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