%%
%% 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-2005 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}[2005/12/01 v1.2d Package for typesetting drama -- Author: Massimiliano Dominici]
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{xspace}
\@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{verselinenumber}{\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{verselinenumber}}
        \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}\xspace}
    \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]{\CharWidth}\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\strut}}
}
\newcommand{\dogrouplist}{%
    \ifnum\value{g\Roman{temp}}>\value{gtemp}
        \stepcounter{gtemp}
        \item\@nameuse{gpersona@\Roman{temp}@\Roman{gtemp}}\strut
        \dogrouplist
    \fi
    \setcounter{gtemp}{0}
}
\newcommand\GCharacter[3]{
    \stepcounter{g\Roman{character}}
    \global\@namedef{#3}{{\namefont #2}\xspace}
    \global\n@me@ppend@nddef{#3}{\@ppendname}{%
        \if@drverse
            {\speakstab\speaksfont #2\speaksdel\par\nobreak\addvspace{-\parskip}}
        \else
            \item[#2\speaksdel]
        \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}
\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}}\strut
        \dodramperlist
    \fi
}
\newcommand{\direct}{%
    \@ifstar\@sdirect\@direct}
\newcommand{\@direct}[1]{%
    \if@drverse
        \vskip2\normallineskip
        \parbox[b]{\dirwidth}{\dirdelimiter{{\itshape #1}}}\@centercr
    \else
        \dirdelimiter{{\itshape #1}}\unskip
    \fi
}
\newcommand{\@sdirect}[1]{%
    \if@drverse
        \vskip2\normallineskip
        \parbox[b]{\dirwidth}{\dirdelimiter{\itshape #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'.