[texhax] [gmane.comp.tex.xetex] Screenplay template

Paul Rankin hello at paulwrankin.com
Wed Oct 22 14:17:58 CEST 2014


Hello!

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 text contained therein, 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:

--8<---------------cut here---------------start------------->8---

\newenvironment*{dialog}[2][]{
  \leftskip=1in\rightskip=2in{
    \hspace*{1.2in}\parbox[t]{4in}{#2}\\*
    \raggedright#1}}

--8<---------------cut here---------------end--------------->8---

Does anyone know how to accomplish this? I found the following on the
TeX Stack Exchange, but don't really know how to decipher for my
purposes: http://tex.stackexchange.com/a/63847/64528

You time is very much appreciated, thank you :)

-- 
Paul W. Rankin
http://www.paulwrankin.com


More information about the texhax mailing list