5

I am typesetting a novel in ConTeXt and I need a way to correctly typeset scenes. A scene in my novel is just a sequence of paragraphs separated from the previous one by two blank lines (though in the future, I may modify the command which typesets the scene to print some character).

I have two doubts which can't solve with my still limited knowledge:

  • Some scenes also change the setting and I need a way to typeset an additional line with the description of the scene, as well as an additional blank line after it

A normal scene:

Text of a previous scene

Two blank lines

Text of next scene

A scene with a setting change:

Text of a previous scene

Two blank lines

Location of the new scene

One blank line

Text of new scene

  • In addition to this, the new command for the scene (or the redefined command) would ideally number the scenes in the background, so that I can generate a table of contents for my perusal while writing. In order to really this to be useful, I would like to know if there is any way in ConTeXt to define a value associated to the scene which would only show in such a table of contents.

I envision it to be roughly like this:

\scene  [description=A new exciting scene]
\scene  [description=Another great scene][setting=With a change of setting]

The first example will only print two blank lines, the description being used for the scene table of contents, while the second example will also print the additional line with the setting and a blank one after it. I'm being extremely liberal with the syntax.

Of course, the command could be a redefinition of any existing sectioning command and not be named \scene but \subject.


Following the advice given to me, I have arrived at the following sample code, but I have found a problem: scenes without description insert more than two lines of vertical space.

\setuppapersize[A5]

\setupindenting[always,small,first]

\definehead[scene][section]

\define\PlaceLocation
      {\framed[frame=off,width=broad,align=flushright,style=slanted]
      {\doifsomething{\structureuservariable{location}}
        {\italic{\structureuservariable{location}}\blank[fixed,line]}}}

\setuphead
  [scene]
  [
    style=slanted,
    align=flushright,
    placehead=empty,
    command=\undefined,
    number=no,
    before={\blank[fixed,line]},
    after={\blank[fixed,line]},
    insidesection={\PlaceLocation}
  ]

\starttext

\startchapter[title=Dead Man Creek]

\startscene
    [title={Arrival at Dead Man Creek}]
    [location={Southern Indiana, United States\\March 1948}]

The Jeep was moving along a dirt road, covered here and there by a thick undergrowth, which made obvious that the path had seen little use for a long time. Flanked on both sides by a dense grove, whose branches were growing upward to form a sort of roofing, the silence in that place only  broken by the noise of the vehicle motor.

\stopscene

\startscene
    [title={Flashback: At Tony Smith's house}]
    
    “Winters has been very kind lending me his personal notes… Well, he has been very kind letting me participate in his investigation, for starters.”

Karl Jegger was holding his pipe as he spoke, looking thoughtfully at the smoke coming from it while sitting in a comfortable armchair facing a window that offered a beautiful view of Fifth Avenue in New York. Beside him, in an identical armchair and enjoying a liquor that Karl had brought to him from Switzerland, was his cousin Tony Smith. Although     Karl was talking to him as he spoke, it was clear he was talking more to himself.
\stopscene

\stopchapter

\stoptext
3
  • Untested: Does adding a comma after \insidesection={\PlaceLocation} fix the spacing issue? Sorry, that was a typo in my code as well.
    – Aditya
    Jan 30, 2015 at 16:23
  • See my updated answer.
    – Aditya
    Feb 2, 2015 at 5:25
  • I have tested your updated answer and I am very happy with it, thank you very much. I will write an article once I typeset my novel, so that others can benefit from my mistakes and your insight. Just for testing, I have removed the \startchapter and \endchapter marks and still find that the Scene location is being printed with some extra vertical space... Is that because of the framed environment for the scene location? May be because I force a break just after the location and before the date?
    – J.A. Rubio
    Feb 5, 2015 at 13:45

1 Answer 1

4

One possible solution is to simply use the default head mechanism. Define a new head scene that has the right properties:

\setuppapersize[A5]
\setupindenting[always,small,first]

\definehead[scene][section]

\defineframed
    [locationframed]
    [
      frame=off,
      width=broad,
      align=flushright,
      foregroundstyle=italic,
    ]

\define\PlaceLocation
      {\doifsomethingelse{\structureuservariable{location}}
          {\doPlaceLocation}
          {\noPlaceLocation}}


\define\doPlaceLocation
      {\blank[line]%
       \locationframed{\structureuservariable{location}}%
       \blank[line]}

\define\noPlaceLocation{\blank[2*line]}

\setuphead
  [scene]
  [
    style=slanted,
    align=flushright,
    placehead=empty,
    number=no,
    before=,
    after=,
    insidesection={\PlaceLocation},
  ]

\setuphead
  [chapter]
  [
    after=,
  ]

\showgrid % To help with visual debugging

\starttext

\startchapter[title=Dead Man Creek]

\startscene
    [title={Arrival at Dead Man Creek}]
    [location={Southern Indiana, United States\\ March 1948}]

The Jeep was moving along a dirt road, covered here and there by a thick undergrowth, which made obvious that the path had seen little use for a long time. Flanked on both sides by a dense grove, whose branches were growing upward to form a sort of roofing, the silence in that place only  broken by the noise of the vehicle motor.

\stopscene

\startscene
    [title={Flashback: At Tony Smith's house}]

    “Winters has been very kind lending me his personal notes… Well, he has been very kind letting me participate in his investigation, for starters.”

Karl Jegger was holding his pipe as he spoke, looking thoughtfully at the smoke coming from it while sitting in a comfortable armchair facing a window that offered a beautiful view of Fifth Avenue in New York. Beside him, in an identical armchair and enjoying a liquor that Karl had brought to him from Switzerland, was his cousin Tony Smith. Although     Karl was talking to him as he spoke, it was clear he was talking more to himself.
\stopscene

which gives:

enter image description here

A couple of notes:

  • I used \showgrid for ease of visual debugging.
  • The reason you were seeing large spaces is because a chapter also adds vertical space. If a chapter is always going to be followed by a scene, then you can remove the vertical space by using after= (as I have done); if not some other trickery will be needed. Normally, ConTeXt collapses multiple spaces, but if you need table of contents, then an achor needs to be placed on the page. Therefore what you get is

    Chapter title
    blank of chapter
    anchor for scene
    blank before location
    

    The anchor does not take any vertical space, but prevents the blank before location from seeing the blank after chapter. Hence the double space.

  • Although it does not make a difference in this setup, you should also be aware of the fact that using a frame at the beginning of a line puts it in the vertical mode rather than the horizontal mode. You can force the frame to remain in horizontal mode by adding a \dontleavehmode before it. Also see the ConTeXt FAQ.
6
  • This is exactly what I was looking for! Did not think about using user variables and the \doifsomething command... I guess I'm still too new to ConTeXt, thanks!
    – J.A. Rubio
    Jan 9, 2015 at 10:14
  • I have been working on this and have found two problems: *I don't seem to be able to make the location text slanted *In scenes without location, it leaves too much space, not just the two lines it should. Would be possible to attach a minimal example?
    – J.A. Rubio
    Jan 28, 2015 at 15:36
  • @J.A.Rubio: (Untested) Try changing \blank[line] to \blank[fixed,line]. Normally, there is some glue associated with all vertical spaces. The keyword fixed kills that glue. To change the scene location italic, use \italic{\structureuservariable{...}{...}}. If these don't work, please post a new question with an example.
    – Aditya
    Jan 28, 2015 at 15:43
  • Using the keyword \italic has worked, though it seems to add a bit of vertical spacing... kinda weird. Sadly, my other problem with too much vertical spacing between scenos with no location persists. Posting another question would be counter productive, isn't it? I would rathe prefer to keep the discussion here, so that all would be contained in a single post. Do you think there would be any problem if I edit the original question with a minimal example?
    – J.A. Rubio
    Jan 28, 2015 at 16:02
  • @J.A.Rubio: I am not sure what is the correct protocol on the site. Add additional info in your question with a minimal example.
    – Aditya
    Jan 28, 2015 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .