home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / texmf / inputs / latex / unpacked / classes.dtx < prev    next >
Encoding:
Text File  |  1995-06-23  |  143.0 KB  |  4,301 lines

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