[XeTeX] Screenplay template

Zdenek Wagner zdenek.wagner at gmail.com
Sat Oct 18 16:06:01 CEST 2014


2014-10-18 8:27 GMT+02:00 Paul Rankin <hello at paulwrankin.com>:
> Hello!
>
Hello,

I do not have time to give you a solution but I can just assist you in
looking at the right direction. This is a task for marks. Your
environment should set the mark either by \markright or by \markboth.
Next you have to modify the definition of the page style so that the
marks are used. I am not sure whether LaTeX macros can directly be
used, maybe you would have to use directly plain TeX \topmark or
\botmark or \firstmark. \markboth and \markright put two texts to a
single mark, you can use \@firstoftwo and \@secondoftwo (I hope I
remember the names well) for extraction of the required text.

> 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
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex



-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



More information about the XeTeX mailing list