2

As you can see in the following code, I have a chapter definition which is always followed by one or several scenes. The heading of the scenes does not show any title, but instead two blank lines (the title will be shown in a table of contents).

I have created a paragraph definition which typesets the location of the scene, to use it each time a scene changes location. I wish to leave a blank space between the paragraph and the text of the scene, but I have been unable to do so.

\setuppapersize[A5]

% Chapters
\define[2]\CustomChapter{\dontleavehmode\framed[frame=on,width=broad,align=middle]{#1.\\#2}}

\setuphead [chapter]
           [after=,
            before={\blank[force,line]},
            command=\CustomChapter]

% Scenes
\definehead[scene][section]

\setuphead
  [scene]
  [placehead=empty,
   number=no,
   before=,
   after=,
   insidesection={\blank[2*line]}
  ]

% Location
\startsetups[paragraph:location]
  \setupalign[flushright]
\stopsetups

\defineparagraph
  [location]
  [style=italic,
   after={\blank[line]},
   setups=paragraph:location]

\showgrid

\starttext

\startchapter[title={One}]

\startscene[title={Karl llega a Dead Man Creek}]

\startparagraph[location]
South of Indiana, United States

March 1948

\stopparagraph

This is Chapter One, and you should see one line between the location and this text.

Each scene typesets two blank lines in its inside section.
\stopscene

\stopchapter

\startchapter[title={Two}]
\startscene[title={This is a scene}]
This is Chapter Two, and this scene typesets, again, two lines in its inside section.
\stopscene
\stopchapter

\stoptext
5
  • A full MWE needs the \documentclass etc. (you have no idea how many packages one would have to try to find the right ones). I take it \medskip didn't work? Nov 4, 2015 at 18:46
  • 3
    @JohnKormylo The document is a MWE; it is in ConTeXt, not LaTeX.
    – egreg
    Nov 4, 2015 at 23:28
  • Indeed, it is a ConTeXt MWE, I should have mentioned it in the question, although I have tagget it as such, the tags are not enough.
    – J.A. Rubio
    Nov 5, 2015 at 7:02
  • paragraph environments do not use before and after keys. They are primarily meant to tag paragraphs for XML/XHTML export. If you need something to alter the display, why not use framedtext (that has the advantage of not splitting across pages?
    – Aditya
    Nov 6, 2015 at 0:58
  • I am going to try framedtext. I was also considering writing my own command for typesetting the location, but framedtext seems to fit the bill perfectly.
    – J.A. Rubio
    Nov 9, 2015 at 7:44

1 Answer 1

0

You're better off using simply \definestartstop. Paragraphs don't seem to be the right tool for what you are doing. Basically you can use a custom start-stop as a drop-in replacement with the benefit that the after value works.

\definestartstop
  [location]
  [style=italic,
   after={\blank[line]},
   setups=paragraph:location]
\prependvalue{stoplocation}{\par}

The last line also smuggles a \par before \stoplocation so you can omit the extra blank line after March 1948. I've also modified your document to adhere a little better to “the ConTeXt way”.

\setuppapersize[A5]

% Chapters
\starttexdefinition unexpanded CustomChapter #1#2
  \dontleavehmode
  \startframed[frame=on,width=broad,align=middle]
    #1.\\#2
  \stopframed
\stoptexdefinition

\setuphead
  [chapter]
  [after=,
   before={\blank[force,line]},
   command=\CustomChapter]

% Scenes
\definehead
  [scene]
  [section]
  [placehead=empty,
   number=no,
   before=,
   after=,
   insidesection={\blank[2*line]}]

% Location
\startsetups[paragraph:location]
  \setupalign[flushright]
\stopsetups

\definestartstop
  [location]
  [style=italic,
   after={\blank[line]},
   setups=paragraph:location]
\prependvalue{stoplocation}{\par}

\showgrid

\starttext

\startchapter[title={One}]

  \startscene[title={Karl llega a Dead Man Creek}]

    \startlocation
      South of Indiana, United States

      March 1948
    \stoplocation

    This is Chapter One, and you should see one line between the location and this text.

    Each scene typesets two blank lines in its inside section.
  \stopscene

\stopchapter

\startchapter[title={Two}]
  \startscene[title={This is a scene}]
    This is Chapter Two, and this scene typesets, again, two lines in its inside section.
  \stopscene
\stopchapter

\stoptext

You must log in to answer this question.

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