summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/play/play.cls
blob: 64dbe5b52e3a9879a0e384a7964dabf5e81c7fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
%%
%% This is file `play.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% play.dtx  (with options: `package,class')
%% This is a generated file. Generated from the source named above
%% The play package
%% Copyright 1999 James Kilfiger
%% This program can redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or (at your option) any later
%% version.
%% 
%% play - Typesetting Drama with LaTeX2e
%% \CheckSum{159}
%% \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         \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{play}[1999/03/26 A LaTeX class for typesetting plays]
\DeclareOption{lineno}{
  \newcommand{\PLthemoduloline}{\@tempcnta=\c@line
    \divide\@tempcnta\c@linemodulo
    \multiply\@tempcnta\c@linemodulo
    \ifnum\@tempcnta=\c@line\arabic{line}\fi}
  \newcommand{\@PLtypemodline}{%
    \ifnum\value{linemodulo}=0%
    \else
      \marginpar{\scriptsize\PLthemoduloline}%
    \fi}
  \newcommand{\@PLputline}{%
    \@PLtypemodline
    \refstepcounter{line}}%
}
\DeclareOption*{%
  \PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
\LoadClass{book}
\newcounter{act}
\newcounter{scene}[act]
\renewcommand{\theact}{\Roman{act}}
\renewcommand{\thescene}{\theact.\arabic{scene}}
\newcommand{\actname}{Act}
\newcommand{\scenename}{Scene}

\DeclareRobustCommand\act{\@ifstar{\@sact}{\@act}}

\newcommand{\@act}{%
  \refstepcounter{act}
  \chapter*{\actname~\theact}
  \addcontentsline{toc}{chapter}{\actname~\theact}}

\newcommand{\@sact}[1]{%
  \refstepcounter{act}
  \chapter*{#1}
  \addcontentsline{toc}{chapter}{#1}}

\DeclareRobustCommand{\scene}{\@ifstar{\@sscene}{\@scene}}

\newcommand{\@scene}{%
  \refstepcounter{scene}
  \section*{\scenename~\arabic{scene}}
   \addcontentsline{toc}{section}{\scenename~\arabic{scene}}}

\newcommand{\@sscene}[1]{%
  \refstepcounter{scene}
  \section*{#1}
  \addcontentsline{toc}{section}{\scenename~\arabic{scene}}}

\DeclareRobustCommand{\setting}[1]{\thesetting #1\endthesetting}
\newenvironment{thesetting}{\em\quotation}{\endquotation}
\newcounter{line}
\newcounter{linemodulo}\setcounter{linemodulo}{5}
\providecommand{\@PLtypemodline}{\relax}
\providecommand\@PLthemoduloline{\relax}
\providecommand{\typeline}{\marginpar{\scriptsize\theline}}
\providecommand{\@PLputline}{\relax}
\newcommand\shortdirectionopen{(}
\newcommand\shortdirectionclose{)}
\newcommand\directionfont{\em}
\DeclareRobustCommand*{\speaker}[1]{\item[#1]}
\DeclareRobustCommand*{\shortdirection}[1]{\shortdirectionopen
                                           {\directionfont#1\/}%
                                           \shortdirectionclose}
\DeclareRobustCommand{\longdirection}[1]%
           {{\list{}{\setlength{\topsep}{0pt}}\item\directionfont#1\endlist}}
\DeclareRobustCommand*{\phantomline}[1]{\leavevmode\phantom{#1}}
\newcommand*\speakerfont{\scshape}
\newcommand*\speakerdelim{}
\newcommand*{\@PLplaylabel}[1]{{\speakerfont#1\speakerdelim\hfil}}
\newenvironment{verseplay}[1][8em]{%
  \list{}{%
    \setcounter{line}{0}
    \refstepcounter{line}
    \def\\{\@PLputline\@centercr}
    \setlength\labelwidth{#1}
    \setlength\itemindent{-3em}
    \setlength\leftmargin{\labelwidth}
    \setlength{\itemsep}{0pt}
    \setlength{\parsep}{0pt}
    \addtolength\leftmargin{-\itemindent}
    \addtolength\leftmargin{\labelsep}
    \setlength\listparindent{\itemindent}
    \let\makelabel=\@PLplaylabel
  }
}
{\endlist}
\newenvironment{play}{%
  \list{}{%
    \setlength{\labelwidth}{0pt}
    \setlength{\labelsep}{1em}
    \setlength{\leftmargin}{1em}
    \setlength{\itemsep}{0pt}
    \setlength{\parsep}{0pt}
    \let\makelabel=\@PLplaylabel
  }
}
{\endlist}

\endinput
%%
%% End of file `play.cls'.