summaryrefslogtreecommitdiff
path: root/macros/scripttex/scrnplay.tex
blob: d9383f3910c05d2301406b09005b15e86f8d7cf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
% ScriptTeX screenplay macros -- typed manuscript version
% Copyright 1991-2002 Adrian McCarthy.  See documentation for re-distribution info.
\def\banner{ScriptTeX 1.04, 10-MAR-2002, typed screenplay format}%version
\immediate\write16{\banner}
%
% These macros will produce a manuscript that looks as though it were typed.
%
% With the fixed pitch font and narrow dialog paragraphs, I've set the
% penalties and such to be extremely tolerant of TeX's concept of badness.
% These are probably more extreme than they have to be, but they can be
% tuned later.
%
\font\mainfont=cmpica % Don Hosek's pica fonts.  Use cmtt12 if not available.
\font\emfont=cmpicati % Change to underlined \mainfont if not available.
\mainfont
\pretolerance=500 % acceptable "badness" before trying to hyphenate
\tolerance=10000  % acceptable "badness" of a line
\linepenalty=0    % penalty for each line in a paragraph
\adjdemerits=0    % demerits for adjacent tight and loose line juxtapositions
\finalhyphendemerits=0 % demerits for hyphenating the penultimate line
\doublehyphendemerits=0 % demerits for hyphenating consecutive lines
\hbadness=10000   % avoid useless underfull hbox messages
%
% General page layout:
%
\newdimen\lineskip \lineskip=12bp % 6 lines per inch
\newdimen\charwid {\setbox0=\hbox{\mainfont M} \global\charwid=\wd0}
\baselineskip=\lineskip  % 2\lineskip for sitcoms
\spaceskip=\charwid   % for true typewriter spacing (redundant in cmtt)
\xspaceskip=2\charwid % for two spaces after a sentence (redundant in cmtt)
\voffset=-4\lineskip % 1 blank line from top
\hoffset=0.5truein   % extra room for hole punch
\vsize=58\lineskip
\hsize=60\charwid
\parindent 0pt
\parskip\baselineskip
\splittopskip=\topskip
\splitmaxdepth=\maxdepth
\newdimen\rightmar
\def\hotzone{8\charwid} % right margin hotzone
\def\margins#1#2{%
  \leftskip=#1
  \rightmar=\hsize \advance\rightmar by -\leftskip \advance\rightmar by -#2
  \rightskip=\rightmar plus \hotzone
}
%
% My first output routine.  Marks have six parts:  act/scene header,
% previous scene continued, dialog continued, \nukeline for (MORE),
% continuing dialog (MORE), \nukeline for continuing scene, and
% continuing scene.  The seventh part is reserved for rev pages.
% I realize that I use \splitbotmark before a \vsplit is ever done, but
% this is correct.  \topmark has the wrong value if I put back lines back
% during the previous \output run.
%
\output={%
  \dimen0=\ht255
  \ifx\LR\empty \else
    \if L\LR \hoffset=0.0truein \global\def\LR{R}
      \else \hoffset=0.5truein \global\def\LR{L}
    \fi
  \fi%x
  \shipout\vbox to 62\lineskip{%
    \boxmaxdepth=\maxdepth%
    \makeheadline%
    \pagebody%
    \makefootline%
  }
  \unvbox255 \penalty\outputpenalty % put back unused text
  \advancepageno
}
\def\makeheadline{%  Act/scene header and page number
  \line{%
    \mainfont%
    \ifcase1\expandafter\relax\splitbotmark\fi%
    \ifnum\pageno>0 \hss \folio\rlap{.}\fi}
  \vskip\lineskip
}
\def\pagebody{%
  \ifcase2\expandafter\relax\splitbotmark\fi   % So-and-so (CONT'D) \nukeline
  \ifcase3\expandafter\relax\botmark\fi        % \nukeline for (MORE)
  \ifcase5\expandafter\relax\botmark\fi        % \nukelines for CONTINUED
  {%
    \vbadness=10000
    \setbox0=\vsplit255 to \dimen0             % split to new height
    \unvbox0                                   % put page into output
  }%
  \ifcase4\expandafter\relax\splitbotmark\fi   % (MORE)
  \ifcase6\expandafter\relax\splitbotmark\fi   %   CONTINUED
  \kern-\dimen0 \vfil % kern keeps \vfil from being discarded
}
\def\makefootline{%
  \vskip\lineskip
  \line{\mainfont \footer}
}
\def\nukeline{%
  \advance\dimen0 by -\lineskip
}
\def\mymark{{
  \header \noexpand\or %
  \contprevscene \noexpand\or %
  \contprevdialog \noexpand\or %
  \contdialoga \noexpand\or %
  \contdialogb \noexpand\or %
  \contscenea \noexpand\or %
  \contsceneb %\noexpand\or
% \contrev
}}
\def\contprevscene{}
\def\contprevdialog{}
\def\contdialoga{}
\def\contdialogb{}
\def\contscenea{}
\def\contsceneb{}
%\def\contrev{}
%
% Revision information
%
\def\titletext{Screenplay}
\def\title#1{\def\titletext{#1}}
\def\seriestext{}
\def\series#1{\def\seriestext{#1}}
\def\authortext{}
\def\author#1{\def\authortext{#1}}
\def\drafttext{}
\def\draft#1{\def\drafttext{\uppercase{#1}}}
\def\basedon#1{\def\basedontext{#1}}
\def\basedontext{}
\def\showcopyright#1{\def\copyrighttext{$\copyright$~#1}}
\def\copyrighttext{}
\def\address#1{\def\addresstext{\vtop{\settabs 1\columns \tabalign #1\cr}}}
\def\\{\cr\tabalign}
\def\addresstext{}
\def\today{%
  \hbox{\number\day-\ifcase\month\or JAN\or FEB\or MAR\or APR\or MAY%
    \or JUN\or JUL\or AUG\or SEP\or OCT\or NOV\or DEC\fi%
    -\number\year}%
}
\edef\datetext{\today}  % \edef for efficiency; it won't change during job
\def\date#1{\def\datetext{#1}}
%
% We count acts and scenes for you.
%
\newcount\actcnt \actcnt=0
\def\currentact{}
\newcount\scenecnt \scenecnt=0
\def\resetscenecnt{\scenecnt=0}
\def\currentscene{}
\def\stdhang{\leavevmode\llap{\number\scenecnt.\ }}
\def\stdhead{\ifx\currentscene\empty \else \number\scenecnt.\fi}
\def\stdfoot{%
  \ifx\seriestext\empty \else
    {\emfont \seriestext} \hss
  \fi%
  ``\titletext'' \hss \drafttext
}
\def\stdxref{%
  \ifx\currentact\empty \else%
    \currentact; %
  \fi%
  \ifx\currentscene\empty \else%
    \currentscene%
  \fi
}
\def\Roman#1{\uppercase\expandafter{\romannumeral#1}}
\def\roman#1{\romannumeral#1}
%
% Keep track of last speaker.
%
\global\def\lastspeaker{}
%
% Variants
%
\def\LR{}
\def\twoside{\def\LR{R}}
\def\jlbrooks{
  \hsize=65\charwid
  \def\hotzone{3\charwid}
  \hfuzz=5\charwid
}
\def\movie{
  \def\resetscenecnt{}
  \def\actheadblock##1{}
  \def\acttailblock{}
  \def\actpgbreak{}
  \def\stdxref{}
}
\def\TV{}
\def\sitcom{\lineskip=24bp}
\def\manuscript{
  \def\header{}
  \def\footer{}
  \def\hangscene{}
  \def\draftblock{}
  \def\stdxref{}
  \def\sound##1{##1}
}
\def\proof{
  \ifx\drafttext\empty \draft{Working Draft}\fi
  \def\header{\stdhead}
  \def\footer{\stdfoot}
  \def\hangscene{\stdhang}
  \def\sound##1{##1}
}
\def\shoot{
  \ifx\drafttext\empty \draft{Shooting Script}\fi
  \def\header{}
  \def\footer{}
  \def\hangscene{\stdhang}
}
%
% Breakdowns (desupported)
%
\def\makecastlist{\immediate\write16{Cast lists no longer supported.}}
\def\collectcast{\immediate\write16{Cast lists no longer supported.}}
\def\makescenelist{\immediate\write16{Scene lists no longer supported.}}
\def\collectscenes{\immediate\write16{Scene lists no longer supported.}}
%
% Make a title page
%
\def\maketitle{%
  \ifx\LR\empty \else \def\LR{R} \fi
  \hbox{}
  \vskip 2in
  \ifx\seriestext\empty \else 
    \centerline{{\emfont \uppercase{\seriestext}}}
    \vskip 3\baselineskip
  \fi
  \centerline{``\uppercase{\titletext}''}
  \vskip\baselineskip
  \ifx\authortext\empty \else
    \centerline{\authortext}
  \fi
  \vskip\baselineskip
  \centerline{\basedontext}
  \vskip 3.5in
  \line{\copyrighttext\hfill\addresstext}
  \vskip 3\baselineskip
  \draftblock
  \pageno=0
  {
    \def\header{}
    \def\footer{}
    \eject
  }
  \pageno=1
}
\def\draftblock{%
  \ifx\drafttext\empty \else
    \rightline{{\emfont \uppercase{\drafttext}}}
  \fi
  \rightline{\datetext}
}
%
% Standard header for acts, tags, and teasers
%
\def\actpgbreak{\vfill \penalty-10000}

\def\actheadblock#1{
  \vskip 2\lineskip
  \centerline{{\emfont \uppercase{#1}}}
  \vskip 4\lineskip
}
\def\acttailblock{
  \vskip 2\lineskip
  {\edef\tempact{end of \currentact}
    \centerline{{\emfont \uppercase\expandafter{\tempact}}}
  }
}
\def\acthead#1{%
  \acttail
  \advance\actcnt by 1
  \resetscenecnt
  \edef\currentact{#1}
  \def\contprevscene{}
  \def\contprevdialog{}
  \def\contdialoga{}
  \def\contdialogb{}
  \def\contscenea{}
  \def\contsceneb{}
  \expandafter\mark\mymark
  \actpgbreak
  \parskip\baselineskip
  \actheadblock{#1}
  \immediate\write16{#1}
}
%
% Standard tail for acts, tags, and teasers
%
\def\acttail{%
  \penalty1000
  \ifx\currentact\empty \else
    \acttailblock
    \def\currentact{}
  \fi
}
%
% Regular script constructs:
%
\def\act{\acthead{Act \ifcase\actcnt\or One\or Two\or Three\or Four\or
     Five\or Six\or Seven\or Eight\or Nine\or Ten\or Eleven\or
     Twelve\or Thirteen\or Fourteen\or Fifteen\or Sixteen\else\Roman\actcnt\fi}
}
\def\teaser{\acthead{Teaser}\actcnt=0}
\def\tag{\acthead{Tag}}
\def\prolog{\acthead{Prolog}\actcnt=0}
\def\epilog{\acthead{Epilog}}
\def\prologue{\acthead{Prologue}\actcnt=0}
\def\epilogue{\acthead{Epilogue}}
\def\theend{
  \def\acttailblock{
    \vskip 2\lineskip
    \centerline{{\emfont THE END}}
  }
}

\def\scene#1{%
  \penalty10000
  \def\contprevscene{}
  \def\contprevdialog{}
  \def\contdialoga{}
  \def\contdialogb{}
  \def\contscenea{}
  \def\contsceneb{}
  \expandafter\mark\mymark
  \penalty-100
  \advance\scenecnt by 1
  \edef\currentscene{Scene \number\scenecnt}
  \parskip\baselineskip
  \margins{0in}{\hsize}
  \leavevmode\hangscene\uppercase{#1}\par
  \def\contprevscene{\hangscene CONTINUED}
  \def\contscenea{\nukeline\nukeline}
  \def\contsceneb{\vskip\lineskip \line{\hskip 40\charwid CONTINUED}}
  \expandafter\mark\mymark
  \global\def\lastspeaker{}
  \penalty1000
}
\def\shot#1{\scene{#1}}

\def\stage{%
  \penalty10000
  \def\contprevdialog{}
  \def\contdialoga{}
  \def\contdialogb{}
  \expandafter\mark\mymark
  \penalty-100
  \margins{0in}{\hsize}
  \parskip\baselineskip
}

\def\trans#1{%
  \def\contprevdialog{}
  \def\contdialoga{}
  \def\contdialogb{}
  \expandafter\mark\mymark
  \parskip\baselineskip
  \penalty100
  {\margins{40\charwid}{20\charwid} \uppercase{#1} \par}
  \penalty-100
}

\def\open#1{%
  \def\contprevscene{}
  \def\contprevdialog{}
  \def\contdialoga{}
  \def\contdialogb{}
  \def\contscenea{}
  \def\contsceneb{}
  \expandafter\mark\mymark
  \parskip\baselineskip
  {\margins{0in}{\hsize} \uppercase{#1} \par}
}

\def\close#1{\open{#1}}

\def\dialog#1#2\par{%
  \penalty10000 % make sure we don't break until after the clear mark
  \def\contprevdialog{}
  \def\contdialoga{}
  \def\contdialogb{}
  \expandafter\mark\mymark
  \penalty-100 % OK to break now
  \parskip\lineskip
  {\margins{24\charwid}{36\charwid} \uppercase{#1}%
    \global\def\thisspeaker{#1}%
    \ifx\thisspeaker\lastspeaker \ (CONT'D)\fi
    \global\def\lastspeaker{#1}
  \par}
  \parskip 0pt
  \def\contprevdialog{%
    \nukeline%
    \line{\hskip 24\charwid \uppercase{#1} (CONT'D)}%
  }
  \def\contdialoga{\nukeline}
  \def\contdialogb{\line{\hskip 24\charwid (MORE)}}
  \expandafter\mark\mymark
  \margins{10\charwid}{35\charwid} % rightmar = \hsize-\leftskip-35\charwid
  \penalty10000
  #2\par
  \stage
}

\def\paren#1#2\par{%
  \par
  \penalty10000
  {%
    \margins{17\charwid}{20\charwid} % rightmar = \hsize-\leftskip-20\charwid
    (#1)%
    \par%
  }
  \penalty10000
  #2\par
  \stage
}

\def\leadin#1{#1~\ldots\par\penalty200}  % These are more exciting in the
\def\pickup{\ldots~}                     % stageplay format.

\def\em#1{{\emfont #1}}
\def\extra#1{\uppercase\expandafter{#1}}
\def\introduce#1{\uppercase\expandafter{#1}}
\def\sound#1{\uppercase{#1}}
\def\ldots{.~.~.}  % Formal typing version.  OK to use "..."

\def\cleanup{%
  \par
  \acttail
  \def\contdialoga{}
  \def\contdialogb{}
  \def\contscenea{}
  \def\contsceneb{}
  \expandafter\mark\mymark
  \vfill
  \penalty-10000
}
\def\bye{%
  \cleanup
  \end
}
%
% Shortcuts:
%
\def\beat{\paren{beat}}
\def\cut{\trans{cut to}}
\let\dialogue=\dialog
\def\dissolve{\trans{dissolve to}}
\def\ext#1{\scene{ext.\ #1}}
\def\fadein{\open{fade in}}
\def\fadeout{\close{fade out}}
\def\int#1{\scene{int.\ #1}}
\def\os{\paren{off screen}}
\let\shot=\scene
\let\tv=\TV
\def\vo{\paren{voice over}}
%
% Defaults
%
\TV\proof