[XeTeX] Screenplay template

Paul Rankin hello at paulwrankin.com
Sat Oct 18 08:27:59 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?

You time is very much appreciated, thank you :)

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



More information about the XeTeX mailing list