texlive[43994] Master/texmf-dist: thalie (23apr17)
commits+karl at tug.org
commits+karl at tug.org
Mon Apr 24 00:08:37 CEST 2017
Revision: 43994
http://tug.org/svn/texlive?view=revision&revision=43994
Author: karl
Date: 2017-04-24 00:08:37 +0200 (Mon, 24 Apr 2017)
Log Message:
-----------
thalie (23apr17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/thalie/thalie.pdf
trunk/Master/texmf-dist/source/latex/thalie/thalie.dtx
trunk/Master/texmf-dist/source/latex/thalie/thalie.ins
trunk/Master/texmf-dist/tex/latex/thalie/thalie.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/thalie/CHANGELOG.md
trunk/Master/texmf-dist/doc/latex/thalie/README.md
trunk/Master/texmf-dist/tex/latex/thalie/thalie-english.trsl
trunk/Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl
trunk/Master/texmf-dist/tex/latex/thalie/thalie-french.trsl
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/thalie/README
Added: trunk/Master/texmf-dist/doc/latex/thalie/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/thalie/CHANGELOG.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/thalie/CHANGELOG.md 2017-04-23 22:08:37 UTC (rev 43994)
@@ -0,0 +1,57 @@
+* thalie 0.9a (2017-04-22)
+
+ * Thalie.sty
+
+ * Commands `\playmark`, `\actmark` and `\scenemark` no longer include label (e.g. "Act 1"). It is up to the user to add it or not.
+ * Display default translations, even in language environments using non-latin characters where no latin font is available (closes #24).
+ * Do not add a wrong indentation after character name in verse environment (closes #3).
+ * Package options can be redefined anywhere in the document (closes #5).
+ * Reduce vertical space around character names in style `imprimerie-verse` (closes #6).
+ * Replace package [ifthen](http://ctan.org/pkg/ifthen) with package [etoolbox](http://ctan.org/pkg/etoolbox) (closes #29).
+ * Style of ramatis personæ can be customized (closes #9 #15 #18 #19).
+ * Use [translations](http://ctan.org/pkg/translations) to translate words ("act", "scene", etc.).
+
+ * Documentation
+
+ * Add sections *Examples* and *Localization*.
+ * Add a note about non-latin characters and character style `bold` (closes #26).
+ * Fix `\customact` example.
+ * Various minor improvements.
+
+ * README
+
+ * Convert README from text to markdown.
+ * Add examples.
+
+ -- Louis Paternault <spalax+thalie at gresille.org>
+
+* thalie 0.8 (2015-12-30)
+
+ * Fix release errors in previous release.
+
+ -- Louis Paternault <spalax+thalie at gresille.org>
+
+* thalie 0.7 (2015-12-28)
+
+ * Update project URL to http://framagit.org/spalax/thalie.
+ * Add commands `\pauseverse`, `\resumeverse` and `\adjustverse`.
+ * Add package option `xspace`.
+ * Minor documentation improvements.
+
+ -- Louis Paternault <spalax+thalie at gresille.org>
+
+* thalie 0.6 (2014-06-26)
+
+ * Add character style `imprimerie-verse`, `imprimerie-prose`, and `arden`.
+ * Correct a lot of typos in documentation (thanks Per).
+ * Better alignment of groups of characters.
+ * Improve spacing (thanks Caroline).
+ * Several documentation and core improvements.
+
+ -- Louis Paternault <spalax+thalie at gresille.org>
+
+* thalie 0.5 (2013-06-08)
+
+ * Initial release.
+
+ -- Louis Paternault <spalax+thalie at gresille.org>
Property changes on: trunk/Master/texmf-dist/doc/latex/thalie/CHANGELOG.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/thalie/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/thalie/README 2017-04-23 22:08:21 UTC (rev 43993)
+++ trunk/Master/texmf-dist/doc/latex/thalie/README 2017-04-23 22:08:37 UTC (rev 43994)
@@ -1,21 +0,0 @@
-Thalie
-
-A package providing tools to typeset drama plays. It defines commands to
-introduce characters' lines, to render stage directions, to divide a play into
-acts and scenes, to automatically build the dramatis personae, etc.
-
-VERSION: 0.8 (2015-12-30)
-
-PROJECT HOME PAGE: https://git.framasoft.org/spalax/thalie
-
-LICENSE
-
-Copyright 2010-2015 Louis Paternault
-
-This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
-of this license or (at your option) any later version.
-The latest version of this license is in
- http://www.latex-project.org/lppl.txt
- and version 1.3 or later is part of all distributions of LaTeX
- version 2005/12/01 or later.
Added: trunk/Master/texmf-dist/doc/latex/thalie/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/thalie/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/thalie/README.md 2017-04-23 22:08:37 UTC (rev 43994)
@@ -0,0 +1,30 @@
+Thalie — A LaTeX package providing tools to typeset drama plays
+===============================================================
+
+[![Sources](https://img.shields.io/badge/sources-thalie-brightgreen.svg)](http://framagit.org/spalax/thalie)
+[![CTAN](https://img.shields.io/ctan/v/thalie.svg)](http://ctan.org/pkg/thalie)
+[![Documentation](https://img.shields.io/badge/doc-pdf-brightgreen.svg)](http://mirrors.ctan.org/macros/latex/contrib/thalie/thalie.pdf)
+
+It defines commands to introduce characters' lines, to render stage direction,
+to divide a play into acts and scenes, to automatically build the dramatis
+personae, etc.
+
+- Version 0.9a (2017-04-22)
+- Usage and installation instruction are available in the [documentation](http://mirrors.ctan.org/macros/latex/contrib/thalie/thalie.pdf).
+- Examples
+ - [French play, in verse](https://framagit.org/spalax/thalie/raw/v0.9a/examples/cyrano.pdf) ([source](https://framagit.org/spalax/thalie/raw/v0.9a/examples/cyrano.tex))
+ - [French play, in prose](https://framagit.org/spalax/thalie/raw/v0.9a/examples/domjuan.pdf) ([source](https://framagit.org/spalax/thalie/raw/v0.9a/examples/domjuan.tex))
+ - [English play, in prose](https://framagit.org/spalax/thalie/raw/v0.9a/examples/hamlet.pdf) ([source](https://framagit.org/spalax/thalie/raw/v0.9a/examples/hamlet.tex))
+
+License
+-------
+
+*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 of this license or (at your option)
+any later version.
+
+The latest version of this license is in http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX version
+2005/12/01 or later.
Property changes on: trunk/Master/texmf-dist/doc/latex/thalie/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/thalie/thalie.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/thalie/thalie.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/thalie/thalie.dtx 2017-04-23 22:08:21 UTC (rev 43993)
+++ trunk/Master/texmf-dist/source/latex/thalie/thalie.dtx 2017-04-23 22:08:37 UTC (rev 43994)
@@ -1,5 +1,5 @@
% \iffalse meta-comment
-% 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
@@ -25,7 +25,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{thalie}
%<*package>
- [2015/12/30 v0.8 A package to typeset drama plays]
+ [2017/04/22 v0.9a A package to typeset drama plays]
%</package>
%
%<*driver>
@@ -34,7 +34,6 @@
\CodelineIndex
\RecordChanges
\usepackage{array}
-\usepackage{attachfile}
\usepackage{enumerate}
\usepackage{multirow}
\usepackage{hyperref}
@@ -41,7 +40,7 @@
\usepackage{thalie}
\usepackage{showexpl}
\lstset{language=[LaTeX]TeX, numbers=left, numberstyle=\tiny}
-\usepackage[francais,english]{babel}
+\usepackage[english]{babel}
\begin{document}
\DocInput{thalie.dtx}
\end{document}
@@ -67,56 +66,65 @@
%
% \GetFileInfo{thalie.dtx}
%
-% \DoNotIndex{\@backslashchar, \@ifnextchar, \@ifundefined, \\, \protect\`, \(, \)}
-% \DoNotIndex{\addcontentsline, \addto, \ae, \AND, \arabic}
-% \DoNotIndex{\begin, \bfseries, \boolean}
+% \DoNotIndex{\@backslashchar, \@ifnextchar, \protect\`}
+% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ ,\!,\(,\),\,}
+% \DoNotIndex{\addcontentsline, \addto, \ae, \AND, \arabic, \abovedisplayshortskip, \abovedisplayskip, \addtolength}
+% \DoNotIndex{\begin, \bfseries, \boolean, \baselineskip, \belowdisplayskip, \belowdisplayshortskip, \boolfalse, \booltrue}
% \DoNotIndex{\captionsenglish, \captionsfrench, \center, \centering, \ClassError, \cleardoublepage, \csname, \csundef}
-% \DoNotIndex{\def, \defcharcommand at with, \defcharcommand at without}
-% \DoNotIndex{\emph, \end, \endcsname, \equal, \expandafter}
-% \DoNotIndex{\framebox}
-% \DoNotIndex{\gappto, \gdef, \global}
+% \DoNotIndex{\def, \defcharcommand at with, \defcharcommand at without, \dimen, \dimexpr}
+% \DoNotIndex{\emph, \end, \endcsname, \equal, \expandafter, \endlist, \endmath, \endminipage}
+% \DoNotIndex{\framebox, \fi}
+% \DoNotIndex{\gappto, \gdef, \global, \GetTranslation}
% \DoNotIndex{\hspace}
-% \DoNotIndex{\ifthenelse, \@ifpackageloaded, \indent, \isundefined}
-% \DoNotIndex{\LARGE, \Large, \left, \leftskip}
-% \DoNotIndex{\medskip, \MakeUppercase, \markboth, \markright}
+% \DoNotIndex{\@ifpackageloaded, \indent, \if at xspace, \ifbool, \ifboolexpr, \ifcsundef, \ifcsdef, \ifdef, \ifdefempty, \ifdefstring, \ifstrempty, \ifstrequal, \ifundef, \ignorespacesafterend, \item}
+% \DoNotIndex{\LARGE, \Large, \left, \leftskip, \leftmargin, \list, \linewidth, \LoadDictionaryFor, \LoadDictionary}
+% \DoNotIndex{\medskip, \MakeUppercase, \markboth, \markright, \MakeLowercase, \math, \minipage}
% \DoNotIndex{
% \@actlevel,
% \@actstyle,
-% \@character,
-% \@characterstyle,
% \@clearpage,
+% \@cmd,
% \@definecharactercommand,
+% \@desc,
% \@displaytitle,
+% \@drama,
% \@dramatis at clear,
-% \@dramatis at hook,
+% \@empty@,
+% \@grouplength,
% \@groupname,
% \@interludelevel,
% \@label,
+% \@maybexspace,
+% \@ne,
% \@playlevel,
% \@playstyle,
% \@scenelevel,
% \@scenestyle,
% \@short,
+% \@spaceaftergroup,
% \@speaks,
+% \@verseadjust,
% }
-% \DoNotIndex{\newcommand, \newcounter, \newenvironment, \noindent, \noexpand, \NOT}
+% \DoNotIndex{\newcommand, \newcounter, \newenvironment, \noindent, \noexpand, \NOT, \newif, \newlength, \newline, \nopagebreak}
% \DoNotIndex{\OR}
-% \DoNotIndex{\par, \pgfkeys, \ProcessPgfPackageOptions, \protect, \provideboolean, \protected at xappto}
-% \DoNotIndex{\refstepcounter, \renewcommand, \RequirePackage, \right, \Roman}
-% \DoNotIndex{\section, \setboolean, \setlength, \sffamily}
-% \DoNotIndex{\tabularnewline, \textrm, \textsc, \textwidth, \thispagestyle}
+% \DoNotIndex{\par, \pgfkeys, \ProcessPgfPackageOptions, \protect, \protected at xappto, \parindent, \parskip, \predisplaysize, \prevgraf, \providebool}
+% \DoNotIndex{\quad},
+% \DoNotIndex{\refstepcounter, \renewcommand, \RequirePackage, \right, \Roman, \relax, \rightmargin}
+% \DoNotIndex{\section, \setboolean, \setlength, \sffamily, \smallskip}
+% \DoNotIndex{\tabularnewline, \textrm, \textsc, \textwidth, \thispagestyle, \textbf, \the, \tmp}
% \DoNotIndex{\undef}
-% \DoNotIndex{\vspace}
+% \DoNotIndex{\vspace, \vskip}
% \DoNotIndex{\WithSuffix}
-% \DoNotIndex{\xappto, \xspace}
+% \DoNotIndex{\xappto, \xspace, \xdef}
+% \DoNotIndex{\z@}
%
% \newcommand{\bbackslash}{\symbol{92}}
%
% \title{The \textsf{thalie} package\thanks{
% This document corresponds to \textsf{thalie}~\fileversion, dated \filedate.
-% Home page, bug requests, etc. at \url{http://git.framasoft.org/spalax/thalie}
+% Home page, bug requests, etc. at \url{http://framagit.org/spalax/thalie}
% }\\A package to typeset drama plays}
-% \author{Louis Paternault\\ \texttt{spalax(at)gresille(dot)org}}
+% \author{Louis Paternault\\ \texttt{spalax+thalie(at)gresille(dot)org}}
%
% \maketitle
%
@@ -170,9 +178,10 @@
%
% 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. Nevertheless,
-% if you like my work, you can send me smiles, cakes or poetry, or, better, the
-% text of the plays you write using my package\footnote{Seriously, it would
-% make me \emph{really} happy!}.
+% 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.}.
%
% \subsection{Acknowledgements}
% I borrowed ideas and lines of code from the \LaTeX{} packages
@@ -184,76 +193,76 @@
%
% \subsection{Examples}
%
-% All the examples are taken from Edmond Rostand's \emph{Cyrano de Bergerac}
+% Most of the examples are taken from Edmond Rostand's \emph{Cyrano de Bergerac}
% \cite{cyrano} or from William Shakespeare's \emph{A Midsummer Night's Dream}
% \cite{midsummer}. The snippets of \emph{Cyrano de Bergerac} are from the
% original (French) version of this play, roughly translated by myself (which
% means that they must be of poor quality).
%
-% A part of this play (now in public domain), is
-% \textattachfile[mimetype=text/plain,color=0 0 1]{examples/cyrano.tex}{attached to this
-% file}, as a working example of this package.
-%
% \subsection{Overview}
+% Installation instruction are given in section \ref{sec:install}.
% Documentation about how to use this package is given in section
% \ref{sec:usage}. In particular, section \ref{sec:sectioning} explains how to
-% use acts and scenes, section \ref{sec:characters} explains how to define
+% use acts and scenes, sections \ref{sec:dramatis} and \ref{sec:characters} explains how to define
% characters, and use these definitions to introduce characters' lines, and
% section \ref{sec:directions} describes commands used to render stage
-% directions.
+% directions. At last, specific instruction about how to use this package with
+% a language other than English (or a non-latin alphabet) are given in section
+% \ref{sec:i18n}. Examples are given in section \ref{sec:examples}.
%
% Implementation is given in section \ref{sec:implementation}.
%
+% \section{Download and Install}
+% \label{sec:install}
+%
+%
+% \subsection{\textsc{Gnu}/Linux Distribution}
+%
+% If applicable, the easiest way to get |thalie| working is by installing it by your distribution package. With Debian (and Ubuntu, and surely other distributions that inherit from Debian), simply run:
+%
+% \begin{quote}
+% |sudo apt-get install texlive-humanities|
+% \end{quote}
+%
+% \subsection{LaTeX distribution}
+%
+% This package is included both in \TeX{}Live and MiK\TeX{}. It can be installed by their respective package managers.
+%
+% \subsection{Manual installation}
+%
+% \begin{itemize}
+% \item Download the lastest archive :
+% \begin{description}
+% \item[Stable version] \url{http://mirrors.ctan.org/install/macros/latex/contrib/thalie.tds.zip}
+% \item[Development version] \url{https://framagit.org/spalax/thalie/repository/archive.zip?ref=master}
+% \end{description}
+% \item Unzip the archive.
+% \item If you got the archive from CTAN (stable version), move file \texttt{tex/latex/thalie/thalie.sty} in a \LaTeX{} path.
+% \item If you got the development version, |cd| to the main archive directory, and run |latex thalie.ins| to build |thalie.sty|. Move this file into a \LaTeX{} path.
+% \end{itemize}
+%
% \section{Usage}
% \label{sec:usage}
%
% \subsection{Localization}
-% \DescribeMacro{\playname}
-% \DescribeMacro{\actname}
-% \DescribeMacro{\scenename}
-% \DescribeMacro{\interludename}
-% \DescribeMacro{\pausename}
-% \DescribeMacro{\curtainname}
-% Language cannot be defined directly in this package. Instead, the language
-% currently used by the |babel| package (i.e. the language returned by
-% |babel|'s |\languagename| command) is used to display names.
+% \changes{v0.9a}{2017/04/22}{Add section \emph{Localization}.}
%
-% Package |babel|, and its languages you want to use, must be loaded
-% \emph{before} this package, otherwise localization will not be available.
+% By default, commands |\act|, |\scene|, etc. use English words, but they are
+% translated to the current language used by |babel| or
+% |polyglossia|\footnote{Given that someone provided the translation. Right
+% now, the only available languages are English and French.}. More information
+% is given in section \ref{sec:l10n}.
%
-% The effect of choosing a language or another is to translate some words. The
-% corresponding commands, and the words they correspond to, are listed in table
-% \ref{table:l10n}.
-%
-% \begin{table}
-% \centering
-% \begin{tabular}{ccc}
-% \hline
-% Command & Result (in English) & Result (in French) \\
-% \hline
-% |\playname| & Play & Pi\`ece \\
-% |\actname| & Act & Acte \\
-% |\scenename| & Scene & Sc\`ene \\
-% |\interludename| & Interlude & Interm\`ede \\
-% |\pausename| & Pause & Pause \\
-% |\curtainname| & Curtain & Rideau \\
-% \hline
-% \end{tabular}
-% \caption{Localization commands}
-% \label{table:l10n}
-% \end{table}
-%
-% If the option for your language does not exist\footnote{You can also send me
-% the translation for your language, to improve this package.}, or if you want
-% to change the default words used here, you can redefine the commands listed
-% in table \ref{table:l10n}. For instance use
-% |\renewcommand{\curtainname}{Tel\`on}| for Spanish (if I am not wrong).
-%
% \subsection{Package options}
% \label{sec:options}
%
% Package options are summed up in table \ref{table:packageoptions}.
%
+% Note that any package option can be redefined anywhere in the document. This
+% makes it possible to have several plays collected in a single document, while
+% applying different styles or options to each play. See section
+% \ref{sec:redefine} for more detail.
+%
% \begin{table}
% \centering
% \begin{tabular}{c|c|c}
@@ -326,6 +335,38 @@
% sectioning levels as the level, you may choose |play|, |act| or |scene|. It
% defines if an interlude is at the same level as a play, an act or a scene.
%
+% \subsubsection{Redefining options}
+% \label{sec:redefine}
+% \DescribeMacro{\setthalieoptions}
+%
+% Packages options can be reset in the document body using command
+% |\setthalieoptions|\marg{package options}. Its only argument has the same
+% syntax as the package options.
+%
+% 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.
+%
+% \iffalse
+%<*example>
+% \fi
+% \begin{lstlisting}
+\documentclass{book}
+...
+\usepackage{thalie}
+...
+\begin{document}
+...
+\play{First play}
+\setthalieoptions{characterstyle=imprimerie-verse}
+...
+\play{Second play}
+\setthalieoptions{characterstyle=impriemie-prose}
+...
+\end{document}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
% \subsection{Sectioning}
% \label{sec:sectioning}
% Here begin the parts explicitly relating to drama.
@@ -378,8 +419,8 @@
%
% \DescribeMacro{\curtain}
% At last, to mark the end of an act or of the play, you can use command
-% |\curtain|, which prints the word |\curtainname| in the middle of its own
-% line.
+% |\curtain|, which prints the word |\GetTranslation{Curtain}| in the middle of its
+% own line.
%
% \subsubsection{Title styles}
% \label{sec:sectionstyles}
@@ -401,13 +442,17 @@
% \begin{lstlisting}
\newcommand\customact[2]{
\begin{center}
- \textsc{#1}
+ \textsc{\GetTranslation{Act} #1}
#2
\end{center}
}
-\WithSuffix\newcommand\customact*[1]{\customact{}{#1}}
-% \end{lstlisting}
+\WithSuffix\newcommand\customact*[1]{
+ \begin{center}
+ #1
+ \end{center}
+}
+\end{lstlisting}
% \iffalse
%</example>
% \fi
@@ -453,12 +498,12 @@
% case if you did not choose the default option for |playlevel|, |actlevel| or
% |scenelevel|), you can redefine them.
%
-% \subsection{Characters}
-% \label{sec:characters}
-% This part explains how to define characters, introduce character's lines, and
-% build and display the dramatis person\ae{}.
+% Examples are given in section \ref{sec:examples:headers}.
%
-% \subsubsection{Dramatis person\ae{}}
+% \subsection{Dramatis person\ae}
+% \label{sec:dramatis}
+% This part explains how to build and display the dramatis person\ae{}.
+%
% Definition of characters is done in document body.
% As it is possible to have several plays in a single documents (for a
% collection of plays or sketches), it is possible to define several
@@ -542,15 +587,15 @@
% \multicolumn{2}{c||}{} & no \meta{cmd} & \meta{cmd} & no \meta{cmd} & \meta{cmd} \\
% \hline
% \hline
-% \multirow{4}{*}{no \meta{drama}} & \multirow{2}{*}{no \meta{desc}} & & & silent\up{\ref{character:silent}} & default\up{\ref{character:default}} \\
-% & & & & & hidden\up{\ref{character:hidden}}\\
+% \multirow{4}{*}{no \meta{drama}} & \multirow{2}{*}{no \meta{desc}} & & & silent\textsuperscript{\ref{character:silent}} & default\textsuperscript{\ref{character:default}} \\
+% & & & & & hidden\textsuperscript{\ref{character:hidden}}\\
% \cline{2-6}
-% & \multirow{2}{*}{ \meta{desc}} & description & & silent\up{\ref{character:silent}} & default\up{\ref{character:default}} \\
-% & & only\up{\ref{character:description}} & & & \\
+% & \multirow{2}{*}{ \meta{desc}} & description & & silent\textsuperscript{\ref{character:silent}} & default\textsuperscript{\ref{character:default}} \\
+% & & only\textsuperscript{\ref{character:description}} & & & \\
% \hline
-% \multirow{2}{*}{ \meta{drama}} & no \meta{desc} & silent\up{\ref{character:silent}} & & & default\up{\ref{character:default}} \\
+% \multirow{2}{*}{ \meta{drama}} & no \meta{desc} & silent\textsuperscript{\ref{character:silent}} & & & default\textsuperscript{\ref{character:default}} \\
% \cline{2-6}
-% & \meta{desc} & silent\up{\ref{character:silent}} & & & default\up{\ref{character:default}} \\
+% & \meta{desc} & silent\textsuperscript{\ref{character:silent}} & & & default\textsuperscript{\ref{character:default}} \\
% \hline
% \end{tabular}
%
@@ -576,8 +621,9 @@
% \DescribeEnv{charactergroup}
% It is possible to group several characters' definition if they have the same
% description. This is done with environment
-% |charactergroup|\marg{description}. For example, one can use code of figure
-% \ref{fig:charactergroup} to define the three sons of another character.
+% |charactergroup|\oarg{width}\marg{description}. The optional argument sets
+% the group width (on the left of the brace).
+% See an example on figure \ref{fig:charactergroup}.
%
% \begin{figure}[p]
% \centering
@@ -584,11 +630,11 @@
% \iffalse
%<*example>
% \fi
-% \begin{LTXexample}
+% \begin{LTXexample}[pos=b]
\begin{dramatis}
-\begin{charactergroup}{Two musicians}
- \character[desc={Gaston Henry}]{}
- \character[desc={Damon}]{}
+\begin{charactergroup}[2.5cm]{Officers}
+ \character[desc={a soldier}]{Marcellus}
+ \character[desc={a soldier}]{Bernardo}
\end{charactergroup}
\end{dramatis}
% \end{LTXexample}
@@ -595,21 +641,153 @@
% \iffalse
%</example>
% \fi
-% \caption[Defining a group of characters]{Defining a group of characters\footnotemark}
+% \caption[Defining a group of characters]{Defining a group of characters}
% \label{fig:charactergroup}
% \end{figure}
-% \footnotetext{
-% I admit I am cheating here. As it was difficult to find a single play that
-% illustrates every feature of this package, this snippet, in the original
-% \emph{Cyrano de Bergerac}, is used to give the names of the actors playing the
-% two musicians, which is a bit different from the purpose of the
-% |charactergroup| environment. Still, you can see how it is rendered,
-% which is the important part here.
-% }
%
% 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.
%
+% The behaviour of nested |charactergroup| environments is
+% undefined\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.}.
+%
+% \subsubsection{Customize style of dramatis person\ae}
+% \DescribeEnv{dramatisenv}
+% \DescribeMacro{\dramatischaracter}
+% \DescribeMacro{\dramatischaractername}
+% \DescribeMacro{\dramatischaracterdescription}
+%
+% A default style is used to display the dramatis person\ae, but is it made to
+% be customized.
+% The following commands can be redefined to make dramatis person\ae look
+% different. They do nothing apart from displaying text (no internal
+% definition, etc.).
+%
+% \begin{itemize}
+% \item |dramatisenv|: This environment wraps the dramatis person\ae.
+% \item |\dramatischaracter|\marg{name}\marg{description} Renders the character name and description. It should take care of cases where name or descsription (but not both) is missing.
+% \item |\dramatischaractername|\marg{name} Renders the character name.
+% \item |\dramatischaracterdescription|\marg{description} Renders the character description.
+% \item Environment |charactergroup|\oarg{width}\marg{description} Renders a group of characters.
+% \item |\characterspace| Adds a vertical character space.
+% \end{itemize}
+
+% Figure \ref{fig:dramatisconversion} illustrates how those commands are used.
+%
+% \begin{figure}[p]
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\begin{dramatis}
+ \character{The queen}
+ \character[desc={the queen's husband.}]{The king}
+ \begin{charactergroup}{Lords and ladies}
+ \character{Lord Foo}
+ \character[desc={Lord Foo's sister.}]{Lady Bar}
+ \character[desc={Lord and Lady Baz.}]{}
+ \end{charactergroup}
+ \characterspace
+ \character[desc={Several servants}]{}
+\end{dramatis}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% To display the dramatis person\ae{} above, the commands below are called.
+%
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\begin{dramatisenv}
+ \dramatischaracter{The queen}{}
+ \dramatischaracter{The king}{the queen's husband.}
+ \begin{charactergroup}{Lords and ladies}
+ \dramatischaracter{Lord Foo}{}
+ \dramatischaracter{Lady Bar}{Lord Foo's sister.}
+ \dramatischaracter{}{Lord and Lady Baz.}
+ \end{charactergroup}
+ \characterspace
+ \dramatischaracter{}{Several servants}
+\end{dramatisenv}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% And command |\dramatischaracter|\marg{Name}\marg{Description} 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).
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\newcommand{\dramatischaracter}[2]{ %
+ \dramatischaractername{#1}, \dramatischaracterdescription{#2}\\
+}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% \caption{Commands used to display the dramatis person\ae.}
+% \label{fig:dramatisconversion}
+% \end{figure}
+%
+% For example, to render character names in small caps, one would define :
+%
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}[numbers=none]
+\renewcommand{\dramatischaractername}[1]{\textsc{#1}}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% Or to make dramatis
+% person\ae{} include a title, one can define :
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}[numbers=none]
+\renewenvironment{dramatisenv}{%
+ \list{}{\rightmargin1cm\leftmargin2cm}\item[]
+ \act*{Dramatis person\ae}%
+}{%
+ \endlist%
+}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% \subsection{Characters}
+% \label{sec:characters}
+% This part explains how to define characters, and introduce character's lines.
+%
+% It has been explained that definition of a character in the dramatis
+% person\ae{} (previous subsection) also creates commands used to introduce
+% lines of characters. For instance, defining a character using
+% |\character[cmd=cyrano]{Cyrano}| means than Cyrano's lines can now be
+% introduced using the following code.
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\cyrano
+No! It's a bit short, young man\ldots
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% This would display the name \emph{Cyrano} using the current character style, then
+% his line.
+%
+% \subsubsection{Custom characters}
+%
% \paragraph{Disposable character}
% \DescribeMacro{\disposablecharacter}
% One can need to define characters that are used only once (or a few times).
@@ -620,6 +798,10 @@
% nothing is added to the dramatis person\ae{}. It is used in figure
% \ref{fig:setcharactername_example}.
%
+% This command is also useful to introduce lines of characters in non standard
+% ways, for instance if several characters speak at once. See examples in
+% section \ref{sec:examples:characterslines}.
+%
% \subsubsection{Changing character's name}
% \label{setcharactername}
% \DescribeMacro{\setcharactername}
@@ -679,12 +861,18 @@
% Several styles are available, to typeset character's name and lines in
% different ways. Change the style by loading package using option
% |characterstyle=|\marg{style} (available styles are |bold|, |center|,
-% |margin|, |simple|, |imprimerie-verse|, |imprimerie-prose|).
-% Note that |imprimerie-verse| and |imprimerie-prose| styles are French
+% |margin|, |simple|, |imprimerie-verse|, |imprimerie-prose|). A few notes:
+% \begin{itemize}
+% \item Default style is |simple|.
+% \item |imprimerie-verse| and |imprimerie-prose| styles are French
% \emph{de facto} standards for typesetting drama plays, respectively in verse
% and in prose, as defined by the \emph{Imprimerie nationale}
-% \cite{imprimerienationale}, and |arden| tries to mimick typesetting of the
-% Arden Shakespeare series. Default style is |simple|.
+% \cite{imprimerienationale}.
+% \item |arden| tries to mimick typesetting of the Arden Shakespeare series.
+% \item |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.)).
+% \end{itemize}
%
% \paragraph{Customize style}
% \DescribeMacro{\speakswithoutdirection}
@@ -726,7 +914,7 @@
%
% \DescribeMacro{\pause}
% As we often need to mark pauses in theater, we created the command |\pause|,
-% which is a shortcut for |\did{\pausename}|.
+% which is a shortcut for |\did{\GetTranslation{Pause}}|.
%
% \subsection{Splitting verses}
% \DescribeMacro{\pauseverse}
@@ -788,6 +976,173 @@
% in \LaTeX, so, defining these commands by default might conflict with other
% packages, while most of |thalie| users will not use them.
%
+% \section{Localization and Internationalization}
+% \label{sec:i18n}
+%
+% \subsection{Localization}
+% \label{sec:l10n}
+%
+% \changes{v0.9a}{2017/04/22}{Use package |translations| for localization.}
+%
+% Language cannot be defined directly in this package. Instead, the language
+% currently used by |babel| or |polyglossia| is used to translate the following
+% words (with or without capital letter, singular or plural): \emph{play},
+% \emph{act}, \emph{scene}, \emph{interlude}, \emph{pause}, \emph{curtain}.
+%
+% If the option for your language does not exist\footnote{You can also send me
+% the translation for your language, to improve this package.}, or if you want
+% to change the default words used here, you can set your own translation
+% using command |\DeclareTranslation| (see the |translations| package for more
+% information). For instance use
+% |\DeclareTranslation{Spanish}{Curtain}{Tel\`on}| for Spanish\footnote{I may
+% be wrong: I cannot speak Spanish.}.
+%
+% \subsubsection{Common translations}
+% \DescribeMacro{\playname}
+% \DescribeMacro{\actname}
+% \DescribeMacro{\scenename}
+% \DescribeMacro{\interludename}
+% \DescribeMacro{\pausename}
+% \DescribeMacro{\curtainname}
+%
+% Commands defined here are shorter versions of strings commonly translated.
+%
+% For instance, |\playname| is a shortcut for |\GetTranslation{Play}|,
+% |\actname| is a shortcut for |\GetTranslation{Act}|, and so on.
+%
+% \subsection{Non-latin alphabets}
+%
+% This package should work with languages using non-latin alphabets (greek,
+% hindi, etc.). However, here are a few remarks.
+%
+% \begin{itemize}
+% \item The |bold| character style (see section \ref{sec:lines}) can only be used if a sans serif font has been defined. For instance, for hindi, you might write in the preamble: |\newfontfamily\hindifontsf{Noto Sans Devanagari}|
+% \end{itemize}
+%
+% \subsection{Language specific comments}
+%
+% \subsubsection{English}
+%
+% \begin{itemize}
+% \item The |arden| character style tries to mimick the typestting of the Arden Shakespeare series.
+% \end{itemize}
+%
+% \subsubsection{French}
+%
+% \begin{itemize}
+% \item The |imprimerie-verse| and |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}.
+% \item The same book (\cite{imprimerienationale}) states that act numbers should be typeset in capital roman numerals (which is done by default with |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: |\renewcommand{\thescene}{\textsc{\roman{scene}}}|
+% \end{itemize}
+%
+% \subsubsection{Other languages}
+%
+% I do not know anything related to other 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!
+%
+% \section{Examples}
+% \label{sec:examples}
+% \changes{v0.9a}{2017/04/22}{Add section \emph{Examples}.}
+%
+% \subsection{Characters' lines}
+% \label{sec:examples:characterslines}
+%
+% \subsubsection{Introduce lines of several characters at the same time.}
+%
+% Since |\disposablecharacter| can display arbitrary text using the style of
+% character names, it can be used to render a custom text when two characters
+% are speaking together.
+%
+% \iffalse
+%<*example>
+% \fi
+% \begin{LTXexample}[pos=b, preset={
+\begin{dramatis}[hidden]
+ \character[cmd=alice]{Alice}
+ \character[cmd=bob]{Bob}
+ \character[cmd=eve]{Eve}
+\end{dramatis}
+}]
+\alice
+Let's open it.
+
+\disposablecharacter{\bobname and \evename}
+No!
+% \end{LTXexample}
+% \iffalse
+%</example>
+% \fi
+%
+% \subsubsection{Add a footnote on a character name}
+%
+% 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 |\disposablecharacter| command can be used instead.
+% \iffalse
+%<*example>
+% \fi
+% \begin{lstlisting}
+\disposablecharacter{\alicename\footnote{An interesting note.}}
+Hello, world!
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% \subsubsection{Add a footnote in a stage direction}
+%
+% Footnote must be protected to be included in stage directions.
+% \iffalse
+%<*example>
+% \fi
+% \begin{lstlisting}
+\cyrano[clapping his hands\protect\footnote{An interesting footnote.}]
+One!
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% \subsection{Headers and footers}
+% \label{sec:examples:headers}
+%
+% By default, with the |article| class, the header of the left page contains
+% the play name, and the header of the right page contains the act number.
+%
+% \subsubsection{Act number on left, scene number on right}
+%
+% \iffalse
+%<*example>
+% \fi
+% \begin{lstlisting}
+\renewcommand{\actmark}[1]{%
+ {\markboth{\MakeUppercase{\GetTranslation{Act}}\ \theact\ #1}{}}%
+}
+\renewcommand{\scenemark}[1]{%
+ {\markright{\MakeUppercase{\GetTranslation{Scene}}\ \thescene\ #1}}%
+}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% \subsubsection{Play name of left, act and scene name on right}
+%
+% \iffalse
+%<*example>
+% \fi
+% \begin{lstlisting}
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\fancyhf{}
+\fancyhead[RO]{%
+ \textit{\MakeUppercase{%
+ \GetTranslation{Act} \theact{}, %
+ \GetTranslation{Scene} \thescene%
+ }}%
+}
+\fancyhead[LE]{\leftmark}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
% \section{Implementation}
% \label{sec:implementation}
%
@@ -794,124 +1149,26 @@
% \subsection{Required packages}
% Loading some packages.
% \begin{macrocode}
-\RequirePackage{ifthen}
% Chapters, sections, etc
\RequirePackage{etoolbox}
\RequirePackage{suffix}
-% Dramatis person\ae{} is written using a table. Package "longtable" is used to be
-% able to write it on several pages.
-\RequirePackage{longtable}
+% Dramatis person\ae{} is written using a table.
+\RequirePackage{tabularx}
% Handling spaces after having introduced characters' lines.
\RequirePackage{xspace}
% \end{macrocode}
%
-% \subsection{Package options}
-% Manage package options.
+% \subsection{Localization}
+%
+% Use |translations|. Translations are defined in the |dicts/thalie-<LANGUAGE>.trsl| files.
% \begin{macrocode}
-\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 at xspace
-\pgfkeys{
- % xspace option
- /THALIE/.cd,
- xspace/.value required,
- xspace/.is if=@xspace,
- xspace/.default=true,
- xspace,
-}
-
-\ProcessPgfPackageOptions{/THALIE}
+\RequirePackage{translations}
+\LoadDictionary{thalie}
+\LoadDictionaryFor{fallback}{thalie}
% \end{macrocode}
%
-% \subsection{Localization}
+% \subsection{Obsolete localization commands}
+%
% \begin{macro}{\playname}
% \begin{macro}{\actname}
% \begin{macro}{\scenename}
@@ -918,29 +1175,14 @@
% \begin{macro}{\interludename}
% \begin{macro}{\curtainname}
% \begin{macro}{\pausename}
-% Definition of the commands used for localization. The \emph{only} way to
-% choose the language to use is by loading the |babel| package before loading
-% this one.
+% Shorter versions of commonly translated strings.
% \begin{macrocode}
-\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...
- }
-}{}
+\newcommand{\playname}{\GetTranslation{Play}}
+\newcommand{\actname}{\GetTranslation{Act}}
+\newcommand{\scenename}{\GetTranslation{Scene}}
+\newcommand{\interludename}{\GetTranslation{Interlude}}
+\newcommand{\curtainname}{\GetTranslation{Curtain}}
+\newcommand{\pausename}{\GetTranslation{Pause}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -961,7 +1203,10 @@
\markboth{\MakeUppercase{#1}}{}%
}
\newcommand{\actmark}[1]{%
- \markright{\MakeUppercase{#1}}%
+ \markright{\MakeUppercase{%
+ \GetTranslation{Act}\ \theact%
+ \ifdefempty{#1}{}{: #1}%
+ }}%
}
\newcommand{\scenemark}[1]{%
}
@@ -997,13 +1242,13 @@
% - 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}
@@ -1010,7 +1255,7 @@
#3
\end{center}
- }{\ifthenelse{\equal{#1}{box}}{
+ }{\ifdefstring{#1}{box}{
\begin{center}
\framebox{\begin{minipage}{0.7\textwidth}
\begin{center}
@@ -1018,7 +1263,7 @@
\vspace{0.5em}
#2
- \ifthenelse{\equal{#3}{} \OR \equal{#2}{}}{}{---}
+ \ifboolexpr{test{\ifstrempty{#3}} or test{\ifstrempty{#2}}}{}{---}
#3
\vspace{0.5em}
@@ -1036,7 +1281,7 @@
% \begin{macrocode}
\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}
}{}
@@ -1052,7 +1297,7 @@
% \begin{macrocode}
\newcommand{\play}[2][]{%
\refstepcounter{play}
- \ifthenelse{\equal{#1}{}}{
+ \ifstrempty{#1}{
\def\@short{#2}
}{
\def\@short{#1}
@@ -1060,7 +1305,7 @@
\@clearpage{\@playlevel}
\playmark{\@short}
\addcontentsline{toc}{\@playlevel}{\@short}
- \ifthenelse{\equal{\@playstyle}{custom}}{
+ \ifdefstring{\@playstyle}{custom}{
\customplay{\theplay}{#2}
}{
\@displaytitle{\@playstyle}{}{#2}
@@ -1068,7 +1313,7 @@
}
\WithSuffix\newcommand\play*[1]{%
\@clearpage{\@playlevel}
- \ifthenelse{\equal{\@playstyle}{custom}}{
+ \ifdefstring{\@playstyle}{custom}{
\customplay*{#1}
}{
\@displaytitle{\@playstyle}{}{#1}
@@ -1084,28 +1329,28 @@
% \begin{macrocode}
\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}
@@ -1121,28 +1366,28 @@
% \begin{macrocode}
\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}
@@ -1157,43 +1402,43 @@
% Define commands to introduce interludes.
% \begin{macrocode}
\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}
}}
}
% \end{macrocode}
@@ -1208,7 +1453,7 @@
% Curtain
\newcommand\curtain{
\begin{center}
- \sffamily\LARGE\bfseries \textsc{\curtainname}
+ \Large\textsc{\GetTranslation{Curtain}}
\end{center}
}
% \end{macrocode}
@@ -1233,7 +1478,7 @@
% takes two arguments: the character's name, and optionally, a stage direction.
% \begin{macrocode}
\newcommand{\@speaks}[2][]{%
- \ifthenelse{\equal{#1}{}}{%
+ \ifstrempty{#1}{%
\speakswithoutdirection{#2}%
}{%
\speakswithdirection{#2}{#1}%
@@ -1246,79 +1491,88 @@
% Definition of styles for introducing characters' lines. These
% commands can be overloaded by user.
% \begin{macrocode}
-\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
+ }%
+ }{}%
+}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1328,17 +1582,16 @@
% In this environment are defined characters.
% \begin{macrocode}
\newcommand{\@dramatis at clear}{}
-\provideboolean{@dramatis at hidden}
+\newcommand{\@empty@}{}
+\providebool{@dramatis at hidden}
\newenvironment{dramatis}[1][]{
\@dramatis at clear{}
\undef{\@dramatis at clear}
- \undef{\@dramatis at hook}
- \newcommand{\@dramatis at hook}{}
- \ifthenelse{\equal{#1}{hidden}}{
- \setboolean{@dramatis at hidden}{true}
- }{\ifthenelse{\equal{#1}{}}{
- \setboolean{@dramatis at hidden}{false}
- \gappto{\@dramatis at hook}{\begin{longtable}{l}}
+ \ifstrequal{#1}{hidden}{
+ \booltrue{@dramatis at hidden}
+ }{\ifstrempty{#1}{
+ \boolfalse{@dramatis at hidden}
+ \dramatisenv
}{
\ClassError{thalie}{%
Environment dramatis does not accept option #1.%
@@ -1347,63 +1600,90 @@
}
}
}{%
- \ifthenelse{\boolean{@dramatis at hidden}}{%
- }{%
- \gappto{\@dramatis at hook}{\end{longtable}}
- \@dramatis at hook{}%
- }
+ \notbool{@dramatis at hidden}{%
+ \enddramatisenv
+ }{}%
}
% \end{macrocode}
% \end{environment}
%
-% Generic character output
+% \begin{environment}{dramatisenv}
+% \changes{v0.9a}{2017/04/22}{It is now possible to customize style of dramatis person\ae.}
+% \begin{macro}{\dramatischaracter}
+% \begin{macro}{\dramatischaractername}
+% \begin{macro}{\dramatischaracterdescription}
+% \begin{macro}{\characterspace}
+% \begin{environment}{charactergroup}
+% \changes{v0.6}{2013/11/02}{Groups of characters are now aligned with other caracters.}
+% Customizable commands to build dramatis person\ae.
% \begin{macrocode}
-\newcommand{\@character}[2]{%
- \ifthenelse{\( \equal{#1}{} \) \AND \( \equal{#2}{} \)}{%
- ~%
+% Environment used to *display* dramatis personae.
+\newenvironment{dramatisenv}{%
+ \list{}{\rightmargin1cm\leftmargin2cm}\item[]
+}{%
+ \endlist%
+}
+
+% Display character name
+\newcommand{\dramatischaractername}[1]{\textbf{#1}}
+
+% Display character description
+\newcommand{\dramatischaracterdescription}[1]{#1}
+
+% Adds a vertical space
+\newcommand{\characterspace}{ %
+ \notbool{@dramatis at hidden}{%
+ \smallskip\newline %
+ }{} %
+}
+
+% Display dramatis personae name and description
+\newcommand{\dramatischaracter}[2]{ %
+ \hspace*{-1cm} %
+ \ifboolexpr{(not test {\ifdefempty{#1}}) and test {\ifdefempty{#2}}}{%
+ \dramatischaractername{#1} %
}{}%
- \ifthenelse{\( \NOT \equal{#1}{} \) \AND \( \equal{#2}{} \)}{%
- #1%
+ \ifboolexpr{ test{\ifdefempty{#1}} and not test{\ifdefempty{#2}}}{%
+ \dramatischaracterdescription{#2} %
}{}%
- \ifthenelse{\( \equal{#1}{} \) \AND \( \NOT \equal{#2}{} \)}{%
- #2%
+ \ifboolexpr{ (not test{\ifdefempty{#1}}) and (not test{\ifdefempty{#2}})}{%
+ \dramatischaractername{#1}, \dramatischaracterdescription{#2} %
}{}%
- \ifthenelse{\( \NOT \equal{#1}{} \) \AND \( \NOT \equal{#2}{} \)}{%
- #1, #2%
+ \newline %
+}
+
+% Environment to manage groups of characters
+ \newlength{\@spaceaftergroup}
+\newenvironment{charactergroup}[2][5cm]{%
+ \notbool{@dramatis at hidden}{%
+ \gdef\@groupname{#2} %
+ \gdef\@grouplength{#1} %
+ \hspace*{-1.3pt}\math\left. %
+ \minipage[c]{#1} %
+ \vspace*{2pt} %
}{}%
- \tabularnewline
-}
-% \end{macrocode}
-%
-% \begin{macro}{\characterspace}
-% Add space in the dramatis person\ae{}.
-% \begin{macrocode}
-\newcommand{\characterspace}{%
- \gappto{\@dramatis at hook}{\@character{}{~}}
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{environment}{charactergroup}
-% \changes{v0.6}{2013/11/02}{Groups of characters are now aligned with other caracters.}
-% Gathers definition of characters that share the same description.
-% \begin{macrocode}
-\newenvironment{charactergroup}[1]{%
- \gdef\@groupname{#1}
- \gappto{\@dramatis at hook}{
- \hspace{-7.2pt}\begin{math}\left.
- \begin{tabular}{ll}
- }
}{%
- \gappto{\@dramatis at hook}{
- \end{tabular}
- \right\} \end{math}
- }
- \protected at xappto{\@dramatis at hook}{\@groupname}
- \gappto{\@dramatis at hook}{\tabularnewline}
+ \notbool{@dramatis at hidden}{%
+ \vspace*{-8pt} %
+ \endminipage %
+ \right\} \endmath %
+ %
+ \setlength{\@spaceaftergroup}{\linewidth}
+ \addtolength\@spaceaftergroup{-\@grouplength}
+ \addtolength\@spaceaftergroup{-20pt}
+ \begin{minipage}[c]{\@spaceaftergroup}
+ \@groupname %
+ \end{minipage}
+ \newline %
+ }{}%
}
% \end{macrocode}
% \end{environment}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{environment}
%
% \subsubsection{Character definitions}
% \begin{macro}{\setcharactername}
@@ -1434,8 +1714,7 @@
% one is the name of the character corresponding to this command.
% \begin{macrocode}
\newcommand{\@definecharactercommand}[2]{%
- \@ifundefined{#1}{%
- }{%
+ \ifcsdef{#1}{%
\ClassError{thalie}{%
A command named \@backslashchar#1 already exists. We cannot define a new
one.%
@@ -1442,9 +1721,9 @@
}{%
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.%
@@ -1453,6 +1732,7 @@
when a new command is defined by adding "name" to it, it does not
conflict with an existing one.
}%
+ }{%
}%
\setcharactername{#1}{#2}%
}
@@ -1466,7 +1746,8 @@
% \begin{macrocode}
\pgfkeys{
% Character definition
- /CHARACTER/.is family, /CHARACTER,
+ /THALIE/CHARACTER/.is family,
+ /THALIE/CHARACTER,
cmd/.value required,
cmd/.store in=\@cmd,
drama/.value required,
@@ -1478,36 +1759,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 at 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 at xappto{\@dramatis at hook}{\noexpand\@character{\@drama}{}}
- }
- }{
+ \dramatischaracter{\@drama}{\@empty@}
+ }%
+ }{%
% Populating dramatis personae
- \@ifundefined{@desc}{\def\@desc{}}{}
- \@ifundefined{@drama}{\def\@drama{#2}}{}
- \protected at xappto{\@dramatis at hook}{\noexpand\@character{\@drama}{\@desc}}
- }
- }
+ \ifcsundef{@desc}{\gdef\@desc{}}{}%
+ \ifcsundef{@drama}{\gdef\@drama{#2}}{}%
+ \dramatischaracter{\@drama}{\@desc}
+ }%
+ }{}%
}
% \end{macrocode}
% \end{macro}
@@ -1551,9 +1830,9 @@
% \end{environment}
%
% \begin{macro}{\pause}
-% Shortcut for |\did{\pausename}|.
+% Shortcut for |\did{\GetTranslation{Pause}}|.
% \begin{macrocode}
-\newcommand\pause{\did{\pausename}}
+\newcommand\pause{\did{\GetTranslation{Pause}}}
% \end{macrocode}
% \end{macro}
@@ -1589,6 +1868,122 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Package options}
+% Manage package options.
+% \begin{macrocode}
+\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 at xspace
+\pgfkeys{
+ % xspace option
+ /THALIE/.cd,
+ xspace/.value required,
+ xspace/.is if=@xspace,
+ xspace/.default=true,
+ xspace,
+}
+
+\ProcessPgfPackageOptions{/THALIE}
+% \end{macrocode}
+%
+% \begin{macro}{\setthalieoptions}
+% \changes{v0.9a}{2017/04/22}{Add command \texttt{\bbackslash{}setthalieoptions}.}
+% Redefine package options.
+% \begin{macrocode}
+\newcommand{\setthalieoptions}[1]{%
+ \pgfkeys{/THALIE/.cd, #1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
% \changes{v0.5}{2013/06/08}{First published version.}
%
% \addcontentsline{toc}{section}{Change History}
Modified: trunk/Master/texmf-dist/source/latex/thalie/thalie.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/thalie/thalie.ins 2017-04-23 22:08:21 UTC (rev 43993)
+++ trunk/Master/texmf-dist/source/latex/thalie/thalie.ins 2017-04-23 22:08:37 UTC (rev 43994)
@@ -1,4 +1,4 @@
-%% Copyright 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
@@ -21,7 +21,7 @@
\usedir{tex/latex/thalie}
\preamble
-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
@@ -47,10 +47,10 @@
\Msg{* To finish the installation you have to move the *}
\Msg{* following file into a directory searched by TeX: *}
\Msg{* *}
-\Msg{* thalie.sty *}
+\Msg{* thalie.sty *}
\Msg{* *}
\Msg{* To produce the documentation run the file *}
-\Msg{* thalie.dtx through LaTeX. *}
+\Msg{* thalie.dtx through LaTeX. *}
\Msg{* *}
\Msg{* Happy TeXing! *}
\Msg{* *}
Added: trunk/Master/texmf-dist/tex/latex/thalie/thalie-english.trsl
===================================================================
--- trunk/Master/texmf-dist/tex/latex/thalie/thalie-english.trsl (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/thalie/thalie-english.trsl 2017-04-23 22:08:37 UTC (rev 43994)
@@ -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}
Added: trunk/Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl
===================================================================
--- trunk/Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/thalie/thalie-fallback.trsl 2017-04-23 22:08:37 UTC (rev 43994)
@@ -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
Added: trunk/Master/texmf-dist/tex/latex/thalie/thalie-french.trsl
===================================================================
--- trunk/Master/texmf-dist/tex/latex/thalie/thalie-french.trsl (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/thalie/thalie-french.trsl 2017-04-23 22:08:37 UTC (rev 43994)
@@ -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}
Modified: trunk/Master/texmf-dist/tex/latex/thalie/thalie.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/thalie/thalie.sty 2017-04-23 22:08:21 UTC (rev 43993)
+++ trunk/Master/texmf-dist/tex/latex/thalie/thalie.sty 2017-04-23 22:08:37 UTC (rev 43994)
@@ -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 at 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,13 +60,13 @@
% - 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}
@@ -181,7 +73,7 @@
#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,28 +154,28 @@
}
\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}
@@ -290,48 +182,48 @@
}
}
\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 at clear}{}
-\provideboolean{@dramatis at hidden}
+\newcommand{\@empty@}{}
+\providebool{@dramatis at hidden}
\newenvironment{dramatis}[1][]{
\@dramatis at clear{}
\undef{\@dramatis at clear}
- \undef{\@dramatis at hook}
- \newcommand{\@dramatis at hook}{}
- \ifthenelse{\equal{#1}{hidden}}{
- \setboolean{@dramatis at hidden}{true}
- }{\ifthenelse{\equal{#1}{}}{
- \setboolean{@dramatis at hidden}{false}
- \gappto{\@dramatis at hook}{\begin{longtable}{l}}
+ \ifstrequal{#1}{hidden}{
+ \booltrue{@dramatis at hidden}
+ }{\ifstrempty{#1}{
+ \boolfalse{@dramatis at hidden}
+ \dramatisenv
}{
\ClassError{thalie}{%
Environment dramatis does not accept option #1.%
@@ -439,43 +339,63 @@
}
}
}{%
- \ifthenelse{\boolean{@dramatis at hidden}}{%
- }{%
- \gappto{\@dramatis at hook}{\end{longtable}}
- \@dramatis at hook{}%
- }
+ \notbool{@dramatis at hidden}{%
+ \enddramatisenv
+ }{}%
}
-\newcommand{\@character}[2]{%
- \ifthenelse{\( \equal{#1}{} \) \AND \( \equal{#2}{} \)}{%
- ~%
+\newenvironment{dramatisenv}{%
+ \list{}{\rightmargin1cm\leftmargin2cm}\item[]
+}{%
+ \endlist%
+}
+
+\newcommand{\dramatischaractername}[1]{\textbf{#1}}
+
+\newcommand{\dramatischaracterdescription}[1]{#1}
+
+\newcommand{\characterspace}{ %
+ \notbool{@dramatis at hidden}{%
+ \smallskip\newline %
+ }{} %
+}
+
+\newcommand{\dramatischaracter}[2]{ %
+ \hspace*{-1cm} %
+ \ifboolexpr{(not test {\ifdefempty{#1}}) and test {\ifdefempty{#2}}}{%
+ \dramatischaractername{#1} %
}{}%
- \ifthenelse{\( \NOT \equal{#1}{} \) \AND \( \equal{#2}{} \)}{%
- #1%
+ \ifboolexpr{ test{\ifdefempty{#1}} and not test{\ifdefempty{#2}}}{%
+ \dramatischaracterdescription{#2} %
}{}%
- \ifthenelse{\( \equal{#1}{} \) \AND \( \NOT \equal{#2}{} \)}{%
- #2%
+ \ifboolexpr{ (not test{\ifdefempty{#1}}) and (not test{\ifdefempty{#2}})}{%
+ \dramatischaractername{#1}, \dramatischaracterdescription{#2} %
}{}%
- \ifthenelse{\( \NOT \equal{#1}{} \) \AND \( \NOT \equal{#2}{} \)}{%
- #1, #2%
+ \newline %
+}
+
+ \newlength{\@spaceaftergroup}
+\newenvironment{charactergroup}[2][5cm]{%
+ \notbool{@dramatis at hidden}{%
+ \gdef\@groupname{#2} %
+ \gdef\@grouplength{#1} %
+ \hspace*{-1.3pt}\math\left. %
+ \minipage[c]{#1} %
+ \vspace*{2pt} %
}{}%
- \tabularnewline
-}
-\newcommand{\characterspace}{%
- \gappto{\@dramatis at hook}{\@character{}{~}}
-}
-\newenvironment{charactergroup}[1]{%
- \gdef\@groupname{#1}
- \gappto{\@dramatis at hook}{
- \hspace{-7.2pt}\begin{math}\left.
- \begin{tabular}{ll}
- }
}{%
- \gappto{\@dramatis at hook}{
- \end{tabular}
- \right\} \end{math}
- }
- \protected at xappto{\@dramatis at hook}{\@groupname}
- \gappto{\@dramatis at hook}{\tabularnewline}
+ \notbool{@dramatis at 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,8 +414,7 @@
}%
}
\newcommand{\@definecharactercommand}[2]{%
- \@ifundefined{#1}{%
- }{%
+ \ifcsdef{#1}{%
\ClassError{thalie}{%
A command named \@backslashchar#1 already exists. We cannot define a new
one.%
@@ -502,9 +421,9 @@
}{%
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 at 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 at 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 at xappto{\@dramatis at hook}{\noexpand\@character{\@drama}{}}
- }
- }{
+ \dramatischaracter{\@drama}{\@empty@}
+ }%
+ }{%
% Populating dramatis personae
- \@ifundefined{@desc}{\def\@desc{}}{}
- \@ifundefined{@drama}{\def\@drama{#2}}{}
- \protected at xappto{\@dramatis at 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 at 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'.
More information about the tex-live-commits
mailing list