diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-23 22:08:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-23 22:08:37 +0000 |
commit | 53b8d70292c2a17a5807f9269c92d0806ca93e61 (patch) | |
tree | 3967d672201c7cbab5895a323b898b18b924321a /Master/texmf-dist/tex | |
parent | f5a55f5fa1a9c9ce70847df822ac1b8210174653 (diff) |
thalie (23apr17)
git-svn-id: svn://tug.org/texlive/trunk@43994 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/thalie/thalie-english.trsl | 26 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl | 45 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/thalie/thalie-french.trsl | 26 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/thalie/thalie.sty | 643 |
4 files changed, 430 insertions, 310 deletions
diff --git a/Master/texmf-dist/tex/latex/thalie/thalie-english.trsl b/Master/texmf-dist/tex/latex/thalie/thalie-english.trsl new file mode 100644 index 00000000000..f1f76492f57 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thalie/thalie-english.trsl @@ -0,0 +1,26 @@ +\ProvideDictionaryFor{English}{thalie} + +\ProvideDictTranslation{play}{play} +\ProvideDictTranslation{plays}{plays} +\ProvideDictTranslation{Play}{Play} +\ProvideDictTranslation{Plays}{Plays} +\ProvideDictTranslation{act}{acte} +\ProvideDictTranslation{acts}{acts} +\ProvideDictTranslation{Act}{Act} +\ProvideDictTranslation{Acts}{Acts} +\ProvideDictTranslation{scene}{scene} +\ProvideDictTranslation{scenes}{scenes} +\ProvideDictTranslation{Scene}{Scene} +\ProvideDictTranslation{Scenes}{Scenes} +\ProvideDictTranslation{interlude}{interlude} +\ProvideDictTranslation{interludes}{interludes} +\ProvideDictTranslation{Interlude}{Interlude} +\ProvideDictTranslation{Interludes}{Interludes} +\ProvideDictTranslation{curtain}{curtain} +\ProvideDictTranslation{curtains}{curtains} +\ProvideDictTranslation{Curtain}{Curtain} +\ProvideDictTranslation{Curtains}{Curtains} +\ProvideDictTranslation{pause}{pause} +\ProvideDictTranslation{pauses}{pauses} +\ProvideDictTranslation{Pause}{Pause} +\ProvideDictTranslation{Pauses}{Pauses} diff --git a/Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl b/Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl new file mode 100644 index 00000000000..2f29486715f --- /dev/null +++ b/Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl @@ -0,0 +1,45 @@ +\ProvideDictionaryFor{fallback}{thalie} + +\makeatletter + +\newcommand{\@latin}[1]{% + % Try hard to display argument, even in an environment that uses non-latin characters. + \ifdefined\normalfontlatin% + {\normalfontlatin#1}% + \else% + {% + \ifdefined\ensureascii% + {\ensureascii{#1}}% + \else% + {#1}% + \fi% + }% + \fi% +} + +\ProvideTranslationFallback{play}{\@latin{play}} +\ProvideTranslationFallback{plays}{\@latin{plays}} +\ProvideTranslationFallback{Play}{\@latin{Play}} +\ProvideTranslationFallback{Plays}{\@latin{Plays}} +\ProvideTranslationFallback{act}{\@latin{acte}} +\ProvideTranslationFallback{acts}{\@latin{acts}} +\ProvideTranslationFallback{Act}{\@latin{Act}} +\ProvideTranslationFallback{Acts}{\@latin{Acts}} +\ProvideTranslationFallback{scene}{\@latin{scene}} +\ProvideTranslationFallback{scenes}{\@latin{scenes}} +\ProvideTranslationFallback{Scene}{\@latin{Scene}} +\ProvideTranslationFallback{Scenes}{\@latin{Scenes}} +\ProvideTranslationFallback{interlude}{\@latin{interlude}} +\ProvideTranslationFallback{interludes}{\@latin{interludes}} +\ProvideTranslationFallback{Interlude}{\@latin{Interlude}} +\ProvideTranslationFallback{Interludes}{\@latin{Interludes}} +\ProvideTranslationFallback{curtain}{\@latin{curtain}} +\ProvideTranslationFallback{curtains}{\@latin{curtains}} +\ProvideTranslationFallback{Curtain}{\@latin{Curtain}} +\ProvideTranslationFallback{Curtains}{\@latin{Curtains}} +\ProvideTranslationFallback{pause}{\@latin{pause}} +\ProvideTranslationFallback{pauses}{\@latin{pauses}} +\ProvideTranslationFallback{Pause}{\@latin{Pause}} +\ProvideTranslationFallback{Pauses}{\@latin{Pauses}} + +\makeatother diff --git a/Master/texmf-dist/tex/latex/thalie/thalie-french.trsl b/Master/texmf-dist/tex/latex/thalie/thalie-french.trsl new file mode 100644 index 00000000000..abc058f11f9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thalie/thalie-french.trsl @@ -0,0 +1,26 @@ +\ProvideDictionaryFor{French}{thalie} + +\ProvideDictTranslation{play}{pi\`ece} +\ProvideDictTranslation{plays}{pi\`eces} +\ProvideDictTranslation{Play}{Pi\`ece} +\ProvideDictTranslation{Plays}{Pi\`eces} +\ProvideDictTranslation{act}{acte} +\ProvideDictTranslation{acts}{actes} +\ProvideDictTranslation{Act}{Acte} +\ProvideDictTranslation{Acts}{Actes} +\ProvideDictTranslation{scene}{sc\`ene} +\ProvideDictTranslation{scenes}{sc\`enes} +\ProvideDictTranslation{Scene}{Sc\`ene} +\ProvideDictTranslation{Scenes}{Sc\`enes} +\ProvideDictTranslation{interlude}{interm\`ede} +\ProvideDictTranslation{interludes}{interm\`edes} +\ProvideDictTranslation{Interlude}{Interm\`ede} +\ProvideDictTranslation{Interludes}{Interm\`edes} +\ProvideDictTranslation{curtain}{rideau} +\ProvideDictTranslation{curtains}{rideaux} +\ProvideDictTranslation{Curtain}{Rideau} +\ProvideDictTranslation{Curtains}{Rideaux} +\ProvideDictTranslation{pause}{pause} +\ProvideDictTranslation{pauses}{pauses} +\ProvideDictTranslation{Pause}{Pause} +\ProvideDictTranslation{Pauses}{Pauses} diff --git a/Master/texmf-dist/tex/latex/thalie/thalie.sty b/Master/texmf-dist/tex/latex/thalie/thalie.sty index 09697db02ea..09918fd01d4 100644 --- a/Master/texmf-dist/tex/latex/thalie/thalie.sty +++ b/Master/texmf-dist/tex/latex/thalie/thalie.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% thalie.dtx (with options: `package') -%% Copyright 2010-2015 Louis Paternault +%% Copyright 2010-2017 Louis Paternault %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -23,137 +23,29 @@ %% and the derived file thalie.sty. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{thalie} - [2015/12/30 v0.8 A package to typeset drama plays] -\RequirePackage{ifthen} + [2017/04/22 v0.9a A package to typeset drama plays] + \RequirePackage{etoolbox} \RequirePackage{suffix} -\RequirePackage{longtable} +\RequirePackage{tabularx} \RequirePackage{xspace} -\RequirePackage{pgfopts} - -\pgfkeys{ - % Character style - /THALIE/.cd, - characterstyle/.value required, - characterstyle/.default=simple, - characterstyle/.is choice, - characterstyle/bold/.code=\def\@characterstyle{bold}, - characterstyle/center/.code=\def\@characterstyle{center}, - characterstyle/margin/.code=\def\@characterstyle{margin}, - characterstyle/simple/.code=\def\@characterstyle{simple}, - characterstyle/arden/.code=\def\@characterstyle{arden}, - characterstyle/imprimerie-verse/.code=\def\@characterstyle{imprimerie-verse}, - characterstyle/imprimerie-prose/.code=\def\@characterstyle{imprimerie-prose}, - characterstyle, -} - -\pgfkeys{ - % play style - /THALIE/.cd, - playstyle/.value required, - playstyle/.default=box, - playstyle/.is choice, - playstyle/center/.code=\def\@playstyle{center}, - playstyle/bigcenter/.code=\def\@playstyle{bigcenter}, - playstyle/box/.code=\def\@playstyle{box}, - playstyle/custom/.code=\def\@playstyle{custom}, - playstyle, -} -\pgfkeys{ - % act style - /THALIE/.cd, - actstyle/.value required, - actstyle/.default=bigcenter, - actstyle/.is choice, - actstyle/center/.code=\def\@actstyle{center}, - actstyle/bigcenter/.code=\def\@actstyle{bigcenter}, - actstyle/box/.code=\def\@actstyle{box}, - actstyle/custom/.code=\def\@actstyle{custom}, - actstyle, -} -\pgfkeys{ - % scene style - /THALIE/.cd, - scenestyle/.value required, - scenestyle/.default=center, - scenestyle/.is choice, - scenestyle/center/.code=\def\@scenestyle{center}, - scenestyle/bigcenter/.code=\def\@scenestyle{bigcenter}, - scenestyle/box/.code=\def\@scenestyle{box}, - scenestyle/custom/.code=\def\@scenestyle{custom}, - scenestyle, -} - -\pgfkeys{ - % play level - /THALIE/.cd, - playlevel/.value required, - playlevel/.default=chapter, - playlevel/.store in=\@playlevel, - playlevel, -} -\pgfkeys{ - % act level - /THALIE/.cd, - actlevel/.value required, - actlevel/.default=section, - actlevel/.store in=\@actlevel, - actlevel, -} -\pgfkeys{ - % scene level - /THALIE/.cd, - scenelevel/.value required, - scenelevel/.default=subsection, - scenelevel/.store in=\@scenelevel, - scenelevel, -} -\pgfkeys{ - % interlude level - /THALIE/.cd, - interludelevel/.value required, - interludelevel/.default=act, - interludelevel/.is choice, - interludelevel/play/.code=\def\@interludelevel{play}, - interludelevel/act/.code=\def\@interludelevel{act}, - interludelevel/scene/.code=\def\@interludelevel{scene}, - interludelevel, -} -\newif\if@xspace -\pgfkeys{ - % xspace option - /THALIE/.cd, - xspace/.value required, - xspace/.is if=@xspace, - xspace/.default=true, - xspace, -} - -\ProcessPgfPackageOptions{/THALIE} -\newcommand{\playname}{Play} -\newcommand{\actname}{Act} -\newcommand{\scenename}{Scene} -\newcommand{\interludename}{Interlude} -\newcommand{\curtainname}{Curtain} -\newcommand{\pausename}{Pause} -\@ifpackageloaded{babel}{ - \addto\captionsfrench{% - \renewcommand{\playname}{Pi\`ece} - \renewcommand{\actname}{Acte} - \renewcommand{\scenename}{Sc\`ene} - \renewcommand{\interludename}{Interm\`ede} - \renewcommand{\curtainname}{Rideau} - \renewcommand{\pausename}{Pause} - } - \addto\captionsenglish{% - % Useless: these are the default... - } -}{} +\RequirePackage{translations} +\LoadDictionary{thalie} +\LoadDictionaryFor{fallback}{thalie} +\newcommand{\playname}{\GetTranslation{Play}} +\newcommand{\actname}{\GetTranslation{Act}} +\newcommand{\scenename}{\GetTranslation{Scene}} +\newcommand{\interludename}{\GetTranslation{Interlude}} +\newcommand{\curtainname}{\GetTranslation{Curtain}} +\newcommand{\pausename}{\GetTranslation{Pause}} \newcommand{\playmark}[1]{% \markboth{\MakeUppercase{#1}}{}% } \newcommand{\actmark}[1]{% - \markright{\MakeUppercase{#1}}% + \markright{\MakeUppercase{% + \GetTranslation{Act}\ \theact% + \ifdefempty{#1}{}{: #1}% + }}% } \newcommand{\scenemark}[1]{% } @@ -168,20 +60,20 @@ % - Style % - Label (none = not in toc) % - Title - \ifthenelse{\equal{#1}{center}}{ + \ifdefstring{#1}{center}{ \begin{center} \textsc{#2} #3 \end{center} - }{\ifthenelse{\equal{#1}{bigcenter}}{ + }{\ifdefstring{#1}{bigcenter}{ \begin{center} \Large \textsc{#2} #3 \end{center} - }{\ifthenelse{\equal{#1}{box}}{ + }{\ifdefstring{#1}{box}{ \begin{center} \framebox{\begin{minipage}{0.7\textwidth} \begin{center} @@ -189,7 +81,7 @@ \vspace{0.5em} #2 - \ifthenelse{\equal{#3}{} \OR \equal{#2}{}}{}{---} + \ifboolexpr{test{\ifstrempty{#3}} or test{\ifstrempty{#2}}}{}{---} #3 \vspace{0.5em} @@ -201,7 +93,7 @@ } \newcommand\@clearpage[1]{% % Clear page if necessary - \ifthenelse{\equal{#1}{part} \OR \equal{#1}{chapter}}{ + \ifboolexpr{test{\ifdefstring{#1}{part}} or test{\ifdefstring{#1}{chapter}}}{ \cleardoublepage \thispagestyle{empty} }{} @@ -209,7 +101,7 @@ \newcommand{\play}[2][]{% \refstepcounter{play} - \ifthenelse{\equal{#1}{}}{ + \ifstrempty{#1}{ \def\@short{#2} }{ \def\@short{#1} @@ -217,7 +109,7 @@ \@clearpage{\@playlevel} \playmark{\@short} \addcontentsline{toc}{\@playlevel}{\@short} - \ifthenelse{\equal{\@playstyle}{custom}}{ + \ifdefstring{\@playstyle}{custom}{ \customplay{\theplay}{#2} }{ \@displaytitle{\@playstyle}{}{#2} @@ -225,7 +117,7 @@ } \WithSuffix\newcommand\play*[1]{% \@clearpage{\@playlevel} - \ifthenelse{\equal{\@playstyle}{custom}}{ + \ifdefstring{\@playstyle}{custom}{ \customplay*{#1} }{ \@displaytitle{\@playstyle}{}{#1} @@ -233,28 +125,28 @@ } \newcommand{\act}[2][]{% \refstepcounter{act} - \ifthenelse{\equal{#1}{}}{ + \ifstrempty{#1}{ \def\@short{#2} }{ \def\@short{#1} } - \ifthenelse{\equal{\@short}{}}{ - \def\@label{\actname{} \theact{}} + \ifdefempty{\@short}{ + \def\@label{\GetTranslation{Act} \theact{}} }{ - \def\@label{\actname{} \theact{}\xspace: } + \def\@label{\GetTranslation{Act} \theact{}\xspace: } } \@clearpage{\@actlevel} - \actmark{\@label\@short} + \actmark{\@short} \addcontentsline{toc}{\@actlevel}{\@label\@short} - \ifthenelse{\equal{\@actstyle}{custom}}{ + \ifdefstring{\@actstyle}{custom}{ \customact{\theact}{#2} }{ - \@displaytitle{\@actstyle}{\actname{} \theact}{#2} + \@displaytitle{\@actstyle}{\GetTranslation{Act} \theact}{#2} } } \WithSuffix\newcommand\act*[1]{% \@clearpage{\@actlevel} - \ifthenelse{\equal{\@actstyle}{custom}}{ + \ifdefstring{\@actstyle}{custom}{ \customact*{#1} }{ \@displaytitle{\@actstyle}{}{#1} @@ -262,76 +154,76 @@ } \newcommand{\scene}[2][]{% \refstepcounter{scene} - \ifthenelse{\equal{#1}{}}{ + \ifstrempty{#1}{ \def\@short{#2} }{ \def\@short{#1} } - \ifthenelse{\equal{\@short}{}}{ - \def\@label{\scenename{} \thescene{}} + \ifdefempty{\@short}{ + \def\@label{\GetTranslation{Scene} \thescene{}} }{ - \def\@label{\scenename{} \thescene{}\xspace: } + \def\@label{\GetTranslation{Scene} \thescene{}\xspace: } } \@clearpage{\@scenelevel} - \scenemark{\@label\@short} + \scenemark{\@short} \addcontentsline{toc}{\@scenelevel}{\@label\@short} - \ifthenelse{\equal{\@scenestyle}{custom}}{ + \ifdefstring{\@scenestyle}{custom}{ \customscene{\thescene}{#2} }{ - \@displaytitle{\@scenestyle}{\scenename{} \thescene}{#2} + \@displaytitle{\@scenestyle}{\GetTranslation{Scene} \thescene}{#2} } } \WithSuffix\newcommand\scene*[1]{% \@clearpage{\@scenelevel} - \ifthenelse{\equal{\@scenestyle}{custom}}{ + \ifdefstring{\@scenestyle}{custom}{ \customscene*{#1} }{ \@displaytitle{\@scenestyle}{}{#1} } } \newcommand{\interlude}[2][]{% - \ifthenelse{\equal{#1}{}}{ + \ifstrempty{#1}{ \def\@short{#2} }{ \def\@short{#1} } - \ifthenelse{\equal{\@short}{}}{ - \def\@label{\interludename{}} + \ifdefempty{\@short}{ + \def\@label{\GetTranslation{Interlude}} }{ - \def\@label{\interludename{}\xspace: } + \def\@label{\GetTranslation{Interlude}\xspace: } } - \ifthenelse{\equal{\@interludelevel}{play}}{ + \ifdefstring{\@interludelevel}{play}{ \@clearpage{\@playlevel} - \playmark{\@label\@short} + \playmark{\@short} \addcontentsline{toc}{\@playlevel}{\@label\@short} - \@displaytitle{\@playstyle}{\interludename}{#2} - }{\ifthenelse{\equal{\@interludelevel}{act}}{ + \@displaytitle{\@playstyle}{\GetTranslation{Interlude}}{#2} + }{\ifdefstring{\@interludelevel}{act}{ \@clearpage{\@actlevel} - \actmark{\@label\@short} + \actmark{\@short} \addcontentsline{toc}{\@actlevel}{\@label\@short} - \@displaytitle{\@actstyle}{\interludename}{#2} + \@displaytitle{\@actstyle}{\GetTranslation{Interlude}}{#2} }{% \@interludelevel is scene \@clearpage{\@scenelevel} - \scenemark{\@label\@short} + \scenemark{\@short} \addcontentsline{toc}{\@scenelevel}{\@label\@short} - \@displaytitle{\@scenestyle}{\interludename}{#2} + \@displaytitle{\@scenestyle}{\GetTranslation{Interlude}}{#2} }} } \WithSuffix\newcommand\interlude*[1]{% - \ifthenelse{\equal{\@interludelevel}{play}}{ + \ifdefstring{\@interludelevel}{play}{ \@clearpage{\@playlevel} - \@displaytitle{\@playstyle}{\interludename}{#1} - }{\ifthenelse{\equal{\@interludelevel}{act}}{ + \@displaytitle{\@playstyle}{\GetTranslation{Interlude}}{#1} + }{\ifdefstring{\@interludelevel}{act}{ \@clearpage{\@actlevel} - \@displaytitle{\@actstyle}{\interludename}{#1} + \@displaytitle{\@actstyle}{\GetTranslation{Interlude}}{#1} }{% \@interludelevel is scene \@clearpage{\@scenelevel} - \@displaytitle{\@scenestyle}{\interludename}{#1} + \@displaytitle{\@scenestyle}{\GetTranslation{Interlude}}{#1} }} } \newcommand\curtain{ \begin{center} - \sffamily\LARGE\bfseries \textsc{\curtainname} + \Large\textsc{\GetTranslation{Curtain}} \end{center} } \newcommand{\@maybexspace}{% @@ -340,97 +232,105 @@ \fi% } \newcommand{\@speaks}[2][]{% - \ifthenelse{\equal{#1}{}}{% + \ifstrempty{#1}{% \speakswithoutdirection{#2}% }{% \speakswithdirection{#2}{#1}% }\@maybexspace% } -\ifthenelse{\equal{\@characterstyle}{bold}}{% - % Bold style - \newcommand\speakswithdirection[2]{% - \noindent% - {\bfseries\sffamily #1} \emph{(#2)}\xspace:% - } - \newcommand\speakswithoutdirection[1]{% - \noindent% - {\bfseries\sffamily #1\xspace:}% - }% -}{}% -\ifthenelse{\equal{\@characterstyle}{center}}{% - % Center style - \newcommand\speakswithdirection[2]{% - \begin{center}% - \textsc{#1},\\\emph{#2}% - \end{center}% - }% - \newcommand\speakswithoutdirection[1]{% - \begin{center}% - \textsc{#1}% - \end{center}% - }% -}{}% -\ifthenelse{\equal{\@characterstyle}{imprimerie-verse}}{% - % Style for verse plays defined by the French Imprimerie nationale - \newcommand\speakswithdirection[2]{% - \begin{center}% - \textsc{#1}, \emph{#2}% - \end{center}% - }% - \newcommand\speakswithoutdirection[1]{% - \begin{center}% - \textsc{#1}% - \end{center}% - }% -}{}% -\ifthenelse{\equal{\@characterstyle}{imprimerie-prose}}{% - % Style for prose plays defined by the French Imprimerie nationale - \newcommand\speakswithdirection[2]{% - \noindent\hspace*{-\parindent}\textsc{#1}, \emph{#2}\xspace:% - }% - \newcommand\speakswithoutdirection[1]{% - \noindent\hspace*{-\parindent}\textsc{#1}\xspace:% - }% -}{}% -\ifthenelse{\equal{\@characterstyle}{arden}}{% - \newcommand\speakswithdirection[2]{% - \noindent\hspace*{-\parindent}\textsc{\MakeLowercase{#1}} [\emph{#2}]\quad% - }% - \newcommand\speakswithoutdirection[1]{% - \noindent\hspace*{-\parindent}\textsc{\MakeLowercase{#1}}\quad% - }% -}{}% -\ifthenelse{\equal{\@characterstyle}{simple}}{% - % Simple style - \newcommand\speakswithdirection[2]{% - \indent\textsc{#1}, \emph{#2}\xspace:% - }% - \newcommand\speakswithoutdirection[1]{% - \indent\textsc{#1}\xspace:% - }% -}{}% -\ifthenelse{\equal{\@characterstyle}{margin}}{% - % Margin style - \setlength{\leftskip}{3cm} - \newcommand\speakswithdirection[2]{% - \hspace{-3cm} #1 #2 - } - \newcommand\speakswithoutdirection[1]{% - \hspace{-3cm} #1 - }% -}{}% +\newenvironment{@smallcenter} + {\par\smallskip\centering} + {\par\nopagebreak\ignorespacesafterend} +\providecommand{\speakswithdirection}{} +\providecommand{\speakswithoutdirection}{} +\newcommand{\@setcharacterstyle}[1]{ + \ifstrequal{#1}{bold}{% + % Bold style + \renewcommand\speakswithdirection[2]{% + \noindent% + {\bfseries\sffamily ##1} \emph{(##2)}\xspace:% + } + \renewcommand\speakswithoutdirection[1]{% + \noindent% + {\bfseries\sffamily ##1\xspace:}% + }% + }{}% + \ifstrequal{#1}{center}{% + % Center style + \renewcommand\speakswithdirection[2]{% + \begin{center}% + \textsc{##1},\\\emph{##2}% + \end{center}% + \par\ignorespacesafterend% + }% + \renewcommand\speakswithoutdirection[1]{% + \begin{center}% + \textsc{##1}% + \end{center}% + \par\ignorespacesafterend% + }% + }{}% + \ifstrequal{#1}{imprimerie-verse}{% + % Style for verse plays defined by the French Imprimerie nationale + \renewcommand\speakswithdirection[2]{% + \begin{@smallcenter}% + \textsc{##1}, \emph{##2}% + \end{@smallcenter}% + }% + \renewcommand\speakswithoutdirection[1]{% + \begin{@smallcenter}% + \textsc{##1}% + \end{@smallcenter}% + }% + }{}% + \ifstrequal{#1}{imprimerie-prose}{% + % Style for prose plays defined by the French Imprimerie nationale + \renewcommand\speakswithdirection[2]{% + \noindent\hspace*{-\parindent}\textsc{##1}, \emph{##2}\xspace:% + }% + \renewcommand\speakswithoutdirection[1]{% + \noindent\hspace*{-\parindent}\textsc{##1}\xspace:% + }% + }{}% + \ifstrequal{#1}{arden}{% + \renewcommand\speakswithdirection[2]{% + \noindent\hspace*{-\parindent}\textsc{\MakeLowercase{##1}} [\emph{##2}]\quad% + }% + \renewcommand\speakswithoutdirection[1]{% + \noindent\hspace*{-\parindent}\textsc{\MakeLowercase{##1}}\quad% + }% + }{}% + \ifstrequal{#1}{simple}{% + % Simple style + \renewcommand\speakswithdirection[2]{% + \indent\textsc{##1}, \emph{##2}\xspace:% + }% + \renewcommand\speakswithoutdirection[1]{% + \indent\textsc{##1}\xspace:% + }% + }{}% + \ifstrequal{#1}{margin}{% + % Margin style + \setlength{\leftskip}{3cm} + \renewcommand\speakswithdirection[2]{% + \hspace{-3cm} ##1 ##2 + } + \renewcommand\speakswithoutdirection[1]{% + \hspace{-3cm} ##1 + }% + }{}% +} \newcommand{\@dramatis@clear}{} -\provideboolean{@dramatis@hidden} +\newcommand{\@empty@}{} +\providebool{@dramatis@hidden} \newenvironment{dramatis}[1][]{ \@dramatis@clear{} \undef{\@dramatis@clear} - \undef{\@dramatis@hook} - \newcommand{\@dramatis@hook}{} - \ifthenelse{\equal{#1}{hidden}}{ - \setboolean{@dramatis@hidden}{true} - }{\ifthenelse{\equal{#1}{}}{ - \setboolean{@dramatis@hidden}{false} - \gappto{\@dramatis@hook}{\begin{longtable}{l}} + \ifstrequal{#1}{hidden}{ + \booltrue{@dramatis@hidden} + }{\ifstrempty{#1}{ + \boolfalse{@dramatis@hidden} + \dramatisenv }{ \ClassError{thalie}{% Environment dramatis does not accept option #1.% @@ -439,43 +339,63 @@ } } }{% - \ifthenelse{\boolean{@dramatis@hidden}}{% - }{% - \gappto{\@dramatis@hook}{\end{longtable}} - \@dramatis@hook{}% - } -} -\newcommand{\@character}[2]{% - \ifthenelse{\( \equal{#1}{} \) \AND \( \equal{#2}{} \)}{% - ~% + \notbool{@dramatis@hidden}{% + \enddramatisenv }{}% - \ifthenelse{\( \NOT \equal{#1}{} \) \AND \( \equal{#2}{} \)}{% - #1% +} +\newenvironment{dramatisenv}{% + \list{}{\rightmargin1cm\leftmargin2cm}\item[] +}{% + \endlist% +} + +\newcommand{\dramatischaractername}[1]{\textbf{#1}} + +\newcommand{\dramatischaracterdescription}[1]{#1} + +\newcommand{\characterspace}{ % + \notbool{@dramatis@hidden}{% + \smallskip\newline % + }{} % +} + +\newcommand{\dramatischaracter}[2]{ % + \hspace*{-1cm} % + \ifboolexpr{(not test {\ifdefempty{#1}}) and test {\ifdefempty{#2}}}{% + \dramatischaractername{#1} % }{}% - \ifthenelse{\( \equal{#1}{} \) \AND \( \NOT \equal{#2}{} \)}{% - #2% + \ifboolexpr{ test{\ifdefempty{#1}} and not test{\ifdefempty{#2}}}{% + \dramatischaracterdescription{#2} % }{}% - \ifthenelse{\( \NOT \equal{#1}{} \) \AND \( \NOT \equal{#2}{} \)}{% - #1, #2% + \ifboolexpr{ (not test{\ifdefempty{#1}}) and (not test{\ifdefempty{#2}})}{% + \dramatischaractername{#1}, \dramatischaracterdescription{#2} % }{}% - \tabularnewline -} -\newcommand{\characterspace}{% - \gappto{\@dramatis@hook}{\@character{}{~}} + \newline % } -\newenvironment{charactergroup}[1]{% - \gdef\@groupname{#1} - \gappto{\@dramatis@hook}{ - \hspace{-7.2pt}\begin{math}\left. - \begin{tabular}{ll} - } + + \newlength{\@spaceaftergroup} +\newenvironment{charactergroup}[2][5cm]{% + \notbool{@dramatis@hidden}{% + \gdef\@groupname{#2} % + \gdef\@grouplength{#1} % + \hspace*{-1.3pt}\math\left. % + \minipage[c]{#1} % + \vspace*{2pt} % + }{}% }{% - \gappto{\@dramatis@hook}{ - \end{tabular} - \right\} \end{math} - } - \protected@xappto{\@dramatis@hook}{\@groupname} - \gappto{\@dramatis@hook}{\tabularnewline} + \notbool{@dramatis@hidden}{% + \vspace*{-8pt} % + \endminipage % + \right\} \endmath % + % + \setlength{\@spaceaftergroup}{\linewidth} + \addtolength\@spaceaftergroup{-\@grouplength} + \addtolength\@spaceaftergroup{-20pt} + \begin{minipage}[c]{\@spaceaftergroup} + \@groupname % + \end{minipage} + \newline % + }{}% } \newcommand{\setcharactername}[2]{% \expandafter\gdef\csname#1name\endcsname{% @@ -494,17 +414,16 @@ }% } \newcommand{\@definecharactercommand}[2]{% - \@ifundefined{#1}{% - }{% + \ifcsdef{#1}{% \ClassError{thalie}{% A command named \@backslashchar#1 already exists. We cannot define a new one.% }{% Choose another command name to introduce character #2's lines.% }% - }% - \@ifundefined{#1name}{% }{% + }% + \ifcsdef{#1name}{% \ClassError{thalie}{% A command named \@backslashchar#1name already exists. We cannot define a new one.% @@ -513,6 +432,7 @@ when a new command is defined by adding "name" to it, it does not conflict with an existing one. }% + }{% }% \setcharactername{#1}{#2}% } @@ -520,7 +440,8 @@ \def\defcharcommand@without#1{\@speaks{#1}} \pgfkeys{ % Character definition - /CHARACTER/.is family, /CHARACTER, + /THALIE/CHARACTER/.is family, + /THALIE/CHARACTER, cmd/.value required, cmd/.store in=\@cmd, drama/.value required, @@ -532,36 +453,34 @@ \undef{\@drama} \undef{\@cmd} \undef{\@desc} - \pgfkeys{/CHARACTER, #1}% + \pgfkeys{/THALIE/CHARACTER, #1}% % Forbidden combinations - \ifthenelse{ - \( \( \NOT \isundefined{\@cmd} \) \AND \equal{#2}{} \) \OR - \( \equal{#2}{} \AND \isundefined{\@cmd} \AND \isundefined{\@desc} \AND \isundefined{\@drama} \) \OR - \( \isundefined{\@cmd} \AND \( \NOT \equal{#2}{} \) \AND \( \NOT \isundefined{\@drama} \) \) + \ifboolexpr{ + ( test{\ifdef{\@cmd}} and test{\ifstrempty{#2}} ) or + ( test{\ifstrempty{#2}} and test{\ifundef{\@cmd}} and test{\ifundef{\@desc}} and test{\ifundef{\@drama}} ) or + ( test{\ifundef{\@cmd}} and (not test{\ifstrempty{#2}}) and test{\ifdef{\@drama}} ) }{ \ClassError{thalie}{Invalid character definition.}{All combination of omitted arguments are not allowed. See the documentation for more information} - }{ - % Defining character command - \ifthenelse{\( \NOT \isundefined{\@cmd} \) \AND \( \NOT \equal{#2}{} \)}{ - \@definecharactercommand{\@cmd}{#2} - }{ - } - \ifthenelse{ - \( \NOT \equal{#2}{} \) \AND \( \NOT \isundefined{\@cmd} \) \AND \( \NOT \isundefined{\@drama} \) \AND \isundefined{\@desc} - }{ - \ifthenelse{\equal{\@drama}{}}{ + }{} + % Defining character command + \ifboolexpr{ test{\ifdef{\@cmd}} and (not test{\ifstrempty{#2}}) }{% + \@definecharactercommand{\@cmd}{#2} + }{}% + \notbool{@dramatis@hidden}{% + \ifboolexpr{ (not test{\ifstrempty{#2}}) and test{\ifdef{\@cmd}} and test{\ifdef{\@drama}} and test{\ifundef{\@desc}}}{% + \ifdefempty{\@drama}{% % Hidden character. Nothing added to dramatis personae - }{ + }{% % Populating dramatis personae - \protected@xappto{\@dramatis@hook}{\noexpand\@character{\@drama}{}} - } - }{ + \dramatischaracter{\@drama}{\@empty@} + }% + }{% % Populating dramatis personae - \@ifundefined{@desc}{\def\@desc{}}{} - \@ifundefined{@drama}{\def\@drama{#2}}{} - \protected@xappto{\@dramatis@hook}{\noexpand\@character{\@drama}{\@desc}} - } - } + \ifcsundef{@desc}{\gdef\@desc{}}{}% + \ifcsundef{@drama}{\gdef\@drama{#2}}{}% + \dramatischaracter{\@drama}{\@desc} + }% + }{}% } \newcommand{\disposablecharacter}[2][]{% \@speaks[#1]{#2}% @@ -575,7 +494,7 @@ \end{em} \end{quote} } -\newcommand\pause{\did{\pausename}} +\newcommand\pause{\did{\GetTranslation{Pause}}} \newlength{\@verseadjust} @@ -595,6 +514,110 @@ \newcommand{\resumeverse}{% \hspace{\@verseadjust}\hspace{\the\dimen\@ne} } +\RequirePackage{pgfopts} + +\pgfkeys{ + % Character style + /THALIE/.cd, + characterstyle/.value required, + characterstyle/.default=simple, + characterstyle/.is choice, + characterstyle/bold/.code=\@setcharacterstyle{bold}, + characterstyle/center/.code=\@setcharacterstyle{center}, + characterstyle/margin/.code=\@setcharacterstyle{margin}, + characterstyle/simple/.code=\@setcharacterstyle{simple}, + characterstyle/arden/.code=\@setcharacterstyle{arden}, + characterstyle/imprimerie-verse/.code=\@setcharacterstyle{imprimerie-verse}, + characterstyle/imprimerie-prose/.code=\@setcharacterstyle{imprimerie-prose}, + characterstyle, +} + +\pgfkeys{ + % play style + /THALIE/.cd, + playstyle/.value required, + playstyle/.default=box, + playstyle/.is choice, + playstyle/center/.code=\def\@playstyle{center}, + playstyle/bigcenter/.code=\def\@playstyle{bigcenter}, + playstyle/box/.code=\def\@playstyle{box}, + playstyle/custom/.code=\def\@playstyle{custom}, + playstyle, +} +\pgfkeys{ + % act style + /THALIE/.cd, + actstyle/.value required, + actstyle/.default=bigcenter, + actstyle/.is choice, + actstyle/center/.code=\def\@actstyle{center}, + actstyle/bigcenter/.code=\def\@actstyle{bigcenter}, + actstyle/box/.code=\def\@actstyle{box}, + actstyle/custom/.code=\def\@actstyle{custom}, + actstyle, +} +\pgfkeys{ + % scene style + /THALIE/.cd, + scenestyle/.value required, + scenestyle/.default=center, + scenestyle/.is choice, + scenestyle/center/.code=\def\@scenestyle{center}, + scenestyle/bigcenter/.code=\def\@scenestyle{bigcenter}, + scenestyle/box/.code=\def\@scenestyle{box}, + scenestyle/custom/.code=\def\@scenestyle{custom}, + scenestyle, +} + +\pgfkeys{ + % play level + /THALIE/.cd, + playlevel/.value required, + playlevel/.default=chapter, + playlevel/.store in=\@playlevel, + playlevel, +} +\pgfkeys{ + % act level + /THALIE/.cd, + actlevel/.value required, + actlevel/.default=section, + actlevel/.store in=\@actlevel, + actlevel, +} +\pgfkeys{ + % scene level + /THALIE/.cd, + scenelevel/.value required, + scenelevel/.default=subsection, + scenelevel/.store in=\@scenelevel, + scenelevel, +} +\pgfkeys{ + % interlude level + /THALIE/.cd, + interludelevel/.value required, + interludelevel/.default=act, + interludelevel/.is choice, + interludelevel/play/.code=\def\@interludelevel{play}, + interludelevel/act/.code=\def\@interludelevel{act}, + interludelevel/scene/.code=\def\@interludelevel{scene}, + interludelevel, +} +\newif\if@xspace +\pgfkeys{ + % xspace option + /THALIE/.cd, + xspace/.value required, + xspace/.is if=@xspace, + xspace/.default=true, + xspace, +} + +\ProcessPgfPackageOptions{/THALIE} +\newcommand{\setthalieoptions}[1]{% + \pgfkeys{/THALIE/.cd, #1}% +} \endinput %% %% End of file `thalie.sty'. |