home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / programs / amiga / pastex / macros / latex2e / base / classes.dtx (.txt) < prev    next >
LaTeX Document  |  1994-06-10  |  142KB  |  3,727 lines

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