3 % $Id: strayman.dtx,v 1.4 2003/11/07 11:32:53 mdw Exp $
5 % Document class for Straylight manuals
11 % \begin{meta-comment} <general public licence>
13 %% strayman -- a LaTeX document class for Straylight manuals
14 %% Copyright (c) 1996 Straylight
16 %% This program is free software; you can redistribute it and/or modify
17 %% it under the terms of the GNU General Public License as published by
18 %% the Free Software Foundation; either version 2 of the License, or
19 %% (at your option) any later version.
21 %% This program is distributed in the hope that it will be useful,
22 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
23 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 %% GNU General Public License for more details.
26 %% You should have received a copy of the GNU General Public License
27 %% along with this program; if not, write to the Free Software
28 %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32 % \begin{meta-comment} <Package preamble>
33 %<+strayman>\NeedsTeXFormat{LaTeX2e}
34 %<+strayman>\ProvidesClass{strayman}
35 %<+strayman> [2003/09/04 1.10 Straylight document class]
40 %% {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
41 %% 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
42 %% Digits \0\1\2\3\4\5\6\7\8\9
43 %% Exclamation \! Double quote \" Hash (number) \#
44 %% Dollar \$ Percent \% Ampersand \&
45 %% Acute accent \' Left paren \( Right paren \)
46 %% Asterisk \* Plus \+ Comma \,
47 %% Minus \- Point \. Solidus \/
48 %% Colon \: Semicolon \; Less than \<
49 %% Equals \= Greater than \> Question mark \?
50 %% Commercial at \@ Left bracket \[ Backslash \\
51 %% Right bracket \] Circumflex \^ Underscore \_
52 %% Grave accent \` Left brace \{ Vertical bar \|
53 %% Right brace \} Tilde \~}
56 % \begin{meta-comment} <driver>
59 \documentclass[10pt,a4paper,book,nohyperref]{strayman}
62 \describesclass{strayman}
63 \errorcontextlines\maxdimen
64 \title[The \strayman\ document class]
65 {The \strayman\footnote{The \strayman\ document class is currently %
66 at version \mdwfileinfo{strayman.cls}{version}, dated %
67 \mdwfileinfo{strayman.cls}{date}.} {} document class}
68 \newenvironment{syndisplay}{\display\synshorts}{\enddisplay}
69 \DeclareRobustCommand\strayman{\package{strayman}}
75 % \chapter{About the \strayman\ document class}
77 % The standard \LaTeX\ document classes are all very well for simple
78 % documents, but the style isn't appropriate for works like manuals.
79 % The \strayman\ document class is an attempt to rectify this situation,
80 % providing an attractive and distinctive style for Straylight documents.
81 % The layout is based on an earlier style built for \emph{Impression}
82 % documents, although many improvements have been made. This document
83 % was typeset using \strayman, and it demonstrates the design far better
84 % than I can describe it.
87 % \section{Document class options}
89 % The document class provides many options, most of which are taken from
90 % the standard \LaTeX\ classes.
93 % \def\|{\ensuremath\vert}
95 % \item [\texttt{a4paper} \| \texttt{a5paper} \| \texttt{b5paper} \|
96 % \texttt{letterpaper} \| \texttt{legalpaper} \|
97 % \texttt{executivepaper}] Select the output paper size. Since
98 % \strayman\ is intended to be used mainly for manuals, the default
101 % \item [\texttt{landscape}] Swaps the width and height of the paper.
102 % Probably not much use, to be honest.
104 % \item [\texttt{9pt} \| \texttt{10pt} \| \texttt{11pt} \| \texttt{12pt}]
105 % Selects the basic type size for the document. The |9pt| option is
106 % nonstandard, but it is the default, since larger sizes don't work
109 % \item [\texttt{text}] Sets up the page layout and fonts so that the
110 % output can be converted fairly easily into a raw text file.
112 % \item [\texttt{oneside} \| \texttt{twoside}] Selects one- or two-sided
113 % page layouts. Note that one-sided output doesn't look too good.
115 % \item [\texttt{draft} \| \texttt{final}] Select various options for draft
118 % \item [\texttt{titlepage} \| \texttt{notitlepage}] Selects whether
119 % the |\maketitle| displays its output on a separate title page.
121 % \item [\texttt{openright} \| \texttt{openany}] Select whether chapters
122 % start only on quarto pages, or any page. The default is |openright|.
124 % \item [\texttt{onecolumn} \| \texttt{twocolumn}] Choose whether the
125 % main body text is set in one or two columns. Note that this uses
126 % \LaTeX's built-in column handling, not the \package{multicol}
129 % \item [\texttt{leqno}] Put the equation numbers on the left, not the
132 % \item [\texttt{fleqn}] Typeset displayed equations left aligned.
134 % \item [\texttt{openbib}] Use the `open' style for the bibliography.
136 % \item [\texttt{article}] Change the formatting slightly, in a way more
137 % suited to short documents.
139 % \item [\texttt{square} \| \texttt{rounded}] These options are passed
140 % directly to the \package{syntax} package, when it's loaded.
145 % \section{The \texttt{text} option}
147 % In order to facilitate creation of attractively formatted text files
148 % from \LaTeX\ documents, \strayman\ provides a |text| option. This will
149 % set up \emph{all} the fonts to be monospaced, in the same size. The page
150 % size is set up to be a multiple of the character size. The command
152 % "dvi2tty -e-17" <filename>
154 % appears to produce a reasonable output from a DVI file created in this
155 % way. The output will need to be formatted and corrected slightly by hand
156 % although there's a good deal less work to do than might be required
160 % \section{That's it}
162 % That's all I'm writing for now. It's a document class. It defines the
163 % style. What more do you expect?
168 % \chapter{Implementation}
170 % \section{Options handling}
172 % From here on, a lot of the code is shamelessly borrowed from
173 % \file{book.cls} and other places. This is what code re-use is for.
175 % This bit handles all the options on the |\documentclass| command, either
176 % altering our own internal arguments, or loading other packages as
179 % \subsection{Set up some defaults}
181 % We create some variables to hold the settings, and initialise them to
186 \newcommand\@ptsize{}
187 \newif\if@restonecol\@restonecolfalse
188 \newif\if@titlepage\@titlepagefalse
189 \newif\if@openright\@openrighttrue
190 \newif\if@openbib\@openbibfalse
191 \newif\if@appendix\@appendixfalse
192 \newif\if@article\@articletrue
193 \newif\if@offsetpages\@offsetpagestrue
194 \newif\if@numbering\@numberingtrue
195 \newif\if@herefloats\@herefloatsfalse
196 \newif\if@runinsubsubsec\@runinsubsubsectrue
197 \newif\if@hyperref\@hyperreftrue
199 \newdimen\pagesurround
200 \let\headfam\rmfamily
201 \let\pad@margin\@empty
204 \expandafter\def\expandafter\@delayed\expandafter{\@delayed#1}%
208 % \subsection{Declare the options we support}
210 % This is just a tedious list of all the options.
213 \DeclareOption{a4paper}{%
218 \DeclareOption{a5paper}{%
223 \DeclareOption{b5paper}{%
228 \DeclareOption{letterpaper}{%
233 \DeclareOption{legalpaper}{%
238 \DeclareOption{executivepaper}{%
243 \DeclareOption{landscape}{%
244 \@tempdima\paperheight%
245 \paperheight\paperwidth%
246 \paperwidth\@tempdima%
248 \DeclareOption{8pt}{\renewcommand\@ptsize{8pt}}
249 \DeclareOption{9pt}{\renewcommand\@ptsize{9pt}}
250 \DeclareOption{10pt}{\renewcommand\@ptsize{10pt}}
251 \DeclareOption{11pt}{\renewcommand\@ptsize{11pt}}
252 \DeclareOption{12pt}{\renewcommand\@ptsize{12pt}}
253 \DeclareOption{text}{%
254 \renewcommand\@ptsize{text}%
255 \setbox\z@\hbox{\texttt{M\strut}}%
256 \newdimen\tt@chw\tt@chw\wd\z@%
257 \newdimen\tt@chh\tt@chh\ht\z@\advance\tt@chh\dp\z@%
258 \paperwidth77\tt@chw%
259 \paperheight60\tt@chh%
263 \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
264 \DeclareOption{twoside}{\@twosidetrue \@mparswitchfalse \reversemarginpar}
265 \DeclareOption{draft}{\overfullrule5\p@}
266 \DeclareOption{final}{\overfullrule\z@}
267 \DeclareOption{titlepage}{\@titlepagetrue}
268 \DeclareOption{notitlepage}{\@titlepagefalse}
269 \DeclareOption{openright}{\@openrighttrue}
270 \DeclareOption{openany}{\@openrightfalse}
271 \DeclareOption{onecolumn}{\@twocolumnfalse}
272 \DeclareOption{twocolumn}{\@twocolumntrue}
273 \DeclareOption{offsetpages}{\@offsetpagestrue}
274 \DeclareOption{nooffsetpages}{\@offsetpagesfalse}
275 \DeclareOption{herefloats}{\@herefloatstrue}
276 \DeclareOption{noherefloats}{\@herefloatsfalse}
277 \DeclareOption{leqno}{\input{leqno.clo}}
278 \DeclareOption{fleqn}{\input{fleqn.clo}}
279 \DeclareOption{openbib}{\@openbibtrue}
280 \DeclareOption{article}{\@articletrue}
281 \DeclareOption{noarticle}{\@articlefalse}
282 \DeclareOption{numbering}{\@numberingtrue}
283 \DeclareOption{nonumbering}{\@numberingfalse}
284 \DeclareOption{runinsubsubsec}{\@runinsubsubsectrue}
285 \DeclareOption{noruninsubsubsec}{\@runinsubsubsecfalse}
286 \DeclareOption{indentpar}{\@indentpartrue}
287 \DeclareOption{noindentpar}{\@indentparfalse}
288 \DeclareOption{book}{\@titlepagetrue\@articlefalse}
289 \DeclareOption{hyperref}{\@hyperreftrue}
290 \DeclareOption{nohyperref}{\@hyperreffalse}
293 % \subsection{Set up the options}
295 % We set up some default options, and then read the user's.
298 \ExecuteOptions{a4paper,10pt,twoside,onecolumn,final}
302 % If this is PDF\TeX\ then tell it the page bounds.
305 \newif\ifpdfing\pdfingfalse
306 \if1\ifx\pdfoutput\@@undefined@@0\else\the\pdfoutput\fi
310 \pdfpageheight\paperheight
311 \pdfpagewidth\paperwidth
316 bookmarks = true, bookmarksnumbered = true, bookmarksdepth = 3,
317 colorlinks = true, linkcolor = blue, citecolor = blue, urlcolor = blue,
318 breaklinks = true]{hyperref}
321 \PassOptionsToPackage{pdftex}{hyperref}
323 \PassOptionsToPackage{dvips}{hyperref}
328 % \subsection{Read in the text size option}
330 % The text sizing is rather messy. We store this in a separate file. To
331 % keep this stuff away from other classes, we use the file \emph{extension}
332 % as the size specifier, rather than the filename, which is the normal
333 % \LaTeX\ way of doing this. This is a \riscos\ thing mainly: I don't like
334 % loads of directories cluttering up my disk, and it means that I can move
335 % the whole of the \strayman\ stuff around as one directory.
338 \input{strayman.\@ptsize}
342 % \section{Package loading}
346 \RequirePackage{fancyhdr}
347 \RequirePackage{multicol}
352 % \section{Page layout}
354 % This is largely the domain of the size option files.
357 %<*8pt|9pt|10pt|11pt|12pt|text>
358 %<+8pt>\ProvidesFile{strayman.8pt}
359 %<+9pt>\ProvidesFile{strayman.9pt}
360 %<+10pt>\ProvidesFile{strayman.10pt}
361 %<+11pt>\ProvidesFile{strayman.11pt}
362 %<+12pt>\ProvidesFile{strayman.12pt}
363 %<+text>\ProvidesFile{strayman.text}
366 % \subsection{Font sizes}
368 % These are fairly standard, and mainly copied from the original size
371 % \begin{macro}{\@setparskip}
373 % Because we separate paragraphs by vertical space, we need to vary this
374 % gap when we change font size. This macro does the job.
378 \newdimen\@parshortfall
380 \@parskip.67\baselineskip\@plus\p@\relax%
381 \ifdim\parskip=\z@\else\parskip\@parskip\relax\fi%
382 \@parshortfall\@parskip\advance\@parshortfall-\parskip%
384 \def\set@vsep#1{#1\@parshortfall\advance#1}
388 % \begin{macro}{\normalsize}
390 % Defines the standard size of text in the document.
393 \renewcommand\normalsize{%
395 \@setfontsize\normalsize\@viiipt{9.6\p@}%
396 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
397 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
398 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
401 \@setfontsize\normalsize\@ixpt\@xipt%
402 \abovedisplayskip9\p@\@plus2\p@\@minus5\p@%
403 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
404 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
407 \@setfontsize\normalsize\@xpt\@xiipt%
408 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
409 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
410 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
413 \@setfontsize\normalsize\@xipt{13.6}%
414 \abovedisplayskip11\p@\@plus3\p@\@minus6\p@%
415 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
416 \set@vsep\belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
419 \@setfontsize\normalsize\@xiipt{14.5}%
420 \abovedisplayskip12\p@\@plus3\p@\@minus7\p@%
421 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
422 \set@vsep\belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
425 \@setfontsize\normalsize\@xpt\@xiipt%
426 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
427 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
428 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
430 \belowdisplayskip\abovedisplayskip%
443 % \begin{macro}{\small}
445 % The |\small| size is defined with similar care to |\normalsize|. The
446 % list defaults are altered to cope with our different value for |\parskip|.
447 % We can then separate this out independently from the typesize.
450 %<+text>\let\small\normalsize
451 %<*8pt|9pt|10pt|11pt|12pt>
454 \@setfontsize\small\@viipt{8.4}%
455 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
456 \set@vsep\abovedisplayshortskip\z@\@plus2\p@%
457 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
460 \@setfontsize\small\@viiipt{9.5}%
461 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
462 \set@vsep\abovedisplayshortskip\z@\@plus2\p@%
463 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
466 \@setfontsize\small\@ixpt{11}%
467 \abovedisplayskip8.5\p@\@plus3\p@\@minus4\p@%
468 \set@vsep\abovedisplayshortskip\z@\@plus2\p@%
469 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
472 \@setfontsize\small\@xpt\@xiipt%
473 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
474 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
475 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
478 \@setfontsize\small\@xipt{13.6}%
479 \abovedisplayskip11\p@\@plus3\p@\@minus6\p@%
480 \set@vsep\abovedisplayshortskip\z@ \@plus3\p@%
481 \set@vsep\belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
484 \leftmargin\leftmargini%
485 \topsep\@parshortfall%
489 \belowdisplayskip\abovedisplayskip%
492 %</8pt|9pt|10pt|11pt|12pt>
496 % \begin{macro}{\footnotesize}
498 % This is also defined with the meticulous care of |\normalsize|, and
499 % altered in the same way as for |\small|.
502 %<+text>\let\footnotesize\normalsize
503 %<*8pt|9pt|10pt|11pt|12pt>
504 \newcommand\footnotesize{%
506 \@setfontsize\footnotesize\@vipt\@viipt%
507 \set@vsep\abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
508 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
509 \set@vsep\belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
512 \@setfontsize\footnotesize\@viipt{8.4}%
513 \set@vsep\abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
514 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
515 \set@vsep\belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
518 \@setfontsize\footnotesize\@viiipt{9.5}%
519 \set@vsep\abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
520 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
521 \set@vsep\belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
524 \@setfontsize\footnotesize\@ixpt{11}%
525 \set@vsep\abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
526 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
527 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
530 \@setfontsize\footnotesize\@xpt\@xiipt
531 \set@vsep\abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
532 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
533 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
536 \leftmargin\leftmargini%
537 \topsep\@parshortfall%
541 \belowdisplayskip\abovedisplayskip%
544 %</8pt|9pt|10pt|11pt|12pt>
548 % The other sizes are all much simpler. We introduce a new size,
549 % |\listingsize|, which is used for the \env{listing} environment, to ensure
550 % that 77 columns of text fit across an A5 sheet.
554 \newcommand\scriptsize{\@setfontsize\scriptsize\@vpt\@vipt\@setparskip}
555 \newcommand\tiny{\@setfontsize\tiny{4}\@vpt\@setparskip}
556 \newcommand\large{\@setfontsize\large\@xpt\@xiipt\@setparskip}
557 \newcommand\Large{\@setfontsize\Large\@xipt{13}\@setparskip}
558 \newcommand\LARGE{\@setfontsize\LARGE\@xiipt\@xivpt\@setparskip}
559 \newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
560 \newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
563 \newcommand\scriptsize{\@setfontsize\scriptsize\@vipt\@viipt\@setparskip}
564 \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt\@setparskip}
565 \newcommand\large{\@setfontsize\large\@xipt{13}\@setparskip}
566 \newcommand\Large{\@setfontsize\Large\@xiipt{14.4}\@setparskip}
567 \newcommand\LARGE{\@setfontsize\LARGE\@xivpt{17}\@setparskip}
568 \newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
569 \newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
572 \newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt\@setparskip}
573 \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt\@setparskip}
574 \newcommand\large{\@setfontsize\large\@xiipt{14}\@setparskip}
575 \newcommand\Large{\@setfontsize\Large\@xivpt{18}\@setparskip}
576 \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}\@setparskip}
577 \newcommand\huge{\@setfontsize\huge\@xxpt{25}\@setparskip}
578 \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}\@setparskip}
581 \newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}\@setparskip}
582 \newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt\@setparskip}
583 \newcommand\large{\@setfontsize\large\@xiipt{14}\@setparskip}
584 \newcommand\Large{\@setfontsize\Large\@xivpt{18}\@setparskip}
585 \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}\@setparskip}
586 \newcommand\huge{\@setfontsize\huge\@xxpt{25}\@setparskip}
587 \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}\@setparskip}
590 \newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}\@setparskip}
591 \newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt\@setparskip}
592 \newcommand\large{\@setfontsize\large\@xivpt{18}\@setparskip}
593 \newcommand\Large{\@setfontsize\Large\@xviipt{22}\@setparskip}
594 \newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}\@setparskip}
595 \newcommand\huge{\@setfontsize\huge\@xxvpt{30}\@setparskip}
598 %<+8pt|9pt|10pt|11pt|12pt>\let\listingsize\footnotesize
600 \def\scriptsize{\@setfontsize\scriptsize\@xpt\@xiipt\@setparskip}
602 \let\large\scriptsize
603 \let\Large\scriptsize
604 \let\LARGE\scriptsize
607 \let\listingsize\scriptsize
609 \let\txt@selectfont\selectfont
611 \fontfamily\ttdefault%
617 %</8pt|9pt|10pt|11pt|12pt|text>
620 % \subsection{Paragraph layout}
622 % Here we define various paragraph layout parameters.
624 % First, set up the line separation parameters. |\baselineskip| is set
625 % up by the individual size commands.
633 % We don't try to stretch the baselines apart:
636 \renewcommand\baselinestretch{}
639 % Paragraph indentation is set up later.
641 % Set up some standard penalty values.
650 % \subsection{Page layout}
652 % Our layout is a bit different to the standard \LaTeX\ ones: we leave a lot
653 % of space down the left hand side: this is reserved for headings and
656 % Calculating the size of the space on the left, which we call |\leftindent|,
657 % is complicated. We want to use as much of the width of the page as
658 % possible, unlike the \LaTeX\ defaults, making sure that we can fit on
659 % 77 columns of |\listingsize\tt| text. We also try to make space for a
660 % reasonable amount of marginal text, although we don't worry too much if
663 % The calculation is done as follows. More than about 40\,mm of margin will
664 % look very strange. We must have at least 104\,mm of main text, which
665 % leaves 20\,mm for the notes on A5 paper (actually, 17\,mm, since we leave
666 % 3\,mm gap between the notes and the main text). We divide the page
667 % horizontally into $s$\,mm of left border, $m$\,mm of marginal notes,
668 % $t$\,mm of body text, and another $s$\,mm of right border, giving
669 % a total of $w$\,mm. The value $s$ is given to us by the parameter
672 % Articles look odd with a big gap down the side, so this is reduced when
675 % We calculate the quantity~$m$ as $\min\bigl(40,17(w-2s-3)/121+3\bigr)$\@.
676 % Then we calculate $t=w-m-24-3$.
679 %<*8pt|9pt|10pt|11pt|12pt|text>
681 %<*8pt|9pt|10pt|11pt|12pt>
682 \leftindent\paperwidth
684 \advance\leftindent-2\pagesurround
685 \advance\leftindent-3mm
686 \leftindent0.1405\leftindent
687 \advance\leftindent3mm
688 \ifdim\leftindent>40mm\relax
691 \if@article\divide\leftindent\tw@\fi
692 \ifdim\leftindent<15mm\leftindent15mm\fi
696 %</8pt|9pt|10pt|11pt|12pt>
697 %<+text>\leftindent8\tt@chw
700 % In two-column layouts, we prevent headings from being outdented, by
701 % zeroing |\sectindent|. Chapter headings and suchlike are still outdented
702 % as before. We do not support margin paragraphs in two-column layouts.
709 \sectindent\if@numbering\z@\else\if@article\else\tw@\fi\leftindent\fi
713 % Having set up the size of the margin, we can get on with the rest of the
716 % First, we fix |\hoffset| and |\voffset| so we can work on the whole size
724 % Now we can design the page layout in earnest. We begin with the vertical
730 %<+10pt>\topskip10\p@
731 %<+11pt>\topskip11\p@
732 %<+12pt>\topskip12\p@
733 %<+text>\topskip\tt@chh
734 %<-text>\topmargin\pagesurround
735 %<+text>\topmargin\z@
736 %<-text>\headheight12\p@
737 %<+text>\headheight12\p@
738 %<-text>\headsep.5\pagesurround
739 %<+text>\headsep2\tt@chh
740 %<+text>\advance\headsep-12\p@
741 %<-text>\footskip12\p@
742 %<-text>\advance\footskip.5\pagesurround
743 %<+text>\footskip2\tt@chh
744 \textheight\paperheight
745 %<-text>\advance\textheight-24\p@
746 %<-text>\advance\textheight-3\pagesurround
747 %<+text>\advance\textheight-4\tt@chh
750 % Now we define the horizontal layout.
753 \oddsidemargin\leftindent
754 %<-text>\advance\oddsidemargin\pagesurround
755 \evensidemargin\oddsidemargin
756 \textwidth\paperwidth
757 \advance\textwidth-\oddsidemargin
758 %<-text> \advance\textwidth-\pagesurround
759 %<-text>\marginparsep3mm
760 %<+text>\marginparsep\tt@chw
761 \marginparwidth\leftindent
762 \advance\marginparwidth-\marginparsep
765 % Setting |\maxdepth| is fairly simple. This looks odd, because normally
766 % there's some messing for compatibility with \LaTeX~2.09.
773 % Marginal notes need some setting up.
779 % Footnotes need some setting up now.
782 %<+8pt>\footnotesep5.8\p@
783 %<+9pt>\footnotesep6.2\p@
784 %<+10pt>\footnotesep6.65\p@
785 %<+11pt>\footnotesep7.7\p@
786 %<+12pt>\footnotesep8.4\p@
787 %<+8pt>\setlength{\skip\footins}{7\p@\@plus4\p@\@minus2\p@}
788 %<+9pt>\setlength{\skip\footins}{8\p@\@plus4\p@\@minus2\p@}
789 %<+10pt>\setlength{\skip\footins}{9\p@\@plus4\p@\@minus2\p@}
790 %<+11pt>\setlength{\skip\footins}{10\p@\@plus4\p@\@minus2\p@}
791 %<+12pt>\setlength{\skip\footins}{10.8\p@\@plus4\p@\@minus2\p@}
792 %</8pt|9pt|10pt|11pt|12pt|text>
795 % \subsection{Float placement}
797 % First, we determine how we position the floats on the page.
801 \setcounter{topnumber}{2}
802 \renewcommand\topfraction{.7}
803 \setcounter{bottomnumber}{1}
804 \renewcommand\bottomfraction{.3}
805 \setcounter{totalnumber}{3}
806 \renewcommand\textfraction{.1}
807 \renewcommand\floatpagefraction{.8}
808 \setcounter{dbltopnumber}{2}
809 \renewcommand\dbltopfraction{.7}
810 \renewcommand\dblfloatpagefraction{.5}
814 % Now we define the glue which surrounds floats.
817 %<*8pt|9pt|10pt|11pt|12pt>
818 \floatsep12\p@\@plus2\p@\@minus2\p@
819 \textfloatsep20\p@\@plus2\p@\@minus4\p@
820 \dbltextfloatsep20\p@\@plus2\p@\@minus4\p@
821 %<+8pt|9pt|10pt|11pt>\intextsep12\p@\@plus2\p@\@minus 2\p@
822 %<+8pt|9pt|10pt|11pt>\dblfloatsep12\p@\@plus2\p@\@minus 2\p@
823 %<+12pt>\intextsep14\p@\@plus4\p@\@minus 4\p@
824 %<+12pt>\dblfloatsep14\p@\@plus2\p@\@minus 4\p@
827 % We must now define the parameters for float pages and columns.
830 \@fptop0\p@\@plus 1fil
831 %<+8pt|9pt|10pt|11pt>\@fpsep8\p@\@plus2fil
832 %<+12pt>\@fpsep10\p@\@plus2fil
833 \@fpbot0\p@\@plus 1fil
835 \@dblfptop0\p@\@plus 1fil
836 %<+8pt|9pt|10pt|11pt>\@dblfpsep8\p@\@plus 2fil
837 %<+12pt>\@dblfpsep10\p@\@plus2fil
838 \@dblfpbot0\p@\@plus 1fil
839 %</8pt|9pt|10pt|11pt|12pt>
842 % \section{Headers and footers}
844 % This part defines the standard page styles. By default, \strayman\
845 % imports \package{fancyheadings} and uses them, although this section is
846 % retained in case anything actually needs the original \LaTeX-style
852 \let\@oddfoot\@empty\let\@evenfoot\@empty
853 \def\@evenhead{\thepage\hfil\slshape\leftmark}%
854 \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
855 \let\@mkboth\markboth
856 \def\chaptermark##1{\markboth {\thechapter. ##1}{}}%
857 \def\sectionmark##1{\markright {\thesection. ##1}}%
861 \let\@oddfoot\@empty\let\@evenfoot\@empty
862 \def\@evenhead{\thepage\hfil\slshape\leftmark}%
863 \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
864 \let\@mkboth\@gobbletwo
865 \let\chaptermark\@gobble
866 \let\sectionmark\@gobble
872 % \begin{macro}{\maketitle}
873 % This is a bit of a thorny issue at the moment. Really, these titles need
874 % a complete rewrite. The |\maketitle| command will only be used for inside
875 % front covers anyway. I'm wondering if it wouldn't be better just to use
876 % special case code for each individual manual. Until a decision is made,
877 % I'll leave this as it was in \package{book}.
880 % This code is largely uncommented. It seems to be fairly straightforward,
881 % and if I do need to change it, I'll probably start again from scratch
888 \newcommand\maketitle{%
890 \let\footnotesize\small%
891 \let\footnoterule\relax%
900 \begin{tabular}[t]{c}%
906 {\large \@date \par}% % Set date in \large size.
912 \setcounter{footnote}{0}%
914 \let\maketitle\relax%
922 \newcommand\maketitle{%
925 \renewcommand\thefootnote{\fnsymbol{footnote}}%
926 \def\@makefnmark{\hb@xt@\z@{$\m@th^{\@thefnmark}$\hss}}%
927 \long\def\@makefntext##1{%
928 \parindent1em\noindent%
929 \hb@xt@1.8em{\hss$\m@th^{\@thefnmark}$}##1%
932 \ifnum\col@number=\@ne%
935 \twocolumn[\@maketitle]%
939 \global\@topnum\z@% % Prevents figures from going at top of page.
942 \thispagestyle{plain}%
945 \setcounter{footnote}{0}%
947 \let\maketitle\relax%
948 \let\@maketitle\relax%
966 \begin{tabular}[t]{c}%
980 % \begin{environment}{titlepage}
982 % The \env{titlepage} environment typesets its contents on a title page.
983 % The implementation is fairly straightforward: we just need to do some
984 % fiddling with two-column layouts. We also add in some hacking to make
985 % title pages centred properly, a bit like the \env{central} environment.
988 \newenvironment{titlepage}{%
991 \@restonecoltrue\onecolumn%
993 \@restonecolfalse\newpage%
997 \setcounter{page}{0}%
1000 \thispagestyle{empty}%
1010 % \begin{macro}{\centrepage}
1012 % Change the page layout to centre everything properly. We guard against
1013 % this sort of thing happening again by clearing |\leftindent| and
1014 % |\sectindent|. This should only be cleared after the page has been
1015 % finished, for obvious reasons.
1019 \advance\oddsidemargin-\leftindent%
1020 \advance\evensidemargin-\leftindent%
1021 \advance\textwidth\leftindent%
1022 \advance\linewidth\leftindent%
1023 \advance\leftmargini0.5\leftindent%
1031 % \section{Sectioning commands}
1033 % In \strayman, quite a lot of the sectioning is different. We
1034 % don't tend to number sections much. Also, the chapter heading style has
1035 % been completely rewritten (several times).
1037 % \subsection{Setting up the counters}
1039 % This is pretty simple stuff.
1042 \newcommand\chaptermark[1]{}
1043 \setcounter{secnumdepth}{\if@numbering\if@runinsubsubsec2\else3\fi\else0\fi}
1045 \newcounter {chapter}
1046 \newcounter {section}[chapter]
1047 \newcounter {subsection}[section]
1048 \newcounter {subsubsection}[subsection]
1049 \newcounter {paragraph}[subsubsection]
1050 \newcounter {subparagraph}[paragraph]
1051 \renewcommand\thepart {\Roman{part}}
1052 \renewcommand\thechapter {\arabic{chapter}}
1054 \renewcommand\thesection {\arabic{section}}
1056 \renewcommand\thesection {\thechapter.\arabic{section}}
1058 \renewcommand\thesubsection {\thesection.\arabic{subsection}}
1059 \renewcommand\thesubsubsection {\thesubsection .\arabic{subsubsection}}
1060 \renewcommand\theparagraph {\thesubsubsection.\arabic{paragraph}}
1061 \renewcommand\thesubparagraph {\theparagraph.\arabic{subparagraph}}
1064 % \subsection{Frontmatter, mainmatter and backmatter}
1066 % We start off thinking we're in the main matter. The user ought to put a
1067 % |\frontmatter| command at the beginning of the document if this is not
1068 % correct, as it usually won't be.
1072 \newif\if@mainmatter
1074 \newcommand\frontmatter{%
1077 \pagenumbering{roman}%
1079 \newcommand\mainmatter{%
1082 \pagenumbering{arabic}%
1084 \newcommand\backmatter{%
1095 % \subsection{Abstracts}
1097 % \begin{environment}{abstract}
1099 % The \env{abstract} environment reduces the type size and margins slightly.
1100 % Abstracts are placed on their own pages when the |titlepage| option is
1101 % enabled. The code is filched from the LaTeX article class.
1105 \newenvironment{abstract}{%
1108 \@beginparpenalty\@lowpenalty
1110 \bfseries \abstractname
1113 {\par\vfil\null\endtitlepage}
1115 \newenvironment{abstract}{%
1117 \section*{\abstractname}%
1123 \fontseries{b}\fontfamily\headdefault\selectfont%
1126 \labelsep1em\labelwidth\z@\itemindent\labelsep%
1127 \rightmargin\leftmargin%
1129 \item[\abstractname]%
1131 {\if@twocolumn\else\endlist\fi}
1136 % \subsection{Appendices}
1138 % \begin{macro}{\appendix}
1140 % This command sets everything up to typeset the appendix.
1143 \newcommand\appendix{%
1145 \setcounter{chapter}{0}%
1146 \setcounter{section}{0}%
1147 \renewcommand\@chapapp{\appendixname}%
1149 \renewcommand\thesection{\Alph{section}}%
1151 \renewcommand\thechapter{\Alph{chapter}}%
1158 % \subsection{Parts}
1160 % Part headings are typeset on completely unadorned sheets, devoid of page
1161 % numbers and suchlike. Because of the strange page layout, we have to
1162 % put the part heading into a |central| environment. to stop the page looking
1163 % horribly lopsided.
1165 % \begin{macro}{\part}
1167 % The |\part| macro moves to an appropriate page, changes the pagestyle to
1168 % empty to switch off page numbering, and then calls |\@part| or |\@spart|
1169 % as appropriate, according to whether a \lit* was supplied. We put some
1170 % |\vfil| glue in, to vertically centre anything that these commands typeset,
1171 % and ensure printing in a single column.
1176 \if@noskipsec\leavevmode\fi\par%
1179 \secdef\@part\@spart%
1184 \thispagestyle{empty}%
1192 \secdef\@part\@spart%
1197 % \begin{macro}{\@part}
1199 % This is where most of the part heading typesetting is done. We stick a
1200 % line in the contents file, clear the heading markers, and typeset the
1201 % heading in the biggest letters we can find. When we're done, we call
1202 % |\@endpart| to do some common cleaning up.
1207 \ifnum\c@secnumdepth>\m@ne\relax%
1208 \refstepcounter{part}%
1209 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
1211 \addcontentsline{toc}{part}{#1}%
1214 \parindent\z@ \raggedright \interlinepenalty\@M%
1215 \reset@font\bfseries\headfam%
1216 \ifnum\c@secnumdepth>\m@ne%
1217 \Large\partname\nobreakspace\thepart \par\nobreak%
1222 \nobreak \vskip3ex \@afterheading%
1226 \ifnum\c@secnumdepth>-2\relax%
1227 \refstepcounter{part}%
1228 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
1230 \addcontentsline{toc}{part}{#1}%
1235 \interlinepenalty\@M%
1237 \ifnum\c@secnumdepth>-2\relax%
1238 \huge\bfseries\headfam\partname~\thepart%
1242 \normalfont\Huge\bfseries\headfam#2\par%
1249 % \begin{macro}{\@spart}
1251 % Here we typeset just the part heading: numbers have been suppressed. Also
1252 % we don't put things into the contents file. Otherwise, this is similar to
1259 \parindent\z@ \raggedright \interlinepenalty\@M%
1260 \reset@font\bfseries\headfam%
1264 \nobreak \vskip3ex \@afterheading%
1270 \interlinepenalty\@M%
1272 \normalfont\Huge\bfseries\headfam#1\par%
1279 % \begin{macro}{\@endpart}
1281 % This does the clearing up operation after a part has been typeset. We
1282 % insert the other |\vfil| glue to centre the heading, clear the other
1283 % side of the page, if printing two-sided, and return if necessary to
1284 % two-column printing.
1292 \thispagestyle{empty}%
1303 % \subsection{Chapters}
1305 % The chapter typesetting has been more-or-less rewritten. We'll follow this
1306 % in a reasonable amount of detail.
1308 % \begin{macro}{\@chapapp}
1310 % Because |\appendix| needs to change what chapters are called, we add a
1311 % level of indirection through |\@chapapp|:
1314 \newcommand\@chapapp{\chaptername}
1318 % \begin{macro}{\chapter}
1320 % The |\chapter| command is the main dispatcher for chapters. We move to
1321 % an appropriate page, depending on the |openright| setting, suppress
1322 % headers, and then call |\@chapter| or |\@schapter| as appropriate.
1326 \newcommand\chapter{%
1332 \thispagestyle{plain}%
1335 \secdef\@chapter\@schapter%
1340 % \begin{macro}{\@chapter}
1342 % There's a lot of messing about to do, depending on whether we're in the
1343 % main matter and so on. We'll take this carefully.
1346 \def\@chapter[#1]#2{%
1349 % The first thing to do is put a line in the contents table. We need to
1350 % check |secnumdepth| and the |mainmatter| flag for this: we should only
1351 % include a number if both these tests pass. In this case, we also type a
1352 % message on the terminal.
1355 \ifnum\c@secnumdepth>\m@ne%
1357 \refstepcounter{chapter}%
1358 \typeout{\@chapapp\space\thechapter.}%
1359 \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
1361 \addcontentsline{toc}{chapter}{#1}%
1364 \addcontentsline{toc}{chapter}{#1}
1368 % Now we put a bit of space in the lists of figures and tables, and set up
1369 % the mark to put the chapter heading in the running header.
1372 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1373 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1376 % Finally, we need to decide how to typeset the chapter heading. On
1377 % single-column chapters, this is easy. On double-column formats, we need
1378 % to do horrid things with |\@topnewpage|.
1382 \@topnewpage[\@makechapterhead{%
1383 \hb@xt@.5\leftindent{\thechapter\hfil}%
1387 \hb@xt@.5\leftindent{\thechapter\hfil}%
1395 % \begin{macro}{\@makechapterhead}
1397 % This macro actually does the job of typesetting a chapter heading. Call
1398 % this routine as |\@makechapterhead{|\synt{number}|}{|\synt{title}|}|.
1399 % Here, \synt{number} is how to typeset the chapter number, and \synt{title}
1400 % is the rest of the title. To suppress the number, just leave \synt{number}
1401 % empty. The number is only typeset when it is correct to do so anyway.
1403 % The spacing is rather awkward. We have to cope with two-column layouts,
1404 % which seem to require different spacing. In a double-column layout,
1405 % the title is normally one |\baselineskip| too high. Also, the space I
1406 % add at the bottom of the heading gets eaten in double-column chapters,
1407 % because I'm actually typesetting into a vbox which is floated to the top
1408 % by \LaTeX\ in a fairly horrid way. This can't really be worked around,
1409 % so we just make the space beneath the heading equal to |\dbltextfloatsep|,
1410 % which is what gets added anyway.
1412 % The other snags are to do with the rule after the chapter heading.
1413 % Firstly, this is meant to be typeset into the left margin, like the
1414 % heading itself, which is a bit messy. More awkwardly, we have to be
1415 % careful not to let the depth of the line vary when the chapter heading has
1416 % descenders, although obviously we must lower the rule if the heading really
1417 % is very deep indeed.
1420 % We'll approach this a bit at a time.
1423 \def\@makechapterhead#1#2{%
1424 \begingroup% % Stop my hacking messing things up
1427 % First, the top spacing. This is divided into two parts, by an invisible
1428 % rule: the |\vskip| above the rule is eaten by \TeX\ if this is a genuine
1429 % new page, but put into the floating vbox if this is a two-column affair.
1430 % The second bit is added in both cases.
1433 \vskip\baselineskip% % This is gobbled in single column
1434 \hrule\@height\z@% % Stops TeX from binning my vskips
1435 \vskip32\p@% % Start chapters in a funny place
1438 % Now we actually typeset the heading. This is fairly simple: we must just
1439 % check that we need to typeset the number.
1442 \normalfont\Huge\bfseries\headfam% % Choose a nice font for it
1443 \raggedright % Don't justify -- it looks nasty
1444 \@hangfrom{\hskip-\leftindent}% % Start text at `real left margin'
1445 \ifnum\c@secnumdepth>\m@ne% % Do we typeset chapter numbers?
1446 \if@mainmatter% % Are we past the front matter?
1447 #1% % Yes -- then typeset the number
1448 \fi\fi% % Now back to normality
1449 {#2}% % Typeset the actual chapter head
1450 \par\nobreak% % Back to vmode again, please
1453 % The next tricky bit is the space before the ruleoff. We must be careful
1458 % \item We want the rule to be the right depth below the heading baseline,
1459 % regardless of whether the heading contains descenders: helpfully, \TeX\
1460 % omits |\baselineskip| glue before and after rules.
1462 % \item We want the rule to always be below any oddly deep descenders that
1463 % a strange user might throw at us (e.g., horrid fractions or weird
1468 % We accomplish this by scrutinising |\prevdepth| carefully.
1471 \@tempdima14\p@% % Be this low below the baseline
1472 \advance\@tempdima-\prevdepth% % This is the actual skip then
1473 \ifdim\@tempdima<8\p@% % Is this not enough skippage?
1474 \@tempdima8\p@% % No: then skip some more
1476 \vskip\@tempdima% % Skip a bit below the title
1479 % Now we can set the rule. This needs a little care.
1482 \@tempskipa\textwidth% % Find the width of the column
1483 \advance\@tempskipa\leftindent% % Add on the big lefthand gap
1484 \nointerlineskip% % Don't add any more space please
1485 \moveleft\leftindent\vbox{% % Shift something left by an amount
1486 \hrule\@width\@tempskipa% % Typeset the rule nicely
1488 \nointerlineskip% % Don't leave a gap beneath it
1491 % Finally, we leave a gap. In two-column layouts this is done for us, and
1492 % \LaTeX\ gobbles this glue and replaces it with |\dbltextfloatsep|. To make
1493 % things consistent, this is the glue we use anyway.
1496 \nobreak% % This would be a bad place to break
1497 \vspace{\dbltextfloatsep}% % Add in some extra glue beneath
1503 % \begin{macro}{\@makeschapterhead}
1505 % This is now just a veneer onto |\@makechapterhead|. It's needed, because
1506 % other bits of \LaTeX\ call it.
1509 \def\@makeschapterhead{%
1515 % \begin{macro}{\@schapter}
1517 % This macro typesets a starred chapter heading. This is terribly simple,
1518 % compared to the sort of things we've been doing so far.
1523 \@topnewpage[\@makeschapterhead{#1}]%
1525 \@makeschapterhead{#1}%
1533 % \subsection{The other sectioning commands}
1535 % These are all defined through |\@startsection|. They've been modified
1536 % to typeset sections and subsections hanging into the left margin, and to
1537 % moderate the amount of following space, due to the extra |\parskip| already
1541 \def\@defsection#1#2#3#4#5#6{%
1542 \expandafter\newcommand\csname#1\endcsname{%
1543 \skip@#4\advance\skip@\ifdim\skip@<\z@-\fi\@parshortfall%
1544 \skip\tw@#5\relax\ifdim\skip\tw@>\z@\advance\skip\tw@\@parshortfall\fi%
1551 {\reset@font#6\bfseries\headfam}%
1555 {section}% % Section name (for contents)
1556 {1}% % Level number (for numbering)
1557 {-.5\sectindent}% % Indentation of title
1558 {-1.5ex\@plus-1ex\@minus-.2ex}% % Space after title (vert/horiz)
1559 {.3ex\@plus.2ex}% % Space before title
1560 {\reset@font\Large\bfseries\headfam}% How to typeset the title
1565 {-1.25ex\@plus-1ex\@minus-.2ex}%
1567 {\reset@font\large\bfseries\headfam}%
1573 {0pt\@plus1ex\@minus.2ex}%
1575 {\reset@font\normalsize\bfseries\headfam}%
1580 {0pt\@plus.5ex\@minus.1ex}%
1582 {\reset@font\normalsize\bfseries\headfam}%
1587 {0pt\@plus.5ex\@minus.1ex}%
1589 {\reset@font\normalsize\bfseries\headfam}%
1595 {-1.25ex\@plus-1ex\@minus-.2ex}%
1597 {\reset@font\normalsize\bfseries\headfam}%
1602 {0pt\@plus1ex\@minus.2ex}%
1604 {\reset@font\normalsize\bfseries\headfam}%
1609 {0pt\@plus.5ex\@minus.1ex}%
1611 {\reset@font\normalsize\bfseries\headfam}%
1615 % \subsection{Section number formatting}
1617 % \begin{macro}{\@seccntformat}
1619 % The macro is given a section counter and must format it in some nice way.
1622 \def\@seccntformat#1{%
1623 \llap{\csname the#1\endcsname{\normalsize\quad}\hfil}%
1626 % \subsection{Top level sectioning}
1628 % \begin{macro}{\@topsect}
1630 % Articles are divided into sections; other documents are divided into
1631 % chapters. Things like the table of contents need to know which.
1635 \def\@topsect@star{\section*}
1636 \let\@topsect\section
1638 \let\@topsect@star\chapter
1639 \let\@topsect\chapter
1646 % \section{List handling}
1648 % A surprising number of \LaTeX's environments are defined in terms of
1649 % lists, many of which hide the fact by putting the entire text in one big
1652 % This part of the document class has to set up lots of list parameters.
1653 % This is largely the same as the standard classes, altered slightly to cope
1654 % with the different paragraph spacing.
1656 % \subsection{General list parameters}
1658 % Default left margins for lists:
1667 \leftmarginiii1.87em
1677 % And now we can set the paragraph indent.
1686 % Other spacing defaults:
1689 \leftmargin\leftmargini
1691 \labelwidth\leftmargini
1692 \advance\labelwidth-\labelsep
1693 \partopsep\z@\@plus1\p@\@minus1\p@
1696 % Interline penalties:
1699 \@beginparpenalty -\@lowpenalty
1700 \@endparpenalty -\@lowpenalty
1701 \@itempenalty -\@lowpenalty
1704 % Now we define the defaults for the list environments. These have managed
1705 % to migrate from the size options into the main document class.
1709 \ifvmode\else\@beginparpenalty\@M\fi%
1710 \leftmargin\leftmargini%
1712 \topsep\@parshortfall%
1718 \ifvmode\else\@beginparpenalty\@M\fi%
1719 \topsep\z@\@plus\p@%
1720 \leftmargin\leftmarginii%
1721 \labelwidth\leftmarginii%
1722 \advance\labelwidth-\labelsep%
1725 \ifvmode\else\@beginparpenalty\@M\fi%
1726 \leftmargin\leftmarginiii%
1727 \labelwidth\leftmarginiii%
1728 \advance\labelwidth-\labelsep%
1729 % \partopsep\p@\@plus\z@\@minus\p@%
1732 \ifvmode\else\@beginparpenalty\@M\fi%
1733 \leftmargin\leftmarginiv%
1734 \labelwidth\leftmarginiv%
1735 \advance\labelwidth-\labelsep%
1738 \ifvmode\else\@beginparpenalty\@M\fi%
1739 \leftmargin\leftmarginv%
1740 \labelwidth\leftmarginv%
1741 \advance\labelwidth-\labelsep%
1744 \ifvmode\else\@beginparpenalty\@M\fi%
1745 \leftmargin\leftmarginvi%
1746 \labelwidth\leftmarginvi%
1747 \advance\labelwidth-\labelsep%
1751 % \subsection{Numbering things}
1753 % \begin{macro}{\numberwithin}
1755 % Does the obvious thing. Optional argument gives numbering style.
1758 \def\numberwithin{\@testopt\nw@i\arabic}
1760 \@addtoreset{#2}{#3}%
1761 \expandafter\xdef\csname the#2\endcsname{%
1762 \expandafter\noexpand\csname the#3\endcsname.%
1769 % \begin{macro}{\removefromreset}
1771 % Does the obvious thing.
1774 \def\removefromreset#1#2{%
1781 \else\toks@\expandafter{\the\toks@\@elt{##1}}%
1784 \csname cl@#2\endcsname%
1785 \expandafter\xdef\csname cl@#2\endcsname{\the\toks@}%
1792 % \subsection{Enumerated lists}
1794 % We busily redefine all the counters for enumerated lists, and how to
1797 % How to typeset the numbers:
1800 \renewcommand\theenumi{\arabic{enumi}}
1801 \renewcommand\theenumii{\alph{enumii}}
1802 \renewcommand\theenumiii{\roman{enumiii}}
1803 \renewcommand\theenumiv{\Alph{enumiv}}
1806 % Typesetting the item labels:
1809 \newcommand\labelenumi{\theenumi.}
1810 \newcommand\labelenumii{(\theenumii)}
1811 \newcommand\labelenumiii{\theenumiii.}
1812 \newcommand\labelenumiv{\theenumiv.}
1815 % And finally how to typeset references to the items:
1818 \renewcommand\p@enumii{\theenumi}
1819 \renewcommand\p@enumiii{\theenumi(\theenumii)}
1820 \renewcommand\p@enumiv{\p@enumiii\theenumiii}
1823 % \subsection{Itemized lists}
1825 % We set up the various bullet shapes for the itemized lists.
1828 \newcommand\labelitemi{$\m@th\bullet$}
1829 \newcommand\labelitemii{\normalfont\bfseries --}
1830 \newcommand\labelitemiii{$\m@th\ast$}
1831 \newcommand\labelitemiv{$\m@th\cdot$}
1834 % \subsection{Description lists}
1836 % This has been redefined a little to make it more sensible. The old version
1837 % had a weird |\hspace\labelsep| in the labelling macro. This has now been
1838 % added into the main list definition. You can now redefine
1839 % |\descriptionlabel| without fear of messing up the spacing.
1841 % \begin{environment}{description}
1843 % Here we set up the main list parameters. The label width is zeroed to
1844 % ensure that the text is always indented nicely.
1850 \itemindent-\leftmargin%
1851 \advance\itemindent\labelsep%
1852 \def\makelabel{\descriptionlabel}%
1855 \let\enddescription\endlist
1858 % \begin{macro}{\descriptionlabel}
1860 % This typesets a description label. Redefine it the obvious way for
1861 % different exciting effects.
1864 \def\descriptionlabel#1{\normalfont\bfseries #1}
1870 % \subsection{Other list-based environments}
1872 % Several other standard environments are defined in terms of lists. These
1873 % are all dealt with here.
1875 % \begin{environment}{verse}
1877 % The \env{verse} environment is specially fiddled so that |\\| works as it
1878 % should. There's nothing else exciting about it.
1881 \newenvironment{verse}{%
1886 \listparindent\itemindent%
1887 \rightmargin\leftmargin%
1888 \advance\leftmargin1.5em%
1897 % \begin{environment}{quotation}
1899 % The \env{quotation} environment is a pretty standard display, except that
1900 % we kill off inter-paragraph space. The current definition means that
1901 % \env{quotation}s are typeset in normal indented-paragraph style, which
1902 % is inconsistent with the rest of the document style.
1905 \newenvironment{quotation}{%
1908 \itemindent\listparindent%
1909 \rightmargin\leftmargin%
1918 % \begin{environment}{quote}
1920 % This is even simpler. We just pull in the right margin a bit.
1923 \newenvironment{quote}{%
1925 \rightmargin\leftmargin%
1934 % \begin{environment}{display}
1936 % The \env{display} environment is intended for any other displays which you
1937 % need to typeset. This is \emph{not} a standard environment.
1940 \newenvironment{display}{%
1943 \rightmargin\leftmargin%
1954 % And some quick hacking of the theorem environment.
1956 % \section{Other parameters}
1958 % We define some miscellaneous parameters for standard environments.
1963 \arrayrulewidth.4\p@
1965 \tabbingsep\labelsep
1966 \skip\@mpfootins\skip\footins
1971 \renewcommand\theequation{\arabic{equation}}
1973 \@addtoreset{equation}{chapter}
1974 \renewcommand\theequation{\thechapter.\arabic{equation}}
1980 % Since raw \LaTeX\ doesn't actually define any floating objects, we have
1981 % to do some of the work here. This isn't actually terribly arduous. For
1982 % a float called \synt{float}, we have to define the following macros:
1984 % \begin{description}
1985 % \let\descriptionlabel\relax
1987 % \item[\texttt{\bslash fps@}\synt{float}] is the default float positioning
1988 % argument for the float type.
1990 % \item[\texttt{\bslash ftype@}\synt{float}] is a flag bit for the float
1991 % type. This is used in \LaTeX's |\output| routine to identify floats of
1994 % \item[\texttt{\bslash ext@}\synt{float}] is the file extension for the
1995 % list of these floats (e.g., \lit{lof} for figures).
1997 % \item[\texttt{\bslash fnum@}\synt{float}] is a macro which generates the
1998 % caption number. For figures, this expands to `|Figure~\thefigure|'.
2002 % We must also define |\@makecaption|, which typesets a float caption in
2003 % an appropriate way, and an environment for each type of float.
2005 % \subsection{Figures}
2007 % This is all fairly straightforward stuff. First, we create a counter for
2011 \newcounter{figure}[chapter]
2013 \renewcommand\thefigure{\@arabic\c@figure}
2015 \renewcommand\thefigure{\thechapter.\@arabic\c@figure}
2019 % Now we define all the macros \LaTeX\ requires.
2022 \if@herefloats\def\fps@figure{htbp}\else\def\fps@figure{tbp}\fi
2023 \def\ftype@figure{1}
2024 \def\ext@figure{lof}
2025 \def\fnum@figure{\figurename~\thefigure}
2028 % \begin{environment}{figure}
2029 % \begin{environment}{figure*}
2031 % Finally, we create the \env{figure} and \env{figure$*$} environments.
2034 \newenvironment{figure}{\@float{figure}}{\end@float}
2035 \newenvironment{figure*}{\@dblfloat{figure}}{\end@dblfloat}
2040 % \subsection{Tables}
2042 % This is pretty similar to the figure handling.
2045 \newcounter{table}[chapter]
2047 \renewcommand\thetable{\@arabic\c@table}
2049 \renewcommand\thetable{\thechapter.\@arabic\c@table}
2052 \if@herefloats\def\fps@table{htbp}\else\def\fps@table{tbp}\fi
2055 \def\fnum@table{\tablename~\thetable}
2057 \newenvironment{table}{\@float{table}}{\end@float}
2058 \newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat}
2061 % \subsection{Other float parameters}
2063 % \begin{macro}{\@makecaption}
2065 % The |\@makecaption| macro is called to display a float caption. It will
2066 % typeset its argument either centred in a box, if it is short enough, or
2067 % in a paragraph if it is longer than a line.
2070 \newlength\abovecaptionskip
2071 \newlength\belowcaptionskip
2072 \abovecaptionskip10\p@
2073 \belowcaptionskip0\p@
2075 \long\def\captionstyle#1#2{\itshape #1: #2}
2076 \long\def\@makecaption#1#2{%
2077 \vskip\abovecaptionskip%
2078 \sbox\@tempboxa{\captionstyle{#1}{#2}}%
2079 \ifdim\wd\@tempboxa>\hsize%
2080 \unhbox\@tempboxa\par%
2082 \hb@xt@\hsize{\hfil\unhbox\@tempboxa\hfil}%
2084 \vskip\belowcaptionskip%
2089 % \section{Font commands}
2091 % We allow the `old' font commands to do sensible \textsf{NFSS} things, since
2092 % we don't have any legacy documents. This means that we have proper
2093 % abbreviations for font changes. We also add |\nm| to return to a normal
2094 % font, whatever that may mean.
2097 \DeclareOldFontCommand{\rm}{\rmfamily}{\mathrm}
2098 \DeclareOldFontCommand{\sf}{\sffamily}{\mathsf}
2099 \DeclareOldFontCommand{\tt}{\ttfamily}{\mathtt}
2100 \DeclareOldFontCommand{\bf}{\bfseries}{\mathbf}
2101 \DeclareOldFontCommand{\md}{\mdseries}{\@nomath\md}
2102 \DeclareOldFontCommand{\it}{\itshape}{\mathit}
2103 \DeclareOldFontCommand{\up}{\upshape}{\@nomath\up}
2104 \DeclareOldFontCommand{\sl}{\slshape}{\@nomath\sl}
2105 \DeclareOldFontCommand{\sc}{\scshape}{\@nomath\sc}
2106 \DeclareOldFontCommand{\nm}{\normalfont}{\mathnormal}
2109 % Now we define some special commands which only work in maths mode. It
2110 % seems that older versions of \LaTeX\ (in particular, that at Warwick
2111 % University) don't define these commands initially, so we'd better not
2112 % use |\renewcommand| after all. We also dispose of lots of messing with
2113 % |\protect| by using |\DeclareRobustCommand|.
2116 \DeclareRobustCommand\cal{\@fontswitch{\relax}{\mathcal}}
2117 \DeclareRobustCommand\pmit{\@fontswitch{\relax}{\mathnormal}}
2120 % \section{Tables of contents}
2122 % This section deals with tables of contents, and lists of figures.
2124 % \subsection{Contents}
2126 % First, we have to define some parameters.
2129 \newcommand\@pnumwidth{2em}
2130 \newcommand\@tocrmarg {3em}
2131 \newcommand\@dotsep{4.5}
2132 \setcounter{tocdepth}{\if@runinsubsubsec1\else2\fi}
2135 % \begin{macro}{\tableofcontents}
2137 % This is the main command for setting up tables of contents. We ensure
2138 % a single-page layout, put in the chapter heading, read in the contents
2139 % file, and then restore the old layout.
2142 \def\@tocthing#1#2{%
2143 \@ifnextchar[{\@tocthing@i{#1}{#2}}{\@tocthing@i{#1}{#2}[\relax][\relax]}%
2145 \def\@tocthing@i#1#2[#3][#4]{%
2146 \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi%
2147 \@topsect@star{#1}#3{\parskip\z@\@starttoc{#2}}#4%
2148 \if@restonecol\twocolumn\fi%
2150 \newcommand\tableofcontents{\@tocthing\contentsname{toc}}
2154 % Each section type \synt{type} is typeset by a command |\l@|\synt{type}:
2155 % for example, the |\l@chapter| command typesets the entry for a chapter
2158 % \begin{macro}{\l@part}
2160 % This command is vaguely interesting. We'll explore in detail.
2166 % We don't typeset the entry if |tocdepth| tells us not to. What kind of
2167 % stupid user is going to disable \emph{all} the contents items.
2170 \ifnum\c@tocdepth>-2\relax%
2173 % Before we start, we try to break above the title. Later, we'll disable
2174 % breaking afterwards. We then leave some vertical space.
2177 \addpenalty{-\@highpenalty}%
2178 \addvspace{2.25em\@plus\p@}%
2181 % We open a group, to avoid messing other things up. The |\numberline|
2182 % macro, which numbers the entry on the left, typesets its argument in a box
2183 % of width |\@tempdima|, which we must set up. We then set up the values
2184 % of |\rightskip| and |\parfillskip| to avoid printing over the page number.
2185 % We also make |\interlinepenalty| infinite to suppress breaking pages in
2186 % the middle of the title.
2192 \rightskip\@pnumwidth%
2193 \parfillskip-\@pnumwidth%
2194 \interlinepenalty\@M
2197 % Time to typeset the actual title. This is fairly simple, apart from
2198 % a complicated mixture of glue and penalties, which handles a line break
2199 % right at the end of the title.
2204 \large\bfseries {#1}%
2205 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak\hfil%
2206 \hb@xt@\@pnumwidth{\hss #2}%
2210 % Now we end the paragraph and suppress page breaking here.
2215 \global\@nobreaktrue%
2216 \everypar{\global\@nobreakfalse\everypar{}}%
2223 % \begin{macro}{\@artsw}
2225 % Define a macro named after the first or second argument depending on
2226 % whether the document is an article.
2230 \edef\@tempa{#1\if@article\noexpand#3\else\noexpand#2\fi}%
2237 % \begin{macro}{\l@chapter}
2239 % This is terribly similar to the previous macro.
2242 \@artsw\def\l@chapter\l@section#1#2{%
2243 \ifnum\c@tocdepth >\m@ne%
2244 \addpenalty{-\@highpenalty}%
2245 \vskip1.0em\@plus\p@%
2246 \setlength\@tempdima{2em}%
2248 \interlinepenalty\@M
2250 \rightskip\@pnumwidth%
2251 \parfillskip-\@pnumwidth%
2254 \advance\leftskip\@tempdima%
2257 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak\hfil%
2258 \hb@xt@\@pnumwidth{\hss #2}%
2260 \penalty\@highpenalty%
2267 % The other types are all defined in terms of |\@dottedtocline|, which is
2271 \@artsw\def\l@section\l@subsection{\@dottedtocline{1}{2em}{2.5em}}
2272 \@artsw\def\l@subsection\l@subsubsection{\@dottedtocline{2}{4.5em}{3.2em}}
2273 \@artsw\def\l@subsubsection\l@paragraph{\@dottedtocline{3}{7.7em}{4.1em}}
2274 \@artsw\def\l@paragraph\l@subparagraph{\@dottedtocline{4}{10.5em}{5em}}
2275 \@artsw\def\l@subparagraph\@tempa{\@dottedtocline{5}{12.5em}{6em}}
2278 % \begin{macro}{\@dottedtocline}
2280 % This is actually a part of the \LaTeX\ kernel, although it's not quite
2281 % right the way it is. We've improved the handling of line breaks after the
2285 \def\@dottedtocline#1#2#3#4#5{%
2288 % We have to make sure that we're meant to typeset this contents entry.
2291 \ifnum#1>\c@tocdepth\else%
2294 % Now we add in a little stretchy space.
2297 \vskip\z@\@plus.2\p@%
2300 % Set up the paragraph layout now. We forbid page breaks in the middle of
2306 \rightskip\@tocrmarg%
2307 \parfillskip-\rightskip%
2310 \interlinepenalty\@M%
2313 % Now we typeset the actual title.
2318 \advance\leftskip\@tempdima%
2324 % This is the clever bit. After the actual title, we add the following
2329 % \item A |\nobreak| penalty, to stop a break from eating the glue.
2331 % \item A glob of |\hfil| glue. If there's a line break after this glue,
2332 % the title is set flush left as a result of this. Otherwise, it is ignored
2333 % because the leaders are |\hfill|.
2335 % \item A penalty. This is a reasonable place to break the line if
2338 % \item An empty |\hbox|. This stops the following glue from being discarded
2339 % at the beginning of a new line.
2341 % \item Another |\nobreak|, which stops a break at the following glue item.
2343 % \item The dotted |\leaders|, which have |\hfill| stretchiness. This forces
2344 % the page number to be flush right.
2348 % The net result of all this is we can now cope with a line break at the
2349 % end of the title, before the page number, which means that the dots are
2350 % put on the next line. The original \LaTeX\ version forced the last word
2351 % of the title onto the next line as well, which can cause underful boxes.
2354 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak%
2355 \leaders\hbox{$\m@th\mkern\@dotsep mu.\mkern\@dotsep mu$}\hfill%
2356 \hb@xt@\@pnumwidth{\hfil\reset@font\rmfamily#5}\par%
2363 % \subsection{Lists of figures and tables}
2365 % These macros are terribly similar to the other ones.
2368 \newcommand\listoffigures{\@tocthing\listfigurename{lof}}
2369 \newcommand\l@figure{\@dottedtocline{0}{0pt}{2em}}
2370 \newcommand\listoftables{\@tocthing\listtablename{lot}}
2371 \let\l@table\l@figure
2374 % \section{Bibliography}
2376 % This isn't actually terribly interesting.
2378 % \begin{environment}{thebibliography}
2384 \newenvironment{thebibliography}[1]{%
2386 \list{\@biblabel{\arabic{enumiv}}}%
2387 {\settowidth\labelwidth{\@biblabel{#1}}%
2388 \leftmargin\labelwidth%
2389 \advance\leftmargin\labelsep%
2391 \advance\leftmargin\bibindent%
2392 \itemindent-\bibindent%
2393 \listparindent\itemindent%
2396 \usecounter{enumiv}%
2397 \let\p@enumiv\@empty%
2398 \renewcommand\theenumiv{\arabic{enumiv}}}%
2400 \renewcommand\newblock{\par}%
2402 \renewcommand\newblock{\hskip.11em\@plus.33em\@minus.07em}%
2409 \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
2413 \newcommand\newblock{}
2419 % Defines the \env{theindex} environment.
2421 % \begin{environment}{theindex}
2423 % The macros are fairly simple. We change to a two column layout, and
2424 % redefine |\item| appropriately.
2427 \newenvironment{theindex}{%
2430 \@topsect\indexname%
2432 \begin{multicols}{2}%
2434 \parskip\z@\@plus.3\p@\relax%
2445 % Now we define the item and spacing macros.
2448 \newcommand\@idxitem {\par\hangindent 40\p@}
2449 \newcommand\subitem {\par\hangindent 40\p@ \hspace*{20\p@}}
2450 \newcommand\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
2451 \newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
2454 % \begin{macro}{\passim}
2456 % The |passim| encapsulator is used to typeset the word `\textit{passim}'
2457 % after a page range.
2460 \def\passim#1{#1 \textit{passim}} % Passim encapsulator for indices
2464 % Other useful commands for indexing:
2466 % \begin{description*}
2467 % \def\descriptionlabel#1{\ttfamily \bslash #1}
2469 % \item[Term] typesets its argument in italics, and adds it to the index.
2471 % \item[term] typesets its first argument in italics, and adds its second
2474 % \item[Index] typesets its argument normally, and adds it to the index.
2476 % \end{description*}
2479 \def\Term#1{\emph{#1}\index{#1}}
2480 \def\term#1{\emph{#1}\index}
2481 \def\Index#1{#1\index{#1}}
2484 % \section{Footnotes}
2486 % \begin{macro}{\footnoterule}
2488 % This macro typesets the rule above footnotes. This is a bit more complex
2489 % than the default: we try and typeset the rule to be at most 1\,in wide,
2490 % although if the column isn't wide enough, we use $4\over10$~of the
2491 % box width instead.
2495 \@tempdima.4\columnwidth%
2496 \ifdim\@tempdima>1in\relax%
2497 \@tempdima1in\relax%
2500 \hrule\@width\@tempdima%
2506 % We number footnotes within chapters:
2509 \@addtoreset{footnote}{chapter}
2512 % \begin{macro}{\@makefntext}
2514 % This is the macro which actually typesets a footnote. This is rather
2515 % complicated. It's based on example code from \file{classes.dtx} which
2516 % doesn't actually work properly.
2519 \long\def\@makefntext#1{%
2522 % First, we redefine |\par| to set up the correct paragraph shape. This
2523 % is indented from the left margin by a small amount.
2529 \advance\@tempdima-1.6em%
2530 \parshape\@ne1.6em\@tempdima%
2534 % Now we set up some parameters so that \env{list} environments work properly
2535 % within the footnote. We also clear |\parindent| to prevent nasty
2536 % indentation. The |\par| sets up the paragraph shape for the next
2537 % paragraph: we're in vertical mode already, so it does nothing else.
2540 \advance\linewidth-1.6em%
2541 \advance\@totalleftmargin1.6em%
2546 % We leave vertical mode to stop the hbox created by |\llap| from being
2547 % stacked vertically. Then we typeset the footnote mark, and put in the
2548 % main text. Finally we leave some space afterwards, to space out the next
2553 \llap{\@makefnmark\enspace}#1\par%
2559 % \begin{macro}{\@makecol}
2561 % The standard \LaTeX\ output routine messes up footnotes a bit, in my
2565 % \item If a page is cut off short, because the next item won't fit (e.g.,
2566 % a section heading), then footnotes are added right below the end
2567 % of the text, which can look strange.
2569 % \item Footnotes are displayed \emph{above} floats at the bottom of a page,
2570 % which also looks strange.
2572 % \item The |\@makefntext| routine above needs to add vertical space between
2573 % footnotes, but this leaves a gap at the very bottom. We remove this
2574 % gap with an |\unskip|.
2580 \setbox\@outputbox \box\@cclv
2581 \xdef\@freelist{\@freelist\@midlist}%
2582 \global \let \@midlist \@empty
2584 \ifvoid\footins \else
2585 \setbox\@outputbox \vbox {%
2586 \boxmaxdepth \@maxdepth
2588 \vskip \skip\footins
2598 \setbox\@outputbox \vbox to\@colht {%
2600 \dimen@ \dp\@outputbox
2606 \global \maxdepth \@maxdepth
2611 % \section{Tidying up}
2613 % This section gathers together various other useful bits of standard
2614 % document class setting.
2616 % \subsection{Item names}
2618 % These commands typeset bits of text. They can then be redefined by
2619 % \package{babel} and suchlike.
2622 \newcommand\contentsname{Contents}
2623 \newcommand\listfigurename{List of figures}
2624 \newcommand\listtablename{List of tables}
2625 \if@article\newcommand\bibname{References}
2626 \else\newcommand\bibname{Bibliography}\fi
2627 \newcommand\indexname{Index}
2628 \newcommand\figurename{Figure}
2629 \newcommand\tablename{Table}
2630 \newcommand\partname{Part}
2631 \newcommand\abstractname{Abstract}
2632 \newcommand\chaptername{Chapter}
2633 \newcommand\appendixname{Appendix}
2634 \newcommand\today{\number\day\space\ifcase\month\or
2635 January\or February\or March\or April\or May\or June\or
2636 July\or August\or September\or October\or November\or December\fi
2640 % \subsection{Final fiddling for two columns}
2645 \pagestyle{headings}
2646 \pagenumbering{arabic} % Arabic page numbers
2656 % \section{The \protect\env{central} environment}
2658 % Because of the strange layout of the pages, text which is centred using
2659 % normal \LaTeX\ commands is centred in the text area, not on the page,
2660 % which is undesirable for large headings, like part headings.
2662 % \begin{environment}{central}
2664 % The \env{central} environment typesets its contents centrally on the page.
2665 % It should only be used from outer vertical mode.
2667 % The code just creates a box of the appropriate size and moves it into the
2671 \newenvironment{central}{%
2673 \vbox\bgroup\moveleft\leftindent\vbox\bgroup%
2674 \textwidth\paperwidth%
2675 \advance\textwidth-2\pagesurround\relax%
2677 \hrule\@height\z@\@depth\z@\@width\hsize%
2685 % \section{Headers and footers}
2687 % The \strayman\ class uses \package{fancyheadings} for its headers
2688 % and footers. This has already been included in the preamble. We now
2689 % need to fix a few problems with \package{fancyheadings} and set up some
2692 % \begin{macro}{\title}
2694 % We extend |\title|, and give it an optional argument. It can now specify
2695 % the document title as used by |\maketitle| and the running title for the
2696 % header separately.
2698 % We store the running header in the macro |\@headertitle|, which is
2705 % Now we define the |\title| macro, using |\@dblarg| to duplicate the
2706 % mandatory argument if the optional one is omitted.
2709 \def\title{\@dblarg\title@i}
2710 \def\title@i[#1]#2{%
2712 \gdef\@headertitle{#1}%
2717 % \begin{macro}{\innerhead}
2718 % \begin{macro}{\innerfoot}
2720 % We allow the user to specify an `inner heading' which is displayed on the
2721 % inside of the header on of each page. This can be used for security
2722 % classifications, for example. Any \package{fancyheadings} commands can
2723 % be used to control the header, which is expanded on each page.
2730 \def\innerhead{\@dblarg\innerhead@i}
2731 \def\innerhead@i[#1]#2{%
2732 \def\l@innerhead{#1}%
2733 \def\r@innerhead{#2}%
2735 \def\innerfoot{\@dblarg\innerfoot@i}
2736 \def\innerfoot@i[#1]#2{%
2737 \def\l@innerfoot{#1}%
2738 \def\r@innerfoot{#2}%
2744 % The next step is to set up the headings:
2747 \let\headrulewidth\z@
2748 \headwidth\textwidth
2749 \advance\headwidth\leftindent
2750 \fancyhfoffset[LE,LO]{\leftindent}
2751 \fancypagestyle{headings}{%
2753 \fancyhead[LE]{\bfseries\@headertitle}
2754 \if@article\fancyhead[RO]{\rightmark}\else\fancyhead[RO]{\leftmark}\fi
2755 \fancyhead[RE]{\l@innerhead} \fancyhead[LO]{\r@innerhead}
2756 \fancyfoot[RE]{\l@innerfoot} \fancyfoot[LO]{\r@innerfoot}
2757 \fancyfoot[LE,RO]{\thepage}
2759 \fancypagestyle{plain}{%
2761 \fancyfoot[RE]{\l@innerfoot} \fancyfoot[LO]{\r@innerfoot}
2762 \fancyfoot[LE,RO]{\thepage}%
2764 \let\ps@fancy\ps@@fancy
2767 % The \package{fancyheadings} package by default expects pages to be
2768 % symmetrical. We have to redefine the |\ps@fancy| macro to make it
2772 \def\@lodd{\ifodd\c@page\hss\else\relax\fi}
2773 \def\@rodd{\ifodd\c@page\relax\else\hss\fi}
2776 % Finally, we can choose the page style we want:
2779 \pagestyle{headings}
2782 % \section{Parbox alteration}
2784 % The standard \LaTeX\ |\parbox| command, and the \env{minipage} environment,
2785 % reset |\parskip| to zero, which is inconsistent with the document style.
2786 % We amend |\@arrayparboxrestore|, the macro which sets up the paragraph
2787 % style for parboxes.
2789 % First, we define a macro explaining how the parbox should set the spacing.
2792 \def\parboxparskip{2ex}
2795 % Next, we redefine the macro. This is taken directly from the \LaTeXe
2799 \def\@arrayparboxrestore{%
2802 \let\'\@acci\let\`\@accii\let\=\@acciii
2803 \parindent\z@ \parskip\z@
2804 \everypar{\parskip\parboxparskip\everypar{}}%
2806 \@totalleftmargin\z@
2807 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
2808 \parfillskip\@flushglue \lineskip\normallineskip
2809 \baselineskip\normalbaselineskip
2810 \@noskipsectrue% % The comp.text.tex gurus said it should be
2815 % \section{Other features}
2817 % At the end is a miscellany of useful features.
2819 % \subsection{Other typesetting conventions}
2821 % Some items need typesetting in particular ways.
2826 \def\submenu{\ensuremath\Rightarrow}
2828 \def\file#1{\mbox{\itshape #1\/}}
2831 % \subsection{And finally}
2836 \def\riscos{RISC~OS}