| 1 |
%% |
| 2 |
%% \CharacterTable |
| 3 |
%% {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 |
| 4 |
%% 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 |
| 5 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 6 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 7 |
%% Dollar \$ Percent \% Ampersand \& |
| 8 |
%% Acute accent \' Left paren \( Right paren \) |
| 9 |
%% Asterisk \* Plus \+ Comma \, |
| 10 |
%% Minus \- Point \. Solidus \/ |
| 11 |
%% Colon \: Semicolon \; Less than \< |
| 12 |
%% Equals \= Greater than \> Question mark \? |
| 13 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 14 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 15 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 16 |
%% Right brace \} Tilde \~} |
| 17 |
%% |
| 18 |
% \CheckSum{2048} |
| 19 |
% \iffalse |
| 20 |
% |
| 21 |
% \changes{1.0}{2003/07/02}{First release} |
| 22 |
% |
| 23 |
% \section{Identification} |
| 24 |
% This is document class Octavo, which can be used with \LaTeX\ only, |
| 25 |
% so prepare to display a message if another \TeX\ format is used. |
| 26 |
% \begin{macrocode} |
| 27 |
%<octavo>\NeedsTeXFormat{LaTeX2e}[1995/12/01] |
| 28 |
% \end{macrocode} |
| 29 |
% |
| 30 |
% Announce the Class name and its version: |
| 31 |
% \begin{macrocode} |
| 32 |
%<octavo>\ProvidesClass{octavo} |
| 33 |
%<10pt>\ProvidesFile{oct10.clo} |
| 34 |
%<11pt>\ProvidesFile{oct11.clo} |
| 35 |
%<12pt>\ProvidesFile{oct12.clo} |
| 36 |
%<*driver> |
| 37 |
\ProvidesFile{octavo.drv} |
| 38 |
%</driver> |
| 39 |
[2007/03/07 v1.2 |
| 40 |
%<octavo> a LaTeX document class] |
| 41 |
%<10pt|11pt|12pt> a LaTeX file (size option)] |
| 42 |
% \end{macrocode} |
| 43 |
% |
| 44 |
% \section{The driver for this document} |
| 45 |
% Now comes the code for the document driver, that is to say, the file |
| 46 |
% which produces the documentation upon extraction from this .dtx file |
| 47 |
% by the docstrip program. |
| 48 |
% \begin{macrocode} |
| 49 |
%<*driver> |
| 50 |
] |
| 51 |
\documentclass{ltxdoc} |
| 52 |
% \end{macrocode} |
| 53 |
% |
| 54 |
% Not everything has to appear in the index |
| 55 |
% \begin{macrocode} |
| 56 |
\DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic} |
| 57 |
\DoNotIndex{\@badmath,\@centercr,\@cite} |
| 58 |
\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue} |
| 59 |
\DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth} |
| 60 |
\DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint} |
| 61 |
\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb} |
| 62 |
\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt} |
| 63 |
\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt} |
| 64 |
\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace} |
| 65 |
\DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box} |
| 66 |
\DoNotIndex{\bullet} |
| 67 |
\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption} |
| 68 |
\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass} |
| 69 |
\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist} |
| 70 |
\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup} |
| 71 |
\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter} |
| 72 |
\DoNotIndex{\fbox} |
| 73 |
\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef} |
| 74 |
\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule} |
| 75 |
\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi} |
| 76 |
\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi} |
| 77 |
\DoNotIndex{\input} |
| 78 |
\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark} |
| 79 |
\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright} |
| 80 |
\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment} |
| 81 |
\DoNotIndex{\NeedsTeXFormat,\newdimen} |
| 82 |
\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number} |
| 83 |
\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@} |
| 84 |
\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip} |
| 85 |
\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions} |
| 86 |
\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright} |
| 87 |
\DoNotIndex{\refstepcounter,\relax,\renewcommand} |
| 88 |
\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily} |
| 89 |
\DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength} |
| 90 |
\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space} |
| 91 |
\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase} |
| 92 |
\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt} |
| 93 |
\DoNotIndex{\viipt,\vipt,\vskip,\vspace} |
| 94 |
\DoNotIndex{\wd,\xiipt,\year,\z@} |
| 95 |
% \end{macrocode} |
| 96 |
% Generate an index using linenumbers |
| 97 |
% \begin{macrocode} |
| 98 |
\EnableCrossrefs |
| 99 |
\CodelineIndex |
| 100 |
\RecordChanges |
| 101 |
% \end{macrocode} |
| 102 |
% Retrieve date and version information from the file |
| 103 |
% \begin{macrocode} |
| 104 |
\GetFileInfo{octavo.drv} |
| 105 |
% \end{macrocode} |
| 106 |
% \begin{macrocode} |
| 107 |
\begin{document} |
| 108 |
\DocInput{octavo.dtx} |
| 109 |
\PrintIndex |
| 110 |
\end{document} |
| 111 |
%</driver> |
| 112 |
% \end{macrocode} |
| 113 |
% \fi |
| 114 |
% |
| 115 |
% \title{The Octavo Package} |
| 116 |
% \author{Stefan A. Revets} |
| 117 |
% \date{Version \fileversion, \filedate} |
| 118 |
% \maketitle |
| 119 |
% \tableofcontents |
| 120 |
% |
| 121 |
% \section{Introduction} |
| 122 |
% |
| 123 |
% Donald Knuth developed \TeX\ because of the dissatisfaction he felt |
| 124 |
% with the commercial typesetting of his books `The Art of Computer |
| 125 |
% programming'~\cite{knuth98}. The program grew into a typesetting system, with |
| 126 |
% a great deal of attention and ingenuity devoted to the calculations of the |
| 127 |
% placement of letters, words and paragraphs on a page. More people began |
| 128 |
% to use \TeX, and, with the advent of \LaTeX, ready-made class files |
| 129 |
% became part of the system. These style files tend to show off the |
| 130 |
% capabilities of the system, rather than conform to good design, or, as |
| 131 |
% Philip Taylor~\cite{taylor98,taylor99} put it `\ldots all of which shriek |
| 132 |
% ``\TeX'' from every page'. |
| 133 |
% |
| 134 |
% Class files have been proposed and are available from CTAN which give the more |
| 135 |
% fastidious user the means with which to moderate at least some of the excesses |
| 136 |
% of the standard \LaTeX\ styles. The KOMA package is a good example, and so |
| 137 |
% is the excellent Memoir class of Peter Wilson~\cite{wilson01}. The manual |
| 138 |
% of this package is a worthwhile read, especially since works on design and |
| 139 |
% style in book making are not all that easy to obtain. |
| 140 |
% |
| 141 |
% \subsection{Background} |
| 142 |
% |
| 143 |
% To \emph{make} a book is an interesting and somewhat involved |
| 144 |
% process~\cite{town}. The text is set in type and printed on paper, the pages |
| 145 |
% are gathered and folded into signatures, and these are then bound and covered. |
| 146 |
% |
| 147 |
% The printing is done on large sheets of paper, which may have to be cut before |
| 148 |
% hey are folded into signatures. These are passed on to the the bookbinder who |
| 149 |
% sews the signatures into the book proper. As is so often the case with |
| 150 |
% venerable crafts, a florid terminology developed which facilitated contacts |
| 151 |
% between the guilds of printers and binders, while at the same time inspiring |
| 152 |
% some sort of grudging respect in the uninitiated, keeping them at bay. |
| 153 |
% |
| 154 |
% The sheets of paper, the broadsides, came in a limited number of more or less |
| 155 |
% standard sizes. These sheets are known under the names Foolscap, Crown, |
| 156 |
% Post, Demy, Medium, Royal, Super Royal and Imperial. Folding the sheets |
| 157 |
% adds another set of terms: a single fold yields a Folio, a double fold a |
| 158 |
% Quarto, a triple fold an Octavo and so on. Hence, the combination of a |
| 159 |
% sheetname and the number of folds denotes a particular and precise size of |
| 160 |
% the book~\cite{town,williamson66}, for example, a crown octavo measures |
| 161 |
% 191x127~mm. |
| 162 |
% |
| 163 |
% Jan Tschichold devoted a lifetime to the design and production of books. |
| 164 |
% Fortunately, he wrote many of his views down. Later in life, he assembled |
| 165 |
% his findings in an overview~\cite{tschichold87}, discussing in a more |
| 166 |
% coherent, concentrated fashion the questions which face anyone wishing to |
| 167 |
% make a book. Of particular interest is his analysis of size and proportions of |
| 168 |
% page, text and margins. Through his own historical investigations, he made, |
| 169 |
% and continues to make, a very strong and convincing case against the more |
| 170 |
% `modern' tendency of making squarish books. His elegant, eloquent and well |
| 171 |
% illustrated discourse guides us away from the ugliness of the convenient but |
| 172 |
% rather square A format (proportion 1:1.414) back to the more rectangular |
| 173 |
% formats with proportions tending towards the Golden Ratio (from 1:1.5 to |
| 174 |
% 1:1.618). It is certainly no accident that the classical sheets of paper |
| 175 |
% traditionally used in the printing of books show proportions which fall very |
| 176 |
% nicely within this range. |
| 177 |
% |
| 178 |
% Tschichold analysed the size and disposition of the text block relative |
| 179 |
% to the page as well. By 1953, he published his discovery of the late gothic |
| 180 |
% workshop secrets of determining the margins on a page. |
| 181 |
% Rosarivo~\cite{rosarivo61}confirmed this determination through his own, |
| 182 |
% independent discovery of a different method which happily yielded the same |
| 183 |
% results. Rosarivo's method is very easy to use and implement automatically: |
| 184 |
% divide the height and width of the page into an equal number, assign one part |
| 185 |
% to make up inner and upper margin, and two parts to make up outer and lower |
| 186 |
% margin, with the remainder defining the area available for printing the body |
| 187 |
% text. |
| 188 |
% |
| 189 |
% The amount of leading between lines of print depends on the nature of the |
| 190 |
% fount, its size, and the length of the line. Also, it should remain fixed for |
| 191 |
% the entire text, yielding a constant, regular grid of lines. Tschichold |
| 192 |
% discussed the leading of lines of text in some detail, and similar views can |
| 193 |
% be found in Williamson's book~\cite{williamson66}. |
| 194 |
% |
| 195 |
% It should be clear by now that the standard book class included in \LaTeX\ |
| 196 |
% requires a fair amount of adjustment to reflect more closely the design |
| 197 |
% principles just highlighted. The Octavo class is an attempt to provide |
| 198 |
% such a class file. |
| 199 |
% |
| 200 |
% \subsection{Rationale} |
| 201 |
% |
| 202 |
% The Octavo class is in essence a modification of the standard \LaTeX\ book |
| 203 |
% class, with a similar, limited amount of options and choices. These |
| 204 |
% limitations are there because a number of inbuilt choices have been made on |
| 205 |
% the basis of design principles and guidelines garnered from a variety of |
| 206 |
% authors and books. The class is christened Octavo because its express |
| 207 |
% aim is to implement many of these classical design elements. |
| 208 |
% |
| 209 |
% First of all, the option of page sizes are the classical octavo sizes. The |
| 210 |
% four smallest ones, i.e., foolscap, crown, post and largepost can be made |
| 211 |
% to fit two by two on A4 paper, allowing one to produce books in these formats |
| 212 |
% on printers routinely available. |
| 213 |
% |
| 214 |
% The size of the margins follows the analysis by Tschichold, but instead of |
| 215 |
% adopting the 6:9 ratio of division of the page (which yields only a 44\% |
| 216 |
% covering of a page by text), a 7:10 ratio is here implemented (yielding |
| 217 |
% a 49\% cover of a page by text). |
| 218 |
% |
| 219 |
% Including a title page is very necessary when making a book, but the way in |
| 220 |
% which to do this is not as straightforward a matter as that may seem at first. |
| 221 |
% Title pages (plural) are much better when they are treated, and made, as |
| 222 |
% an integral part of the endpapers. When binding (good) books, endpapers |
| 223 |
% fulfill a functional and aesthetical role, and a separate folio bearing the |
| 224 |
% titling, adds to the strength, and beauty, of the endpapers~\cite{town}. |
| 225 |
% |
| 226 |
% Ideally, a separate folio should be made, bearing on the first recto page the |
| 227 |
% bastard title, on the verso possibly a frontispiece, or failing something |
| 228 |
% suitable, left blank. The next recto bears title, author, publisher and |
| 229 |
% the like, and the final verso provides space for the biblio or imprint. |
| 230 |
% From a design perspective, it is not really feasible, nor desirable, to |
| 231 |
% lay down hard and fast rules for the organisation or the placement of the |
| 232 |
% various elements needed on a titlepage. In practice, it is much easier |
| 233 |
% to do this as a separate document, especially when the text is to be |
| 234 |
% organised into signatures. |
| 235 |
% |
| 236 |
% An attempt is made here to try and maintain a uniform printing grid across |
| 237 |
% the text. Amongst the \TeX\ algorithms, Knuth developed a set with the aim of |
| 238 |
% keeping the overall text block on each page the same size. If necessary, this |
| 239 |
% means allowing the change of spacing between paragraphs, around floating |
| 240 |
% objects, or indeed the leading within a paragraph. To counteract this |
| 241 |
% behaviour completely would require a rewriting of part of the \TeX\ code, |
| 242 |
% which really is too daunting a task. However, it seems possible, through a |
| 243 |
% judicious setting of parameters, lengths and sizes, almost to achieve the |
| 244 |
% same result. In principle, the octavo class will maintain the regularity |
| 245 |
% of the grid within the text body, i.e., the leading should remain constant, |
| 246 |
% and successive paragraphs should not become separated by extra space. |
| 247 |
% Adjustments, if and when they become necessary, will be made to the spacing |
| 248 |
% around headings, lists and floats. Nevertheless, there will be times when |
| 249 |
% the actual text, the parameters defined by the octavo class, and the \TeX\ |
| 250 |
% kernel will conspire to produce truly horrible results. Such misfortunes call |
| 251 |
% for direct intervention, or, the user willing, suggestions of improving the |
| 252 |
% definitions of the parameters proposed here for the octavo class. |
| 253 |
% |
| 254 |
% \subsection{Some notes on making books with octavo} |
| 255 |
% |
| 256 |
% Thanks to excellent works on bookbinding such as the book by Lawrence |
| 257 |
% Town~\cite{town}, the physical making of books lies well within reach of |
| 258 |
% anyone caring to make the effort. Thanks to a number of additional programs, |
| 259 |
% also available from CTAN, it is a straightforward matter to organise and print |
| 260 |
% out a text in signatures. Here are some of the means which have proved to be |
| 261 |
% both useful and effective. |
| 262 |
% |
| 263 |
% As already mentioned, the formats foolscap, crown, post and largepost can be |
| 264 |
% made to sit on an A5 page. This means that four pages can be put on a single |
| 265 |
% A4 sheet, a set of which can be made to form a signature. To do so requires |
| 266 |
% a few careful but simple adjustments. |
| 267 |
% |
| 268 |
% A problem comes up with the imposition of the textpages on an A4 sheet. The |
| 269 |
% four formats mentioned are all narrower than an A5 sheet, and hence extra |
| 270 |
% space is left protruding at the outer margins. This is not a problem with the |
| 271 |
% odd-numbered pages, as it is their inner margin which is made to coincide with |
| 272 |
% the inner margin of the A5 sheet. However, the even-numbered pages have their |
| 273 |
% outer margin made to coincide with the outer margin of the A5 sheet, the |
| 274 |
% latter of course being too wide. What should happen is to have the inner |
| 275 |
% margin of the even-numbered sheet coincide with the inner margins of the A5 |
| 276 |
% sheet. The simplest solution is to add a single line to the preamble of the |
| 277 |
% document: |\addtolength{\evensidemargin}{148.5mm-\paperwidth}|, rather than |
| 278 |
% try and reposition only the even-numbered pages with dvidvi, dvips, and the |
| 279 |
% like. |
| 280 |
% |
| 281 |
% Organising the pages into signatures can be done quite easily. With dvips: |
| 282 |
% \begin{enumerate} |
| 283 |
% \item dvips -ta5 \meta{file} |
| 284 |
% \item psbook -s16 \meta{file}.ps \meta{file}.tmp |
| 285 |
% \item psnup -pa4 -Pa5 -l -2 -s1.0 \meta{file}.tmp \meta{file}.ps |
| 286 |
% \end{enumerate} |
| 287 |
% or with dvihplj or similar, using the switches:\\ |
| 288 |
% |prthpljh| \meta{file} |+columns:2 +rows:1 +section-size:4|\\ |
| 289 |
% |+full-last-section +page-width:148.5mm +page-height:210mm|\\ |
| 290 |
% |+landscape-mode +double-sided:odd[even]| |
| 291 |
% |
| 292 |
% These sets of commands and switches yield signatures made up of 16 pages on 4 |
| 293 |
% sheets. Such an arrangement is very effective and handy when binding the |
| 294 |
% book. It may be necessary to instruct the printer to shift each page a little |
| 295 |
% on the sheet to ensure perfect register, and a little experimenting may be |
| 296 |
% called for. |
| 297 |
% |
| 298 |
% \subsection{Acknowledgements} |
| 299 |
% Octavo is a modification of |classes.dtx| written by Leslie Lamport (1992), |
| 300 |
% Frank Mittelbach (1994-97) and Johannes Braams (1994-97). As can be seen |
| 301 |
% from the code, my own input is restricted to a tweaking of some parameters |
| 302 |
% and true credit is due to Lamport, Mittelbach and Braams for their |
| 303 |
% monumental efforts. |
| 304 |
% |
| 305 |
% \begin{thebibliography}{16} |
| 306 |
% |
| 307 |
% \bibitem{knuth98} Knuth,~D. 1998. \emph{Digital Typography}. CSLI |
| 308 |
% Publications, Stanford. |
| 309 |
% |
| 310 |
% \bibitem{rosarivo61} Rosarivo,~R. 1961. \emph{Divina proportio typographica}. |
| 311 |
% Scherpe, Krefeld. |
| 312 |
% |
| 313 |
% \bibitem{taylor98} Taylor,~P. 1998. \emph{Book design for \TeX\ users, Part 1: |
| 314 |
% Theory.} TUGBoat, 19:65--74. |
| 315 |
% |
| 316 |
% \bibitem{taylor99} Taylor,~P. 1999. \emph{Book design for \TeX\ users, Part 2: |
| 317 |
% Practice.} TUGBoat, 20:378--389. |
| 318 |
% |
| 319 |
% \bibitem{town} Town,~L. \emph{Bookbinding by hand.} Faber \& Faber, London. |
| 320 |
% |
| 321 |
% \bibitem{tschichold87} Tschichold,~ J. 1987. \emph{Ausgew\"{a}hlte Aufs\"{a}tze |
| 322 |
% \"{u}ber Fragen der Gestalt des Buches und der Typographie}. Birkh\"{a}user |
| 323 |
% Verlag, Basel. |
| 324 |
% |
| 325 |
% \bibitem{williamson66} Williamson,~H. 1966. \emph{Methods of book design.} Oxford |
| 326 |
% University Press, Oxford. |
| 327 |
% |
| 328 |
% \bibitem{wilson01} Wilson,~P. 2001. \emph{The Memoir class for configurable |
| 329 |
% typesetting.} CTAN. |macros\latex\contrib\memoir| |
| 330 |
% |
| 331 |
% \end{thebibliography} |
| 332 |
% \StopEventually{} |
| 333 |
% |
| 334 |
% |
| 335 |
% \section{Preliminaries} |
| 336 |
% We begin by declaring a number of commands, parameters and control |
| 337 |
% sequences which will be used later on. |
| 338 |
% \begin{macro}{\@ptsize} |
| 339 |
% The controlsequence stores the second digit of the pointsize in which |
| 340 |
% the body of the text will be typeset. |
| 341 |
% \begin{macrocode} |
| 342 |
%<*octavo> |
| 343 |
\newcommand\@ptsize{} |
| 344 |
% \end{macrocode} |
| 345 |
% \end{macro} |
| 346 |
% |
| 347 |
% \begin{macro}{\if@restonecol} |
| 348 |
% In texts printed in two columns, this switch is used to remember to |
| 349 |
% switch back to two column if there has been a temporary change to single |
| 350 |
% column mode. |
| 351 |
% \begin{macrocode} |
| 352 |
\newif\if@restonecol |
| 353 |
% \end{macrocode} |
| 354 |
% \end{macro} |
| 355 |
% |
| 356 |
% \begin{macro}{\if@titlepage} |
| 357 |
% Usually, a titlepage is produced with a book. However, if a set of |
| 358 |
% endpapers is made, titlepages can be made separately from the body |
| 359 |
% of the book, and it is useful to omit the production of a titlepage. |
| 360 |
% \begin{macrocode} |
| 361 |
\newif\if@titlepage |
| 362 |
\@titlepagetrue |
| 363 |
% \end{macrocode} |
| 364 |
% \end{macro} |
| 365 |
% |
| 366 |
% \begin{macro}{\if@openright} |
| 367 |
% \begin{macro}{\if@openbib} |
| 368 |
% Another set of switches, to indicate if new chapters must start on a |
| 369 |
% right-hand page. Normally they do, but novels and the like may well |
| 370 |
% benefit from having new chapters start on either side. |
| 371 |
% \begin{macrocode} |
| 372 |
\newif\if@openright |
| 373 |
\newif\if@openbib |
| 374 |
\@openbibfalse |
| 375 |
% \end{macrocode} |
| 376 |
% \end{macro} |
| 377 |
% \end{macro} |
| 378 |
% |
| 379 |
% \begin{macro}{\if@mainmatter} |
| 380 |
% A switch to indicate when we are processing the main material of the book. |
| 381 |
% \begin{macrocode} |
| 382 |
\newif\if@mainmatter |
| 383 |
\@mainmattertrue |
| 384 |
% \end{macrocode} |
| 385 |
% \end{macro} |
| 386 |
% |
| 387 |
% \section{Class options} |
| 388 |
% \subsection{Declaring options} |
| 389 |
% The options available to the octavo class are essentially the same as those |
| 390 |
% defined for the standard book class. What is different and new is a set of |
| 391 |
% papersize options. |
| 392 |
% |
| 393 |
% \begin{macro}{\paperheight} |
| 394 |
% \begin{macro}{\paperwidth} |
| 395 |
% We begin with the papersizes. These are largely the traditional octavo |
| 396 |
% sizes. The option |largepost| is slightly different: it is an example |
| 397 |
% of Tschichold's pentagon-based proportion (1:1.538) applied to a page |
| 398 |
% height of an a5 page. |
| 399 |
% \begin{macrocode} |
| 400 |
\DeclareOption{foolscap} |
| 401 |
{\setlength\paperheight{171mm}% |
| 402 |
\setlength\paperwidth{108mm}} |
| 403 |
\DeclareOption{crown} |
| 404 |
{\setlength\paperheight{191mm}% |
| 405 |
\setlength\paperwidth{127mm}} |
| 406 |
\DeclareOption{post} |
| 407 |
{\setlength\paperheight{194mm}% |
| 408 |
\setlength\paperwidth{122mm}} |
| 409 |
\DeclareOption{largepost} |
| 410 |
{\setlength\paperheight{210mm}% |
| 411 |
\setlength\paperwidth{137mm}} |
| 412 |
\DeclareOption{demy} |
| 413 |
{\setlength\paperheight{222mm}% |
| 414 |
\setlength\paperwidth{143mm}} |
| 415 |
\DeclareOption{medium} |
| 416 |
{\setlength\paperheight{229mm}% |
| 417 |
\setlength\paperwidth{146mm}} |
| 418 |
\DeclareOption{royal} |
| 419 |
{\setlength\paperheight{254mm}% |
| 420 |
\setlength\paperwidth{159mm}} |
| 421 |
\DeclareOption{superroyal} |
| 422 |
{\setlength\paperheight{267mm}% |
| 423 |
\setlength\paperwidth{171mm}} |
| 424 |
\DeclareOption{imperial} |
| 425 |
{\setlength\paperheight{279mm}% |
| 426 |
\setlength\paperwidth{191mm}} |
| 427 |
% \end{macrocode} |
| 428 |
% \end{macro} |
| 429 |
% \end{macro} |
| 430 |
% |
| 431 |
% \begin{macro}{\@ptsize} |
| 432 |
% The choice of type size is kept through the last digit of the size |
| 433 |
% in |\@ptsize|. There are apparently good, or at least, historical |
| 434 |
% reasons for doing so. Since this may well ensure compatibility with |
| 435 |
% other packages, the method is maintained here. |
| 436 |
% \begin{macrocode} |
| 437 |
\DeclareOption{10pt}{\renewcommand\@ptsize{0}} |
| 438 |
\DeclareOption{11pt}{\renewcommand\@ptsize{1}} |
| 439 |
\DeclareOption{12pt}{\renewcommand\@ptsize{2}} |
| 440 |
% \end{macrocode} |
| 441 |
% \end{macro} |
| 442 |
% |
| 443 |
% \begin{macro}{twoside} |
| 444 |
% When printing books, two-sided printing is the norm. This |
| 445 |
% means that we have to set the |if@mparswitch| to get any margin |
| 446 |
% paragraphs into the outside margin. |
| 447 |
% \begin{macrocode} |
| 448 |
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} |
| 449 |
% \end{macrocode} |
| 450 |
% \end{macro} |
| 451 |
% |
| 452 |
% \begin{macro}{draft} |
| 453 |
% When preparing a text for final tweaking, the |draft| mode may come in |
| 454 |
% handy, as it will show on the page where overfull boxes appear. |
| 455 |
% \begin{macrocode} |
| 456 |
\DeclareOption{draft}{\setlength\overfullrule{5pt}} |
| 457 |
\DeclareOption{final}{\setlength\overfullrule{0pt}} |
| 458 |
% \end{macrocode} |
| 459 |
% \end{macro} |
| 460 |
% |
| 461 |
% \begin{macro}{titlepage} |
| 462 |
% Having argued that it is much better to deal with the titlepage separately |
| 463 |
% from the book itself, we do leave the choice of a titlepage as integral |
| 464 |
% part of the book as an option. However, the default will be to have no |
| 465 |
% titlepage. |
| 466 |
% \begin{macrocode} |
| 467 |
\DeclareOption{titlepage}{\@titlepagetrue} |
| 468 |
\DeclareOption{notitlepage}{\@titlepagefalse} |
| 469 |
% \end{macrocode} |
| 470 |
% \end{macro} |
| 471 |
% |
| 472 |
% \begin{macro}{openright} |
| 473 |
% New chapters normally start on a right-hand page in books, but novels, or |
| 474 |
% poetry books may well be better off by allowing chapters to begin on either |
| 475 |
% side. |
| 476 |
% \begin{macrocode} |
| 477 |
\DeclareOption{openright}{\@openrighttrue} |
| 478 |
\DeclareOption{openany}{\@openrightfalse} |
| 479 |
% \end{macrocode} |
| 480 |
% \end{macro} |
| 481 |
% |
| 482 |
% \begin{macro}{twocolumn} |
| 483 |
% Single or double column arrangement of the body text is chosen with this |
| 484 |
% option. The choice does require some care, as the width of a line of text |
| 485 |
% that can be read comfortably depends on the total number of ens, and this |
| 486 |
% is a function of the fount, the fount size and the text width. The larger |
| 487 |
% formats almost always benefit from being typeset in two columns. |
| 488 |
% \begin{macrocode} |
| 489 |
\DeclareOption{onecolumn}{\@twocolumnfalse} |
| 490 |
\DeclareOption{twocolumn}{\@twocolumntrue} |
| 491 |
% \end{macrocode} |
| 492 |
% \end{macro} |
| 493 |
% |
| 494 |
% \begin{macro}{leqno} |
| 495 |
% \begin{macro}{fleqn} |
| 496 |
% When including mathematical formul\ae , equation numbers are usually |
| 497 |
% placed to the right, but the |leqno| option places them on the left of the |
| 498 |
% the equation. The |fleqn| option redefines the math display environment so |
| 499 |
% that equations are typeset flush with the left margin and indented by |
| 500 |
% |\mathindent| from the prevailing left margin. |
| 501 |
% \begin{macrocode} |
| 502 |
\DeclareOption{leqno}{\input{leqno.clo}} |
| 503 |
\DeclareOption{fleqn}{\input{fleqn.clo}} |
| 504 |
% \end{macrocode} |
| 505 |
% \end{macro} |
| 506 |
% \end{macro} |
| 507 |
% |
| 508 |
% \begin{macro}{openbib} |
| 509 |
% The format of the bibliography is set to an `open' one, that is, each block |
| 510 |
% starts on a new line, with successive lines in a block indented by the |
| 511 |
% amount defined by |\bibindent|. |
| 512 |
% \begin{macrocode} |
| 513 |
\DeclareOption{openbib}{\@openbibtrue} |
| 514 |
% \end{macrocode} |
| 515 |
% \end{macro} |
| 516 |
% |
| 517 |
% \subsection{Executing options} |
| 518 |
% Here, default options are executed in order to initialise a number of |
| 519 |
% variables. The |\ProcessOptions| command then ensures the execution of the |
| 520 |
% code for every option declared and for which the user included an option |
| 521 |
% in the |\documentclass| command. |
| 522 |
% \begin{macrocode} |
| 523 |
\ExecuteOptions{crown,10pt,twoside,final,notitlepage,openright,onecolumn} |
| 524 |
\ProcessOptions |
| 525 |
% \end{macrocode} |
| 526 |
% After the execution of all the options, we can now load the class option |
| 527 |
% file which contains all the size dependent code. |
| 528 |
% \begin{macrocode} |
| 529 |
\input{oct1\@ptsize.clo} |
| 530 |
%</octavo> |
| 531 |
% \end{macrocode} |
| 532 |
% |
| 533 |
% \section{Document layout} |
| 534 |
% \subsection{Fount sizes} |
| 535 |
% The user has access to a number of commands which change the size of |
| 536 |
% the fount, relative to the `main' size used for the bulk of the text. |
| 537 |
% These |\size| commands issue a |
| 538 |
% |\@setfontsize||\size|\meta{font-size}\meta{baselineskip} where: |
| 539 |
% \begin{description} |
| 540 |
% \item{\meta{font-size}} The absolute size of the fount to use from |
| 541 |
% now on. |
| 542 |
% \item{\meta{baselineskip}} The normal value of |\baselineskip| |
| 543 |
% for the size of the fount selected. (The actual value will be |
| 544 |
% |\baselinestretch| * \meta{baselineskip}.) |
| 545 |
% \end{description} |
| 546 |
% |
| 547 |
% A number of commands, defined in the \LaTeX\ kernel, shorten the |
| 548 |
% following definitions and are used throughout. These are: |
| 549 |
% \begin{center} |
| 550 |
% \begin{tabular}{ll@{\qquad}ll@{\qquad}ll} |
| 551 |
% \verb=\@vpt= & 5 & \verb=\@vipt= & 6 & \verb=\@viipt= & 7 \\ |
| 552 |
% \verb=\@viiipt= & 8 & \verb=\@ixpt= & 9 & \verb=\@xpt= & 10 \\ |
| 553 |
% \verb=\@xipt= & 10.95 & \verb=\@xiipt= & 12 & \verb=\@xivpt= & 14.4\\ |
| 554 |
% \ldots |
| 555 |
% \end{tabular} |
| 556 |
% \end{center} |
| 557 |
% |
| 558 |
% \begin{macro}{\normalsize} |
| 559 |
% \begin{macro}{\@normalsize} |
| 560 |
% The user command to obtain the `main' size is |\normalsize|. \LaTeX\ |
| 561 |
% uses |\@normalsize| when referring to the main size and maintains this |
| 562 |
% value even if |\normalsize| is redefined. The |\normalsize| macro also |
| 563 |
% sets values for |\abovedisplayskip|, |\abovedisplayshortskip| and |
| 564 |
% |\belowdisplayshortskip|. |
| 565 |
% \begin{macrocode} |
| 566 |
%<*10pt|11pt|12pt> |
| 567 |
\renewcommand\normalsize{% |
| 568 |
%<*10pt> |
| 569 |
\@setfontsize\normalsize\@xpt\@xiipt |
| 570 |
\abovedisplayskip 12\p@ \@plus 2\p@ \@minus 2\p@ |
| 571 |
\abovedisplayshortskip \z@ \@plus 3\p@ |
| 572 |
\belowdisplayshortskip 6\p@ \@plus 3\p@ \@minus 3\p@ |
| 573 |
%</10pt> |
| 574 |
%<*11pt> |
| 575 |
\@setfontsize\normalsize\@xipt{13.2}% |
| 576 |
\abovedisplayskip 13.2\p@ \@plus 3\p@ \@minus 3\p@ |
| 577 |
\abovedisplayshortskip \z@ \@plus 3\p@ |
| 578 |
\belowdisplayshortskip 6.6\p@ \@plus 3\p@ \@minus 3\p@ |
| 579 |
%</11pt> |
| 580 |
%<*12pt> |
| 581 |
\@setfontsize\normalsize\@xiipt\@xivpt |
| 582 |
\abovedisplayskip 14.4\p@ \@plus 3\p@ \@minus 3\p@ |
| 583 |
\abovedisplayshortskip \z@ \@plus 3\p@ |
| 584 |
\belowdisplayshortskip 7.2\p@ \@plus 3\p@ \@minus 3\p@ |
| 585 |
%</12pt> |
| 586 |
% \end{macrocode} |
| 587 |
% The |\belowdisplayskip| equals |\abovedisplayskip|. The parameters of |
| 588 |
% the first-level list are always given by |\@listI|. |
| 589 |
% \begin{macrocode} |
| 590 |
\belowdisplayskip \abovedisplayskip |
| 591 |
\let\@listi\@listI} |
| 592 |
% \end{macrocode} |
| 593 |
% Initially, the |normalsize| fount is put into use for the document |
| 594 |
% \begin{macrocode} |
| 595 |
\normalsize |
| 596 |
% \end{macrocode} |
| 597 |
% \end{macro} |
| 598 |
% \end{macro} |
| 599 |
% |
| 600 |
% \begin{macro}{\small} |
| 601 |
% Similar to |\normalsize| |
| 602 |
% \begin{macrocode} |
| 603 |
\newcommand\small{% |
| 604 |
%<*10pt> |
| 605 |
\@setfontsize\small\@ixpt\@xipt% |
| 606 |
\abovedisplayskip 11\p@ \@plus 2\p@ \@minus2\p@ |
| 607 |
\abovedisplayshortskip \z@ \@plus 3\p@ |
| 608 |
\belowdisplayshortskip 5.5\p@ \@plus 2\p@ \@minus 2\p@ |
| 609 |
\def\@listi{\leftmargin\leftmargini |
| 610 |
\topsep 5.5\p@ \@plus 2\p@ \@minus 2\p@ |
| 611 |
\parsep \z@ |
| 612 |
\itemsep \z@}% |
| 613 |
%</10pt> |
| 614 |
%<*11pt> |
| 615 |
\@setfontsize\small\@xpt\@xiipt |
| 616 |
\abovedisplayskip 12\p@ \@plus 2\p@ \@minus 2\p@ |
| 617 |
\abovedisplayshortskip \z@ \@plus 3\p@ |
| 618 |
\belowdisplayshortskip 6\p@ \@plus 3\p@ \@minus 3\p@ |
| 619 |
\def\@listi{\leftmargin\leftmargini |
| 620 |
\topsep 6\p@ \@plus 2\p@ \@minus 2\p@ |
| 621 |
\parsep \z@ |
| 622 |
\itemsep \z@}% |
| 623 |
%</11pt> |
| 624 |
%<*12pt> |
| 625 |
\@setfontsize\small\@xipt{13.2}% |
| 626 |
\abovedisplayskip 13.2\p@ \@plus 3\p@ \@minus 3\p@ |
| 627 |
\abovedisplayshortskip \z@ \@plus 3\p@ |
| 628 |
\belowdisplayshortskip 6.6\p@ \@plus 3\p@ \@minus 3\p@ |
| 629 |
\def\@listi{\leftmargin\leftmargini |
| 630 |
\topsep 6.6\p@ \@plus 3\p@ \@minus 3\p@ |
| 631 |
\parsep \z@ |
| 632 |
\itemsep \z@}% |
| 633 |
%</12pt> |
| 634 |
\belowdisplayskip \abovedisplayskip} |
| 635 |
% \end{macrocode} |
| 636 |
% \end{macro} |
| 637 |
% |
| 638 |
% \begin{macro}{\footnotesize} |
| 639 |
% Again, very similar to |\normalsize| |
| 640 |
% \begin{macrocode} |
| 641 |
\newcommand\footnotesize{% |
| 642 |
%<*10pt> |
| 643 |
\@setfontsize\footnotesize\@viiipt{9.5}% |
| 644 |
\abovedisplayskip 9.5\p@ \@plus 2\p@ \@minus 2\p@ |
| 645 |
\abovedisplayshortskip \z@ \@plus 2\p@ |
| 646 |
\belowdisplayshortskip 5\p@ \@plus 2\p@ \@minus 2\p@ |
| 647 |
\def\@listi{\leftmargin\leftmargini |
| 648 |
\topsep 5\p@ \@plus 2\p@ \@minus 2\p@ |
| 649 |
\parsep \z@ |
| 650 |
\itemsep \z@}% |
| 651 |
%</10pt> |
| 652 |
%<*11pt> |
| 653 |
\@setfontsize\footnotesize\@ixpt\@xipt% |
| 654 |
\abovedisplayskip 11\p@ \@plus 2\p@ \@minus 2\p@ |
| 655 |
\abovedisplayshortskip \z@ \@plus 2\p@ |
| 656 |
\belowdisplayshortskip 5.5\p@ \@plus 2\p@ \@minus 2\p@ |
| 657 |
\def\@listi{\leftmargin\leftmargini |
| 658 |
\topsep 5.5\p@ \@plus 2\p@ \@minus 2\p@ |
| 659 |
\parsep \z@ |
| 660 |
\itemsep \z@}% |
| 661 |
%</11pt> |
| 662 |
%<*12pt> |
| 663 |
\@setfontsize\footnotesize\@xpt\@xiipt |
| 664 |
\abovedisplayskip 12\p@ \@plus 2\p@ \@minus 2\p@ |
| 665 |
\abovedisplayshortskip \z@ \@plus 3\p@ |
| 666 |
\belowdisplayshortskip 6\p@ \@plus 3\p@ \@minus 3\p@ |
| 667 |
\def\@listi{\leftmargin\leftmargini |
| 668 |
\topsep 6\p@ \@plus 2\p@ \@minus 2\p@ |
| 669 |
\parsep \z@ |
| 670 |
\itemsep \z@}% |
| 671 |
%</12pt> |
| 672 |
\belowdisplayskip \abovedisplayskip} |
| 673 |
% \end{macrocode} |
| 674 |
% \end{macro} |
| 675 |
% |
| 676 |
% \begin{macro}{\scriptsize} |
| 677 |
% \begin{macro}{\tiny} |
| 678 |
% \begin{macro}{\large} |
| 679 |
% \begin{macro}{\Large} |
| 680 |
% \begin{macro}{\LARGE} |
| 681 |
% \begin{macro}{\huge} |
| 682 |
% \begin{macro}{\Huge} |
| 683 |
% These macros select new fountsizes, but leave display and lists alone. |
| 684 |
% \begin{macrocode} |
| 685 |
%<*10pt> |
| 686 |
\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt} |
| 687 |
\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt} |
| 688 |
\newcommand\large{\@setfontsize\large\@xiipt{14}} |
| 689 |
\newcommand\Large{\@setfontsize\Large\@xivpt{18}} |
| 690 |
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}} |
| 691 |
\newcommand\huge{\@setfontsize\huge\@xxpt{25}} |
| 692 |
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}} |
| 693 |
%</10pt> |
| 694 |
%<*11pt> |
| 695 |
\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}} |
| 696 |
\newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt} |
| 697 |
\newcommand\large{\@setfontsize\large\@xiipt{14}} |
| 698 |
\newcommand\Large{\@setfontsize\Large\@xivpt{18}} |
| 699 |
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}} |
| 700 |
\newcommand\huge{\@setfontsize\huge\@xxpt{25}} |
| 701 |
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}} |
| 702 |
%</11pt> |
| 703 |
%<*12pt> |
| 704 |
\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}} |
| 705 |
\newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt} |
| 706 |
\newcommand\large{\@setfontsize\large\@xivpt{18}} |
| 707 |
\newcommand\Large{\@setfontsize\Large\@xviipt{22}} |
| 708 |
\newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}} |
| 709 |
\newcommand\huge{\@setfontsize\huge\@xxvpt{30}} |
| 710 |
\let\Huge=\huge |
| 711 |
%</12pt> |
| 712 |
%</10pt|11pt|12pt> |
| 713 |
% \end{macrocode} |
| 714 |
% \end{macro} |
| 715 |
% \end{macro} |
| 716 |
% \end{macro} |
| 717 |
% \end{macro} |
| 718 |
% \end{macro} |
| 719 |
% \end{macro} |
| 720 |
% \end{macro} |
| 721 |
% |
| 722 |
% \subsubsection{Fount changes} |
| 723 |
% Fount changes should really be done with the \LaTeXe\ commands, but quite |
| 724 |
% a few packages rely on the older versions of these commands. Therefore, for |
| 725 |
% the sake of compatibility, the old commands are retained. |
| 726 |
% \begin{macro}{\rm} |
| 727 |
% \begin{macro}{\tt} |
| 728 |
% \begin{macro}{\sf} |
| 729 |
% These are commands to change the fount family. |
| 730 |
% \begin{macrocode} |
| 731 |
%<*octavo> |
| 732 |
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} |
| 733 |
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} |
| 734 |
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} |
| 735 |
% \end{macrocode} |
| 736 |
% \end{macro} |
| 737 |
% \end{macro} |
| 738 |
% \end{macro} |
| 739 |
% |
| 740 |
% \begin{macro}{\bf} |
| 741 |
% The command to change to the bold series |
| 742 |
% \begin{macrocode} |
| 743 |
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} |
| 744 |
% \end{macrocode} |
| 745 |
% \end{macro} |
| 746 |
% |
| 747 |
% \begin{macro}{\sl} |
| 748 |
% \begin{macro}{\it} |
| 749 |
% \begin{macro}{\sc} |
| 750 |
% And finally, the commands to change the shape of the founts. |
| 751 |
% \begin{macrocode} |
| 752 |
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} |
| 753 |
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} |
| 754 |
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} |
| 755 |
% \end{macrocode} |
| 756 |
% \end{macro} |
| 757 |
% \end{macro} |
| 758 |
% \end{macro} |
| 759 |
% |
| 760 |
% \subsection{Paragraphs} |
| 761 |
% The parameters which control \TeX 's behaviour when typesetting |
| 762 |
% paragraphs receive a bit of a tweak here. Contrary to the usual |
| 763 |
% behaviour of modifying the grid with glue when difficulties are |
| 764 |
% encountered with vertical space, here we shall try to counteract |
| 765 |
% these tendencies and enforce as much as possible uniformity of the |
| 766 |
% grid of lines. |
| 767 |
% \begin{macro}{\lineskip} |
| 768 |
% \begin{macro}{\normallineskip} |
| 769 |
% These two parameters influence \TeX when two lines come too close. |
| 770 |
% \begin{macrocode} |
| 771 |
\setlength\lineskip{1\p@} |
| 772 |
\setlength\normallineskip{1\p@} |
| 773 |
% \end{macrocode} |
| 774 |
% \end{macro} |
| 775 |
% \end{macro} |
| 776 |
% |
| 777 |
% \begin{macro}{\baselinestretch} |
| 778 |
% Used by \TeX\ as a multiplier for |\baselineskip|. \emph{Default} |
| 779 |
% behaviour is not to stretch the baselines. If this command does not |
| 780 |
% resolve to `empty', any |plus| or |minus| part in the specification |
| 781 |
% of |\baselineskip| is ignored. |
| 782 |
% \begin{macrocode} |
| 783 |
\renewcommand\baselinestretch{} |
| 784 |
%</octavo> |
| 785 |
% \end{macrocode} |
| 786 |
% \end{macro} |
| 787 |
% |
| 788 |
% \begin{macro}{\parskip} |
| 789 |
% Extra vertical space can be put between successive paragraphs with |
| 790 |
% |\parskip| as it is usually defined as a zero rubber length. Here, it |
| 791 |
% is set to zero, without rubber extention, hopefully helping to maintain |
| 792 |
% the regular grid. |
| 793 |
% \begin{macrocode} |
| 794 |
%<*10pt|11pt|12pt> |
| 795 |
\setlength\parskip{0\p@} |
| 796 |
% \end{macrocode} |
| 797 |
% \end{macro} |
| 798 |
% |
| 799 |
% \begin{macro}{\parindent} |
| 800 |
% The value of |\parindent| was set to a variety of sizes depending on the |
| 801 |
% fount size and whether single- or double-column is in use. Using the |
| 802 |
% |em| measure relates the indent to the fount in use, and there is little |
| 803 |
% merit in having a marginally wider indent when typesetting in a single |
| 804 |
% column. |
| 805 |
% \begin{macrocode} |
| 806 |
\setlength\parindent{1em} |
| 807 |
%</10pt|11pt|12pt> |
| 808 |
% \end{macrocode} |
| 809 |
% \end{macro} |
| 810 |
% |
| 811 |
% \begin{macro}{\@lowpenalty} |
| 812 |
% \begin{macro}{\@medpenalty} |
| 813 |
% \begin{macro}{\@highpenalty} |
| 814 |
% Command such as |\nopagebreak| or |\nolinebreak| put in penalties to |
| 815 |
% discourage the placement of these breaks. Depending on the argument |
| 816 |
% with which they are put, a low, medium or high penalty is chosen. |
| 817 |
% \begin{macrocode} |
| 818 |
%<*octavo> |
| 819 |
\@lowpenalty 51 |
| 820 |
\@medpenalty 151 |
| 821 |
\@highpenalty 301 |
| 822 |
%</octavo> |
| 823 |
% \end{macrocode} |
| 824 |
% \end{macro} |
| 825 |
% \end{macro} |
| 826 |
% \end{macro} |
| 827 |
% |
| 828 |
% |
| 829 |
% \subsection{Page layout} |
| 830 |
% Here the class file deviates more noticably from the standard book class. |
| 831 |
% To begin with, all dimensions are measured from the true upper left corner |
| 832 |
% of the page. Dimensions and placement of the text area is directly related |
| 833 |
% to and determined as proportions of the dimensions of the page. |
| 834 |
% |
| 835 |
% \changes{1.2a}{2007/03/07}{Removed changes to hoffset and voffset to maintain |
| 836 |
% compatibility with other class files, notably crop} |
| 837 |
% |
| 838 |
% \subsubsection{Vertical spacing} |
| 839 |
% |
| 840 |
% \begin{macro}{\headheight} |
| 841 |
% \begin{macro}{\headsep} |
| 842 |
% \begin{macro}{\topskip} |
| 843 |
% The |\headheight| is the height of the box containing the running head. |
| 844 |
% The |\headsep| is the distance between the bottom of the box with the |
| 845 |
% running head and the top of the text. The |\topskip| is the |
| 846 |
% |\baselineskip| for the first line on the page. |
| 847 |
% \begin{macrocode} |
| 848 |
\setlength\headheight{12\p@} |
| 849 |
%<10pt>\setlength\headsep{6\p@} |
| 850 |
%<11pt>\setlength\headsep{7\p@} |
| 851 |
%<12pt>\setlength\headsep{8\p@} |
| 852 |
%<10pt>\setlength\topskip{10\p@} |
| 853 |
%<11pt>\setlength\topskip{11\p@} |
| 854 |
%<12pt>\setlength\topskip{12\p@} |
| 855 |
% \end{macrocode} |
| 856 |
% \end{macro} |
| 857 |
% \end{macro} |
| 858 |
% \end{macro} |
| 859 |
% |
| 860 |
% \begin{macro}{\footskip} |
| 861 |
% This is the distance from the baseline of the box containing the running |
| 862 |
% foot to the bottom of the text. |
| 863 |
% \begin{macrocode} |
| 864 |
%<10pt>\setlength\footskip{25\p@} |
| 865 |
%<11pt>\setlength\footskip{27.5\p@} |
| 866 |
%<12pt>\setlength\footskip{30\p@} |
| 867 |
% \end{macrocode} |
| 868 |
% \end{macro} |
| 869 |
% |
| 870 |
% \begin{macro}{\maxdepth} |
| 871 |
% The |\maxdepth| register has a function similar to that of |\topskip|. The |
| 872 |
% register |\@maxdepth| should always contain a copy of |\maxdepth|, and this |
| 873 |
% is ensured by setting it when issuing the command |\begin{document}|. In |
| 874 |
% \TeX\ and \LaTeX2.09 it was fixed at |4pt|. Following \LaTeXe, it now |
| 875 |
% depends on the typesize, and calculation simplifies it to half the topskip. |
| 876 |
% \begin{macrocode} |
| 877 |
\setlength\maxdepth{0.5\topskip} |
| 878 |
% \end{macrocode} |
| 879 |
% \end{macro} |
| 880 |
% |
| 881 |
% \subsubsection{Text dimensions} |
| 882 |
% Here we implement the proposals and calculations by Tschichold. In |
| 883 |
% particular, the proportions of text to page are set so that 49\% of |
| 884 |
% the page area is covered by the text block. |
| 885 |
% |
| 886 |
% \begin{macro}{\topmargin} |
| 887 |
% The |\topmargin| is the distance between the top of the text block and |
| 888 |
% the top of the box containing the running head. The running head is not |
| 889 |
% part of the text block, and it goes into the top margin. As |\topmargin| |
| 890 |
% is measured from the top of the box, we have to correct for header height |
| 891 |
% and header separation. |
| 892 |
% By subtracting 1 inch, the effect of voffset is overcome. |
| 893 |
% \changes{1.2b}{2007/03/07}{Subtract 1 inch from |topmargin| to move textblock} |
| 894 |
% \begin{macrocode} |
| 895 |
\setlength{\topmargin}{0.1\paperheight} |
| 896 |
\addtolength{\topmargin}{-\headheight} |
| 897 |
\addtolength{\topmargin}{-\headsep} |
| 898 |
\addtolength{\topmargin}{-1in} |
| 899 |
% \end{macrocode} |
| 900 |
% \end{macro} |
| 901 |
% |
| 902 |
% \begin{macro}{\textwidth} |
| 903 |
% Define the width of the text block to 0.7 of the page width, and make |
| 904 |
% calculations a little easier by adjusting the calculated width to a |
| 905 |
% whole number of points. |
| 906 |
% \begin{macrocode} |
| 907 |
\setlength{\textwidth}{0.7\paperwidth} |
| 908 |
\@settopoint\textwidth |
| 909 |
% \end{macrocode} |
| 910 |
% \end{macro} |
| 911 |
% |
| 912 |
% \begin{macro}{\textheight} |
| 913 |
% The height of the text block itself is set to 0.7 times the page height. |
| 914 |
% This amount is then adjusted to ensure that a whole number of lines makes |
| 915 |
% up the text block, and does so exactly. |
| 916 |
% \begin{macrocode} |
| 917 |
\setlength\@tempdima{0.7\paperheight} |
| 918 |
% \end{macrocode} |
| 919 |
% take away the first line, which is a bit shorter than the |\baselineskip|, |
| 920 |
% \begin{macrocode} |
| 921 |
\addtolength\@tempdima{-\topskip} |
| 922 |
% \end{macrocode} |
| 923 |
% this length may be very close, but just a little too small to accommodate |
| 924 |
% one more line, so we add a small amount, |
| 925 |
% \begin{macrocode} |
| 926 |
\addtolength\@tempdima{5\p@} |
| 927 |
% \end{macrocode} |
| 928 |
% and calculate the number of lines in this length, |
| 929 |
% \begin{macrocode} |
| 930 |
\divide\@tempdima\baselineskip |
| 931 |
\@tempcnta=\@tempdima |
| 932 |
% \end{macrocode} |
| 933 |
% The correct textheight comes to the number of lines just calculated, |
| 934 |
% multiplied by the height of text lines, |\baselineskip|, and with the |
| 935 |
% addition of the |\topskip| we took away initially. |
| 936 |
% \begin{macrocode} |
| 937 |
\setlength\textheight{\@tempcnta\baselineskip} |
| 938 |
\addtolength\textheight{\topskip} |
| 939 |
% \end{macrocode} |
| 940 |
% \end{macro} |
| 941 |
% |
| 942 |
% \subsubsection{Margin dimensions} |
| 943 |
% Now that we have set the size of the text block, the amount of space |
| 944 |
% available for margins is set as well. The remaining white space is divided |
| 945 |
% in a 1:2 ratio, hence the proportions between margins and text become 1:7:2. |
| 946 |
% |
| 947 |
% \begin{macro}{\evensidemargin} |
| 948 |
% \begin{macro}{\oddsidemargin} |
| 949 |
% Since we are typesetting books, both even and odd side margins have to be |
| 950 |
% set. |
| 951 |
% \changes{1.2c}{2007/03/07}{Subtract 1 inch from |oddsidemargin| and |evensidemargin| |
| 952 |
% to move textblock} |
| 953 |
% \begin{macrocode} |
| 954 |
\setlength{\evensidemargin}{0.2\paperwidth} |
| 955 |
\addtolength{\evensidemargin}{-1in} |
| 956 |
\setlength{\oddsidemargin}{0.1\paperwidth} |
| 957 |
\addtolength{\oddsidemargin}{-1in} |
| 958 |
% \end{macrocode} |
| 959 |
% \end{macro} |
| 960 |
% \end{macro} |
| 961 |
% |
| 962 |
% \begin{macro}{\marginparsep} |
| 963 |
% \begin{macro}{\marginparpush} |
| 964 |
% The horizontal space between the text block and marginal notes is set by |
| 965 |
% |\marginparsep|, while the minimal vertical separation between successive |
| 966 |
% marginal notes is controlled by |\marginparpush|. |
| 967 |
% \begin{macrocode} |
| 968 |
\if@twocolumn |
| 969 |
\setlength\marginparsep{10\p@} |
| 970 |
\else |
| 971 |
%<10pt>\setlength\marginparsep{10\p@} |
| 972 |
%<11pt>\setlength\marginparsep{11\p@} |
| 973 |
%<12pt>\setlength\marginparsep{12\p@} |
| 974 |
\fi |
| 975 |
%<10pt|11pt>\setlength\marginparpush{5\p@} |
| 976 |
%<12pt>\setlength\marginparpush{7\p@} |
| 977 |
% \end{macrocode} |
| 978 |
% \end{macro} |
| 979 |
% \end{macro} |
| 980 |
% |
| 981 |
% \begin{macro}{\marginparwidth} |
| 982 |
% The amount of space available for marginal notes is the outer margin. |
| 983 |
% From this we have to substract the separation between notes and the text |
| 984 |
% body, as well as another, marginal outer margin. In principle, marginal |
| 985 |
% text could run up all the way to the outer margin, but this is both ugly |
| 986 |
% and impractical for the book binder. Since the margins have to be cut, it |
| 987 |
% is very wise to leave sufficient space: |30pt| seems a good minimum. |
| 988 |
% \begin{macrocode} |
| 989 |
\setlength\@tempdima{\paperwidth} |
| 990 |
\addtolength\@tempdima{-\textwidth} |
| 991 |
\addtolength\@tempdima{-\oddsidemargin} |
| 992 |
\addtolength\@tempdima{-\marginparsep} |
| 993 |
\addtolength\@tempdima{-30\p@} |
| 994 |
\setlength\marginparwidth{\@tempdima} |
| 995 |
\@settopoint\marginparwidth |
| 996 |
% \end{macrocode} |
| 997 |
% \end{macro} |
| 998 |
% |
| 999 |
% \subsubsection{Footnotes} |
| 1000 |
% |
| 1001 |
% \begin{macro}{\footnotesep} |
| 1002 |
% The height of the strut placed at the beginning of every footnote. For |
| 1003 |
% each size, |\footnotesep| is set to the height of the corresponding |
| 1004 |
% |\footnotesize| strut, so there is no extra space between successive |
| 1005 |
% footnotes. |
| 1006 |
% \begin{macrocode} |
| 1007 |
%<10pt>\setlength\footnotesep{6.65\p@} |
| 1008 |
%<11pt>\setlength\footnotesep{7.7\p@} |
| 1009 |
%<12pt>\setlength\footnotesep{8.4\p@} |
| 1010 |
% \end{macrocode} |
| 1011 |
% \end{macro} |
| 1012 |
% |
| 1013 |
% \begin{macro}{\footins} |
| 1014 |
% The space between the last line of the main text and the top of the first |
| 1015 |
% footnote. |
| 1016 |
% \begin{macrocode} |
| 1017 |
%<10pt>\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@} |
| 1018 |
%<11pt>\setlength{\skip\footins}{10\p@ \@plus 4\p@ \@minus 2\p@} |
| 1019 |
%<12pt>\setlength{\skip\footins}{11\p@ \@plus 4\p@ \@minus 2\p@} |
| 1020 |
% \end{macrocode} |
| 1021 |
% \end{macro} |
| 1022 |
% |
| 1023 |
% \subsubsection{Float placement} |
| 1024 |
% Float placement parameters are given values by \LaTeXe, therefore any |
| 1025 |
% parameters which are not counters have to be (re)set with |\renewcommand|. |
| 1026 |
% \begin{macro}{topnumber} |
| 1027 |
% The maximum number of floats allowed at the top of a page. |
| 1028 |
% \begin{macrocode} |
| 1029 |
%<*octavo> |
| 1030 |
\setcounter{topnumber}{2} |
| 1031 |
% \end{macrocode} |
| 1032 |
% \end{macro} |
| 1033 |
% |
| 1034 |
% \begin{macro}{\topfraction} |
| 1035 |
% The maximum part of a text page that may be occupied by floats at the |
| 1036 |
% top of a page. |
| 1037 |
% \begin{macrocode} |
| 1038 |
\renewcommand\topfraction{.7} |
| 1039 |
% \end{macrocode} |
| 1040 |
% \end{macro} |
| 1041 |
% |
| 1042 |
% \begin{macro}{bottomnumber} |
| 1043 |
% The equivalent of |topnumber|, but for the maximum number of floats |
| 1044 |
% allowed at the bottom of a page. |
| 1045 |
% \begin{macrocode} |
| 1046 |
\setcounter{bottomnumber}{1} |
| 1047 |
% \end{macrocode} |
| 1048 |
% \end{macro} |
| 1049 |
% |
| 1050 |
% \begin{macro}{\bottomfraction} |
| 1051 |
% The maximum part of a text page that may be occupied by floats at the |
| 1052 |
% bottom of a page. |
| 1053 |
% \begin{macrocode} |
| 1054 |
\renewcommand\bottomfraction{.5} |
| 1055 |
% \end{macrocode} |
| 1056 |
% \end{macro} |
| 1057 |
% |
| 1058 |
% \begin{macro}{totalnumber} |
| 1059 |
% The maximum number of floats in total which may appear on a page. |
| 1060 |
% \begin{macrocode} |
| 1061 |
\setcounter{totalnumber}{3} |
| 1062 |
% \end{macrocode} |
| 1063 |
% \end{macro} |
| 1064 |
% |
| 1065 |
% \begin{macro}{\textfraction} |
| 1066 |
% The minimum part of a text page which has to be occupied by text. |
| 1067 |
% \begin{macrocode} |
| 1068 |
\renewcommand\textfraction{.2} |
| 1069 |
% \end{macrocode} |
| 1070 |
% \end{macro} |
| 1071 |
% |
| 1072 |
% \begin{macro}{\floatpagefraction} |
| 1073 |
% The minimum part of a page which has to be occupied by floating object |
| 1074 |
% before a `float page' is produced. |
| 1075 |
% \begin{macrocode} |
| 1076 |
\renewcommand\floatpagefraction{.5} |
| 1077 |
% \end{macrocode} |
| 1078 |
% \end{macro} |
| 1079 |
% |
| 1080 |
% \begin{macro}{dbltopnumber} |
| 1081 |
% The maximum number of two-column floats which may appear at the top of |
| 1082 |
% a two-column text page. |
| 1083 |
% \begin{macrocode} |
| 1084 |
\setcounter{dbltopnumber}{2} |
| 1085 |
% \end{macrocode} |
| 1086 |
% \end{macro} |
| 1087 |
% |
| 1088 |
% \begin{macro}{\dbltopfraction} |
| 1089 |
% The maximum part of a two-column text page which may be occupied at the |
| 1090 |
% top by two-column floats. |
| 1091 |
% \begin{macrocode} |
| 1092 |
\renewcommand\dbltopfraction{.7} |
| 1093 |
% \end{macrocode} |
| 1094 |
% \end{macro} |
| 1095 |
% |
| 1096 |
% \begin{macro}{\dblfloatpagefraction} |
| 1097 |
% The minimum part of a page which has to be occupied by two-column floating |
| 1098 |
% objects before a `float page' is produced. |
| 1099 |
% \begin{macrocode} |
| 1100 |
\renewcommand\dblfloatpagefraction{.5} |
| 1101 |
%</octavo> |
| 1102 |
% \end{macrocode} |
| 1103 |
% \end{macro} |
| 1104 |
% |
| 1105 |
% \begin{macro}{\floatsep} |
| 1106 |
% \begin{macro}{\textfloatsep} |
| 1107 |
% \begin{macro}{\intextsep} |
| 1108 |
% These parameters control the separation between a float object and the |
| 1109 |
% other objects on the same page. They are used in both single-column and |
| 1110 |
% double-column mode. |
| 1111 |
% \begin{description} |
| 1112 |
% \item{|\floatsep|} is the amount of space between adjacent floats moved to |
| 1113 |
% the top or to the bottom of the text page. |
| 1114 |
% \item{|\textfloatsep|} is the amount of space between the main text and the |
| 1115 |
% floats at the top or at the bottom of the text page. |
| 1116 |
% \item{|\intextsep|} is the amount of space between in-text floats and the |
| 1117 |
% text |
| 1118 |
% \end{description} |
| 1119 |
% \begin{macrocode} |
| 1120 |
%<*10pt> |
| 1121 |
\setlength\floatsep{12\p@ \@plus 2\p@ \@minus 2\p@} |
| 1122 |
\setlength\textfloatsep{24\p@ \@plus 2\p@ \@minus 4\p@} |
| 1123 |
\setlength\intextsep{12\p@ \@plus 2\p@ \@minus 2\p@} |
| 1124 |
%</10pt> |
| 1125 |
%<*11pt> |
| 1126 |
\setlength\floatsep{13.2\p@ \@plus 2\p@ \@minus 2\p@} |
| 1127 |
\setlength\textfloatsep{26\p@ \@plus 2\p@ \@minus 4\p@} |
| 1128 |
\setlength\intextsep{13.2\p@ \@plus 2\p@ \@minus 2\p@} |
| 1129 |
%</11pt> |
| 1130 |
%<*12pt> |
| 1131 |
\setlength\floatsep{14.4\p@ \@plus 2\p@ \@minus 2\p@} |
| 1132 |
\setlength\textfloatsep{28\p@ \@plus 2\p@ \@minus 4\p@} |
| 1133 |
\setlength\intextsep{14.4\p@ \@plus 4\p@ \@minus 2\p@} |
| 1134 |
%</12pt> |
| 1135 |
% \end{macrocode} |
| 1136 |
% \end{macro} |
| 1137 |
% \end{macro} |
| 1138 |
% \end{macro} |
| 1139 |
% |
| 1140 |
% \begin{macro}{\dblfloatsep} |
| 1141 |
% \begin{macro}{\dbltextfloatsep} |
| 1142 |
% In two-column mode, floats spanning the entire |\textwidth| are placed |
| 1143 |
% with the parameters |\dblfloatsep| and |\dbltextfloatsep| in control. |
| 1144 |
% \begin{description} |
| 1145 |
% \item{|\dblfloatsep|} is the amount of space between adjacent floats at the |
| 1146 |
% top or at the bottom of the text page |
| 1147 |
% \item{|\dbltextfloatsep|} is the amount of space between the main text and |
| 1148 |
% floats at the top or at the bottom of the text page. |
| 1149 |
% \end{description} |
| 1150 |
% \begin{macrocode} |
| 1151 |
%<*10pt> |
| 1152 |
\setlength\dblfloatsep{12\p@ \@plus 2\p@ \@minus 2\p@} |
| 1153 |
\setlength\dbltextfloatsep{24\p@ \@plus 2\p@ \@minus 4\p@} |
| 1154 |
%</10pt> |
| 1155 |
%<*11pt> |
| 1156 |
\setlength\dblfloatsep{12\p@ \@plus 2\p@ \@minus 2\p@} |
| 1157 |
\setlength\dbltextfloatsep{26\p@ \@plus 2\p@ \@minus 4\p@} |
| 1158 |
%</11pt> |
| 1159 |
%<*12pt> |
| 1160 |
\setlength\dblfloatsep{14\p@ \@plus 2\p@ \@minus 2\p@} |
| 1161 |
\setlength\dbltextfloatsep{28\p@ \@plus 2\p@ \@minus 4\p@} |
| 1162 |
%</12pt> |
| 1163 |
% \end{macrocode} |
| 1164 |
% \end{macro} |
| 1165 |
% \end{macro} |
| 1166 |
% |
| 1167 |
% \begin{macro}{\@fptop} |
| 1168 |
% \begin{macro}{\@fpsep} |
| 1169 |
% \begin{macro}{\@fpbot} |
| 1170 |
% The layout of floating objects on separate, `float' pages is controlled by |
| 1171 |
% the parameters |\@fptop|, |\@fpsep| and |\@fpbot|. These parameters insert |
| 1172 |
% stretchable amounts of white space between the top and the bottom of the |
| 1173 |
% page and the floats, while |\@fpsep| inserts white space between adjacent |
| 1174 |
% floats. In order to ensure that any remaining space is filled, at least one |
| 1175 |
% of |\@fptop| or |\@fpbot| has to contain stretchable space. |
| 1176 |
% \begin{macrocode} |
| 1177 |
%<*10pt> |
| 1178 |
\setlength\@fptop{0\p@ \@plus 1fil} |
| 1179 |
\setlength\@fpsep{10\p@ \@plus 2fil} |
| 1180 |
\setlength\@fpbot{0\p@ \@plus 1fil} |
| 1181 |
%</10pt> |
| 1182 |
%<*11pt> |
| 1183 |
\setlength\@fptop{0\p@ \@plus 1fil} |
| 1184 |
\setlength\@fpsep{11\p@ \@plus 2fil} |
| 1185 |
\setlength\@fpbot{0\p@ \@plus 1fil} |
| 1186 |
%</11pt> |
| 1187 |
%<*12pt> |
| 1188 |
\setlength\@fptop{0\p@ \@plus 1fil} |
| 1189 |
\setlength\@fpsep{12\p@ \@plus 2fil} |
| 1190 |
\setlength\@fpbot{0\p@ \@plus 1fil} |
| 1191 |
%</12pt> |
| 1192 |
% \end{macrocode} |
| 1193 |
% \end{macro} |
| 1194 |
% \end{macro} |
| 1195 |
% \end{macro} |
| 1196 |
% |
| 1197 |
% \begin{macro}{\@dblfptop} |
| 1198 |
% \begin{macro}{\@dblfpsep} |
| 1199 |
% \begin{macro}{\@dblfpbot} |
| 1200 |
% The layout of floating objects in double-column mode on separate `float' |
| 1201 |
% pages is handled in a similar way to that used for single-column mode |
| 1202 |
% pages just described. |
| 1203 |
% \begin{macrocode} |
| 1204 |
%<*10pt> |
| 1205 |
\setlength\@dblfptop{0\p@ \@plus 1fil} |
| 1206 |
\setlength\@dblfpsep{10\p@ \@plus 2fil} |
| 1207 |
\setlength\@dblfpbot{0\p@ \@plus 1fil} |
| 1208 |
%</10pt> |
| 1209 |
%<*11pt> |
| 1210 |
\setlength\@dblfptop{0\p@ \@plus 1fil} |
| 1211 |
\setlength\@dblfpsep{11\p@ \@plus 2fil} |
| 1212 |
\setlength\@dblfpbot{0\p@ \@plus 1fil} |
| 1213 |
%</11pt> |
| 1214 |
%<*12pt> |
| 1215 |
\setlength\@dblfptop{0\p@ \@plus 1fil} |
| 1216 |
\setlength\@dblfpsep{12\p@ \@plus 2fil} |
| 1217 |
\setlength\@dblfpbot{0\p@ \@plus 1fil} |
| 1218 |
%</12pt> |
| 1219 |
% \end{macrocode} |
| 1220 |
% \end{macro} |
| 1221 |
% \end{macro} |
| 1222 |
% \end{macro} |
| 1223 |
% |
| 1224 |
% |
| 1225 |
% \subsection{Page styles} |
| 1226 |
% A number of page styles are defined by the class file. Of course, more |
| 1227 |
% elaborate styles can be designed using the |fancyheadings| package, but |
| 1228 |
% once again, here we opt for the more restrained and discrete means of |
| 1229 |
% guiding the reader. The page styles included in the standard \LaTeX\ book |
| 1230 |
% class are either |headings|, |plain|, |empty| or |myheadings|. The standard |
| 1231 |
% |headings| is here modified a little, so that the folios now appear |
| 1232 |
% centered at the foot of the page. |
| 1233 |
% |
| 1234 |
% The page style \emph{style} is defined by defining the command |\ps@style|. |
| 1235 |
% Definitions should be local only, and any stray spaces in definitions had |
| 1236 |
% better be avoided as they may turn up unexpectedly in the output. |
| 1237 |
% |
| 1238 |
% \begin{macro}{\@evenhead} |
| 1239 |
% \begin{macro}{\@oddhead} |
| 1240 |
% \begin{macro}{\@evenfoot} |
| 1241 |
% \begin{macro}{\@oddfoot} |
| 1242 |
% The |\ps@style| commands define the macros |\@evenhead|, |\@evenfoot| and |
| 1243 |
% their odd-page equivalents to define the running head and foot. The |
| 1244 |
% contents are produced inside a |\hbox| of width |\textwidth|. |
| 1245 |
% \end{macro} |
| 1246 |
% \end{macro} |
| 1247 |
% \end{macro} |
| 1248 |
% \end{macro} |
| 1249 |
% |
| 1250 |
% \subsubsection{Marking conventions} |
| 1251 |
% The making of headings reflecting the sectioning commands, a page style |
| 1252 |
% has to define commands such as |\chaptermark|, |\sectionmark| and so on |
| 1253 |
% so that e.g., |\chapter| calls |\chaptermark{TEXT}|. These commands are |
| 1254 |
% all defined with the help of the following macros, which have extended |
| 1255 |
% in \LaTeX\ a bit as compared to the original \TeX\ |\mark| facility. |
| 1256 |
% So we now have at our disposal: |
| 1257 |
% \begin{description} |
| 1258 |
% \item{|\markboth{Left}{Right}|} Adds both marks |
| 1259 |
% \item{|\markright{Right}|} Adds a righthand-side mark |
| 1260 |
% \item{|\leftmark|} used in the |\SIDEhead| and |\SIDEfoot| macros, |
| 1261 |
% getting the current lefthand-side mark |
| 1262 |
% \item{|\rightmark|} also used in the |\SIDEhead| and |\SIDEfoot| |
| 1263 |
% macros, but getting the current righthand-side mark. |
| 1264 |
% \end{description} |
| 1265 |
% |
| 1266 |
% \subsubsection{The headings and myheadings styles} |
| 1267 |
% The two other styles, |plain| and |empty| are defined by \LaTeX. |
| 1268 |
% |
| 1269 |
% \begin{macro}{\ps@headings} |
| 1270 |
% To begin with, the folios are centered at the foot of the pages, while |
| 1271 |
% the running heads contain one of the marks. The contents of the running |
| 1272 |
% head is determined both by the chapter and the section titles, hence we |
| 1273 |
% let |\@mkboth| be |\markboth|. |
| 1274 |
% \begin{macrocode} |
| 1275 |
%<*octavo> |
| 1276 |
\def\ps@headings{% |
| 1277 |
\def\@oddfoot{\hfil\thepage\hfil}% |
| 1278 |
\def\@evenfoot{\hfil\thepage\hfil}% |
| 1279 |
\def\@evenhead{\hfil{\scshape\leftmark}\hfil}% |
| 1280 |
\def\@oddhead{\hfil{\scshape\rightmark}\hfil}% |
| 1281 |
\let\@mkboth\markboth |
| 1282 |
% \end{macrocode} |
| 1283 |
% \end{macro} |
| 1284 |
% |
| 1285 |
% \begin{macro}{\chaptermark} |
| 1286 |
% \begin{macro}{\sectionmark} |
| 1287 |
% As we use |\chaptermark| and |\sectionmark| to fill the running heads |
| 1288 |
% we define these here. The use of |##1| as parameter of the commands, and |
| 1289 |
% these will be defined when |\ps@headings| is executed. |
| 1290 |
% \begin{macrocode} |
| 1291 |
\def\chaptermark##1{% |
| 1292 |
\markboth {% |
| 1293 |
\ifnum \c@secnumdepth >\m@ne |
| 1294 |
\if@mainmatter |
| 1295 |
\@chapapp\ \thechapter. \ % |
| 1296 |
\fi |
| 1297 |
\fi |
| 1298 |
##1}{}}% |
| 1299 |
\def\sectionmark##1{% |
| 1300 |
\markright {% |
| 1301 |
\ifnum \c@secnumdepth >\z@ |
| 1302 |
\thesection. \ % |
| 1303 |
\fi |
| 1304 |
##1}}} |
| 1305 |
% \end{macrocode} |
| 1306 |
% \end{macro} |
| 1307 |
% \end{macro} |
| 1308 |
% |
| 1309 |
% \begin{macro}{\ps@myheadings} |
| 1310 |
% The definition of this page style is straightforward, as it is up to the |
| 1311 |
% user to determine what goes into the running heads by setting the |
| 1312 |
% |\markboth| and |\markright| commands in the text. We do, however, maintain |
| 1313 |
% the presence of the centered folios at the foot of the pages. To ensure |
| 1314 |
% that the marking commands used by chapter and section commands are not |
| 1315 |
% used, we set them to a macro gobbling up the arguments. |
| 1316 |
% \begin{macrocode} |
| 1317 |
\def\ps@myheadings{% |
| 1318 |
\def\@oddfoot{\hfil\thepage\hfil}% |
| 1319 |
\def\@evenfoot{\hfil\thepage\hfil}% |
| 1320 |
\def\@evenhead{\hfil{\scshape\leftmark}\hfil}% |
| 1321 |
\def\@oddhead{\hfil{\scshape\rightmark}\hfil}% |
| 1322 |
\let\@mkboth\@gobbletwo |
| 1323 |
\let\chaptermark\@gobble |
| 1324 |
\let\sectionmark\@gobble} |
| 1325 |
% \end{macrocode} |
| 1326 |
% \end{macro} |
| 1327 |
% |
| 1328 |
% |
| 1329 |
% \section{Document markup} |
| 1330 |
% |
| 1331 |
% \subsection{The title} |
| 1332 |
% \begin{macro}{\maketitle} |
| 1333 |
% The three macros |\title|, |\author| and |\date| are part of \LaTeX, |
| 1334 |
% and that info is therefore stored away in internal control sequences. |
| 1335 |
% The |\date| macro gets today's date by default, so it may have to be |
| 1336 |
% set explicitly to a particular date by the user. |
| 1337 |
% |
| 1338 |
% If there is a request for a title, we will generate a simple, separate |
| 1339 |
% titlepage. First, a local redefinition of |\footnotesize| and |
| 1340 |
% |footnoterule|, so that we get a different appearance of the |\thanks| |
| 1341 |
% command. These changes affect all footnotes, but since there really is |
| 1342 |
% no need for true footnotes on a title page, this is hardly a problem. |
| 1343 |
% \begin{macrocode} |
| 1344 |
\if@titlepage |
| 1345 |
\newcommand\maketitle{\begin{titlepage}% |
| 1346 |
\let\footnotesize\small |
| 1347 |
\let\footnoterule\relax |
| 1348 |
\let\footnote\thanks |
| 1349 |
% \end{macrocode} |
| 1350 |
% The title itself is centered vertically, with a little offset brought by |
| 1351 |
% a |\vskip|. |
| 1352 |
% \begin{macrocode} |
| 1353 |
\null\vfil |
| 1354 |
\vskip 60\p@ |
| 1355 |
% \end{macrocode} |
| 1356 |
% Now we can set the title, using the |\LARGE| fount, followed by a little |
| 1357 |
% bit of vertical space, and then the authors, set in |\large| fount. To |
| 1358 |
% ensure everything lines up nicely in a single column, we resort to the |
| 1359 |
% tabular environment. A little vertical space is then followed by the date. |
| 1360 |
% \begin{macrocode} |
| 1361 |
\begin{center}% |
| 1362 |
{\LARGE \@title \par}% |
| 1363 |
\vskip 3em% |
| 1364 |
{\large |
| 1365 |
\lineskip .75em% |
| 1366 |
\begin{tabular}[t]{c}% |
| 1367 |
\@author |
| 1368 |
\end{tabular}\par}% |
| 1369 |
\vskip 1.5em% |
| 1370 |
{\large \@date \par}% |
| 1371 |
\end{center}\par |
| 1372 |
% \end{macrocode} |
| 1373 |
% Calling |\@thanks| prints the information to go into the footnote, and |
| 1374 |
% completes the printing on the page. |
| 1375 |
% \begin{macrocode} |
| 1376 |
\@thanks |
| 1377 |
\vfil\null |
| 1378 |
\end{titlepage}% |
| 1379 |
% \end{macrocode} |
| 1380 |
% Having finished the printing of the title page, we now clean up. |
| 1381 |
% \begin{macrocode} |
| 1382 |
\setcounter{footnote}{0}% |
| 1383 |
\let\thanks\relax |
| 1384 |
\let\maketitle\relax |
| 1385 |
\gdef\@thanks{} |
| 1386 |
\gdef\@author{} |
| 1387 |
\gdef\@title{}} |
| 1388 |
\fi |
| 1389 |
% \end{macrocode} |
| 1390 |
% \end{macro} |
| 1391 |
% |
| 1392 |
% |
| 1393 |
% \subsection{Chapters and section} |
| 1394 |
% The coming definitions rely on two internal macros, |\@startsection| and |
| 1395 |
% |\secdef|. Their syntax is simpe but a bit involved. The |\@startsection| |
| 1396 |
% macro has 7 required arguments and 2 optional ones. The full set looks like |
| 1397 |
% this: |
| 1398 |
% |
| 1399 |
% |\@startsection|\meta{name}\meta{level}\meta{indent}\meta{beforeskip} |
| 1400 |
% \meta{afterskip}\meta{style} \\ |
| 1401 |
% |[|*|] ||[|\meta{altheading}|]| \meta{heading} |
| 1402 |
% |
| 1403 |
% \begin{description} |
| 1404 |
% \item{\meta{name}} The name of the level command, e.g., `section'. |
| 1405 |
% \item{\meta{level}} A number denoting the depth of the section, |
| 1406 |
% chapter=1, section=2, etc. A section number will be printed only |
| 1407 |
% if \meta{level} is equal or smaller than the value of |
| 1408 |
% \emph{secnumdepth}. |
| 1409 |
% \item{\meta{indent}} The indentation of the heading from the left margin |
| 1410 |
% \item{\meta{beforeskip}} The absolute value of this argument is the skip |
| 1411 |
% to leave above the heading. If it is negative, then the paragraph |
| 1412 |
% indent of the text following the heading is suppressed. |
| 1413 |
% \item{\meta{afterskip}} If positive, it is the skip to leave below the |
| 1414 |
% heading, else it is the skip to the right of a run-in heading. |
| 1415 |
% \item{\meta{style}} Sets the style of the heading. |
| 1416 |
% \item{$*$} When this is missing the heading is numbered and the |
| 1417 |
% corresponding counter is incremented. |
| 1418 |
% \item{\meta{altheading}} Gives an alternative heading to use in |
| 1419 |
% the table of contents and in the running heads. This should |
| 1420 |
% be present when the $*$ form is used. |
| 1421 |
% \item{\meta{heading}} The heading of the new section. |
| 1422 |
% \end{description} |
| 1423 |
% |
| 1424 |
% The macro |\secdef| can be used when a sectioning command is |
| 1425 |
% defined without using |\@startsection|. It has two arguments: |
| 1426 |
% |
| 1427 |
% |\secdef|\meta{unstarcmds}\meta{starcmds} |
| 1428 |
% |
| 1429 |
% \begin{description} |
| 1430 |
% \item{\meta{unstarcmds}} Used for the normal form of the |
| 1431 |
% sectioning command. |
| 1432 |
% \item{\meta{starcmds}} Used for the $*$-form of the |
| 1433 |
% sectioning command. |
| 1434 |
% \end{description} |
| 1435 |
% |
| 1436 |
% \subsubsection{Definition of counters} |
| 1437 |
% \begin{macro}{\c@secnumdepth} |
| 1438 |
% The \emph{secnumdepth} counter indicates to what level sectioning commands |
| 1439 |
% have to make and include section numbers. More often than not, such numbers |
| 1440 |
% are of little real value to the reader of a book: therefore, it is herein |
| 1441 |
% set to a value that eliminates such number. The user can always bring them |
| 1442 |
% back in by resetting \emph{secnumdepth} in the preamble of the document. |
| 1443 |
% \begin{macrocode} |
| 1444 |
\setcounter{secnumdepth}{-2} |
| 1445 |
% \end{macrocode} |
| 1446 |
% \end{macro} |
| 1447 |
% |
| 1448 |
% \begin{macro}{\c@part} |
| 1449 |
% \begin{macro}{\c@chapter} |
| 1450 |
% \begin{macro}{\c@section} |
| 1451 |
% \begin{macro}{\c@subsection} |
| 1452 |
% \begin{macro}{\c@subsubsection} |
| 1453 |
% \begin{macro}{\c@paragraph} |
| 1454 |
% \begin{macro}{\c@subparagraph} |
| 1455 |
% Nevertheless, all counters will be defined in case they are wanted. |
| 1456 |
% The particular construction |\newcounter{\meta{newcount}}[\meta{oldcount}]| |
| 1457 |
% defined \meta{newcount} as a counter which is reset every time |
| 1458 |
% \meta{oldcount} is stepped. Of course, the counter \meta{oldcount} must |
| 1459 |
% have been defined. |
| 1460 |
% \begin{macrocode} |
| 1461 |
\newcounter{part} |
| 1462 |
\newcounter{chapter} |
| 1463 |
\newcounter{section}[chapter] |
| 1464 |
\newcounter{subsection}[section] |
| 1465 |
\newcounter{subsubsection}[subsection] |
| 1466 |
\newcounter{paragraph}[subsubsection] |
| 1467 |
\newcounter{subparagraph}[paragraph] |
| 1468 |
% \end{macrocode} |
| 1469 |
% \end{macro} |
| 1470 |
% \end{macro} |
| 1471 |
% \end{macro} |
| 1472 |
% \end{macro} |
| 1473 |
% \end{macro} |
| 1474 |
% \end{macro} |
| 1475 |
% \end{macro} |
| 1476 |
% |
| 1477 |
% \begin{macro}{\thepart} |
| 1478 |
% \begin{macro}{\thechapter} |
| 1479 |
% \begin{macro}{\thesection} |
| 1480 |
% \begin{macro}{\thesubsection} |
| 1481 |
% \begin{macro}{\thesubsubsection} |
| 1482 |
% \begin{macro}{\theparagraph} |
| 1483 |
% \begin{macro}{\thesubparagraph} |
| 1484 |
% For each counter, the |\theCTR| macro defines how the counter CTR is |
| 1485 |
% printed. |
| 1486 |
% \begin{macrocode} |
| 1487 |
\renewcommand\thepart{\@Roman\c@part} |
| 1488 |
\renewcommand\thechapter{\@arabic\c@chapter} |
| 1489 |
\renewcommand\thesection{\thechapter.\@arabic\c@section} |
| 1490 |
\renewcommand\thesubsection{\thesection.\@arabic\c@subsection} |
| 1491 |
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection} |
| 1492 |
\renewcommand\theparagraph{\thesubsubsection.\@arabic\c@paragraph} |
| 1493 |
\renewcommand\thesubparagraph{\theparagraph.\@arabic\c@subparagraph} |
| 1494 |
% \end{macrocode} |
| 1495 |
% \end{macro} |
| 1496 |
% \end{macro} |
| 1497 |
% \end{macro} |
| 1498 |
% \end{macro} |
| 1499 |
% \end{macro} |
| 1500 |
% \end{macro} |
| 1501 |
% \end{macro} |
| 1502 |
% |
| 1503 |
% \begin{macro}{\@chapapp} |
| 1504 |
% The macro |\@chapapp| is defined to be |\chaptername|. But when the |
| 1505 |
% |\appendix| command is issued, it is changed to |\appendixname| |
| 1506 |
% \begin{macrocode} |
| 1507 |
\newcommand\@chapapp{\chaptername} |
| 1508 |
% \end{macrocode} |
| 1509 |
% \end{macro} |
| 1510 |
% |
| 1511 |
% \subsubsection{Front, main and back matter} |
| 1512 |
% Books are traditionally made up from three logical sections, known as |
| 1513 |
% front matter, main matter and back matter. The actual \emph{text} of |
| 1514 |
% a book is the main matter. The separation into different `matters' allows |
| 1515 |
% slightly different ways of typesetting these sections. |
| 1516 |
% |
| 1517 |
% \begin{macro}{\frontmatter} |
| 1518 |
% Front matter is typeset with roman page numbering and without numbers given |
| 1519 |
% to any of its chapters. |
| 1520 |
% \begin{macrocode} |
| 1521 |
\newcommand\frontmatter{\cleardoublepage |
| 1522 |
\@mainmatterfalse\pagenumbering{roman}} |
| 1523 |
% \end{macrocode} |
| 1524 |
% \end{macro} |
| 1525 |
% |
| 1526 |
% \begin{macro}{\mainmatter} |
| 1527 |
% In main matter, we first clear the page, start page numbering with arabic |
| 1528 |
% numerals and switch on chapter numbering (which will be visible only if |
| 1529 |
% \emph{secnumdepth} has been set to a sufficiently high value, of course. |
| 1530 |
% \begin{macrocode} |
| 1531 |
\newcommand\mainmatter{\cleardoublepage |
| 1532 |
\@mainmattertrue\pagenumbering{arabic}} |
| 1533 |
% \end{macrocode} |
| 1534 |
% \end{macro} |
| 1535 |
% |
| 1536 |
% \begin{macro}{\backmatter} |
| 1537 |
% Back matter clears the page, turns off any chapter numbering, but leaves |
| 1538 |
% the page numbering unchanged. |
| 1539 |
% \begin{macrocode} |
| 1540 |
\newcommand\backmatter{\cleardoublepage |
| 1541 |
\@mainmatterfalse} |
| 1542 |
% \end{macrocode} |
| 1543 |
% \end{macro} |
| 1544 |
% |
| 1545 |
% \subsubsection{Parts} |
| 1546 |
% The text of books may well be divided into a number of parts by the |
| 1547 |
% writer(s). Here are the macros to deal with these major divisions of |
| 1548 |
% a text, should they be required. |
| 1549 |
% \begin{macro}{\part} |
| 1550 |
% A part is shown in the book by beginning on a new right-hand page and |
| 1551 |
% we use a \emph{plain} pagestyle. |
| 1552 |
% \begin{macrocode} |
| 1553 |
\newcommand\part{\cleardoublepage |
| 1554 |
\thispagestyle{plain}% |
| 1555 |
% \end{macrocode} |
| 1556 |
% In case we are dealing with a double-column text, the page will be in a |
| 1557 |
% single column but we have to remember we switch back to double-column mode. |
| 1558 |
% \begin{macrocode} |
| 1559 |
\if@twocolumn |
| 1560 |
\onecolumn |
| 1561 |
\@tempswatrue |
| 1562 |
\else |
| 1563 |
\@tempswafalse |
| 1564 |
\fi |
| 1565 |
% \end{macrocode} |
| 1566 |
% To ensure that the fill glue does not disappear, we need an empty box. |
| 1567 |
% \begin{macrocode} |
| 1568 |
\hbox{}\vfil |
| 1569 |
% \end{macrocode} |
| 1570 |
% To make the actual heading, we issue a |\secdef| here. |
| 1571 |
% \begin{macrocode} |
| 1572 |
\secdef\@part\@spart} |
| 1573 |
% \end{macrocode} |
| 1574 |
% \end{macro} |
| 1575 |
% |
| 1576 |
% \begin{macro}{\@part} |
| 1577 |
% This is the macro which carries out the actual formatting of the title of |
| 1578 |
% the part. If \emph{secnumdepth} equals -2 or larger, a number is given to |
| 1579 |
% the part. |
| 1580 |
% \begin{macrocode} |
| 1581 |
\def\@part[#1]#2{% |
| 1582 |
\ifnum \c@secnumdepth >-2\relax |
| 1583 |
\refstepcounter{part}% |
| 1584 |
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% |
| 1585 |
\else |
| 1586 |
\addcontentsline{toc}{part}{#1}% |
| 1587 |
\fi |
| 1588 |
% \end{macrocode} |
| 1589 |
% Empty the mark registers, center the title on the page, and prevent any |
| 1590 |
% breaking between lines, and finally reset the fount. |
| 1591 |
% \begin{macrocode} |
| 1592 |
\markboth{}{}% |
| 1593 |
{\centering |
| 1594 |
\interlinepenalty \@M |
| 1595 |
\normalfont |
| 1596 |
% \end{macrocode} |
| 1597 |
% If we are dealing with a numbered part, print the number. |
| 1598 |
% \begin{macrocode} |
| 1599 |
\ifnum \c@secnumdepth >-2\relax |
| 1600 |
\huge \partname~\thepart |
| 1601 |
\par |
| 1602 |
% \end{macrocode} |
| 1603 |
% Leave some space before printing the title, and clear up with |\@endpart|. |
| 1604 |
% \begin{macrocode} |
| 1605 |
\vskip 20\p@ |
| 1606 |
\fi |
| 1607 |
\Huge #2\par}% |
| 1608 |
\@endpart} |
| 1609 |
% \end{macrocode} |
| 1610 |
% \end{macro} |
| 1611 |
% |
| 1612 |
% \begin{macro}{\@spart} |
| 1613 |
% A macro to deal with a part*. If this sectioning command was used, we do |
| 1614 |
% not print a number, but otherwise the format is the same as for the |
| 1615 |
% unstarred part. |
| 1616 |
% |
| 1617 |
% \begin{macrocode} |
| 1618 |
\def\@spart#1{% |
| 1619 |
{\centering |
| 1620 |
\interlinepenalty \@M |
| 1621 |
\normalfont |
| 1622 |
\Huge #1\par}% |
| 1623 |
\@endpart} |
| 1624 |
% \end{macrocode} |
| 1625 |
% \end{macro} |
| 1626 |
% |
| 1627 |
% \begin{macro}{\@endpart} |
| 1628 |
% A macro to finishes the part page. First, fill the current page, |
| 1629 |
% \begin{macrocode} |
| 1630 |
\def\@endpart{% |
| 1631 |
\vfil\newpage |
| 1632 |
% \end{macrocode} |
| 1633 |
% and, as we are dealing with a two-sided document, insert a blank page. |
| 1634 |
% \begin{macrocode} |
| 1635 |
\hbox{}% |
| 1636 |
\thispagestyle{empty}% |
| 1637 |
\newpage |
| 1638 |
% \end{macrocode} |
| 1639 |
% If we are dealing with a two-column document, switch back to double |
| 1640 |
% column mode. |
| 1641 |
% \begin{macrocode} |
| 1642 |
\if@tempswa |
| 1643 |
\twocolumn |
| 1644 |
\fi} |
| 1645 |
% \end{macrocode} |
| 1646 |
% \end{macro} |
| 1647 |
% |
| 1648 |
% \subsubsection{Chapters} |
| 1649 |
% \begin{macro}{\chapter} |
| 1650 |
% Chapters start on a new page, and the page style is set to \emph{plain} |
| 1651 |
% \begin{macrocode} |
| 1652 |
\newcommand\chapter{% |
| 1653 |
\if@openright\cleardoublepage |
| 1654 |
\else\clearpage |
| 1655 |
\fi |
| 1656 |
\thispagestyle{plain}% |
| 1657 |
% \end{macrocode} |
| 1658 |
% Ensure that no float appears on the top of this page: it really would not |
| 1659 |
% do to have something like a float appearing above a chapter title. |
| 1660 |
% \begin{macrocode} |
| 1661 |
\global\@topnum\z@ |
| 1662 |
% \end{macrocode} |
| 1663 |
% Also, suppress any indentation of the first paragraph and issue the |
| 1664 |
% |\secdef| which will take care of making the chapter title. |
| 1665 |
% \begin{macrocode} |
| 1666 |
\@afterindentfalse |
| 1667 |
\secdef\@chapter\@schapter} |
| 1668 |
% \end{macrocode} |
| 1669 |
% \end{macro} |
| 1670 |
% |
| 1671 |
% \begin{macro}{\@chapter} |
| 1672 |
% The macro for numbered chapters. If \emph{secnumdepth} is larger than -1, |
| 1673 |
% and |\@mainmatter| is true, display the chapter number. Write a message to |
| 1674 |
% the terminal to let the user know that a new chapter is about to be |
| 1675 |
% typeset. |
| 1676 |
% \begin{macrocode} |
| 1677 |
\def\@chapter[#1]#2{% |
| 1678 |
\ifnum \c@secnumdepth >\m@ne |
| 1679 |
\if@mainmatter |
| 1680 |
\refstepcounter{chapter}% |
| 1681 |
\typeout{\@chapapp\space\thechapter.}% |
| 1682 |
\addcontentsline{toc}{chapter}% |
| 1683 |
{\protect\numberline{\thechapter}#1}% |
| 1684 |
\else |
| 1685 |
\addcontentsline{toc}{chapter}{#1}% |
| 1686 |
\fi |
| 1687 |
\else |
| 1688 |
\addcontentsline{toc}{chapter}{#1}% |
| 1689 |
\fi |
| 1690 |
% \end{macrocode} |
| 1691 |
% Having written the entry to the table of contents, store the (alternative) |
| 1692 |
% title of the chapter with |\chaptermark|, add some white space to the lists |
| 1693 |
% of figures and tables |
| 1694 |
% \begin{macrocode} |
| 1695 |
\chaptermark{#1}% |
| 1696 |
\addtocontents{lof}{\protect\addvspace{10\p@}}% |
| 1697 |
\addtocontents{lot}{\protect\addvspace{10\p@}}% |
| 1698 |
% \end{macrocode} |
| 1699 |
% Now call |\@makechapterhead| to typeset the actual chapter title. When |
| 1700 |
% dealing with text in double columns, this require a bit of attention as |
| 1701 |
% we want the title to use the whole of the width of the text. |
| 1702 |
% The |\@afterheading| macro suppresses the indentation. |
| 1703 |
% \begin{macrocode} |
| 1704 |
\if@twocolumn |
| 1705 |
\@topnewpage[\@makechapterhead{#2}]% |
| 1706 |
\else |
| 1707 |
\@makechapterhead{#2}% |
| 1708 |
\@afterheading |
| 1709 |
\fi} |
| 1710 |
% \end{macrocode} |
| 1711 |
% \end{macro} |
| 1712 |
% |
| 1713 |
% \begin{macro}{\@makechapterhead} |
| 1714 |
% The macro to typeset the actual chapter heading. Before we begin, bear in |
| 1715 |
% mind that we have to retain the grid, so the total amount of space occupied |
| 1716 |
% by the heading should be a whole number of lines. So, first some white |
| 1717 |
% space. Then open a group with no indenting, with ragged right text, and |
| 1718 |
% reset the fount. |
| 1719 |
% \begin{macrocode} |
| 1720 |
\def\@makechapterhead#1{% |
| 1721 |
\vspace*{4\baselineskip}% |
| 1722 |
{\parindent \z@ \raggedright \normalfont |
| 1723 |
% \end{macrocode} |
| 1724 |
% Find out if the chapter number has to be printed, and, if that is the case, |
| 1725 |
% leave some white space between number and title. |
| 1726 |
% \begin{macrocode} |
| 1727 |
\ifnum \c@secnumdepth >\m@ne |
| 1728 |
\if@mainmatter |
| 1729 |
\Large \@chapapp{} \thechapter |
| 1730 |
\par\nobreak |
| 1731 |
\ifnum \@ptsize < 1 |
| 1732 |
\vskip 26\p@ |
| 1733 |
\else |
| 1734 |
\vskip 22\p@ |
| 1735 |
\fi |
| 1736 |
\fi |
| 1737 |
\fi |
| 1738 |
% \end{macrocode} |
| 1739 |
% Set the title in Large fount, prevent a pagebreak from happening in the |
| 1740 |
% middle or after the title, and leave a bit of white space before the text. |
| 1741 |
% \begin{macrocode} |
| 1742 |
\interlinepenalty\@M |
| 1743 |
\Large #1\par\nobreak |
| 1744 |
\vskip 34\p@ \@minus 4\p@ |
| 1745 |
}} |
| 1746 |
% \end{macrocode} |
| 1747 |
% \end{macro} |
| 1748 |
% |
| 1749 |
% \begin{macro}{\@schapter} |
| 1750 |
% The macro which takes care of unnumbered chapters, which is much more |
| 1751 |
% straightforward, as it only has to typeset the chapter title. |
| 1752 |
% \begin{macrocode} |
| 1753 |
\def\@schapter#1{% |
| 1754 |
\if@twocolumn |
| 1755 |
\@topnewpage[\@makeschapterhead{#1}]% |
| 1756 |
\else |
| 1757 |
\@makeschapterhead{#1}% |
| 1758 |
\@afterheading |
| 1759 |
\fi} |
| 1760 |
% \end{macrocode} |
| 1761 |
% \end{macro} |
| 1762 |
% |
| 1763 |
% \begin{macro}{\@makeschapterhead} |
| 1764 |
% The equivalent macro of |\@makechapterhead| but for typesetting the |
| 1765 |
% heading of an unnumbered chapter. |
| 1766 |
% \begin{macrocode} |
| 1767 |
\def\@makeschapterhead#1{% |
| 1768 |
\vspace*{4\baselineskip}% |
| 1769 |
{\parindent \z@ \raggedright |
| 1770 |
\normalfont |
| 1771 |
\interlinepenalty\@M |
| 1772 |
\Large #1\par\nobreak |
| 1773 |
\ifnum \@ptsize < 1 |
| 1774 |
\vskip 30\p@ |
| 1775 |
\else |
| 1776 |
\vskip 34.8\p@ |
| 1777 |
\fi |
| 1778 |
}} |
| 1779 |
% \end{macrocode} |
| 1780 |
% \end{macro} |
| 1781 |
% |
| 1782 |
% \subsubsection{Lower-level headings} |
| 1783 |
% \begin{macro}{\section} |
| 1784 |
% \begin{macro}{\subsection} |
| 1785 |
% \begin{macro}{\subsubsection} |
| 1786 |
% \begin{macro}{\paragraph} |
| 1787 |
% \begin{macro}{\subparagraph} |
| 1788 |
% All the lower-level headings are generated by using the |\@startsection|. |
| 1789 |
% Because these various headings can occur anywhere on a page, some care |
| 1790 |
% has gone into defining the vertical spacing surrounding the headings. The |
| 1791 |
% reason for the different approach, compared to the standard book class, is |
| 1792 |
% that we are trying our utmost to maintain the regularity of the printing |
| 1793 |
% grid of text lines. Through the use of |\baselineskip| multiples and |
| 1794 |
% fractions, the space given to headings and surrounding white space will |
| 1795 |
% always be a multiple of print lines. |
| 1796 |
% We take the opportunity here of toning down the `loudness' of some of the |
| 1797 |
% headings compared to the standard book class. |
| 1798 |
% \begin{macrocode} |
| 1799 |
\newcommand\section{% |
| 1800 |
\@startsection{section}% |
| 1801 |
{1}% |
| 1802 |
{0em}% |
| 1803 |
{-1.166\baselineskip \@minus -2\p@}% |
| 1804 |
{0.835\baselineskip \@minus 2\p@}% |
| 1805 |
{\centering\large\normalfont\scshape}} |
| 1806 |
\newcommand\subsection{% |
| 1807 |
\@startsection{subsection}% |
| 1808 |
{2}% |
| 1809 |
{1em}% |
| 1810 |
{-0.666\baselineskip \@minus -2\p@}% |
| 1811 |
{0.333\baselineskip \@minus 2\p@}% |
| 1812 |
{\normalfont\normalsize\scshape}} |
| 1813 |
\newcommand\subsubsection{% |
| 1814 |
\@startsection{subsubsection}% |
| 1815 |
{3}% |
| 1816 |
{1em}% |
| 1817 |
{-0.666\baselineskip \@minus -2\p@}% |
| 1818 |
{0.333\baselineskip \@minus 2\p@}% |
| 1819 |
{\normalfont\normalsize\itshape}} |
| 1820 |
\newcommand\paragraph{% |
| 1821 |
\@startsection{paragraph}% |
| 1822 |
{4}% |
| 1823 |
{\z@}% |
| 1824 |
{0\p@}% |
| 1825 |
{-1em}% |
| 1826 |
{\normalfont\normalsize}} |
| 1827 |
\newcommand\subparagraph{% |
| 1828 |
\@startsection{subparagraph}% |
| 1829 |
{5}% |
| 1830 |
{\parindent}% |
| 1831 |
{0\p@}% |
| 1832 |
{-1em}% |
| 1833 |
{\normalfont\normalsize}} |
| 1834 |
% \end{macrocode} |
| 1835 |
% \end{macro} |
| 1836 |
% \end{macro} |
| 1837 |
% \end{macro} |
| 1838 |
% \end{macro} |
| 1839 |
% \end{macro} |
| 1840 |
% |
| 1841 |
% \subsection{Lists} |
| 1842 |
% \subsubsection{List parameters} |
| 1843 |
% The type setting of the list environment is governed by a considerable |
| 1844 |
% number of parameters, including |\leftmargin|, |\rightmargin|, |
| 1845 |
% |\listparindent|, |\itemindent|, |\labelwidth|, |\labelsep| and |
| 1846 |
% |\partopsep|. By default, |\rightmargin|, |\listparindent| and |
| 1847 |
% |itemindent| are set to |0pt|. For a list at level L, the command |
| 1848 |
% |\@listL| is called, with L denoting `i', `ii', \ldots `vi'. By convention, |
| 1849 |
% |@listL| should set |\leftmargin| to |\leftmarginL|. |
| 1850 |
% |
| 1851 |
% \begin{macro}{\listmargin} |
| 1852 |
% \begin{macro}{\listmargini} |
| 1853 |
% \begin{macro}{\listmarginii} |
| 1854 |
% \begin{macro}{\listmarginiii} |
| 1855 |
% \begin{macro}{\listmarginiv} |
| 1856 |
% \begin{macro}{\listmarginv} |
| 1857 |
% \begin{macro}{\listmarginvi} |
| 1858 |
% In double-column mode, margins are set somewhat smaller. |
| 1859 |
% \begin{macrocode} |
| 1860 |
\if@twocolumn |
| 1861 |
\setlength\leftmargini{2em} |
| 1862 |
\else |
| 1863 |
\setlength\leftmargini{2.5em} |
| 1864 |
\fi |
| 1865 |
% \end{macrocode} |
| 1866 |
% \begin{macrocode} |
| 1867 |
\setlength\leftmargin{\leftmargini} |
| 1868 |
% \end{macrocode} |
| 1869 |
% \end{macro} |
| 1870 |
% \end{macro} |
| 1871 |
% \end{macro} |
| 1872 |
% \end{macro} |
| 1873 |
% \end{macro} |
| 1874 |
% \end{macro} |
| 1875 |
% \end{macro} |
| 1876 |
% The next three levels are set so that they are larger than the sum of |
| 1877 |
% |\labelsep| and the width of the default labels, being `(m)', `vii.' and |
| 1878 |
% `M.' |
| 1879 |
% \begin{macrocode} |
| 1880 |
\setlength\leftmarginii{2.2em} |
| 1881 |
\setlength\leftmarginiii{1.87em} |
| 1882 |
\setlength\leftmarginiv{1.7em} |
| 1883 |
\if@twocolumn |
| 1884 |
\setlength\leftmarginv{.5em} |
| 1885 |
\setlength\leftmarginvi{.5em} |
| 1886 |
\else |
| 1887 |
\setlength\leftmarginv{1em} |
| 1888 |
\setlength\leftmarginvi{1em} |
| 1889 |
\fi |
| 1890 |
% \end{macrocode} |
| 1891 |
% |
| 1892 |
% \begin{macro}{\labelsep} |
| 1893 |
% \begin{macro}{\labelwidth} |
| 1894 |
% The distance between label and text of an item is set by |\labelsep|, while |
| 1895 |
% the width of the label is set by |\labelwidth| |
| 1896 |
% \begin{macrocode} |
| 1897 |
\setlength\labelsep{.5em} |
| 1898 |
\setlength\labelwidth{\leftmargini} |
| 1899 |
\addtolength\labelwidth{-\labelsep} |
| 1900 |
% \end{macrocode} |
| 1901 |
% \end{macro} |
| 1902 |
% \end{macro} |
| 1903 |
% |
| 1904 |
% \begin{macro}{\partopsep} |
| 1905 |
% When a blank line is left before the list environment, we add an extra |
| 1906 |
% vertical space of |\partopsep|, in addition to |\parskip| and |\topsep|. |
| 1907 |
% Bearing in mind our attempts to maintain the regularity of the line grid, |
| 1908 |
% the exact value of this space has to be set with some care. |
| 1909 |
% \begin{macrocode} |
| 1910 |
%</octavo> |
| 1911 |
%<*10pt|11pt|12pt> |
| 1912 |
\setlength\partopsep{0.5\baselineskip \@plus 2\p@ \@minus 2\p@} |
| 1913 |
%</10pt|11pt|12pt> |
| 1914 |
% \end{macrocode} |
| 1915 |
% \end{macro} |
| 1916 |
% |
| 1917 |
% \begin{macro}{\@beginparpenalty} |
| 1918 |
% \begin{macro}{\@endparpenalty} |
| 1919 |
% \begin{macro}{\@itempenalty} |
| 1920 |
% These are the penalties incurred before and after a list or paragraph |
| 1921 |
% environment, and set to a bonus value to encourage a page break at these |
| 1922 |
% points. |
| 1923 |
% \begin{macrocode} |
| 1924 |
%<*octavo> |
| 1925 |
\@beginparpenalty -\@lowpenalty |
| 1926 |
\@endparpenalty -\@lowpenalty |
| 1927 |
\@itempenalty -\@lowpenalty |
| 1928 |
%</octavo> |
| 1929 |
% \end{macrocode} |
| 1930 |
% \end{macro} |
| 1931 |
% \end{macro} |
| 1932 |
% \end{macro} |
| 1933 |
% |
| 1934 |
% \begin{macro}{\@listi} |
| 1935 |
% \begin{macro}{\@listI} |
| 1936 |
% The macro |\@listi| sets the values of |\leftmargin|, |\parsep|, |\topsep|, |
| 1937 |
% |\itemsep|, and so forth, for the lists that appear at top level. These |
| 1938 |
% definitions are usually modified in function of the fount-size in use. |
| 1939 |
% As we wish to maintain the printing grid, these adjustments are not used |
| 1940 |
% here. Just to be on the safe side though, we define listI to hold a copy of |
| 1941 |
% listi so that |\normalsize| can switch all parameters back. |
| 1942 |
% \begin{macrocode} |
| 1943 |
%<*10pt|11pt|12pt> |
| 1944 |
\def\@listi{% |
| 1945 |
\leftmargin\leftmargini |
| 1946 |
% \end{macrocode} |
| 1947 |
% \begin{macrocode} |
| 1948 |
%<*10pt> |
| 1949 |
\parsep \z@ |
| 1950 |
\topsep 6\p@ \@plus 2\p@ \@minus 2\p@ |
| 1951 |
\itemsep \z@} |
| 1952 |
%</10pt> |
| 1953 |
% \end{macrocode} |
| 1954 |
% \begin{macrocode} |
| 1955 |
%<*11pt> |
| 1956 |
\parsep \z@ |
| 1957 |
\topsep 6.6\p@ \@plus 2\p@ \@minus 2\p@ |
| 1958 |
\itemsep \z@} |
| 1959 |
%</11pt> |
| 1960 |
% \end{macrocode} |
| 1961 |
% \begin{macrocode} |
| 1962 |
%<*12pt> |
| 1963 |
\parsep \z@ |
| 1964 |
\topsep 7.2\p@ \@plus 3\p@ \@minus 3\p@ |
| 1965 |
\itemsep \z@} |
| 1966 |
%</12pt> |
| 1967 |
% \end{macrocode} |
| 1968 |
% \begin{macrocode} |
| 1969 |
\let\@listI\@listi |
| 1970 |
\@listi |
| 1971 |
% \end{macrocode} |
| 1972 |
% \end{macro} |
| 1973 |
% \end{macro} |
| 1974 |
% |
| 1975 |
% \begin{macro}{\@listii} |
| 1976 |
% \begin{macro}{\@listiii} |
| 1977 |
% \begin{macro}{\@listiv} |
| 1978 |
% \begin{macro}{\@listv} |
| 1979 |
% \begin{macro}{\@listvi} |
| 1980 |
% Lists at higher levels need their own macros, and here they are. These do |
| 1981 |
% not have a saved version, and are not modified by fount size commands. |
| 1982 |
% \begin{macrocode} |
| 1983 |
\def\@listii{% |
| 1984 |
\leftmargin\leftmarginii |
| 1985 |
\labelwidth\leftmarginii |
| 1986 |
\advance\labelwidth-\labelsep |
| 1987 |
\itemsep \parsep} |
| 1988 |
\def\@listiii{% |
| 1989 |
\leftmargin\leftmarginiii |
| 1990 |
\labelwidth\leftmarginiii |
| 1991 |
\advance\labelwidth-\labelsep |
| 1992 |
\itemsep \parsep} |
| 1993 |
\def\@listiv{% |
| 1994 |
\leftmargin\leftmarginiv |
| 1995 |
\labelwidth\leftmarginiv |
| 1996 |
\advance\labelwidth-\labelsep |
| 1997 |
\itemsep \parsep} |
| 1998 |
\def\@listv{% |
| 1999 |
\leftmargin\leftmarginv |
| 2000 |
\labelwidth\leftmarginv |
| 2001 |
\advance\labelwidth-\labelsep |
| 2002 |
\itemsep \parsep} |
| 2003 |
\def\@listvi{% |
| 2004 |
\leftmargin\leftmarginvi |
| 2005 |
\labelwidth\leftmarginvi |
| 2006 |
\advance\labelwidth-\labelsep |
| 2007 |
\itemsep \parsep} |
| 2008 |
%</10pt|11pt|12pt> |
| 2009 |
% \end{macrocode} |
| 2010 |
% \end{macro} |
| 2011 |
% \end{macro} |
| 2012 |
% \end{macro} |
| 2013 |
% \end{macro} |
| 2014 |
% \end{macro} |
| 2015 |
% |
| 2016 |
% \subsubsection{Enumerate} |
| 2017 |
% \begin{macro}{\theenumi} |
| 2018 |
% \begin{macro}{\theenumii} |
| 2019 |
% \begin{macro}{\theenumiii} |
| 2020 |
% \begin{macro}{\theenumiv} |
| 2021 |
% The \emph{enumerate} environment uses four counters, where \emph{enumN} |
| 2022 |
% controls the numbering at level N of the enumeration. These counters have |
| 2023 |
% been defined by \LaTeX, but we use a different representation here. |
| 2024 |
% \begin{macrocode} |
| 2025 |
%<*octavo> |
| 2026 |
\renewcommand\theenumi{\@arabic\c@enumi} |
| 2027 |
\renewcommand\theenumii{\@alph\c@enumii} |
| 2028 |
\renewcommand\theenumiii{\@roman\c@enumiii} |
| 2029 |
\renewcommand\theenumiv{\@Alph\c@enumiv} |
| 2030 |
% \end{macrocode} |
| 2031 |
% \end{macro} |
| 2032 |
% \end{macro} |
| 2033 |
% \end{macro} |
| 2034 |
% \end{macro} |
| 2035 |
% |
| 2036 |
% \begin{macro}{\labelenumi} |
| 2037 |
% \begin{macro}{\labelenumii} |
| 2038 |
% \begin{macro}{\labelenumiii} |
| 2039 |
% \begin{macro}{\labelenumiv} |
| 2040 |
% The label for each item in generated by these commands |
| 2041 |
% \begin{macrocode} |
| 2042 |
\newcommand\labelenumi{\theenumi.} |
| 2043 |
\newcommand\labelenumii{(\theenumii)} |
| 2044 |
\newcommand\labelenumiii{\theenumiii.} |
| 2045 |
\newcommand\labelenumiv{\theenumiv.} |
| 2046 |
% \end{macrocode} |
| 2047 |
% \end{macro} |
| 2048 |
% \end{macro} |
| 2049 |
% \end{macro} |
| 2050 |
% \end{macro} |
| 2051 |
% |
| 2052 |
% \begin{macro}{\p@enumii} |
| 2053 |
% \begin{macro}{\p@enumiii} |
| 2054 |
% \begin{macro}{\p@enumiv} |
| 2055 |
% The expanding of |\p@enumN\theenumN| defines the output of a |\ref| |
| 2056 |
% command when referencing an item at the Nth level in an enumerated list. |
| 2057 |
% \begin{macrocode} |
| 2058 |
\renewcommand\p@enumii{\theenumi} |
| 2059 |
\renewcommand\p@enumiii{\theenumi(\theenumii)} |
| 2060 |
\renewcommand\p@enumiv{\p@enumiii\theenumiii} |
| 2061 |
% \end{macrocode} |
| 2062 |
% \end{macro} |
| 2063 |
% \end{macro} |
| 2064 |
% \end{macro} |
| 2065 |
% |
| 2066 |
% \subsubsection{Itemise} |
| 2067 |
% \begin{macro}{\labelitemi} |
| 2068 |
% \begin{macro}{\labelitemii} |
| 2069 |
% \begin{macro}{\labelitemiii} |
| 2070 |
% \begin{macro}{\labelitemiv} |
| 2071 |
% Itemising is governed by four commands, |\labelitemN|, defining the labels |
| 2072 |
% at the various levels. |
| 2073 |
% \begin{macrocode} |
| 2074 |
\newcommand\labelitemi{\normalfont\bfseries --} |
| 2075 |
\newcommand\labelitemii{$\m@th\cdot$} |
| 2076 |
\newcommand\labelitemiii{$\m@th\bullet$} |
| 2077 |
\newcommand\labelitemiv{$\m@th\ast$} |
| 2078 |
% \end{macrocode} |
| 2079 |
% \end{macro} |
| 2080 |
% \end{macro} |
| 2081 |
% \end{macro} |
| 2082 |
% \end{macro} |
| 2083 |
% |
| 2084 |
% \subsubsection{Description} |
| 2085 |
% \begin{macro}{description} |
| 2086 |
% The \emph{itemize} and \emph{enumerate} environments are defined by |
| 2087 |
% \LaTeX, but we have to define the description environment here. |
| 2088 |
% \begin{macrocode} |
| 2089 |
\newenvironment{description} |
| 2090 |
{\list{}% |
| 2091 |
{\labelwidth\z@% |
| 2092 |
\itemindent-\leftmargin% |
| 2093 |
\let\makelabel\descriptionlabel}}% |
| 2094 |
{\endlist} |
| 2095 |
% \end{macrocode} |
| 2096 |
% \end{macro} |
| 2097 |
% |
| 2098 |
% \begin{macro}{\descriptionlabel} |
| 2099 |
% To change the format of the label, redefine |\descriptionlabel| |
| 2100 |
% \begin{macrocode} |
| 2101 |
\newcommand*\descriptionlabel[1]{% |
| 2102 |
\hspace\labelsep% |
| 2103 |
\normalfont\bfseries #1} |
| 2104 |
% \end{macrocode} |
| 2105 |
% \end{macro} |
| 2106 |
% |
| 2107 |
% \subsection{Defining new environments} |
| 2108 |
% A number of separate environments for specific bodies of text can be |
| 2109 |
% specified at class level. In the context of writing and making books, |
| 2110 |
% here are a number of such environments. |
| 2111 |
% |
| 2112 |
% \subsubsection{Verse} |
| 2113 |
% \begin{macro}{verse} |
| 2114 |
% A simple way of implementing the requirements of typesetting verse. |
| 2115 |
% The environment is defined by tweaking some parameters of the list |
| 2116 |
% environment. Each line of verse ends with a |\\|, and the macro takes |
| 2117 |
% this to be |\@centercr|. |
| 2118 |
% \begin{macrocode} |
| 2119 |
\newenvironment{verse} |
| 2120 |
{\let\\=\@centercr |
| 2121 |
\list{}{\itemsep \z@ |
| 2122 |
\itemindent -1.5em% |
| 2123 |
\listparindent\itemindent |
| 2124 |
\rightmargin \leftmargin |
| 2125 |
\advance\leftmargin 1.5em}% |
| 2126 |
\item[]} |
| 2127 |
{\endlist} |
| 2128 |
% \end{macrocode} |
| 2129 |
% \end{macro} |
| 2130 |
% |
| 2131 |
% \subsubsection{Quotation} |
| 2132 |
% \begin{macro}{quotation} |
| 2133 |
% Also an implementation based on the list environment. Lines of the |
| 2134 |
% quotation are set more narrowly. |
| 2135 |
% \begin{macrocode} |
| 2136 |
\newenvironment{quotation} |
| 2137 |
{\list{}{\listparindent 1.5em% |
| 2138 |
\itemindent \listparindent |
| 2139 |
\rightmargin \leftmargin |
| 2140 |
\parsep \z@}% |
| 2141 |
\item[]} |
| 2142 |
{\endlist} |
| 2143 |
% \end{macrocode} |
| 2144 |
% \end{macro} |
| 2145 |
% |
| 2146 |
% \subsubsection{Quote} |
| 2147 |
% \begin{macro}{quote} |
| 2148 |
% For short quotations, the text is set as a quotation but without the |
| 2149 |
% narrowing of the line length. |
| 2150 |
% \begin{macrocode} |
| 2151 |
\newenvironment{quote} |
| 2152 |
{\list{}% |
| 2153 |
{\rightmargin\leftmargin}% |
| 2154 |
\item[]} |
| 2155 |
{\endlist} |
| 2156 |
% \end{macrocode} |
| 2157 |
% \end{macro} |
| 2158 |
% |
| 2159 |
% \subsubsection{Titlepage} |
| 2160 |
% \begin{macro}{titlepage} |
| 2161 |
% A titlepage starts and ends a page, and omits the folio. If the text is |
| 2162 |
% typeset in double columns, this page alone reverts to single column mode. |
| 2163 |
% \begin{macrocode} |
| 2164 |
\newenvironment{titlepage}{% |
| 2165 |
\cleardoublepage |
| 2166 |
\if@twocolumn |
| 2167 |
\@restonecoltrue\onecolumn |
| 2168 |
\else |
| 2169 |
\@restonecolfalse\newpage |
| 2170 |
\fi |
| 2171 |
\thispagestyle{empty}}% |
| 2172 |
{\if@restonecol |
| 2173 |
\twocolumn |
| 2174 |
\else |
| 2175 |
\newpage |
| 2176 |
\fi} |
| 2177 |
% \end{macrocode} |
| 2178 |
% \end{macro} |
| 2179 |
% |
| 2180 |
% \subsubsection{Appendix} |
| 2181 |
% \begin{macro}{\appendix} |
| 2182 |
% Typesetting appendices is somewhat different from the other chapters. We |
| 2183 |
% have to reset section and subsection counters and redefine the macro |
| 2184 |
% |\thesection| so that it produces an alphabetic enumeration of the |
| 2185 |
% appendices. We also set |\@chapapp| to |\appendixname|. |
| 2186 |
% \begin{macrocode} |
| 2187 |
\newcommand\appendix{\par |
| 2188 |
\setcounter{chapter}{0}% |
| 2189 |
\setcounter{section}{0}% |
| 2190 |
\renewcommand\@chapapp{\appendixname}% |
| 2191 |
\renewcommand\thechapter{\@Alph\c@chapter}} |
| 2192 |
% \end{macrocode} |
| 2193 |
% \end{macro} |
| 2194 |
% |
| 2195 |
% \subsection{Setting environment parameters} |
| 2196 |
% \begin{macro}{\arraycolsep} |
| 2197 |
% Columns in an |array| environment are separated by 2 |\arraycolsep| |
| 2198 |
% \begin{macrocode} |
| 2199 |
\setlength\arraycolsep{5\p@} |
| 2200 |
% \end{macrocode} |
| 2201 |
% \end{macro} |
| 2202 |
% |
| 2203 |
% \begin{macro}{\tabcolsep} |
| 2204 |
% Columns in a |tabular| environment are separated by 2 |\tabcolsep| |
| 2205 |
% \begin{macrocode} |
| 2206 |
\setlength\tabcolsep{6\p@} |
| 2207 |
% \end{macrocode} |
| 2208 |
% \end{macro} |
| 2209 |
% |
| 2210 |
% \begin{macro}{\arrayrulewidth} |
| 2211 |
% The width of the lines in |array| and |tabular| environments |
| 2212 |
% \begin{macrocode} |
| 2213 |
\setlength\arrayrulewidth{.4\p@} |
| 2214 |
% \end{macrocode} |
| 2215 |
% \end{macro} |
| 2216 |
% |
| 2217 |
% \begin{macro}{\doublerulesep} |
| 2218 |
% When rules are adjacent in |array| and |tabular| environments, this is |
| 2219 |
% how far apart they are drawn |
| 2220 |
% \begin{macrocode} |
| 2221 |
\setlength\doublerulesep{2\p@} |
| 2222 |
% \end{macrocode} |
| 2223 |
% \end{macro} |
| 2224 |
% |
| 2225 |
% \begin{macro}{\tabbingsep} |
| 2226 |
% Defines the space requested by the |\'| command in the text |
| 2227 |
% \begin{macrocode} |
| 2228 |
\setlength\tabbingsep{\labelsep} |
| 2229 |
% \end{macrocode} |
| 2230 |
% \end{macro} |
| 2231 |
% |
| 2232 |
% \begin{macro}{\@mpfootins} |
| 2233 |
% The equivalent of |\skip\footins| for footnotes appearing in minipages. |
| 2234 |
% \begin{macrocode} |
| 2235 |
\skip\@mpfootins = \skip\footins |
| 2236 |
% \end{macrocode} |
| 2237 |
% \end{macro} |
| 2238 |
% |
| 2239 |
% \begin{macro}{\fboxsep} |
| 2240 |
% \begin{macro}{\fboxrule} |
| 2241 |
% When using |\fbox| or |\framebox|, these macros define the amount of space |
| 2242 |
% left between box and text, and the width of the rules in the box. |
| 2243 |
% \begin{macrocode} |
| 2244 |
\setlength\fboxsep{3\p@} |
| 2245 |
\setlength\fboxrule{.4\p@} |
| 2246 |
% \end{macrocode} |
| 2247 |
% \end{macro} |
| 2248 |
% \end{macro} |
| 2249 |
% |
| 2250 |
% \begin{macro}{\theequation} |
| 2251 |
% Contrary to what is often seen in mathematical texts, here we number |
| 2252 |
% equations continuously throughout the text. Cross-referencing is just so |
| 2253 |
% easy in TeX that there is not really any need for a different numbering |
| 2254 |
% system. |
| 2255 |
% \changes{1.1}{2003/10/10}{Equations numbered continuously} |
| 2256 |
% \begin{macrocode} |
| 2257 |
\renewcommand\theequation{\@arabic\c@equation} |
| 2258 |
% \end{macrocode} |
| 2259 |
% \end{macro} |
| 2260 |
% |
| 2261 |
% |
| 2262 |
% \subsection{Floating objects} |
| 2263 |
% Floats cover a variety of object types. Here, we deal with two different |
| 2264 |
% types: figure, and table. The typesetting of floats is of course governed |
| 2265 |
% by a number of specific macros. |
| 2266 |
% \begin{description} |
| 2267 |
% \item{|\fps@TYPE|} The default placement of TYPE floats |
| 2268 |
% \item{|\ftype@TYPE|} The type number of floats or type TYPE. These are |
| 2269 |
% unique, powers of 2. For example, the type number of figures might be |
| 2270 |
% 1, tables 2, programs 4. |
| 2271 |
% \item{|\ext@TYPE|} File extension of the file in which the contents list |
| 2272 |
% of the TYPE floats is stored (example: |\ext@figure|=`lof' |
| 2273 |
% \item{|fnum@TYPE|} The macro which generates the number for the caption of |
| 2274 |
% the TYPE float. |
| 2275 |
% \item{|\@makecaption|\meta{num}\meta{text}} The macro to make a caption |
| 2276 |
% with \meta{num} the value produced by |\fnum@TYPE| and \meta{text} the |
| 2277 |
% text of the caption (in a |\parbox| of appropriate width). It is used |
| 2278 |
% for all floating objects. |
| 2279 |
% \end{description} |
| 2280 |
% |
| 2281 |
% \begin{macro}{\c@figure} |
| 2282 |
% The format of the counter of figures. Often, the chapter number is part |
| 2283 |
% of the number, as this supposedly makes it easier to find the figure again, |
| 2284 |
% but that seems rather a poor justification, especially in the light of the |
| 2285 |
% excellent capabilities of \TeX\ of making cross references. |
| 2286 |
% \begin{macrocode} |
| 2287 |
\newcounter{figure} |
| 2288 |
\renewcommand\thefigure{\@arabic\c@figure} |
| 2289 |
% \end{macrocode} |
| 2290 |
% \end{macro} |
| 2291 |
% |
| 2292 |
% \begin{macro}{\fps@figure} |
| 2293 |
% \begin{macro}{\ftype@figure} |
| 2294 |
% \begin{macro}{\ext@figure} |
| 2295 |
% \begin{macro}{\num@figure} |
| 2296 |
% These are the parameters dealing with the `figure' floats. |
| 2297 |
% \begin{macrocode} |
| 2298 |
\def\fps@figure{tbp} |
| 2299 |
\def\ftype@figure{1} |
| 2300 |
\def\ext@figure{lof} |
| 2301 |
\def\fnum@figure{\figurename~\thefigure} |
| 2302 |
% \end{macrocode} |
| 2303 |
% \end{macro} |
| 2304 |
% \end{macro} |
| 2305 |
% \end{macro} |
| 2306 |
% \end{macro} |
| 2307 |
% |
| 2308 |
% \begin{macro}{figure} |
| 2309 |
% \begin{macro}{figure*} |
| 2310 |
% Here we define the actual floating figure environments. The starred version |
| 2311 |
% is used for double-column figures. |
| 2312 |
% \begin{macrocode} |
| 2313 |
\newenvironment{figure} |
| 2314 |
{\@float{figure}} |
| 2315 |
{\end@float} |
| 2316 |
\newenvironment{figure*} |
| 2317 |
{\@dblfloat{figure}} |
| 2318 |
{\end@dblfloat} |
| 2319 |
% \end{macrocode} |
| 2320 |
% \end{macro} |
| 2321 |
% \end{macro} |
| 2322 |
% |
| 2323 |
% \begin{macro}{\c@table} |
| 2324 |
% And now for tables as floats. The numbering of tables follows the same |
| 2325 |
% ideas as that of figures. |
| 2326 |
% \begin{macrocode} |
| 2327 |
\newcounter{table} |
| 2328 |
\renewcommand\thetable{\@arabic\c@table} |
| 2329 |
% \end{macrocode} |
| 2330 |
% \end{macro} |
| 2331 |
% |
| 2332 |
% \begin{macro}{\fps@table} |
| 2333 |
% \begin{macro}{\ftype@table} |
| 2334 |
% \begin{macro}{\ext@table} |
| 2335 |
% \begin{macro}{\num@table} |
| 2336 |
% Define the parameters for table floats. |
| 2337 |
% \begin{macrocode} |
| 2338 |
\def\fps@table{tbp} |
| 2339 |
\def\ftype@table{2} |
| 2340 |
\def\ext@table{lot} |
| 2341 |
\def\fnum@table{\tablename~\thetable} |
| 2342 |
% \end{macrocode} |
| 2343 |
% \end{macro} |
| 2344 |
% \end{macro} |
| 2345 |
% \end{macro} |
| 2346 |
% \end{macro} |
| 2347 |
% |
| 2348 |
% \begin{macro}{table} |
| 2349 |
% \begin{macro}{table*} |
| 2350 |
% Here we define the actual floating table environments. The starred version |
| 2351 |
% is used for double-column tables. |
| 2352 |
% \begin{macrocode} |
| 2353 |
\newenvironment{table} |
| 2354 |
{\@float{table}} |
| 2355 |
{\end@float} |
| 2356 |
\newenvironment{table*} |
| 2357 |
{\@dblfloat{table}} |
| 2358 |
{\end@dblfloat} |
| 2359 |
% \end{macrocode} |
| 2360 |
% \end{macro} |
| 2361 |
% \end{macro} |
| 2362 |
% |
| 2363 |
% \begin{macro}{\@makecaption} |
| 2364 |
% The |\caption| macro calls |\@makecaption| to typeset the caption of the |
| 2365 |
% floating object. It uses the arguments \meta{number} and \meta{text}, so |
| 2366 |
% that number and captiontext can be typeset. The macro assumes, rightly, |
| 2367 |
% that it is called inside a |\parbox| of appropriate width. |
| 2368 |
% \end{macro} |
| 2369 |
% |
| 2370 |
% \begin{macro}{\abovecaptionskip} |
| 2371 |
% \begin{macro}{\belowcaptionskip} |
| 2372 |
% \begin{macrocode} |
| 2373 |
\newlength\abovecaptionskip |
| 2374 |
\newlength\belowcaptionskip |
| 2375 |
\setlength\abovecaptionskip{10\p@} |
| 2376 |
\setlength\belowcaptionskip{0\p@} |
| 2377 |
% \end{macrocode} |
| 2378 |
% The definition of the macro is |\long|, allowing more than a single |
| 2379 |
% paragraph to be put into the caption. |
| 2380 |
% \begin{macrocode} |
| 2381 |
\long\def\@makecaption#1#2{% |
| 2382 |
\vskip\abovecaptionskip |
| 2383 |
% \end{macrocode} |
| 2384 |
% In order to see if the caption text fits on a single line, we typeset it |
| 2385 |
% temporarily into a box. |
| 2386 |
% \begin{macrocode} |
| 2387 |
\sbox\@tempboxa{#1: #2}% |
| 2388 |
% \end{macrocode} |
| 2389 |
% Now measure the width of the box. If it exceeds the current |\hsize| then |
| 2390 |
% the caption text has to be set as an ordinary paragraph. |
| 2391 |
% \begin{macrocode} |
| 2392 |
\ifdim \wd\@tempboxa >\hsize |
| 2393 |
#1: #2\par |
| 2394 |
% \end{macrocode} |
| 2395 |
% If the text fits, center it on the line. This means using a |\hbox| in |
| 2396 |
% vertical mode, hence the |\everypar| tokens are not executed. What could |
| 2397 |
% be needed, if at all, is a resetting of the `minipage' flag, so we do that |
| 2398 |
% here explicitly. |
| 2399 |
% \begin{macrocode} |
| 2400 |
\else |
| 2401 |
\global \@minipagefalse |
| 2402 |
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% |
| 2403 |
\fi |
| 2404 |
\vskip\belowcaptionskip} |
| 2405 |
% \end{macrocode} |
| 2406 |
% \end{macro} |
| 2407 |
% \end{macro} |
| 2408 |
% |
| 2409 |
% |
| 2410 |
% \section{Cross referencing} |
| 2411 |
% Commands like |\section| or |\caption| write a contentsline to an |
| 2412 |
% appropriate file. |
| 2413 |
% The line |\contentsline{section}{|\meta{title}|}{|\meta{page}|}| is |
| 2414 |
% written to the |.toc| file by the |\section| command. If sections |
| 2415 |
% are numbered, the \meta{title} will show up as |\numberline{|\meta{num} |
| 2416 |
% |}{|\meta{heading}|}|, the \meta{num} is the number generated by |
| 2417 |
% |\thesection|. |
| 2418 |
% |
| 2419 |
% Similarly, the |\caption| command in a figure environment writes to a |
| 2420 |
% |.lof| file the line |\contentsline{figure}{\numberline{|\meta{num}|}{| |
| 2421 |
% \meta{caption}|}}{|\meta{page}|}|. |
| 2422 |
% |
| 2423 |
% The |\contentsline{|\meta{name}|}| command expands to |\l@|\meta{name}. |
| 2424 |
% Hence, we have to define |\l@chapter|, |\l@section| and so on, and for |
| 2425 |
% figures the similar |\l@figure|. These can be defined conveniently with the |
| 2426 |
% command |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|\meta{numwidth} |
| 2427 |
% |}{|\meta{title}|}{|\meta{page}|}|. |
| 2428 |
% \begin{description} |
| 2429 |
% \item{\meta{level}} An entry is only produced if \meta{level} is smaller or |
| 2430 |
% equal to the \emph{tocdepth} counter, with chapters being level 0, |
| 2431 |
% sections level 1 and so on. |
| 2432 |
% \item{\meta{indent}} Defines the indentation from the outer left margin of |
| 2433 |
% the contentsline. |
| 2434 |
% \item{\meta{numwidth}} Defines the width of the box containing the section |
| 2435 |
% number, if the \meta{title} includes a |\numberline|. |
| 2436 |
% \end{description} |
| 2437 |
% |
| 2438 |
% \subsection{Table of contents, etc.} |
| 2439 |
% \begin{macro}{\@pnumwidth} |
| 2440 |
% \begin{macro}{\@tocrmargin} |
| 2441 |
% \begin{macro}{\@dotsep} |
| 2442 |
% The three parameters control the appearance of the contents. Their |
| 2443 |
% definition through the |\newcommand| allows the use of the `em' measure, |
| 2444 |
% meaning that the sizes defined can depend on the fount used. The role of |
| 2445 |
% |\@pnumwidth| is to define the width of the box containing the page number. |
| 2446 |
% |\@tocrmargin| defines the right margin for multi-line entries, obviously |
| 2447 |
% it is a good idea ot have |\@tocrmarg| $\leq$ |\@pnumwidth|. Finally, the |
| 2448 |
% separation between the dots on contentslines in mu units is given as a |
| 2449 |
% real number by |\@dotsep|. From a design perspective, these dots are very |
| 2450 |
% unattractive, and an easy way of avoiding them appearing is to set the |
| 2451 |
% separation to a very high number. |
| 2452 |
% \begin{macrocode} |
| 2453 |
\newcommand\@pnumwidth{1.55em} |
| 2454 |
\newcommand\@tocrmarg{2.55em} |
| 2455 |
\newcommand\@dotsep{4500} |
| 2456 |
% \end{macrocode} |
| 2457 |
% \end{macro} |
| 2458 |
% \end{macro} |
| 2459 |
% \end{macro} |
| 2460 |
% |
| 2461 |
% \begin{macro}{\tableofcontents} |
| 2462 |
% This is the request for the production of a table of contents. Such a |
| 2463 |
% table is always typeset as a single column, so it might be necessary |
| 2464 |
% to switch temporarily to single-column mode. |
| 2465 |
% \begin{macrocode} |
| 2466 |
\setcounter{tocdepth}{2} |
| 2467 |
\newcommand\tableofcontents{% |
| 2468 |
\if@twocolumn |
| 2469 |
\@restonecoltrue\onecolumn |
| 2470 |
\else |
| 2471 |
\@restonecolfalse |
| 2472 |
\fi |
| 2473 |
% \end{macrocode} |
| 2474 |
% The title is set with |\chapter*|, to ensure that a possible running head |
| 2475 |
% contains the correct information |
| 2476 |
% \begin{macrocode} |
| 2477 |
\chapter*{\contentsname |
| 2478 |
\@mkboth{% |
| 2479 |
\MakeUppercase\contentsname} |
| 2480 |
{\MakeUppercase\contentsname}}% |
| 2481 |
% \end{macrocode} |
| 2482 |
% The actual table of contents itself is typeset by calling |
| 2483 |
% |\@starttoc{toc}|. If necessary, we also switch back to double-column mode. |
| 2484 |
% \begin{macrocode} |
| 2485 |
\@starttoc{toc}% |
| 2486 |
\if@restonecol |
| 2487 |
\twocolumn |
| 2488 |
\fi} |
| 2489 |
% \end{macrocode} |
| 2490 |
% \end{macro} |
| 2491 |
% |
| 2492 |
% \begin{macro}{\l@part} |
| 2493 |
% The sectioning commands require additional macros to format the entries |
| 2494 |
% in the table of contents. Of these various entries, the entry for parts |
| 2495 |
% is somewhat more involved. First of all, ensure that if a pagebreak may |
| 2496 |
% be imminent, it should occur before the entry of a part. The addition of |
| 2497 |
% a little white space and the beginning of a group to keep changes local |
| 2498 |
% occupies us here as well. |
| 2499 |
% \begin{macrocode} |
| 2500 |
\newcommand*\l@part[2]{% |
| 2501 |
\ifnum \c@tocdepth >-2\relax |
| 2502 |
\addpenalty{-\@highpenalty}% |
| 2503 |
\addvspace{2.25em \@plus\p@}% |
| 2504 |
\begingroup |
| 2505 |
% \end{macrocode} |
| 2506 |
% Set |\parindent| to 0pt, and use |\rightskip| to reserve enough room for |
| 2507 |
% the page numbers. The |\parfillskip| is made negative so that no overfull |
| 2508 |
% box messages are issued. |
| 2509 |
% \begin{macrocode} |
| 2510 |
\setlength\@tempdima{3em}% |
| 2511 |
\parindent \z@ \rightskip \@pnumwidth |
| 2512 |
\parfillskip -\@pnumwidth |
| 2513 |
% \end{macrocode} |
| 2514 |
% Set the entry in large fount, and do a bit of housekeeping before |
| 2515 |
% finishing the macro. |
| 2516 |
% \begin{macrocode} |
| 2517 |
{\leavevmode |
| 2518 |
\large #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par |
| 2519 |
\nobreak |
| 2520 |
\global\@nobreaktrue |
| 2521 |
\everypar{\global\@nobreakfalse\everypar{}} |
| 2522 |
\endgroup |
| 2523 |
\fi} |
| 2524 |
% \end{macrocode} |
| 2525 |
% \end{macro} |
| 2526 |
% |
| 2527 |
% \begin{macro}{\l@chapter} |
| 2528 |
% The entries of chapters is very similar to that of parts, and the |
| 2529 |
% definition of the macro follows the same lines. |
| 2530 |
% \begin{macrocode} |
| 2531 |
\newcommand*\l@chapter[2]{% |
| 2532 |
\ifnum \c@tocdepth >\m@ne |
| 2533 |
\addpenalty{-\@highpenalty}% |
| 2534 |
\vskip 1.0em \@plus\p@ |
| 2535 |
% \end{macrocode} |
| 2536 |
% The |\numberline| macro needs the width of the box holding the number of |
| 2537 |
% the chapter to be in the scratch |\@tempdima|. Also, begin a new group and |
| 2538 |
% change some of the paragraph parameters. |
| 2539 |
% \begin{macrocode} |
| 2540 |
\setlength\@tempdima{1.5em}% |
| 2541 |
\begingroup |
| 2542 |
\parindent \z@ \rightskip \@pnumwidth |
| 2543 |
\parfillskip -\@pnumwidth |
| 2544 |
\leavevmode |
| 2545 |
% \end{macrocode} |
| 2546 |
% As we do no use |\numberline|, some manual adjustments are needed before |
| 2547 |
% typesetting the entry. A pagebreak following a chapter entry should be |
| 2548 |
% discouraged but not forbidden. |
| 2549 |
% \begin{macrocode} |
| 2550 |
\advance\leftskip\@tempdima |
| 2551 |
\hskip -\leftskip |
| 2552 |
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par |
| 2553 |
\penalty\@highpenalty |
| 2554 |
\endgroup |
| 2555 |
\fi} |
| 2556 |
% \end{macrocode} |
| 2557 |
% \end{macro} |
| 2558 |
% |
| 2559 |
% \begin{macro}{\l@section} |
| 2560 |
% \begin{macro}{\l@subsection} |
| 2561 |
% \begin{macro}{\l@subsubsection} |
| 2562 |
% \begin{macro}{\l@paragraph} |
| 2563 |
% \begin{macro}{\l@subparagraph} |
| 2564 |
% The lower level entries are all governed by the |\@dottedtocline| macro. |
| 2565 |
% \begin{macrocode} |
| 2566 |
\newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}} |
| 2567 |
\newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}} |
| 2568 |
\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}} |
| 2569 |
\newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}} |
| 2570 |
\newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}} |
| 2571 |
% \end{macrocode} |
| 2572 |
% \end{macro} |
| 2573 |
% \end{macro} |
| 2574 |
% \end{macro} |
| 2575 |
% \end{macro} |
| 2576 |
% \end{macro} |
| 2577 |
% |
| 2578 |
% \begin{macro}{\listoffigures} |
| 2579 |
% This is the request to produce a list of figures, and very similar in |
| 2580 |
% construction to |\tableofcontents|. |
| 2581 |
% \begin{macrocode} |
| 2582 |
\newcommand\listoffigures{% |
| 2583 |
\if@twocolumn |
| 2584 |
\@restonecoltrue\onecolumn |
| 2585 |
\else |
| 2586 |
\@restonecolfalse |
| 2587 |
\fi |
| 2588 |
\chapter*{\listfigurename |
| 2589 |
\@mkboth{\MakeUppercase\listfigurename}% |
| 2590 |
{\MakeUppercase\listfigurename}}% |
| 2591 |
\@starttoc{lof}% |
| 2592 |
\if@restonecol\twocolumn |
| 2593 |
\fi} |
| 2594 |
% \end{macrocode} |
| 2595 |
% \end{macro} |
| 2596 |
% |
| 2597 |
% \begin{macro}{\l@figure} |
| 2598 |
% The macro which produces the actual entry in the list of figures. |
| 2599 |
% \begin{macrocode} |
| 2600 |
\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}} |
| 2601 |
% \end{macrocode} |
| 2602 |
% \end{macro} |
| 2603 |
% |
| 2604 |
% \begin{macro}{\listoftables} |
| 2605 |
% The request to make a list of tables is given through this macro. Once |
| 2606 |
% again, it is very similar to the |\tableofcontents| macro. |
| 2607 |
% \begin{macrocode} |
| 2608 |
\newcommand\listoftables{% |
| 2609 |
\if@twocolumn |
| 2610 |
\@restonecoltrue\onecolumn |
| 2611 |
\else |
| 2612 |
\@restonecolfalse |
| 2613 |
\fi |
| 2614 |
\chapter*{\listtablename |
| 2615 |
\@mkboth{% |
| 2616 |
\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}% |
| 2617 |
\@starttoc{lot}% |
| 2618 |
\if@restonecol\twocolumn |
| 2619 |
\fi} |
| 2620 |
% \end{macrocode} |
| 2621 |
% \end{macro} |
| 2622 |
% |
| 2623 |
% \begin{macro}{\l@table} |
| 2624 |
% The macro which produces the actual entry in the list of tables. |
| 2625 |
% \begin{macrocode} |
| 2626 |
\let\l@table\l@figure |
| 2627 |
% \end{macrocode} |
| 2628 |
% \end{macro} |
| 2629 |
% |
| 2630 |
% \subsection{Bibliography} |
| 2631 |
% \begin{macro}{\bibindent} |
| 2632 |
% The open bibliography format uses the indentation set by |\bibindent|. |
| 2633 |
% \begin{macrocode} |
| 2634 |
\newdimen\bibindent |
| 2635 |
\bibindent=1.5em |
| 2636 |
% \end{macrocode} |
| 2637 |
% \end{macro} |
| 2638 |
% |
| 2639 |
% \begin{macro}{thebibliography} |
| 2640 |
% The environment is based on a generic list environment, using the |
| 2641 |
% \emph{enumiv} as internal counter to generate the labels of the list. If |
| 2642 |
% and empty \emph{thebibliography} environment is found, issue a warning. |
| 2643 |
% The environment executes a number of commands: |\sloppy| is used because |
| 2644 |
% it is hard to do line breaks in bibliographies, |\sfcode`\.=1000\relax| is |
| 2645 |
% issued so that a period does not produce and end-of-sequence space. |
| 2646 |
% \begin{macrocode} |
| 2647 |
\newenvironment{thebibliography}[1] |
| 2648 |
{\chapter*{\bibname |
| 2649 |
\@mkboth{\MakeUppercase\bibname} |
| 2650 |
{\MakeUppercase\bibname}}% |
| 2651 |
\list{\@biblabel{\@arabic\c@enumiv}}% |
| 2652 |
{\settowidth\labelwidth{\@biblabel{#1}}% |
| 2653 |
\leftmargin\labelwidth |
| 2654 |
\advance\leftmargin\labelsep |
| 2655 |
\if@openbib |
| 2656 |
\advance\leftmargin\bibindent |
| 2657 |
\itemindent -\bibindent |
| 2658 |
\listparindent \itemindent |
| 2659 |
\parsep \z@ |
| 2660 |
\fi |
| 2661 |
\usecounter{enumiv}% |
| 2662 |
\let\p@enumiv\@empty |
| 2663 |
\renewcommand\theenumiv{\@arabic\c@enumiv}}% |
| 2664 |
\if@openbib |
| 2665 |
\renewcommand\newblock{\par}% |
| 2666 |
\else |
| 2667 |
\renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}% |
| 2668 |
\fi |
| 2669 |
\sloppy |
| 2670 |
% \end{macrocode} |
| 2671 |
% Reset parameters to their previous values before leaving the environment |
| 2672 |
% \begin{macrocode} |
| 2673 |
\clubpenalty4000 |
| 2674 |
\@clubpenalty \clubpenalty |
| 2675 |
\widowpenalty4000 |
| 2676 |
\sfcode`\.=\@m} |
| 2677 |
{\def\@noitemerr |
| 2678 |
{\@latex@warning{Empty `thebibliography' environment}}% |
| 2679 |
\endlist} |
| 2680 |
\newcommand\newblock{} |
| 2681 |
% \end{macrocode} |
| 2682 |
% \end{macro} |
| 2683 |
% |
| 2684 |
% \subsection{The index} |
| 2685 |
% \begin{macro}{theindex} |
| 2686 |
% The index environment procudes a two-column index, with each new entry |
| 2687 |
% having its own paragraph. In the text, the commands |\item|, |\subitem| and |
| 2688 |
% |\subsubitem| are available to produce index entries at three levels. |
| 2689 |
% Each time a new letter of the alphabet is encountered, an |\indexspace| |
| 2690 |
% amount of white space can be inserted. |
| 2691 |
% \begin{macrocode} |
| 2692 |
\newenvironment{theindex} |
| 2693 |
{\if@twocolumn |
| 2694 |
\@restonecolfalse |
| 2695 |
\else |
| 2696 |
\@restonecoltrue |
| 2697 |
\fi |
| 2698 |
\columnseprule \z@ |
| 2699 |
\columnsep 35\p@ |
| 2700 |
\twocolumn[\@makeschapterhead{\indexname}]% |
| 2701 |
\@mkboth{\MakeUppercase\indexname}% |
| 2702 |
{\MakeUppercase\indexname}% |
| 2703 |
\thispagestyle{plain}\parindent\z@ |
| 2704 |
\parskip\z@ \@plus .3\p@\relax |
| 2705 |
\let\item\@idxitem} |
| 2706 |
% \end{macrocode} |
| 2707 |
% In case more text follows the index, and the document was typeset in |
| 2708 |
% single-column mode, switch back to the one column mode before finishing |
| 2709 |
% the index. |
| 2710 |
% \begin{macrocode} |
| 2711 |
{\if@restonecol |
| 2712 |
\onecolumn |
| 2713 |
\else |
| 2714 |
\clearpage |
| 2715 |
\fi} |
| 2716 |
% \end{macrocode} |
| 2717 |
% \end{macro} |
| 2718 |
% |
| 2719 |
% \begin{macro}{\@idxitem} |
| 2720 |
% \begin{macro}{\subitem} |
| 2721 |
% \begin{macro}{\subsubitem} |
| 2722 |
% The macros which typeset the actual index entries |
| 2723 |
% \begin{macrocode} |
| 2724 |
\newcommand\@idxitem{\par\hangindent 40\p@} |
| 2725 |
\newcommand\subitem{\par\hangindent 40\p@ \hspace*{20\p@}} |
| 2726 |
\newcommand\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}} |
| 2727 |
% \end{macrocode} |
| 2728 |
% \end{macro} |
| 2729 |
% \end{macro} |
| 2730 |
% \end{macro} |
| 2731 |
% |
| 2732 |
% \begin{macro}{\indexspace} |
| 2733 |
% Define the amount of white space to insert between letter blocks in |
| 2734 |
% the index. |
| 2735 |
% \begin{macrocode} |
| 2736 |
\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} |
| 2737 |
% \end{macrocode} |
| 2738 |
% \end{macro} |
| 2739 |
% |
| 2740 |
% |
| 2741 |
% \subsection{Footnotes} |
| 2742 |
% \begin{macro}{\footnoterule} |
| 2743 |
% Footnotes are often separated from the body of the text by a small rule. |
| 2744 |
% To ensure that such a rule does not take up any vertical space, we have |
| 2745 |
% to compensate for the height of the rule (of 0.4pt) by adding some vertical |
| 2746 |
% skip. But we also have to avoid the rule from colliding with the footnote |
| 2747 |
% text, so we add first a bit of negative skip, and make sure that we end up |
| 2748 |
% eventually at the point where we began. |
| 2749 |
% \begin{macrocode} |
| 2750 |
\renewcommand\footnoterule{% |
| 2751 |
\kern-3\p@ |
| 2752 |
\hrule\@width.4\columnwidth |
| 2753 |
\kern2.6\p@} |
| 2754 |
% \end{macrocode} |
| 2755 |
% \end{macro} |
| 2756 |
% |
| 2757 |
% \begin{macro}{\c@footnote} |
| 2758 |
% Footnotes are numbered within chapters, so we have to restart the numbering |
| 2759 |
% when beginning a new chapter. |
| 2760 |
% \begin{macrocode} |
| 2761 |
\@addtoreset{footnote}{chapter} |
| 2762 |
% \end{macrocode} |
| 2763 |
% \end{macro} |
| 2764 |
% |
| 2765 |
% \begin{macro}{\@makefntext} |
| 2766 |
% The macro which produces the footnote. We use a simple macro, in which the |
| 2767 |
% footnote text is typeset like a normal paragraph, without indentation |
| 2768 |
% except for its first line. The footnote markers printed in the text, which |
| 2769 |
% refer to the actual footnotes are produced by the macro |\@makefnmark|. |
| 2770 |
% Here we take over the default definition without change. |
| 2771 |
% \begin{macrocode} |
| 2772 |
\newcommand\@makefntext[1]{% |
| 2773 |
\parindent 1em% |
| 2774 |
\noindent |
| 2775 |
\hb@[email protected]{\hss\@makefnmark}#1} |
| 2776 |
% \end{macrocode} |
| 2777 |
% \end{macro} |
| 2778 |
% |
| 2779 |
% \section{Initialisation} |
| 2780 |
% \subsection{Heading names} |
| 2781 |
% The names of most of the headings can be (re)defined, and here we set |
| 2782 |
% these names to their English equivalent. They can be renamed in the |
| 2783 |
% text file through the |\renewcommand|. |
| 2784 |
% \begin{macrocode} |
| 2785 |
\newcommand\contentsname{Contents} |
| 2786 |
\newcommand\listfigurename{List of Figures} |
| 2787 |
\newcommand\listtablename{List of Tables} |
| 2788 |
\newcommand\bibname{Bibliography} |
| 2789 |
\newcommand\indexname{Index} |
| 2790 |
\newcommand\figurename{Figure} |
| 2791 |
\newcommand\tablename{Table} |
| 2792 |
\newcommand\partname{Part} |
| 2793 |
\newcommand\chaptername{Chapter} |
| 2794 |
\newcommand\appendixname{Appendix} |
| 2795 |
% \end{macrocode} |
| 2796 |
% |
| 2797 |
% \subsection{Date} |
| 2798 |
% \begin{macro}{\today} |
| 2799 |
% The macro |\today| relies on the \TeX\ macros |\month|, |\day| and |year| |
| 2800 |
% generate the date of the \LaTeX\ run. The macro has been re-arranged from |
| 2801 |
% the standard \LaTeX\ format to conform to European usage, that is, |
| 2802 |
% day month year sequence. |
| 2803 |
% \begin{macrocode} |
| 2804 |
\newcommand\today{\number\day \ \ifcase\month\or |
| 2805 |
January\or February\or March\or April\or May\or June\or |
| 2806 |
July\or August\or September\or October\or November\or December\fi |
| 2807 |
\ \number\year} |
| 2808 |
% \end{macrocode} |
| 2809 |
% \end{macro} |
| 2810 |
% |
| 2811 |
% \subsection{Double columns} |
| 2812 |
% \begin{macro}{\columnsep} |
| 2813 |
% \begin{macro}{\columnseprule} |
| 2814 |
% The macros define the distance between the two columns, and the width of |
| 2815 |
% rule separating the columns. Such a rule is usually unattractive and serves |
| 2816 |
% no real purpose for the reader: it is therefore set to 0pt. |
| 2817 |
% \begin{macrocode} |
| 2818 |
\setlength\columnsep{10\p@} |
| 2819 |
\setlength\columnseprule{0\p@} |
| 2820 |
% \end{macrocode} |
| 2821 |
% \end{macro} |
| 2822 |
% \end{macro} |
| 2823 |
% |
| 2824 |
% \subsection{Page style} |
| 2825 |
% Set the default page style to \emph{heading} and set the folio style to |
| 2826 |
% \emph{arabic} |
| 2827 |
% \begin{macrocode} |
| 2828 |
\pagestyle{headings} |
| 2829 |
\pagenumbering{arabic} |
| 2830 |
% \end{macrocode} |
| 2831 |
% If |twocolumn| was chosen as an option for typesetting the text, activate |
| 2832 |
% the double column mode with |\twocolumn|. Try to keep the columns balanced |
| 2833 |
% but do not make things too hard, hence issue a |\sloppy| command as well. |
| 2834 |
% Normally, call the |\onecolumn| macro to typeset in a single column. |
| 2835 |
% \begin{macrocode} |
| 2836 |
\if@twocolumn |
| 2837 |
\twocolumn |
| 2838 |
\sloppy |
| 2839 |
\flushbottom |
| 2840 |
\else |
| 2841 |
\onecolumn |
| 2842 |
\fi |
| 2843 |
%</octavo> |
| 2844 |
% \end{macrocode} |
| 2845 |
% |
| 2846 |
% End of file `octavo.cls'. |
| 2847 |
% \Finale |
| 2848 |
% \PrintIndex |
| 2849 |
% \PrintChanges |
| 2850 |
\endinput |