diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:54:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:54:25 +0000 |
commit | 609a1d771c503fd20375a25bfeb0fb52ca9cadd1 (patch) | |
tree | d1b4159d29d65a6bbaafd8ec7218e94ecac7afe6 | |
parent | 5cbffa83cb16c709dd45e6620d2a3ca5f4126362 (diff) |
dramatist
git-svn-id: svn://tug.org/texlive/trunk@838 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/tex/latex/dramatist/dramatist.sty | 472 |
1 files changed, 472 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/dramatist/dramatist.sty b/Master/texmf-dist/tex/latex/dramatist/dramatist.sty new file mode 100644 index 00000000000..74d814fc64d --- /dev/null +++ b/Master/texmf-dist/tex/latex/dramatist/dramatist.sty @@ -0,0 +1,472 @@ +%% +%% This is file `dramatist.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% dramatist.dtx (with options: `dramatist') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from dramatist.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file dramatist.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% dramatist.dtx +%% Copyright (C) 2003-2004 Massimiliano Dominici +%% \CharacterTable%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +\ProvidesPackage{dramatist}[2004/05/10 v1.2 Package for typesetting drama -- Author: Massimiliano Dominici] +\NeedsTeXFormat{LaTeX2e} +\@ifundefined{if@openright}{\newif\if@openright}{} +\newif\if@drverse +\newif\if@poemscol +\@ifpackageloaded{poemscol}{\@poemscoltrue}{\@poemscolfalse} +\newif\if@stagedir +\newif\if@lnpa +\newif\if@lnps +\newif\if@lnpd +\DeclareOption{lnpa}{\@lnpatrue} +\DeclareOption{lnps}{\@lnpstrue} +\ProcessOptions +\newcounter{storelineno} +\setcounter{storelineno}{0} +\if@poemscol\else +\refstepcounter{storelineno}\fi +\newcounter{storeprintlineindex} +\newcounter{character} +\newcounter{temp} +\newcounter{gtemp} +\newcounter{act} +\newcounter{scene}[act] +\renewcommand{\theact}{\roman{act}} +\renewcommand{\thescene}{\roman{scene}} +\newenvironment{drama}{% + \if@lnpa + \PackageWarning{dramatist}{\lnpwarning{a}} + \fi + \if@lnps + \PackageWarning{dramatist}{\lnpwarning{s}} + \fi + \list{}{% + \labelwidth\speakswidth + \itemindent\speaksindent + \itemsep\speechskip + \parsep\Dparsep + \labelsep\Dlabelsep + \let\makelabel\speakslabel} + } {\endlist} +\@namedef{drama*}{% + \@drversetrue + \if@poemscol + \begin{poem} + \setcounter{linenumber}{\value{storelineno}} + \setcounter{printlineindex}{\value{storeprintlineindex}} + \else + \begin{verse} + \fi + \ifx\poemlines\@undefined\else + \setcounter{poemline}{\value{storelineno}} + \fi} +\@namedef{enddrama*}{% + \ifx\poemlines\@undefined\else + \setcounter{storelineno}{\value{poemline}} + \fi + \if@poemscol + \end{poem} + \setcounter{storelineno}{\value{linenumber}} + \setcounter{storeprintlineindex}{\value{printlineindex}} + \else + \end{verse} + \fi + \@drversefalse} +\providecommand\phantomsection{} +\newcommand\actmark[1]{} +\newcommand\scenemark[1]{} +\newcommand\drampermark[1]{} +\newcommand\@openact{% + \@ifundefined{if@openright}{\clearpage}{% + \if@openright + \clearpage{\thispagestyle{empty}\cleardoublepage} + \else + \clearpage + \fi} + \thispagestyle{plain} + \refstepcounter{act} + \if@lnpa + \setcounter{storelineno}{0} + \if@poemscol + \setcounter{storeprintlineindex}{0} + \else + \refstepcounter{storelineno} + \fi + \fi +} +\newcommand\act{% + \@openact + \secdef\@act\@sact} +\newcommand\@act[1][]{% + \phantomsection + \addcontentsline{toc}{chapter}{\actname\ \theact} + \actmark{\actname\ \theact} + \m@ke@cthead{#1} + \@afterindentfalse + \@afterheading} +\newcommand\@sact[1][]{% + \m@ke@cthead{#1} + \@afterindentfalse + \@afterheading} +\newcommand\Act{% + \@openact + \secdef\@Act\@sact} +\def\@Act[#1]#2{% + \phantomsection + \ifnum\c@secnumdepth>\m@ne + \addcontentsline{toc}{chapter}{\actname\ \theact\ #1} + \else + \addcontentsline{toc}{chapter}{#1} + \fi + \actmark{\actname\ \theact\ #1} + \m@ke@cthead{#2} + \@afterindentfalse + \@afterheading} +\newcommand\m@ke@cthead[1]{% + \actheadstart + {\parindent \z@ + \ifnum\c@secnumdepth>\m@ne + \printactname \printsep \printactnum + \fi + \printacttitle{#1} + \afteract} +} +\newcommand\@openscene{% + \stepcounter{scene} + \if@lnps + \setcounter{storelineno}{0} + \if@poemscol + \setcounter{storeprintlineindex}{0} + \else + \refstepcounter{storelineno} + \fi + \fi +} +\newcommand\scene{% + \@openscene + \secdef\@scene\@sscene} +\newcommand\@scene[1][]{% + \phantomsection + \addcontentsline{toc}{section}{\scenename\ \thescene} + \scenemark{\scenename\ \thescene} + \m@kescenehead{#1} + \@afterindentfalse + \@afterheading} +\newcommand\@sscene[1][]{% + \m@kescenehead{#1} + \@afterindentfalse + \@afterheading} +\newcommand\Scene{% + \@openscene + \secdef\@Scene\@sscene} +\def\@Scene[#1]#2{% + \phantomsection + \ifnum\c@secnumdepth>\z@ + \addcontentsline{toc}{section}{\scenename\ \thescene\ #1} + \else + \addcontentsline{toc}{section}{#1} + \fi + \scenemark{\scenename\ \thescene\ #1} + \m@kescenehead{#2} + \@afterindentfalse + \@afterheading} +\newcommand\m@kescenehead[1]{% + \sceneheadstart + {\parindent \z@ + \ifnum\c@secnumdepth>\z@ + \printscenename \printsep \printscenenum + \fi + \printscenetitle{#1} + \afterscene} +} +\newcommand\Character{% + \@ifnextchar[{\@xcharacter}{\@character}} +\def\@xcharacter[#1]#2#3{% + \stepcounter{character} + \@character{#2}{#3} + \n@me@ppend@nddef{persona}{\roman{character}}{\castfont #1} +} +\def\@character#1#2{% + \@namedef{#2}{{\namefont #1}\intsp@ce{#1}\check@spr} + \n@me@ppend@nddef{#2}{\@ppendname}{% + \if@drverse + {\speakstab\speaksfont{#1}\speaksdel\par\nobreak\addvspace{-\parskip}} + \else + \item[#1\speaksdel] + \fi} +} +\newcommand{\n@me@ppend@nddef}[2]{% + \expandafter\def\csname#1#2\endcsname} +\newcommand{\@ppendname}{speaks} +\newenvironment{CharacterGroup}[1]{% + \stepcounter{character} + \newcounter{g\roman{character}} + \grouplist{#1} +}{} +\newsavebox{\tbox} +\newcommand\grouplist[1]{% + \global\n@me@ppend@nddef{persona}{\roman{character}}{% + \begin{lrbox}{\tbox} + \begin{minipage}[c]{.65\textwidth}\raggedright + \leftmargini=0pt + \begin{list}{}{\itemsep=0pt} + \dogrouplist + \end{list} + \end{minipage} + \end{lrbox} + \parbox{\CharWidth}{\usebox{\tbox}}% + \parbox{\ParenWidth}{$\left.\rule{0pt}{\ht\tbox}\right\}$} + \parbox{\CastWidth}{\castfont #1}} +} +\newcommand{\dogrouplist}{% + \ifnum\value{g\roman{temp}}>\value{gtemp} + \stepcounter{gtemp} + \item\@nameuse{gpersona\Roman{temp}\roman{gtemp}} + \dogrouplist + \fi + \setcounter{gtemp}{0} +} +\newcommand\GCharacter[3]{ + \stepcounter{g\roman{character}} + \global\@namedef{#3}{{\namefont #2}\intsp@ce{#2}\check@spr} + \global\n@me@ppend@nddef{#3}{\@ppendname}{% + \if@drverse + {\speakstab\speaksfont #2\par\nobreak\addvspace{-\parskip}} + \else + \item[#2] + \fi} + \global\n@me@ppend@nddef{gpersona\Roman{character}}{% + \roman{g\roman{character}}}{\castfont #1} +} +\newcommand\speaker[1]{% + \if@drverse + {\speakstab\speaksfont #1\speaksdel\par\nobreak\addvspace{-\parskip}} + \else + \item[#1\speaksdel] + \fi} +\let \nospace \relax +\let \check@spr \@empty +\def \intsp@ce #1{% + \def \reserved@a {#1}% + \ifx \reserved@a \@empty + \let \check@spr \@empty + \else + \ifx \reserved@a \space + \let \check@spr \@empty + \else + \check@nospace@ #1\nospace\@nil + \fi + \fi +} +\def \check@nospace@ #1#2\nospace#3\@nil {% + \let \check@spr \maybe@sp + \def \reserved@a {\nospace}% + \def \reserved@b {#1}% + \def \reserved@c {#3}% + \ifx \reserved@a \reserved@b + \ifx \reserved@c \@empty + \else + \let \check@spr \@empty + \fi + \else + \ifx \reserved@c \@empty + \else + \let \check@spr \@empty + \fi + \fi +} +\def \maybe@sp {\futurelet\@let@token\maybe@sp@} +\def \maybe@sp@ {% + \@tempswatrue + \expandafter\@tfor\expandafter\reserved@a\expandafter:\expandafter=% + \nospacelist + \do \t@st@sp + \if@tempswa \space \fi +} +\def \t@st@sp {% + \expandafter\let\expandafter\reserved@b\expandafter=\reserved@a\relax + \ifx\reserved@b\@let@token + \@tempswafalse + \@break@tfor + \fi +} +\def \nospacelist {,.;:?!)} +\newcommand{\DramPer}{% + \@ifundefined{if@openright}{\clearpage}{% + \if@openright\cleardoublepage\else\clearpage\fi} + \secdef\@dramper\@sdramper} +\newcommand\@dramper[1][]{% + \phantomsection + \addcontentsline{toc}{chapter}{\casttitlename} + \drampermark{\casttitlename} + \m@kedramperhead{#1}} +\newcommand\@sdramper[1][]{% + \m@kedramperhead{#1}} +\newcommand\m@kedramperhead[1]{ + \castheadstart + {\printcasttitle #1 + \aftercasttitle} + \begin{list}{}{\leftmargin=0pt \itemsep=0pt} + \dodramperlist + \end{list} +} +\newcommand{\dodramperlist}{% + \ifnum\value{character}>\value{temp} + \stepcounter{temp} + \item\@nameuse{persona\roman{temp}} + \dodramperlist + \fi +} +\newcommand{\direct}{% + \@ifstar\@sdirect\@direct} +\newcommand{\@direct}[1]{% + \if@drverse + \vskip2\normallineskip + \parbox[b]{\dirwidth}{\dirdelimiter{\emph{#1}}}\@centercr + \else + \dirdelimiter{\emph{#1}}\unskip + \fi +} +\newcommand{\@sdirect}[1]{% + \if@drverse + \vskip2\normallineskip + \parbox[b]{\dirwidth}{\dirdelimiter{\emph{#1}}}\\! + \else + \starrederror + \fi +} +\newcommand{\dirdelimiter}[1]{(#1)} +\newcommand{\StageDir}[1]{% + \begin{stagedir} + #1 + \end{stagedir} +} +\newenvironment{stagedir}{% + \StageDirOpenSettings}{% + \StageDirCloseSettings\global\@stagedirtrue} +\newcommand\StageDirOpenSettings{\begin{quote}\em} +\newcommand\StageDirCloseSettings{\end{quote}} +\newcommand\StageDirConf[2]{% + \renewcommand\StageDirOpenSettings{#1} + \renewcommand\StageDirCloseSettings{#2} +} +\newcommand\actcontentsline[1]{\actname\ \theact} +\newcommand{\actnamefont}{\scshape\Large} +\newcommand{\actnumfont}{\actnamefont} +\newcommand{\acttitlefont}{\actnamefont} +\newcommand{\actname}{Act} +\newcommand{\printactname}{\centering\actnamefont \actname} +\newcommand{\printactnum}{\actnumfont \theact} +\newcommand{\printacttitle}[1]{\acttitlefont\ #1} +\newcommand\scenecontentsline[1]{\scenename\ \thescene} +\newcommand{\scenenamefont}{\scshape\large} +\newcommand{\scenenumfont}{\scenenamefont} +\newcommand{\scenetitlefont}{\scenenamefont} +\newcommand{\scenename}{Scene} +\newcommand{\printscenename}{\centering\scenenamefont \scenename} +\newcommand{\printscenenum}{\scenenumfont \theact\intersep\thescene} +\newcommand{\printscenetitle}[1]{\scenetitlefont\ #1} +\newcommand{\intersep}{\ --\ } +\newcommand{\printsep}{\ } +\newcommand{\printcasttitle}{\centering\casttitlefont \casttitlename} +\newcommand{\casttitlefont}{\Large\scshape} +\newcommand{\casttitlename}{Dramatis Person\ae} +\newcommand{\castfont}{\normalfont} +\newcommand{\namefont}{\scshape} +\newcommand{\speaksfont}{\scshape} +\newcommand{\speaksdel}{} +\newlength{\CharWidth} +\setlength{\CharWidth}{.3\textwidth} +\newlength{\ParenWidth} +\setlength{\ParenWidth}{.05\textwidth} +\newlength{\CastWidth} +\setlength{\CastWidth}{.6\textwidth} +\def\actheadstart{\vspace*{\beforeactskip}} +\def\afteract{\par\nobreak\vskip\afteractskip} +\def\sceneheadstart{\vspace*{\beforesceneskip}} +\def\afterscene{\par\nobreak\vskip\aftersceneskip} +\def\castheadstart{\vspace*{\beforecastskip}} +\def\aftercasttitle{\par\nobreak\vskip\aftercasttitleskip} +\newcommand{\speakstab}{\hspace{\speaksskip}} +\newlength{\beforeactskip} +\setlength{\beforeactskip}{\baselineskip} +\newlength{\afteractskip} +\setlength{\afteractskip}{\baselineskip} +\newlength{\beforesceneskip} +\setlength{\beforesceneskip}{0pt} +\newlength{\aftersceneskip} +\setlength{\aftersceneskip}{\baselineskip} +\newlength{\beforecastskip} +\setlength{\beforecastskip}{0pt} +\newlength{\aftercasttitleskip} +\setlength{\aftercasttitleskip}{0pt} +\newlength{\speaksskip} +\setlength{\speaksskip}{1em} +\newlength{\dirwidth} +\setlength{\dirwidth}{.6\textwidth} +\newdimen\speakswidth +\speakswidth\z@ +\newdimen\speaksindent +\speaksindent=-\leftmargin +\newdimen\speechskip +\speechskip\itemsep +\newdimen\Dparsep +\Dparsep\z@ +\newdimen\Dlabelsep +\Dlabelsep\labelsep +\newcommand{\speakslabel}[1]{% + \hspace\labelsep \speaksfont{#1}} +\newcommand{\starrederror}{\PackageError{dramatist}{% + The starred version of this command is not available under the + option you have chosen} + {You probably misspelled the command.^^J% + Only the `verse' option supports a starred version of this + command.} +} +\newcommand{\lnpwarning}[1]{The option `lnp#1' is meaningless outside the% + `drama*' environment} +\newcommand{\inputfilewarning}{\PackageWarningNoLine{dramatist}{^^J^^J% +********************************************************^^J% +* No Configuration file found, using default settings. *^^J% +********************************************************^^J% +}} +\newcommand{\foundfile}{\PackageWarningNoLine{dramatist}{^^J^^J% +*******************************************^^J% +* Using Configuration file dramatist.cfg. *^^J% +*******************************************^^J% +}} +\InputIfFileExists{dramatist.cfg}{\foundfile}{\inputfilewarning} +%%\section{The GNU General Public License} + +\endinput +%% +%% End of file `dramatist.sty'. |