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,times,cmtt]{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.
142 % \item [\texttt{helvetica}] Typeset headings in the Helvetica font,
143 % not in Computer Modern.
145 % \item [\texttt{palatino}] Typeset the main body text in Palatino, and
146 % headings in Helvetica. The |\tt| font is changed to Courier, but
147 % see the \texttt{cmtt} option.
149 % \item [\texttt{times}] Typeset the main body text in Times, and headings
150 % in Helvetica. The |\tt| font is changed to Courier, but see the
151 % \texttt{cmtt} option.
156 % \section{The \texttt{text} option}
158 % In order to facilitate creation of attractively formatted text files
159 % from \LaTeX\ documents, \strayman\ provides a |text| option. This will
160 % set up \emph{all} the fonts to be monospaced, in the same size. The page
161 % size is set up to be a multiple of the character size. The command
163 % "dvi2tty -e-17" <filename>
165 % appears to produce a reasonable output from a DVI file created in this
166 % way. The output will need to be formatted and corrected slightly by hand
167 % although there's a good deal less work to do than might be required
171 % \section{That's it}
173 % That's all I'm writing for now. It's a document class. It defines the
174 % style. What more do you expect?
179 % \chapter{Implementation}
181 % \section{Options handling}
183 % From here on, a lot of the code is shamelessly borrowed from
184 % \file{book.cls} and other places. This is what code re-use is for.
186 % This bit handles all the options on the |\documentclass| command, either
187 % altering our own internal arguments, or loading other packages as
190 % \subsection{Set up some defaults}
192 % We create some variables to hold the settings, and initialise them to
197 \newcommand\@ptsize{}
198 \newif\if@restonecol\@restonecolfalse
199 \newif\if@titlepage\@titlepagetrue
200 \newif\if@openright\@openrighttrue
201 \newif\if@openbib\@openbibfalse
202 \newif\if@appendix\@appendixfalse
203 \newif\if@article\@articlefalse
204 \newif\if@offsetpages\@offsetpagestrue
205 \newif\if@numbering\@numberingfalse
206 \newif\if@herefloats\@herefloatstrue
207 \newif\if@runinsubsubsec\@runinsubsubsecfalse
209 \newdimen\pagesurround
210 \let\headfam\rmfamily
211 \let\pad@margin\@empty
214 \expandafter\def\expandafter\@delayed\expandafter{\@delayed#1}%
218 % \subsection{Declare the options we support}
220 % This is just a tedious list of all the options.
223 \DeclareOption{a4paper}{%
228 \DeclareOption{a5paper}{%
233 \DeclareOption{b5paper}{%
238 \DeclareOption{letterpaper}{%
243 \DeclareOption{legalpaper}{%
248 \DeclareOption{executivepaper}{%
253 \DeclareOption{landscape}{%
254 \@tempdima\paperheight%
255 \paperheight\paperwidth%
256 \paperwidth\@tempdima%
258 \DeclareOption{8pt}{\renewcommand\@ptsize{8pt}}
259 \DeclareOption{9pt}{\renewcommand\@ptsize{9pt}}
260 \DeclareOption{10pt}{\renewcommand\@ptsize{10pt}}
261 \DeclareOption{11pt}{\renewcommand\@ptsize{11pt}}
262 \DeclareOption{12pt}{\renewcommand\@ptsize{12pt}}
263 \DeclareOption{text}{%
264 \renewcommand\@ptsize{text}%
265 \setbox\z@\hbox{\texttt{M\strut}}%
266 \newdimen\tt@chw\tt@chw\wd\z@%
267 \newdimen\tt@chh\tt@chh\ht\z@\advance\tt@chh\dp\z@%
268 \paperwidth77\tt@chw%
269 \paperheight60\tt@chh%
273 \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
274 \DeclareOption{twoside}{\@twosidetrue \@mparswitchfalse \reversemarginpar}
275 \DeclareOption{draft}{\overfullrule5\p@}
276 \DeclareOption{final}{\overfullrule\z@}
277 \DeclareOption{titlepage}{\@titlepagetrue}
278 \DeclareOption{notitlepage}{\@titlepagefalse}
279 \DeclareOption{openright}{\@openrighttrue}
280 \DeclareOption{openany}{\@openrightfalse}
281 \DeclareOption{onecolumn}{\@twocolumnfalse}
282 \DeclareOption{twocolumn}{\@twocolumntrue}
283 \DeclareOption{offsetpages}{\@offsetpagestrue}
284 \DeclareOption{nooffsetpages}{\@offsetpagesfalse}
285 \DeclareOption{herefloats}{\@herefloatstrue}
286 \DeclareOption{noherefloats}{\@herefloatsfalse}
287 \DeclareOption{leqno}{\input{leqno.clo}}
288 \DeclareOption{fleqn}{\input{fleqn.clo}}
289 \DeclareOption{openbib}{\@openbibtrue}
290 \DeclareOption{article}{\@articletrue}
291 \DeclareOption{numbering}{\@numberingtrue}
292 \DeclareOption{nonumbering}{\@numberingfalse}
293 \DeclareOption{runinsubsubsec}{\@runinsubsubsectrue}
294 \DeclareOption{noruninsubsubsec}{\@runinsubsubsecfalse}
295 \DeclareOption{indentpar}{\@indentpartrue}
296 \DeclareOption{noindentpar}{\@indentparfalse}
299 % \subsection{Set up the options}
301 % We set up some default options, and then read the user's.
304 \ExecuteOptions{a5paper,8pt,twoside,onecolumn,final,openright}
308 % If this is PDF\TeX\ then tell it the page bounds.
311 \@ifundefined{pdfpageheight}{
314 \pdfpageheight\paperheight
315 \pdfpagewidth\paperwidth
319 % \subsection{Read in the text size option}
321 % The text sizing is rather messy. We store this in a separate file. To
322 % keep this stuff away from other classes, we use the file \emph{extension}
323 % as the size specifier, rather than the filename, which is the normal
324 % \LaTeX\ way of doing this. This is a \riscos\ thing mainly: I don't like
325 % loads of directories cluttering up my disk, and it means that I can move
326 % the whole of the \strayman\ stuff around as one directory.
329 \input{strayman.\@ptsize}
333 % \section{Package loading}
337 \RequirePackage{fancyhdr}
338 \RequirePackage{multicol}
343 % \section{Page layout}
345 % This is largely the domain of the size option files.
348 %<*8pt|9pt|10pt|11pt|12pt|text>
349 %<+8pt>\ProvidesFile{strayman.8pt}
350 %<+9pt>\ProvidesFile{strayman.9pt}
351 %<+10pt>\ProvidesFile{strayman.10pt}
352 %<+11pt>\ProvidesFile{strayman.11pt}
353 %<+12pt>\ProvidesFile{strayman.12pt}
354 %<+text>\ProvidesFile{strayman.text}
357 % \subsection{Font sizes}
359 % These are fairly standard, and mainly copied from the original size
362 % \begin{macro}{\@setparskip}
364 % Because we separate paragraphs by vertical space, we need to vary this
365 % gap when we change font size. This macro does the job.
369 \newdimen\@parshortfall
371 \@parskip.67\baselineskip\@plus\p@\relax%
372 \ifdim\parskip=\z@\else\parskip\@parskip\relax\fi%
373 \@parshortfall\@parskip\advance\@parshortfall-\parskip%
375 \def\set@vsep#1{#1\@parshortfall\advance#1}
379 % \begin{macro}{\normalsize}
381 % Defines the standard size of text in the document.
384 \renewcommand\normalsize{%
386 \@setfontsize\normalsize\@viiipt{9.6\p@}%
387 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
388 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
389 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
392 \@setfontsize\normalsize\@ixpt\@xipt%
393 \abovedisplayskip9\p@\@plus2\p@\@minus5\p@%
394 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
395 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
398 \@setfontsize\normalsize\@xpt\@xiipt%
399 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
400 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
401 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
404 \@setfontsize\normalsize\@xipt{13.6}%
405 \abovedisplayskip11\p@\@plus3\p@\@minus6\p@%
406 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
407 \set@vsep\belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
410 \@setfontsize\normalsize\@xiipt{14.5}%
411 \abovedisplayskip12\p@\@plus3\p@\@minus7\p@%
412 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
413 \set@vsep\belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
416 \@setfontsize\normalsize\@xpt\@xiipt%
417 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
418 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
419 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
421 \belowdisplayskip\abovedisplayskip%
434 % \begin{macro}{\small}
436 % The |\small| size is defined with similar care to |\normalsize|. The
437 % list defaults are altered to cope with our different value for |\parskip|.
438 % We can then separate this out independently from the typesize.
441 %<+text>\let\small\normalsize
442 %<*8pt|9pt|10pt|11pt|12pt>
445 \@setfontsize\small\@viipt{8.4}%
446 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
447 \set@vsep\abovedisplayshortskip\z@\@plus2\p@%
448 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
451 \@setfontsize\small\@viiipt{9.5}%
452 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
453 \set@vsep\abovedisplayshortskip\z@\@plus2\p@%
454 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
457 \@setfontsize\small\@ixpt{11}%
458 \abovedisplayskip8.5\p@\@plus3\p@\@minus4\p@%
459 \set@vsep\abovedisplayshortskip\z@\@plus2\p@%
460 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
463 \@setfontsize\small\@xpt\@xiipt%
464 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
465 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
466 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
469 \@setfontsize\small\@xipt{13.6}%
470 \abovedisplayskip11\p@\@plus3\p@\@minus6\p@%
471 \set@vsep\abovedisplayshortskip\z@ \@plus3\p@%
472 \set@vsep\belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
475 \leftmargin\leftmargini%
476 \topsep\@parshortfall%
480 \belowdisplayskip\abovedisplayskip%
483 %</8pt|9pt|10pt|11pt|12pt>
487 % \begin{macro}{\footnotesize}
489 % This is also defined with the meticulous care of |\normalsize|, and
490 % altered in the same way as for |\small|.
493 %<+text>\let\footnotesize\normalsize
494 %<*8pt|9pt|10pt|11pt|12pt>
495 \newcommand\footnotesize{%
497 \@setfontsize\footnotesize\@vipt\@viipt%
498 \set@vsep\abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
499 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
500 \set@vsep\belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
503 \@setfontsize\footnotesize\@viipt{8.4}%
504 \set@vsep\abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
505 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
506 \set@vsep\belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
509 \@setfontsize\footnotesize\@viiipt{9.5}%
510 \set@vsep\abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
511 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
512 \set@vsep\belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
515 \@setfontsize\footnotesize\@ixpt{11}%
516 \set@vsep\abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
517 \set@vsep\abovedisplayshortskip\z@\@plus\p@%
518 \set@vsep\belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
521 \@setfontsize\footnotesize\@xpt\@xiipt
522 \set@vsep\abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
523 \set@vsep\abovedisplayshortskip\z@\@plus3\p@%
524 \set@vsep\belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
527 \leftmargin\leftmargini%
528 \topsep\@parshortfall%
532 \belowdisplayskip\abovedisplayskip%
535 %</8pt|9pt|10pt|11pt|12pt>
539 % The other sizes are all much simpler. We introduce a new size,
540 % |\listingsize|, which is used for the \env{listing} environment, to ensure
541 % that 77 columns of text fit across an A5 sheet.
545 \newcommand\scriptsize{\@setfontsize\scriptsize\@vpt\@vipt\@setparskip}
546 \newcommand\tiny{\@setfontsize\tiny{4}\@vpt\@setparskip}
547 \newcommand\large{\@setfontsize\large\@xpt\@xiipt\@setparskip}
548 \newcommand\Large{\@setfontsize\Large\@xipt{13}\@setparskip}
549 \newcommand\LARGE{\@setfontsize\LARGE\@xiipt\@xivpt\@setparskip}
550 \newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
551 \newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
554 \newcommand\scriptsize{\@setfontsize\scriptsize\@vipt\@viipt\@setparskip}
555 \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt\@setparskip}
556 \newcommand\large{\@setfontsize\large\@xipt{13}\@setparskip}
557 \newcommand\Large{\@setfontsize\Large\@xiipt{14.4}\@setparskip}
558 \newcommand\LARGE{\@setfontsize\LARGE\@xivpt{17}\@setparskip}
559 \newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
560 \newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
563 \newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt\@setparskip}
564 \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt\@setparskip}
565 \newcommand\large{\@setfontsize\large\@xiipt{14}\@setparskip}
566 \newcommand\Large{\@setfontsize\Large\@xivpt{18}\@setparskip}
567 \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}\@setparskip}
568 \newcommand\huge{\@setfontsize\huge\@xxpt{25}\@setparskip}
569 \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}\@setparskip}
572 \newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}\@setparskip}
573 \newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt\@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\@xivpt{18}\@setparskip}
584 \newcommand\Large{\@setfontsize\Large\@xviipt{22}\@setparskip}
585 \newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}\@setparskip}
586 \newcommand\huge{\@setfontsize\huge\@xxvpt{30}\@setparskip}
589 %<+8pt|9pt|10pt|11pt|12pt>\let\listingsize\footnotesize
591 \def\scriptsize{\@setfontsize\scriptsize\@xpt\@xiipt\@setparskip}
593 \let\large\scriptsize
594 \let\Large\scriptsize
595 \let\LARGE\scriptsize
598 \let\listingsize\scriptsize
600 \let\txt@selectfont\selectfont
602 \fontfamily\ttdefault%
608 %</8pt|9pt|10pt|11pt|12pt|text>
611 % \subsection{Paragraph layout}
613 % Here we define various paragraph layout parameters.
615 % First, set up the line separation parameters. |\baselineskip| is set
616 % up by the individual size commands.
624 % We don't try to stretch the baselines apart:
627 \renewcommand\baselinestretch{}
630 % Paragraph indentation is set up later.
632 % Set up some standard penalty values.
641 % \subsection{Page layout}
643 % Our layout is a bit different to the standard \LaTeX\ ones: we leave a lot
644 % of space down the left hand side: this is reserved for headings and
647 % Calculating the size of the space on the left, which we call |\leftindent|,
648 % is complicated. We want to use as much of the width of the page as
649 % possible, unlike the \LaTeX\ defaults, making sure that we can fit on
650 % 77 columns of |\listingsize\tt| text. We also try to make space for a
651 % reasonable amount of marginal text, although we don't worry too much if
654 % The calculation is done as follows. More than about 40\,mm of margin will
655 % look very strange. We must have at least 104\,mm of main text, which
656 % leaves 20\,mm for the notes on A5 paper (actually, 17\,mm, since we leave
657 % 3\,mm gap between the notes and the main text). We divide the page
658 % horizontally into $s$\,mm of left border, $m$\,mm of marginal notes,
659 % $t$\,mm of body text, and another $s$\,mm of right border, giving
660 % a total of $w$\,mm. The value $s$ is given to us by the parameter
663 % Articles look odd with a big gap down the side, so this is reduced when
666 % We calculate the quantity~$m$ as $\min\bigl(40,17(w-2s-3)/121+3\bigr)$\@.
667 % Then we calculate $t=w-m-24-3$.
670 %<*8pt|9pt|10pt|11pt|12pt|text>
672 %<*8pt|9pt|10pt|11pt|12pt>
673 \leftindent\paperwidth
675 \advance\leftindent-2\pagesurround
676 \advance\leftindent-3mm
677 \leftindent0.1405\leftindent
678 \advance\leftindent3mm
679 \ifdim\leftindent>40mm\relax
682 \if@article\divide\leftindent\tw@\fi
683 \ifdim\leftindent<15mm\leftindent15mm\fi
687 %</8pt|9pt|10pt|11pt|12pt>
688 %<+text>\leftindent8\tt@chw
691 % In two-column layouts, we prevent headings from being outdented, by
692 % zeroing |\sectindent|. Chapter headings and suchlike are still outdented
693 % as before. We do not support margin paragraphs in two-column layouts.
700 \sectindent\if@numbering\z@\else\if@article\else\tw@\fi\leftindent\fi
704 % Having set up the size of the margin, we can get on with the rest of the
707 % First, we fix |\hoffset| and |\voffset| so we can work on the whole size
715 % Now we can design the page layout in earnest. We begin with the vertical
721 %<+10pt>\topskip10\p@
722 %<+11pt>\topskip11\p@
723 %<+12pt>\topskip12\p@
724 %<+text>\topskip\tt@chh
725 %<-text>\topmargin\pagesurround
726 %<+text>\topmargin\z@
727 %<-text>\headheight12\p@
728 %<+text>\headheight12\p@
729 %<-text>\headsep.5\pagesurround
730 %<+text>\headsep2\tt@chh
731 %<+text>\advance\headsep-12\p@
732 %<-text>\footskip12\p@
733 %<-text>\advance\footskip.5\pagesurround
734 %<+text>\footskip2\tt@chh
735 \textheight\paperheight
736 %<-text>\advance\textheight-24\p@
737 %<-text>\advance\textheight-3\pagesurround
738 %<+text>\advance\textheight-4\tt@chh
741 % Now we define the horizontal layout.
744 \oddsidemargin\leftindent
745 %<-text>\advance\oddsidemargin\pagesurround
746 \evensidemargin\oddsidemargin
747 \textwidth\paperwidth
748 \advance\textwidth-\oddsidemargin
749 %<-text> \advance\textwidth-\pagesurround
750 %<-text>\marginparsep3mm
751 %<+text>\marginparsep\tt@chw
752 \marginparwidth\leftindent
753 \advance\marginparwidth-\marginparsep
756 % Setting |\maxdepth| is fairly simple. This looks odd, because normally
757 % there's some messing for compatibility with \LaTeX~2.09.
764 % Marginal notes need some setting up.
770 % Footnotes need some setting up now.
773 %<+8pt>\footnotesep5.8\p@
774 %<+9pt>\footnotesep6.2\p@
775 %<+10pt>\footnotesep6.65\p@
776 %<+11pt>\footnotesep7.7\p@
777 %<+12pt>\footnotesep8.4\p@
778 %<+8pt>\setlength{\skip\footins}{7\p@\@plus4\p@\@minus2\p@}
779 %<+9pt>\setlength{\skip\footins}{8\p@\@plus4\p@\@minus2\p@}
780 %<+10pt>\setlength{\skip\footins}{9\p@\@plus4\p@\@minus2\p@}
781 %<+11pt>\setlength{\skip\footins}{10\p@\@plus4\p@\@minus2\p@}
782 %<+12pt>\setlength{\skip\footins}{10.8\p@\@plus4\p@\@minus2\p@}
783 %</8pt|9pt|10pt|11pt|12pt|text>
786 % \subsection{Float placement}
788 % First, we determine how we position the floats on the page.
792 \setcounter{topnumber}{2}
793 \renewcommand\topfraction{.7}
794 \setcounter{bottomnumber}{1}
795 \renewcommand\bottomfraction{.3}
796 \setcounter{totalnumber}{3}
797 \renewcommand\textfraction{.1}
798 \renewcommand\floatpagefraction{.8}
799 \setcounter{dbltopnumber}{2}
800 \renewcommand\dbltopfraction{.7}
801 \renewcommand\dblfloatpagefraction{.5}
805 % Now we define the glue which surrounds floats.
808 %<*8pt|9pt|10pt|11pt|12pt>
809 \floatsep12\p@\@plus2\p@\@minus2\p@
810 \textfloatsep20\p@\@plus2\p@\@minus4\p@
811 \dbltextfloatsep20\p@\@plus2\p@\@minus4\p@
812 %<+8pt|9pt|10pt|11pt>\intextsep12\p@\@plus2\p@\@minus 2\p@
813 %<+8pt|9pt|10pt|11pt>\dblfloatsep12\p@\@plus2\p@\@minus 2\p@
814 %<+12pt>\intextsep14\p@\@plus4\p@\@minus 4\p@
815 %<+12pt>\dblfloatsep14\p@\@plus2\p@\@minus 4\p@
818 % We must now define the parameters for float pages and columns.
821 \@fptop0\p@\@plus 1fil
822 %<+8pt|9pt|10pt|11pt>\@fpsep8\p@\@plus2fil
823 %<+12pt>\@fpsep10\p@\@plus2fil
824 \@fpbot0\p@\@plus 1fil
826 \@dblfptop0\p@\@plus 1fil
827 %<+8pt|9pt|10pt|11pt>\@dblfpsep8\p@\@plus 2fil
828 %<+12pt>\@dblfpsep10\p@\@plus2fil
829 \@dblfpbot0\p@\@plus 1fil
830 %</8pt|9pt|10pt|11pt|12pt>
833 % \section{Headers and footers}
835 % This part defines the standard page styles. By default, \strayman\
836 % imports \package{fancyheadings} and uses them, although this section is
837 % retained in case anything actually needs the original \LaTeX-style
843 \let\@oddfoot\@empty\let\@evenfoot\@empty
844 \def\@evenhead{\thepage\hfil\slshape\leftmark}%
845 \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
846 \let\@mkboth\markboth
847 \def\chaptermark##1{\markboth {\thechapter. ##1}{}}%
848 \def\sectionmark##1{\markright {\thesection. ##1}}%
852 \let\@oddfoot\@empty\let\@evenfoot\@empty
853 \def\@evenhead{\thepage\hfil\slshape\leftmark}%
854 \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
855 \let\@mkboth\@gobbletwo
856 \let\chaptermark\@gobble
857 \let\sectionmark\@gobble
863 % \begin{macro}{\maketitle}
864 % This is a bit of a thorny issue at the moment. Really, these titles need
865 % a complete rewrite. The |\maketitle| command will only be used for inside
866 % front covers anyway. I'm wondering if it wouldn't be better just to use
867 % special case code for each individual manual. Until a decision is made,
868 % I'll leave this as it was in \package{book}.
871 % This code is largely uncommented. It seems to be fairly straightforward,
872 % and if I do need to change it, I'll probably start again from scratch
879 \newcommand\maketitle{%
881 \let\footnotesize\small%
882 \let\footnoterule\relax%
891 \begin{tabular}[t]{c}%
897 {\large \@date \par}% % Set date in \large size.
903 \setcounter{footnote}{0}%
905 \let\maketitle\relax%
913 \newcommand\maketitle{%
916 \renewcommand\thefootnote{\fnsymbol{footnote}}%
917 \def\@makefnmark{\hb@xt@\z@{$\m@th^{\@thefnmark}$\hss}}%
918 \long\def\@makefntext##1{%
919 \parindent1em\noindent%
920 \hb@xt@1.8em{\hss$\m@th^{\@thefnmark}$}##1%
923 \ifnum\col@number=\@ne%
926 \twocolumn[\@maketitle]%
930 \global\@topnum\z@% % Prevents figures from going at top of page.
933 \thispagestyle{plain}%
936 \setcounter{footnote}{0}%
938 \let\maketitle\relax%
939 \let\@maketitle\relax%
957 \begin{tabular}[t]{c}%
971 % \begin{environment}{titlepage}
973 % The \env{titlepage} environment typesets its contents on a title page.
974 % The implementation is fairly straightforward: we just need to do some
975 % fiddling with two-column layouts. We also add in some hacking to make
976 % title pages centred properly, a bit like the \env{central} environment.
979 \newenvironment{titlepage}{%
982 \@restonecoltrue\onecolumn%
984 \@restonecolfalse\newpage%
988 \setcounter{page}{0}%
991 \thispagestyle{empty}%
1001 % \begin{macro}{\centrepage}
1003 % Change the page layout to centre everything properly. We guard against
1004 % this sort of thing happening again by clearing |\leftindent| and
1005 % |\sectindent|. This should only be cleared after the page has been
1006 % finished, for obvious reasons.
1010 \advance\oddsidemargin-\leftindent%
1011 \advance\evensidemargin-\leftindent%
1012 \advance\textwidth\leftindent%
1013 \advance\linewidth\leftindent%
1014 \advance\leftmargini0.5\leftindent%
1022 % \section{Sectioning commands}
1024 % In \strayman, quite a lot of the sectioning is different. We
1025 % don't tend to number sections much. Also, the chapter heading style has
1026 % been completely rewritten (several times).
1028 % \subsection{Setting up the counters}
1030 % This is pretty simple stuff.
1033 \newcommand\chaptermark[1]{}
1034 \setcounter{secnumdepth}{\if@numbering\if@runinsubsubsec2\else3\fi\else0\fi}
1036 \newcounter {chapter}
1037 \newcounter {section}[chapter]
1038 \newcounter {subsection}[section]
1039 \newcounter {subsubsection}[subsection]
1040 \newcounter {paragraph}[subsubsection]
1041 \newcounter {subparagraph}[paragraph]
1042 \renewcommand\thepart {\Roman{part}}
1043 \renewcommand\thechapter {\arabic{chapter}}
1045 \renewcommand\thesection {\arabic{section}}
1047 \renewcommand\thesection {\thechapter.\arabic{section}}
1049 \renewcommand\thesubsection {\thesection.\arabic{subsection}}
1050 \renewcommand\thesubsubsection {\thesubsection .\arabic{subsubsection}}
1051 \renewcommand\theparagraph {\thesubsubsection.\arabic{paragraph}}
1052 \renewcommand\thesubparagraph {\theparagraph.\arabic{subparagraph}}
1055 % \subsection{Frontmatter, mainmatter and backmatter}
1057 % We start off thinking we're in the main matter. The user ought to put a
1058 % |\frontmatter| command at the beginning of the document if this is not
1059 % correct, as it usually won't be.
1062 \newif\if@mainmatter
1064 \newcommand\frontmatter{%
1067 \pagenumbering{roman}%
1069 \newcommand\mainmatter{%
1072 \pagenumbering{arabic}%
1074 \newcommand\backmatter{%
1084 % \subsection{Abstracts}
1086 % \begin{environment}{abstract}
1088 % The \env{abstract} environment reduces the type size and margins slightly.
1089 % Abstracts are placed on their own pages when the |titlepage| option is
1090 % enabled. The code is filched from the LaTeX article class.
1094 \newenvironment{abstract}{%
1097 \@beginparpenalty\@lowpenalty
1099 \bfseries \abstractname
1102 {\par\vfil\null\endtitlepage}
1104 \newenvironment{abstract}{%
1106 \section*{\abstractname}%
1112 \fontseries{b}\fontfamily\headdefault\selectfont%
1115 \labelsep1em\labelwidth\z@\itemindent\labelsep%
1116 \rightmargin\leftmargin%
1118 \item[\abstractname]%
1120 {\if@twocolumn\else\endlist\fi}
1125 % \subsection{Appendices}
1127 % \begin{macro}{\appendix}
1129 % This command sets everything up to typeset the appendix.
1132 \newcommand\appendix{%
1134 \setcounter{chapter}{0}%
1135 \setcounter{section}{0}%
1136 \renewcommand\@chapapp{\appendixname}%
1138 \renewcommand\thesection{\Alph{section}}%
1140 \renewcommand\thechapter{\Alph{chapter}}%
1147 % \subsection{Parts}
1149 % Part headings are typeset on completely unadorned sheets, devoid of page
1150 % numbers and suchlike. Because of the strange page layout, we have to
1151 % put the part heading into a |central| environment. to stop the page looking
1152 % horribly lopsided.
1154 % \begin{macro}{\part}
1156 % The |\part| macro moves to an appropriate page, changes the pagestyle to
1157 % empty to switch off page numbering, and then calls |\@part| or |\@spart|
1158 % as appropriate, according to whether a \lit* was supplied. We put some
1159 % |\vfil| glue in, to vertically centre anything that these commands typeset,
1160 % and ensure printing in a single column.
1165 \thispagestyle{empty}%
1174 \secdef\@part\@spart%
1178 % \begin{macro}{\@part}
1180 % This is where most of the part heading typesetting is done. We stick a
1181 % line in the contents file, clear the heading markers, and typeset the
1182 % heading in the biggest letters we can find. When we're done, we call
1183 % |\@endpart| to do some common cleaning up.
1187 \ifnum\c@secnumdepth>-2\relax%
1188 \refstepcounter{part}%
1189 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
1191 \addcontentsline{toc}{part}{#1}%
1195 \interlinepenalty\@M%
1197 \ifnum\c@secnumdepth>-2\relax%
1198 \huge\bfseries\headfam\partname~\thepart%
1202 \normalfont\Huge\bfseries\headfam#2\par%
1208 % \begin{macro}{\@spart}
1210 % Here we typeset just the part heading: numbers have been suppressed. Also
1211 % we don't put things into the contents file. Otherwise, this is similar to
1217 \interlinepenalty\@M%
1219 \normalfont\Huge\bfseries\headfam#1\par%
1225 % \begin{macro}{\@endpart}
1227 % This does the clearing up operation after a part has been typeset. We
1228 % insert the other |\vfil| glue to centre the heading, clear the other
1229 % side of the page, if printing two-sided, and return if necessary to
1230 % two-column printing.
1238 \thispagestyle{empty}%
1249 % \subsection{Chapters}
1251 % The chapter typesetting has been more-or-less rewritten. We'll follow this
1252 % in a reasonable amount of detail.
1254 % \begin{macro}{\@chapapp}
1256 % Because |\appendix| needs to change what chapters are called, we add a
1257 % level of indirection through |\@chapapp|:
1260 \newcommand\@chapapp{\chaptername}
1264 % \begin{macro}{\chapter}
1266 % The |\chapter| command is the main dispatcher for chapters. We move to
1267 % an appropriate page, depending on the |openright| setting, suppress
1268 % headers, and then call |\@chapter| or |\@schapter| as appropriate.
1271 \newcommand\chapter{%
1277 \thispagestyle{plain}%
1280 \secdef\@chapter\@schapter%
1284 % \begin{macro}{\@chapter}
1286 % There's a lot of messing about to do, depending on whether we're in the
1287 % main matter and so on. We'll take this carefully.
1290 \def\@chapter[#1]#2{%
1293 % The first thing to do is put a line in the contents table. We need to
1294 % check |secnumdepth| and the |mainmatter| flag for this: we should only
1295 % include a number if both these tests pass. In this case, we also type a
1296 % message on the terminal.
1299 \ifnum\c@secnumdepth>\m@ne%
1301 \refstepcounter{chapter}%
1302 \typeout{\@chapapp\space\thechapter.}%
1303 \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
1305 \addcontentsline{toc}{chapter}{#1}%
1308 \addcontentsline{toc}{chapter}{#1}
1312 % Now we put a bit of space in the lists of figures and tables, and set up
1313 % the mark to put the chapter heading in the running header.
1316 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1317 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1320 % Finally, we need to decide how to typeset the chapter heading. On
1321 % single-column chapters, this is easy. On double-column formats, we need
1322 % to do horrid things with |\@topnewpage|.
1326 \@topnewpage[\@makechapterhead{%
1327 \hb@xt@.5\leftindent{\thechapter\hfil}%
1331 \hb@xt@.5\leftindent{\thechapter\hfil}%
1339 % \begin{macro}{\@makechapterhead}
1341 % This macro actually does the job of typesetting a chapter heading. Call
1342 % this routine as |\@makechapterhead{|\synt{number}|}{|\synt{title}|}|.
1343 % Here, \synt{number} is how to typeset the chapter number, and \synt{title}
1344 % is the rest of the title. To suppress the number, just leave \synt{number}
1345 % empty. The number is only typeset when it is correct to do so anyway.
1347 % The spacing is rather awkward. We have to cope with two-column layouts,
1348 % which seem to require different spacing. In a double-column layout,
1349 % the title is normally one |\baselineskip| too high. Also, the space I
1350 % add at the bottom of the heading gets eaten in double-column chapters,
1351 % because I'm actually typesetting into a vbox which is floated to the top
1352 % by \LaTeX\ in a fairly horrid way. This can't really be worked around,
1353 % so we just make the space beneath the heading equal to |\dbltextfloatsep|,
1354 % which is what gets added anyway.
1356 % The other snags are to do with the rule after the chapter heading.
1357 % Firstly, this is meant to be typeset into the left margin, like the
1358 % heading itself, which is a bit messy. More awkwardly, we have to be
1359 % careful not to let the depth of the line vary when the chapter heading has
1360 % descenders, although obviously we must lower the rule if the heading really
1361 % is very deep indeed.
1364 % We'll approach this a bit at a time.
1367 \def\@makechapterhead#1#2{%
1368 \begingroup% % Stop my hacking messing things up
1371 % First, the top spacing. This is divided into two parts, by an invisible
1372 % rule: the |\vskip| above the rule is eaten by \TeX\ if this is a genuine
1373 % new page, but put into the floating vbox if this is a two-column affair.
1374 % The second bit is added in both cases.
1377 \vskip\baselineskip% % This is gobbled in single column
1378 \hrule\@height\z@% % Stops TeX from binning my vskips
1379 \vskip32\p@% % Start chapters in a funny place
1382 % Now we actually typeset the heading. This is fairly simple: we must just
1383 % check that we need to typeset the number.
1386 \normalfont\Huge\bfseries\headfam% % Choose a nice font for it
1387 \raggedright % Don't justify -- it looks nasty
1388 \@hangfrom{\hskip-\leftindent}% % Start text at `real left margin'
1389 \ifnum\c@secnumdepth>\m@ne% % Do we typeset chapter numbers?
1390 \if@mainmatter% % Are we past the front matter?
1391 #1% % Yes -- then typeset the number
1392 \fi\fi% % Now back to normality
1393 {#2}% % Typeset the actual chapter head
1394 \par\nobreak% % Back to vmode again, please
1397 % The next tricky bit is the space before the ruleoff. We must be careful
1402 % \item We want the rule to be the right depth below the heading baseline,
1403 % regardless of whether the heading contains descenders: helpfully, \TeX\
1404 % omits |\baselineskip| glue before and after rules.
1406 % \item We want the rule to always be below any oddly deep descenders that
1407 % a strange user might throw at us (e.g., horrid fractions or weird
1412 % We accomplish this by scrutinising |\prevdepth| carefully.
1415 \@tempdima14\p@% % Be this low below the baseline
1416 \advance\@tempdima-\prevdepth% % This is the actual skip then
1417 \ifdim\@tempdima<8\p@% % Is this not enough skippage?
1418 \@tempdima8\p@% % No: then skip some more
1420 \vskip\@tempdima% % Skip a bit below the title
1423 % Now we can set the rule. This needs a little care.
1426 \@tempskipa\textwidth% % Find the width of the column
1427 \advance\@tempskipa\leftindent% % Add on the big lefthand gap
1428 \nointerlineskip% % Don't add any more space please
1429 \moveleft\leftindent\vbox{% % Shift something left by an amount
1430 \hrule\@width\@tempskipa% % Typeset the rule nicely
1432 \nointerlineskip% % Don't leave a gap beneath it
1435 % Finally, we leave a gap. In two-column layouts this is done for us, and
1436 % \LaTeX\ gobbles this glue and replaces it with |\dbltextfloatsep|. To make
1437 % things consistent, this is the glue we use anyway.
1440 \nobreak% % This would be a bad place to break
1441 \vspace{\dbltextfloatsep}% % Add in some extra glue beneath
1447 % \begin{macro}{\@makeschapterhead}
1449 % This is now just a veneer onto |\@makechapterhead|. It's needed, because
1450 % other bits of \LaTeX\ call it.
1453 \def\@makeschapterhead{%
1459 % \begin{macro}{\@schapter}
1461 % This macro typesets a starred chapter heading. This is terribly simple,
1462 % compared to the sort of things we've been doing so far.
1467 \@topnewpage[\@makeschapterhead{#1}]%
1469 \@makeschapterhead{#1}%
1477 % \subsection{The other sectioning commands}
1479 % These are all defined through |\@startsection|. They've been modified
1480 % to typeset sections and subsections hanging into the left margin, and to
1481 % moderate the amount of following space, due to the extra |\parskip| already
1485 \def\@defsection#1#2#3#4#5#6{%
1486 \expandafter\newcommand\csname#1\endcsname{%
1487 \skip@#4\advance\skip@\ifdim\skip@<\z@-\fi\@parshortfall%
1488 \skip\tw@#5\relax\ifdim\skip\tw@>\z@\advance\skip\tw@\@parshortfall\fi%
1495 {\reset@font#6\bfseries\headfam}%
1499 {section}% % Section name (for contents)
1500 {1}% % Level number (for numbering)
1501 {-.5\sectindent}% % Indentation of title
1502 {-1.5ex\@plus-1ex\@minus-.2ex}% % Space after title (vert/horiz)
1503 {.3ex\@plus.2ex}% % Space before title
1504 {\reset@font\Large\bfseries\headfam}% How to typeset the title
1509 {-1.25ex\@plus-1ex\@minus-.2ex}%
1511 {\reset@font\large\bfseries\headfam}%
1517 {0pt\@plus1ex\@minus.2ex}%
1519 {\reset@font\normalsize\bfseries\headfam}%
1524 {0pt\@plus.5ex\@minus.1ex}%
1526 {\reset@font\normalsize\bfseries\headfam}%
1531 {0pt\@plus.5ex\@minus.1ex}%
1533 {\reset@font\normalsize\bfseries\headfam}%
1539 {-1.25ex\@plus-1ex\@minus-.2ex}%
1541 {\reset@font\normalsize\bfseries\headfam}%
1546 {0pt\@plus1ex\@minus.2ex}%
1548 {\reset@font\normalsize\bfseries\headfam}%
1553 {0pt\@plus.5ex\@minus.1ex}%
1555 {\reset@font\normalsize\bfseries\headfam}%
1559 % \subsection{Section number formatting}
1561 % \begin{macro}{\@seccntformat}
1563 % The macro is given a section counter and must format it in some nice way.
1566 \def\@seccntformat#1{%
1567 \llap{\csname the#1\endcsname{\normalsize\quad}\hfil}%
1570 % \subsection{Top level sectioning}
1572 % \begin{macro}{\@topsect}
1574 % Articles are divided into sections; other documents are divided into
1575 % chapters. Things like the table of contents need to know which.
1579 \def\@topsect@star{\section*}
1580 \let\@topsect\section
1582 \let\@topsect@star\chapter
1583 \let\@topsect\chapter
1590 % \section{List handling}
1592 % A surprising number of \LaTeX's environments are defined in terms of
1593 % lists, many of which hide the fact by putting the entire text in one big
1596 % This part of the document class has to set up lots of list parameters.
1597 % This is largely the same as the standard classes, altered slightly to cope
1598 % with the different paragraph spacing.
1600 % \subsection{General list parameters}
1602 % Default left margins for lists:
1611 \leftmarginiii1.87em
1621 % And now we can set the paragraph indent.
1624 \parindent\leftmargini
1630 % Other spacing defaults:
1633 \leftmargin\leftmargini
1635 \labelwidth\leftmargini
1636 \advance\labelwidth-\labelsep
1637 \partopsep\z@\@plus1\p@\@minus1\p@
1640 % Interline penalties:
1643 \@beginparpenalty -\@lowpenalty
1644 \@endparpenalty -\@lowpenalty
1645 \@itempenalty -\@lowpenalty
1648 % Now we define the defaults for the list environments. These have managed
1649 % to migrate from the size options into the main document class.
1653 \leftmargin\leftmargini%
1659 \@listi\topsep\parskip%
1661 \leftmargin\leftmarginii%
1662 \labelwidth\leftmarginii%
1663 \advance\labelwidth-\labelsep%
1666 \leftmargin\leftmarginiii%
1667 \labelwidth\leftmarginiii%
1668 \advance\labelwidth-\labelsep%
1669 % \partopsep\p@\@plus\z@\@minus\p@%
1672 \leftmargin\leftmarginiv%
1673 \labelwidth\leftmarginiv%
1674 \advance\labelwidth-\labelsep%
1677 \leftmargin\leftmarginv%
1678 \labelwidth\leftmarginv%
1679 \advance\labelwidth-\labelsep%
1682 \leftmargin\leftmarginvi%
1683 \labelwidth\leftmarginvi%
1684 \advance\labelwidth-\labelsep%
1688 % \subsection{Numbering things}
1690 % \begin{macro}{\numberwithin}
1692 % Does the obvious thing. Optional argument gives numbering style.
1695 \def\numberwithin{\@testopt\nw@i\arabic}
1697 \@addtoreset{#2}{#3}%
1698 \expandafter\xdef\csname the#2\endcsname{%
1699 \expandafter\noexpand\csname the#3\endcsname.%
1706 % \begin{macro}{\removefromreset}
1708 % Does the obvious thing.
1711 \def\removefromreset#1#2{%
1718 \else\toks@\expandafter{\the\toks@\@elt{##1}}%
1721 \csname cl@#2\endcsname%
1722 \expandafter\xdef\csname cl@#2\endcsname{\the\toks@}%
1729 % \subsection{Enumerated lists}
1731 % We busily redefine all the counters for enumerated lists, and how to
1734 % How to typeset the numbers:
1737 \renewcommand\theenumi{\arabic{enumi}}
1738 \renewcommand\theenumii{\alph{enumii}}
1739 \renewcommand\theenumiii{\roman{enumiii}}
1740 \renewcommand\theenumiv{\Alph{enumiv}}
1743 % Typesetting the item labels:
1746 \newcommand\labelenumi{\theenumi.}
1747 \newcommand\labelenumii{(\theenumii)}
1748 \newcommand\labelenumiii{\theenumiii.}
1749 \newcommand\labelenumiv{\theenumiv.}
1752 % And finally how to typeset references to the items:
1755 \renewcommand\p@enumii{\theenumi}
1756 \renewcommand\p@enumiii{\theenumi(\theenumii)}
1757 \renewcommand\p@enumiv{\p@enumiii\theenumiii}
1760 % \subsection{Itemized lists}
1762 % We set up the various bullet shapes for the itemized lists.
1765 \newcommand\labelitemi{$\m@th\bullet$}
1766 \newcommand\labelitemii{\normalfont\bfseries --}
1767 \newcommand\labelitemiii{$\m@th\ast$}
1768 \newcommand\labelitemiv{$\m@th\cdot$}
1771 % \subsection{Description lists}
1773 % This has been redefined a little to make it more sensible. The old version
1774 % had a weird |\hspace\labelsep| in the labelling macro. This has now been
1775 % added into the main list definition. You can now redefine
1776 % |\descriptionlabel| without fear of messing up the spacing.
1778 % \begin{environment}{description}
1780 % Here we set up the main list parameters. The label width is zeroed to
1781 % ensure that the text is always indented nicely.
1787 \itemindent-\leftmargin%
1788 \advance\itemindent\labelsep%
1789 \def\makelabel{\descriptionlabel}%
1792 \let\enddescription\endlist
1795 % \begin{macro}{\descriptionlabel}
1797 % This typesets a description label. Redefine it the obvious way for
1798 % different exciting effects.
1801 \def\descriptionlabel#1{\normalfont\bfseries #1}
1807 % \subsection{Other list-based environments}
1809 % Several other standard environments are defined in terms of lists. These
1810 % are all dealt with here.
1812 % \begin{environment}{verse}
1814 % The \env{verse} environment is specially fiddled so that |\\| works as it
1815 % should. There's nothing else exciting about it.
1818 \newenvironment{verse}{%
1823 \listparindent\itemindent%
1824 \rightmargin\leftmargin%
1825 \advance\leftmargin1.5em%
1834 % \begin{environment}{quotation}
1836 % The \env{quotation} environment is a pretty standard display, except that
1837 % we kill off inter-paragraph space. The current definition means that
1838 % \env{quotation}s are typeset in normal indented-paragraph style, which
1839 % is inconsistent with the rest of the document style.
1842 \newenvironment{quotation}{%
1845 \itemindent\listparindent%
1846 \rightmargin\leftmargin%
1855 % \begin{environment}{quote}
1857 % This is even simpler. We just pull in the right margin a bit.
1860 \newenvironment{quote}{%
1862 \rightmargin\leftmargin%
1871 % \begin{environment}{display}
1873 % The \env{display} environment is intended for any other displays which you
1874 % need to typeset. This is \emph{not} a standard environment.
1877 \newenvironment{display}{%
1880 \rightmargin\leftmargin%
1891 % And some quick hacking of the theorem environment.
1893 % \section{Other parameters}
1895 % We define some miscellaneous parameters for standard environments.
1900 \arrayrulewidth.4\p@
1902 \tabbingsep\labelsep
1903 \skip\@mpfootins\skip\footins
1908 \renewcommand\theequation{\arabic{equation}}
1910 \@addtoreset{equation}{chapter}
1911 \renewcommand\theequation{\thechapter.\arabic{equation}}
1917 % Since raw \LaTeX\ doesn't actually define any floating objects, we have
1918 % to do some of the work here. This isn't actually terribly arduous. For
1919 % a float called \synt{float}, we have to define the following macros:
1921 % \begin{description}
1922 % \let\descriptionlabel\relax
1924 % \item[\texttt{\bslash fps@}\synt{float}] is the default float positioning
1925 % argument for the float type.
1927 % \item[\texttt{\bslash ftype@}\synt{float}] is a flag bit for the float
1928 % type. This is used in \LaTeX's |\output| routine to identify floats of
1931 % \item[\texttt{\bslash ext@}\synt{float}] is the file extension for the
1932 % list of these floats (e.g., \lit{lof} for figures).
1934 % \item[\texttt{\bslash fnum@}\synt{float}] is a macro which generates the
1935 % caption number. For figures, this expands to `|Figure~\thefigure|'.
1939 % We must also define |\@makecaption|, which typesets a float caption in
1940 % an appropriate way, and an environment for each type of float.
1942 % \subsection{Figures}
1944 % This is all fairly straightforward stuff. First, we create a counter for
1948 \newcounter{figure}[chapter]
1950 \renewcommand\thefigure{\@arabic\c@figure}
1952 \renewcommand\thefigure{\thechapter.\@arabic\c@figure}
1956 % Now we define all the macros \LaTeX\ requires.
1959 \if@herefloats\def\fps@figure{htbp}\else\def\fps@figure{tbp}\fi
1960 \def\ftype@figure{1}
1961 \def\ext@figure{lof}
1962 \def\fnum@figure{\figurename~\thefigure}
1965 % \begin{environment}{figure}
1966 % \begin{environment}{figure*}
1968 % Finally, we create the \env{figure} and \env{figure$*$} environments.
1971 \newenvironment{figure}{\@float{figure}}{\end@float}
1972 \newenvironment{figure*}{\@dblfloat{figure}}{\end@dblfloat}
1977 % \subsection{Tables}
1979 % This is pretty similar to the figure handling.
1982 \newcounter{table}[chapter]
1984 \renewcommand\thetable{\@arabic\c@table}
1986 \renewcommand\thetable{\thechapter.\@arabic\c@table}
1989 \if@herefloats\def\fps@table{htbp}\else\def\fps@table{tbp}\fi
1992 \def\fnum@table{\tablename~\thetable}
1994 \newenvironment{table}{\@float{table}}{\end@float}
1995 \newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat}
1998 % \subsection{Other float parameters}
2000 % \begin{macro}{\@makecaption}
2002 % The |\@makecaption| macro is called to display a float caption. It will
2003 % typeset its argument either centred in a box, if it is short enough, or
2004 % in a paragraph if it is longer than a line.
2007 \newlength\abovecaptionskip
2008 \newlength\belowcaptionskip
2009 \abovecaptionskip10\p@
2010 \belowcaptionskip0\p@
2012 \long\def\captionstyle#1#2{\itshape #1: #2}
2013 \long\def\@makecaption#1#2{%
2014 \vskip\abovecaptionskip%
2015 \sbox\@tempboxa{\captionstyle{#1}{#2}}%
2016 \ifdim\wd\@tempboxa>\hsize%
2017 \unhbox\@tempboxa\par%
2019 \hb@xt@\hsize{\hfil\unhbox\@tempboxa\hfil}%
2021 \vskip\belowcaptionskip%
2026 % \section{Font commands}
2028 % We allow the `old' font commands to do sensible \textsf{NFSS} things, since
2029 % we don't have any legacy documents. This means that we have proper
2030 % abbreviations for font changes. We also add |\nm| to return to a normal
2031 % font, whatever that may mean.
2034 \DeclareOldFontCommand{\rm}{\rmfamily}{\mathrm}
2035 \DeclareOldFontCommand{\sf}{\sffamily}{\mathsf}
2036 \DeclareOldFontCommand{\tt}{\ttfamily}{\mathtt}
2037 \DeclareOldFontCommand{\bf}{\bfseries}{\mathbf}
2038 \DeclareOldFontCommand{\md}{\mdseries}{\@nomath\md}
2039 \DeclareOldFontCommand{\it}{\itshape}{\mathit}
2040 \DeclareOldFontCommand{\up}{\upshape}{\@nomath\up}
2041 \DeclareOldFontCommand{\sl}{\slshape}{\@nomath\sl}
2042 \DeclareOldFontCommand{\sc}{\scshape}{\@nomath\sc}
2043 \DeclareOldFontCommand{\nm}{\normalfont}{\mathnormal}
2046 % Now we define some special commands which only work in maths mode. It
2047 % seems that older versions of \LaTeX\ (in particular, that at Warwick
2048 % University) don't define these commands initially, so we'd better not
2049 % use |\renewcommand| after all. We also dispose of lots of messing with
2050 % |\protect| by using |\DeclareRobustCommand|.
2053 \DeclareRobustCommand\cal{\@fontswitch{\relax}{\mathcal}}
2054 \DeclareRobustCommand\pmit{\@fontswitch{\relax}{\mathnormal}}
2057 % \section{Tables of contents}
2059 % This section deals with tables of contents, and lists of figures.
2061 % \subsection{Contents}
2063 % First, we have to define some parameters.
2066 \newcommand\@pnumwidth{2em}
2067 \newcommand\@tocrmarg {3em}
2068 \newcommand\@dotsep{4.5}
2069 \setcounter{tocdepth}{\if@runinsubsubsec1\else2\fi}
2072 % \begin{macro}{\tableofcontents}
2074 % This is the main command for setting up tables of contents. We ensure
2075 % a single-page layout, put in the chapter heading, read in the contents
2076 % file, and then restore the old layout.
2079 \def\@tocthing#1#2{%
2080 \@ifnextchar[{\@tocthing@i{#1}{#2}}{\@tocthing@i{#1}{#2}[\relax][\relax]}%
2082 \def\@tocthing@i#1#2[#3][#4]{%
2083 \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi%
2084 \@topsect@star{#1}#3{\parskip\z@\@starttoc{#2}}#4%
2085 \if@restonecol\twocolumn\fi%
2087 \newcommand\tableofcontents{\@tocthing\contentsname{toc}}
2091 % Each section type \synt{type} is typeset by a command |\l@|\synt{type}:
2092 % for example, the |\l@chapter| command typesets the entry for a chapter
2095 % \begin{macro}{\l@part}
2097 % This command is vaguely interesting. We'll explore in detail.
2103 % We don't typeset the entry if |tocdepth| tells us not to. What kind of
2104 % stupid user is going to disable \emph{all} the contents items.
2107 \ifnum\c@tocdepth>-2\relax%
2110 % Before we start, we try to break above the title. Later, we'll disable
2111 % breaking afterwards. We then leave some vertical space.
2114 \addpenalty{-\@highpenalty}%
2115 \addvspace{2.25em\@plus\p@}%
2118 % We open a group, to avoid messing other things up. The |\numberline|
2119 % macro, which numbers the entry on the left, typesets its argument in a box
2120 % of width |\@tempdima|, which we must set up. We then set up the values
2121 % of |\rightskip| and |\parfillskip| to avoid printing over the page number.
2122 % We also make |\interlinepenalty| infinite to suppress breaking pages in
2123 % the middle of the title.
2129 \rightskip\@pnumwidth%
2130 \parfillskip-\@pnumwidth%
2131 \interlinepenalty\@M
2134 % Time to typeset the actual title. This is fairly simple, apart from
2135 % a complicated mixture of glue and penalties, which handles a line break
2136 % right at the end of the title.
2141 \large\bfseries {#1}%
2142 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak\hfil%
2143 \hb@xt@\@pnumwidth{\hss #2}%
2147 % Now we end the paragraph and suppress page breaking here.
2152 \global\@nobreaktrue%
2153 \everypar{\global\@nobreakfalse\everypar{}}%
2160 % \begin{macro}{\@artsw}
2162 % Define a macro named after the first or second argument depending on
2163 % whether the document is an article.
2167 \edef\@tempa{#1\if@article\noexpand#3\else\noexpand#2\fi}%
2174 % \begin{macro}{\l@chapter}
2176 % This is terribly similar to the previous macro.
2179 \@artsw\def\l@chapter\l@section#1#2{%
2180 \ifnum\c@tocdepth >\m@ne%
2181 \addpenalty{-\@highpenalty}%
2182 \vskip1.0em\@plus\p@%
2183 \setlength\@tempdima{2em}%
2185 \interlinepenalty\@M
2187 \rightskip\@pnumwidth%
2188 \parfillskip-\@pnumwidth%
2191 \advance\leftskip\@tempdima%
2194 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak\hfil%
2195 \hb@xt@\@pnumwidth{\hss #2}%
2197 \penalty\@highpenalty%
2204 % The other types are all defined in terms of |\@dottedtocline|, which is
2208 \@artsw\def\l@section\l@subsection{\@dottedtocline{1}{2em}{2.5em}}
2209 \@artsw\def\l@subsection\l@subsubsection{\@dottedtocline{2}{4.5em}{3.2em}}
2210 \@artsw\def\l@subsubsection\l@paragraph{\@dottedtocline{3}{7.7em}{4.1em}}
2211 \@artsw\def\l@paragraph\l@subparagraph{\@dottedtocline{4}{10.5em}{5em}}
2212 \@artsw\def\l@subparagraph\@tempa{\@dottedtocline{5}{12.5em}{6em}}
2215 % \begin{macro}{\@dottedtocline}
2217 % This is actually a part of the \LaTeX\ kernel, although it's not quite
2218 % right the way it is. We've improved the handling of line breaks after the
2222 \def\@dottedtocline#1#2#3#4#5{%
2225 % We have to make sure that we're meant to typeset this contents entry.
2228 \ifnum#1>\c@tocdepth\else%
2231 % Now we add in a little stretchy space.
2234 \vskip\z@\@plus.2\p@%
2237 % Set up the paragraph layout now. We forbid page breaks in the middle of
2243 \rightskip\@tocrmarg%
2244 \parfillskip-\rightskip%
2247 \interlinepenalty\@M%
2250 % Now we typeset the actual title.
2255 \advance\leftskip\@tempdima%
2261 % This is the clever bit. After the actual title, we add the following
2266 % \item A |\nobreak| penalty, to stop a break from eating the glue.
2268 % \item A glob of |\hfil| glue. If there's a line break after this glue,
2269 % the title is set flush left as a result of this. Otherwise, it is ignored
2270 % because the leaders are |\hfill|.
2272 % \item A penalty. This is a reasonable place to break the line if
2275 % \item An empty |\hbox|. This stops the following glue from being discarded
2276 % at the beginning of a new line.
2278 % \item Another |\nobreak|, which stops a break at the following glue item.
2280 % \item The dotted |\leaders|, which have |\hfill| stretchiness. This forces
2281 % the page number to be flush right.
2285 % The net result of all this is we can now cope with a line break at the
2286 % end of the title, before the page number, which means that the dots are
2287 % put on the next line. The original \LaTeX\ version forced the last word
2288 % of the title onto the next line as well, which can cause underful boxes.
2291 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak%
2292 \leaders\hbox{$\m@th\mkern\@dotsep mu.\mkern\@dotsep mu$}\hfill%
2293 \hb@xt@\@pnumwidth{\hfil\reset@font\rmfamily#5}\par%
2300 % \subsection{Lists of figures and tables}
2302 % These macros are terribly similar to the other ones.
2305 \newcommand\listoffigures{\@tocthing\listfigurename{lof}}
2306 \newcommand\l@figure{\@dottedtocline{0}{0pt}{2em}}
2307 \newcommand\listoftables{\@tocthing\listtablename{lot}}
2308 \let\l@table\l@figure
2311 % \section{Bibliography}
2313 % This isn't actually terribly interesting.
2315 % \begin{environment}{thebibliography}
2321 \newenvironment{thebibliography}[1]{%
2323 \list{\@biblabel{\arabic{enumiv}}}%
2324 {\settowidth\labelwidth{\@biblabel{#1}}%
2325 \leftmargin\labelwidth%
2326 \advance\leftmargin\labelsep%
2328 \advance\leftmargin\bibindent%
2329 \itemindent-\bibindent%
2330 \listparindent\itemindent%
2333 \usecounter{enumiv}%
2334 \let\p@enumiv\@empty%
2335 \renewcommand\theenumiv{\arabic{enumiv}}}%
2337 \renewcommand\newblock{\par}%
2339 \renewcommand\newblock{\hskip.11em\@plus.33em\@minus.07em}%
2346 \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
2350 \newcommand\newblock{}
2356 % Defines the \env{theindex} environment.
2358 % \begin{environment}{theindex}
2360 % The macros are fairly simple. We change to a two column layout, and
2361 % redefine |\item| appropriately.
2364 \newenvironment{theindex}{%
2367 \@topsect\indexname%
2369 \begin{multicols}{2}%
2371 \parskip\z@\@plus.3\p@\relax%
2382 % Now we define the item and spacing macros.
2385 \newcommand\@idxitem {\par\hangindent 40\p@}
2386 \newcommand\subitem {\par\hangindent 40\p@ \hspace*{20\p@}}
2387 \newcommand\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
2388 \newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
2391 % \begin{macro}{\passim}
2393 % The |passim| encapsulator is used to typeset the word `\textit{passim}'
2394 % after a page range.
2397 \def\passim#1{#1 \textit{passim}} % Passim encapsulator for indices
2401 % Other useful commands for indexing:
2403 % \begin{description*}
2404 % \def\descriptionlabel#1{\ttfamily \bslash #1}
2406 % \item[Term] typesets its argument in italics, and adds it to the index.
2408 % \item[term] typesets its first argument in italics, and adds its second
2411 % \item[Index] typesets its argument normally, and adds it to the index.
2413 % \end{description*}
2416 \def\Term#1{\emph{#1}\index{#1}}
2417 \def\term#1{\emph{#1}\index}
2418 \def\Index#1{#1\index{#1}}
2421 % \section{Footnotes}
2423 % \begin{macro}{\footnoterule}
2425 % This macro typesets the rule above footnotes. This is a bit more complex
2426 % than the default: we try and typeset the rule to be at most 1\,in wide,
2427 % although if the column isn't wide enough, we use $4\over10$~of the
2428 % box width instead.
2432 \@tempdima.4\columnwidth%
2433 \ifdim\@tempdima>1in\relax%
2434 \@tempdima1in\relax%
2437 \hrule\@width\@tempdima%
2443 % We number footnotes within chapters:
2446 \@addtoreset{footnote}{chapter}
2449 % \begin{macro}{\@makefntext}
2451 % This is the macro which actually typesets a footnote. This is rather
2452 % complicated. It's based on example code from \file{classes.dtx} which
2453 % doesn't actually work properly.
2456 \long\def\@makefntext#1{%
2459 % First, we redefine |\par| to set up the correct paragraph shape. This
2460 % is indented from the left margin by a small amount.
2466 \advance\@tempdima-1.6em%
2467 \parshape\@ne1.6em\@tempdima%
2471 % Now we set up some parameters so that \env{list} environments work properly
2472 % within the footnote. We also clear |\parindent| to prevent nasty
2473 % indentation. The |\par| sets up the paragraph shape for the next
2474 % paragraph: we're in vertical mode already, so it does nothing else.
2477 \advance\linewidth-1.6em%
2478 \advance\@totalleftmargin1.6em%
2483 % We leave vertical mode to stop the hbox created by |\llap| from being
2484 % stacked vertically. Then we typeset the footnote mark, and put in the
2485 % main text. Finally we leave some space afterwards, to space out the next
2490 \llap{\@makefnmark\enspace}#1\par%
2496 % \begin{macro}{\@makecol}
2498 % The standard \LaTeX\ output routine messes up footnotes a bit, in my
2502 % \item If a page is cut off short, because the next item won't fit (e.g.,
2503 % a section heading), then footnotes are added right below the end
2504 % of the text, which can look strange.
2506 % \item Footnotes are displayed \emph{above} floats at the bottom of a page,
2507 % which also looks strange.
2509 % \item The |\@makefntext| routine above needs to add vertical space between
2510 % footnotes, but this leaves a gap at the very bottom. We remove this
2511 % gap with an |\unskip|.
2517 \setbox\@outputbox \box\@cclv
2518 \xdef\@freelist{\@freelist\@midlist}%
2519 \global \let \@midlist \@empty
2521 \ifvoid\footins \else
2522 \setbox\@outputbox \vbox {%
2523 \boxmaxdepth \@maxdepth
2525 \vskip \skip\footins
2535 \setbox\@outputbox \vbox to\@colht {%
2537 \dimen@ \dp\@outputbox
2543 \global \maxdepth \@maxdepth
2548 % \section{Tidying up}
2550 % This section gathers together various other useful bits of standard
2551 % document class setting.
2553 % \subsection{Item names}
2555 % These commands typeset bits of text. They can then be redefined by
2556 % \package{babel} and suchlike.
2559 \newcommand\contentsname{Contents}
2560 \newcommand\listfigurename{List of figures}
2561 \newcommand\listtablename{List of tables}
2562 \if@article\newcommand\bibname{References}
2563 \else\newcommand\bibname{Bibliography}\fi
2564 \newcommand\indexname{Index}
2565 \newcommand\figurename{Figure}
2566 \newcommand\tablename{Table}
2567 \newcommand\partname{Part}
2568 \newcommand\abstractname{Abstract}
2569 \newcommand\chaptername{Chapter}
2570 \newcommand\appendixname{Appendix}
2571 \newcommand\today{\number\day\space\ifcase\month\or
2572 January\or February\or March\or April\or May\or June\or
2573 July\or August\or September\or October\or November\or December\fi
2577 % \subsection{Final fiddling for two columns}
2582 \pagestyle{headings}
2583 \pagenumbering{arabic} % Arabic page numbers
2593 % \section{The \protect\env{central} environment}
2595 % Because of the strange layout of the pages, text which is centred using
2596 % normal \LaTeX\ commands is centred in the text area, not on the page,
2597 % which is undesirable for large headings, like part headings.
2599 % \begin{environment}{central}
2601 % The \env{central} environment typesets its contents centrally on the page.
2602 % It should only be used from outer vertical mode.
2604 % The code just creates a box of the appropriate size and moves it into the
2608 \newenvironment{central}{%
2610 \vbox\bgroup\moveleft\leftindent\vbox\bgroup%
2611 \textwidth\paperwidth%
2612 \advance\textwidth-2\pagesurround\relax%
2614 \hrule\@height\z@\@depth\z@\@width\hsize%
2622 % \section{Headers and footers}
2624 % The \strayman\ class uses \package{fancyheadings} for its headers
2625 % and footers. This has already been included in the preamble. We now
2626 % need to fix a few problems with \package{fancyheadings} and set up some
2629 % \begin{macro}{\title}
2631 % We extend |\title|, and give it an optional argument. It can now specify
2632 % the document title as used by |\maketitle| and the running title for the
2633 % header separately.
2635 % We store the running header in the macro |\@headertitle|, which is
2642 % Now we define the |\title| macro, using |\@dblarg| to duplicate the
2643 % mandatory argument if the optional one is omitted.
2646 \def\title{\@dblarg\title@i}
2647 \def\title@i[#1]#2{%
2649 \gdef\@headertitle{#1}%
2654 % \begin{macro}{\innerhead}
2655 % \begin{macro}{\innerfoot}
2657 % We allow the user to specify an `inner heading' which is displayed on the
2658 % inside of the header on of each page. This can be used for security
2659 % classifications, for example. Any \package{fancyheadings} commands can
2660 % be used to control the header, which is expanded on each page.
2667 \def\innerhead{\@dblarg\innerhead@i}
2668 \def\innerhead@i[#1]#2{%
2669 \def\l@innerhead{#1}%
2670 \def\r@innerhead{#2}%
2672 \def\innerfoot{\@dblarg\innerfoot@i}
2673 \def\innerfoot@i[#1]#2{%
2674 \def\l@innerfoot{#1}%
2675 \def\r@innerfoot{#2}%
2681 % The next step is to set up the headings:
2684 \let\headrulewidth\z@
2685 \headwidth\textwidth
2686 \advance\headwidth\leftindent
2687 \fancypagestyle{headings}{%
2689 \fancyhead[LE]{\bfseries\@headertitle}
2690 \if@article\fancyhead[RO]{\rightmark}\else\fancyhead[RO]{\leftmark}\fi
2691 \fancyhead[RE]{\l@innerhead} \fancyhead[LO]{\r@innerhead}
2692 \fancyfoot[RE]{\l@innerfoot} \fancyfoot[LO]{\r@innerfoot}
2693 \fancyfoot[LE,RO]{\thepage}
2695 \fancypagestyle{plain}{%
2697 \fancyfoot[RE]{\l@innerfoot} \fancyfoot[LO]{\r@innerfoot}
2698 \fancyfoot[LE,RO]{\thepage}%
2700 \let\ps@fancy\ps@@fancy
2703 % The \package{fancyheadings} package by default expects pages to be
2704 % symmetrical. We have to redefine the |\ps@fancy| macro to make it
2708 \def\@lodd{\ifodd\c@page\hss\else\relax\fi}
2709 \def\@rodd{\ifodd\c@page\relax\else\hss\fi}
2712 % Finally, we can choose the page style we want:
2715 \pagestyle{headings}
2718 % \section{Parbox alteration}
2720 % The standard \LaTeX\ |\parbox| command, and the \env{minipage} environment,
2721 % reset |\parskip| to zero, which is inconsistent with the document style.
2722 % We amend |\@arrayparboxrestore|, the macro which sets up the paragraph
2723 % style for parboxes.
2725 % First, we define a macro explaining how the parbox should set the spacing.
2728 \def\parboxparskip{2ex}
2731 % Next, we redefine the macro. This is taken directly from the \LaTeXe
2735 \def\@arrayparboxrestore{%
2738 \let\'\@acci\let\`\@accii\let\=\@acciii
2739 \parindent\z@ \parskip\z@
2740 \everypar{\parskip\parboxparskip\everypar{}}%
2742 \@totalleftmargin\z@
2743 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
2744 \parfillskip\@flushglue \lineskip\normallineskip
2745 \baselineskip\normalbaselineskip
2746 \@noskipsectrue% % The comp.text.tex gurus said it should be
2751 % \section{Other features}
2753 % At the end is a miscellany of useful features.
2755 % \subsection{Other typesetting conventions}
2757 % Some items need typesetting in particular ways.
2762 \def\submenu{\ensuremath\Rightarrow}
2764 \def\file#1{\mbox{\itshape #1\/}}
2767 % \subsection{And finally}
2772 \def\riscos{RISC~OS}