updated
[latex2e.git] / base / classes.dtx
blob0d5411aa9ba13a485cee1bd913850e3254c56cad
1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
4 % The LaTeX3 Project and any individual authors listed elsewhere
5 % in this file. 
6
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 %    http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX 
16 % version 2005/12/01 or later.
17
18 % This file has the LPPL maintenance status "maintained".
19
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23
24 % The list of derived (unpacked) files belonging to the distribution 
25 % and covered by LPPL is defined by the unpacking scripts (with 
26 % extension .ins) which are part of the distribution.
27
28 % \fi
29 % \CheckSum{2976}
30 %% \CharacterTable
31 %%  {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
32 %%   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
33 %%   Digits        \0\1\2\3\4\5\6\7\8\9
34 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
35 %%   Dollar        \$     Percent       \%     Ampersand     \&
36 %%   Acute accent  \'     Left paren    \(     Right paren   \)
37 %%   Asterisk      \*     Plus          \+     Comma         \,
38 %%   Minus         \-     Point         \.     Solidus       \/
39 %%   Colon         \:     Semicolon     \;     Less than     \<
40 %%   Equals        \=     Greater than  \>     Question mark \?
41 %%   Commercial at \@     Left bracket  \[     Backslash     \\
42 %%   Right bracket \]     Circumflex    \^     Underscore    \_
43 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
44 %%   Right brace   \}     Tilde         \~}
46 % \iffalse
47 % \section{Identification}
49 %    These document classes can only be used with \LaTeXe, so we make
50 %    sure that an appropriate message is displayed when another \TeX{}
51 %    format is used.
52 % \changes{v1.3p}{1995/11/30}{Added date of \LaTeX\ format to argument
53 %    of \cs{NeedsTeXFormat}}
54 %    \begin{macrocode}
55 %<article|report|book>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
56 %    \end{macrocode}
58 %    Announce the Class name and its version:
59 %    \begin{macrocode}
60 %<article>\ProvidesClass{article}
61 %<report>\ProvidesClass{report}
62 %<book>\ProvidesClass{book}
63 %<10pt&!bk>\ProvidesFile{size10.clo}
64 %<11pt&!bk>\ProvidesFile{size11.clo}
65 %<12pt&!bk>\ProvidesFile{size12.clo}
66 %<10pt&bk>\ProvidesFile{bk10.clo}
67 %<11pt&bk>\ProvidesFile{bk11.clo}
68 %<12pt&bk>\ProvidesFile{bk12.clo}
69 %<*driver>
70 \ProvidesFile{classes.drv}
71 %</driver>
72               [2007/10/19 v1.4h
73 %<article|report|book> Standard LaTeX document class]
74 %<10pt|11pt|12pt>      Standard LaTeX file (size option)]
75 %    \end{macrocode}
77 % \section{A driver for this document}
79 % The next bit of code contains the documentation driver file for
80 % \TeX{}, i.e., the file that will produce the documentation you are
81 % currently reading. It will be extracted from this file by the 
82 % {\sc docstrip} program.
84 % \changes{1.0f}{1993/12/07}{Use class ltxdoc document class}
85 % \changes{1.0r}{1994/02/28}{Moved driver code in order not to need a
86 %    separate driver}
87 %    \begin{macrocode}
88 %<*driver>
90 \documentclass{ltxdoc}
91 %    \end{macrocode}
93 %    We don't want everything to appear in the index
94 %    \begin{macrocode}
95 \DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
96 \DoNotIndex{\@badmath,\@centercr,\@cite}
97 \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
98 \DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
99 \DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint}
100 \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
101 \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
102 \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
103 \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
104 \DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
105 \DoNotIndex{\bullet}
106 \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
107 \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
108 \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
109 \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
110 \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
111 \DoNotIndex{\fbox}
112 \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
113 \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
114 \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
115 \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
116 \DoNotIndex{\input}
117 \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
118 \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
119 \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
120 \DoNotIndex{\NeedsTeXFormat,\newdimen}
121 \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
122 \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
123 \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
124 \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
125 \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
126 \DoNotIndex{\refstepcounter,\relax,\renewcommand}
127 \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily}
128 \DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength}
129 \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
130 \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
131 \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
132 \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
133 \DoNotIndex{\wd,\xiipt,\year,\z@}
134 %    \end{macrocode}
135 %    We do want an index, using linenumbers
136 %    \begin{macrocode}
137 \EnableCrossrefs
138 \CodelineIndex
139 %    \end{macrocode}
140 %    We use so many \file{docstrip} modules that we set the
141 %    \texttt{StandardModuleDepth} counter to 1.
142 %    \begin{macrocode}
143 \setcounter{StandardModuleDepth}{1}
144 %    \end{macrocode}
145 %    The following command retrieves the date and version information
146 %    from the file.
147 %    \begin{macrocode}
148 \GetFileInfo{classes.drv}
149 %    \end{macrocode}
150 %    Some commonly used abbreviations
151 % \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*}}
152 %    \begin{macrocode}
153 \newcommand*{\Lopt}[1]{\textsf {#1}}
154 \newcommand*{\file}[1]{\texttt {#1}}
155 \newcommand*{\Lcount}[1]{\textsl {\small#1}}
156 \newcommand*{\pstyle}[1]{\textsl {#1}}
157 %    \end{macrocode}
158 %    We also want the full details.
159 %    \begin{macrocode}
160 \begin{document}
161 \DocInput{classes.dtx}
162 \PrintIndex
163 % ^^A\PrintChanges
164 \end{document}
165 %</driver>
166 %    \end{macrocode}
168 % \fi
170 % \changes{v1.0d}{1993/11/30}{remove \cs{@in}, made option makeindex
171 %    a synonym for option makeidx}
172 % \changes{v1.0d}{1993/11/30}{removed \cs{@minus}, \cs{@plus},
173 %    \cs{@settopoint}, \cs{@setfontsize}; they are now in the
174 %    kernel}
175 % \changes{v1.0d}{1993/11/30}{Added use of \cs{NeedsTeXFormat}}
176 % \changes{v1.0d}{1993/11/30}{Replaced \cs{bf} with \cs{bfseries};
177 %    \cs{rm} with \cs{rmfamily}}
178 % \changes{v1.0d}{1993/11/30}{Made eqaution and eqnarray environments
179 %    in the fleqn option up to date with latex.dtx}
180 % \changes{v1.0f}{1993/12/08}{Made all lines shorter than 72 characters}
181 % \changes{v1.0g}{1993/12/08}{Made change in eqnarray for the fleqn
182 %    option, as suggested by Rainer.}
183 % \changes{v1.0h}{1993/12/18}{Made the definitions of the font- and
184 %    size-changing commands use \cs{renew} rather than \cs{new}.
185 %    Defined the float parameters with \cs{renewcommand} rather than
186 %    \cs{newcommand}.  Corrected some typos in the fleqn option.
187 %    Replaced two occurrences of -\cs{@secpenalty} by
188 %    \cs{@secpenalty}.  ASAJ.}
189 % \changes{v1.0j}{1993/12/20}{Added \cs{ProvidesFile} to size files}
190 % \changes{v1.0j}{1993/12/10}{Use \cs{cmd} in change entries}
191 % \changes{v1.0k}{1994/01/09}{Removed some typos/bugs}
192 % \changes{v1.0l}{1994/01/11}{add the extension to the names of the
193 %     files} 
194 % \changes{v1.0l}{1994/01/10}{Changed version numbering; moved leqno
195 %    and fleqn options to an external file.}
196 % \changes{v1.0n}{1994/01/19}{Removed code for makeidx option and made
197 %    it a separate package; removed use of \cs{setlength} from list
198 %    parameters.}
199 % \changes{v1.0o}{1994/01/31}{Small documention changes}
200 % \changes{v1.0q}{1994/02/16}{Small documention changes}
201 % \changes{v1.1a}{1994/03/12}{Removed \cs{typeout} messages}
202 % \changes{v1.1f}{1994/04/15}{Inserted forgotten line break}
203 % \changes{v1.2a}{1994/03/17}{Added openright option. (LL)}
204 % \changes{v1.2b}{1994/03/17}{Added the \ldots{}matter commands. (LL)}
205 % \changes{v1.2c}{1994/03/17}{Fixed page numbering in titlepage
206 %    env. (LL)}
207 % \changes{v1.2d}{1994/04/11}{Checked the file for long lines and
208 %    wrapped them when necessary; made a slight implementation
209 %    modification to the openright and openany options.}
210 % \changes{v1.2i}{1994/04/28}{Use LaTeX instead of LaTeX2e in messages}
211 % \changes{v1.2j}{1994/05/01}{Removed the use of \cs{fileversion}
212 %    c.s.}
213 % \changes{v1.2l}{1994/05/11}{changed some \cs{changes} entries}
214 % \changes{v1.2m}{1994/05/12}{Forgot a few entries}
215 % \changes{v1.2o}{1994/05/24}{Changed file information}
216 % \changes{v1.2p}{1994/05/27}{Moved identification and driver to the
217 %    front of the file}
218 % \changes{v1.2t}{1994/06/22}{Refrased a few sentences to prevent
219 %    overfull hboxes}
220 % \changes{v1.2v}{1994/12/01}{Made the oneside option work for the
221 %    book class}
222 % \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*} for commands with
223 %    arguments}
224 % \changes{v1.2z}{1995/05/16}{Always use \cs{cs} in \cs{changes}
225 %    entries}
226 % \changes{v1.3a}{1995/05/17}{Replaced all \cs{hbox to} by \cs{hb@xt@}}
227 % \changes{v1.3d}{1995/06/05}{Replaced all \cs{uppercase} by
228 %    \cs{MakeUppercase}}
229 % \changes{v1.3l}{1995/10/20}{Disabled in compatibility mode all
230 %    options that are new in \LaTeXe.}
231 % \changes{v1.3v}{1997/06/16}{Documentation fixes.}
234 % \title{Standard Document Classes for \LaTeX{} version 2e\thanks{This
235 %    file has version number \fileversion, last revised \filedate.}}
237 % \author{%
238 % Copyright (C) 1992 by Leslie Lamport \and
239 % Copyright (C) 1994-97 by Frank Mittelbach \and Johannes Braams
240 % }
241 % \date{\filedate}
242 % \maketitle
243 % \tableofcontents
245 % \StopEventually{}    ^^A 
247 % \section{The {\sc docstrip} modules}
249 % The following modules are used in the implementation to direct
250 % {\sc docstrip} in generating the external files:
251 % \begin{center}
252 % \begin{tabular}{ll}
253 %   article & produce the documentclass article\\
254 %   report  & produce the documentclass report\\
255 %   size10  & produce the class option for 10pt\\
256 %   size11  & produce the class option for 11pt\\
257 %   size12  & produce the class option for 12pt\\
258 %   book    & produce the documentclass book\\
259 %   bk10    & produce the book class option for 10pt\\
260 %   bk11    & produce the book class option for 11pt\\
261 %   bk12    & produce the book class option for 12pt\\
262 %   driver  & produce a documentation driver file \\
263 % \end{tabular}
264 % \end{center}
266 % \section{Initial Code}
268 %    In this part we define a few commands that are used later on.
270 % \begin{macro}{\@ptsize}
271 %    This control sequence is used to store the second digit of the
272 %    pointsize we are typesetting in. So, normally, it's value is one
273 %    of 0, 1 or 2.
274 %    \begin{macrocode}
275 %<*article|report|book>
276 \newcommand\@ptsize{}
277 %    \end{macrocode}
278 % \end{macro}
280 % \begin{macro}{\if@restonecol}
281 %    When the document has to printed in two columns, we sometimes
282 %    have to temporarily switch to one column. This switch is used to
283 %    remember to switch back.
284 %    \begin{macrocode}
285 \newif\if@restonecol
286 %    \end{macrocode}
287 % \end{macro}
289 % \begin{macro}{\if@titlepage}
290 %    A switch to indicate if a titlepage has to be produced.  For the
291 %    article document class the default is not to make a separate
292 %    titlepage.
293 %    \begin{macrocode}
294 \newif\if@titlepage
295 %<article>\@titlepagefalse
296 %<!article>\@titlepagetrue
297 %    \end{macrocode}
298 % \end{macro}
300 % \begin{macro}{\if@openright}
301 %    A switch to indicate if chapters must start on a right-hand page.
302 %    The default for the report class is no; for the book class it's
303 %    yes.
304 %    \begin{macrocode}
305 %<!article>\newif\if@openright
306 %    \end{macrocode}
307 % \end{macro}
309 % \changes{v1.3k}{1995/08/27}{Macro \cs{if@openbib} removed}
311 % \begin{macro}{\if@mainmatter}
312 % \changes{v1.2v}{1994/12/01}{Moved the allocation of
313 %    \cs{if@mainmatter} here}
315 %    The switch |\if@mainmatter|, only available in the document class
316 %    book, indicates whether we are processing the main material in
317 %    the book.
318 %    \begin{macrocode}
319 %<book>\newif\if@mainmatter \@mainmattertrue
320 %    \end{macrocode}
321 %  \end{macro}
323 % \section{Declaration of Options}
326 % \subsection{Setting Paper Sizes}
328 %    The variables |\paperwidth| and |\paperheight| should reflect the
329 %    physical paper size after trimming. For desk printer output this
330 %    is usually the real paper size since there is no post-processing.
331 %    Classes for real book production will probably add other paper
332 %    sizes and additionally the production of crop marks for trimming.
333 %    In compatibility mode, these (and some of the subsequent) options
334 %    are disabled, as they were not present in \LaTeX 2.09.
335 % \changes{v1.0g}{1993/12/09}{Removed typo, A4 is not 279 mm high}
336 %    \begin{macrocode}
337 \if@compatibility\else
338 \DeclareOption{a4paper}
339    {\setlength\paperheight {297mm}%
340     \setlength\paperwidth  {210mm}}
341 \DeclareOption{a5paper}
342    {\setlength\paperheight {210mm}%
343     \setlength\paperwidth  {148mm}}
344 \DeclareOption{b5paper}
345    {\setlength\paperheight {250mm}%
346     \setlength\paperwidth  {176mm}}
347 \DeclareOption{letterpaper}
348    {\setlength\paperheight {11in}%
349     \setlength\paperwidth  {8.5in}}
350 \DeclareOption{legalpaper}
351    {\setlength\paperheight {14in}%
352     \setlength\paperwidth  {8.5in}}
353 \DeclareOption{executivepaper}
354    {\setlength\paperheight {10.5in}%
355     \setlength\paperwidth  {7.25in}}
356 %    \end{macrocode}
358 %    The option \Lopt{landscape} switches the values of |\paperheight|
359 %    and |\paperwidth|, assuming the dimensions were given for portrait
360 %    paper.
361 %    \begin{macrocode}
362 \DeclareOption{landscape}
363    {\setlength\@tempdima   {\paperheight}%
364     \setlength\paperheight {\paperwidth}%
365     \setlength\paperwidth  {\@tempdima}}
367 %    \end{macrocode}
369 % \subsection{Choosing the type size}
371 %    The type size options are handled by defining |\@ptsize| to contain
372 %    the last digit of the size in question and branching on |\ifcase|
373 %    statements. This is done for historical reasons to stay compatible
374 %    with other packages that use the |\@ptsize| variable to select
375 %    special actions. It makes the declarations of size options less
376 %    than 10pt difficult, although one can probably use \texttt{9}
377 %    and \texttt{8} assuming that a class wont define both
378 %    \Lopt{8pt} and \Lopt{18pt} options.
380 %    \begin{macrocode}
381 \if@compatibility
382   \renewcommand\@ptsize{0}
383 \else
384 \DeclareOption{10pt}{\renewcommand\@ptsize{0}}
386 \DeclareOption{11pt}{\renewcommand\@ptsize{1}}
387 \DeclareOption{12pt}{\renewcommand\@ptsize{2}}
388 %    \end{macrocode}
391 %  \subsection{Two-side or one-side printing}
393 %    For two-sided printing we use the switch |\if@twoside|. In
394 %    addition we have to set the |\if@mparswitch| to get any margin
395 %    paragraphs into the outside margin.
396 %    \begin{macrocode}
397 \if@compatibility\else
398 \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
400 \DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
401 %    \end{macrocode}
404 %  \subsection{Draft option}
406 %    If the user requests \Lopt{draft} we show any overfull boxes.
407 %    We could probably add some more interesting stuff to this option.
408 %    \begin{macrocode}
409 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
410 \if@compatibility\else
411 \DeclareOption{final}{\setlength\overfullrule{0pt}}
413 %    \end{macrocode}
415 %  \subsection{Titlepage option}
416 %    An article usually has no separate titlepage, but the user can
417 %    request one.
418 %    \begin{macrocode}
419 \DeclareOption{titlepage}{\@titlepagetrue}
420 \if@compatibility\else
421 \DeclareOption{notitlepage}{\@titlepagefalse}
423 %    \end{macrocode}
425 %  \subsection{openright option}
426 %    This option determines whether or not a chapter must start on
427 %    a right-hand page 
428 %    request one.
429 %    \begin{macrocode}
430 %<!article>\if@compatibility
431 %<book>\@openrighttrue
432 %<!article>\else
433 %<!article>\DeclareOption{openright}{\@openrighttrue}
434 %<!article>\DeclareOption{openany}{\@openrightfalse}
435 %<!article>\fi
436 %    \end{macrocode}
438 %  \subsection{Twocolumn printing}
440 %    Two-column and one-column printing is again realized via a switch.
441 %    \begin{macrocode}
442 \if@compatibility\else
443 \DeclareOption{onecolumn}{\@twocolumnfalse}
445 \DeclareOption{twocolumn}{\@twocolumntrue}
446 %    \end{macrocode}
448 %  \subsection{Equation numbering on the left}
450 %    The option \Lopt{leqno} can be used to get the equation numbers
451 %    on the left side of the equation. It loads code which is generated
452 %    automatically from the kernel files when the format is built.
453 %    If the equation number does get a special formatting then instead
454 %    of using the kernel file the class would need to provide the code
455 %    explicitly.
456 %    \begin{macrocode}
457 \DeclareOption{leqno}{\input{leqno.clo}}
458 %    \end{macrocode}
460 %  \subsection{Flush left displays}
462 %    The option \Lopt{fleqn} redefines the displayed math environments
463 %    in such a way that they come out flush left, with an indentation
464 %    of |\mathindent| from the prevailing left margin. It loads
465 %    code which is generated
466 %    automatically from the kernel files when the format is built.
467 % \changes{v1.0h}{1993/12/18}{Corrected some typos.  ASAJ.}
468 %    \begin{macrocode}
469 \DeclareOption{fleqn}{\input{fleqn.clo}}
470 %    \end{macrocode}
472 % \subsection{Open bibliography}
474 %    The option \Lopt{openbib} produces the ``open'' bibliography
475 %    style, in which each block starts on a new line, and succeeding
476 %    lines in a block are indented by |\bibindent|.
477 % \changes{v1.3k}{1995/08/27}{openbib option reimplemented}
478 %    \begin{macrocode}
479 \DeclareOption{openbib}{%
480 %    \end{macrocode}
481 %    First some hook into the bibliography environment is filled.
482 %    \begin{macrocode}
483   \AtEndOfPackage{%
484    \renewcommand\@openbib@code{%
485       \advance\leftmargin\bibindent
486       \itemindent -\bibindent
487       \listparindent \itemindent
488       \parsep \z@
489       }%
490 %    \end{macrocode}
491 %    In addition the definition of |\newblock| is overwritten.
492 %    \begin{macrocode}
493    \renewcommand\newblock{\par}}%
495 %    \end{macrocode}
498 % \section{Executing Options}
500 %    Here we execute the default options to initialize certain
501 %    variables. Note that the document class `book' always uses two
502 %    sided printing.
503 %    \begin{macrocode}
504 %<*article>
505 \ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final}
506 %</article>
507 %<*report>
508 \ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final,openany}
509 %</report>
510 %<*book>
511 \ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright}
512 %</book>
513 %    \end{macrocode}
515 %    The |\ProcessOptions| command causes the execution of the code
516 %    for every option \Lopt{FOO}
517 %    which is declared and for which the user typed
518 %    the \Lopt{FOO} option in his
519 %    |\documentclass| command.  For every option \Lopt{BAR} he typed,
520 %    which is not declared, the option is assumed to be a global option.
521 %    All options will be passed as document options to any
522 %    |\usepackage| command in the document preamble.
523 %    \begin{macrocode}
524 \ProcessOptions
525 %    \end{macrocode}
526 %    Now that all the options have been executed we can load the
527 %    chosen class option file that contains all size dependent code.
528 %    \begin{macrocode}
529 %<!book>\input{size1\@ptsize.clo}
530 %<book>\input{bk1\@ptsize.clo}
531 %</article|report|book>
532 %    \end{macrocode}
534 %  \section{Loading Packages}
536 %  The standard class files do not load additional packages.
539 % \section{Document Layout}
540 % \label{sec:classes:maincode}
542 %  In this section we are finally dealing with the nasty typographical
543 %  details.
545 % \subsection{Fonts}
547 %    \LaTeX\ offers the user commands to change the size of the font,
548 %    relative to the `main' size. Each relative size changing command
549 %    |\size| executes the command
550 %    |\@setfontsize||\size|\meta{font-size}\meta{baselineskip} where:
552 %    \begin{description}
553 %    \item[\meta{font-size}] The absolute size of the font to use from
554 %        now on.
556 %    \item[\meta{baselineskip}] The normal value of |\baselineskip|
557 %        for the size of the font selected. (The actual value will be
558 %        |\baselinestretch| * \meta{baselineskip}.)
559 %    \end{description}
561 %    A number of commands, defined in the \LaTeX{} kernel, shorten the
562 %    following  definitions and are used throughout. They are:
563 % \begin{center}
564 % \begin{tabular}{ll@{\qquad}ll@{\qquad}ll}
565 %  \verb=\@vpt= & 5 & \verb=\@vipt= & 6 & \verb=\@viipt= & 7 \\
566 %  \verb=\@viiipt= & 8 & \verb=\@ixpt= & 9 & \verb=\@xpt= & 10 \\
567 %  \verb=\@xipt= & 10.95 & \verb=\@xiipt= & 12 & \verb=\@xivpt= & 14.4\\
568 %  ...
569 %  \end{tabular}
570 %  \end{center}
572 % \begin{macro}{\normalsize}
573 % \begin{macro}{\@normalsize}
574 % \changes{v1.0o}{1994/01/31}{\cs{@normalsize} now defined in the
575 %    kernel}
577 %    The user level command for the main size is |\normalsize|.
578 %    Internally \LaTeX{} uses |\@normalsize| when it refers to the
579 %    main size. |\@normalsize| will be defined to work like
580 %    |\normalsize| if the latter is redefined from its default
581 %    definition (that just issues an error message). Otherwise
582 %    |\@normalsize| simply selects a 10pt/12pt size.
584 %    The |\normalsize| macro also sets new values for\\
585 %    |\abovedisplayskip|, |\abovedisplayshortskip| and
586 %    |\belowdisplayshortskip|.
588 % \changes{v1.0e}{1993/12/07}{\cs{normalsize} doesn't exist, so use
589 %    \cs{newcommand}}
590 % \changes{v1.0h}{1993/12/18}{\cs{normalsize} is now defined in the
591 %    kernel, so use \cs{renewcommand}.  ASAJ.}
592 %    \begin{macrocode}
593 %<*10pt|11pt|12pt>
594 \renewcommand\normalsize{%
595 %<*10pt>
596    \@setfontsize\normalsize\@xpt\@xiipt
597    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
598    \abovedisplayshortskip \z@ \@plus3\p@
599    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
600 %</10pt>
601 %<*11pt>
602    \@setfontsize\normalsize\@xipt{13.6}%
603    \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
604    \abovedisplayshortskip \z@ \@plus3\p@
605    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
606 %</11pt>
607 %<*12pt>
608    \@setfontsize\normalsize\@xiipt{14.5}%
609    \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
610    \abovedisplayshortskip \z@ \@plus3\p@
611    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
612 %</12pt>
613 %    \end{macrocode}
614 %    The |\belowdisplayskip| is always equal to the
615 %    |\abovedisplayskip|. The parameters of the first level list are
616 %    always given by |\@listI|.
617 %    \begin{macrocode}
618    \belowdisplayskip \abovedisplayskip
619    \let\@listi\@listI}
620 %    \end{macrocode}
622 %    We initially choose the normalsize font.
623 %    \begin{macrocode}
624 \normalsize
625 %    \end{macrocode}
626 % \end{macro}
627 % \end{macro}
629 % \begin{macro}{\small}
630 %    This is similar to |\normalsize|.
631 % \changes{v1.0h}{1993/12/18}{\cs{small} is now defined in the kernel,
632 %    so use \cs{renewcommand}.  ASAJ.}
633 % \changes{v1.2e}{1994/04/14}{\cs{small} is no longer defined in the
634 %    kernel; use \cs{newcommand}}
635 %    \begin{macrocode}
636 \newcommand\small{%
637 %<*10pt>
638    \@setfontsize\small\@ixpt{11}%
639    \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
640    \abovedisplayshortskip \z@ \@plus2\p@
641    \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
642    \def\@listi{\leftmargin\leftmargini
643                \topsep 4\p@ \@plus2\p@ \@minus2\p@
644                \parsep 2\p@ \@plus\p@ \@minus\p@
645                \itemsep \parsep}%
646 %</10pt>
647 %<*11pt>
648    \@setfontsize\small\@xpt\@xiipt
649    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
650    \abovedisplayshortskip \z@ \@plus3\p@
651    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
652    \def\@listi{\leftmargin\leftmargini
653                \topsep 6\p@ \@plus2\p@ \@minus2\p@
654                \parsep 3\p@ \@plus2\p@ \@minus\p@
655                \itemsep \parsep}%
656 %</11pt>
657 %<*12pt>
658    \@setfontsize\small\@xipt{13.6}%
659    \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
660    \abovedisplayshortskip \z@ \@plus3\p@
661    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
662    \def\@listi{\leftmargin\leftmargini
663                \topsep 9\p@ \@plus3\p@ \@minus5\p@
664                \parsep 4.5\p@ \@plus2\p@ \@minus\p@
665                \itemsep \parsep}%
666 %</12pt>
667    \belowdisplayskip \abovedisplayskip
669 %    \end{macrocode}
670 % \end{macro}
672 % \begin{macro}{\footnotesize}
673 %    This is similar to |\normalsize|.
674 % \changes{v1.0h}{1993/12/18}{\cs{footnotesize} is now defined in the
675 %    kernel, so use \cs{renewcommand}.  ASAJ.}
676 % \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again}
677 %    \begin{macrocode}
678 \newcommand\footnotesize{%
679 %<*10pt>
680    \@setfontsize\footnotesize\@viiipt{9.5}%
681    \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
682    \abovedisplayshortskip \z@ \@plus\p@
683    \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
684    \def\@listi{\leftmargin\leftmargini
685                \topsep 3\p@ \@plus\p@ \@minus\p@
686                \parsep 2\p@ \@plus\p@ \@minus\p@
687                \itemsep \parsep}%
688 %</10pt>
689 %<*11pt>
690    \@setfontsize\footnotesize\@ixpt{11}%
691    \abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
692    \abovedisplayshortskip \z@ \@plus\p@
693    \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
694    \def\@listi{\leftmargin\leftmargini
695                \topsep 4\p@ \@plus2\p@ \@minus2\p@
696                \parsep 2\p@ \@plus\p@ \@minus\p@
697                \itemsep \parsep}%
698 %</11pt>
699 %<*12pt>
700    \@setfontsize\footnotesize\@xpt\@xiipt
701    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
702    \abovedisplayshortskip \z@ \@plus3\p@
703    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
704    \def\@listi{\leftmargin\leftmargini
705                \topsep 6\p@ \@plus2\p@ \@minus2\p@
706                \parsep 3\p@ \@plus2\p@ \@minus\p@
707                \itemsep \parsep}%
708 %</12pt>
709    \belowdisplayskip \abovedisplayskip
711 %</10pt|11pt|12pt>
712 %    \end{macrocode}
713 % \end{macro}
715 % \begin{macro}{\scriptsize}
716 % \begin{macro}{\tiny}
717 % \begin{macro}{\large}
718 % \begin{macro}{\Large}
719 % \begin{macro}{\LARGE}
720 % \begin{macro}{\huge}
721 % \begin{macro}{\Huge}
722 %    These are all much simpler than the previous macros, they just
723 %    select a new fontsize, but leave the parameters for displays and
724 %    lists alone.
725 % \changes{v1.0h}{1993/12/18}{These are now defined in the kernel,
726 %    so use \cs{renewcommand}.  ASAJ.}
727 % \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again}
728 %    \begin{macrocode}
729 %<*10pt>
730 \newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
731 \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
732 \newcommand\large{\@setfontsize\large\@xiipt{14}}
733 \newcommand\Large{\@setfontsize\Large\@xivpt{18}}
734 \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
735 \newcommand\huge{\@setfontsize\huge\@xxpt{25}}
736 \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
737 %</10pt>
738 %<*11pt>
739 \newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
740 \newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
741 \newcommand\large{\@setfontsize\large\@xiipt{14}}
742 \newcommand\Large{\@setfontsize\Large\@xivpt{18}}
743 \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
744 \newcommand\huge{\@setfontsize\huge\@xxpt{25}}
745 \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
746 %</11pt>
747 %<*12pt>
748 \newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
749 \newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
750 \newcommand\large{\@setfontsize\large\@xivpt{18}}
751 \newcommand\Large{\@setfontsize\Large\@xviipt{22}}
752 \newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}}
753 \newcommand\huge{\@setfontsize\huge\@xxvpt{30}}
754 \let\Huge=\huge
755 %</12pt>
756 %    \end{macrocode}
757 % \end{macro}
758 % \end{macro}
759 % \end{macro}
760 % \end{macro}
761 % \end{macro}
762 % \end{macro}
763 % \end{macro}
766 % \subsection{Paragraphing}
768 % \begin{macro}{\lineskip}
769 % \begin{macro}{\normallineskip}
770 %    These parameters control \TeX's behaviour when two lines tend to
771 %    come too close together.
772 %    \begin{macrocode}
773 %<*article|report|book>
774 \setlength\lineskip{1\p@}
775 \setlength\normallineskip{1\p@}
776 %    \end{macrocode}
777 % \end{macro}
778 % \end{macro}
780 % \begin{macro}{\baselinestretch}
781 %    This is used as a multiplier for |\baselineskip|. The default is
782 %    to \emph{not} stretch the baselines. Note that if this command
783 %    doesn't resolve to ``empty'' any \texttt{plus} or \texttt{minus}
784 %    part in the specification of |\baselineskip| is ignored.
785 %    \begin{macrocode}
786 \renewcommand\baselinestretch{}
787 %    \end{macrocode}
788 % \end{macro}
790 % \begin{macro}{\parskip}
791 % \begin{macro}{\parindent}
792 %    |\parskip| gives extra vertical space between paragraphs and
793 %    |\parindent| is the width of the paragraph indentation. The value
794 %    of |\parindent| depends on whether we are in two column mode.
795 % \changes{v1.0m}{1994/01/12}{\cs{parindent} should be different,
796 %    depending on the pointsize}
797 %    \begin{macrocode}
798 \setlength\parskip{0\p@ \@plus \p@}
799 %</article|report|book>
800 %<*10pt|11pt|12pt>
801 \if@twocolumn
802   \setlength\parindent{1em}
803 \else
804 %<10pt>  \setlength\parindent{15\p@}
805 %<11pt>  \setlength\parindent{17\p@}
806 %<12pt>  \setlength\parindent{1.5em}
808 %</10pt|11pt|12pt>
809 %    \end{macrocode}
810 % \end{macro}
811 % \end{macro}
813 %  \begin{macro}{\smallskipamount}
814 %  \begin{macro}{\medskipamount}
815 %  \begin{macro}{\bigskipamount}
816 %    The values for these three parameters are set in the \LaTeX\
817 %    kernel. They should perhaps vary, according to the size option
818 %    specified. But as they have always had the same value regardless
819 %    of the size option we do not change them to stay compatible with
820 %    both \LaTeX~2.09 and older releases of \LaTeXe.
821 % \changes{v1.3n}{1995/10/29}{Added setting the values of
822 %    \cs{...skipamount}} 
823 %    \begin{macrocode}
824 %<*10pt|11pt|12pt>
825 \setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@}
826 \setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@}
827 \setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@}
828 %</10pt|11pt|12pt>
829 %    \end{macrocode}
830 %  \end{macro}
831 %  \end{macro}
832 %  \end{macro}
834 % \begin{macro}{\@lowpenalty}
835 % \begin{macro}{\@medpenalty}
836 % \begin{macro}{\@highpenalty}%
837 %    The commands |\nopagebreak| and |\nolinebreak| put in penalties
838 %    to discourage these breaks at the point they are put in.
839 %    They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|,
840 %    dependent on their argument.
841 %    \begin{macrocode}
842 %<*article|report|book>
843 \@lowpenalty   51
844 \@medpenalty  151
845 \@highpenalty 301
846 %    \end{macrocode}
847 % \end{macro}
848 % \end{macro}
849 % \end{macro}
851 % \begin{macro}{\clubpenalty}
852 % \begin{macro}{\widowpenalty}
853 %    These penalties are use to discourage club and widow lines.
854 %    Because we use their default values we only show them here,
855 %    commented out.
856 %    \begin{macrocode}
857 % \clubpenalty  150
858 % \widowpenalty 150
859 %    \end{macrocode}
860 % \end{macro}
861 % \end{macro}
863 % \begin{macro}{\displaywidowpenalty}
864 % \begin{macro}{\predisplaypenalty}
865 % \begin{macro}{\postdisplaypenalty}
866 %    Discourage (but not so much) widows in front of a math display
867 %    and forbid breaking directly in front of a display. Allow break
868 %    after a display without a penalty. Again the default values are
869 %    used, therefore we only show them here.
870 %    \begin{macrocode}
871 % \displaywidowpenalty 50
872 % \predisplaypenalty   10000
873 % \postdisplaypenalty  0
874 %    \end{macrocode}
875 % \end{macro}
876 % \end{macro}
877 % \end{macro}
879 % \begin{macro}{\interlinepenalty}
880 %    Allow the breaking of a page in the middle of a paragraph.
881 %    \begin{macrocode}
882 % \interlinepenalty 0
883 %    \end{macrocode}
884 % \end{macro}
887 % \begin{macro}{\brokenpenalty}
888 %    We allow the breaking of a page after a hyphenated line.
889 % \changes{v1.1a}{1994/03/12}{Show correct default which is 100}
890 %    \begin{macrocode}
891 % \brokenpenalty 100
892 %</article|report|book>
893 %    \end{macrocode}
894 % \end{macro}
897 % \subsection{Page Layout}
899 %    All margin dimensions are measured from a point one inch from the
900 %    top and lefthand side of the page.
902 % \subsubsection{Vertical spacing}
904 % \begin{macro}{\headheight}
905 % \begin{macro}{\headsep}
906 % \begin{macro}{\topskip}
907 %    The |\headheight| is the height of the box that will contain the
908 %    running head. The |\headsep| is the distance between the bottom
909 %    of the running head and the top of the text. The |\topskip| is
910 %    the |\baselineskip| for the first line on a page; \LaTeX's output
911 %    routine will not work properly if it has the value 0pt, so do not
912 %    do that!
913 %    \begin{macrocode}
914 %<*10pt|11pt|12pt>
915 \setlength\headheight{12\p@}
916 %<!bk>\setlength\headsep   {25\p@}
917 %<10pt&bk>\setlength\headsep   {.25in}
918 %<11pt&bk>\setlength\headsep   {.275in}
919 %<12pt&bk>\setlength\headsep   {.275in}
920 %<10pt>\setlength\topskip   {10\p@}
921 %<11pt>\setlength\topskip   {11\p@}
922 %<12pt>\setlength\topskip   {12\p@}
923 %    \end{macrocode}
924 % \end{macro}
925 % \end{macro}
926 % \end{macro}
928 % \begin{macro}{\footskip}
929 %    The distance from the baseline of the box which contains the
930 %    running footer to the baseline of last line of text is controlled
931 %    by the |\footskip|.
932 %    \begin{macrocode}
933 %<!bk>\setlength\footskip{30\p@}
934 %<10pt&bk>\setlength\footskip{.35in}
935 %<11pt&bk>\setlength\footskip{.38in}
936 %<12pt&bk>\setlength\footskip{30\p@}
937 %    \end{macrocode}
938 % \end{macro}
940 % \begin{macro}{\maxdepth}
941 % \changes{v1.2k}{1994/05/06}{Added setting of \cs{maxdepth} and
942 %    \cs{@maxdepth}}
943 % \changes{v1.3j}{1995/08/16}{Take setting of
944 %    \cs{@maxdepth} out again}
945 %    The \TeX\ primitive register |\maxdepth| has a function that is
946 %    similar to that of |\topskip|. The register |\@maxdepth| should
947 %    always contain a copy of |\maxdepth|. This is achieved by setting
948 %    it internally at |\begin{document}|. In both plain \TeX\ and
949 %    \LaTeX~2.09 |\maxdepth| had a fixed value of \texttt{4pt}; in
950 %    native \LaTeX2e\ mode we let the value depend on the typesize. We
951 %    set it so that |\maxdepth| $+$ |\topskip| $=$ typesize $\times
952 %    1.5$. As it happens, in these classes |\topskip| is equal to the
953 %    typesize, therefore we set |\maxdepth| to half the value of
954 %    |\topskip|.
955 %    \begin{macrocode}
956 \if@compatibility \setlength\maxdepth{4\p@} \else
957 \setlength\maxdepth{.5\topskip} \fi
958 %    \end{macrocode}
959 % \end{macro}
961 % \subsubsection{The dimension of text}
963 % \begin{macro}{\textwidth}
964 %    When we are in compatibility mode we have to make sure that the
965 %    dimensions of the printed area are not different from what the
966 %    user was used to see.
968 %    \begin{macrocode}
969 \if@compatibility
970   \if@twocolumn
971     \setlength\textwidth{410\p@}
972   \else
973 %<10pt&!bk>    \setlength\textwidth{345\p@}
974 %<11pt&!bk>    \setlength\textwidth{360\p@}
975 %<12pt&!bk>    \setlength\textwidth{390\p@}
976 %<10pt&bk>    \setlength\textwidth{4.5in}
977 %<11pt&bk>    \setlength\textwidth{5in}
978 %<12pt&bk>    \setlength\textwidth{5in}
979   \fi
980 %    \end{macrocode}
981 %    When we are not in compatibility mode we can set some of the
982 %    dimensions differently, taking into account the paper size for
983 %    instance.
984 %    \begin{macrocode}
985 \else
986 %    \end{macrocode}
987 %    First, we calculate the maximum |\textwidth|, which we will allow
988 %    on the selected paper and store it in |\@tempdima|. Then we store
989 %    the length of a line with approximately 60--70 characters in
990 %    |\@tempdimb|. The values given are more or less suitable when
991 %    Computer Modern fonts are used.
992 % \changes{v1.1a}{1994/03/12}{Have old values for width in native mode}
993 %    \begin{macrocode}
994   \setlength\@tempdima{\paperwidth}
995   \addtolength\@tempdima{-2in}
996 %<10pt>  \setlength\@tempdimb{345\p@}
997 %<11pt>  \setlength\@tempdimb{360\p@}
998 %<12pt>  \setlength\@tempdimb{390\p@}
999 %    \end{macrocode}
1001 %    Now we can set the |\textwidth|, depending on whether we will be
1002 %    setting one or two columns.
1004 %    In two column mode each \emph{column} shouldn't be wider than
1005 %    |\@tempdimb| (which could happen on \textsc{a3} paper for
1006 %    instance).
1007 %    \begin{macrocode}
1008   \if@twocolumn
1009     \ifdim\@tempdima>2\@tempdimb\relax
1010       \setlength\textwidth{2\@tempdimb}
1011     \else
1012       \setlength\textwidth{\@tempdima}
1013     \fi
1014 %    \end{macrocode}
1016 %    In one column mode the text should not be wider than the minimum
1017 %    of the paperwidth (minus 2 inches for the margins) and the
1018 %    maximum length of a line as defined by the number of characters.
1019 %    \begin{macrocode}
1020   \else
1021     \ifdim\@tempdima>\@tempdimb\relax
1022       \setlength\textwidth{\@tempdimb}
1023     \else
1024       \setlength\textwidth{\@tempdima}
1025     \fi
1026   \fi
1028 %    \end{macrocode}
1030 %    Here we modify the width of the text a little to be a whole
1031 %    number of points.
1032 %    \begin{macrocode}
1033 \if@compatibility\else
1034   \@settopoint\textwidth
1036 %    \end{macrocode}
1037 % \end{macro}
1039 % \begin{macro}{\textheight}
1040 %    Now that we have computed the width of the text, we have to take
1041 %    care of the height. The |\textheight| is the height of text
1042 %    (including footnotes and figures, excluding running head and
1043 %    foot).
1045 %    First make sure that the compatibility mode gets the same
1046 %    dimensions as we had with \LaTeX2.09. The number of lines was
1047 %    calculated as the floor of the old |\textheight| minus
1048 %    |\topskip|, divided by |\baselineskip| for |\normalsize|. The
1049 %    old value of |\textheight| was 528pt.
1051 %    \begin{macrocode}
1052 \if@compatibility
1053 %<10pt&!bk>  \setlength\textheight{43\baselineskip}
1054 %<10pt&bk>  \setlength\textheight{41\baselineskip}
1055 %<11pt>  \setlength\textheight{38\baselineskip}
1056 %<12pt>  \setlength\textheight{36\baselineskip}
1057 %    \end{macrocode}
1059 %    Again we compute this, depending on the papersize and depending
1060 %    on the baselineskip that is used, in order to have a whole number
1061 %    of lines on the page.
1062 %    \begin{macrocode}
1063 \else
1064   \setlength\@tempdima{\paperheight}
1065 %    \end{macrocode}
1067 %    We leave at least a 1 inch margin on the top and the bottom of
1068 %    the page.
1069 %    \begin{macrocode}
1070   \addtolength\@tempdima{-2in}
1071 %    \end{macrocode}
1073 %    We also have to leave room for the running headers and footers.
1074 %    \begin{macrocode}
1075   \addtolength\@tempdima{-1.5in}
1076 %    \end{macrocode}
1078 %    Then we divide the result by the current |\baselineskip| and
1079 %    store this in the count register |\@tempcnta|, which then
1080 %    contains the number of lines that fit on this page.
1081 %    \begin{macrocode}
1082   \divide\@tempdima\baselineskip
1083   \@tempcnta=\@tempdima
1084 %    \end{macrocode}
1086 %    From this we can calculate the height of the text.
1087 %    \begin{macrocode}
1088   \setlength\textheight{\@tempcnta\baselineskip}
1090 %    \end{macrocode}
1092 %    The first line on the page has a height of |\topskip|.
1093 %    \begin{macrocode}
1094 \addtolength\textheight{\topskip}
1095 %    \end{macrocode}
1096 % \end{macro}
1100 % \subsubsection{Margins}
1102 %    Most of the values of these parameters are now calculated, based
1103 %    on the papersize in use. In the calcluations the |\marginparsep|
1104 %    needs to be taken into account so we give it its value first.
1106 % \begin{macro}{\marginparsep}
1107 % \begin{macro}{\marginparpush}
1108 %    The horizontal space between the main text and marginal notes is
1109 %    determined by |\marginparsep|, the minimum vertical separation
1110 %    between two marginal notes is controlled by |\marginparpush|.
1111 %    \begin{macrocode}
1112 \if@twocolumn
1113  \setlength\marginparsep {10\p@}
1114 \else
1115 %<10pt&!bk>  \setlength\marginparsep{11\p@}
1116 %<11pt&!bk>  \setlength\marginparsep{10\p@}
1117 %<12pt&!bk>  \setlength\marginparsep{10\p@}
1118 %<bk>  \setlength\marginparsep{7\p@}
1120 %<10pt|11pt>\setlength\marginparpush{5\p@}
1121 %<12pt>\setlength\marginparpush{7\p@}
1122 %    \end{macrocode}
1123 % \end{macro}
1124 % \end{macro}
1126 %    Now we can give the values for the other margin parameters. For
1127 %    native \LaTeXe, these are calculated.
1128 % \begin{macro}{\oddsidemargin}
1129 % \begin{macro}{\evensidemargin}
1130 % \begin{macro}{\marginparwidth}
1131 %    First we give the values for the compatibility mode.
1133 %    Values for two-sided printing:
1134 %    \begin{macrocode}
1135 \if@compatibility
1136 %<*bk>
1137 %<10pt>   \setlength\oddsidemargin   {.5in}
1138 %<11pt>   \setlength\oddsidemargin   {.25in}
1139 %<12pt>   \setlength\oddsidemargin   {.25in}
1140 %<10pt>   \setlength\evensidemargin  {1.5in}
1141 %<11pt>   \setlength\evensidemargin  {1.25in}
1142 %<12pt>   \setlength\evensidemargin  {1.25in}
1143 %<10pt>   \setlength\marginparwidth {.75in}
1144 %<11pt>   \setlength\marginparwidth {1in}
1145 %<12pt>   \setlength\marginparwidth {1in}
1146 %</bk>
1147 %<*!bk>
1148   \if@twoside
1149 %<10pt>     \setlength\oddsidemargin   {44\p@}
1150 %<11pt>     \setlength\oddsidemargin   {36\p@}
1151 %<12pt>     \setlength\oddsidemargin   {21\p@}
1152 %<10pt>     \setlength\evensidemargin  {82\p@}
1153 %<11pt>     \setlength\evensidemargin  {74\p@}
1154 %<12pt>     \setlength\evensidemargin  {59\p@}
1155 %<10pt>     \setlength\marginparwidth {107\p@}
1156 %<11pt>     \setlength\marginparwidth {100\p@}
1157 %<12pt>     \setlength\marginparwidth {85\p@}
1158 %    \end{macrocode}
1159 %    Values for one-sided printing:
1160 %    \begin{macrocode}
1161   \else
1162 %<10pt>     \setlength\oddsidemargin   {63\p@}
1163 %<11pt>     \setlength\oddsidemargin   {54\p@}
1164 %<12pt>     \setlength\oddsidemargin   {39.5\p@}
1165 %<10pt>     \setlength\evensidemargin  {63\p@}
1166 %<11pt>     \setlength\evensidemargin  {54\p@}
1167 %<12pt>     \setlength\evensidemargin  {39.5\p@}
1168 %<10pt>     \setlength\marginparwidth  {90\p@}
1169 %<11pt>     \setlength\marginparwidth  {83\p@}
1170 %<12pt>     \setlength\marginparwidth  {68\p@}
1171   \fi
1172 %</!bk>
1173 %    \end{macrocode}
1174 %    And values for two column mode:
1175 %    \begin{macrocode}
1176   \if@twocolumn
1177      \setlength\oddsidemargin  {30\p@}
1178      \setlength\evensidemargin {30\p@}
1179      \setlength\marginparwidth {48\p@}
1180   \fi
1181 %    \end{macrocode}
1183 %    When we are not in compatibility mode we can take the dimensions
1184 %    of the selected paper into account.
1186 %    The values for |\oddsidemargin| and |\marginparwidth| will be set
1187 %    depending on the status of the |\if@twoside|.
1189 %    If |@twoside| is true (which is always the case for book) we make
1190 %    the inner margin smaller than the outer one.
1191 %    \begin{macrocode}
1192 \else
1193   \if@twoside
1194     \setlength\@tempdima        {\paperwidth}
1195     \addtolength\@tempdima      {-\textwidth}
1196     \setlength\oddsidemargin    {.4\@tempdima}
1197     \addtolength\oddsidemargin  {-1in}
1198 %    \end{macrocode}
1199 %    The width of the margin for text is set to the remainder of the
1200 %    width except for a `real margin' of white space of width 0.4in.
1201 %    A check should perhaps be built in to ensure that the (text)
1202 %    margin width does not get too small!
1203 %    
1204 % \changes{v1.1a}{1994/03/12}{New algorithm for \cs{oddsidemargin}}
1205 % \changes{v1.1a}{1994/03/12}{New algorithm for \cs{marginparwidth}}
1206 % \changes{v1.2z}{1995/04/14}{Also take \cs{marginparsep} into account
1207 %    here}
1208 %    \begin{macrocode}
1209     \setlength\marginparwidth   {.6\@tempdima}
1210     \addtolength\marginparwidth {-\marginparsep}
1211     \addtolength\marginparwidth {-0.4in}
1212 %    \end{macrocode}
1213 %    For one-sided printing we center the text on the page, by
1214 %    calculating the difference between |\textwidth| and
1215 %    |\paperwidth|. Half of that difference is than used for
1216 %    the margin (thus |\oddsidemargin| is |1in| less). 
1217 %    \begin{macrocode}
1218   \else
1219     \setlength\@tempdima        {\paperwidth}
1220     \addtolength\@tempdima      {-\textwidth}
1221     \setlength\oddsidemargin    {.5\@tempdima}
1222     \addtolength\oddsidemargin  {-1in}
1223     \setlength\marginparwidth   {.5\@tempdima}
1224     \addtolength\marginparwidth {-\marginparsep}
1225     \addtolength\marginparwidth {-0.4in}
1226     \addtolength\marginparwidth {-.4in}
1227   \fi
1228 %    \end{macrocode}
1229 %    With the above algorithm the |\marginparwidth| can come out quite
1230 %    large which we may not want.
1231 %    \begin{macrocode}
1232   \ifdim \marginparwidth >2in
1233      \setlength\marginparwidth{2in}
1234   \fi
1235 %    \end{macrocode}
1236 %    Having done these calculations we make them pt values.
1237 %    \begin{macrocode}
1238   \@settopoint\oddsidemargin
1239   \@settopoint\marginparwidth
1240 %    \end{macrocode}
1242 %    The |\evensidemargin| can now be computed from the values set
1243 %    above.
1244 % \changes{v1.0l}{1994/01/11}{Computing of \cs{evensidemargin}
1245 %    should only occur in compatibility mode}
1246 %    \begin{macrocode}
1247   \setlength\evensidemargin  {\paperwidth}
1248   \addtolength\evensidemargin{-2in}
1249   \addtolength\evensidemargin{-\textwidth}
1250   \addtolength\evensidemargin{-\oddsidemargin}
1251 %    \end{macrocode}
1252 %    Setting |\evensidemargin| to a full point value may produce a
1253 %    small error. However it will lie within the error range a
1254 %    doublesided printer of today's technology can accurately print.
1255 %    \begin{macrocode}
1256   \@settopoint\evensidemargin
1258 %    \end{macrocode}
1259 % \end{macro}
1260 % \end{macro}
1261 % \end{macro}
1263 % \begin{macro}{\topmargin}
1264 %    The |\topmargin| is the distance between the top of `the
1265 %    printable area'---which is 1 inch below the top of the
1266 %    paper--and the top of the box which contains the running head.
1268 %    It can now be computed from the values set above.
1269 %    \begin{macrocode}
1270 \if@compatibility
1271 %<!bk>  \setlength\topmargin{27pt}
1272 %<10pt&bk>  \setlength\topmargin{.75in}
1273 %<11pt&bk>  \setlength\topmargin{.73in}
1274 %<12pt&bk>  \setlength\topmargin{.73in}
1275 \else
1276   \setlength\topmargin{\paperheight}
1277   \addtolength\topmargin{-2in}
1278   \addtolength\topmargin{-\headheight}
1279   \addtolength\topmargin{-\headsep}
1280   \addtolength\topmargin{-\textheight}
1281   \addtolength\topmargin{-\footskip}     % this might be wrong!
1282 %    \end{macrocode}
1283 %    By changing the factor in the next line the complete page
1284 %    can be shifted vertically.
1285 % \changes{v1.2u}{1994/07/13}{Moved rounding of \cs{topmargin} to
1286 %    native mode}
1287 %    \begin{macrocode}
1288   \addtolength\topmargin{-.5\topmargin}
1289   \@settopoint\topmargin
1291 %    \end{macrocode}
1292 % \end{macro}
1295 % \subsubsection{Footnotes}
1297 % \begin{macro}{\footnotesep}
1298 %    |\footnotesep| is the height of the strut placed at the beginning
1299 %    of every footnote. It equals the  height of a normal
1300 %    |\footnotesize| strut in this
1301 %    class, thus no extra space occurs between footnotes.
1302 %    \begin{macrocode}
1303 %<10pt>\setlength\footnotesep{6.65\p@}
1304 %<11pt>\setlength\footnotesep{7.7\p@}
1305 %<12pt>\setlength\footnotesep{8.4\p@}
1306 %    \end{macrocode}
1307 % \end{macro}
1309 % \begin{macro}{\footins}
1310 %    |\skip\footins| is the space between the last line of the main
1311 %    text and the top of the first footnote.
1312 %    \begin{macrocode}
1313 %<10pt>\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
1314 %<11pt>\setlength{\skip\footins}{10\p@ \@plus 4\p@ \@minus 2\p@}
1315 %<12pt>\setlength{\skip\footins}{10.8\p@ \@plus 4\p@ \@minus 2\p@}
1316 %</10pt|11pt|12pt>
1317 %    \end{macrocode}
1318 % \end{macro}
1320 % \subsubsection{Float placement parameters}
1322 % All float parameters are given default values in the \LaTeXe{}
1323 % kernel. For this reason parameters that are not counters
1324 % need to be set with |\renewcommand|.
1326 % \paragraph{Limits for the placement of floating objects}
1328 % \begin{macro}{\c@topnumber}
1329 %    The \Lcount{topnumber} counter holds the maximum number of
1330 %    floats that can appear on the top of a text page.
1331 %    \begin{macrocode}
1332 %<*article|report|book>
1333 \setcounter{topnumber}{2}
1334 %    \end{macrocode}
1335 % \end{macro}
1337 % \begin{macro}{\topfraction}
1338 %    This indicates the maximum part of a text page that can be
1339 %    occupied by floats at the top.
1340 % \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with
1341 %    \cs{renewcommand}.  ASAJ.}
1342 %    \begin{macrocode}
1343 \renewcommand\topfraction{.7}
1344 %    \end{macrocode}
1345 % \end{macro}
1347 % \begin{macro}{\c@bottomnumber}
1348 %    The \Lcount{bottomnumber} counter holds the maximum number of
1349 %    floats that can appear on the bottom of a text page.
1350 %    \begin{macrocode}
1351 \setcounter{bottomnumber}{1}
1352 %    \end{macrocode}
1353 % \end{macro}
1355 % \begin{macro}{\bottomfraction}
1356 %    This indicates the maximum part of a text page that can be
1357 %    occupied by floats at the bottom.
1358 % \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with
1359 %    \cs{renewcommand}.  ASAJ.}
1360 %    \begin{macrocode}
1361 \renewcommand\bottomfraction{.3}
1362 %    \end{macrocode}
1363 % \end{macro}
1365 % \begin{macro}{\c@totalnumber}
1366 %    This indicates the maximum number of floats that can appear on
1367 %    any text page.
1368 %    \begin{macrocode}
1369 \setcounter{totalnumber}{3}
1370 %    \end{macrocode}
1371 % \end{macro}
1373 % \begin{macro}{\textfraction}
1374 %    This indicates the minimum part of a text page that has to be
1375 %    occupied by text.
1376 % \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with
1377 %    \cs{renewcommand}.  ASAJ.}
1378 %    \begin{macrocode}
1379 \renewcommand\textfraction{.2}
1380 %    \end{macrocode}
1381 % \end{macro}
1383 % \begin{macro}{\floatpagefraction}
1384 %    This indicates the minimum part of a page that has to be
1385 %    occupied by floating objects before a `float page' is produced.
1386 % \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with
1387 %    \cs{renewcommand}.  ASAJ.}
1388 %    \begin{macrocode}
1389 \renewcommand\floatpagefraction{.5}
1390 %    \end{macrocode}
1391 % \end{macro}
1393 % \begin{macro}{\c@dbltopnumber}
1394 %    The \Lcount{dbltopnumber} counter holds the maximum number of
1395 %    two column floats that can appear on the top of a two column text
1396 %    page.
1397 %    \begin{macrocode}
1398 \setcounter{dbltopnumber}{2}
1399 %    \end{macrocode}
1400 % \end{macro}
1402 % \begin{macro}{\dbltopfraction}
1403 %    This indicates the maximum part of a two column text page that
1404 %    can be occupied by two column floats at the top.
1405 % \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with
1406 %    \cs{renewcommand}.  ASAJ.}
1407 %    \begin{macrocode}
1408 \renewcommand\dbltopfraction{.7}
1409 %    \end{macrocode}
1410 % \end{macro}
1412 % \begin{macro}{\dblfloatpagefraction}
1413 %    This indicates the minimum part of a page that has to be
1414 %    occupied by two column wide floating objects before a `float
1415 %    page' is produced.
1416 % \changes{v1.0h}{1993/12/18}{Replaced \cs{newcommand} with
1417 %    \cs{renewcommand}.  ASAJ.}
1418 %    \begin{macrocode}
1419 \renewcommand\dblfloatpagefraction{.5}
1420 %</article|report|book>
1421 %    \end{macrocode}
1422 % \end{macro}
1424 % \paragraph{Floats on a text page}
1426 % \begin{macro}{\floatsep}
1427 % \begin{macro}{\textfloatsep}
1428 % \begin{macro}{\intextsep}
1429 %    When a floating object is placed on a page with text, these
1430 %    parameters control the separation between the float and the other
1431 %    objects on the page. These parameters are used for both
1432 %    one-column mode and single-column floats in two-column mode.
1434 %    |\floatsep| is the space between adjacent floats that are moved
1435 %    to the top or bottom of the text page.
1437 %    |\textfloatsep| is the space between the main text and floats
1438 %    at the top or bottom of the page.
1440 %    |\intextsep| is the space between in-text floats and the text.
1441 %    \begin{macrocode}
1442 %<*10pt>
1443 \setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
1444 \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
1445 \setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}
1446 %</10pt>
1447 %<*11pt>
1448 \setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
1449 \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
1450 \setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}
1451 %</11pt>
1452 %<*12pt>
1453 \setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 4\p@}
1454 \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
1455 \setlength\intextsep   {14\p@ \@plus 4\p@ \@minus 4\p@}
1456 %</12pt>
1457 %    \end{macrocode}
1458 % \end{macro}
1459 % \end{macro}
1460 % \end{macro}
1462 % \begin{macro}{\dblfloatsep}
1463 % \begin{macro}{\dbltextfloatsep}
1464 %    When floating objects that span the whole |\textwidth| are placed
1465 %    on a text page when we are in twocolumn mode the separation
1466 %    between the float and the text is controlled by |\dblfloatsep|
1467 %    and |\dbltextfloatsep|.
1469 %    |\dblfloatsep| is the space between adjacent floats that are moved
1470 %    to the top or bottom of the text page.
1472 %    |\dbltextfloatsep| is the space between the main text and floats
1473 %    at the top or bottom of the page.
1475 %    \begin{macrocode}
1476 %<*10pt>
1477 \setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
1478 \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
1479 %</10pt>
1480 %<*11pt>
1481 \setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
1482 \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
1483 %</11pt>
1484 %<*12pt>
1485 \setlength\dblfloatsep    {14\p@ \@plus 2\p@ \@minus 4\p@}
1486 \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
1487 %</12pt>
1488 %    \end{macrocode}
1489 % \end{macro}
1490 % \end{macro}
1492 % \paragraph{Floats on their own page or column}
1494 % \begin{macro}{\@fptop}
1495 % \begin{macro}{\@fpsep}
1496 % \begin{macro}{\@fpbot}
1497 %    When floating objects are placed on separate pages the layout of
1498 %    such pages is controlled by these parameters. At the top of the
1499 %    page |\@fptop| amount of stretchable whitespace is inserted, at
1500 %    the bottom of the page we get an |\@fpbot| amount of stretchable
1501 %    whitespace. Between adjacent floats the |\@fpsep| is inserted.
1503 %    These parameters are used for the placement of floating objects
1504 %    in one column mode, or in single column floats in two column
1505 %    mode.
1507 %    Note that at least one of the two parameters |\@fptop| and
1508 %    |\@fpbot| should contain a |plus ...fil| to allow filling the
1509 %    remaining empty space.
1510 %    \begin{macrocode}
1511 %<*10pt>
1512 \setlength\@fptop{0\p@ \@plus 1fil}
1513 \setlength\@fpsep{8\p@ \@plus 2fil}
1514 \setlength\@fpbot{0\p@ \@plus 1fil}
1515 %</10pt>
1516 %<*11pt>
1517 \setlength\@fptop{0\p@ \@plus 1fil}
1518 \setlength\@fpsep{8\p@ \@plus 2fil}
1519 \setlength\@fpbot{0\p@ \@plus 1fil}
1520 %</11pt>
1521 %<*12pt>
1522 \setlength\@fptop{0\p@ \@plus 1fil}
1523 \setlength\@fpsep{10\p@ \@plus 2fil}
1524 \setlength\@fpbot{0\p@ \@plus 1fil}
1525 %</12pt>
1526 %    \end{macrocode}
1527 % \end{macro}
1528 % \end{macro}
1529 % \end{macro}
1531 % \begin{macro}{\@dblfptop}
1532 % \begin{macro}{\@dblfpsep}
1533 % \begin{macro}{\@dblfpbot}
1534 %    Double column floats in two column mode are handled with similar
1535 %    parameters.
1536 %    \begin{macrocode}
1537 %<*10pt>
1538 \setlength\@dblfptop{0\p@ \@plus 1fil}
1539 \setlength\@dblfpsep{8\p@ \@plus 2fil}
1540 \setlength\@dblfpbot{0\p@ \@plus 1fil}
1541 %</10pt>
1542 %<*11pt>
1543 \setlength\@dblfptop{0\p@ \@plus 1fil}
1544 \setlength\@dblfpsep{8\p@ \@plus 2fil}
1545 \setlength\@dblfpbot{0\p@ \@plus 1fil}
1546 %</11pt>
1547 %<*12pt>
1548 \setlength\@dblfptop{0\p@ \@plus 1fil}
1549 \setlength\@dblfpsep{10\p@ \@plus 2fil}
1550 \setlength\@dblfpbot{0\p@ \@plus 1fil}
1551 %</12pt>
1552 %<*article|report|book>
1553 %    \end{macrocode}
1554 % \end{macro}
1555 % \end{macro}
1556 % \end{macro}
1558 % \subsection{Page Styles}
1560 %    The page style \pstyle{foo} is defined by defining the command
1561 %    |\ps@foo|.   This command should make only local definitions.
1562 %    There should be no stray spaces in the definition, since they
1563 %    could lead to mysterious extra spaces in the output (well, that's
1564 %    something that should be always avoided).
1566 % \begin{macro}{\@evenhead}
1567 % \begin{macro}{\@oddhead}
1568 % \begin{macro}{\@evenfoot}
1569 % \begin{macro}{\@oddfoot}
1570 %    The |\ps@...| command defines the macros |\@oddhead|,
1571 %    |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running
1572 %    heads and feet---e.g., |\@oddhead| is the macro to produce the
1573 %    contents of the heading box for odd-numbered pages.  It is called
1574 %    inside an |\hbox| of width |\textwidth|.
1575 % \end{macro}
1576 % \end{macro}
1577 % \end{macro}
1578 % \end{macro}
1580 % \subsubsection{Marking conventions}
1582 %    To make headings determined by the sectioning commands, the page
1583 %    style defines the commands |\chaptermark|, |\sectionmark|,
1584 %    \ldots,\\
1585 %     where |\chaptermark{|\meta{TEXT}|}| is called by
1586 %    |\chapter| to set a mark, and so on.
1588 %    The |\...mark| commands and the |\...head| macros are defined
1589 %    with the help of the following macros.  (All the |\...mark|
1590 %    commands should be initialized to no-ops.)
1592 %    \LaTeX{} extends \TeX's |\mark| facility by producing two kinds
1593 %    of marks, a `left' and a `right' mark, using the following
1594 %    commands:
1595 %    \begin{flushleft}
1596 %     |\markboth{|\meta{LEFT}|}{|\meta{RIGHT}|}|: Adds both marks.
1598 %     |\markright{|\meta{RIGHT}|}|: Adds a `right' mark.
1600 %     |\leftmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
1601 %                  or |\@evenfoot| macros, it gets the current `left'
1602 %                  mark.  |\leftmark| works like \TeX's |\botmark|
1603 %                  command.
1605 %     |\rightmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
1606 %                   or  |\@evenfoot| macros, it gets the current
1607 %                   `right' mark. |\rightmark| works like \TeX's
1608 %                   |\firstmark| command.
1609 %    \end{flushleft}
1611 %    The marking commands work reasonably well for right marks
1612 %    `numbered within' left marks---e.g., the left mark is changed by a
1613 %    |\chapter| command and the right mark is changed by a |\section|
1614 %    command.  However, it does produce somewhat anomalous results if
1615 %    two |\markboth|'s occur on the same page.
1618 %    Commands like |\tableofcontents| that should set the marks in some
1619 %    page styles use a |\@mkboth| command, which is |\let| by the
1620 %    pagestyle command (|\ps@...|)  to |\markboth| for setting the
1621 %    heading or to |\@gobbletwo| to do nothing.
1624 % \subsubsection{Defining the page styles}
1625 % \label{sec:classes:pagestyle}
1627 %    The pagestyles \pstyle{empty} and \pstyle{plain} are defined in
1628 %    \file{latex.dtx}.
1630 % \begin{macro}{\ps@headings}
1631 %    The definition of the page style \pstyle{headings} has to be
1632 %    different for two sided printing than it is for one sided
1633 %    printing.
1635 %    \begin{macrocode}
1636 \if@twoside
1637   \def\ps@headings{%
1638 %    \end{macrocode}
1639 %    The running feet are empty in this page style, the running head
1640 %    contains the page number and one of the marks.
1641 %    \begin{macrocode}
1642       \let\@oddfoot\@empty\let\@evenfoot\@empty
1643       \def\@evenhead{\thepage\hfil\slshape\leftmark}%
1644       \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
1645 %    \end{macrocode}
1647 %    When using this page style, the contents of the running head is
1648 %    determined by the chapter and section titles. So we |\let|
1649 %    |\@mkboth| to |\markboth|.
1650 %    \begin{macrocode}
1651       \let\@mkboth\markboth
1652 %    \end{macrocode}
1654 %    For the article document class we define |\sectionmark| to clear
1655 %    the right mark and put the number of the section (when it is
1656 %    numbered) and its title in the left mark. The rightmark is set by
1657 %    |\subsectionmark| to contain the subsection titles.
1659 %    Note the use of |##1| for the parameter of the |\sectionmark|
1660 %    command, which will be defined when |\ps@headings| is executed.
1662 % \changes{v1.2z}{1995/04/03}{Removed extra dot after \cs{thesection}
1663 %    (PR 1519)}
1664 % \changes{v1.3c}{1995/05/25}{Replace \cs{hskip}
1665 %    \texttt{1em}\cs{relax} with \cs{quad}}
1666 %    \begin{macrocode}
1667 %<*article>
1668     \def\sectionmark##1{%
1669       \markboth {\MakeUppercase{%
1670         \ifnum \c@secnumdepth >\z@
1671           \thesection\quad
1672         \fi
1673         ##1}}{}}%
1674     \def\subsectionmark##1{%
1675       \markright {%
1676         \ifnum \c@secnumdepth >\@ne
1677           \thesubsection\quad
1678         \fi
1679         ##1}}}
1680 %</article>
1681 %    \end{macrocode}
1683 %    In the report and book document classes we use the |\chaptermark|
1684 %    and |\sectionmark| macros to fill the running heads.
1686 %    Note the use of |##1| for the parameter of the |\chaptermark|
1687 %    command, which will be defined when |\ps@headings| is executed.
1689 %    \begin{macrocode}
1690 %<*report|book>
1691     \def\chaptermark##1{%
1692       \markboth {\MakeUppercase{%
1693         \ifnum \c@secnumdepth >\m@ne
1694 %<book>          \if@mainmatter
1695             \@chapapp\ \thechapter. \ %
1696 %<book>          \fi
1697         \fi
1698         ##1}}{}}%
1699     \def\sectionmark##1{%
1700       \markright {\MakeUppercase{%
1701         \ifnum \c@secnumdepth >\z@
1702           \thesection. \ %
1703         \fi
1704         ##1}}}}
1705 %</report|book>
1706 %    \end{macrocode}
1708 %    The definition of |\ps@headings| for one sided printing can be
1709 %    much simpler, because we treat even and odd pages the same.
1710 %    Therefore we don't need to define |\@even...|.
1711 %    \begin{macrocode}
1712 \else
1713   \def\ps@headings{%
1714     \let\@oddfoot\@empty
1715     \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
1716     \let\@mkboth\markboth
1717 %    \end{macrocode}
1718 %    We use |\markright| now instead of |\markboth| as we did for two
1719 %    sided printing.
1720 %    \begin{macrocode}
1721 %<*article>
1722     \def\sectionmark##1{%
1723       \markright {\MakeUppercase{%
1724         \ifnum \c@secnumdepth >\m@ne
1725           \thesection\quad
1726         \fi
1727         ##1}}}}
1728 %</article>
1729 %    \end{macrocode}
1731 %    \begin{macrocode}
1732 %<*report|book>
1733     \def\chaptermark##1{%
1734       \markright {\MakeUppercase{%
1735         \ifnum \c@secnumdepth >\m@ne
1736 %<book>          \if@mainmatter
1737             \@chapapp\ \thechapter. \ %
1738 %<book>          \fi
1739         \fi
1740         ##1}}}}
1741 %</report|book>
1743 %    \end{macrocode}
1744 % \end{macro}
1746 % \begin{macro}{\ps@myheadings}
1747 %    The definition of the page style \pstyle{myheadings} is fairly
1748 %    simple because the user determines the contents of the running
1749 %    head himself by using the |\markboth| and |\markright| commands.
1751 %    \begin{macrocode}
1752 \def\ps@myheadings{%
1753     \let\@oddfoot\@empty\let\@evenfoot\@empty
1754     \def\@evenhead{\thepage\hfil\slshape\leftmark}%
1755     \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
1756 %    \end{macrocode}
1758 %    We have to make sure that the marking commands that are used by
1759 %    the chapter and section headings are disabled. We do this
1760 %    |\let|ting them to a macro that gobbles its argument(s).
1761 %    \begin{macrocode}
1762     \let\@mkboth\@gobbletwo
1763 %<!article>    \let\chaptermark\@gobble
1764     \let\sectionmark\@gobble
1765 %<article>    \let\subsectionmark\@gobble
1766     }
1767 %    \end{macrocode}
1768 % \end{macro}
1770 % \section{Document Markup}
1772 % \subsection{The title}
1774 % \begin{macro}{\title}
1775 % \begin{macro}{\author}
1776 % \begin{macro}{\date}
1777 %    These three macros are provided by \file{latex.dtx} to provide
1778 %    information about the title, author(s) and date of the document.
1779 %    The information is stored away in internal control sequences.
1780 %    It is the task of the |\maketitle| command to use the
1781 %    information provided. The definitions of these macros are shown
1782 %    here for information.
1783 %    \begin{macrocode}
1784 % \newcommand*{\title}[1]{\gdef\@title{#1}}
1785 % \newcommand*{\author}[1]{\gdef\@author{#1}}
1786 % \newcommand*{\date}[1]{\gdef\@date{#1}}
1787 %    \end{macrocode}
1788 %    The |\date| macro gets today's date by default.
1789 %    \begin{macrocode}
1790 % \date{\today}
1791 %    \end{macrocode}
1792 % \end{macro}
1793 % \end{macro}
1794 % \end{macro}
1796 % \begin{macro}{\maketitle}
1797 %    The definition of |\maketitle| depends on whether a separate
1798 %    title page is made. This is the default for the report and book
1799 %    document classes, but for the article class it is optional.
1801 %    When we are making a title page, we locally redefine
1802 %    |\footnotesize| and |footnoterule| to change the appearance of
1803 %    the footnotes that are produced by the |\thanks| command;
1804 %    these changes affect all footnotes.
1805 % \changes{v1.3o}{1995/11/02}{(CAR) Make \cs{footnote} always work in
1806 %      title, etc}
1807 %    \begin{macrocode}
1808   \if@titlepage
1809   \newcommand\maketitle{\begin{titlepage}%
1810   \let\footnotesize\small
1811   \let\footnoterule\relax
1812   \let \footnote \thanks
1813 %    \end{macrocode}
1814 %    We center the entire title vertically; the centering is set off a
1815 %    little by adding a |\vskip|. (In compatibility mode the pagenumber
1816 %    is set to 0 by the titlepage environment to keep the behaviour 
1817 %    of \LaTeX\ 2.09 style files.)
1818 % \changes{v1.0g}{1993/12/09}{Removed the setting of the page number,
1819 %    when not in compatibility mode}
1820 % \changes{v1.2c}{1994/03/17}{Removed setting of page number, now done
1821 %    in titlepage environment}
1822 %    \begin{macrocode}
1823   \null\vfil
1824   \vskip 60\p@
1825 %    \end{macrocode}
1826 %    Then we set the title, in a |\LARGE| font; leave a little space
1827 %    and set the author(s) in a |\large| font. We do this inside a
1828 %    tabular environment to get them in a single column.
1829 %    Before the date we leave a little whitespace again.
1830 %    \begin{macrocode}
1831   \begin{center}%
1832     {\LARGE \@title \par}%
1833     \vskip 3em%
1834     {\large
1835      \lineskip .75em%
1836       \begin{tabular}[t]{c}%
1837         \@author
1838       \end{tabular}\par}%
1839       \vskip 1.5em%
1840     {\large \@date \par}%       % Set date in \large size.
1841   \end{center}\par
1842 %    \end{macrocode}
1843 %    Then we call |\@thanks| to print the information that goes into
1844 %    the footnote and finish the page.
1845 %    \begin{macrocode}
1846   \@thanks
1847   \vfil\null
1848   \end{titlepage}%
1849 %    \end{macrocode}
1850 %    We reset the \Lcount{footnote} counter, disable |\thanks| and
1851 %    |\maketitle| and save some storage space by emptying the internal
1852 %    information macros.
1853 % \changes{v1.3j}{1995/08/16}{use \cs{let} to save space}
1854 % \changes{v1.3n}{1995/10/29}{Empty \cs{@date} as well}
1855 %    \begin{macrocode}
1856   \setcounter{footnote}{0}%
1857   \global\let\thanks\relax
1858   \global\let\maketitle\relax
1859   \global\let\@thanks\@empty
1860   \global\let\@author\@empty
1861   \global\let\@date\@empty
1862   \global\let\@title\@empty
1863 %    \end{macrocode}
1864 %    After the title is set the declaration commands |\title|, etc.\
1865 %    can vanish.
1866 %    The definition of |\and| makes only sense within the argument of
1867 %    |\author| so this can go as well.
1868 % \changes{v1.3k}{1995/08/27}{Disable \cs{title} and similar decls}
1869 %    \begin{macrocode}
1870   \global\let\title\relax
1871   \global\let\author\relax
1872   \global\let\date\relax
1873   \global\let\and\relax
1875 %    \end{macrocode}
1876 %    When the title is not on a page of its own, the layout of the
1877 %    title is a little different. We use symbols to mark the footnotes
1878 %    and we have to deal with two column documents.
1880 %    Therefore we first start a new group to keep changes local. Then
1881 %    we redefine |\thefootnote| to use |\fnsymbol|; and change
1882 %    |\@makefnmark| so that footnotemarks have zero width (to make the
1883 %    centering of the author names look better).
1884 % \changes{v1.2s}{1994/06/02}{Reset \cs{@makefntext}}
1885 % \changes{v1.3a}{1995/05/17}{Use \cs{@makefnmark} in definition of
1886 %    \cs{@makefntext}}
1887 % \changes{v1.3g}{1995/06/26}{Fix definition of \cs{@makefnmark} and
1888 %    \cs{@makefntext} to a) work and b) without using math}
1889 %    \begin{macrocode}
1890 \else
1891 \newcommand\maketitle{\par
1892   \begingroup
1893     \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
1894     \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
1895     \long\def\@makefntext##1{\parindent 1em\noindent
1896             \hb@xt@1.8em{%
1897                 \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
1898 %    \end{macrocode}
1899 %    If this is a twocolumn document we start a new page in twocolumn
1900 %    mode, with the title set to the full width of the text. The
1901 %    actual printing of the title information is left to
1902 %    |\@maketitle|.
1903 % \changes{v1.2k}{1994/05/06}{Added check on number of columns in use
1904 %    locally}
1905 %    \begin{macrocode}
1906     \if@twocolumn
1907       \ifnum \col@number=\@ne
1908         \@maketitle
1909       \else
1910         \twocolumn[\@maketitle]%
1911       \fi
1912     \else
1913 %    \end{macrocode}
1914 %    When this is not a twocolumn document we just start a new page,
1915 %    prevent floating objects from appearing on the top of this page
1916 %    and print the title information.
1917 %    \begin{macrocode}
1918       \newpage
1919       \global\@topnum\z@   % Prevents figures from going at top of page.
1920       \@maketitle
1921     \fi
1922 %    \end{macrocode}
1923 %    This page gets a \pstyle{plain} layout. We call |\@thanks| to
1924 %    produce the footnotes.
1925 %    \begin{macrocode}
1926     \thispagestyle{plain}\@thanks
1927 %    \end{macrocode}
1928 %    Now we can close the group, reset the \Lcount{footnote} counter,
1929 %    disable |\thanks|, |\maketitle| and |\@maketitle| and save some
1930 %    storage space by emptying the internal information macros.
1931 % \changes{v1.3j}{1995/08/16}{use \cs{let} to save space}
1932 % \changes{v1.3k}{1995/08/27}{Disable \cs{title} and similar decls}
1933 % \changes{v1.3n}{1995/10/29}{Empty \cs{@date} as well}
1934 %    \begin{macrocode}
1935   \endgroup
1936   \setcounter{footnote}{0}%
1937   \global\let\thanks\relax
1938   \global\let\maketitle\relax
1939   \global\let\@maketitle\relax
1940   \global\let\@thanks\@empty
1941   \global\let\@author\@empty
1942   \global\let\@date\@empty
1943   \global\let\@title\@empty
1944   \global\let\title\relax
1945   \global\let\author\relax
1946   \global\let\date\relax
1947   \global\let\and\relax
1949 %    \end{macrocode}
1950 % \end{macro}
1952 % \begin{macro}{\@maketitle}
1953 %    This macro takes care of formatting the title information when we
1954 %    have no separate title page.
1956 %    We always start a new page, leave some white space and center the
1957 %    information. The title is set in a |\LARGE| font, the author
1958 %    names and the date in a |\large| font.
1959 % \changes{v1.3o}{1995/11/02}{(CAR) Make \cs{footnote} always work in
1960 %      title, etc}
1961 %    \begin{macrocode}
1962 \def\@maketitle{%
1963   \newpage
1964   \null
1965   \vskip 2em%
1966   \begin{center}%
1967   \let \footnote \thanks
1968     {\LARGE \@title \par}%
1969     \vskip 1.5em%
1970     {\large
1971       \lineskip .5em%
1972       \begin{tabular}[t]{c}%
1973         \@author
1974       \end{tabular}\par}%
1975     \vskip 1em%
1976     {\large \@date}%
1977   \end{center}%
1978   \par
1979   \vskip 1.5em}
1981 %    \end{macrocode}
1982 % \end{macro}
1984 % \subsection{Chapters and Sections}
1986 % \subsubsection{Building blocks} The definitions in this part of the
1987 %    class file make use of two internal macros, |\@startsection| and
1988 %    |\secdef|. To understand
1989 %    what is going on here, we describe their syntax.
1991 %    The macro |\@startsection| has 6 required arguments, optionally
1992 %    followed by  a $*$, an optional argument and a required argument:
1994 %    |\@startsection|\meta{name}\meta{level}\meta{indent}^^A
1995 %                    \meta{beforeskip}\meta{afterskip}\meta{style}
1996 %            optional *\\
1997 %    \null\hphantom{\bslash @startsection}^^A
1998 %            |[|\meta{altheading}|]|\meta{heading}
2000 %    It is a generic command to start a section, the arguments have
2001 %    the following meaning:
2003 %    \begin{description}
2004 %    \item[\meta{name}] The name of the user level command, e.g.,
2005 %          `section'.
2006 %    \item[\meta{level}] A number, denoting the depth of the section
2007 %          -- e.g., chapter=1, section = 2, etc.  A section number
2008 %          will be printed if and only if \meta{level} $<=$  the value
2009 %          of the \Lcount{secnumdepth} counter.
2010 %    \item[\meta{indent}] The indentation of the heading from the left
2011 %          margin
2012 %    \item[\meta{beforeskip}] The absolute value of this argument
2013 %          gives the skip to leave above the heading. If it is
2014 %          negative, then the paragraph indent of the text following
2015 %          the heading is suppressed.
2016 %    \item[\meta{afterskip}] If positive, this gives the skip to leave
2017 %          below the heading, else it gives the skip to leave to the
2018 %          right of a run-in heading.
2019 %    \item[\meta{style}] Commands to set the style of the heading.
2020 %    \item[$*$] When this is missing the heading is numbered and the
2021 %          corresponding counter is incremented.
2022 %    \item[\meta{altheading}] Gives an alternative heading to use in
2023 %          the table of contents and in the running heads. This should
2024 %          not be present when the $*$ form is used.
2025 %    \item[\meta{heading}] The heading of the new section.
2026 %    \end{description}
2027 %  A sectioning command is normally defined to |\@startsection| and
2028 %  its first six arguments.
2030 %    The macro |\secdef| can be used when a sectioning command is
2031 %    defined without using |\@startsection|. It has two arguments:
2033 %    |\secdef|\meta{unstarcmds}\meta{starcmds}
2035 %    \begin{description}
2036 %    \item[\meta{unstarcmds}] Used for the normal form of the
2037 %          sectioning command.
2038 %    \item[\meta{starcmds}] Used for the $*$-form of the
2039 %          sectioning command.
2040 %    \end{description}
2042 %    You can use |\secdef| as follows:
2043 % \begin{verbatim}
2044 %       \def\chapter { ... \secdef \CMDA \CMDB }
2045 %       \def\CMDA    [#1]#2{ ... }  % Command to define
2046 %                                   % \chapter[...]{...}
2047 %       \def\CMDB    #1{ ... }      % Command to define
2048 %                                   % \chapter*{...}
2049 % \end{verbatim}
2051 % \subsubsection{Mark commands}
2053 % \begin{macro}{\chaptermark}
2054 % \begin{macro}{\sectionmark}
2055 % \begin{macro}{\subsectionmark}
2056 % \begin{macro}{\subsubsectionmark}
2057 % \begin{macro}{\paragraphmark}
2058 % \begin{macro}{\subparagraphmark}
2059 %    Default initializations of |\...mark| commands.  These commands
2060 %    are used in the definition of the page styles (see
2061 %    section~\ref{sec:classes:pagestyle}) Most of them are already defined by
2062 %    \file{latex.dtx}, so they are only shown here.
2064 %    \begin{macrocode}
2065 %<!article>\newcommand*\chaptermark[1]{}
2066 % \newcommand*\sectionmark[1]{}
2067 % \newcommand*\subsectionmark[1]{}
2068 % \newcommand*\subsubsectionmark[1]{}
2069 % \newcommand*\paragraphmark[1]{}
2070 % \newcommand*\subparagraphmark[1]{}
2071 %    \end{macrocode}
2072 % \end{macro}
2073 % \end{macro}
2074 % \end{macro}
2075 % \end{macro}
2076 % \end{macro}
2077 % \end{macro}
2079 % \subsubsection{Define Counters}
2081 % \begin{macro}{\c@secnumdepth}
2082 %    The value of the counter \Lcount{secnumdepth} gives the depth of
2083 %    the highest-level sectioning command that is to produce section
2084 %    numbers.
2085 %    \begin{macrocode}
2086 %<article>\setcounter{secnumdepth}{3}
2087 %<!article>\setcounter{secnumdepth}{2}
2088 %    \end{macrocode}
2089 % \end{macro}
2091 % \begin{macro}{\c@part}
2092 % \begin{macro}{\c@chapter}
2093 % \begin{macro}{\c@section}
2094 % \begin{macro}{\c@subsection}
2095 % \begin{macro}{\c@subsubsection}
2096 % \begin{macro}{\c@paragraph}
2097 % \begin{macro}{\c@subparagraph}
2098 %    These counters are used for the section numbers. The macro\\
2099 %    |\newcounter{|\meta{newctr}|}[|\meta{oldctr}|]|\\
2100 %     defines\meta{newctr} to be a counter, which is reset to zero when
2101 %    counter \meta{oldctr} is stepped. Counter \meta{oldctr} must
2102 %    already be defined.
2104 %    \begin{macrocode}
2105 \newcounter {part}
2106 %<article>\newcounter {section}
2107 %<*report|book>
2108 \newcounter {chapter}
2109 \newcounter {section}[chapter]
2110 %</report|book>
2111 \newcounter {subsection}[section]
2112 \newcounter {subsubsection}[subsection]
2113 \newcounter {paragraph}[subsubsection]
2114 \newcounter {subparagraph}[paragraph]
2115 %    \end{macrocode}
2116 % \end{macro}
2117 % \end{macro}
2118 % \end{macro}
2119 % \end{macro}
2120 % \end{macro}
2121 % \end{macro}
2122 % \end{macro}
2124 % \begin{macro}{\thepart}
2125 % \begin{macro}{\thechapter}
2126 % \begin{macro}{\thesection}
2127 % \begin{macro}{\thesubsection}
2128 % \begin{macro}{\thesubsubsection}
2129 % \begin{macro}{\theparagraph}
2130 % \begin{macro}{\thesubparagraph}
2131 %    For any counter \Lcount{CTR}, |\theCTR| is a macro that defines
2132 %    the printed version of counter \Lcount{CTR}.  It is defined in
2133 %    terms of the following macros:
2135 %    |\arabic{|\Lcount{COUNTER}|}| prints the value of
2136 %    \Lcount{COUNTER} as an arabic numeral.
2138 %    |\roman{|\Lcount{COUNTER}|}| prints the value of
2139 %    \Lcount{COUNTER} as a lowercase roman numberal.
2141 %    |\Roman{|\Lcount{COUNTER}|}| prints the value of
2142 %    \Lcount{COUNTER} as an uppercase roman numberal.
2144 %    |\alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
2145 %    as a lowercase letter: $1 =$~a, $2 =$~ b, etc.
2147 %    |\Alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
2148 %    as an uppercase letter: $1 =$~A, $2 =$~B, etc.
2150 %    Actually to save space the internal counter repesentations
2151 %    and the commands operating on those are used.
2152 %    \begin{macrocode}
2153 \renewcommand \thepart {\@Roman\c@part}
2154 %<article>\renewcommand \thesection {\@arabic\c@section}
2155 %<*report|book>
2156 \renewcommand \thechapter {\@arabic\c@chapter}
2157 \renewcommand \thesection {\thechapter.\@arabic\c@section}
2158 %</report|book>
2159 \renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}
2160 \renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
2161 \renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
2162 \renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
2163 %    \end{macrocode}
2164 % \end{macro}
2165 % \end{macro}
2166 % \end{macro}
2167 % \end{macro}
2168 % \end{macro}
2169 % \end{macro}
2170 % \end{macro}
2172 % \begin{macro}{\@chapapp}
2173 %    |\@chapapp| is initially defined to be `|\chaptername|'. The
2174 %    |\appendix| command redefines it to be `|\appendixname|'.
2176 %    \begin{macrocode}
2177 %<report|book>\newcommand\@chapapp{\chaptername}
2178 %    \end{macrocode}
2179 % \end{macro}
2181 %  \subsubsection{Front Matter, Main Matter, and Back Matter}
2183 %    A book contains these three (logical) sections. The switch
2184 %    |\@mainmatter| is true iff we are processing Main Matter.  When
2185 %    this switch is false, the |\chapter| command does not print
2186 %    chapter numbers.
2188 %    Here we define the commands that start these sections.
2189 %  \begin{macro}{\frontmatter}
2190 %    This command starts Roman page numbering and turns off chapter
2191 %    numbering.  Since this restarts the page numbering from 1, it
2192 %    should also ensure that a recto page is used.
2193 % \changes{v1.3r}{1996/05/26}{Make this command react to the option
2194 %    \texttt{openany}}
2195 % \changes{v1.3y}{1998/05/05}{Two years on: Make this command not
2196 %    react to the option \texttt{openany} as this makes the
2197 %    verso/recto numbering wrong: see pr/2754 for discussion}
2198 %    \begin{macrocode}
2199 %<*book>
2200 \newcommand\frontmatter{%
2201 %   \if@openright
2202     \cleardoublepage
2203 %   \else
2204 %     \clearpage
2205 %   \fi
2206   \@mainmatterfalse
2207   \pagenumbering{roman}}
2208 %    \end{macrocode}
2209 %  \end{macro}
2211 %  \begin{macro}{\mainmatter}
2212 %    This command clears the page, starts arabic page numbering and 
2213 %    turns on chapter numbering.  Since this restarts the page numbering
2214 %    from 1, it should also ensure that a recto page is used.
2215 % \changes{v1.3r}{1996/05/26}{Make this command react to the option
2216 %    \texttt{openany}}
2217 % \changes{v1.3y}{1998/05/05}{Two years on: Make this command not
2218 %    react to the option \texttt{openany} as this makes the
2219 %    verso/recto numbering wrong: see pr/2754 for discussion}
2220 %    \begin{macrocode}
2221 \newcommand\mainmatter{%
2222 %   \if@openright
2223     \cleardoublepage
2224 %   \else
2225 %     \clearpage
2226 %   \fi
2227   \@mainmattertrue
2228   \pagenumbering{arabic}}
2229 %    \end{macrocode}
2230 %  \end{macro}
2232 %  \begin{macro}{\backmatter}
2233 %    This clears the page, turns off chapter numbering and leaves page 
2234 %    numbering unchanged.
2235 %    \begin{macrocode}
2236 \newcommand\backmatter{%
2237   \if@openright
2238     \cleardoublepage
2239   \else
2240     \clearpage
2241   \fi
2242   \@mainmatterfalse}
2243 %</book>
2244 %    \end{macrocode}
2245 %  \end{macro}
2247 % \subsubsection{Parts}
2249 % \begin{macro}{\part}
2250 %    The command to start a new part of our document.
2252 %    In the article class the definition of |\part| is rather simple;
2253 %    we start a new paragraph, add a little white space, suppress the
2254 %    indentation of the first paragraph and make use of |\secdef|.
2255 %    As in other sectioning commands (cf.\ |\@startsection| in the
2256 %    {\LaTeXe} kernel), we need to check the |@noskipsec| switch and
2257 %    force horizontal mode if it is set.
2258 % \changes{v1.4a}{1999/01/07}{Check \texttt{@noskipsec} switch and
2259 %      possibly force horizontal mode; see PR/2889.}
2260 %    \begin{macrocode}
2261 %<*article>
2262 \newcommand\part{%
2263    \if@noskipsec \leavevmode \fi
2264    \par
2265    \addvspace{4ex}%
2266    \@afterindentfalse
2267    \secdef\@part\@spart}
2268 %</article>
2269 %    \end{macrocode}
2271 %    For the report and book classes we things a bit different.
2273 %    We start a new (righthand) page and use the \pstyle{plain}
2274 %    pagestyle.
2275 % \changes{v1.3r}{1996/05/26}{Make this command react to the option
2276 %    \texttt{openany}}
2277 %    \begin{macrocode}
2278 %<*report|book>
2279 \newcommand\part{%
2280   \if@openright
2281     \cleardoublepage
2282   \else
2283     \clearpage
2284   \fi
2285   \thispagestyle{plain}%
2286 %    \end{macrocode}
2287 %    When we are making a two column document, this will be a one
2288 %    column page. We use |@tempswa| to remember to switch back to two
2289 %    columns.
2290 %    \begin{macrocode}
2291   \if@twocolumn
2292     \onecolumn
2293     \@tempswatrue
2294   \else
2295     \@tempswafalse
2296   \fi
2297 %    \end{macrocode}
2298 %    We need an empty box to prevent the fil glue from disappearing.
2299 % \changes{v1.3j}{1995/08/16}{Replace \cs{hbox} by \cs{null}}
2300 %    \begin{macrocode}
2301   \null\vfil
2302 %    \end{macrocode}
2303 %    Here we use |\secdef| to indicate which commands to use to make
2304 %    the actual heading.
2305 %    \begin{macrocode}
2306   \secdef\@part\@spart}
2307 %</report|book>
2308 %    \end{macrocode}
2310 % \begin{macro}{\@part}
2311 %    This macro does the actual formatting of the title of the part.
2312 %    Again the macro is differently defined for the article document
2313 %    class than for the document classes report and book.
2315 %    When \Lcount{secnumdepth} is larger than $-1$ for the
2316 %    document class article, we have a numbered
2317 %    part, otherwise it is unnumbered.
2318 %    \begin{macrocode}
2319 %<*article>
2320 \def\@part[#1]#2{%
2321     \ifnum \c@secnumdepth >\m@ne
2322       \refstepcounter{part}%
2323       \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
2324     \else
2325       \addcontentsline{toc}{part}{#1}%
2326     \fi
2327 %    \end{macrocode}
2328 %    We  print the title flush left in the article class.
2329 %    Also we prevent breaking between lines and reset the font.
2330 % \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with
2331 %    \cs{normalfont}}
2332 %    \begin{macrocode}
2333     {\parindent \z@ \raggedright
2334      \interlinepenalty \@M
2335      \normalfont
2336 %    \end{macrocode}
2337 %    When this is a numbered part we have to print the number and the
2338 %    title. The |\nobreak| should prevent a page break here.
2339 % \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace}
2340 %                             (pr/3310)}
2341 %    \begin{macrocode}
2342      \ifnum \c@secnumdepth >\m@ne
2343        \Large\bfseries \partname\nobreakspace\thepart
2344        \par\nobreak
2345      \fi
2346      \huge \bfseries #2%
2347 %    \end{macrocode}
2348 %    Now we empty the mark registers, leave some white space and let
2349 %    |\@afterheading| take care of suppressing the indentation.
2350 %    \begin{macrocode}
2351      \markboth{}{}\par}%
2352     \nobreak
2353     \vskip 3ex
2354     \@afterheading}
2355 %</article>
2356 %    \end{macrocode}
2358 %    When \Lcount{secnumdepth} is larger than $-2$ for the
2359 %    document class report and book, we have a numbered
2360 %    part, otherwise it is unnumbered.
2361 %    \begin{macrocode}
2362 %<*report|book>
2363 \def\@part[#1]#2{%
2364     \ifnum \c@secnumdepth >-2\relax
2365       \refstepcounter{part}%
2366       \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
2367     \else
2368       \addcontentsline{toc}{part}{#1}%
2369     \fi
2370 %    \end{macrocode}
2371 %    We empty the mark registers and center the title on the page in the
2372 %    report and book document classes.
2373 %    Also we prevent breaking between lines and reset the font.
2374 % \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with
2375 %    \cs{normalfont}}
2376 % \changes{v1.3j}{1995/08/16}{add missing percent}
2377 %    \begin{macrocode}
2378     \markboth{}{}%
2379     {\centering
2380      \interlinepenalty \@M
2381      \normalfont
2382 %    \end{macrocode}
2383 %    When this is a numbered part we have to print the number.
2384 % \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace}
2385 %                             (pr/3310)}
2386 %    \begin{macrocode}
2387      \ifnum \c@secnumdepth >-2\relax
2388        \huge\bfseries \partname\nobreakspace\thepart
2389        \par
2390 %    \end{macrocode}
2391 %    We leave some space before we print the title and leave the
2392 %    finishing up to |\@endpart|.
2393 %    \begin{macrocode}
2394        \vskip 20\p@
2395      \fi
2396      \Huge \bfseries #2\par}%
2397     \@endpart}
2398 %</report|book>
2399 %    \end{macrocode}
2400 % \end{macro}
2402 % \begin{macro}{\@spart}
2403 %    This macro does the actual formatting of the title of the part
2404 %    when the star form of the user command was used. In this case we
2405 %    \emph{never} print a number. Otherwise the formatting is the
2406 %    same.
2408 %    The differences between the definition of this macro in the
2409 %    article document class and in the report and book document
2410 %    classes are similar as they were for |\@part|.
2411 % \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with
2412 %    \cs{normalfont}}
2413 %    \begin{macrocode}
2414 %<*article>
2415 \def\@spart#1{%
2416     {\parindent \z@ \raggedright
2417      \interlinepenalty \@M
2418      \normalfont
2419      \huge \bfseries #1\par}%
2420      \nobreak
2421      \vskip 3ex
2422      \@afterheading}
2423 %</article>
2424 %<*report|book>
2425 \def\@spart#1{%
2426     {\centering
2427      \interlinepenalty \@M
2428      \normalfont
2429      \Huge \bfseries #1\par}%
2430     \@endpart}
2431 %</report|book>
2432 %    \end{macrocode}
2433 % \end{macro}
2435 % \begin{macro}{\@endpart}
2436 % \changes{v1.3j}{1995/08/16}{move docstrip guard to avoid defining
2437 %    \cs{@endpart} in article}
2438 %    This macro finishes the part page, for both |\@part| and
2439 %    |\@spart|.
2441 %    First we fill the current page.
2442 %    \begin{macrocode}
2443 %<*report|book>
2444 \def\@endpart{\vfil\newpage
2445 %    \end{macrocode}
2446 %    Then, when we are in twosided mode and chapters are supposed to
2447 %    be on right hand sides, we produce a completely blank page.
2448 % \changes{v1.4b}{2000/05/19}{Only add empty page after part if
2449 %    twoside and openright (pr/3155)}
2450 %    \begin{macrocode}
2451               \if@twoside
2452                \if@openright
2453                 \null
2454                 \thispagestyle{empty}%
2455                 \newpage
2456                \fi
2457               \fi
2458 %    \end{macrocode}
2459 %    When this was a two column document we have to switch back to two
2460 %    column mode.
2461 %    \begin{macrocode}
2462               \if@tempswa
2463                 \twocolumn
2464               \fi}
2465 %</report|book>
2466 %    \end{macrocode}
2467 % \end{macro}
2468 % \end{macro}
2470 % \subsubsection{Chapters}
2472 % \begin{macro}{\chapter}
2473 %    A chapter should always start on a new page therefore we start by
2474 %    calling |\clearpage| and setting the pagestyle for this page to
2475 %    \pstyle{plain}.
2476 %    \begin{macrocode}
2477 %<*report|book>
2478 \newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
2479                     \thispagestyle{plain}%
2480 %    \end{macrocode}
2481 %    Then we prevent floats from appearing at the top of this page
2482 %    because it looks weird to see a floating object above a chapter
2483 %    title.
2484 %    \begin{macrocode}
2485                     \global\@topnum\z@
2486 %    \end{macrocode}
2487 %    Then we suppress the indentation of the first paragraph by
2488 %    setting the switch |\@afterindent| to |false|. We use |\secdef|
2489 %    to specify the macros to use for actually setting the chapter
2490 %    title.
2491 %    \begin{macrocode}
2492                     \@afterindentfalse
2493                     \secdef\@chapter\@schapter}
2494 %    \end{macrocode}
2496 % \begin{macro}{\@chapter}
2497 %    This macro is called when we have a numbered chapter. When
2498 %    \Lcount{secnumdepth} is larger than $-1$ and, in the book
2499 %    class, |\@mainmatter| is true, we display the chapter
2500 %    number. We also inform the user that a new chapter is about to be
2501 %    typeset by writing a message to the terminal.
2502 %    \begin{macrocode}
2503 \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
2504 %<book>                       \if@mainmatter
2505                          \refstepcounter{chapter}%
2506                          \typeout{\@chapapp\space\thechapter.}%
2507                          \addcontentsline{toc}{chapter}%
2508                                    {\protect\numberline{\thechapter}#1}%
2509 %<*book>
2510                        \else
2511                          \addcontentsline{toc}{chapter}{#1}%
2512                        \fi
2513 %</book>
2514                     \else
2515                       \addcontentsline{toc}{chapter}{#1}%
2516                     \fi
2517 %    \end{macrocode}
2518 %    After having written an entry to the table of contents we store
2519 %    the (alternative) title of this chapter with |\chaptermark| and
2520 %    add some white space to the lists of figures and tables.
2521 %    \begin{macrocode}
2522                     \chaptermark{#1}%
2523                     \addtocontents{lof}{\protect\addvspace{10\p@}}%
2524                     \addtocontents{lot}{\protect\addvspace{10\p@}}%
2525 %    \end{macrocode}
2526 %    Then we call upon |\@makechapterhead| to format the actual
2527 %    chapter title. We have to do this in a special way when we are in
2528 %    twocolumn mode in order to have the chapter title use the entire
2529 %    |\textwidth|. In one column mode we call |\@afterheading| which
2530 %    takes care of suppressing the indentation.
2531 %    \begin{macrocode}
2532                     \if@twocolumn
2533                       \@topnewpage[\@makechapterhead{#2}]%
2534                     \else
2535                       \@makechapterhead{#2}%
2536                       \@afterheading
2537                     \fi}
2538 %    \end{macrocode}
2540 % \begin{macro}{\@makechapterhead}
2541 %    The macro above uses |\@makechapterhead|\meta{text} to format the
2542 %    heading of the chapter.
2544 %    We begin by leaving some white space. The we open a group in
2545 %    which we have a paragraph indent of 0pt, and in which we have the
2546 %    text set ragged right. We also reset the font.
2547 % \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with
2548 %    \cs{normalfont}}
2549 %    \begin{macrocode}
2550 \def\@makechapterhead#1{%
2551   \vspace*{50\p@}%
2552   {\parindent \z@ \raggedright \normalfont
2553 %    \end{macrocode}
2554 %    Then we check whether the number of the chapter has to be printed.
2555 %    If so we leave some whitespace between the chapternumber and its
2556 %    title.
2557 % \changes{v1.2v}{1994/11/30}{Added a \cs{nobreak} to prevent a
2558 %    pagebreak between the chapternumber and the chaptertitle}
2559 % \changes{v1.3j}{1995/08/16}{replace braces by \cs{space}}
2560 %    \begin{macrocode}
2561     \ifnum \c@secnumdepth >\m@ne
2562 %<book>      \if@mainmatter
2563         \huge\bfseries \@chapapp\space \thechapter
2564         \par\nobreak
2565         \vskip 20\p@
2566 %<book>      \fi
2567     \fi
2568 %    \end{macrocode}
2569 %    Now we set the title in a large bold font. We prevent a pagebreak
2570 %    from occuring in the middle of or after the title. Finally we
2571 %    leave some whitespace before the text begins.
2572 % \changes{v1.2v}{1994/11/30}{Added \cs{interlinepenalty}\cs{@M} to
2573 %    prevent a pagebreak in the middle of a title}
2574 %    \begin{macrocode}
2575     \interlinepenalty\@M
2576     \Huge \bfseries #1\par\nobreak
2577     \vskip 40\p@
2578   }}
2579 %    \end{macrocode}
2580 % \end{macro}
2581 % \end{macro}
2583 % \begin{macro}{\@schapter}
2584 %    This macro is called when we have an unnumbered chapter. It is
2585 %    much simpler than |\@chapter| because it only needs to typeset
2586 %    the chapter title.
2587 %    \begin{macrocode}
2588 \def\@schapter#1{\if@twocolumn
2589                    \@topnewpage[\@makeschapterhead{#1}]%
2590                  \else
2591                    \@makeschapterhead{#1}%
2592                    \@afterheading
2593                  \fi}
2594 %    \end{macrocode}
2596 % \begin{macro}{\@makeschapterhead}
2597 %    The macro above uses |\@makeschapterhead|\meta{text}to format
2598 %    the heading of the chapter. It is similar to |\@makechapterhead|
2599 %    except that it never has to print a chapter number.
2601 % \changes{v1.2v}{1994/11/30}{Added \cs{interlinepenalty}\cs{@M} to
2602 %    prevent a pagebreak in the middle of a title}
2603 % \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with
2604 %    \cs{normalfont}}
2605 %    \begin{macrocode}
2606 \def\@makeschapterhead#1{%
2607   \vspace*{50\p@}%
2608   {\parindent \z@ \raggedright
2609     \normalfont
2610     \interlinepenalty\@M
2611     \Huge \bfseries  #1\par\nobreak
2612     \vskip 40\p@
2613   }}
2614 %</report|book>
2615 %    \end{macrocode}
2616 % \end{macro}
2617 % \end{macro}
2618 % \end{macro}
2621 % \subsubsection{Lower level headings}
2623 %    These commands all make use of |\@startsection|.
2624 % \begin{macro}{\section}
2625 %    This gives a normal heading with white space above and below the
2626 %    heading, the title set in |\Large\bfseries|, and no indentation
2627 %    on the first paragraph.
2628 % \changes{v1.3c}{1995/05/25}{replace \cs{reset@font} with
2629 %    \cs{normalfont}}
2630 %    \begin{macrocode}
2631 \newcommand\section{\@startsection {section}{1}{\z@}%
2632                                    {-3.5ex \@plus -1ex \@minus -.2ex}%
2633                                    {2.3ex \@plus.2ex}%
2634                                    {\normalfont\Large\bfseries}}
2635 %    \end{macrocode}
2636 % \end{macro}
2638 % \begin{macro}{\subsection}
2639 %    This gives a normal heading with white space above and below the
2640 %    heading, the title set in |\large\bfseries|, and no indentation
2641 %    on the first paragraph.
2642 %    \begin{macrocode}
2643 \newcommand\subsection{\@startsection{subsection}{2}{\z@}%
2644                                      {-3.25ex\@plus -1ex \@minus -.2ex}%
2645                                      {1.5ex \@plus .2ex}%
2646                                      {\normalfont\large\bfseries}}
2647 %    \end{macrocode}
2648 % \end{macro}
2650 % \begin{macro}{\subsubsection}
2651 %    This gives a normal heading with white space above and below the
2652 %    heading, the title set in |\normalsize\bfseries|, and no
2653 %    indentation on the first paragraph.
2654 %    \begin{macrocode}
2655 \newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
2656                                      {-3.25ex\@plus -1ex \@minus -.2ex}%
2657                                      {1.5ex \@plus .2ex}%
2658                                      {\normalfont\normalsize\bfseries}}
2659 %    \end{macrocode}
2660 % \end{macro}
2662 % \begin{macro}{\paragraph}
2663 %    This gives a run-in heading with white space above and to the
2664 %    right of the heading, the title set in |\normalsize\bfseries|.
2665 %    \begin{macrocode}
2666 \newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
2667                                     {3.25ex \@plus1ex \@minus.2ex}%
2668                                     {-1em}%
2669                                     {\normalfont\normalsize\bfseries}}
2670 %    \end{macrocode}
2671 % \end{macro}
2673 % \begin{macro}{\subparagraph}
2674 %    This gives an indented run-in heading with white space above and
2675 %    to the right of the heading, the title set in
2676 %    |\normalsize\bfseries|.
2677 %    \begin{macrocode}
2678 \newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
2679                                        {3.25ex \@plus1ex \@minus .2ex}%
2680                                        {-1em}%
2681                                       {\normalfont\normalsize\bfseries}}
2682 %    \end{macrocode}
2683 % \end{macro}
2685 % \subsection{Lists}
2687 % \subsubsection{General List Parameters}
2689 % The following commands are used to set the default values for the list
2690 % environment's parameters. See the \LaTeX{} manual for an explanation
2691 % of the meanings of the parameters.  Defaults for the list
2692 % environment are set as follows.  First, |\rightmargin|,
2693 % |\listparindent| and |\itemindent| are set to 0pt.  Then, for a Kth
2694 % level list, the command |\@listK| is called, where `K' denotes `i',
2695 % '`i', ... , `vi'.  (I.e., |\@listiii| is called for a third-level
2696 % list.)  By convention, |\@listK| should set |\leftmargin| to
2697 % |\leftmarginK|.
2699 % \begin{macro}{\leftmargin}
2700 % \begin{macro}{\leftmargini}
2701 % \begin{macro}{\leftmarginii}
2702 % \begin{macro}{\leftmarginiii}
2703 % \begin{macro}{\leftmarginiv}
2704 % \begin{macro}{\leftmarginv}
2705 % \begin{macro}{\leftmarginvi}
2706 % \changes{v1.0m}{1994/01/12}{Use em instead of pt to remain
2707 %    compatible with old styles}
2708 % \changes{v1.3q}{1995/12/20}{Temporary(?) fix: revert to setting
2709 %    \cs{leftmargin} at outer level} 
2711 % When we are in two column mode some of the margins are set somewhat
2712 % smaller.
2713 %    \begin{macrocode}
2714 \if@twocolumn
2715   \setlength\leftmargini  {2em}
2716 \else
2717   \setlength\leftmargini  {2.5em}
2719 %    \end{macrocode}
2720 %    Until the whole of the parameter setting in these files is
2721 %    rationalised, we need to set the value of |\leftmargin| at this
2722 %    outer level.
2723 %    \begin{macrocode}
2724 \leftmargin  \leftmargini
2725 %    \end{macrocode}
2726 %    The following three are calculated so  that they are larger than
2727 %    the sum of |\labelsep| and the width of the default labels (which
2728 %    are `(m)', `vii.' and `M.').
2729 %    \begin{macrocode}
2730 \setlength\leftmarginii  {2.2em}
2731 \setlength\leftmarginiii {1.87em}
2732 \setlength\leftmarginiv  {1.7em}
2733 \if@twocolumn
2734   \setlength\leftmarginv  {.5em}
2735   \setlength\leftmarginvi {.5em}
2736 \else
2737   \setlength\leftmarginv  {1em}
2738   \setlength\leftmarginvi {1em}
2740 %    \end{macrocode}
2741 % \end{macro}
2742 % \end{macro}
2743 % \end{macro}
2744 % \end{macro}
2745 % \end{macro}
2746 % \end{macro}
2747 % \end{macro}
2749 % \begin{macro}{\labelsep}
2750 % \begin{macro}{\labelwidth}
2751 % \changes{v1.0m}{1994/01/12}{Use em instead of pt to remain
2752 %    compatible with old styles}
2753 %    |\labelsep| is the distance between the label and the text of an
2754 %    item; |\labelwidth| is the width of the label.
2755 %    \begin{macrocode}
2756 \setlength  \labelsep  {.5em}
2757 \setlength  \labelwidth{\leftmargini}
2758 \addtolength\labelwidth{-\labelsep}
2759 %    \end{macrocode}
2760 % \end{macro}
2761 % \end{macro}
2763 % \begin{macro}{\partopsep}
2764 %    When the user leaves a blank line before the environment an extra
2765 %    vertical space of |\partopsep| is inserted, in addition to
2766 %    |\parskip| and |\topsep|.
2767 % \changes{v1.0m}{1994/01/12}{\cs{partopsep} should be different,
2768 %    depending on the pointsize}
2769 %    \begin{macrocode}
2770 %</article|report|book>
2771 %<10pt>\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
2772 %<11pt>\setlength\partopsep{3\p@ \@plus 1\p@ \@minus 1\p@}
2773 %<12pt>\setlength\partopsep{3\p@ \@plus 2\p@ \@minus 2\p@}
2774 %    \end{macrocode}
2775 % \end{macro}
2777 % \begin{macro}{\@beginparpenalty}
2778 % \begin{macro}{\@endparpenalty}
2779 %    These penalties are inserted before and after a list or paragraph
2780 %    environment. They are set to a bonus value to encourage page
2781 %    breaking at these points.
2782 % \begin{macro}{\@itempenalty}
2783 %    This penalty is inserted between list items.
2784 %    \begin{macrocode}
2785 %<*article|report|book>
2786 \@beginparpenalty -\@lowpenalty
2787 \@endparpenalty   -\@lowpenalty
2788 \@itempenalty     -\@lowpenalty
2789 %</article|report|book>
2790 %    \end{macrocode}
2791 % \end{macro}
2792 % \end{macro}
2793 % \end{macro}
2795 % \begin{macro}{\@listi}
2796 % \begin{macro}{\@listI}
2797 % |\@listi| defines the values of
2798 % |\leftmargin|, |\parsep|, |\topsep|, |\itemsep|, etc.\ for the
2799 % lists that appear on top-level. Its definition is modified by the 
2800 % font-size commands (eg within |\small| the list parameters get
2801 % ``smaller'' values).
2803 % For this reason \@listI is defined to hold a saved copy of \@listi
2804 % so that |\normalsize| can switch all parameters back.
2806 %    \begin{macrocode}
2807 %<*10pt|11pt|12pt>
2808 \def\@listi{\leftmargin\leftmargini
2809 %<*10pt>    
2810             \parsep 4\p@ \@plus2\p@ \@minus\p@
2811             \topsep 8\p@ \@plus2\p@ \@minus4\p@
2812             \itemsep4\p@ \@plus2\p@ \@minus\p@}
2813 %</10pt>            
2814 %<*11pt>            
2815             \parsep 4.5\p@ \@plus2\p@ \@minus\p@
2816             \topsep 9\p@   \@plus3\p@ \@minus5\p@
2817             \itemsep4.5\p@ \@plus2\p@ \@minus\p@}
2818 %</11pt>            
2819 %<*12pt>            
2820             \parsep 5\p@  \@plus2.5\p@ \@minus\p@
2821             \topsep 10\p@ \@plus4\p@   \@minus6\p@
2822             \itemsep5\p@  \@plus2.5\p@ \@minus\p@}
2823 %</12pt>
2824 \let\@listI\@listi
2825 %    \end{macrocode}
2826 %    We initialise the parameters although strictly speaking that
2827 %    is not necessary.
2828 %    \begin{macrocode}
2829 \@listi
2830 %    \end{macrocode}
2831 % \end{macro}
2832 % \end{macro}
2834 % \begin{macro}{\@listii}
2835 % \begin{macro}{\@listiii}
2836 % \begin{macro}{\@listiv}
2837 % \begin{macro}{\@listv}
2838 % \begin{macro}{\@listvi}
2839 %    Here are the same macros for the higher level lists. Note that
2840 %    they don't have saved versions and are not modified by the font
2841 %    size commands. In other words this class assumes that nested
2842 %    lists only appear in |\normalsize|, i.e.\ the main document size.
2843 %    \begin{macrocode}
2844 \def\@listii {\leftmargin\leftmarginii
2845               \labelwidth\leftmarginii
2846               \advance\labelwidth-\labelsep
2847 %<*10pt>
2848               \topsep    4\p@ \@plus2\p@ \@minus\p@
2849               \parsep    2\p@ \@plus\p@  \@minus\p@
2850 %</10pt>                 
2851 %<*11pt>                 
2852               \topsep    4.5\p@ \@plus2\p@ \@minus\p@
2853               \parsep    2\p@   \@plus\p@  \@minus\p@
2854 %</11pt>                 
2855 %<*12pt>                 
2856               \topsep    5\p@   \@plus2.5\p@ \@minus\p@
2857               \parsep    2.5\p@ \@plus\p@    \@minus\p@
2858 %</12pt>                 
2859               \itemsep   \parsep}
2860 \def\@listiii{\leftmargin\leftmarginiii
2861               \labelwidth\leftmarginiii
2862               \advance\labelwidth-\labelsep
2863 %<10pt>              \topsep    2\p@ \@plus\p@\@minus\p@
2864 %<11pt>              \topsep    2\p@ \@plus\p@\@minus\p@
2865 %<12pt>              \topsep    2.5\p@\@plus\p@\@minus\p@
2866               \parsep    \z@
2867               \partopsep \p@ \@plus\z@ \@minus\p@
2868               \itemsep   \topsep}
2869 \def\@listiv {\leftmargin\leftmarginiv
2870               \labelwidth\leftmarginiv
2871               \advance\labelwidth-\labelsep}
2872 \def\@listv  {\leftmargin\leftmarginv
2873               \labelwidth\leftmarginv
2874               \advance\labelwidth-\labelsep}
2875 \def\@listvi {\leftmargin\leftmarginvi
2876               \labelwidth\leftmarginvi
2877               \advance\labelwidth-\labelsep}
2878 %</10pt|11pt|12pt>
2879 %    \end{macrocode}
2880 % \end{macro}
2881 % \end{macro}
2882 % \end{macro}
2883 % \end{macro}
2884 % \end{macro}
2886 % \subsubsection{Enumerate}
2888 %    The enumerate environment uses  four counters: \Lcount{enumi},
2889 %    \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where
2890 %    \Lcount{enumN} controls the numbering of the Nth level
2891 %    enumeration.
2893 % \begin{macro}{\theenumi}
2894 % \begin{macro}{\theenumii}
2895 % \begin{macro}{\theenumiii}
2896 % \begin{macro}{\theenumiv}
2897 %    The counters are already defined in \file{latex.dtx}, but their
2898 %    representation is changed here.
2900 %    \begin{macrocode}
2901 %<*article|report|book>
2902 \renewcommand\theenumi{\@arabic\c@enumi}
2903 \renewcommand\theenumii{\@alph\c@enumii}
2904 \renewcommand\theenumiii{\@roman\c@enumiii}
2905 \renewcommand\theenumiv{\@Alph\c@enumiv}
2906 %    \end{macrocode}
2907 % \end{macro}
2908 % \end{macro}
2909 % \end{macro}
2910 % \end{macro}
2912 % \begin{macro}{\labelenumi}
2913 % \begin{macro}{\labelenumii}
2914 % \begin{macro}{\labelenumiii}
2915 % \begin{macro}{\labelenumiv}
2916 %    The label for each item is generated by the commands\\
2917 %    |\labelenumi| \ldots\ |\labelenumiv|.
2918 %    \begin{macrocode}
2919 \newcommand\labelenumi{\theenumi.}
2920 \newcommand\labelenumii{(\theenumii)}
2921 \newcommand\labelenumiii{\theenumiii.}
2922 \newcommand\labelenumiv{\theenumiv.}
2923 %    \end{macrocode}
2924 % \end{macro}
2925 % \end{macro}
2926 % \end{macro}
2927 % \end{macro}
2929 % \begin{macro}{\p@enumii}
2930 % \begin{macro}{\p@enumiii}
2931 % \begin{macro}{\p@enumiv}
2932 %    The expansion of |\p@enumN||\theenumN| defines the output of a
2933 %    |\ref| command when referencing an item of the Nth level of an
2934 %    enumerated list.
2935 %    \begin{macrocode}
2936 \renewcommand\p@enumii{\theenumi}
2937 \renewcommand\p@enumiii{\theenumi(\theenumii)}
2938 \renewcommand\p@enumiv{\p@enumiii\theenumiii}
2939 %    \end{macrocode}
2940 % \end{macro}
2941 % \end{macro}
2942 % \end{macro}
2944 % \subsubsection{Itemize}
2946 % \begin{macro}{\labelitemi}
2947 % \begin{macro}{\labelitemii}
2948 % \changes{v1.2k}{1994/05/06}{Inserted \cs{normalfont}}
2949 % \changes{v1.3s}{1996/08/24}{Replaced -{}- with \cs{textendash}}
2950 % \changes{v1.3u}{1996/10/31}{Changed to \cs{textbullet},
2951 %                 \cs{textasteriskcentered} and \cs{textperiodcentered}}
2952 % \begin{macro}{\labelitemiii}
2953 % \begin{macro}{\labelitemiv}
2954 %    Itemization is controlled by four commands: |\labelitemi|,
2955 %    |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define
2956 %    the labels of thevarious itemization levels: the symbols used are
2957 %    bullet, bold en-dash, centered asterisk and centred dot.
2959 %    \begin{macrocode}
2960 \newcommand\labelitemi{\textbullet}
2961 \newcommand\labelitemii{\normalfont\bfseries \textendash}
2962 \newcommand\labelitemiii{\textasteriskcentered}
2963 \newcommand\labelitemiv{\textperiodcentered}
2964 %    \end{macrocode}
2965 % \end{macro}
2966 % \end{macro}
2967 % \end{macro}
2968 % \end{macro}
2970 % \subsubsection{Description}
2972 % \begin{environment}{description}
2973 %    The description environment is defined here -- while the itemize
2974 %    and enumerate environments are defined in \file{latex.dtx}.
2976 %    \begin{macrocode}
2977 \newenvironment{description}
2978                {\list{}{\labelwidth\z@ \itemindent-\leftmargin
2979                         \let\makelabel\descriptionlabel}}
2980                {\endlist}
2981 %    \end{macrocode}
2982 % \end{environment}
2984 % \begin{macro}{\descriptionlabel}
2985 %    To change the formatting of the label, you must redefine
2986 %    |\descriptionlabel|.
2988 % \changes{v1.2k}{1994/05/06}{Inserted \cs{normalfont}}
2989 % \changes{v1.2y}{1995/01/31}{made command short}
2990 %    \begin{macrocode}
2991 \newcommand*\descriptionlabel[1]{\hspace\labelsep
2992                                 \normalfont\bfseries #1}
2993 %    \end{macrocode}
2994 % \end{macro}
2996 % \subsection{Defining new environments}
2998 % \subsubsection{Abstract}
3000 % \begin{environment}{abstract}
3001 %    When we are producing a separate titlepage we also put the
3002 %    abstract on a page of its own. It will be centred vertically on
3003 %    the page.
3005 %    Note that this environment is not defined for books.
3006 % \changes{v1.3e}{1995/06/19}{Added setting of \cs{@endparpenalty}
3007 %         to avoid page break after abstract heading.}
3008 %    \begin{macrocode}
3009 % \changes{v1.3m}{1995/10/23}{Added setting of \cs{beginparpenalty} to
3010 %    discourage page break before abstract heading.}
3011 %<*article|report>
3012 \if@titlepage
3013   \newenvironment{abstract}{%
3014       \titlepage
3015       \null\vfil
3016       \@beginparpenalty\@lowpenalty
3017       \begin{center}%
3018         \bfseries \abstractname
3019         \@endparpenalty\@M
3020       \end{center}}%
3021      {\par\vfil\null\endtitlepage}
3022 %    \end{macrocode}
3023 %    When we are not making a separate titlepage --the default for the
3024 %    article document class-- we have to check if we are in twocolumn
3025 %    mode. In that case the abstract is as a |\section*|, otherwise
3026 %    the quotation environment is used to typeset the abstract.
3027 %    \begin{macrocode}
3028 \else
3029   \newenvironment{abstract}{%
3030       \if@twocolumn
3031         \section*{\abstractname}%
3032       \else
3033         \small
3034         \begin{center}%
3035           {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
3036         \end{center}%
3037         \quotation
3038       \fi}
3039       {\if@twocolumn\else\endquotation\fi}
3041 %</article|report>
3042 %    \end{macrocode}
3043 % \end{environment}
3045 % \subsubsection{Verse}
3047 % \begin{environment}{verse}
3048 %   The verse environment is defined by making clever use of the
3049 %   list environment's parameters.  The user types |\\| to end a line.
3050 %   This is implemented by |\let|'ing |\\| equal |\@centercr|.
3052 % \changes{v1.3j}{1995/08/16}{stop \cs{item} scanning for [ with
3053 %    \cs{relax}}
3054 %    \begin{macrocode}
3055 \newenvironment{verse}
3056                {\let\\\@centercr
3057                 \list{}{\itemsep      \z@
3058                         \itemindent   -1.5em%
3059                         \listparindent\itemindent
3060                         \rightmargin  \leftmargin
3061                         \advance\leftmargin 1.5em}%
3062                 \item\relax}
3063                {\endlist}
3064 %    \end{macrocode}
3065 % \end{environment}
3067 % \subsubsection{Quotation}
3069 % \begin{environment}{quotation}
3070 %   The quotation environment is also defined by making clever use of
3071 %   the list environment's parameters. The lines in the environment
3072 %   are set smaller than |\textwidth|. The first line of a paragraph
3073 %   inside this environment is indented.
3075 % \changes{v1.3j}{1995/08/16}{stop \cs{item} scanning for [ with
3076 %    \cs{relax}}
3077 %    \begin{macrocode}
3078 \newenvironment{quotation}
3079                {\list{}{\listparindent 1.5em%
3080                         \itemindent    \listparindent
3081                         \rightmargin   \leftmargin
3082                         \parsep        \z@ \@plus\p@}%
3083                 \item\relax}
3084                {\endlist}
3085 %    \end{macrocode}
3086 % \end{environment}
3088 % \subsubsection{Quote}
3090 % \begin{environment}{quote}
3091 %   The quote environment is like the quotation environment except
3092 %   that paragraphs are not indented.
3094 % \changes{v1.3j}{1995/08/16}{stop \cs{item} scanning for [ with
3095 %    \cs{relax}}
3096 %    \begin{macrocode}
3097 \newenvironment{quote}
3098                {\list{}{\rightmargin\leftmargin}%
3099                 \item\relax}
3100                {\endlist}
3101 %    \end{macrocode}
3102 % \end{environment}
3104 % \subsubsection{Theorem}
3106 %    This document class does not define it's own theorem environments,
3107 %    the defaults, supplied by \file{latex.dtx} are available.
3109 % \subsubsection{Titlepage}
3111 % \begin{environment}{titlepage}
3112 %  In the normal environments, the titlepage environment does nothing
3113 %  but start and end a page, and inhibit page numbers.  In the report
3114 %  style, it also resets the page number to one, and then sets it
3115 %  back to one at the end.  In compatibility mode, it sets the
3116 %  page number to zero. This is incorrect since it results in using
3117 %  the page parameters for a right-hand page but it is the way it was.
3118 %  In two-column style, it still makes a 
3119 %  one-column page.
3121 % \changes{v1.0g}{1993/12/09}{Moved the setting of
3122 %    \cs{@restonecolfalse}}
3123 % \changes{v1.2c}{1994/03/17}{page :!= 0 only in compatibility mode
3124 %    (LL)}
3125 % \changes{v1.2d}{1994/04/11}{Moved \cs{cleardoublepage} inside
3126 %    definition of titlepage environment}
3127 % \changes{v1.3i}{1995/08/08}{New implementation with support for
3128 %      twoside and openright option}
3130 %    First we do give the definition for compatibility mode.
3131 %    \begin{macrocode}
3132 \if@compatibility
3133 \newenvironment{titlepage}
3134     {%
3135 %<book>      \cleardoublepage
3136       \if@twocolumn
3137         \@restonecoltrue\onecolumn
3138       \else
3139         \@restonecolfalse\newpage
3140       \fi
3141       \thispagestyle{empty}%
3142       \setcounter{page}\z@
3143     }%
3144     {\if@restonecol\twocolumn \else \newpage \fi
3145     }
3146 %    \end{macrocode}
3148 %    And here is the one for native \LaTeXe{}.
3149 %    \begin{macrocode}
3150 \else
3151 \newenvironment{titlepage}
3152     {%
3153 %<book>      \cleardoublepage
3154       \if@twocolumn
3155         \@restonecoltrue\onecolumn
3156       \else
3157         \@restonecolfalse\newpage
3158       \fi
3159       \thispagestyle{empty}%
3160       \setcounter{page}\@ne
3161     }%
3162     {\if@restonecol\twocolumn \else \newpage \fi
3163 %    \end{macrocode}
3164 %    If we are not in two-side mode the first page after the title page
3165 %    should also get page number 1.
3166 %    \begin{macrocode}
3167      \if@twoside\else
3168         \setcounter{page}\@ne
3169      \fi
3170     }
3172 %    \end{macrocode}
3173 % \end{environment}
3175 % \subsubsection{Appendix}
3177 % \begin{macro}{\appendix}
3179 %    The |\appendix| command is not really an environment, it is a
3180 %    macro that makes some changes in the way things are done.
3182 %    In the article document class the |\appendix| command must do the
3183 %    following:
3184 %    \begin{itemize}
3185 %    \item reset the section and subsection counters to zero,
3186 %    \item redefine |\thesection| to produce alphabetic appendix
3187 %        numbers. This redefinition is done globally to ensure that it 
3188 %        survives even if |\appendix| is issued within an environment such
3189 %        as \texttt{multicols}.
3190 %    \end{itemize}
3192 % \changes{1.3z}{1998/09/19}{Redefine \cs{thesection} globally (pr/2862)}
3193 %    \begin{macrocode}
3194 %<*article>
3195 \newcommand\appendix{\par
3196   \setcounter{section}{0}%
3197   \setcounter{subsection}{0}%
3198   \gdef\thesection{\@Alph\c@section}}
3199 %</article>
3200 %    \end{macrocode}
3202 %    In the report and book document classes the |\appendix| command
3203 %    must do the following:
3204 %    \begin{itemize}
3205 %    \item reset the chapter and section counters to zero,
3206 %    \item set |\@chapapp| to |\appendixname| (for messages),
3207 %    \item redefine the chapter counter to produce appendix numbers,
3208 %    \item possibly redefine the |\chapter| command if appendix titles
3209 %        and headings are to look different from chapter titles and
3210 %        headings. This redefinition is done globally to ensure that it 
3211 %        survives even if |\appendix| is issued within an environment such
3212 %        as \texttt{multicols}.
3213 %    \end{itemize}
3215 % \changes{1.3z}{1998/09/19}{Redefine \cs{thechapter} and
3216 %                            \cs{@chapapp} globally (pr/2862)}
3217 %    \begin{macrocode}
3218 %<*report|book>
3219 \newcommand\appendix{\par
3220   \setcounter{chapter}{0}%
3221   \setcounter{section}{0}%
3222   \gdef\@chapapp{\appendixname}%
3223   \gdef\thechapter{\@Alph\c@chapter}}
3224 %</report|book>
3225 %    \end{macrocode}
3226 % \end{macro}
3228 % \subsection{Setting parameters for existing environments}
3230 % \subsubsection{Array and tabular}
3232 % \begin{macro}{\arraycolsep}
3233 %    The columns in an array environment are separated by
3234 %    2|\arraycolsep|.
3235 %    \begin{macrocode}
3236 \setlength\arraycolsep{5\p@}
3237 %    \end{macrocode}
3238 % \end{macro}
3240 % \begin{macro}{\tabcolsep}
3241 %    The columns in an tabular environment are separated by
3242 %    2|\tabcolsep|.
3243 %    \begin{macrocode}
3244 \setlength\tabcolsep{6\p@}
3245 %    \end{macrocode}
3246 % \end{macro}
3248 % \begin{macro}{\arrayrulewidth}
3249 %    The width of rules in the array and tabular environments is given
3250 %    by\\ |\arrayrulewidth|.
3251 %    \begin{macrocode}
3252 \setlength\arrayrulewidth{.4\p@}
3253 %    \end{macrocode}
3254 % \end{macro}
3256 % \begin{macro}{\doublerulesep}
3257 %    The space between adjacent rules in the array and tabular
3258 %    environments is given by |\doublerulesep|.
3259 %    \begin{macrocode}
3260 \setlength\doublerulesep{2\p@}
3261 %    \end{macrocode}
3262 % \end{macro}
3264 % \subsubsection{Tabbing}
3266 % \begin{macro}{\tabbingsep}
3267 %    This controls the space that the |\'| command puts in. (See
3268 %    \LaTeX{} manual for an explanation.)
3269 %    \begin{macrocode}
3270 \setlength\tabbingsep{\labelsep}
3271 %    \end{macrocode}
3272 % \end{macro}
3274 % \subsubsection{Minipage}
3276 % \begin{macro}{\@minipagerestore}
3277 %    The macro |\@minipagerestore| is called upon entry to a minipage
3278 %    environment to set up things that are to be handled differently
3279 %    inside a minipage environment. In the current styles, it does
3280 %    nothing.
3281 % \end{macro}
3283 % \begin{macro}{\@mpfootins}
3284 %    Minipages have their own footnotes; |\skip||\@mpfootins| plays
3285 %    same r\^ole for footnotes in a minipage as |\skip||\footins| does
3286 %    for ordinary footnotes.
3288 %    \begin{macrocode}
3289 \skip\@mpfootins = \skip\footins
3290 %    \end{macrocode}
3291 % \end{macro}
3293 % \subsubsection{Framed boxes}
3295 % \begin{macro}{\fboxsep}
3296 %    The space left by |\fbox| and |\framebox| between the box and the
3297 %    text in it.
3298 % \begin{macro}{\fboxrule}
3299 %    The width of the rules in the box made by |\fbox| and |\framebox|.
3300 %    \begin{macrocode}
3301 \setlength\fboxsep{3\p@}
3302 \setlength\fboxrule{.4\p@}
3303 %    \end{macrocode}
3304 % \end{macro}
3305 % \end{macro}
3307 % \subsubsection{Equation and eqnarray}
3309 % \begin{macro}{\theequation}
3310 %    When within chapters, the equation counter will be reset at
3311 %    the beginning of a new chapter and the equation number will
3312 %    be prefixed by the chapter number.
3313 % \changes{v1.3u}{1996/10/31}{Added test for non-zero chapter number}
3315 %    This code  must follow the |\chapter| definition or, more exactly,
3316 %    the definition of the chapter counter.
3317 %    \begin{macrocode}
3318 %<article>\renewcommand \theequation {\@arabic\c@equation}
3319 %<*report|book>
3320 \@addtoreset {equation}{chapter}
3321 \renewcommand\theequation
3322   {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}
3323 %</report|book>
3324 %    \end{macrocode}
3325 % \end{macro}
3327 % \begin{macro}{\jot}
3328 %    |\jot| is the extra space added between lines of an eqnarray
3329 %    environment. The default value is used.
3330 %    \begin{macrocode}
3331 % \setlength\jot{3pt}
3332 %    \end{macrocode}
3333 % \end{macro}
3335 % \begin{macro}{\@eqnnum}
3336 %    The macro |\@eqnnum| defines how equation numbers are to appear in
3337 %    equations. Again the default is used.
3339 %    \begin{macrocode}
3340 % \def\@eqnnum{(\theequation)}
3341 %    \end{macrocode}
3342 % \end{macro}
3344 % \subsection{Floating objects}
3346 %    The file \file{latex.dtx} only defines a number of tools with
3347 %    which floating objects can be defined. This is done in the
3348 %    document class. It needs to define the following macros for each
3349 %    floating object of type \texttt{TYPE} (e.g., \texttt{TYPE} =
3350 %    figure).
3352 %    \begin{description}
3353 %    \item[\texttt{\bslash fps@TYPE}]
3354 %        The default placement specifier for floats of type
3355 %        \texttt{TYPE}.
3357 %    \item[\texttt{\bslash ftype@TYPE}]
3358 %        The type number for floats of type \texttt{TYPE}.  Each
3359 %        \texttt{TYPE} has associated a unique positive \texttt
3360 %        {TYPE} number, which is a power of two.  E.g., figures might
3361 %        have type number 1, tables type number 2, programs type
3362 %        number 4, etc.
3364 %    \item[\texttt{\bslash ext@TYPE}]
3365 %        The file extension indicating the file on which the contents
3366 %        list for float type \texttt{TYPE} is stored.  For example,
3367 %        |\ext@figure| = `lof'.
3369 %    \item[\texttt{\bslash fnum@TYPE}]
3370 %        A macro to generate the figure number for a caption. For
3371 %        example, |\fnum@TYPE| == `Figure |\thefigure|'.
3373 %    \item[\texttt{\bslash @makecaption}{\meta{num}}{\meta{text}}]
3374 %        A macro to make a caption, with \meta{num} the value produced
3375 %        by |\fnum@...| and \meta{text} the text of the caption. It
3376 %        can assume it's in a |\parbox| of the appropriate width.
3377 %        This will be used for \emph{all} floating objects.
3379 %    \end{description}
3381 %    The actual environment that implements a floating object such as
3382 %    a figure is defined using the macros |\@float| and |\end@float|,
3383 %    which are defined in \file{latex.dtx}.
3385 %    An environment that implements a single column floating object is
3386 %    started with |\@float{|\texttt{TYPE}|}[|\meta{placement}|]| of type
3387 %    \texttt{TYPE} with \meta{placement} as the placement specifier.
3388 %    The default value of \meta{PLACEMENT} is defined by |\fps@TYPE|.
3390 %    The environment is ended by |\end@float|.  E.g., |\figure| ==
3391 %    |\@float|{figure}, |\endfigure| == |\end@float|.
3393 % \subsubsection{Figure}
3395 %    Here is the implementation of the figure environment.
3397 % \begin{macro}{\c@figure}
3398 %    First we have to allocate a counter to number the figures.
3400 %    In the report and book document classes figures within chapters are
3401 %    numbered per chapter.
3402 % \changes{v1.3u}{1996/10/31}{Added test for non-zero chapter number}
3403 %    \begin{macrocode}
3404 %<*article>
3405 \newcounter{figure}
3406 \renewcommand \thefigure {\@arabic\c@figure}
3407 %</article>
3408 %<*report|book>
3409 \newcounter{figure}[chapter]
3410 \renewcommand \thefigure
3411      {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
3412 %</report|book>
3413 %    \end{macrocode}
3414 % \end{macro}
3416 % \begin{macro}{\fps@figure}
3417 % \begin{macro}{\ftype@figure}
3418 % \begin{macro}{\ext@figure}
3419 % \begin{macro}{\num@figure}
3420 %    Here are the parameters for the floating objects of type `figure'.
3421 % \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace}
3422 %                             (pr/3310)}
3423 %    \begin{macrocode}
3424 \def\fps@figure{tbp}
3425 \def\ftype@figure{1}
3426 \def\ext@figure{lof}
3427 \def\fnum@figure{\figurename\nobreakspace\thefigure}
3428 %    \end{macrocode}
3429 % \end{macro}
3430 % \end{macro}
3431 % \end{macro}
3432 % \end{macro}
3434 % \begin{environment}{figure}
3435 % \begin{environment}{figure*}
3436 %    And the definition of the actual environment. The form with the
3437 %    |*| is used for double column figures.
3438 %    \begin{macrocode}
3439 \newenvironment{figure}
3440                {\@float{figure}}
3441                {\end@float}
3442 \newenvironment{figure*}
3443                {\@dblfloat{figure}}
3444                {\end@dblfloat}
3445 %    \end{macrocode}
3446 % \end{environment}
3447 % \end{environment}
3449 % \subsubsection{Table}
3451 %    Here is the implementation of the table environment. It is very
3452 %    much the same as the figure environment.
3454 % \begin{macro}{\c@table}
3455 %    First we have to allocate a counter to number the tables.
3456 %    
3457 %    In the report and book document classes tables within chapters are
3458 %    numbered per chapter.
3459 % \changes{v1.3u}{1996/10/31}{Added test for non-zero chapter number}
3460 %    \begin{macrocode}
3461 %<*article>
3462 \newcounter{table}
3463 \renewcommand\thetable{\@arabic\c@table}
3464 %</article>
3465 %<*report|book>
3466 \newcounter{table}[chapter]
3467 \renewcommand \thetable
3468      {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
3469 %</report|book>
3470 %    \end{macrocode}
3471 % \end{macro}
3473 % \begin{macro}{\fps@table}
3474 % \begin{macro}{\ftype@table}
3475 % \begin{macro}{\ext@table}
3476 % \begin{macro}{\num@table}
3477 %    Here are the parameters for the floating objects of type `table'.
3478 % \changes{v1.4e}{2001/05/24}{Replaced tilde with \cs{nobreakspace}
3479 %                             (pr/3310)}
3480 %    \begin{macrocode}
3481 \def\fps@table{tbp}
3482 \def\ftype@table{2}
3483 \def\ext@table{lot}
3484 \def\fnum@table{\tablename\nobreakspace\thetable}
3485 %    \end{macrocode}
3486 % \end{macro}
3487 % \end{macro}
3488 % \end{macro}
3489 % \end{macro}
3491 % \begin{environment}{table}
3492 % \begin{environment}{table*}
3493 %    And the definition of the actual environment. The form with the
3494 %    |*| is used for double column tables.
3495 %    \begin{macrocode}
3496 \newenvironment{table}
3497                {\@float{table}}
3498                {\end@float}
3499 \newenvironment{table*}
3500                {\@dblfloat{table}}
3501                {\end@dblfloat}
3502 %    \end{macrocode}
3503 % \end{environment}
3504 % \end{environment}
3506 % \subsubsection{Captions}
3508 % \begin{macro}{\@makecaption}
3509 %    The |\caption| command calls |\@makecaption| to format the
3510 %    caption of floating objects. It gets two arguments,
3511 %    \meta{number}, the number of the floating object and \meta{text},
3512 %    the text of the caption. Usually \meta{number} contains a string
3513 %    such as `Figure 3.2'. The macro can assume it is called inside a
3514 %    |\parbox| of right width, with |\normalsize|.
3516 % \begin{macro}{\abovecaptionskip}
3517 % \begin{macro}{\belowcaptionskip}
3518 %    These lengths contain the amount of white space to leave above
3519 %    and below the caption.
3520 %    \begin{macrocode}
3521 \newlength\abovecaptionskip
3522 \newlength\belowcaptionskip
3523 \setlength\abovecaptionskip{10\p@}
3524 \setlength\belowcaptionskip{0\p@}
3525 %    \end{macrocode}
3526 % \end{macro}
3527 % \end{macro}
3529 %    The definition of this macro is |\long| in order to allow more
3530 %    then one paragraph in a caption.
3531 %    \begin{macrocode}
3532 \long\def\@makecaption#1#2{%
3533   \vskip\abovecaptionskip
3534 %    \end{macrocode}
3535 %    We want to see if the caption fits on one line on the page,
3536 %    therefore we first typeset it in a temporary box.
3537 % \changes{v1.2q}{1994/05/29}{Use \cs{sbox}\cs{@tempboxa} instead of
3538 %    \cs{setbox}\cs{@tempboxa}\cs{hbox} to make this colour safe}
3539 %    \begin{macrocode}
3540   \sbox\@tempboxa{#1: #2}%
3541 %    \end{macrocode}
3542 %    We can the measure its width. It that is larger than the current
3543 %    |\hsize| we typeset the caption as an ordinary paragraph.
3544 %    \begin{macrocode}
3545   \ifdim \wd\@tempboxa >\hsize
3546     #1: #2\par
3547 %    \end{macrocode}
3548 %    If the caption fits, we center it. Because this uses an |\hbox|
3549 %    directly in vertical mode, it does not execute the |\everypar|
3550 %    tokens; the only thing that could be needed here is resetting the
3551 %    `minipage flag' so we do this explicitly.
3552 % \changes{v1.2x}{1994/12/09}{Due to a change in the way floats are
3553 %    handled we need to set the \cs{if@minipage} switch to false}
3554 %    \begin{macrocode}
3555   \else
3556     \global \@minipagefalse
3557     \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
3558   \fi
3559   \vskip\belowcaptionskip}
3560 %    \end{macrocode}
3561 % \end{macro}
3563 % \subsection{Font changing}
3565 %    Here we supply the declarative font changing commands that were
3566 %    common in \LaTeX\ version 2.09 and earlier. These commands work
3567 %    in text mode \emph{and} in math mode. They are provided for
3568 %    compatibility, but one should start using the |\text...| and
3569 %    |\math...| commands instead. These commands are defined using
3570 %    |\DeclareTextFontCommand|, a command with three arguments: the
3571 %    user command to be defined; \LaTeX\ commands to execute in text
3572 %    mode and \LaTeX\ commands to execute in math mode.
3574 % \changes{v1.0g}{1993/12/12}{Distinguished between compatibility and
3575 %    `normal' mode for the font changing commands.}
3576 % \changes{v1.0h}{1993/12/18}{These are now defined in the kernel, so
3577 %    use \cs{@renewfontswitch}.  Compatibility mode defines
3578 %    \cs{@renewfontswitch} to do nothing, so we don't need to check
3579 %    for compatibility mode any more.}
3580 % \changes{v1.0j}{1993/12/20}{Added \cs{normalfont} back in the
3581 %    definitions of \cs{rm} etc. as this should be the default
3582 %    behaviour}
3583 % \changes{v1.2e}{1994/04/14}{\cs{@renewfontswitch} has become
3584 %    \cs{DeclareOldFontCommand}}
3586 %  \begin{macro}{\rm}
3587 % \changes{v1.0f}{1993/12/08}{Macro added}
3588 %  \begin{macro}{\tt}
3589 % \changes{v1.0f}{1993/12/08}{Macro added}
3590 %  \begin{macro}{\sf}
3591 % \changes{v1.0f}{1993/12/08}{Macro added}
3593 %    The commands to change the family. When in compatibility mode we
3594 %    select the `default' font first, to get \LaTeX2.09 behviour.
3595 %    \begin{macrocode}
3596 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
3597 \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
3598 \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
3599 %    \end{macrocode}
3600 %  \end{macro}
3601 %  \end{macro}
3602 %  \end{macro}
3604 %  \begin{macro}{\bf}
3605 % \changes{v1.0f}{1993/12/08}{Macro added}
3606 %    The command to change to the bold series. One should use
3607 %    |\mdseries| to explicitly switch back to medium series.
3608 %    \begin{macrocode}
3609 \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
3610 %    \end{macrocode}
3611 %  \end{macro}
3613 %  \begin{macro}{\sl}
3614 % \changes{v1.0f}{1993/12/08}{Macro added}
3615 % \changes{v1.2g}{1994/04/24}{Added warning if used in math mode}
3616 %  \begin{macro}{\it}
3617 % \changes{v1.0f}{1993/12/08}{Macro added}
3618 %  \begin{macro}{\sc}
3619 % \changes{v1.0f}{1993/12/08}{Macro added}
3620 % \changes{v1.2g}{1994/04/24}{Added warning if used in math mode}
3622 %    And the commands to change the shape of the font. The slanted and
3623 %    small caps shapes are not available by default as math alphabets,
3624 %    so those changes do nothing in math mode. However, we do warn the
3625 %    user that the selection will not have any effect.One should use
3626 %    |\upshape| to explicitly change back to the upright shape.
3627 %    \begin{macrocode}
3628 \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
3629 \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
3630 \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
3631 %    \end{macrocode}
3632 %  \end{macro}
3633 %  \end{macro}
3634 %  \end{macro}
3636 % \begin{macro}{\cal}
3637 % \changes{v1.0g}{1993/12/12}{Macro added}
3638 % \begin{macro}{\mit}
3639 % \changes{v1.0g}{1993/12/12}{Macro added}
3641 %    The commands |\cal| and |\mit| should only be used in math mode,
3642 %    outside math mode they have no effect. Currently the New Font
3643 %    Selection Scheme defines these commands to generate warning
3644 %    messages. Therefore we have to define them `by hand'.
3645 % \changes{v1.2w}{1994/12/01}{Now define \cs{cal} and \cs{mit} using
3646 %    \cs{DeclareRobustCommand*}}
3647 % \changes{v1.3j}{1995/08/16}{Remove surplus braces}
3648 %    \begin{macrocode}
3649 \DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
3650 \DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
3651 %    \end{macrocode}
3652 %  \end{macro}
3653 %  \end{macro}
3655 % \section{Cross Referencing}
3656 % \subsection{Table of Contents, etc.}
3658 %     A |\section| command writes a
3659 %     |\contentsline{section}{|\meta{title}|}{|\meta{page}|}| command
3660 %     on the \file{.toc} file, where \meta{title} contains the
3661 %     contents of the entry and \meta{page} is the page number. If
3662 %     sections are being numbered, then \meta{title} will be of the
3663 %     form |\numberline{|\meta{num}|}{|\meta{heading}|}| where
3664 %     \meta{num} is the number produced by |\thesection|.  Other
3665 %     sectioning commands work similarly.
3667 %     A |\caption| command in a `figure' environment writes
3669 %     |\contentsline{figure}{\numberline{|\meta{num}|}{|%
3670 %                    \meta{caption}|}}{|\meta{page}|}|
3672 %     on the .\file{lof} file, where \meta{num} is the number produced
3673 %     by |\thefigure| and \meta{caption} is the figure caption.  It
3674 %     works similarly for a `table' environment.
3676 %    The command |\contentsline{|\meta{name}|}| expands to
3677 %    |\l@|\meta{name}.  So, to specify the table of contents, we must
3678 %    define |\l@chapter|, |\l@section|, |\l@subsection|, ... ; to
3679 %    specify the list of figures, we must define |\l@figure|; and so
3680 %    on.  Most of these can be defined with the |\@dottedtocline|
3681 %    command, which works as follows.
3683 %    |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|^^A
3684 %                      \meta{numwidth}|}{|^^A
3685 %                      \meta{title}|}{|\meta{page}|}|
3687 %    \begin{description}
3688 %    \item[\meta{level}] An entry is produced only if\meta{ level}
3689 %        $<=$ value of the \Lcount{tocdepth} counter.  Note,
3690 %        |\chapter| is level 0, |\section| is level 1, etc.
3691 %    \item[\meta{indent}] The indentation from the outer left margin
3692 %        of the start   of the contents line.
3693 %    \item[\meta{numwidth}] The width of a box in which the section
3694 %        number is to go, if \meta{title} includes a |\numberline|
3695 %        command.
3696 %    \end{description}
3698 % \begin{macro}{\@pnumwidth}
3699 % \begin{macro}{\@tocrmarg}
3700 % \begin{macro}{\@dotsep}
3701 %    This command uses the following three parameters, which are set
3702 %    with a |\newcommand| (so em's can be used to make them depend upon
3703 %    the font).
3704 %    \begin{description}
3705 %    \item[\texttt{\bslash @pnumwidth}] The width of a box in which the
3706 %        page number is put.
3707 % \changes{v1.2v}{1994/10/29}{Changed documentation from $!>$ or $!=$ to
3708 %    $\ge$}
3709 %    \item[\texttt{\bslash @tocrmarg}] The right margin for multiple
3710 %        line entries.  One wants |\@tocrmarg| $\ge$ |\@pnumwidth|
3711 %    \item[\texttt{\bslash @dotsep}] Separation between dots, in mu
3712 %        units. Should be defined as a number like 2 or 1.7
3713 %    \end{description}
3715 %    \begin{macrocode}
3716 \newcommand\@pnumwidth{1.55em}
3717 \newcommand\@tocrmarg{2.55em}
3718 \newcommand\@dotsep{4.5}
3719 %<article>\setcounter{tocdepth}{3}
3720 %<!article>\setcounter{tocdepth}{2}
3721 %    \end{macrocode}
3722 % \end{macro}
3723 % \end{macro}
3724 % \end{macro}
3726 % \subsubsection{Table of Contents}
3728 % \begin{macro}{\tableofcontents}
3729 %    This macro is used to request that \LaTeX{} produces a table of
3730 %    contents. In the report and book document classes the tables of
3731 %    contents, figures etc. are always set in single-column style.
3733 % \changes{v1.0g}{1993/12/09}{Moved the setting of
3734 %    \cs{@restonecolfalse}}
3735 % \changes{v1.4h}{2007/10/19}{Explain why \cs{@mkboth} is insde the heading 
3736 %                         arg for \cs{tableofcontents} (pr/3285 and pr/3984)}
3737 %    \begin{macrocode}
3738 \newcommand\tableofcontents{%
3739 %<*report|book>
3740     \if@twocolumn
3741       \@restonecoltrue\onecolumn
3742     \else
3743       \@restonecolfalse
3744     \fi
3745 %    \end{macrocode}
3746 %    The title is set using the |\chapter*| command, making sure that
3747 %    the running head --if one is required-- contains the right
3748 %    information.
3749 %    \begin{macrocode}
3750     \chapter*{\contentsname
3751 %</report|book>
3752 %<article>    \section*{\contentsname
3753 %    \end{macrocode}
3754 %    The code for |\@mkboth| is placed inside the heading to avoid any
3755 %    influence on vertical spacing after the heading (in some cases). For
3756 %    other commands, such as |\listoffigures| below this has been changed from
3757 %    the \LaTeX{}2.09 version as it will produce a serious bug if used in
3758 %    two-column mode (see, pr/3285). However |\tableofcontents| is always
3759 %    typeset in one-column mode in these classes, therefore the somewhat
3760 %    inconsistent setting has been retained for compatibility reasons.
3761 %    \begin{macrocode}
3762         \@mkboth{%
3763            \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
3764 %    \end{macrocode}
3765 %    The the actual table of contents is made by calling
3766 %    |\@starttoc{toc}|. After that we restore twocolumn mode if
3767 %    necessary.
3768 %    \begin{macrocode}
3769     \@starttoc{toc}%
3770 %<!article>    \if@restonecol\twocolumn\fi
3771     }
3772 %    \end{macrocode}
3773 % \end{macro}
3775 % \begin{macro}{\l@part}
3776 %    Each sectioning command needs an additional macro  to format its
3777 %    entry in the table of contents, as described above. The macro for
3778 %    the entry for parts is defined in a special way.
3780 %    First we make sure that if a pagebreak should occur, it occurs
3781 %    \emph{before} this entry. Also a little whitespace is added and a
3782 %    group begun to keep changes local.
3783 % \changes{v1.0h}{1993/12/18}{Replaced -\cs{@secpenalty} by
3784 %    \cs{@secpenalty}.  ASAJ.}
3785 % \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth
3786 %    counter is less then -1}
3787 % \changes{v1.3b}{1995/05/23}{Added missing braces around argument
3788 %           to \cs{addpenalty}.}
3789 % \changes{v1.3x}{1997/10/10}{Removed setting of \cs{@tempdima} as
3790 %    this macro does not use \cs{numberline} to set the toc line.}
3791 % \changes{v1.4a}{1998/10/12}{we should use \cs{@tocrmarg}; see PR/2881.}
3792 %    \begin{macrocode}
3793 \newcommand*\l@part[2]{%
3794   \ifnum \c@tocdepth >-2\relax
3795 %<article>    \addpenalty\@secpenalty
3796 %<!article>    \addpenalty{-\@highpenalty}%
3797     \addvspace{2.25em \@plus\p@}%
3798 %    \end{macrocode}
3799 %    The macro |\numberline| requires that the width of the box that
3800 %    holds the part number is stored in \LaTeX's scratch register
3801 %    |\@tempdima|. Therefore we initialize it there even though we do
3802 %    not use |\numberline| internally---the value used is quite large
3803 %    so that something like |\numberline{VIII}| would still work.    
3804 % \changes{v1.4d}{2001/04/21}{Initialize \cs{@tempdima} to some
3805 %    sensible value (pr/3327)}
3806 %    \begin{macrocode}
3807     \setlength\@tempdima{3em}%
3808     \begingroup
3809 %    \end{macrocode}
3810 %    We set |\parindent| to 0pt and use |\rightskip| to leave
3811 %    enough room for the pagenumbers.\footnote{^^A
3812 %        We should really set \cs{rightskip} to \cs{@tocrmarg} instead 
3813 %        of \cs{@pnumwidth} (no version of {\LaTeX} ever did this), 
3814 %        otherwise the \cs{rightskip} is too small.
3815 %        Unfortunately this can't be changed in {\LaTeXe} as we don't 
3816 %        want to create different versions of {\LaTeXe} which produce 
3817 %        different typset output unless this is absolutely necessary;
3818 %        instead we suspend it for \LaTeX3.}
3819 %    To prevent overfull box messages the |\parfillskip| is set to a 
3820 %    negative value.
3821 %    \begin{macrocode}
3822       \parindent \z@ \rightskip \@pnumwidth
3823       \parfillskip -\@pnumwidth
3824 %    \end{macrocode}
3825 %    Now we can set the entry, in a large bold font. We make sure to
3826 %    leave vertical mode, set the part title and add the pagenumber,
3827 %    set flush right.
3828 %    \begin{macrocode}
3829       {\leavevmode
3830        \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
3831 %    \end{macrocode}
3832 %    Prevent a pagebreak immediately after this entry, but use
3833 %    |\everypar| to reset the |\if@nobreak| switch. Finally we close
3834 %    the group.
3835 % \changes{v1.3j}{1995/08/16}{Add missing percent}
3836 %    \begin{macrocode}
3837        \nobreak
3838 %<article>       \if@compatibility
3839          \global\@nobreaktrue
3840          \everypar{\global\@nobreakfalse\everypar{}}%
3841 %<article>      \fi
3842     \endgroup
3843   \fi}
3844 %    \end{macrocode}
3845 % \end{macro}
3847 % \begin{macro}{\l@chapter}
3848 %    This macro formats the entries in the table of contents for
3849 %    chapters. It is very similar to |\l@part|
3851 %    First we make sure that if a pagebreak should occur, it occurs
3852 %    \emph{before} this entry. Also a little whitespace is added and a
3853 %    group begun to keep changes local.
3854 % \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth
3855 %    counter is less than 0}
3856 % \changes{v1.3b}{1995/05/23}{Added missing braces around argument
3857 %           to \cs{addpenalty}.}
3858 % \changes{v1.4a}{1998/10/12}{we should use \cs{@tocrmarg}; see PR/2881.}
3859 %    \begin{macrocode}
3860 %<*report|book>
3861 \newcommand*\l@chapter[2]{%
3862   \ifnum \c@tocdepth >\m@ne
3863     \addpenalty{-\@highpenalty}%
3864     \vskip 1.0em \@plus\p@
3865 %    \end{macrocode}
3867 %    The macro |\numberline| requires that the width of the box that
3868 %    holds the part number is stored in \LaTeX's scratch register
3869 %    |\@tempdima|. Therefore we initialize it there even though we do
3870 %    not use |\numberline| internally (the position as well as the
3871 %    values seems questionable but can't be changed without producing
3872 %    compatibility problems). We begin a group, and change
3873 %    some of the paragraph parameters (see also the remark at
3874 %    \cs{l@part} regarding \cs{rightskip}).
3875 %    \begin{macrocode}
3876     \setlength\@tempdima{1.5em}%
3877     \begingroup
3878       \parindent \z@ \rightskip \@pnumwidth
3879       \parfillskip -\@pnumwidth
3880 %    \end{macrocode}
3881 %    Then we leave vertical mode and switch to a bold font.
3882 %    \begin{macrocode}
3883       \leavevmode \bfseries
3884 %    \end{macrocode}
3885 %    Because we do not use |\numberline| here, we have do some fine
3886 %    tuning `by hand', before we can set the entry. We discourage but
3887 %    not disallow a pagebreak immediately after a chapter entry.
3888 %    \begin{macrocode}
3889       \advance\leftskip\@tempdima
3890       \hskip -\leftskip
3891       #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
3892       \penalty\@highpenalty
3893     \endgroup
3894   \fi}
3895 %</report|book>
3896 %    \end{macrocode}
3897 % \end{macro}
3899 % \begin{macro}{\l@section}
3900 %    In the article document class the entry in the table of contents
3901 %    for sections looks much like the chapter entries for the report
3902 %    and book document classes.
3904 %    First we make sure that if a pagebreak should occur, it occurs
3905 %    \emph{before} this entry. Also a little whitespace is added and a
3906 %    group begun to keep changes local.
3907 % \changes{v1.0h}{1993/12/18}{Replaced -\cs{@secpenalty} by
3908 %    \cs{@secpenalty}.  ASAJ.}
3909 % \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth
3910 %    counter is less than 1.}
3911 % \changes{v1.4a}{1998/10/12}{we should use \cs{@tocrmarg}; see PR/2881.}
3912 %    \begin{macrocode}
3913 %<*article>
3914 \newcommand*\l@section[2]{%
3915   \ifnum \c@tocdepth >\z@
3916     \addpenalty\@secpenalty
3917     \addvspace{1.0em \@plus\p@}%
3918 %    \end{macrocode}
3920 %    The macro |\numberline| requires that the width of the box that
3921 %    holds the part number is stored in \LaTeX's scratch register
3922 %    |\@tempdima|. Therefore we put it there. We begin a group, and
3923 %    change some of the paragraph parameters (see also the remark at
3924 %    \cs{l@part} regarding \cs{rightskip}).
3925 %    \begin{macrocode}
3926     \setlength\@tempdima{1.5em}%
3927     \begingroup
3928       \parindent \z@ \rightskip \@pnumwidth
3929       \parfillskip -\@pnumwidth
3930 %    \end{macrocode}
3931 %    Then we leave vertical mode and switch to a bold font.
3932 %    \begin{macrocode}
3933       \leavevmode \bfseries
3934 %    \end{macrocode}
3935 %    Because we do not use |\numberline| here, we have do some fine
3936 %    tuning `by hand', before we can set the entry. We discourage but
3937 %    not disallow a pagebreak immediately after a chapter entry.
3938 %    \begin{macrocode}
3939       \advance\leftskip\@tempdima
3940       \hskip -\leftskip
3941       #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
3942     \endgroup
3943   \fi}
3944 %</article>
3945 %    \end{macrocode}
3946 %    In the report and book document classes the definition for
3947 %    |\l@section| is much simpler.
3948 %    \begin{macrocode}
3949 %<*report|book>
3950 \newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
3951 %</report|book>
3952 %    \end{macrocode}
3953 % \end{macro}
3955 % \begin{macro}{\l@subsection}
3956 % \begin{macro}{\l@subsubsection}
3957 % \begin{macro}{\l@paragraph}
3958 % \begin{macro}{\l@subparagraph}
3959 %    All lower level entries are defined using the macro
3960 %    |\@dottedtocline| (see above).
3961 %    \begin{macrocode}
3962 %<*article>
3963 \newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
3964 \newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
3965 \newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
3966 \newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
3967 %</article>
3968 %<*report|book>
3969 \newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
3970 \newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
3971 \newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
3972 \newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}
3973 %</report|book>
3974 %    \end{macrocode}
3975 % \end{macro}
3976 % \end{macro}
3977 % \end{macro}
3978 % \end{macro}
3980 % \subsubsection{List of figures}
3982 % \begin{macro}{\listoffigures}
3983 %    This macro is used to request that \LaTeX{} produces a list of
3984 %    figures. It is very similar to |\tableofcontents|.
3986 % \changes{v1.0g}{1993/12/09}{Moved the setting of
3987 %    \cs{@restonecolfalse}}
3988 % \changes{v1.4c}{2001/01/06}{Moved \cs{@mkboth} out of heading 
3989 %                             arg (pr/3285)}
3990 %    \begin{macrocode}
3991 \newcommand\listoffigures{%
3992 %<*report|book>
3993     \if@twocolumn
3994       \@restonecoltrue\onecolumn
3995     \else
3996       \@restonecolfalse
3997     \fi
3998     \chapter*{\listfigurename}%
3999 %</report|book>
4000 %<article>    \section*{\listfigurename}%
4001       \@mkboth{\MakeUppercase\listfigurename}%
4002               {\MakeUppercase\listfigurename}%
4003     \@starttoc{lof}%
4004 %<report|book>    \if@restonecol\twocolumn\fi
4005     }
4006 %    \end{macrocode}
4007 % \end{macro}
4009 % \begin{macro}{\l@figure}
4010 %    This macro produces an entry in the list of figures.
4011 %    \begin{macrocode}
4012 \newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
4013 %    \end{macrocode}
4014 % \end{macro}
4016 % \subsubsection{List of tables}
4018 % \begin{macro}{\listoftables}
4019 %    This macro is used to request that \LaTeX{} produces a list of
4020 %    tables. It is very similar to |\tableofcontents|.
4022 % \changes{v1.0g}{1993/12/09}{Moved the setting of
4023 %    \cs{@restonecolfalse}}
4024 % \changes{v1.4c}{2001/01/06}{Moved \cs{@mkboth} out of heading 
4025 %                             arg (pr/3285)}
4026 %    \begin{macrocode}
4027 \newcommand\listoftables{%
4028 %<*report|book>
4029     \if@twocolumn
4030       \@restonecoltrue\onecolumn
4031     \else
4032       \@restonecolfalse
4033     \fi
4034     \chapter*{\listtablename}%
4035 %</report|book>
4036 %<article>    \section*{\listtablename}%
4037       \@mkboth{%
4038           \MakeUppercase\listtablename}%
4039          {\MakeUppercase\listtablename}%
4040     \@starttoc{lot}%
4041 %<report|book>    \if@restonecol\twocolumn\fi
4042     }
4043 %    \end{macrocode}
4044 % \end{macro}
4046 % \begin{macro}{\l@table}
4047 %    This macro produces an entry in the list of tables.
4048 %    \begin{macrocode}
4049 \let\l@table\l@figure
4050 %    \end{macrocode}
4051 % \end{macro}
4053 % \subsection{Bibliography}
4055 % \begin{macro}{\bibindent}
4056 %    The ``open'' bibliography format uses an indentation of
4057 %    |\bibindent|.
4058 %    \begin{macrocode}
4059 \newdimen\bibindent
4060 \setlength\bibindent{1.5em}
4061 %    \end{macrocode}
4062 % \end{macro}
4064 % \begin{environment}{thebibliography}
4065 %    The `thebibliography' environment executes the following
4066 %    commands:
4068 %    |\renewcommand{\newblock}{\hskip.11em \@plus.33em \@minus.07em}|\\
4069 %      --- Defines the ``closed'' format, where the blocks (major units
4070 %      of information) of an entry run together.
4072 %    |\sloppy|  --- Used because it's rather hard to do line breaks in
4073 %      bibliographies,
4075 %    |\sfcode`\.=1000\relax| ---
4076 %      Causes a `.' (period) not to produce an end-of-sentence space.
4078 %    The implementation of this environment is based on the generic
4079 %    list environment. It uses the \Lcount{enumiv} counter internally
4080 %    to generate the labels of the list.
4082 %    When an empty `thebibliography' environment is found, a warning
4083 %    is issued.
4085 % \changes{v1.0i}{1993/12/19}{Corrected definition of thebibliography
4086 %    for article}
4087 % \changes{v1.2z}{1995/05/09}{added a missing percent character}
4088 % \changes{v1.3b}{1995/05/23}{Added missing braces in definition
4089 %    of thebibliography environment.}
4090 % \changes{v1.3j}{1995/08/16}{remove surplus spaces}
4091 % \changes{v1.3k}{1995/08/27}{Code for openbib changed}
4092 % \changes{v1.3t}{1996/10/05}{Added setting value of \cs{@clubpenalty}}
4093 %    \begin{macrocode}
4094 \newenvironment{thebibliography}[1]
4095 %<*article>
4096      {\section*{\refname}%
4097 %    \end{macrocode}
4098 %    The |\@mkboth| was moved out of the heading argument since at
4099 %    least in report and book (twocolumn option) there are definitions
4100 %    for |\chapter| which would swallow it otherwise.
4101 % \changes{v1.4c}{2001/01/06}{Moved \cs{@mkboth} out of heading 
4102 %                             arg (pr/3285)}
4103 %    \begin{macrocode}
4104       \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
4105 %</article>
4106 %<*!article>
4107      {\chapter*{\bibname}%
4108       \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
4109 %</!article>
4110       \list{\@biblabel{\@arabic\c@enumiv}}%
4111            {\settowidth\labelwidth{\@biblabel{#1}}%
4112             \leftmargin\labelwidth
4113             \advance\leftmargin\labelsep
4114             \@openbib@code
4115             \usecounter{enumiv}%
4116             \let\p@enumiv\@empty
4117             \renewcommand\theenumiv{\@arabic\c@enumiv}}%
4118       \sloppy
4119 %    \end{macrocode}
4120 %    This is setting the normal (non-infinite) value of
4121 %    |\clubpenalty| for the whole of this environment,
4122 %    so we must reset its stored value also.  (Why is there a |%| after
4123 %    the second 4000 below?)
4124 %    \begin{macrocode}
4125       \clubpenalty4000
4126       \@clubpenalty \clubpenalty
4127       \widowpenalty4000%
4128       \sfcode`\.\@m}
4129      {\def\@noitemerr
4130        {\@latex@warning{Empty `thebibliography' environment}}%
4131       \endlist}
4132 %    \end{macrocode}
4133 % \end{environment}
4135 % \begin{macro}{\newblock}
4136 %    The default definition for |\newblock| is to produce a small space.
4137 % \changes{v1.3k}{1995/08/27}{Default changed.}
4138 %    \begin{macrocode}
4139 \newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
4140 %    \end{macrocode}
4141 % \end{macro}
4143 % \begin{macro}{\@openbib@code}
4144 %    The default definition for |\@openbib@code| is to do nothing.
4145 %    It will be changed by the \Lopt{openbib} option.
4146 % \changes{v1.3k}{1995/08/27}{Macro added}
4147 %    \begin{macrocode}
4148 \let\@openbib@code\@empty
4149 %    \end{macrocode}
4150 % \end{macro}
4152 % \begin{macro}{\@biblabel}
4153 %    The label for a |\bibitem[...]| command is produced by this
4154 %    macro. The default from \file{latex.dtx} is used.
4155 %    \begin{macrocode}
4156 % \renewcommand*{\@biblabel}[1]{[#1]\hfill}
4157 %    \end{macrocode}
4158 % \end{macro}
4160 % \begin{macro}{\@cite}
4161 %    The output of the |\cite| command is produced by this macro. The
4162 %    default from \file{latex.dtx} is used.
4163 %    \begin{macrocode}
4164 % \renewcommand*{\@cite}[1]{[#1]}
4165 %    \end{macrocode}
4166 % \end{macro}
4168 %  \subsection{The index}
4170 % \begin{environment}{theindex}
4171 %    The environment `theindex' can be used for indices. It makes an
4172 %    index with two columns, with each entry a separate paragraph. At
4173 %    the user level the commands |\item|, |\subitem| and |\subsubitem|
4174 %    are used to produce index entries of various levels. When a new
4175 %    letter of the alphabet is encountered an amount of |\indexspace|
4176 %    white space can be added.
4179 % \changes{v1.0g}{1993/12/09}{Moved the setting of
4180 %    \cs{@restonecoltrue}}
4181 %    \begin{macrocode}
4182 \newenvironment{theindex}
4183                {\if@twocolumn
4184                   \@restonecolfalse
4185                 \else
4186                   \@restonecoltrue
4187                 \fi
4188 %<article>                \twocolumn[\section*{\indexname}]%
4189 %<!article>                \twocolumn[\@makeschapterhead{\indexname}]%
4190                 \@mkboth{\MakeUppercase\indexname}%
4191                         {\MakeUppercase\indexname}%
4192                 \thispagestyle{plain}\parindent\z@
4193 %    \end{macrocode}
4194 %    Parameter changes to |\columnseprule| and |\columnsep| have to be
4195 %    done after |\twocolumn| has acted. Otherwise they can affect the
4196 %    last page before the index.
4197 % \changes{ v1.4f}{2004/02/16}{Moved setting of \cs{columnsep} and
4198 %    \cs{columnseprule} later to avoid affecting the wrong page (pr/3616)}
4199 %    \begin{macrocode}
4200                 \parskip\z@ \@plus .3\p@\relax
4201                 \columnseprule \z@
4202                 \columnsep 35\p@
4203                 \let\item\@idxitem}
4204 %    \end{macrocode}
4205 %    When the document continues after the index and it was a one
4206 %    column document we have to switch back to one column after the
4207 %    index.
4208 %    \begin{macrocode}
4209                {\if@restonecol\onecolumn\else\clearpage\fi}
4210 %    \end{macrocode}
4211 % \end{environment}
4213 % \begin{macro}{\@idxitem}
4214 % \begin{macro}{\subitem}
4215 % \begin{macro}{\subsubitem}
4216 %    These macros are used to format the entries in the index. ^^AA ???
4217 % \changes{v1.3f}{1995/06/23}{Corrected error in definition of
4218 %                         \cs{@idxitem}.}
4219 % \changes{v1.3j}{1995/08/16}{use \cs{@idxitem} to save space}
4220 %    \begin{macrocode}
4221 \newcommand\@idxitem{\par\hangindent 40\p@}
4222 \newcommand\subitem{\@idxitem \hspace*{20\p@}}
4223 \newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
4224 %    \end{macrocode}
4225 % \end{macro}
4226 % \end{macro}
4227 % \end{macro}
4229 % \begin{macro}{\indexspace}
4230 %    The amount of white space that is inserted between `letter
4231 %    blocks' in the index.
4232 %    \begin{macrocode}
4233 \newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
4234 %    \end{macrocode}
4235 % \end{macro}
4237 % \subsection{Footnotes}
4239 % \begin{macro}{\footnoterule}
4240 %    Usually, footnotes are separated from the main body of the text
4241 %    by a small rule. This rule is drawn by the macro |\footnoterule|.
4242 %    We have to make sure that the rule takes no vertical space (see
4243 %    \file{plain.tex}) so we compensate for the natural heigth of the
4244 %    rule of 0.4pt by adding the right amount of vertical skip.
4246 %    To prevent the rule from colliding with the footnote we first add
4247 %    a little negative vertical skip, then we put the rule and make
4248 %    sure we end up at the same point where we begun this operation.
4249 % \changes{v1.3a}{1995/05/17}{use \cs{@width}}
4250 %    \begin{macrocode}
4251 \renewcommand\footnoterule{%
4252   \kern-3\p@
4253   \hrule\@width.4\columnwidth
4254   \kern2.6\p@}
4255 %    \end{macrocode}
4256 % \end{macro}
4258 % \begin{macro}{\c@footnote}
4259 %    Footnotes are numbered within chapters in the report and book
4260 %    document styles.
4261 %    \begin{macrocode}
4262 %<!article>\@addtoreset{footnote}{chapter}
4263 %    \end{macrocode}
4264 % \end{macro}
4266 % \begin{macro}{\@makefntext}
4267 %    The footnote mechanism of \LaTeX{} calls the macro |\@makefntext|
4268 %    to produce the actual footnote. The macro gets the text of the
4269 %    footnote as its argument and should use |\@thefnmark| as the mark
4270 %    of the footnote. The macro |\@makefntext|is called when
4271 %    effectively inside a |\parbox| of width |\columnwidth| (i.e.,
4272 %    with |\hsize| = |\columnwidth|).
4274 %   An example of what can be achieved is given by the following piece
4275 %   of \TeX\ code.
4276 % \begin{verbatim}
4277 %          \newcommand\@makefntext[1]{%
4278 %             \@setpar{\@@par
4279 %                      \@tempdima = \hsize
4280 %                      \advance\@tempdima-10pt
4281 %                      \parshape \@ne 10pt \@tempdima}%
4282 %             \par
4283 %             \parindent 1em\noindent
4284 %             \hbox to \z@{\hss\@makefnmark}#1}
4285 % \end{verbatim}
4286 %    The effect of this definition is that all lines of the footnote
4287 %    are indented by 10pt, while the first line of a new paragraph is
4288 %    indented by 1em. To change these dimensions, just substitute the
4289 %    desired value for `10pt' (in both places) or `1em'.  The mark is
4290 %    flushright against the footnote.
4292 %    In these document classes we use a simpler macro, in which the
4293 %    footnote text is set like an ordinary text paragraph, with no
4294 %    indentation except on the first line of a paragraph, and the
4295 %    first line of the footnote. Thus, all the macro must do is set
4296 %    |\parindent| to the appropriate value for succeeding paragraphs
4297 %    and put the proper indentation before the mark.
4299 % \changes{v1.1a}{1994/03/13}{Use \cs{@makefnmark} to generate
4300 %    footnote marker}
4301 %    \begin{macrocode}
4302 \newcommand\@makefntext[1]{%
4303     \parindent 1em%
4304     \noindent
4305     \hb@xt@1.8em{\hss\@makefnmark}#1}
4306 %    \end{macrocode}
4307 % \end{macro}
4309 % \begin{macro}{\@makefnmark}
4310 %    The footnote markers that are printed in the text to point to the
4311 %    footnotes should be produced by the macro |\@makefnmark|. We use
4312 %    the default definition for it.
4313 %    \begin{macrocode}
4314 %\renewcommand\@makefnmark{\hbox{\@textsuperscript
4315 %                                  {\normalfont\@thefnmark}}}
4316 %    \end{macrocode}
4317 % \end{macro}
4319 % \section{Initialization}
4321 % \subsection{Words}
4323 % This document class is for documents prepared in the English language.
4324 % To prepare a version for another language, various English words must
4325 % be replaced.  All the English words that require replacement are
4326 % defined below in command names. These commands may be redefined in
4327 % any class or package that is customising \LaTeX\ for use with
4328 % non-English languages.
4329 % \changes{v1.3h}{1995/07/20}{Split up to save save stack /1742}
4331 % \begin{macro}{\contentsname}
4332 % \begin{macro}{\listfigurename}
4333 % \begin{macro}{\listtablename}
4334 %    \begin{macrocode}
4335 \newcommand\contentsname{Contents}
4336 \newcommand\listfigurename{List of Figures}
4337 \newcommand\listtablename{List of Tables}
4338 %    \end{macrocode}
4339 % \end{macro}
4340 % \end{macro}
4341 % \end{macro}
4343 % \begin{macro}{\refname}
4344 % \begin{macro}{\bibname}
4345 % \begin{macro}{\indexname}
4346 %    \begin{macrocode}
4347 %<article>\newcommand\refname{References}
4348 %<report|book>\newcommand\bibname{Bibliography}
4349 \newcommand\indexname{Index}
4350 %    \end{macrocode}
4351 % \end{macro}
4352 % \end{macro}
4353 % \end{macro}
4355 % \begin{macro}{\figurename}
4356 % \begin{macro}{\tablename}
4357 %    \begin{macrocode}
4358 \newcommand\figurename{Figure}
4359 \newcommand\tablename{Table}
4360 %    \end{macrocode}
4361 % \end{macro}
4362 % \end{macro}
4364 % \begin{macro}{\partname}
4365 % \begin{macro}{\chaptername}
4366 % \begin{macro}{\appendixname}
4367 % \begin{macro}{\abstractname}
4368 %    \begin{macrocode}
4369 \newcommand\partname{Part}
4370 %<report|book>\newcommand\chaptername{Chapter}
4371 \newcommand\appendixname{Appendix}
4372 %<!book>\newcommand\abstractname{Abstract}
4373 %    \end{macrocode}
4374 % \end{macro}
4375 % \end{macro}
4376 % \end{macro}
4377 % \end{macro}
4379 % \subsection{Date}
4381 % \begin{macro}{\today}
4382 %    This macro uses the \TeX\ primitives |\month|, |\day| and |\year|
4383 %    to provide the date of the \LaTeX-run.
4385 %    At |\begin{document}| this definition will be optimised
4386 %    so that the names of all the `wrong' months are not stored.
4387 %    This optimisation is not done here as that would `freeze'
4388 %    |\today| in any special purpose format made by loading the class
4389 %    file into the format file.
4390 % \changes{v1.3j}{1995/08/16}{use \cs{edef} to save a lot of space}
4391 % \changes{v1.3w}{1997/10/06}{use \cs{def} again, latex/2620}
4392 %    \begin{macrocode}
4393 \def\today{\ifcase\month\or
4394   January\or February\or March\or April\or May\or June\or
4395   July\or August\or September\or October\or November\or December\fi
4396   \space\number\day, \number\year}
4397 %    \end{macrocode}
4398 % \end{macro}
4400 % \subsection{Two column mode}
4402 % \begin{macro}{\columnsep}
4403 %    This gives the distance between two columns in two column mode.
4404 %    \begin{macrocode}
4405 \setlength\columnsep{10\p@}
4406 %    \end{macrocode}
4407 % \end{macro}
4409 % \begin{macro}{\columnseprule}
4410 %    This gives the width of the rule between two columns in two
4411 %    column mode. We have no visible rule.
4412 %    \begin{macrocode}
4413 \setlength\columnseprule{0\p@}
4414 %    \end{macrocode}
4415 % \end{macro}
4417 % \subsection{The page style}
4418 %    We have \pstyle{plain} pages in the document classes article and
4419 %    report unless the user specified otherwise. In the `book'
4420 %    document class we use the page style \pstyle{headings} by
4421 %    default. We use arabic pagenumbers.
4422 %    \begin{macrocode}
4423 %<!book>\pagestyle{plain}
4424 %<book>\pagestyle{headings}
4425 \pagenumbering{arabic}
4426 %    \end{macrocode}
4428 % \subsection{Single or double sided printing}
4431 % \changes{v1.2v}{1994/11/10}{removed typo}
4432 %    When the \Lopt{twoside} option wasn't specified, we don't try to
4433 %    make each page as long as all the others.
4434 %    \begin{macrocode}
4435 \if@twoside
4436 \else
4437   \raggedbottom
4439 %    \end{macrocode}
4440 %    When the \Lopt{twocolumn} option was specified we call
4441 %    |\twocolumn| to activate this mode. We try to make each column as
4442 %    long as the others, but call |sloppy| to make our life easier.
4443 %    \begin{macrocode}
4444 \if@twocolumn
4445   \twocolumn
4446   \sloppy
4447   \flushbottom
4448 %    \end{macrocode}
4449 %    Normally we call |\onecolumn| to initiate typesetting in one
4450 %    column.
4451 %    \begin{macrocode}
4452 \else
4453   \onecolumn
4455 %</article|report|book>
4456 %    \end{macrocode}
4458 % \changes{v1.3i}{1995/08/09}{Moved code for generic class options
4459 % leqno and fleqn to kernel file}
4461 % \Finale
4463 \endinput