home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / textutil / tex / source / latex_2e_1 / classes.dtx < prev    next >
Encoding:
Text File  |  1994-07-28  |  138.9 KB  |  4,195 lines

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