1

Edit: consider this a followup to the answer here https://tex.stackexchange.com/a/63847/64528

I'm trying to create a LaTeX/XeTeX template for screenwriting, specifically to output from an Emacs major mode I wrote.

I'd like to define an environment "dialog" that behaves in a rather special way when breaking across pages, i.e. if a page break occurs within the environment text, the paragraph "(MORE)" will be appended at the bottom of the text on the first page, then, on the following page, the character name will be repeated with the string " (CONT'D)" appended.

An approximated example of how this would look:

        BOBBY DARIN
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Donec
hendrerit tempor tellus. Donec
pretium posuere tellus. Proin quam
nisl, tincidunt et, mattis eget,
convallis nec, purus. Cum sociis
natoque penatibus et magnis dis
parturient montes, nascetur
ridiculus mus.
        (MORE)

------------ page break ------------

        BOBBY DARIN (CONT'D)
Nulla posuere. Donec
vitae dolor. Nullam tristique diam
non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam
vestibulum accumsan nisl. Lorem
ipsum dolor sit amet, consectetuer
adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium
posuere tellus. Proin quam nisl,
tincidunt et, mattis eget.

The caveat is, of course, that this is a template, and as such the input remains variable, thus this cannot be split manually.

Just to make matters more difficult, sometimes the initial character name may appear with the " (CONT'D)" string already, e.g. "BOBBY DARIN (CONT'D)", in which case it ought not to be repeated on the second page...

The current environment, which does not attempt to do any of this:

\newenvironment{dialog}[1]{
  \begingroup
  \leftskip=1.5in
  \hspace*{1.2in}\parbox[t]{4in}{#1}
  \parskip=0pt\par\nopagebreak[4]
  \rightskip=2in
}{\par\endgroup}

Does anyone know how to accomplish this?

Some notes:

  • I don't think tables will work, because the "dialog" text would essentially be in a single cell
  • The character name on the second page can't really be in the page header.
rnkn
  • 111

0 Answers0