3 % $Id: strayman.dtx,v 1.2 2002/02/24 12:45:56 mdw Exp $
5 % Document class for Straylight manuals
9 %----- Revision history -----------------------------------------------------
11 % $Log: strayman.dtx,v $
12 % Revision 1.2 2002/02/24 12:45:56 mdw
15 % Revision 1.1 2002/02/19 23:27:57 mdw
18 % Revision 1.8 1996/12/09 23:20:42 mdw
19 % (\tab@setstrut): Fixed so that it uses \dimen\tw@ for the strut depth,
22 % Revision 1.7 1996/11/29 21:59:16 mdw
23 % Fixed a little formatting mistake in a syntax diagram, and switched over
24 % to the new syntax diagram commands on the grounds that they're slightly
27 % Revision 1.6 1996/11/19 20:54:33 mdw
33 % \begin{meta-comment} <general public licence>
35 %% strayman -- a LaTeX document class for Straylight manuals
36 %% Copyright (c) 1996 Straylight
38 %% This program is free software; you can redistribute it and/or modify
39 %% it under the terms of the GNU General Public License as published by
40 %% the Free Software Foundation; either version 2 of the License, or
41 %% (at your option) any later version.
43 %% This program is distributed in the hope that it will be useful,
44 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
45 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 %% GNU General Public License for more details.
48 %% You should have received a copy of the GNU General Public License
49 %% along with this program; if not, write to the Free Software
50 %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
54 % \begin{meta-comment} <Package preamble>
55 %<+strayman>\NeedsTeXFormat{LaTeX2e}
56 %<+strayman>\ProvidesClass{strayman}
57 %<+strayman> [1996/03/26 1.05 Straylight document class]
62 %% {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
63 %% 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
64 %% Digits \0\1\2\3\4\5\6\7\8\9
65 %% Exclamation \! Double quote \" Hash (number) \#
66 %% Dollar \$ Percent \% Ampersand \&
67 %% Acute accent \' Left paren \( Right paren \)
68 %% Asterisk \* Plus \+ Comma \,
69 %% Minus \- Point \. Solidus \/
70 %% Colon \: Semicolon \; Less than \<
71 %% Equals \= Greater than \> Question mark \?
72 %% Commercial at \@ Left bracket \[ Backslash \\
73 %% Right bracket \] Circumflex \^ Underscore \_
74 %% Grave accent \` Left brace \{ Vertical bar \|
75 %% Right brace \} Tilde \~}
78 % \begin{meta-comment} <driver>
81 \documentclass[10pt,a4paper,times,cmtt]{strayman}
84 \describesclass{strayman}
85 \title[The \strayman\ document class]
86 {The \strayman\footnote{The \strayman\ document class is currently %
87 at version \mdwfileinfo{strayman.cls}{version}, dated %
88 \mdwfileinfo{strayman.cls}{date}.} {} document class}
89 \newenvironment{syndisplay}{\display\synshorts}{\enddisplay}
90 \DeclareRobustCommand\strayman{\package{strayman}}
96 % \chapter{About the \strayman\ document class}
98 % The standard \LaTeX\ document classes are all very well for simple
99 % documents, but the style isn't appropriate for works like manuals.
100 % The \strayman\ document class is an attempt to recitfy this situataion,
101 % providing an attractive and distinctive style for Straylight documents.
102 % The layout is based on an earlier style built for \emph{Impression}
103 % documents, although many improvements have been made. This document
104 % was typeset using \strayman, and it demonstrates the design far better
105 % than I can describe it.
108 % \section{Document class options}
110 % The document class provides many options, most of which are taken from
111 % the standard \LaTeX\ classes.
113 % \begin{description}
114 % \def\|{\ensuremath\vert}
116 % \item [\texttt{a4paper} \| \texttt{a5paper} \| \texttt{b5paper} \|
117 % \texttt{letterpaper} \| \texttt{legalpaper} \|
118 % \texttt{executivepaper}] Select the output paper size. Since
119 % \strayman\ is intended to be used mainly for manuals, the default
122 % \item [\texttt{landscape}] Swaps the width and height of the paper.
123 % Probably not much use, to be honest.
125 % \item [\texttt{9pt} \| \texttt{10pt} \| \texttt{11pt} \| \texttt{12pt}]
126 % Selects the basic type size for the document. The |9pt| option is
127 % nonstandard, but it is the default, since larger sizes don't work
130 % \item [\texttt{text}] Sets up the page layout and fonts so that the
131 % output can be converted fairly easily into a raw text file.
133 % \item [\texttt{oneside} \| \texttt{twoside}] Selects one- or two-sided
134 % page layouts. Note that one-sided output doesn't look too good.
136 % \item [\texttt{draft} \| \texttt{final}] Select various options for draft
139 % \item [\texttt{titlepage} \| \texttt{notitlepage}] Selects whether
140 % the |\maketitle| displays its output on a separate title page.
142 % \item [\texttt{openright} \| \texttt{openany}] Select whether chapters
143 % start only on quarto pages, or any page. The default is |openright|.
145 % \item [\texttt{onecolumn} \| \texttt{twocolumn}] Choose whether the
146 % main body text is set in one or two columns. Note that this uses
147 % \LaTeX's built-in column handling, not the \package{multicol}
150 % \item [\texttt{leqno}] Put the equation numbers on the left, not the
153 % \item [\texttt{fleqn}] Typeset displayed equations left aligned.
155 % \item [\texttt{openbib}] Use the `open' style for the bibliography.
157 % \item [\texttt{article}] Change the formatting slightly, in a way more
158 % suited to short documents.
160 % \item [\texttt{square} \| \texttt{rounded}] These options are passed
161 % directly to the \package{syntax} package, when it's loaded.
163 % \item [\texttt{helvetica}] Typeset headings in the Helvetica font,
164 % not in Computer Modern.
166 % \item [\texttt{palatino}] Typeset the main body text in Palatino, and
167 % headings in Helvetica. The |\tt| font is changed to Courier, but
168 % see the \texttt{cmtt} option.
170 % \item [\texttt{times}] Typeset the main body text in Times, and headings
171 % in Helvetica. The |\tt| font is changed to Courier, but see the
172 % \texttt{cmtt} option.
177 % \section{The \texttt{text} option}
179 % In order to facilitate creation of attractively formatted text files
180 % from \LaTeX\ documents, \strayman\ provides a |text| option. This will
181 % set up \emph{all} the fonts to be monospaced, in the same size. The page
182 % size is set up to be a multiple of the character size. The command
184 % "dvi2tty -e-17" <filename>
186 % appears to produce a reasonable output from a DVI file created in this
187 % way. The output will need to be formatted and corrected slightly by hand
188 % although there's a good deal less work to do than might be required
192 % \section{That's it}
194 % That's all I'm writing for now. It's a document class. It defines the
195 % style. What more do you expect?
200 % \chapter{Implementation}
202 % \section{Options handling}
204 % From here on, a lot of the code is shamelessly borrowed from
205 % \file{book.cls} and other places. This is what code re-use is for.
207 % This bit handles all the options on the |\documentclass| command, either
208 % altering our own internal arguments, or loading other packages as
211 % \subsection{Set up some defaults}
213 % We create some variables to hold the settings, and initialise them to
218 \newcommand\@ptsize{}
219 \newif\if@restonecol\@restonecolfalse
220 \newif\if@titlepage\@titlepagetrue
221 \newif\if@openright\@openrighttrue
222 \newif\if@openbib\@openbibfalse
223 \newif\if@appendix\@appendixfalse
224 \newif\if@article\@articlefalse
225 \newif\if@offsetpages\@offsetpagestrue
226 \newif\if@numbering\@numberingfalse
227 \newif\if@herefloats\@herefloatstrue
228 \newif\if@runinsubsubsec\@runinsubsubsecfalse
229 \newdimen\pagesurround
230 \let\headfam\rmfamily
231 \let\pad@margin\@empty
234 \expandafter\def\expandafter\@delayed\expandafter{\@delayed#1}%
238 % \subsection{Declare the options we support}
240 % This is just a tedious list of all the options.
243 \DeclareOption{a4paper}{%
248 \DeclareOption{a5paper}{%
253 \DeclareOption{b5paper}{%
258 \DeclareOption{letterpaper}{%
263 \DeclareOption{legalpaper}{%
268 \DeclareOption{executivepaper}{%
273 \DeclareOption{landscape}{%
274 \@tempdima\paperheight%
275 \paperheight\paperwidth%
276 \paperwidth\@tempdima%
278 \DeclareOption{8pt}{\renewcommand\@ptsize{8pt}}
279 \DeclareOption{9pt}{\renewcommand\@ptsize{9pt}}
280 \DeclareOption{10pt}{\renewcommand\@ptsize{10pt}}
281 \DeclareOption{11pt}{\renewcommand\@ptsize{11pt}}
282 \DeclareOption{12pt}{\renewcommand\@ptsize{12pt}}
283 \DeclareOption{text}{%
284 \renewcommand\@ptsize{text}%
285 \setbox\z@\hbox{\texttt{M\strut}}%
286 \newdimen\tt@chw\tt@chw\wd\z@%
287 \newdimen\tt@chh\tt@chh\ht\z@\advance\tt@chh\dp\z@%
288 \paperwidth77\tt@chw%
289 \paperheight60\tt@chh%
293 \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
294 \DeclareOption{twoside}{\@twosidetrue \@mparswitchfalse \reversemarginpar}
295 \DeclareOption{draft}{\overfullrule5\p@}
296 \DeclareOption{final}{\overfullrule\z@}
297 \DeclareOption{titlepage}{\@titlepagetrue}
298 \DeclareOption{notitlepage}{\@titlepagefalse}
299 \DeclareOption{openright}{\@openrighttrue}
300 \DeclareOption{openany}{\@openrightfalse}
301 \DeclareOption{onecolumn}{\@twocolumnfalse}
302 \DeclareOption{twocolumn}{\@twocolumntrue}
303 \DeclareOption{offsetpages}{\@offsetpagestrue}
304 \DeclareOption{nooffsetpages}{\@offsetpagesfalse}
305 \DeclareOption{herefloats}{\@herefloatstrue}
306 \DeclareOption{noherefloats}{\@herefloatsfalse}
307 \DeclareOption{leqno}{\input{leqno.clo}}
308 \DeclareOption{fleqn}{\input{fleqn.clo}}
309 \DeclareOption{openbib}{\@openbibtrue}
310 \DeclareOption{article}{\@articletrue}
311 \DeclareOption{numbering}{\@numberingtrue}
312 \DeclareOption{nonumbering}{\@numberingfalse}
313 \DeclareOption{runinsubsubsec}{\@runinsubsubsectrue}
314 \DeclareOption{noruninsubsubsec}{\@runinsubsubsecfalse}
317 % \subsection{Set up the options}
319 % We set up some default options, and then read the user's.
322 \ExecuteOptions{a5paper,8pt,twoside,onecolumn,final,openright}
326 % If this is PDF\TeX\ then tell it the page bounds.
329 \@ifundefined{pdfpageheight}{
332 \pdfpageheight\paperheight
333 \pdfpagewidth\paperwidth
337 % \subsection{Read in the text size option}
339 % The text sizing is rather messy. We store this in a separate file. To
340 % keep this stuff away from other classes, we use the file \emph{extension}
341 % as the size specifier, rather than the filename, which is the normal
342 % \LaTeX\ way of doing this. This is a \riscos\ thing mainly: I don't like
343 % loads of directories cluttering up my disk, and it means that I can move
344 % the whole of the \strayman\ stuff around as one directory.
347 \input{strayman.\@ptsize}
351 % \section{Package loading}
355 \RequirePackage{fancyhdr}
356 \RequirePackage{multicol}
361 % \section{Page layout}
363 % This is largely the domain of the size option files.
366 %<*8pt|9pt|10pt|11pt|12pt|text>
367 %<+8pt>\ProvidesFile{strayman.8pt}
368 %<+9pt>\ProvidesFile{strayman.9pt}
369 %<+10pt>\ProvidesFile{strayman.10pt}
370 %<+11pt>\ProvidesFile{strayman.11pt}
371 %<+12pt>\ProvidesFile{strayman.12pt}
372 %<+text>\ProvidesFile{strayman.text}
375 % \subsection{Font sizes}
377 % These are fairly standard, and mainly copied from the original size
380 % \begin{macro}{\@setparskip}
382 % Because we separate paragraphs by vertical space, we need to vary this
383 % gap when we change font size. This macro does the job.
387 \relax\ifdim\parskip=\z@\else%
388 \parskip.67\baselineskip\@plus\p@\relax%
394 % \begin{macro}{\normalsize}
396 % Defines the standard size of text in the document.
399 \renewcommand\normalsize{%
401 \@setfontsize\normalsize\@viiipt\@xpt%
402 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
403 \abovedisplayshortskip\z@\@plus3\p@%
404 \belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
407 \@setfontsize\normalsize\@ixpt\@xipt%
408 \abovedisplayskip9\p@\@plus2\p@\@minus5\p@%
409 \abovedisplayshortskip\z@\@plus3\p@%
410 \belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
413 \@setfontsize\normalsize\@xpt\@xiipt%
414 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
415 \abovedisplayshortskip\z@\@plus3\p@%
416 \belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
419 \@setfontsize\normalsize\@xipt{13.6}%
420 \abovedisplayskip11\p@\@plus3\p@\@minus6\p@%
421 \abovedisplayshortskip\z@\@plus3\p@%
422 \belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
425 \@setfontsize\normalsize\@xiipt{14.5}%
426 \abovedisplayskip12\p@\@plus3\p@\@minus7\p@%
427 \abovedisplayshortskip\z@\@plus3\p@%
428 \belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
431 \@setfontsize\normalsize\@xpt\@xiipt%
432 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
433 \abovedisplayshortskip\z@\@plus3\p@%
434 \belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
436 \belowdisplayskip\abovedisplayskip%
445 % \begin{macro}{\small}
447 % The |\small| size is defined with similar care to |\normalsize|. The
448 % list defaults are altered to cope with our different value for |\parskip|.
449 % We can then separate this out independently from the typesize.
452 %<+text>\let\small\normalsize
453 %<*8pt|9pt|10pt|11pt|12pt>
456 \@setfontsize\small\@viipt{8.4}%
457 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
458 \abovedisplayshortskip\z@\@plus2\p@%
459 \belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
462 \@setfontsize\small\@viiipt{9.5}%
463 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
464 \abovedisplayshortskip\z@\@plus2\p@%
465 \belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
468 \@setfontsize\small\@ixpt{11}%
469 \abovedisplayskip8.5\p@\@plus3\p@\@minus4\p@%
470 \abovedisplayshortskip\z@\@plus2\p@%
471 \belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
474 \@setfontsize\small\@xpt\@xiipt%
475 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
476 \abovedisplayshortskip\z@\@plus3\p@%
477 \belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
480 \@setfontsize\small\@xipt{13.6}%
481 \abovedisplayskip11\p@\@plus3\p@\@minus6\p@%
482 \abovedisplayshortskip\z@ \@plus3\p@%
483 \belowdisplayshortskip6.5\p@ \@plus3.5\p@\@minus3\p@%
486 \leftmargin\leftmargini%
491 \belowdisplayskip\abovedisplayskip%
494 %</8pt|9pt|10pt|11pt|12pt>
498 % \begin{macro}{\footnotesize}
500 % This is also defined with the meticulous care of |\normalsize|, and
501 % altered in the same way as for |\small|.
504 %<+text>\let\footnotesize\normalsize
505 %<*8pt|9pt|10pt|11pt|12pt>
506 \newcommand\footnotesize{%
508 \@setfontsize\footnotesize\@vipt\@viipt%
509 \abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
510 \abovedisplayshortskip\z@\@plus\p@%
511 \belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
514 \@setfontsize\footnotesize\@viipt{8.4}%
515 \abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
516 \abovedisplayshortskip\z@\@plus\p@%
517 \belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
520 \@setfontsize\footnotesize\@viiipt{9.5}%
521 \abovedisplayskip6\p@\@plus2\p@\@minus4\p@%
522 \abovedisplayshortskip\z@\@plus\p@%
523 \belowdisplayshortskip3\p@\@plus\p@\@minus2\p@%
526 \@setfontsize\footnotesize\@ixpt{11}%
527 \abovedisplayskip8\p@\@plus2\p@\@minus4\p@%
528 \abovedisplayshortskip\z@\@plus\p@%
529 \belowdisplayshortskip4\p@\@plus2\p@\@minus2\p@%
532 \@setfontsize\footnotesize\@xpt\@xiipt
533 \abovedisplayskip10\p@\@plus2\p@\@minus5\p@%
534 \abovedisplayshortskip\z@\@plus3\p@%
535 \belowdisplayshortskip6\p@\@plus3\p@\@minus3\p@%
538 \leftmargin\leftmargini%
543 \belowdisplayskip\abovedisplayskip%
546 %</8pt|9pt|10pt|11pt|12pt>
550 % The other sizes are all much simpler. We introduce a new size,
551 % |\listingsize|, which is used for the \env{listing} environment, to ensure
552 % that 77 columns of text fit across an A5 sheet.
556 \newcommand\scriptsize{\@setfontsize\scriptsize\@vpt\@vipt\@setparskip}
557 \newcommand\tiny{\@setfontsize\tiny{4}\@vpt\@setparskip}
558 \newcommand\large{\@setfontsize\large\@xpt\@xiipt\@setparskip}
559 \newcommand\Large{\@setfontsize\Large\@xipt{13}\@setparskip}
560 \newcommand\LARGE{\@setfontsize\LARGE\@xiipt\@xivpt\@setparskip}
561 \newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
562 \newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
563 \newcommand\listingsize{\@setfontsize\listingsize\@viipt\@viiipt\@setparskip}
566 \newcommand\scriptsize{\@setfontsize\scriptsize\@vipt\@viipt\@setparskip}
567 \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt\@setparskip}
568 \newcommand\large{\@setfontsize\large\@xipt{13}\@setparskip}
569 \newcommand\Large{\@setfontsize\Large\@xiipt{14.4}\@setparskip}
570 \newcommand\LARGE{\@setfontsize\LARGE\@xivpt{17}\@setparskip}
571 \newcommand\huge{\@setfontsize\huge\@xviipt{20}\@setparskip}
572 \newcommand\Huge{\@setfontsize\Huge\@xxpt{26}\@setparskip}
573 \newcommand\listingsize{\@setfontsize\listingsize\@viipt\@viiipt\@setparskip}
576 \newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt\@setparskip}
577 \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt\@setparskip}
578 \newcommand\large{\@setfontsize\large\@xiipt{14}\@setparskip}
579 \newcommand\Large{\@setfontsize\Large\@xivpt{18}\@setparskip}
580 \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}\@setparskip}
581 \newcommand\huge{\@setfontsize\huge\@xxpt{25}\@setparskip}
582 \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}\@setparskip}
583 \newcommand\listingsize{\@setfontsize\listingsize\@viipt\@viiipt\@setparskip}
586 \newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}\@setparskip}
587 \newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt\@setparskip}
588 \newcommand\large{\@setfontsize\large\@xiipt{14}\@setparskip}
589 \newcommand\Large{\@setfontsize\Large\@xivpt{18}\@setparskip}
590 \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}\@setparskip}
591 \newcommand\huge{\@setfontsize\huge\@xxpt{25}\@setparskip}
592 \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}\@setparskip}
593 \newcommand\listingsize{\@setfontsize\listingsize\@viiipt{9.5}\@setparskip}
596 \newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}\@setparskip}
597 \newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt\@setparskip}
598 \newcommand\large{\@setfontsize\large\@xivpt{18}\@setparskip}
599 \newcommand\Large{\@setfontsize\Large\@xviipt{22}\@setparskip}
600 \newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}\@setparskip}
601 \newcommand\huge{\@setfontsize\huge\@xxvpt{30}\@setparskip}
603 \newcommand\listingsize{\@setfontsize\listingsize\@viiipt{9.5}\@setparskip}
606 \def\scriptsize{\@setfontsize\scriptsize\@xpt\@xiipt\@setparskip}
608 \let\large\scriptsize
609 \let\Large\scriptsize
610 \let\LARGE\scriptsize
613 \let\listingsize\scriptsize
615 \let\txt@selectfont\selectfont
617 \fontfamily\ttdefault%
623 %</8pt|9pt|10pt|11pt|12pt|text>
626 % \subsection{Paragraph layout}
628 % Here we define various paragraph layout parameters.
630 % First, set up the line separation parameters. |\baselineskip| is set
631 % up by the individual size commands.
639 % We don't try to stretch the baselines apart:
642 \renewcommand\baselinestretch{}
645 % We don't indent paragraphs at all; instead, we separate them with blank
646 % lines. The vertical gap is worked out in the size command; we just clear
653 % Set up some standard penalty values.
662 % \subsection{Page layout}
664 % Our layout is a bit different to the standard \LaTeX\ ones: we leave a lot
665 % of space down the left hand side: this is reserved for headings and
668 % Calculating the size of the space on the left, which we call |\leftindent|,
669 % is complicated. We want to use as much of the width of the page as
670 % possible, unlike the \LaTeX\ defaults, making sure that we can fit on
671 % 77 columns of |\listingsize\tt| text. We also try to make space for a
672 % reasonable amount of marginal text, although we don't worry too much if
675 % The calculation is done as follows. More than about 40\,mm of margin will
676 % look very strange. We must have at least 104\,mm of main text, which
677 % leaves 20\,mm for the notes on A5 paper (actually, 17\,mm, since we leave
678 % 3\,mm gap between the notes and the main text). We divide the page
679 % horizontally into $s$\,mm of left border, $m$\,mm of marginal notes,
680 % $t$\,mm of body text, and another $s$\,mm of right border, giving
681 % a total of $w$\,mm. The value $s$ is given to us by the parameter
684 % Articles look odd with a big gap down the side, so this is reduced when
687 % We calculate the quantity~$m$ as $\min\bigl(40,17(w-2s-3)/121+3\bigr)$\@.
688 % Then we calculate $t=w-m-24-3$.
691 %<*8pt|9pt|10pt|11pt|12pt|text>
693 %<*8pt|9pt|10pt|11pt|12pt>
694 \leftindent\paperwidth
696 \advance\leftindent-2\pagesurround
697 \advance\leftindent-3mm
698 \leftindent0.1405\leftindent
699 \advance\leftindent3mm
700 \ifdim\leftindent>40mm\relax
703 \if@article\divide\leftindent\tw@\fi
704 \ifdim\leftindent<15mm\leftindent15mm\fi
708 %</8pt|9pt|10pt|11pt|12pt>
709 %<+text>\leftindent8\tt@chw
712 % In two-column layouts, we prevent headings from being outdented, by
713 % zeroing |\sectindent|. Chapter headings and suchlike are still outdented
714 % as before. We do not support margin paragraphs in two-column layouts.
721 \sectindent\if@numbering\z@\else\if@article\else\tw@\fi\leftindent\fi
725 % Having set up the size of the margin, we can get on with the rest of the
728 % First, we fix |\hoffset| and |\voffset| so we can work on the whole size
736 % Now we can design the page layout in earnest. We begin with the vertical
742 %<+10pt>\topskip10\p@
743 %<+11pt>\topskip11\p@
744 %<+12pt>\topskip12\p@
745 %<+text>\topskip\tt@chh
746 %<-text>\topmargin\pagesurround
747 %<+text>\topmargin\z@
748 %<-text>\headheight12\p@
749 %<+text>\headheight12\p@
750 %<-text>\headsep.5\pagesurround
751 %<+text>\headsep2\tt@chh
752 %<+text>\advance\headsep-12\p@
753 %<-text>\footskip12\p@
754 %<-text>\advance\footskip.5\pagesurround
755 %<+text>\footskip2\tt@chh
756 \textheight\paperheight
757 %<-text>\advance\textheight-24\p@
758 %<-text>\advance\textheight-3\pagesurround
759 %<+text>\advance\textheight-4\tt@chh
762 % Now we define the horizontal layout.
765 \oddsidemargin\leftindent
766 %<-text>\advance\oddsidemargin\pagesurround
767 \evensidemargin\oddsidemargin
768 \textwidth\paperwidth
769 \advance\textwidth-\oddsidemargin
770 %<-text> \advance\textwidth-\pagesurround
771 %<-text>\marginparsep3mm
772 %<+text>\marginparsep\tt@chw
773 \marginparwidth\leftindent
774 \advance\marginparwidth-\marginparsep
777 % Setting |\maxdepth| is fairly simple. This looks odd, because normally
778 % there's some messing for compatibility with \LaTeX~2.09.
785 % Marginal notes need some setting up.
791 % Footnotes need some setting up now.
794 %<+8pt>\footnotesep5.8\p@
795 %<+9pt>\footnotesep6.2\p@
796 %<+10pt>\footnotesep6.65\p@
797 %<+11pt>\footnotesep7.7\p@
798 %<+12pt>\footnotesep8.4\p@
799 %<+8pt>\setlength{\skip\footins}{7\p@\@plus4\p@\@minus2\p@}
800 %<+9pt>\setlength{\skip\footins}{8\p@\@plus4\p@\@minus2\p@}
801 %<+10pt>\setlength{\skip\footins}{9\p@\@plus4\p@\@minus2\p@}
802 %<+11pt>\setlength{\skip\footins}{10\p@\@plus4\p@\@minus2\p@}
803 %<+12pt>\setlength{\skip\footins}{10.8\p@\@plus4\p@\@minus2\p@}
804 %</8pt|9pt|10pt|11pt|12pt|text>
807 % \subsection{Float placement}
809 % First, we determine how we position the floats on the page.
813 \setcounter{topnumber}{2}
814 \renewcommand\topfraction{.7}
815 \setcounter{bottomnumber}{1}
816 \renewcommand\bottomfraction{.3}
817 \setcounter{totalnumber}{3}
818 \renewcommand\textfraction{.1}
819 \renewcommand\floatpagefraction{.8}
820 \setcounter{dbltopnumber}{2}
821 \renewcommand\dbltopfraction{.7}
822 \renewcommand\dblfloatpagefraction{.5}
826 % Now we define the glue which surrounds floats.
829 %<*8pt|9pt|10pt|11pt|12pt>
830 \floatsep12\p@\@plus2\p@\@minus2\p@
831 \textfloatsep20\p@\@plus2\p@\@minus4\p@
832 \dbltextfloatsep20\p@\@plus2\p@\@minus4\p@
833 %<+8pt|9pt|10pt|11pt>\intextsep12\p@\@plus2\p@\@minus 2\p@
834 %<+8pt|9pt|10pt|11pt>\dblfloatsep12\p@\@plus2\p@\@minus 2\p@
835 %<+12pt>\intextsep14\p@\@plus4\p@\@minus 4\p@
836 %<+12pt>\dblfloatsep14\p@\@plus2\p@\@minus 4\p@
839 % We must now define the parameters for float pages and columns.
842 \@fptop0\p@\@plus 1fil
843 %<+8pt|9pt|10pt|11pt>\@fpsep8\p@\@plus2fil
844 %<+12pt>\@fpsep10\p@\@plus2fil
845 \@fpbot0\p@\@plus 1fil
847 \@dblfptop0\p@\@plus 1fil
848 %<+8pt|9pt|10pt|11pt>\@dblfpsep8\p@\@plus 2fil
849 %<+12pt>\@dblfpsep10\p@\@plus2fil
850 \@dblfpbot0\p@\@plus 1fil
851 %</8pt|9pt|10pt|11pt|12pt>
854 % \section{Headers and footers}
856 % This part defines the standard page styles. By default, \strayman\
857 % imports \package{fancyheadings} and uses them, although this section is
858 % retained in case anything actually needs the original \LaTeX-style
864 \let\@oddfoot\@empty\let\@evenfoot\@empty
865 \def\@evenhead{\thepage\hfil\slshape\leftmark}%
866 \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
867 \let\@mkboth\markboth
868 \def\chaptermark##1{\markboth {##1}{}}%
869 \def\sectionmark##1{\markright {##1}}%
873 \let\@oddfoot\@empty\let\@evenfoot\@empty
874 \def\@evenhead{\thepage\hfil\slshape\leftmark}%
875 \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
876 \let\@mkboth\@gobbletwo
877 \let\chaptermark\@gobble
878 \let\sectionmark\@gobble
884 % \begin{macro}{\maketitle}
885 % This is a bit of a thorny issue at the moment. Really, these titles need
886 % a complete rewrite. The |\maketitle| command will only be used for inside
887 % front covers anyway. I'm wondering if it wouldn't be better just to use
888 % special case code for each individual manual. Until a decision is made,
889 % I'll leave this as it was in \package{book}.
892 % This code is largely uncommented. It seems to be fairly straightforward,
893 % and if I do need to change it, I'll probably start again from scratch
900 \newcommand\maketitle{%
902 \let\footnotesize\small%
903 \let\footnoterule\relax%
912 \begin{tabular}[t]{c}%
918 {\large \@date \par}% % Set date in \large size.
924 \setcounter{footnote}{0}%
926 \let\maketitle\relax%
934 \newcommand\maketitle{%
937 \renewcommand\thefootnote{\fnsymbol{footnote}}%
938 \def\@makefnmark{\hb@xt@\z@{$\m@th^{\@thefnmark}$\hss}}%
939 \long\def\@makefntext##1{%
940 \parindent1em\noindent%
941 \hb@xt@1.8em{\hss$\m@th^{\@thefnmark}$}##1%
944 \ifnum\col@number=\@ne%
947 \twocolumn[\@maketitle]%
951 \global\@topnum\z@% % Prevents figures from going at top of page.
954 \thispagestyle{plain}%
957 \setcounter{footnote}{0}%
959 \let\maketitle\relax%
960 \let\@maketitle\relax%
978 \begin{tabular}[t]{c}%
992 % \begin{environment}{titlepage}
994 % The \env{titlepage} environment typesets its contents on a title page.
995 % The implementation is fairly straightforward: we just need to do some
996 % fiddling with two-column layouts. We also add in some hacking to make
997 % title pages centred properly, a bit like the \env{central} environment.
1000 \newenvironment{titlepage}{%
1003 \@restonecoltrue\onecolumn%
1005 \@restonecolfalse\newpage%
1009 \setcounter{page}{0}%
1012 \thispagestyle{empty}%
1022 % \begin{macro}{\centrepage}
1024 % Change the page layout to centre everything properly. We guard against
1025 % this sort of thing happening again by clearing |\leftindent| and
1026 % |\sectindent|. This should only be cleared after the page has been
1027 % finished, for obvious reasons.
1031 \advance\oddsidemargin-\leftindent%
1032 \advance\evensidemargin-\leftindent%
1033 \advance\textwidth\leftindent%
1034 \advance\linewidth\leftindent%
1035 \advance\leftmargini0.5\leftindent%
1043 % \section{Sectioning commands}
1045 % In \strayman, quite a lot of the sectioning is different. We
1046 % don't tend to number sections much. Also, the chapter heading style has
1047 % been completely rewritten (several times).
1049 % \subsection{Setting up the counters}
1051 % This is pretty simple stuff.
1054 \newcommand\chaptermark[1]{}
1055 \setcounter{secnumdepth}{\if@numbering\if@runinsubsubsec2\else3\fi\else0\fi}
1057 \newcounter {chapter}
1058 \newcounter {section}[chapter]
1059 \newcounter {subsection}[section]
1060 \newcounter {subsubsection}[subsection]
1061 \newcounter {paragraph}[subsubsection]
1062 \newcounter {subparagraph}[paragraph]
1063 \renewcommand\thepart {\Roman{part}}
1064 \renewcommand\thechapter {\arabic{chapter}}
1066 \renewcommand\thesection {\arabic{section}}
1068 \renewcommand\thesection {\thechapter.\arabic{section}}
1070 \renewcommand\thesubsection {\thesection.\arabic{subsection}}
1071 \renewcommand\thesubsubsection {\thesubsection .\arabic{subsubsection}}
1072 \renewcommand\theparagraph {\thesubsubsection.\arabic{paragraph}}
1073 \renewcommand\thesubparagraph {\theparagraph.\arabic{subparagraph}}
1076 % \subsection{Frontmatter, mainmatter and backmatter}
1078 % We start off thinking we're in the main matter. The user ought to put a
1079 % |\frontmatter| command at the beginning of the document if this is not
1080 % correct, as it usually won't be.
1083 \newif\if@mainmatter
1085 \newcommand\frontmatter{%
1088 \pagenumbering{roman}%
1090 \newcommand\mainmatter{%
1093 \pagenumbering{arabic}%
1095 \newcommand\backmatter{%
1105 % \subsection{Abstracts}
1107 % \begin{environment}{abstract}
1109 % The \env{abstract} environment reduces the type size and margins slightly.
1110 % Abstracts are placed on their own pages when the |titlepage| option is
1111 % enabled. The code is filched from the LaTeX article class.
1115 \newenvironment{abstract}{%
1118 \@beginparpenalty\@lowpenalty
1120 \bfseries \abstractname
1123 {\par\vfil\null\endtitlepage}
1125 \newenvironment{abstract}{%
1127 \section*{\abstractname}%
1133 \fontseries{b}\fontfamily\headdefault\selectfont%
1136 \labelsep1em\labelwidth\z@\itemindent\labelsep%
1137 \rightmargin\leftmargin%
1139 \item[\abstractname]%
1141 {\if@twocolumn\else\endlist\fi}
1146 % \subsection{Appendices}
1148 % \begin{macro}{\appendix}
1150 % This command sets everything up to typeset the appendix.
1153 \newcommand\appendix{%
1155 \setcounter{chapter}{0}%
1156 \setcounter{section}{0}%
1157 \renewcommand\@chapapp{\appendixname}%
1159 \renewcommand\thesection{\Alph{section}}%
1161 \renewcommand\thechapter{\Alph{chapter}}%
1168 % \subsection{Parts}
1170 % Part headings are typeset on completely unadorned sheets, devoid of page
1171 % numbers and suchlike. Because of the strange page layout, we have to
1172 % put the part heading into a |central| environment. to stop the page looking
1173 % horribly lopsided.
1175 % \begin{macro}{\part}
1177 % The |\part| macro moves to an appropriate page, changes the pagestyle to
1178 % empty to switch off page numbering, and then calls |\@part| or |\@spart|
1179 % as appropriate, according to whether a \lit* was supplied. We put some
1180 % |\vfil| glue in, to vertically centre anything that these commands typeset,
1181 % and ensure printing in a single column.
1186 \thispagestyle{empty}%
1195 \secdef\@part\@spart%
1199 % \begin{macro}{\@part}
1201 % This is where most of the part heading typesetting is done. We stick a
1202 % line in the contents file, clear the heading markers, and typeset the
1203 % heading in the biggest letters we can find. When we're done, we call
1204 % |\@endpart| to do some common cleaning up.
1208 \ifnum\c@secnumdepth>-2\relax%
1209 \refstepcounter{part}%
1210 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
1212 \addcontentsline{toc}{part}{#1}%
1216 \interlinepenalty\@M%
1218 \ifnum\c@secnumdepth>-2\relax%
1219 \huge\bfseries\headfam\partname~\thepart%
1223 \normalfont\Huge\bfseries\headfam#2\par%
1229 % \begin{macro}{\@spart}
1231 % Here we typeset just the part heading: numbers have been suppressed. Also
1232 % we don't put things into the contents file. Otherwise, this is similar to
1238 \interlinepenalty\@M%
1240 \normalfont\Huge\bfseries\headfam#1\par%
1246 % \begin{macro}{\@endpart}
1248 % This does the clearing up operation after a part has been typeset. We
1249 % insert the other |\vfil| glue to centre the heading, clear the other
1250 % side of the page, if printing two-sided, and return if necessary to
1251 % two-column printing.
1259 \thispagestyle{empty}%
1270 % \subsection{Chapters}
1272 % The chapter typesetting has been more-or-less rewritten. We'll follow this
1273 % in a reasonable amount of detail.
1275 % \begin{macro}{\@chapapp}
1277 % Because |\appendix| needs to change what chapters are called, we add a
1278 % level of indirection through |\@chapapp|:
1281 \newcommand\@chapapp{\chaptername}
1285 % \begin{macro}{\chapter}
1287 % The |\chapter| command is the main dispatcher for chapters. We move to
1288 % an appropriate page, depending on the |openright| setting, suppress
1289 % headers, and then call |\@chapter| or |\@schapter| as appropriate.
1292 \newcommand\chapter{%
1298 \thispagestyle{plain}%
1301 \secdef\@chapter\@schapter%
1305 % \begin{macro}{\@chapter}
1307 % There's a lot of messing about to do, depending on whether we're in the
1308 % main matter and so on. We'll take this carefully.
1311 \def\@chapter[#1]#2{%
1314 % The first thing to do is put a line in the contents table. We need to
1315 % check |secnumdepth| and the |mainmatter| flag for this: we should only
1316 % include a number if both these tests pass. In this case, we also type a
1317 % message on the terminal.
1320 \ifnum\c@secnumdepth>\m@ne%
1322 \refstepcounter{chapter}%
1323 \typeout{\@chapapp\space\thechapter.}%
1324 \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
1326 \addcontentsline{toc}{chapter}{#1}%
1329 \addcontentsline{toc}{chapter}{#1}
1333 % Now we put a bit of space in the lists of figures and tables, and set up
1334 % the mark to put the chapter heading in the running header.
1337 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1338 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1341 % Finally, we need to decide how to typeset the chapter heading. On
1342 % single-column chapters, this is easy. On double-column formats, we need
1343 % to do horrid things with |\@topnewpage|.
1347 \@topnewpage[\@makechapterhead{%
1348 \hb@xt@.5\leftindent{\thechapter\hfil}%
1352 \hb@xt@.5\leftindent{\thechapter\hfil}%
1360 % \begin{macro}{\@makechapterhead}
1362 % This macro actually does the job of typesetting a chapter heading. Call
1363 % this routine as |\@makechapterhead{|\synt{number}|}{|\synt{title}|}|.
1364 % Here, \synt{number} is how to typeset the chapter number, and \synt{title}
1365 % is the rest of the title. To suppress the number, just leave \synt{number}
1366 % empty. The number is only typeset when it is correct to do so anyway.
1368 % The spacing is rather awkward. We have to cope with two-column layouts,
1369 % which seem to require different spacing. In a double-column layout,
1370 % the title is normally one |\baselineskip| too high. Also, the space I
1371 % add at the bottom of the heading gets eaten in double-column chapters,
1372 % because I'm actually typesetting into a vbox which is floated to the top
1373 % by \LaTeX\ in a fairly horrid way. This can't really be worked around,
1374 % so we just make the space beneath the heading equal to |\dbltextfloatsep|,
1375 % which is what gets added anyway.
1377 % The other snags are to do with the rule after the chapter heading.
1378 % Firstly, this is meant to be typeset into the left margin, like the
1379 % heading itself, which is a bit messy. More awkwardly, we have to be
1380 % careful not to let the depth of the line vary when the chapter heading has
1381 % descenders, although obviously we must lower the rule if the heading really
1382 % is very deep indeed.
1385 % We'll approach this a bit at a time.
1388 \def\@makechapterhead#1#2{%
1389 \begingroup% % Stop my hacking messing things up
1392 % First, the top spacing. This is divided into two parts, by an invisible
1393 % rule: the |\vskip| above the rule is eaten by \TeX\ if this is a genuine
1394 % new page, but put into the floating vbox if this is a two-column affair.
1395 % The second bit is added in both cases.
1398 \vskip\baselineskip% % This is gobbled in single column
1399 \hrule\@height\z@% % Stops TeX from binning my vskips
1400 \vskip32\p@% % Start chapters in a funny place
1403 % Now we actually typeset the heading. This is fairly simple: we must just
1404 % check that we need to typeset the number.
1407 \normalfont\Huge\bfseries\headfam% % Choose a nice font for it
1408 \raggedright % Don't justify -- it looks nasty
1409 \@hangfrom{\hskip-\leftindent}% % Start text at `real left margin'
1410 \ifnum\c@secnumdepth>\m@ne% % Do we typeset chapter numbers?
1411 \if@mainmatter% % Are we past the front matter?
1412 #1% % Yes -- then typeset the number
1413 \fi\fi% % Now back to normality
1414 {#2}% % Typeset the actual chapter head
1415 \par\nobreak% % Back to vmode again, please
1418 % The next tricky bit is the space before the ruleoff. We must be careful
1423 % \item We want the rule to be the right depth below the heading baseline,
1424 % regardless of whether the heading contains descenders: helpfully, \TeX\
1425 % omits |\baselineskip| glue before and after rules.
1427 % \item We want the rule to always be below any oddly deep descenders that
1428 % a strange user might throw at us (e.g., horrid fractions or weird
1433 % We accomplish this by scrutinising |\prevdepth| carefully.
1436 \@tempdima14\p@% % Be this low below the baseline
1437 \advance\@tempdima-\prevdepth% % This is the actual skip then
1438 \ifdim\@tempdima<8\p@% % Is this not enough skippage?
1439 \@tempdima8\p@% % No: then skip some more
1441 \vskip\@tempdima% % Skip a bit below the title
1444 % Now we can set the rule. This needs a little care.
1447 \@tempskipa\textwidth% % Find the width of the column
1448 \advance\@tempskipa\leftindent% % Add on the big lefthand gap
1449 \nointerlineskip% % Don't add any more space please
1450 \moveleft\leftindent\vbox{% % Shift something left by an amount
1451 \hrule\@width\@tempskipa% % Typeset the rule nicely
1453 \nointerlineskip% % Don't leave a gap beneath it
1456 % Finally, we leave a gap. In two-column layouts this is done for us, and
1457 % \LaTeX\ gobbles this glue and replaces it with |\dbltextfloatsep|. To make
1458 % things consistent, this is the glue we use anyway.
1461 \nobreak% % This would be a bad place to break
1462 \vspace{\dbltextfloatsep}% % Add in some extra glue beneath
1468 % \begin{macro}{\@makeschapterhead}
1470 % This is now just a veneer onto |\@makechapterhead|. It's needed, because
1471 % other bits of \LaTeX\ call it.
1474 \def\@makeschapterhead{%
1480 % \begin{macro}{\@schapter}
1482 % This macro typesets a starred chapter heading. This is terribly simple,
1483 % compared to the sort of things we've been doing so far.
1488 \@topnewpage[\@makeschapterhead{#1}]%
1490 \@makeschapterhead{#1}%
1498 % \subsection{The other sectioning commands}
1500 % These are all defined through |\@startsection|. They've been modified
1501 % to typeset sections and subsections hanging into the left margin, and to
1502 % moderate the amount of following space, due to the extra |\parskip| already
1506 \newcommand\section{%
1508 {section}% % Section name (for contents)
1509 {1}% % Level number (for numbering)
1510 {-.5\sectindent}% % Indentation of title
1511 {-1.5ex\@plus-1ex\@minus-.2ex}% % Space after title (vert/horiz)
1512 {.3ex\@plus.2ex}% % Space before title
1513 {\reset@font\Large\bfseries\headfam}% How to typeset the title
1515 \newcommand\subsection{%
1520 {-1.25ex\@plus-1ex\@minus-.2ex}%
1522 {\reset@font\large\bfseries\headfam}%
1525 \newcommand\subsubsection{%
1530 {0pt\@plus1ex\@minus.2ex}%
1532 {\reset@font\normalsize\bfseries\headfam}%
1534 \newcommand\paragraph{%
1539 {0pt\@plus.5ex\@minus.1ex}%
1541 {\reset@font\normalsize\bfseries\headfam}%
1543 \newcommand\subparagraph{%
1548 {0pt\@plus.5ex\@minus.1ex}%
1550 {\reset@font\normalsize\bfseries\headfam}%
1553 \newcommand\subsubsection{%
1558 {-1.25ex\@plus-1ex\@minus-.2ex}%
1560 {\reset@font\normalsize\bfseries\headfam}%
1562 \newcommand\paragraph{%
1567 {0pt\@plus1ex\@minus.2ex}%
1569 {\reset@font\normalsize\bfseries\headfam}%
1571 \newcommand\subparagraph{%
1576 {0pt\@plus.5ex\@minus.1ex}%
1578 {\reset@font\normalsize\bfseries\headfam}%
1583 % \subsection{Section number formatting}
1585 % \begin{macro}{\@seccntformat}
1587 % The macro is given a section counter and must format it in some nice way.
1590 \def\@seccntformat#1{%
1591 \llap{\csname the#1\endcsname{\normalsize\quad}\hfil}%
1594 % \subsection{Top level sectioning}
1596 % \begin{macro}{\@topsect}
1598 % Articles are divided into sections; other documents are divided into
1599 % chapters. Things like the table of contents need to know which.
1603 \def\@topsect{\section*}
1605 \let\@topsect\chapter
1612 % \section{List handling}
1614 % A surprising number of \LaTeX's environments are defined in terms of
1615 % lists, many of which hide the fact by putting the entire text in one big
1618 % This part of the document class has to set up lots of list parameters.
1619 % This is largely the same as the standard classes, altered slightly to cope
1620 % with the different paragraph spacing.
1622 % \subsection{General list parameters}
1624 % Default left margins for lists:
1633 \leftmarginiii1.87em
1644 % Other spacing defaults:
1647 \leftmargin\leftmargini
1649 \labelwidth\leftmargini
1650 \advance\labelwidth-\labelsep
1651 \partopsep\z@\@plus1\p@\@minus1\p@
1654 % Interline penalties:
1657 \@beginparpenalty -\@lowpenalty
1658 \@endparpenalty -\@lowpenalty
1659 \@itempenalty -\@lowpenalty
1662 % Now we define the defaults for the list environments. These have managed
1663 % to migrate from the size options into the main document class.
1667 \leftmargin\leftmargini%
1673 \@listi\topsep\parskip%
1675 \leftmargin\leftmarginii%
1676 \labelwidth\leftmarginii%
1677 \advance\labelwidth-\labelsep%
1680 \leftmargin\leftmarginiii%
1681 \labelwidth\leftmarginiii%
1682 \advance\labelwidth-\labelsep%
1683 \partopsep\p@\@plus\z@\@minus\p@%
1686 \leftmargin\leftmarginiv%
1687 \labelwidth\leftmarginiv%
1688 \advance\labelwidth-\labelsep%
1691 \leftmargin\leftmarginv%
1692 \labelwidth\leftmarginv%
1693 \advance\labelwidth-\labelsep%
1696 \leftmargin\leftmarginvi%
1697 \labelwidth\leftmarginvi%
1698 \advance\labelwidth-\labelsep%
1702 % \subsection{Enumerated lists}
1704 % We busily redefine all the counters for enumerated lists, and how to
1707 % How to typeset the numbers:
1710 \renewcommand\theenumi{\arabic{enumi}}
1711 \renewcommand\theenumii{\alph{enumii}}
1712 \renewcommand\theenumiii{\roman{enumiii}}
1713 \renewcommand\theenumiv{\Alph{enumiv}}
1716 % Typesetting the item labels:
1719 \newcommand\labelenumi{\theenumi.}
1720 \newcommand\labelenumii{(\theenumii)}
1721 \newcommand\labelenumiii{\theenumiii.}
1722 \newcommand\labelenumiv{\theenumiv.}
1725 % And finally how to typeset references to the items:
1728 \renewcommand\p@enumii{\theenumi}
1729 \renewcommand\p@enumiii{\theenumi(\theenumii)}
1730 \renewcommand\p@enumiv{\p@enumiii\theenumiii}
1733 % \subsection{Itemized lists}
1735 % We set up the various bullet shapes for the itemized lists.
1738 \newcommand\labelitemi{$\m@th\bullet$}
1739 \newcommand\labelitemii{\normalfont\bfseries --}
1740 \newcommand\labelitemiii{$\m@th\ast$}
1741 \newcommand\labelitemiv{$\m@th\cdot$}
1744 % \subsection{Description lists}
1746 % This has been redefined a little to make it more sensible. The old version
1747 % had a weird |\hspace\labelsep| in the labelling macro. This has now been
1748 % added into the main list definition. You can now redefine
1749 % |\descriptionlabel| without fear of messing up the spacing.
1751 % \begin{environment}{description}
1753 % Here we set up the main list parameters. The label width is zeroed to
1754 % ensure that the text is always indented nicely.
1760 \itemindent-\leftmargin%
1761 \advance\itemindent\labelsep%
1762 \def\makelabel{\descriptionlabel}%
1765 \let\enddescription\endlist
1768 % \begin{macro}{\descriptionlabel}
1770 % This typesets a description label. Redefine it the obvious way for
1771 % different exciting effects.
1774 \def\descriptionlabel#1{\normalfont\bfseries #1}
1780 % \subsection{Other list-based environments}
1782 % Several other standard environments are defined in terms of lists. These
1783 % are all dealt with here.
1785 % \begin{environment}{verse}
1787 % The \env{verse} environment is specially fiddled so that |\\| works as it
1788 % should. There's nothing else exciting about it.
1791 \newenvironment{verse}{%
1796 \listparindent\itemindent%
1797 \rightmargin\leftmargin%
1798 \advance\leftmargin1.5em%
1807 % \begin{environment}{quotation}
1809 % The \env{quotation} environment is a pretty standard display, except that
1810 % we kill off inter-paragraph space. The current definition means that
1811 % \env{quotation}s are typeset in normal indented-paragraph style, which
1812 % is inconsistent with the rest of the document style.
1815 \newenvironment{quotation}{%
1818 \itemindent\listparindent%
1819 \rightmargin\leftmargin%
1828 % \begin{environment}{quote}
1830 % This is even simpler. We just pull in the right margin a bit.
1833 \newenvironment{quote}{%
1835 \rightmargin\leftmargin%
1844 % \begin{environment}{display}
1846 % The \env{display} environment is intended for any other displays which you
1847 % need to typeset. This is \emph{not} a standard environment.
1850 \newenvironment{display}{%
1853 \rightmargin\leftmargin%
1864 % And some quick hacking of the theorem environment.
1866 % \section{Other parameters}
1868 % We define some miscellaneous parameters for standard environments.
1873 \arrayrulewidth.4\p@
1875 \tabbingsep\labelsep
1876 \skip\@mpfootins\skip\footins
1881 \renewcommand\theequation{\arabic{equation}}
1883 \@addtoreset{equation}{chapter}
1884 \renewcommand\theequation{\thechapter.\arabic{equation}}
1890 % Since raw \LaTeX\ doesn't actually define any floating objects, we have
1891 % to do some of the work here. This isn't actually terribly arduous. For
1892 % a float called \synt{float}, we have to define the following macros:
1894 % \begin{description}
1895 % \let\descriptionlabel\relax
1897 % \item[\texttt{\bslash fps@}\synt{float}] is the default float positioning
1898 % argument for the float type.
1900 % \item[\texttt{\bslash ftype@}\synt{float}] is a flag bit for the float
1901 % type. This is used in \LaTeX's |\output| routine to identify floats of
1904 % \item[\texttt{\bslash ext@}\synt{float}] is the file extension for the
1905 % list of these floats (e.g., \lit{lof} for figures).
1907 % \item[\texttt{\bslash fnum@}\synt{float}] is a macro which generates the
1908 % caption number. For figures, this expands to `|Figure~\thefigure|'.
1912 % We must also define |\@makecaption|, which typesets a float caption in
1913 % an appropriate way, and an environment for each type of float.
1915 % \subsection{Figures}
1917 % This is all fairly straightforward stuff. First, we create a counter for
1921 \newcounter{figure}[chapter]
1923 \renewcommand\thefigure{\@arabic\c@figure}
1925 \renewcommand\thefigure{\thechapter.\@arabic\c@figure}
1929 % Now we define all the macros \LaTeX\ requires.
1932 \if@herefloats\def\fps@figure{htbp}\else\def\fps@figure{tbp}\fi
1933 \def\ftype@figure{1}
1934 \def\ext@figure{lof}
1935 \def\fnum@figure{\figurename~\thefigure}
1938 % \begin{environment}{figure}
1939 % \begin{environment}{figure*}
1941 % Finally, we create the \env{figure} and \env{figure$*$} environments.
1944 \newenvironment{figure}{\@float{figure}}{\end@float}
1945 \newenvironment{figure*}{\@dblfloat{figure}}{\end@dblfloat}
1950 % \subsection{Tables}
1952 % This is pretty similar to the figure handling.
1955 \newcounter{table}[chapter]
1957 \renewcommand\thetable{\@arabic\c@table}
1959 \renewcommand\thetable{\thechapter.\@arabic\c@table}
1962 \if@herefloats\def\fps@table{htbp}\else\def\fps@table{tbp}\fi
1965 \def\fnum@table{\tablename~\thetable}
1967 \newenvironment{table}{\@float{table}}{\end@float}
1968 \newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat}
1971 % \subsection{Other float parameters}
1973 % \begin{macro}{\@makecaption}
1975 % The |\@makecaption| macro is called to display a float caption. It will
1976 % typeset its argument either centred in a box, if it is short enough, or
1977 % in a paragraph if it is longer than a line.
1980 \newlength\abovecaptionskip
1981 \newlength\belowcaptionskip
1982 \abovecaptionskip10\p@
1983 \belowcaptionskip0\p@
1985 \long\def\@makecaption#1#2{%
1986 \vskip\abovecaptionskip%
1987 \sbox\@tempboxa{#1: #2}%
1988 \ifdim\wd\@tempboxa>\hsize%
1991 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
1993 \vskip\belowcaptionskip%
1998 % \section{Font commands}
2000 % We allow the `old' font commands to do sensible \textsf{NFSS} things, since
2001 % we don't have any legacy documents. This means that we have proper
2002 % abbreviations for font changes. We also add |\nm| to return to a normal
2003 % font, whatever that may mean.
2006 \DeclareOldFontCommand{\rm}{\rmfamily}{\mathrm}
2007 \DeclareOldFontCommand{\sf}{\sffamily}{\mathsf}
2008 \DeclareOldFontCommand{\tt}{\ttfamily}{\mathtt}
2009 \DeclareOldFontCommand{\bf}{\bfseries}{\mathbf}
2010 \DeclareOldFontCommand{\md}{\mdseries}{\@nomath\md}
2011 \DeclareOldFontCommand{\it}{\itshape}{\mathit}
2012 \DeclareOldFontCommand{\up}{\upshape}{\@nomath\up}
2013 \DeclareOldFontCommand{\sl}{\slshape}{\@nomath\sl}
2014 \DeclareOldFontCommand{\sc}{\scshape}{\@nomath\sc}
2015 \DeclareOldFontCommand{\nm}{\normalfont}{\mathnormal}
2018 % Now we define some special commands which only work in maths mode. It
2019 % seems that older versions of \LaTeX\ (in particular, that at Warwick
2020 % University) don't define these commands initially, so we'd better not
2021 % use |\renewcommand| after all. We also dispose of lots of messing with
2022 % |\protect| by using |\DeclareRobustCommand|.
2025 \DeclareRobustCommand\cal{\@fontswitch{\relax}{\mathcal}}
2026 \DeclareRobustCommand\pmit{\@fontswitch{\relax}{\mathnormal}}
2029 % \section{Tables of contents}
2031 % This section deals with tables of contents, and lists of figures.
2033 % \subsection{Contents}
2035 % First, we have to define some parameters.
2038 \newcommand\@pnumwidth{2em}
2039 \newcommand\@tocrmarg {3em}
2040 \newcommand\@dotsep{4.5}
2041 \setcounter{tocdepth}{\if@runinsubsubsec1\else2\fi}
2044 % \begin{macro}{\tableofcontents}
2046 % This is the main command for setting up tables of contents. We ensure
2047 % a single-page layout, put in the chapter heading, read in the contents
2048 % file, and then restore the old layout.
2051 \newcommand\tableofcontents{%
2058 \@topsect\contentsname%
2059 {\parskip\z@\@starttoc{toc}}%
2067 % Each section type \synt{type} is typeset by a command |\l@|\synt{type}:
2068 % for example, the |\l@chapter| command typesets the entry for a chapter
2071 % \begin{macro}{\l@part}
2073 % This command is vaguely interesting. We'll explore in detail.
2079 % We don't typeset the entry if |tocdepth| tells us not to. What kind of
2080 % stupid user is going to disable \emph{all} the contents items.
2083 \ifnum\c@tocdepth>-2\relax%
2086 % Before we start, we try to break above the title. Later, we'll disable
2087 % breaking afterwards. We then leave some vertical space.
2090 \addpenalty{-\@highpenalty}%
2091 \addvspace{2.25em\@plus\p@}%
2094 % We open a group, to avoid messing other things up. The |\numberline|
2095 % macro, which numbers the entry on the left, typesets its argument in a box
2096 % of width |\@tempdima|, which we must set up. We then set up the values
2097 % of |\rightskip| and |\parfillskip| to avoid printing over the page number.
2098 % We also make |\interlinepenalty| infinite to suppress breaking pages in
2099 % the middle of the title.
2105 \rightskip\@pnumwidth%
2106 \parfillskip-\@pnumwidth%
2107 \interlinepenalty\@M
2110 % Time to typeset the actual title. This is fairly simple, apart from
2111 % a complicated mixture of glue and penalties, which handles a line break
2112 % right at the end of the title.
2117 \large\bfseries {#1}%
2118 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak\hfil%
2119 \hb@xt@\@pnumwidth{\hss #2}%
2123 % Now we end the paragraph and suppress page breaking here.
2128 \global\@nobreaktrue%
2129 \everypar{\global\@nobreakfalse\everypar{}}%
2136 % \begin{macro}{\@artsw}
2138 % Define a macro named after the first or second argument depending on
2139 % whether the document is an article.
2143 \edef\@tempa{#1\if@article\noexpand#3\else\noexpand#2\fi}%
2150 % \begin{macro}{\l@chapter}
2152 % This is terribly similar to the previous macro.
2155 \@artsw\def\l@chapter\l@section#1#2{%
2156 \ifnum\c@tocdepth >\m@ne%
2157 \addpenalty{-\@highpenalty}%
2158 \vskip1.0em\@plus\p@%
2159 \setlength\@tempdima{2em}%
2161 \interlinepenalty\@M
2163 \rightskip\@pnumwidth%
2164 \parfillskip-\@pnumwidth%
2167 \advance\leftskip\@tempdima%
2170 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak\hfil%
2171 \hb@xt@\@pnumwidth{\hss #2}%
2173 \penalty\@highpenalty%
2180 % The other types are all defined in terms of |\@dottedtocline|, which is
2184 \@artsw\def\l@section\l@subsection{\@dottedtocline{1}{2em}{2.5em}}
2185 \@artsw\def\l@subsection\l@subsubsection{\@dottedtocline{2}{4.5em}{3.2em}}
2186 \@artsw\def\l@subsubsection\l@paragraph{\@dottedtocline{3}{7.7em}{4.1em}}
2187 \@artsw\def\l@paragraph\l@subparagraph{\@dottedtocline{4}{10.5em}{5em}}
2188 \@artsw\def\l@subparagraph\@tempa{\@dottedtocline{5}{12.5em}{6em}}
2191 % \begin{macro}{\@dottedtocline}
2193 % This is actually a part of the \LaTeX\ kernel, although it's not quite
2194 % right the way it is. We've improved the handling of line breaks after the
2198 \def\@dottedtocline#1#2#3#4#5{%
2201 % We have to make sure that we're meant to typeset this contents entry.
2204 \ifnum#1>\c@tocdepth\else%
2207 % Now we add in a little stretchy space.
2210 \vskip\z@\@plus.2\p@%
2213 % Set up the paragraph layout now. We forbid page breaks in the middle of
2219 \rightskip\@tocrmarg%
2220 \parfillskip-\rightskip%
2223 \interlinepenalty\@M%
2226 % Now we typeset the actual title.
2231 \advance\leftskip\@tempdima%
2237 % This is the clever bit. After the actual title, we add the following
2242 % \item A |\nobreak| penalty, to stop a break from eating the glue.
2244 % \item A glob of |\hfil| glue. If there's a line break after this glue,
2245 % the title is set flush left as a result of this. Otherwise, it is ignored
2246 % because the leaders are |\hfill|.
2248 % \item A penalty. This is a reasonable place to break the line if
2251 % \item An empty |\hbox|. This stops the following glue from being discarded
2252 % at the beginning of a new line.
2254 % \item Another |\nobreak|, which stops a break at the following glue item.
2256 % \item The dotted |\leaders|, which have |\hfill| stretchiness. This forces
2257 % the page number to be flush right.
2261 % The net result of all this is we can now cope with a line break at the
2262 % end of the title, before the page number, which means that the dots are
2263 % put on the next line. The original \LaTeX\ version forced the last word
2264 % of the title onto the next line as well, which can cause underful boxes.
2267 \nobreak\hfil\penalty\@highpenalty\hbox{}\nobreak%
2268 \leaders\hbox{$\m@th\mkern\@dotsep mu.\mkern\@dotsep mu$}\hfill%
2269 \hb@xt@\@pnumwidth{\hfil\reset@font\rmfamily#5}\par%
2276 % \subsection{Lists of figures and tables}
2278 % These macros are terribly similar to the other ones.
2281 \newcommand\listoffigures{%
2283 \@restonecoltrue\onecolumn%
2287 \@topsect\listfigurename%
2288 {\parskip\z@ \@starttoc{lof}}%
2289 \if@restonecol\twocolumn\fi%
2292 \newcommand\l@figure{\@dottedtocline{1}{1.5em}{2.5em}}
2294 \newcommand\listoftables{%
2296 \@restonecoltrue\onecolumn%
2300 \@topsect\listtablename%
2301 {\parksip\z@ \@starttoc{lot}}%
2302 \if@restonecol\twocolumn\fi%
2305 \let\l@table\l@figure
2308 % \section{Bibliography}
2310 % This isn't actually terribly interesting.
2312 % \begin{environment}{thebibliography}
2318 \newenvironment{thebibliography}[1]{%
2320 \list{\@biblabel{\arabic{enumiv}}}%
2321 {\settowidth\labelwidth{\@biblabel{#1}}%
2322 \leftmargin\labelwidth%
2323 \advance\leftmargin\labelsep%
2325 \advance\leftmargin\bibindent%
2326 \itemindent-\bibindent%
2327 \listparindent\itemindent%
2330 \usecounter{enumiv}%
2331 \let\p@enumiv\@empty%
2332 \renewcommand\theenumiv{\arabic{enumiv}}}%
2334 \renewcommand\newblock{\par}%
2336 \renewcommand\newblock{\hskip.11em\@plus.33em\@minus.07em}%
2343 \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
2347 \newcommand\newblock{}
2353 % Defines the \env{theindex} environment.
2355 % \begin{environment}{theindex}
2357 % The macros are fairly simple. We change to a two column layout, and
2358 % redefine |\item| appropriately.
2361 \newenvironment{theindex}{%
2364 \@topsect\indexname%
2366 \begin{multicols}{2}%
2368 \parskip\z@\@plus.3\p@\relax%
2379 % Now we define the item and spacing macros.
2382 \newcommand\@idxitem {\par\hangindent 40\p@}
2383 \newcommand\subitem {\par\hangindent 40\p@ \hspace*{20\p@}}
2384 \newcommand\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
2385 \newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
2388 % \begin{macro}{\passim}
2390 % The |passim| encapsulator is used to typeset the word `\textit{passim}'
2391 % after a page range.
2394 \def\passim#1{#1 \textit{passim}} % Passim encapsulator for indices
2398 % Other useful commands for indexing:
2400 % \begin{description*}
2401 % \def\descriptionlabel#1{\ttfamily \bslash #1}
2403 % \item[Term] typesets its argument in italics, and adds it to the index.
2405 % \item[term] typesets its first argument in italics, and adds its second
2408 % \item[Index] typesets its argument normally, and adds it to the index.
2410 % \end{description*}
2413 \def\Term#1{\emph{#1}\index{#1}}
2414 \def\term#1{\emph{#1}\index}
2415 \def\Index#1{#1\index{#1}}
2418 % \section{Footnotes}
2420 % \begin{macro}{\footnoterule}
2422 % This macro typesets the rule above footnotes. This is a bit more complex
2423 % than the default: we try and typeset the rule to be at most 1\,in wide,
2424 % although if the column isn't wide enough, we use $4\over10$~of the
2425 % box width instead.
2429 \@tempdima.4\columnwidth%
2430 \ifdim\@tempdima>1in\relax%
2431 \@tempdima1in\relax%
2434 \hrule\@width\@tempdima%
2440 % We number footnotes within chapters:
2443 \@addtoreset{footnote}{chapter}
2446 % \begin{macro}{\@makefntext}
2448 % This is the macro which actually typesets a footnote. This is rather
2449 % complicated. It's based on example code from \file{classes.dtx} which
2450 % doesn't actually work properly.
2453 \long\def\@makefntext#1{%
2456 % First, we redefine |\par| to set up the correct paragraph shape. This
2457 % is indented from the left margin by a small amount.
2463 \advance\@tempdima-1.6em%
2464 \parshape\@ne1.6em\@tempdima%
2468 % Now we set up some parameters so that \env{list} environments work properly
2469 % within the footnote. We also clear |\parindent| to prevent nasty
2470 % indentation. The |\par| sets up the paragraph shape for the next
2471 % paragraph: we're in vertical mode already, so it does nothing else.
2474 \advance\linewidth-1.6em%
2475 \advance\@totalleftmargin1.6em%
2480 % We leave vertical mode to stop the hbox created by |\llap| from being
2481 % stacked vertically. Then we typeset the footnote mark, and put in the
2482 % main text. Finally we leave some space afterwards, to space out the next
2487 \llap{\@makefnmark\enspace}#1\par%
2493 % \begin{macro}{\@makecol}
2495 % The standard \LaTeX\ output routine messes up footnotes a bit, in my
2499 % \item If a page is cut off short, because the next item won't fit (e.g.,
2500 % a section heading), then footnotes are added right below the end
2501 % of the text, which can look strange.
2503 % \item Footnotes are displayed \emph{above} floats at the bottom of a page,
2504 % which also looks strange.
2506 % \item The |\@makefntext| routine above needs to add vertical space between
2507 % footnotes, but this leaves a gap at the very bottom. We remove this
2508 % gap with an |\unskip|.
2514 \setbox\@outputbox \box\@cclv
2515 \xdef\@freelist{\@freelist\@midlist}%
2516 \global \let \@midlist \@empty
2518 \ifvoid\footins \else
2519 \setbox\@outputbox \vbox {%
2520 \boxmaxdepth \@maxdepth
2522 \vskip \skip\footins
2532 \setbox\@outputbox \vbox to\@colht {%
2534 \dimen@ \dp\@outputbox
2540 \global \maxdepth \@maxdepth
2545 % \section{Tidying up}
2547 % This section gathers together various other useful bits of standard
2548 % document class setting.
2550 % \subsection{Item names}
2552 % These commands typeset bits of text. They can then be redefined by
2553 % \package{babel} and suchlike.
2556 \newcommand\contentsname{Contents}
2557 \newcommand\listfigurename{List of Figures}
2558 \newcommand\listtablename{List of Tables}
2559 \if@article\newcommand\bibname{References}
2560 \else\newcommand\bibname{Bibliography}\fi
2561 \newcommand\indexname{Index}
2562 \newcommand\figurename{Figure}
2563 \newcommand\tablename{Table}
2564 \newcommand\partname{Part}
2565 \newcommand\abstractname{Abstract}
2566 \newcommand\chaptername{Chapter}
2567 \newcommand\appendixname{Appendix}
2568 \newcommand\today{\number\day\space\ifcase\month\or
2569 January\or February\or March\or April\or May\or June\or
2570 July\or August\or September\or October\or November\or December\fi
2574 % \subsection{Final fiddling for two columns}
2579 \pagestyle{headings}
2580 \pagenumbering{arabic} % Arabic page numbers
2590 % \section{The \protect\env{central} environment}
2592 % Because of the strange layout of the pages, text which is centred using
2593 % normal \LaTeX\ commands is centred in the text area, not on the page,
2594 % which is undesirable for large headings, like part headings.
2596 % \begin{environment}{central}
2598 % The \env{central} environment typesets its contents centrally on the page.
2599 % It should only be used from outer vertical mode.
2601 % The code just creates a box of the appropriate size and moves it into the
2605 \newenvironment{central}{%
2607 \vbox\bgroup\moveleft\leftindent\vbox\bgroup%
2608 \textwidth\paperwidth%
2609 \advance\textwidth-2\pagesurround\relax%
2611 \hrule\@height\z@\@depth\z@\@width\hsize%
2619 % \section{Headers and footers}
2621 % The \strayman\ class uses \package{fancyheadings} for its headers
2622 % and footers. This has already been included in the preamble. We now
2623 % need to fix a few problems with \package{fancyheadings} and set up some
2626 % \begin{macro}{\title}
2628 % We extend |\title|, and give it an optional argument. It can now specify
2629 % the document title as used by |\maketitle| and the running title for the
2630 % header separately.
2632 % We store the running header in the macro |\@headertitle|, which is
2639 % Now we define the |\title| macro, using |\@dblarg| to duplicate the
2640 % mandatory argument if the optional one is omitted.
2643 \def\title{\@dblarg\title@i}
2644 \def\title@i[#1]#2{%
2646 \gdef\@headertitle{#1}%
2651 % \begin{macro}{\innerhead}
2652 % \begin{macro}{\innerfoot}
2654 % We allow the user to specify an `inner heading' which is displayed on the
2655 % inside of the header on of each page. This can be used for security
2656 % classifications, for example. Any \package{fancyheadings} commands can
2657 % be used to control the header, which is expanded on each page.
2664 \def\innerhead{\@dblarg\innerhead@i}
2665 \def\innerhead@i[#1]#2{%
2666 \def\l@innerhead{#1}%
2667 \def\r@innerhead{#2}%
2669 \def\innerfoot{\@dblarg\innerfoot@i}
2670 \def\innerfoot@i[#1]#2{%
2671 \def\l@innerfoot{#1}%
2672 \def\r@innerfoot{#2}%
2678 % The next step is to set up the headings:
2681 \let\headrulewidth\z@
2682 \headwidth\textwidth
2683 \advance\headwidth\leftindent
2684 \fancypagestyle{headings}{%
2686 \fancyhead[LE]{\bfseries\@headertitle}
2687 \if@article\fancyhead[RO]{\rightmark}\else\fancyhead[RO]{\leftmark}\fi
2688 \fancyhead[RE]{\l@innerhead} \fancyhead[LO]{\r@innerhead}
2689 \fancyfoot[RE]{\l@innerfoot} \fancyfoot[LO]{\r@innerfoot}
2690 \fancyfoot[LE,RO]{\thepage}
2692 \fancypagestyle{plain}{%
2694 \fancyfoot[RE]{\l@innerfoot} \fancyfoot[LO]{\r@innerfoot}
2695 \fancyfoot[LE,RO]{\thepage}%
2697 \let\ps@fancy\ps@@fancy
2700 % The \package{fancyheadings} package by default expects pages to be
2701 % symmetrical. We have to redefine the |\ps@fancy| macro to make it
2705 \def\@lodd{\ifodd\c@page\hss\else\relax\fi}
2706 \def\@rodd{\ifodd\c@page\relax\else\hss\fi}
2709 % Finally, we can choose the page style we want:
2712 \pagestyle{headings}
2715 % \section{Parbox alteration}
2717 % The standard \LaTeX\ |\parbox| command, and the \env{minipage} environment,
2718 % reset |\parskip| to zero, which is inconsistent with the document style.
2719 % We amend |\@arrayparboxrestore|, the macro which sets up the paragraph
2720 % style for parboxes.
2722 % First, we define a macro explaining how the parbox should set the spacing.
2725 \def\parboxparskip{2ex}
2728 % Next, we redefine the macro. This is taken directly from the \LaTeXe
2732 \def\@arrayparboxrestore{%
2735 \let\'\@acci\let\`\@accii\let\=\@acciii
2736 \parindent\z@ \parskip\z@
2737 \everypar{\parskip\parboxparskip\everypar{}}%
2739 \@totalleftmargin\z@
2740 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
2741 \parfillskip\@flushglue \lineskip\normallineskip
2742 \baselineskip\normalbaselineskip
2743 \@noskipsectrue% % The comp.text.tex gurus said it should be
2748 % \section{Other features}
2750 % At the end is a miscellany of useful features.
2752 % \subsection{Other typesetting conventions}
2754 % Some items need typesetting in particular ways.
2759 \def\submenu{\ensuremath\Rightarrow}
2761 \def\file#1{\mbox{\itshape #1\/}}
2764 % \subsection{And finally}
2769 \def\riscos{RISC~OS}