Debian Codegraph @

texmf-dist/doc/latex/thalie/thalie.tex

raw
1 \documentclass[
2 load-preamble-,
3 babel-options=english,
4 add-index=true,
5 ]{cnltx-doc}
6
7 \usepackage{thalie}
8
9 \usepackage{emoji}
10 \setcnltx{
11 name = thalie,
12 title = {\emoji{performing-arts} Thalie},
13 version = v0.13a,
14 date = 2022-12-11,
15 info = A \LaTeX{} package to typeset drama plays,
16 authors = Louis Paternault ,
17 email = spalax(at)gresille(dot)org ,
18 url = https://framagit.org/spalax/thalie ,
19 abstract = {%
20 This package is meant to typeset drama plays using \LaTeX{}. It provides commands to introduce characters' lines, to render stage direction, to divide a play into acts and scenes, to automatically build the dramatis person\ae{}, etc.
21 } ,
22 add-cmds = {
23 act,
24 actname,
25 adjustverse,
26 character,
27 characterspace,
28 customact,
29 customplay,
30 customscene,
31 did,
32 disposablecharacter,
33 dramatiscast
34 dramatischaracter,
35 dramatischaractercast,
36 dramatischaracterdescription,
37 dramatischaractername,
38 pauseverse,
39 play,
40 playname,
41 resumeverse,
42 scene,
43 scenename,
44 setcharactername,
45 setthalieoptions,
46 speakswithdirection,
47 speakswithoutdirection,
48 theact,
49 theplay,
50 thescene,
51 },
52 add-envs = {
53 castgroup,
54 charactergroup,
55 dida,
56 dramatis,
57 dramatischaractercastgroup,
58 dramatischaractergroup,
59 dramatisenv,
60 },
61 add-silent-cmds = {
62 enquote,
63 },
64 add-sourcecode-options = {
65 numbers = none,
66 },
67 }
68
69 \usepackage{tabularray}
70 \UseTblrLibrary{booktabs}
71 \usepackage{booktabs}
72 \usepackage[nospace]{varioref}
73 \usepackage[autostyle=true]{csquotes}
74 \usepackage{graphicx}
75 \usepackage{markdown}
76
77 \usepackage{polyglossia}
78 \setmainlanguage{english}
79 \setotherlanguages{french,greek}
80 \newfontfamily\greekfont[Script=Greek]{Linux Libertine O}
81
82 \newcommand{\bbackslash}{\symbol{92}}
83 \usepackage{manfnt}
84 \newcommand{\danger}{\marginpar[\hfill\dbend]{\dbend\hfill}}
85
86 \setcounter{tocdepth}{2}
87
88 \begin{document}
89
90 This document introduces the \textsf{thalie} package, used to typeset drama plays.
91
92 \part{Introduction}
93
94 \section{About \pkg*{thalie}}
95
96 \subsection{Why Thalie?}
97
98 \enquote{\textfrench{Thalie}} is the French translation of \enquote{Thalia} (\enquote{\textgreek{Θάλεια}} in Greek), the Muse of comedy and idyllic poetry\footnote{More information : \url{https://fr.wikipedia.org/wiki/Thalie_(Muse)}.}. It seems an appropriate name for a tool dedicated to help writing drama.
99
100 \subsection{Other classes and packages}
101 This package is far from being the only one that can be used to render drama
102 plays. If you do not like my work, you can use one of the following ones (and
103 I guess there exists others):
104 \pkg{drama} \cite{drama},
105 \pkg{dramatist} \cite{dramatist},
106 \pkg{play} \cite{play},
107 \pkg{screenplay} \cite{screenplay},
108 \pkg{sides} \cite{sides}.
109
110 I began to write this package in 2010, and now, at the end of 2012, I must admit that I wonder why I started this…
111 There are already several such packages in \ctan\footnote{\url{http://www.ctan.org/topic/drama-script}}, and the \pkg{dramatist} package seems really nice (I borrowed some ideas and copied some code from it).
112 There are actually a few improvements in my package compared to \pkg{dramatist}:
113 in my package, plays, acts and scenes appear in the table of contents;
114 it is possible to include several plays in a single document;
115 there are more options when building the dramatis person\ae{};
116 headers and footers are taken into account, etc.
117 But these improvements are small; it might have been smarter to contribute to \pkg{dramatist} instead of starting my own package.
118 The good part is that I have a package that fits my needs, and I learned how to write a \LaTeX{} package.
119
120 Oh, yes! I know why I started this: I am a geek…
121
122 \subsection{License}
123 This work may be distributed and/or modified under the conditions of the \LPPL,
124 either version 1.3 of this license or (at your option) any later version.
125
126 Further information can be found in the \texttt{.dtx} file used to build this document.
127
128 In short (but this paragraph has no legal value), you can use this package freely to render your drama plays, and modify it almost freely.
129 Nevertheless, if you like my work, you can invite me to the performance of the play you typeset using my package\footnote{You will not take a big risk, since there is little chance I travel half the world to see a play. But if by chance I can attend it, it would make me really happy.}.
130
131 \subsection{Acknowledgements}
132 I borrowed ideas and lines of code from the \LaTeX{} packages \pkg{drama}\cite{drama} and \pkg{dramatist}\cite{dramatist}.
133
134 I used the following guides to package my package: \emph{How to Package Your \LaTeX{} Package} \cite{dtxtut}, and \emph{\LaTeXe{} for class and package writers} \cite{clsguide}.
135
136 \section{About this documentation}
137
138 \subsection{Examples}
139
140 Most of the examples are taken from
141 Edmond Rostand's \textfrench{\emph{Cyrano de Bergerac}} \cite{cyrano},
142 Jean Giraudoux's \textfrench{\emph{Électre}} \cite{electre},
143 or William Shakespeare's \emph{A Midsummer Night's Dream} \cite{midsummer}.
144
145 \subsection{Overview}
146 Installation instruction are given in section \ref{sec:install}.
147 Documentation about how to use this package is given in section
148 \ref{sec:usage}. In particular, section \ref{sec:sectioning} explains how to
149 use acts and scenes, sections \ref{sec:dramatis} and \ref{sec:characters} explains how to define
150 characters, and use these definitions to introduce characters' lines, and
151 section \ref{sec:directions} describes commands used to render stage
152 directions. At last, specific instruction about how to use this package with
153 a language other than English (or a non-latin alphabet) are given in section
154 \ref{sec:i18n}. Examples are given in section \ref{sec:examples}.
155
156 \section{Download and Install}
157 \label{sec:install}
158
159
160 \subsection{\textsc{Gnu}/Linux Distribution}
161
162 If applicable, the easiest way to get \pkg{thalie} working is by installing it by your distribution package. With Debian (and Ubuntu, and surely other distributions that inherit from Debian), simply run:
163
164 \begin{sourcecode}[add-sourcecode-options={language=bash}]
165 sudo apt-get install texlive-humanities
166 \end{sourcecode}
167
168 \subsection{\LaTeX{} distribution}
169
170 This package is included both in \TeX{}Live and MiK\TeX{}. It can be installed by their respective package managers.
171
172 \subsection{Manual installation}
173
174 \begin{itemize}
175 \item Download the lastest archive :
176 \begin{description}
177 \item[Stable version] \url{http://mirrors.ctan.org/install/macros/latex/contrib/thalie.tds.zip}
178 \item[Development version] \url{https://framagit.org/spalax/thalie/repository/archive.zip?ref=main}
179 \end{description}
180 \item Unzip the archive.
181 \item Move file \texttt{tex/latex/thalie/thalie.sty} (or simply \texttt{thalie.sty} if you got the development version) in a \LaTeX{} path.
182 \end{itemize}
183
184 \part{Usage}
185 \label{sec:usage}
186
187 \section{Package options}
188 \label{sec:options}
189
190 Note that any package option can be redefined anywhere in the document: the options given to \cs*{usepackage}\oarg{options}\marg{thalie} as passed as-is to command \cs*{setthalieoptions} (see section \vref{sec:redefine}).
191 This makes it possible to have several plays collected in a single document, while applying different styles or options to each play.
192
193 \subsection{Space following character commands and stage directions}
194 \begin{options}
195 \keybool{xspace}
196 \label{option:xspace}
197 \sinceversion{v0.7} % Add package option \code{xspace}.
198 As commands introducing characters' lines and displaying characters' names may be frequently used, it might be tempting to omit the following \code{\{\}}. For instance, one might prefer to write:
199
200 \begin{sourcecode}[add-silent-cmds={lebret,cyranoname}]
201 \lebret \cyranoname n'est pas là.
202 \end{sourcecode}
203
204 instead of:
205
206 \begin{sourcecode}[add-silent-cmds={lebret,cyranoname}]
207 \lebret \cyranoname{} n'est pas là.
208 \end{sourcecode}
209
210 If package option \option{xspace} is set (e.g. \keyis{xspace}{true}), space is automatically added after those commands if necessary\footnote{This is done with the \cs*{xspace} command (from the \pkg{xspace} package), hence the name.};
211 otherwise, it is not.
212 The same rule applies after a \cs{did} command.
213
214 For historical reasons, the option \option{xspace} default is \keyis{xspace}{true}, but this might change in some later non-backward compatible version.
215 \end{options}
216
217 \subsection{Style}
218
219 The way characters' lines are displayed, as well as play, act and scene titles, can be set when loading the options.
220
221 \begin{options}
222 \keychoice{characterstyle}{bold,margin,center,\default{simple},arden,imprimerie-verse,imprimerie-prose}
223 Set character style. Available styles, and indication to use a custom one, are described in section \vref{sec:lines}.
224
225 \keychoice{playstyle}{center,bigcenter,\default{box},custom}
226 Set play style. Available styles, and indication to use a custom one, are described in section \vref{sec:sectionstyles}.
227
228 \keychoice{actstyle}{center,\default{bigcenter},box,custom}
229 Set act style. Available styles, and indication to use a custom one, are described in section \ref{sec:sectionstyles}.
230
231 \keychoice{scenestyle}{\default{center},bigcenter,box,custom}
232 Set scene style. Available styles, and indication to use a custom one, are described in section \ref{sec:sectionstyles}.
233 \end{options}
234
235
236 \subsection{Sectioning levels}
237
238 If you use a table of contents, or if you also use \enquote{usual} sectioning commands (\cs{chapter}, \cs{section} and so on), the relative importance of plays, acts and scenes is important.
239
240 \begin{options}
241 \keychoice{playlevel}{part,\default{chapter},section,subsection,subsubsection,paragraph,subparagraph}
242 Set play level in the table of contents.
243
244 \keychoice{actlevel}{part,chapter,\default{section},subsection,subsubsection,paragraph,subparagraph}
245 Set act level in the table of contents.
246
247 \keychoice{scenelevel}{part,chapter,section,\default{subsection},subsubsection,paragraph,subparagraph}
248 Set scene level in the table of contents.
249
250 \keychoice{interludelevel}{play,\default{act},scene}
251 Setting the interlude level is slightly different. When setting it using \key{interludelevel}{level}, instead of choosing one of \LaTeX{} vanilla sectioning levels as the level, you may choose one of \choices{play,\default{act},scene}. It defines if an interlude is at the same level as a play, an act or a scene.
252 \end{options}
253
254 \subsection{Redefining options}
255 \label{sec:redefine}
256 \sinceversion{v0.9a} % New command \cs{setthalieoptions}.
257
258 \begin{commands}
259 \command{setthalieoptions}[\marg{package options}]
260 Packages options can be reset in the document body using this command.
261 Its only argument has the same syntax as the package options (see section \vref{sec:options}).
262
263 For instance, if you are writing a collections of plays, some in prose, some in verses, you might want to write something like the following.
264
265 \begin{sourcecode}
266 \documentclass{book}
267 \usepackage{thalie}
268 \begin{document}
269
270 \play{First play}
271 \setthalieoptions{characterstyle=imprimerie-verse}
272 ...
273
274 \play{Second play}
275 \setthalieoptions{characterstyle=impriemie-prose}
276 ...
277
278 \end{document}
279 \end{sourcecode}
280 \end{commands}
281
282 \section{Commands and Environments}
283
284 \subsection{Sectioning}
285 \label{sec:sectioning}
286 Here begin the parts explicitly relating to drama.
287
288 \subsubsection{Levels}
289
290 To introduce a new play, act or scene, use commands \cs{play}, \cs{act} and \cs{scene}.
291 Their behaviour is as close as the \enquote{usual} sectioning commands (\cs{chapter}, \cs{section} and so on) as possible, i.e.:
292
293 \begin{itemize}
294 \item Their signature is \cs{play}\oarg{short title}\marg{longtitle} (the optional short title is the one used in the table of content, and in headers and footers).
295 \item A starred version (\cs{play}\sarg, \cs{act}\sarg{} and \cs{scene}\sarg) is provided, which inserts a play (or act, or scene) which is not numbered, and does not insert any line in the table of content.
296 \item Headers and footers are changed (more information in section \vref{sec:header}).
297 \end{itemize}
298
299 Both commands \cs{act} and \cs{scene} (and their starred versions) are designed to
300 deal with empty titles. Indeed, it is common not to give any name to acts and
301 scenes.
302
303 By default, a play is as deep (regarding to the table of contents) as a
304 chapter, an act as a section, and a scene as a subsection. But this can be
305 set using package options \option{playlevel}, \option{actlevel} and \option{scenelevel} (see
306 packages options, page \pageref{sec:options}). That way, you can use in your
307 document plays, acts and scenes as well as chapters, sections and so on. It
308 can be useful if you want a foreword, and appendix, etc.
309
310 It is not compulsory to use all three commands \cs{play}, \cs{act} and \cs{scene}.
311 The rule of thumb is: if only one element exists, skip the corresponding
312 command: if your document has a single play, you should ignore \cs{play}; if
313 your document has several single act plays, set
314 \keyis{playlevel}{section}, \keyis{scenelevel}{subsection}, and ignore \cs{act}; etc.
315
316 \begin{commands}
317 \command{play}[\oarg{short title}\marg{long title}]
318 Start a new play (see above).
319
320 \command{act}[\oarg{short title}\marg{long title}]
321 Start a new act (see above).
322
323 \command{scene}[\oarg{short title}\marg{long title}]
324 Start a new scene (see above).
325
326 \command{interlude}[\sarg\oarg{short title}\marg{long title}]
327 Insert an interlude, which is an act or a scene which is not numbered, but which should appear in the table of content (unless the starred version is used).
328
329 You may choose the sectioning level an interlude is equivalent to in the package options.
330 If your interludes are acts, use \keyis{interludelevel}{act};
331 if they are scenes, use \keyis{interludelevel}{scene}.
332
333 \command{curtain}
334 At last, to mark the end of an act or of the play, you can use command \cs{curtain}, which prints the word \cs{GetTranslation}\Marg{Curtain} in the middle of its own line.
335 \end{commands}
336
337 \subsubsection{Title styles}
338 \label{sec:sectionstyles}
339
340 Several styles are available to render play, act and scene titles. Choose them using package options \option{playstyle}, \option{actstyle}, and \option{scenestyle}.
341 Default is \keyis{playstyle}{box}, \keyis{actstyle}{bigcenter}, \keyis{scenestyle}{center}.
342
343 \paragraph{Custom titles}
344 Unfortunately, as play, act and scene titles are not considered (by \LaTeX{}) as usual sections, package \pkg{titlesec}\footnote{\url{http://www.ctan.org/pkg/titlesec}} cannot be used to use alternative section titles.
345 Here is the way to set your own one.
346
347 When loading the package, use \keyis{actstyle}{custom} as the style of the title you want to customize.
348 Then, commands \cs{customact}\marg{counter}\marg{title} and \cs{customact}\sarg\marg{title} will be called by this package to render titles.
349 You \emph{must} define them.
350 Example \vref{ex:custom} gives the example of the definition of the \code{center} style.
351
352 The first argument of \cs{customact} is the label of the act being printed
353 (that is, \cs{theact} for an act, \cs{theplay} for a play, etc.),
354 its second argument is its title.
355 Command \cs{customact}\sarg{} only has one argument, which is the act title.
356
357 \subsubsection{Labels and counters}
358
359 Using the same tools as \cs{chapter}, \cs{section} and so on, it is possible to
360 define the way counters of plays, acts and scenes are displayed. You can do
361 this by redefining \cs{theplay}, \cs{theact} and \cs{thescene}. For example, to
362 have acts numbered using letters, use: \verbcode|\renewcommand{\theact}{\Alph{act}}|.
363
364 \subsubsection{Headers and footers}
365 \label{sec:header}
366
367 Once again, similar tools as those used by \cs{section} are provided to deal with headers and footers. When introducing, a new play, act or scene, respectively, commands \cs{playmark}\marg{label}, \cs{actmark}\marg{label} and \cs{scenemark}\marg{label} are called, so that titles can be used in headers and footers.
368 If the default behaviour does not suit you (which should be the case if you did not choose the default option for \option{playlevel}, \option{actlevel} or \option{scenelevel}), you can redefine them.
369
370 Examples are given in section \vref{sec:examples:headers}.
371
372 \subsection{Dramatis person\ae}
373 \label{sec:dramatis}
374 This part explains how to build and display the dramatis person\ae{}.
375
376 Definition of characters is done in document body.
377 As it is possible to have several plays in a single documents (for a
378 collection of plays or sketches), it is possible to define several
379 dramatis person\ae{}. A new one disables the character commands
380 defined by the previous one.
381
382 \begin{environments}
383 \environment{dramatis}[\Oarg{\choicekey{hidden}{yes,\default{no}}, \key{defaultcast}{}}]
384 Definition of characters is done inside the \env{dramatis} environment.
385
386 The following options can be set.
387
388 \begin{options}
389 \keychoice{hidden}{true,\default{false}}
390 If the \option{hidden} option is set to \code{true} (or given without any argument), the dramatis person\ae{} is not printed (its only purpose is then to define the character commands). Default value is \code{false} (that is: dramatis person\ae{} is not hidden).
391
392 \meta{defaultcast}{default}\Default
393 \sinceversion{v0.13a} % New option \option{defaultcast}.
394 Default value of the \option{cast} option of command \cs{character} (see section \vref{sec:cast}).
395 \end{options}
396 \end{environments}
397
398
399 Then, several commands are available to define characters, and organize
400 character definitions.
401
402 \subsubsection{Character definition}
403 \paragraph{Basic definition}
404 \label{sec:basiccharacter}
405
406 To define a character, use command \cs{character}.
407
408 \begin{commands}
409 \command{character}[\Oarg{\key{cmd}{command}, \key{drama}{dramatis}, \key{desc}{description}, \key{cast}{cast}}\marg{name}]
410
411 \begin{options}
412 \opt{name}
413 The mandatory argument is the name of the character, as it will appear to introduce each of their line. It is later possible to redefine it using command \cs{setcharactername} (see part \vref{setcharactername}). Optional arguments are:
414 \keyval{desc}{description}
415 Description of the character, displayed in the dramatis person\ae{}.
416 \keyval{cmd}{command}
417 Name of the control sequence that will be used to introduce this character's lines in the remaining part of your play.
418 \keyval{drama}{dramatis}
419 Name of the character, as it will appear in the dramatis person\ae{}. The name of the character (mandatory argument) is used as a default value.
420 \keyval{cast}{cast}
421 Name of the actor or actress playing this character, displayed in the dramatis person\ae{}. More information in section \vref{sec:cast}.
422 \end{options}
423 \end{commands}
424
425 If \option{cmd} is defined, this command creates two new commands: \cs*{\meta{cmd}} and \cs*{\meta{cmd}name}.
426 The first one is used to introduce a character's line.
427 The second one prints the character's name.
428 An error is raised if a command with any of these two names already exists.
429
430 An example of the use of this command is given in section \vref{sec:character_example}.
431
432 \paragraph{Special character definition}
433
434 Although optional arguments are not mandatory, not defining them, or leaving the mandatory argument blank, have special meaning. The combination are summed up in the following table, where a cross \(\times\) means that the corresponding combination is forbidden. The superscript number refers to the list of special character definitions (right after the table).
435
436 \begin{center}
437 \begin{tblr}{rr*{4}{X[co=1,c,m]}}
438 \toprule
439 && \SetCell[c=2]{c} empty \option{name} && \SetCell[c=2]{c} \option{name} \\
440 && no \option{cmd} & \option{cmd} & no \option{cmd} & \option{cmd} \\
441 \midrule
442 \SetCell[r=2]{r} no \option{drama} & no \option{desc} & \(\times\) & \(\times\) &\(\times\) & default\textsuperscript{\ref{character:default}} \\
443 \cmidrule{2-6}
444 & \option{desc} & {description\\ only\textsuperscript{\ref{character:description}}} & \(\times\) & \(\times\)& default\textsuperscript{\ref{character:default}} \\
445 \midrule
446 \SetCell[r=2]{r} \key{drama}{drama} & no \option{desc} & silent\textsuperscript{\ref{character:silent}} & \(\times\) & \(\times\)& default\textsuperscript{\ref{character:default}} \\
447 \cmidrule{2-6}
448 & \option{desc} & silent\textsuperscript{\ref{character:silent}} & \(\times\) & \(\times\)& default\textsuperscript{\ref{character:default}} \\
449 \midrule
450 \SetCell[r=2]{r} \keyis{drama}{} & no \option{desc} &\(\times\) & \(\times\) & \(\times\)& hidden\textsuperscript{\ref{character:hidden}}\\
451 \cmidrule{2-6}
452 & \option{desc} & \(\times\)& \(\times\) & \(\times\)& \(\times\)& \\
453 \bottomrule
454 \SetCell[c=6]{c} Table: \enquote{To define or not to define} options of \cs{character}
455 \end{tblr}
456 \end{center}
457
458 \label{specialcharaclist}
459 \begin{enumerate}[(i)]
460 \item \label{character:default} \textbf{Default definition (\option{name} and \option{cmd} are given; \option{desc} and \option{drama} may be omitted):} The character is defined as described in section \vref{sec:basiccharacter}. If \option{desc} is omitted, no description appear in the dramatis person\ae{}; if no \option{drama} is given, character in the dramatis person\ae{} has the same name as it will have in the document.
461 Example:
462
463 \begin{sourcecode}
464 \character[
465 drama={A ghost},
466 desc={the king's ghost},
467 cmd={ghost},
468 ]{The ghost}
469 \end{sourcecode}
470
471 \item \label{character:description} \textbf{Description only (everything omitted but \option{desc}):} A description is inserted in the dramatis person\ae{}. Useful to add characters such as \emph{The kings' armies}.
472 Example:
473
474 \begin{sourcecode}
475 \character[desc={The kings' armies}]{}
476 \end{sourcecode}
477
478 \item \label{character:hidden} \textbf{Hidden character (\option{drama} is empty (defined, but empty), \option{cmd} and \option{name} are defined, \option{desc} is omitted)} Definition of a character that does not appear in the dramatis person\ae{}. In this case, even if defined, the \option{cast} argument is ignored.
479 Example:
480
481 \begin{sourcecode}
482 \character[drama={}, cmd={postman}]{The postman}
483 \end{sourcecode}
484
485 \item \label{character:silent} \textbf{Silent character (\option{name} is empty; \option{drama} is defined; \option{desc} may be omitted; \option{cmd} is omitted):} The character only appear in the dramatis person\ae{}. It will not be used elsewhere in the document. An optional description may also appear in the dramatis person\ae{}.
486 Example:
487
488 \begin{sourcecode}
489 \character[drama={A priest}]{}
490 \end{sourcecode}
491
492 \end{enumerate}
493
494 \paragraph{Group of characters}
495 \label{sec:charactergroup}
496 \changedversion{v0.6} % Improve alignment of groups of characters.
497
498 \begin{environments}
499 \environment{charactergroup}[\oarg{width}\marg{description}]
500 It is possible to group several characters' definition if they have the same description.
501 The optional argument sets the group width (on the left of the brace).
502 See an example on section \vref{sec:charactergroupexample}.
503
504 The effect of this code will be, in the dramatis person\ae{}, to have a nice brace mapping the three characters to their common description.
505
506 The behaviour of nested \env{charactergroup} environments is undefined%
507 \footnote{It might work; it might not. It might work now, but stop working in the future; it might not work now, but work by accident in the future. Etc.}.
508 \end{environments}
509
510 \subsubsection{Cast names}
511 \label{sec:cast}
512 \sinceversion{0.13a} % New option \option{cast}.
513
514 The name of the actor or actress playing a character can be displayed next to their name in the dramatis person\ae{}, using the \option{cast} option of the \cs{character} command. Special values are described here; see section \vref{sec:defaultcast} for an example.
515
516 \begin{description}
517 \item[\key{cast}{name}] The name given in argument is displayed next to the character definition.
518 \item[\keyis{cast}{}] No cast is displayed.
519 \item[\keyis{cast}{\cs{underline}\Marg{\cs{phantom}\Marg{XXXXXXXXXX}}}] Display a line instead of the cast name: the name of the actor or actress may be added by hand later, when the play has been printed.
520 \end{description}
521
522 Default value is \keyis{cast}{}, unless something else has been set using option \option{defaultcast} of environment \env{dramatis} (see \vref{sec:dramatis}).
523
524 \paragraph{Cast group}
525 \sinceversion{v0.13a}
526
527 Some characters (or group of characters), like the chorus in Greek tragedy, can be played by several actors and actresses.
528
529 See an example in section \ref{sec:castgroupexample}.
530
531 \begin{environments}
532 \environment{castgroup}[\Oarg{\key{cmd}{command}, \key{drama}{dramatis}, \key{desc}{description}}\marg{name}]
533 Declare a character, that is played by several cast members. The arguments are the same as the arguments of the \cs{character} command (see section \ref{sec:basiccharacter}), excepted that the \option{cast} option is missing.
534 \end{environments}
535
536 \begin{commands}
537 \command{cast}[\oarg{cast}]
538 This command is the only one allowed inside a \env{castgroup} environment. It declares a new cast member (its only argument) for this group.
539 \end{commands}
540
541 \subsubsection{Vertical space}
542
543 \begin{commands}
544 \command{characterspace}
545 Command \cs{characterspace} put some vertical space into the dramatis person\ae{}.
546 \end{commands}
547
548 \subsubsection{Customize style of dramatis person\ae}
549 \sinceversion{v0.9a} % Style of the dramatis personae can be customized using environment \env{dramatisenv} and commands \cs{dramatischaracter}, and so on.
550
551 A default style is used to display the dramatis person\ae, but it is made to be customized.
552 The following commands can be redefined to make dramatis person\ae{} look different.
553 They do nothing apart from displaying text (no internal definition, etc.).
554 You can redefine them to change the look of the dramatis person\ae{}.
555
556 \begin{environments}
557 \environment{dramatisenv}
558 This environment wraps the dramatis person\ae.
559
560 \environment{dramatischaractergroup}[\marg{width}\marg{description}]
561 Renders a group of characters.
562
563 \environment{dramatischaractercastgroup}[\marg{name}\marg{description}\marg{cast}]
564 Renders a group of cast members.
565
566 \end{environments}
567
568 \begin{commands}
569 \command{dramatischaracter}[\marg{name}\marg{description}\marg{cast}]
570 Renders the character name, description, and cast. It should take care of cases where name or description (but not both) is missing, or cast is empty.
571
572 \command{dramatischaractername}[\marg{name}]
573 Renders the character name.
574
575 \command{dramatischaracterdescription}[\marg{description}]
576 Renders the character description.
577
578 \command{dramatischaractercast}[\marg{cast}]
579 Renders the cast name.
580
581 \command{dramatiscast}[\marg{cast}]
582 Renders the cast name, inside a \env{dramatischaractercastgroup}.
583
584 \command{characterspace} Adds a vertical character space.
585 \end{commands}
586
587 Section \vref{sec:customdramatis} illustrates how those commands are used.
588
589 For example, to render character names in small caps, one would define :
590
591 \begin{sourcecode}
592 \renewcommand{\dramatischaractername}[1]{\textsc{#1}}
593 \end{sourcecode}
594
595 Or to make dramatis person\ae{} include a title, one can define :
596
597 \begin{sourcecode}[add-silent-cmds={list}]
598 \renewenvironment{dramatisenv}{%
599 \act*{Dramatis person\ae}%
600 \list{}{\rightmargin1cm\leftmargin2cm}\item[]
601 }{%
602 \endlist%
603 }
604 \end{sourcecode}
605
606 \subsection{Characters}
607 \label{sec:characters}
608 This part explains how to define characters, and introduce character's lines.
609
610 It has been explained that definition of a character in the dramatis person\ae{} (see \vref{sec:dramatis}) also creates commands used to introduce lines of characters.
611 For instance, defining a character using \cs{character}\Oarg{\keyis{cmd}{cyrano}}\Marg{Cyrano} means than Cyrano's lines can now be
612 introduced using the following code.
613
614 \begin{sourcecode}
615 \cyrano
616 Ah ! non ! c'est un peu court, jeune homme !
617 \end{sourcecode}
618
619 This would display the name \emph{Cyrano} using the current character style, then his line.
620
621 \subsubsection{\enquote{Disposable} characters}
622
623 One can need to define characters that are used only once (or a few times).
624
625 \begin{commands}
626 \command{disposablecharacter}[\oarg{directions}\marg{name}]
627 This command, used in the body, introduces a line for character \marg{name},
628 with optional stage directions.
629 It is rendered the same way regular characters are rendered,
630 but nothing is added to the dramatis person\ae{}.
631 It is used in section \vref{sec:setcharactername}.
632 \end{commands}
633
634 This command is also useful to introduce lines of characters in non standard ways, for instance if several characters speak at once.
635 See examples in section \vref{ex:severalcharacters}.
636
637 \subsubsection{Changing character's name}
638 \label{setcharactername}
639
640 It is possible to change the name that appears to introduce character's lines
641 within the text. This can be used, for example, when a character is first
642 refered to as \emph{A voice}, until we learn his real identity, which is
643 \emph{Cyrano}. An example is given in section \vref{sec:setcharactername}.
644
645 \begin{commands}
646 \command{setcharactername}[\marg{command}\marg{name}]
647 \begin{options}
648 \opt{command}
649 Control sequence used to introduce this character's line.
650 \opt{name}
651 Name to display for this character.
652 \end{options}
653 \end{commands}
654
655 \subsubsection{Lines}
656 \label{sec:lines}
657 To introduce characters' lines, use the commands defined in the character
658 definition (see the \cs{character} command, or the example in section
659 \vref{sec:character_example}).
660
661 \paragraph{Choose style}
662 Several styles are available, to typeset character's name and lines in
663 different ways. Change the style by loading package using option
664 \key{characterstyle}{style} (available styles are
665 \code{bold},
666 \code{center},
667 \code{margin},
668 \code{simple},
669 \code{imprimerie-verse},
670 \code{imprimerie-prose}).
671 A few notes:
672 \begin{itemize}
673 \item \code{simple} Default style.
674 \item\sinceversion{v0.6} % Add styles \code{imprimerie-verse} and \code{imprimerie-prose}.
675 \code{imprimerie-verse} and \code{imprimerie-prose} French \emph{de facto} standards for typesetting drama plays, respectively in verse and in prose, as defined by the \emph{Imprimerie nationale} \cite{imprimerienationale}.
676 \item\sinceversion{v0.6} % Add styles \code{arden}.
677 \code{arden} Mimick typesetting of the Arden Shakespeare series.
678 \item \code{bold} Needs a sans serif font to be defined (it should be done by default with latin alphabets, but must be done by hand with languages using non latin characters (greek, hindi, etc.)).
679 \end{itemize}
680
681 \paragraph{Customize style}
682 If available styles does not fit your need, you can also define your own one.
683 To do so, you can redefine the following commands.
684
685 \begin{commands}
686 \command{speakswithoutdirection}[\marg{name}]
687 Invoked to display a character's name to introduce their line. It takes one argument, which is the character's name.
688
689 \command{speakswithdirection}[\marg{name}\marg{direction}]
690 Also invoked to display a character's name to introduce their line, but it takes a second argument, which is stage directions to be printed together with character's name.
691 \end{commands}
692
693 See also section \vref{sec:directions} to see other ways to print stage directions.
694
695 \subsection{Stage directions}
696 \label{sec:directions}
697 \changedversion{0.12a} % The \option{xspace} option also affects \cs{did}.
698
699 Let us begin with a warning: since we could not figure out a nice command
700 name made from \enquote{stage directions}, we used the French word
701 \emph{(\textfrench{didascalie})} to build up command names.
702
703 We define two ways to render stage directions: a short one, that is printed
704 inline, and a long one, printed in its own paragraph\footnote{For people writing math:
705 They act a bit like \texttt{\bbackslash(1+1=2\bbackslash)} and \texttt{\bbackslash[1+1=2\bbackslash]} for formulas.}.
706
707 \begin{commands}
708 \command{did}[\marg{directions}]
709 Display a stage direction inline.
710 \end{commands}
711
712 \begin{environments}
713 \environment{dida}
714 Display a stage direction in its own paragraph.
715 \end{environments}
716
717 Note that option \option{xspace} may be used to automatically add a space,
718 if necessary, after a \cs{did} command (see section \vref{option:xspace}, page \pageref{option:xspace}).
719
720 \begin{commands}
721 \command{onstage}[\marg{directions}]
722 Some stage directions are displayed centered under the scene or act
723 definition (I often see it in classical drama, where the list of characters
724 appearing in each scene is displayed that way).
725 This command can be used to display such information.
726
727 \command{pause}
728 As we often need to mark pauses in theater, we created the command \cs{pause},
729 which is a shortcut for \verbcode|\did{\GetTranslation{Pause}}|.
730 \end{commands}
731
732 \subsection{Splitting verses}
733 \sinceversion{v0.7} % New commands \cs{pauseverse}, \cs{resumeverse}, and \cs{adjustverse}.
734 \changedversion{v0.10c} % Document different implementations of \cs{pauseverse} and \cs{resumeverse}.
735
736 When writing verses, it is sometimes useful to split a verse between two
737 characters: the first character starts it in their line, and the second one
738 finishes it in a second line. Visually, the start of the second line is
739 vertically aligned to the end of the first line.
740
741 \danger
742 Warning: this is still experimental. I present several recipes to achieve this, but they all have their pros and cons.
743
744 The recipes presented below all implement macros \cs{pauseverse} and \cs{resumeverse}.
745 See section \vref{sec:splitverse} for an example.
746
747 \begin{commands}
748 \command{pauseverse}
749 Used at the end of the verse to be continued.
750 \command{resumeverse}
751 Used at the beginning of the continuing verse.
752 \end{commands}
753
754 When writing a play in verse, one can use a lot of those commands, which can
755 be tedious because of their long names. So, defining \enquote{shortcuts} of those
756 commands can be handy, as in the following example.
757
758
759 \begin{sourcecode}
760 \newcommand{\pv}{\pauseverse}
761 \newcommand{\rv}{\resumeverse}
762 \end{sourcecode}
763
764
765 This is not done by default, because short command names are a scarce ressource
766 in \LaTeX, so, defining these commands by default might conflict with other
767 packages, while most of \pkg*{thalie} users will not use them.
768
769 \subsubsection{Which recipe should I use?}
770
771 As I have already stated, there are several ways to achieve this, but none of them is perfect.
772
773 \begin{itemize}
774 \item Do try the first recipe (section \ref{split-latex}). If it works, stick to it. Otherwise…
775 \item If you do not mind loading the \texttt{TikZ} package, use it (section \ref{split-tikz}). As far as I know, from a user point of view, it is the easiest recipe to use, with the less bugs. Otherwise…
776 \item You can try building you own commands (section \ref{split-hanging}). Otherwise…
777 \item The last recipe (section \ref{split-phantom}) always works. It is far less user-friendly, but it does the job.
778 \end{itemize}
779
780 \subsubsection{Recipe 1 : Pure \LaTeX}
781 \label{split-latex}
782
783 \danger
784 Warning: I do not understand the code behind this feature. I copied-pasted code by David Carlisle\footnote{Originally written as an answer to a StackExchange question: see \url{https://tex.stackexchange.com/a/107727}.} without understanding it. There are \sout{probably} bugs\footnote{One on them lead to the next recipe.}, but I won't be able to solve them.
785
786 The implemented macros \cs{pauseverse} and \cs{resumeverse} are written in pure \LaTeX (without any external package). For backward compatibility reasons, this will remain the default implementation for some time…
787
788 If the character names are displayed on the same line as the verse, the lines
789 are not aligned the way one would expect them to. To correct this, command
790 \cs{adjustverse}\marg{length} can be used to add an extra (possibly negative)
791 space when calling \cs{resumeverse}, to get a correct alignment.
792 See section \vref{sec:splitverse-adjusted}, for an example of those three commands.
793
794 The young inexperienced fool\footnote{Me…} who originally wrote those commands had not noticed that \cs{adjustverse} is needed because \cs{resumeverse} does not take into account the length of the character names, in styles where it appears on the same line as the verse. This (probably) won't be fixed, because some people might be using this, and fixing this might break their document.
795
796 If you encounter the same issue, you might prefer one of the other recipes.
797
798 \subsubsection{Recipe 2 : With package \texttt{hanging}}
799 \label{split-hanging}
800
801 \danger
802 Warning: This is a do-it-yourself recipe.
803
804 The bug announced at the end of the previous recipe, has been spotted and partially corrected by egreg on StackExchange\footnote{\url{https://tex.stackexchange.com/a/545326}}. He proposes the following code to fix this.
805
806
807 \begin{sourcecode}[add-silent-cmds={brokenverse,hangpara}]
808 \usepackage{hanging}
809
810 \newlength{\brokenverse}
811 \renewcommand*{\speakswithoutdirection}[1]{%
812 \settowidth{\brokenverse}{\textsc{#1}.}%
813 \hangpara{2\parindent}{1}\noindent\textsc{#1}.%
814 }
815 \makeatletter
816 \renewcommand{\resumeverse}{%
817 \hspace{\@verseadjust}\hspace{\dimexpr\dimen\@ne-\brokenverse-2em}
818 }
819 \makeatother
820 \end{sourcecode}
821
822
823 This code ignores the choosen style (it actually redesigns it), and it only works with lines without character directions. If needed, you should also define a \cs{speakswithdirection} command to implement the same feature.
824
825 \subsubsection{Recipe 3 : With package \texttt{TikZ}}
826 \label{split-tikz}
827
828 As far as I know, this recipe is the best one, from a user point of view. But it loads the \texttt{TikZ} package, which is a huge package to implement such a tiny feature\footnote{In French, we would say : \enquote{\foreignlanguage{french}{Un marteau-pilon pour écraser une mouche}} (a far too heavy solution for a tiny problem).}.
829
830 \begin{sourcecode}[add-silent-cmds={usetikzlibrary,tikzset,draw,tikzmark,iftikzmark,tikzmath}]
831 \usepackage{tikz}
832 \usetikzlibrary{tikzmark}
833 \usetikzlibrary{math}
834 \newcounter{thalieverse}
835 \tikzset{tikzmark suffix=-\thethalieverse}%
836 \renewcommand{\pauseverse}{%
837 \stepcounter{thalieverse}
838 \tikzmark{thaliepauseverse}
839 }
840 \renewcommand{\resumeverse}{%
841 \tikzmark{thalieresumeverse}%
842 \iftikzmark{thaliepauseverse}{%
843 \begin{tikzpicture}[remember picture]%
844 % Uncomment to see "pause" and "resume" tikz marks.
845 %\draw[overlay,green, ultra thick] (pic cs:thaliepauseverse) -- (pic cs:thalieresumeverse);%
846 \tikzmath{
847 coordinate \c;
848 \c1 = (pic cs:thaliepauseverse);
849 \c2 = (pic cs:thalieresumeverse);
850 \width = max(0, \cx1 - \cx2);
851 }
852 % Set opacity to 1 to see the space
853 \draw[opacity=0, black, line width=1ex] (0, 0) -- (\width pt, 0);
854 \end{tikzpicture}%
855 }{}%
856 }
857 \end{sourcecode}
858
859
860 This recipe is implemented in the \href{https://framagit.org/spalax/thalie/-/blob/main/examples/henry.tex}{\texttt{examples/henry.tex}} file in the repository of this project.
861
862 \subsubsection{Recipe 4 : With \texttt{\textbackslash{}phantom\{\}}}
863 \label{split-phantom}
864
865 At last, if nothing else workd, this feature can also be implemented using the \cs{phantom} command (see section \vref{sec:splitverse-phantom} for an example).
866 It is far less user-friendly, but it is also less error prone. Choose wisely…
867
868 \section{Localization and Internationalization}
869 \label{sec:i18n}
870
871 \subsection{Localization}
872 \sinceversion{v0.9a} % Add section \emph{Localization} to the documentation.
873 \label{sec:l10n}
874
875 By default, commands \cs{act}, \cs{scene}, etc. use English words, but they are
876 translated to the current language used by \pkg{babel} or
877 \pkg{polyglossia}\footnote{Given that someone provided the translation. See
878 section \vref{sec:languages} for the list of available languages.}.
879
880
881 Language cannot be defined directly in this package. Instead, the language
882 currently used by \pkg{babel} or \pkg{polyglossia} is used to translate the following
883 words (with or without capital letter, singular or plural): \emph{play},
884 \emph{act}, \emph{scene}, \emph{interlude}, \emph{pause}, \emph{curtain}.
885
886 If the option for your language does not exist\footnote{You can also send me the translation for your language, to improve this package.},
887 or if you want to change the default words used here, you can set your own translation using command \cs{DeclareTranslation}
888 (see the \pkg{translations} package for more information).
889 \changedversion{v0.9a} % Use package \pkg{translations} to handle translations.
890 For instance use
891 \verbcode|\DeclareTranslation{Spanish}{Curtain}{Telòn}| for Spanish\footnote{I may be wrong: I cannot speak Spanish.}.
892
893 See section \vref{sec:languages} for the list of supported languages.
894
895 \subsubsection{Common translations}
896
897 Commands defined here are shorter versions of strings commonly translated.
898
899 \begin{commands}
900 \command{playname}
901 Shortcut for \verbcode|\GetTranslation{Play}|.
902
903 \command{actname}
904 Shortcut for \verbcode|\GetTranslation{Act}|.
905
906 \command{scenename}
907 Shortcut for \verbcode|\GetTranslation{Scene}|.
908
909 \command{interludename}
910 Shortcut for \verbcode|\GetTranslation{Interlude}|.
911
912 \command{pausename}
913 Shortcut for \verbcode|\GetTranslation{Pause}|.
914
915 \command{curtainname}
916 Shortcut for \verbcode|\GetTranslation{Curtain}|.
917 \end{commands}
918
919 \subsection{Non-latin alphabets}
920
921 This package should work with languages using non-latin alphabets (greek, hindi, etc.). However, here are a few remarks.
922
923 \begin{itemize}
924 \item The \code{bold} character style (see section \vref{sec:lines}) can only be used if a sans serif font has been defined. For instance, for hindi, you might write in the preamble: \verbcode|\newfontfamily\hindifontsf{Noto Sans Devanagari}|.
925 \end{itemize}
926
927 \subsection{Language specific comments}
928 \label{sec:languages}
929
930 The following languages are available:
931
932 \begin{description}
933 \item[English]~
934 \begin{itemize}
935 \item The \code{arden} character style tries to mimick the typestting of the Arden Shakespeare series.
936 \end{itemize}
937 \item[French]~
938 \begin{itemize}
939 \item The \code{imprimerie-verse} and \code{imprimerie-prose} character styles implements the French \emph{de facto} standards for typesetting drama plays, respectively in verse and in prose, as defined by the \emph{Imprimerie nationale} \cite{imprimerienationale}.
940 \item The same book \cite{imprimerienationale} states that act numbers should be typeset in capital roman numerals (which is done by default with \pkg{thalie}), and that scene numbers should be typeset in small capital roman numerals, which is \emph{not} the default, but can be achieved by adding the following line in the preamble: \verbcode|\renewcommand{\thescene}{\textsc{\roman{scene}}}|.
941 \end{itemize}
942 \item[German]
943 \sinceversion{v0.10a} % New translation: German (thanks Ekkart Kleinod).
944 \item[Italian]
945 \sinceversion{v0.11a} % New translation: Italian (thanks Giuseppe Palma).
946 \end{description}
947
948 I am not a linguist or dramatist in any of those languages. If you have interesting advice for those languages that you would like to share (preferably with a reference to a reliable source), I would be happy to add them to this list!
949
950 \appendix
951 \part{Appendix}
952
953 \section{Examples}
954 \label{sec:examples}
955 \sinceversion{v0.9a} % New section in the documentation: Examples.
956
957 \subsection{Dramatis person\ae}
958
959 \subsubsection{Character definition}
960 \label{sec:character_example}
961
962 \begin{lang}{french}
963 \begin{example}[add-silent-cmds={lebret,cyrano,cyranoname,bellerosename}]
964 \begin{dramatis}
965 \character[cmd={cyrano}, drama={Cyrano de Bergerac}]{Cyrano}
966 \character[cmd={lebret}]{Le Bret}
967 \character[cmd={bellerose}]{Bellerose}
968 \end{dramatis}
969
970 \bigskip
971
972 \lebret[à \cyranoname, lui prenant le bras]
973 Çà, causons !\ldots
974
975 \cyrano
976 Laisse un peu sortir cette cohue\ldots{}
977 \did{À \bellerosename.}
978 Je peux rester ?
979 \end{example}
980 \end{lang}
981
982 \subsubsection{Define a group of characters}
983 \label{sec:charactergroupexample}
984
985 \begin{example}
986 \begin{dramatis}
987 \begin{charactergroup}[2.5cm]{Officers}
988 \character[desc={a soldier}, cmd=marcellus]{Marcellus}
989 \character[desc={a soldier}, cmd=bernardo]{Bernardo}
990 \end{charactergroup}
991 \end{dramatis}
992 \end{example}
993
994 \subsubsection{Define a cast group}
995 \label{sec:castgroupexample}
996
997 \begin{french}
998 \begin{example}
999 \begin{dramatis}
1000 \character[cmd=narses, cast={Raymone}]{La femme Narsès}
1001 \begin{castgroup}[drama={Les Euménides}]{}
1002 \cast{Marthe Herlin}
1003 \cast{Monique Mélinand}
1004 \cast{Denise Pezzani}
1005 \end{castgroup}
1006 \begin{castgroup}[drama={Les petites Euménides}]{}
1007 \cast{Véra Pharès}
1008 \cast{Nicole Munié-Berny}
1009 \cast{Clairette Fournier}
1010 \end{castgroup}
1011 \character[cmd=mendiant, cast={Louis Jouvet}]{Le Mendiant}
1012 \end{dramatis}
1013 \end{example}
1014 \end{french}
1015
1016 \subsubsection{Example of \texttt{defaultcast}.}
1017 \label{sec:defaultcast}
1018
1019 We already know that John Doe will play Astérix.
1020 Actors for Obélix and Cléopatre have not been found yet.
1021 Idéfix will be played by a puppet: no need to put a cast name.
1022
1023 \begin{lang}{french}
1024 \begin{example}
1025 \begin{dramatis}[defaultcast={\underline{\phantom{XXXXXXX}}}]
1026 % Explicit cast
1027 \character[desc={guerrier gaulois}, cast={John Doe}, cmd=asterix]{Astérix}
1028 % Default cast
1029 \character[desc={sculpteur de menhir, ami du précédent}, cmd=obelix]{Obélix}
1030 \character[desc={reine d'Égypte}, cmd=cleopatre]{Cléopatre}
1031 % No cast
1032 \character[desc={chien d'Obélix}, cast={}, drama={Idéfix}]{}
1033 \end{dramatis}
1034 \end{example}
1035 \end{lang}
1036
1037 \subsubsection{Commands used to display the dramatis person\ae.}
1038 \label{sec:customdramatis}
1039
1040 \begin{sourcecode}
1041 \begin{dramatis}
1042 \character[cmd=queen]{The queen}
1043 \character[cmd=king, desc={the queen's husband.}]{The king}
1044 \begin{charactergroup}{Lords and ladies}
1045 \character[drama={Lord Foo}]{}
1046 \character[desc={Lord Foo's sister.}, drama={Lady Bar}]{}
1047 \character[desc={Lord and Lady Baz.}]{}
1048 \end{charactergroup}
1049 \characterspace
1050 \character[desc={Several servants}]{}
1051 \begin{castgroup}[drama={Chorus}]{}
1052 \cast{Jane Doe}
1053 \cast{John Doe}
1054 \end{castgroup}
1055 \end{dramatis}
1056 \end{sourcecode}
1057
1058 To display the dramatis person\ae{} above, the commands below are called.
1059
1060 \begin{sourcecode}
1061 \begin{dramatisenv}
1062 \dramatischaracter{The queen}{}{}
1063 \dramatischaracter{The king}{the queen's husband.}{}
1064 \begin{dramatischaractergroup}[5cm]{Lords and ladies}
1065 \dramatischaracter{Lord Foo}{}{}
1066 \dramatischaracter{Lady Bar}{Lord Foo's sister.}{}
1067 \dramatischaracter{}{Lord and Lady Baz.}{}
1068 \end{dramatischaractergroup}
1069 \characterspace
1070 \dramatischaracter{}{Several servants}{}
1071 \begin{dramatischaractercastgroup}{}{Chorus}{}
1072 \dramatiscast{Jane Doe}
1073 \dramatiscast{John Doe}
1074 \end{dramatischaractercastgroup}
1075 \end{dramatisenv}
1076 \end{sourcecode}
1077
1078 Command \cs{dramatischaracter}\marg{name}\marg{description}\marg{cast} is defined as something like the following code (excepted that parts taking care of cases where there is no character name or description is omitted here).
1079
1080 \begin{sourcecode}
1081 \newcommand{\dramatischaracter}[3]{ %
1082 \dramatischaractername{#1}, \dramatischaracterdescription{#2}\dotfill\dramatischaractercast{#3}\\
1083 }
1084 \end{sourcecode}
1085
1086 \subsection{Custom definition of acts}
1087 \label{ex:custom}
1088
1089 To redefine the definition of \cs{act}, one can use the following code.
1090
1091 \begin{sourcecode}[add-silent-cmds={WithSuffix}]
1092 \newcommand\customact[2]{
1093 \begin{center}
1094 \textsc{\GetTranslation{Act} #1}
1095
1096 #2
1097 \end{center}
1098 }
1099 \WithSuffix\newcommand\customact*[1]{
1100 \begin{center}
1101 #1
1102 \end{center}
1103 }
1104 \end{sourcecode}
1105
1106 \subsection{Charcters' lines}
1107
1108 \subsubsection{Introduce lines of several characters at the same time.}
1109 \label{ex:severalcharacters}
1110
1111 Since \cs{disposablecharacter} can display arbitrary text using the style of
1112 character names, it can be used to render a custom text when two characters
1113 are speaking together.
1114
1115
1116 \begin{dramatis}[hidden]
1117 \character[cmd=alice]{Alice}
1118 \character[cmd=bob]{Bob}
1119 \character[cmd=eve]{Eve}
1120 \end{dramatis}
1121 \begin{example}[add-silent-cmds={eve,alicename,bobname}]
1122 \eve
1123 Let's open it.
1124
1125 \disposablecharacter{\alicename and \bobname}
1126 No!
1127 \end{example}
1128
1129 \subsubsection{Change the name of a character}
1130 \label{sec:setcharactername}
1131
1132 On the first scenes of \emph{Cyrano de Bergerac}, the main character (Cyrano) is somewhere in a crowd, and only appears as \emph{The voice} (\emph{\textfrench{La voix}} in French).
1133 He appears as Cyrano in the following verses.
1134
1135 \begin{lang}{french}
1136 \begin{dramatis}[hidden]
1137 \character[desc={Cyrano de Bergerac}, cmd=cyrano]{La voix}
1138 \character[cmd=montfleury]{Montfleury}
1139 \end{dramatis}
1140
1141 \begin{example}[add-silent-cmds={cyrano,montfleury}]
1142 \cyrano Sortez !
1143
1144 \disposablecharacter{Le parterre} Oh !
1145
1146 \montfleury[s'étranglant] \enquote{Heureux qui loin des cours\ldots}
1147
1148 \setcharactername{cyrano}{Cyrano}
1149 \cyrano[surgissant du parterre, debout sur une chaise, les bras croisés, le feutre en bataille, la moustache hérissée, le nez terrible] Ah ! je vais me fâcher !\ldots
1150 \end{example}
1151 \end{lang}
1152
1153 \subsection{Splitting verses}
1154
1155 \subsubsection{Commands used to split verse}
1156 \label{sec:splitverse}
1157 \begin{dramatis}[hidden]
1158 \character[cmd={hermia}]{Hermia}
1159 \character[cmd={theseus}]{Theseus}
1160 \end{dramatis}
1161 \begin{example}[add-silent-cmds={hermia,theseus}]
1162
1163 \setthalieoptions{characterstyle=imprimerie-verse}
1164
1165 \hermia
1166 So is Lysander.\pauseverse
1167
1168 \theseus
1169 \resumeverse In himself he is.
1170 \end{example}
1171
1172 \subsubsection{Commands used to adjust splitted verse}
1173 \label{sec:splitverse-adjusted}
1174
1175 \begin{dramatis}[hidden]
1176 \character[cmd={hermia}]{Hermia}
1177 \character[cmd={theseus}]{Theseus}
1178 \end{dramatis}
1179
1180 \begin{example}[add-silent-cmds={hermia,theseus}]
1181 \setthalieoptions{characterstyle=simple}
1182 \adjustverse{-7em}
1183
1184 \hermia
1185 So is Lysander.\pauseverse
1186
1187 \theseus
1188 \resumeverse In himself he is.
1189 \end{example}
1190
1191 \subsubsection{Commands used to split verse (using the \texttt{\bbackslash{}phantom} command)}
1192 \label{sec:splitverse-phantom}
1193
1194 \begin{dramatis}[hidden]
1195 \character[cmd={hermia}]{Hermia}
1196 \character[cmd={theseus}]{Theseus}
1197 \end{dramatis}
1198 \begin{example}[add-silent-cmds={hermia,theseus}]
1199 \hermia
1200 So is Lysander.
1201
1202 \theseus
1203 \phantom{So is Lysander.} In himself he is.
1204 \end{example}
1205
1206 \subsection{Footnotes}
1207
1208 \paragraph{Add a footnote on a character name}
1209
1210 Adding a footnote on the character name introducing its line cannot be done on the character command defined by the dramatis person\ae. Instead, the \cs{disposablecharacter} command can be used instead.
1211
1212 \begin{sourcecode}[add-silent-cmds={alicename}]
1213 \disposablecharacter{\alicename\footnote{An interesting note.}}
1214 Hello, world!
1215 \end{sourcecode}
1216
1217
1218 \paragraph{Add a footnote in a stage direction}
1219
1220 Footnote must be protected to be included in stage directions.
1221
1222 \begin{sourcecode}[add-silent-cmds={cyrano}]
1223 \cyrano[frappant dans ses mains \protect\footnote{An interesting footnote.}]
1224 Une !
1225 \end{sourcecode}
1226
1227 \subsection{Headers and footers}
1228 \label{sec:examples:headers}
1229
1230 By default, with the \cls*{article} class, the header of the left page contains the play name, and the header of the right page contains the act number.
1231
1232 \paragraph{Header: Act number on left, scene number on right}
1233
1234 \begin{sourcecode}
1235 \renewcommand{\actmark}[1]{%
1236 {\markboth{\MakeUppercase{\GetTranslation{Act}}\ \theact\ #1}{}}%
1237 }
1238 \renewcommand{\scenemark}[1]{%
1239 {\markright{\MakeUppercase{\GetTranslation{Scene}}\ \thescene\ #1}}%
1240 }
1241 \end{sourcecode}
1242
1243 \paragraph{Play name of left, act and scene name on right}
1244
1245 \begin{sourcecode}[add-silent-cmds={fancyhf,fancyhead}]
1246 \usepackage{fancyhdr}
1247 \pagestyle{fancy}
1248 \fancyhf{}
1249 \fancyhead[RO]{%
1250 \textit{\MakeUppercase{%
1251 \GetTranslation{Act} \theact{}, %
1252 \GetTranslation{Scene} \thescene%
1253 }}%
1254 }
1255 \fancyhead[LE]{\leftmark}
1256 \end{sourcecode}
1257
1258 \subsection{Line numbers}
1259
1260 Some styles write character names in the left margin, which can overlap with line numbers displayed by package \pkg{lineno}.
1261 To avoid this, line numbers can be displayed on the right of the page using option \verbcode|[right]| of package \pkg{lineno}.
1262
1263 \section{Change History}
1264
1265 This is a raw copy of the \href{https://framagit.org/spalax/thalie/-/blob/main/CHANGELOG.md}{\textsl{CHANGELOG.md}} file that can be found in the git repository of \pkg*{thalie}.
1266
1267 \markdownInput{CHANGELOG.md}
1268
1269 \addcontentsline{toc}{section}{\refname}
1270 \begin{thebibliography}{99}
1271 \bibitem{imprimerienationale}
1272 {Imprimerie nationale},
1273 \emph{Lexique des r\`egles typographiques en usage \`a l'Imprimerie nationale},
1274 2002,
1275 ISBN : 978-2-7433-0482-9
1276 \bibitem{cyrano}
1277 {Edmond Rostand},
1278 \emph{Cyrano de Bergerac},
1279 1897
1280 \bibitem{midsummer}
1281 {William Shakespeare},
1282 \emph{A Midsummer Night's Dream},
1283 1600
1284 \bibitem{electre}
1285 {Jean Giraudoux},
1286 \emph{Électre},
1287 1937
1288 \bibitem{dtxtut}
1289 {Scott Pakin},
1290 \emph{How to Package Your \LaTeX{} Package --- Tutorial on writing .dtx and .ins files},
1291 2004,
1292 \url{http://www.ctan.org/pkg/dtxtut/}
1293 \bibitem{clsguide}
1294 {The \LaTeX{} Team},
1295 \emph{\LaTeXe{} for class and package writers},
1296 2006,
1297 \url{http://www.ctan.org/pkg/clsguide}
1298 \bibitem{drama}
1299 {Matt Swift},
1300 \emph{drama --- Production-style stage script in LaTeX},
1301 2001,
1302 \url{http://www.ctan.org/pkg/drama}
1303 \bibitem{dramatist}
1304 {Massimiliano Dominici},
1305 \emph{dramatist --- Typeset dramas, both in verse and in prose},
1306 2005,
1307 \url{http://www.ctan.org/pkg/dramatist}
1308 \bibitem{play}
1309 {James Kilfiger},
1310 \emph{play --- Typeset drama using \LaTeX{}},
1311 2001,
1312 \url{http://www.ctan.org/pkg/play}
1313 \bibitem{screenplay}
1314 {John Pate},
1315 \emph{screenplay --- A class file to typeset screenplays},
1316 2012,
1317 \url{http://www.ctan.org/pkg/screenplay}
1318 \bibitem{sides}
1319 {Wing L Mui},
1320 \emph{sides --- A LaTeX class for typesetting stage plays},
1321 2005,
1322 \url{http://www.ctan.org/pkg/sides}
1323 \end{thebibliography}
1324
1325 \end{document}