Guido van Rossum | ecae0b7 | 1996-06-26 19:03:20 +0000 | [diff] [blame] | 1 | % |
| 2 | % myformat.sty for the Python doc [updated to work with Latex2e] |
| 3 | % |
| 4 | |
Guido van Rossum | daff175 | 1997-06-02 17:35:01 +0000 | [diff] [blame] | 5 | % Increase printable page size (copied from fullpage.sty) |
| 6 | \topmargin 0pt |
| 7 | \advance \topmargin by -\headheight |
| 8 | \advance \topmargin by -\headsep |
Fred Drake | 9e24309 | 1998-01-18 05:09:54 +0000 | [diff] [blame] | 9 | |
Guido van Rossum | daff175 | 1997-06-02 17:35:01 +0000 | [diff] [blame] | 10 | \textheight 8.9in |
Fred Drake | 9e24309 | 1998-01-18 05:09:54 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | daff175 | 1997-06-02 17:35:01 +0000 | [diff] [blame] | 12 | \oddsidemargin 0pt |
| 13 | \evensidemargin \oddsidemargin |
| 14 | \marginparwidth 0.5in |
Fred Drake | 9e24309 | 1998-01-18 05:09:54 +0000 | [diff] [blame] | 15 | |
Guido van Rossum | daff175 | 1997-06-02 17:35:01 +0000 | [diff] [blame] | 16 | \textwidth 6.5in |
| 17 | |
Guido van Rossum | 643d932 | 1992-03-31 18:53:47 +0000 | [diff] [blame] | 18 | % Style parameters and macros used by most documents here |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 19 | \raggedbottom |
| 20 | \sloppy |
| 21 | \parindent = 0mm |
| 22 | \parskip = 2mm |
| 23 | |
Fred Drake | 9e24309 | 1998-01-18 05:09:54 +0000 | [diff] [blame] | 24 | % old code font selections: |
| 25 | \let\codefont=\tt |
| 26 | \let\sectcodefont=\tt |
| 27 | |
| 28 | % (Haven't found a new one that gets <, >, and _ right without being |
| 29 | % monospaced.) |
| 30 | |
Guido van Rossum | 4c22cb2 | 1991-01-25 13:28:15 +0000 | [diff] [blame] | 31 | % Variable used by begin code command |
Guido van Rossum | 44000ed | 1991-01-24 16:54:29 +0000 | [diff] [blame] | 32 | \newlength{\codewidth} |
Guido van Rossum | 44000ed | 1991-01-24 16:54:29 +0000 | [diff] [blame] | 33 | |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 34 | % Command to start a code block (follow this by \begin{verbatim}) |
Guido van Rossum | 4c22cb2 | 1991-01-25 13:28:15 +0000 | [diff] [blame] | 35 | \newcommand{\bcode}{ |
| 36 | % Calculate the text width for the minipage: |
| 37 | \setlength{\codewidth}{\linewidth} |
| 38 | \addtolength{\codewidth}{-\parindent} |
| 39 | % |
Guido van Rossum | 4c22cb2 | 1991-01-25 13:28:15 +0000 | [diff] [blame] | 40 | \par |
Guido van Rossum | 92fba02 | 1991-11-12 15:44:51 +0000 | [diff] [blame] | 41 | \vspace{3mm} |
Guido van Rossum | 4c22cb2 | 1991-01-25 13:28:15 +0000 | [diff] [blame] | 42 | \indent |
| 43 | \begin{minipage}[t]{\codewidth} |
| 44 | } |
| 45 | |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 46 | % Command to end a code block (precede this by \end{verbatim}) |
Guido van Rossum | 4c22cb2 | 1991-01-25 13:28:15 +0000 | [diff] [blame] | 47 | \newcommand{\ecode}{ |
| 48 | \end{minipage} |
| 49 | \vspace{3mm} |
| 50 | \par |
| 51 | \noindent |
| 52 | } |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 53 | |
Guido van Rossum | ecae0b7 | 1996-06-26 19:03:20 +0000 | [diff] [blame] | 54 | % Underscore hack (only act like subscript operator if in math mode) |
| 55 | % |
| 56 | % The following is due to Mark Wooding (the old version didn't work with |
| 57 | % Latex 2e. |
| 58 | |
| 59 | \DeclareRobustCommand\hackscore{% |
| 60 | \ifmmode_\else\textunderscore\fi% |
| 61 | } |
| 62 | \begingroup |
| 63 | \catcode`\_\active |
| 64 | \def\next{% |
| 65 | \AtBeginDocument{\catcode`\_\active\def_{\hackscore{}}}% |
| 66 | } |
| 67 | \expandafter\endgroup\next |
| 68 | |
| 69 | % |
| 70 | % This is the old hack, which didn't work with 2e. |
| 71 | % If you're still using Latex 2.09, you can give it a try if the above fails. |
| 72 | % |
| 73 | %\def\_{\ifnum\fam=\ttfamily \char'137\else{\tt\char'137}\fi} |
| 74 | %\catcode`\_=12 |
| 75 | %\catcode`\_=\active\def_{\ifnum\fam=\ttfamily \char'137 \else{\tt\char'137}\fi} |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 76 | |
Fred Drake | b37a395 | 1998-02-06 22:52:52 +0000 | [diff] [blame] | 77 | |
| 78 | %% Lots of index-entry generation support. |
| 79 | |
| 80 | % Command to wrap around stuff that refers to function/module/attribute names |
| 81 | % in the index. Default behavior: like \code{}. To just keep the index |
| 82 | % entries in the roman font, uncomment the second definition to use instead; |
| 83 | % it matches O'Reilly style more. |
| 84 | \newcommand{\idxcode}[1]{\codefont{#1}} |
| 85 | %\renewcommand{\idxcode}[1]{#1} |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 86 | |
| 87 | % Command to generate two index entries (using subentries) |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 88 | \newcommand{\indexii}[2]{\index{#1!#2}\index{#2!#1}} |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 89 | |
| 90 | % And three entries (using only one level of subentries) |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 91 | \newcommand{\indexiii}[3]{\index{#1!#2 #3}\index{#2!#3, #1}\index{#3!#1 #2}} |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 92 | |
| 93 | % And four (again, using only one level of subentries) |
| 94 | \newcommand{\indexiv}[4]{ |
| 95 | \index{#1!#2 #3 #4} |
| 96 | \index{#2!#3 #4, #1} |
| 97 | \index{#3!#4, #1 #2} |
| 98 | \index{#4!#1 #2 #3} |
| 99 | } |
| 100 | |
Fred Drake | b16166e | 1998-02-09 19:14:54 +0000 | [diff] [blame] | 101 | % Index an Internet RFC |
| 102 | \newcommand{\rfcindex}[1]{\index{RFC!#1}} |
| 103 | |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 104 | % Command to generate a reference to a function, statement, keyword, operator |
Fred Drake | b37a395 | 1998-02-06 22:52:52 +0000 | [diff] [blame] | 105 | \newcommand{\stindex}[1]{\indexii{statement}{#1@{\idxcode{#1}}}} |
| 106 | \newcommand{\opindex}[1]{\indexii{operator}{#1@{\idxcode{#1}}}} |
| 107 | \newcommand{\exindex}[1]{\indexii{exception}{#1@{\idxcode{#1}}}} |
Guido van Rossum | 6886c83 | 1992-04-03 14:44:27 +0000 | [diff] [blame] | 108 | \newcommand{\obindex}[1]{\indexii{object}{#1}} |
Fred Drake | b37a395 | 1998-02-06 22:52:52 +0000 | [diff] [blame] | 109 | \newcommand{\bifuncindex}[1]{\index{#1@{\idxcode{#1}} (built-in function)}} |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 110 | |
| 111 | % Add an index entry for a module |
Fred Drake | b37a395 | 1998-02-06 22:52:52 +0000 | [diff] [blame] | 112 | \newcommand{\refmodule}[2]{\index{#1@{\idxcode{#1}} (#2module)}} |
Fred Drake | 4af1814 | 1997-12-15 22:08:14 +0000 | [diff] [blame] | 113 | \newcommand{\refmodindex}[1]{\refmodule{#1}{}} |
Fred Drake | 207e57b | 1997-12-15 21:37:45 +0000 | [diff] [blame] | 114 | \newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }} |
| 115 | \newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }} |
| 116 | |
Fred Drake | da941ef | 1998-01-02 02:57:41 +0000 | [diff] [blame] | 117 | % support for the module index |
| 118 | \newwrite\modindexfile |
| 119 | \openout\modindexfile=modules.idx |
| 120 | |
Fred Drake | 207e57b | 1997-12-15 21:37:45 +0000 | [diff] [blame] | 121 | % Add the defining entry for a module |
Fred Drake | b37a395 | 1998-02-06 22:52:52 +0000 | [diff] [blame] | 122 | \newcommand{\defmodindex}[2]{% |
| 123 | \index{#1@{\idxcode{#1}} (#2module)|textbf}% |
Fred Drake | da941ef | 1998-01-02 02:57:41 +0000 | [diff] [blame] | 124 | \write\modindexfile{#1 \thepage}} |
Fred Drake | b192747 | 1998-02-04 14:43:36 +0000 | [diff] [blame] | 125 | \newcommand{\modindex}[1]{\defmodindex{#1}{}} |
Fred Drake | 207e57b | 1997-12-15 21:37:45 +0000 | [diff] [blame] | 126 | \newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }} |
| 127 | \newcommand{\stmodindex}[1]{\defmodindex{#1}{standard }} |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 128 | |
| 129 | % Additional string for an index entry |
| 130 | \newcommand{\indexsubitem}{} |
Fred Drake | b37a395 | 1998-02-06 22:52:52 +0000 | [diff] [blame] | 131 | \newcommand{\ttindex}[1]{\index{#1@{\idxcode{#1}} \indexsubitem}} |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 132 | |
Guido van Rossum | 5badc75 | 1992-03-06 10:55:46 +0000 | [diff] [blame] | 133 | |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 134 | % from user-level, fulllineitems should be called as an environment |
| 135 | \def\fulllineitems{\list{}{\labelwidth \leftmargin \labelsep 0pt |
| 136 | \rightmargin 0pt \topsep -\parskip \partopsep \parskip |
| 137 | \itemsep -\parsep |
| 138 | \let\makelabel\itemnewline}} |
| 139 | \let\endfulllineitems\endlist |
| 140 | |
| 141 | |
Guido van Rossum | 36f3502 | 1997-05-22 20:43:24 +0000 | [diff] [blame] | 142 | % cfuncdesc should be called as |
| 143 | % \begin{cfuncdesc}{type}{name}{arglist} |
| 144 | % ... description ... |
| 145 | % \end{cfuncdesc} |
Fred Drake | eb33c78 | 1996-10-29 15:55:08 +0000 | [diff] [blame] | 146 | \newcommand{\cfuncline}[3]{\item[\code{#1 #2(\varvars{#3})}]\ttindex{#2}} |
| 147 | \newcommand{\cfuncdesc}[3]{\fulllineitems\cfuncline{#1}{#2}{#3}} |
| 148 | \let\endcfuncdesc\endfulllineitems |
| 149 | |
Guido van Rossum | 36f3502 | 1997-05-22 20:43:24 +0000 | [diff] [blame] | 150 | \newcommand{\cvarline}[2]{\item[\code{#1 #2}]\ttindex{#2}} |
| 151 | \newcommand{\cvardesc}[2]{\fulllineitems\cvarline{#1}{#2}} |
| 152 | \let\endcvardesc\endfulllineitems |
| 153 | |
| 154 | \newcommand{\ctypeline}[1]{\item[\code{#1}]\ttindex{#1}} |
| 155 | \newcommand{\ctypedesc}[1]{\fulllineitems\ctypeline{#1}} |
| 156 | \let\endctypedesc\endfulllineitems |
| 157 | |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 158 | % funcdesc should be called as an \begin{funcdesc} ... \end{funcdesc} |
| 159 | \newcommand{\funcline}[2]{\item[\code{#1(\varvars{#2})}]\ttindex{#1}} |
| 160 | \newcommand{\funcdesc}[2]{\fulllineitems\funcline{#1}{#2}} |
| 161 | \let\endfuncdesc\endfulllineitems |
Fred Drake | 6c886a8 | 1998-01-12 14:44:33 +0000 | [diff] [blame] | 162 | \newcommand{\optional}[1]{{\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}} } |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 163 | |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 164 | |
| 165 | % same for excdesc |
| 166 | \newcommand{\excline}[1]{\item[\code{#1}]\ttindex{#1}} |
| 167 | \newcommand{\excdesc}[1]{\fulllineitems\excline{#1}} |
| 168 | \let\endexcdesc\endfulllineitems |
| 169 | |
| 170 | % same for datadesc |
| 171 | \newcommand{\dataline}[1]{\item[\code{#1}]\ttindex{#1}} |
| 172 | \newcommand{\datadesc}[1]{\fulllineitems\dataline{#1}} |
| 173 | \let\enddatadesc\endfulllineitems |
| 174 | |
| 175 | |
Fred Drake | a610f9f | 1997-12-03 03:42:39 +0000 | [diff] [blame] | 176 | % opcodedesc should be called as an \begin{opcodedesc} ... \end{opcodedesc} |
| 177 | \newcommand{\opcodeline}[2]{\item[\code{#1\quad\varvars{#2}}]\ttindex{#1}} |
| 178 | \newcommand{\opcodedesc}[2]{\fulllineitems\opcodeline{#1}{#2}} |
| 179 | \let\endopcodedesc\endfulllineitems |
| 180 | |
| 181 | |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 182 | \let\nodename=\label |
| 183 | |
Fred Drake | 3082424 | 1996-12-13 21:53:07 +0000 | [diff] [blame] | 184 | %% For these commands, use \command{} to get the typography right, not |
| 185 | %% {\command}. This works better with the texinfo translation. |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 186 | \newcommand{\ABC}{{\sc abc}} |
| 187 | \newcommand{\UNIX}{{\sc Unix}} |
Fred Drake | 311c196 | 1998-01-20 05:07:19 +0000 | [diff] [blame] | 188 | \newcommand{\POSIX}{POSIX} |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 189 | \newcommand{\ASCII}{{\sc ascii}} |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 190 | \newcommand{\Cpp}{C\protect\raisebox{.18ex}{++}} |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 191 | \newcommand{\C}{C} |
| 192 | \newcommand{\EOF}{{\sc eof}} |
Guido van Rossum | 9231c8f | 1997-05-15 21:43:21 +0000 | [diff] [blame] | 193 | \newcommand{\NULL}{\code{NULL}} |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 194 | |
| 195 | % code is the most difficult one... |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 196 | \newcommand{\code}[1]{{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}% |
Fred Drake | 9e24309 | 1998-01-18 05:09:54 +0000 | [diff] [blame] | 197 | \mbox{\codefont{#1}}}} |
Guido van Rossum | ecae0b7 | 1996-06-26 19:03:20 +0000 | [diff] [blame] | 198 | |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 199 | \newcommand{\kbd}[1]{\mbox{\tt #1}} |
| 200 | \newcommand{\key}[1]{\mbox{\tt #1}} |
| 201 | \newcommand{\samp}[1]{\mbox{`\code{#1}'}} |
Fred Drake | 9e24309 | 1998-01-18 05:09:54 +0000 | [diff] [blame] | 202 | % This weird definition of \var{} allows it to always appear in roman italics, |
| 203 | % and won't be sans-serif in code fragments. |
| 204 | \newcommand{\var}[1]{\mbox{\textrm{\textit{#1\/}}}} |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 205 | \let\file=\samp |
Guido van Rossum | 4541602 | 1995-03-30 16:00:58 +0000 | [diff] [blame] | 206 | \newcommand{\dfn}[1]{{\em #1\/}} |
Guido van Rossum | ecae0b7 | 1996-06-26 19:03:20 +0000 | [diff] [blame] | 207 | \renewcommand{\emph}[1]{{\em #1\/}} |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 208 | \newcommand{\strong}[1]{{\bf #1}} |
| 209 | |
Fred Drake | 9b550d9 | 1996-11-11 20:43:46 +0000 | [diff] [blame] | 210 | \newcommand{\varvars}[1]{{\def\,{\/{\char`\,}}\var{#1}}} |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 211 | |
| 212 | \newif\iftexi\texifalse |
Guido van Rossum | ecae0b7 | 1996-06-26 19:03:20 +0000 | [diff] [blame] | 213 | \newif\iflatex\latextrue |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 214 | |
Fred Drake | 311c196 | 1998-01-20 05:07:19 +0000 | [diff] [blame] | 215 | % Proposed new macros: These should be used for all references to identifiers |
| 216 | % which are used to refer to instances of specific language constructs. See |
| 217 | % the names for specific semantic assignments. |
| 218 | % |
Fred Drake | dd28d57 | 1998-01-22 15:55:21 +0000 | [diff] [blame] | 219 | % For now, don't do anything really fancy with them; just use them as logical |
| 220 | % markup. This might change in the future. |
Fred Drake | 311c196 | 1998-01-20 05:07:19 +0000 | [diff] [blame] | 221 | % |
| 222 | \let\module=\code |
Fred Drake | dd28d57 | 1998-01-22 15:55:21 +0000 | [diff] [blame] | 223 | \let\keyword=\code |
| 224 | \let\exception=\code |
Fred Drake | 311c196 | 1998-01-20 05:07:19 +0000 | [diff] [blame] | 225 | \let\class=\code |
Fred Drake | dd28d57 | 1998-01-22 15:55:21 +0000 | [diff] [blame] | 226 | \let\function=\code |
| 227 | \let\cfunction=\code |
| 228 | \let\method=\code |
| 229 | |
| 230 | % constants defined in Python modules, not language constants: |
| 231 | \let\constant=\code |
Fred Drake | 311c196 | 1998-01-20 05:07:19 +0000 | [diff] [blame] | 232 | |
| 233 | \newcommand{\manpage}[2]{{\emph{#1}(#2)}} |
Fred Drake | b16166e | 1998-02-09 19:14:54 +0000 | [diff] [blame] | 234 | \newcommand{\rfc}[1]{RFC #1\rfcindex{#1}} |
Fred Drake | 311c196 | 1998-01-20 05:07:19 +0000 | [diff] [blame] | 235 | \let\email=\code |
| 236 | \let\url=\code |
| 237 | |
| 238 | |
Guido van Rossum | e7af5a0 | 1994-08-01 12:39:35 +0000 | [diff] [blame] | 239 | \newenvironment{tableii}[4]{\begin{center}\def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}\begin{tabular}{#1}\hline#3\\ |
| 240 | \hline}{\hline\end{tabular}\end{center}} |
| 241 | |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 242 | \newenvironment{tableiii}[5]{\begin{center}\def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}\begin{tabular}{#1}\hline#3\\ |
| 243 | \hline}{\hline\end{tabular}\end{center}} |
| 244 | |
| 245 | \newcommand{\itemnewline}[1]{\@tempdima\linewidth |
| 246 | \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}} |
| 247 | |
Fred Drake | 9e24309 | 1998-01-18 05:09:54 +0000 | [diff] [blame] | 248 | \newcommand{\sectcode}[1]{{\sectcodefont{#1}}} |
Guido van Rossum | e3d5fc5 | 1997-07-17 18:27:53 +0000 | [diff] [blame] | 249 | |
| 250 | % Cross-referencing (AMK) |
| 251 | % Sample usage: |
| 252 | % \begin{seealso} |
| 253 | % \seemodule{rand}{Uniform random number generator}; % Module xref |
| 254 | % \seetext{{\em Encyclopedia Britannica}}. % Ref to a book |
| 255 | % \end{seealso} |
| 256 | |
Fred Drake | 6c886a8 | 1998-01-12 14:44:33 +0000 | [diff] [blame] | 257 | \newenvironment{seealso}[0]{{\bf See Also:}\par}{\par} |
Fred Drake | 0f02628 | 1998-01-22 17:43:15 +0000 | [diff] [blame] | 258 | \newcommand{\seemodule}[2]{\ref{module-#1}: \module{#1}\quad(#2)} |
Guido van Rossum | e3d5fc5 | 1997-07-17 18:27:53 +0000 | [diff] [blame] | 259 | \newcommand{\seetext}[1]{\par{#1}} |
Fred Drake | da941ef | 1998-01-02 02:57:41 +0000 | [diff] [blame] | 260 | |
| 261 | % Fix the theindex environment to add an entry to the Table of Contents; |
| 262 | % this is much nicer than just having to jump to the end of the book and |
| 263 | % flip around, especially with multiple indexes. |
| 264 | % |
| 265 | \let\OldTheindex=\theindex |
| 266 | \def\theindex{% |
| 267 | \OldTheindex% |
| 268 | \addcontentsline{toc}{chapter}{\indexname}% |
| 269 | } |
Fred Drake | 031ad4b | 1998-01-09 05:34:23 +0000 | [diff] [blame] | 270 | |
| 271 | % Use a similar trick to catch the end of the {abstract} environment, |
| 272 | % but here make sure the abstract is followed by a blank page if the |
| 273 | % 'openright' option is used. |
| 274 | % |
| 275 | \let\OldEndAbstract=\endabstract |
Fred Drake | 737e73e | 1998-01-13 22:40:08 +0000 | [diff] [blame] | 276 | \def\endabstract{ |
| 277 | \if@openright |
| 278 | \ifodd\value{page} |
| 279 | \typeout{Adding blank page after the abstract.} |
| 280 | \vfil\pagebreak |
Fred Drake | 031ad4b | 1998-01-09 05:34:23 +0000 | [diff] [blame] | 281 | \fi |
Fred Drake | 737e73e | 1998-01-13 22:40:08 +0000 | [diff] [blame] | 282 | \fi |
| 283 | \OldEndAbstract |
Fred Drake | 031ad4b | 1998-01-09 05:34:23 +0000 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | % \mytableofcontents wraps the \tableofcontents macro with all the magic to |
| 287 | % get the spacing right and have the right number of pages if the 'openright' |
| 288 | % option has been used. This eliminates a fair amount of crud in the |
| 289 | % individual document files. |
| 290 | % |
Fred Drake | 737e73e | 1998-01-13 22:40:08 +0000 | [diff] [blame] | 291 | \let\OldTableofcontents=\tableofcontents |
| 292 | \def\tableofcontents{% |
| 293 | \pagebreak |
| 294 | \pagestyle{plain} |
| 295 | { |
| 296 | \parskip = 0mm |
| 297 | \OldTableofcontents |
Fred Drake | 031ad4b | 1998-01-09 05:34:23 +0000 | [diff] [blame] | 298 | \if@openright |
Fred Drake | 737e73e | 1998-01-13 22:40:08 +0000 | [diff] [blame] | 299 | \ifodd\value{page} |
| 300 | \typeout{Adding blank page after the table of contents.} |
| 301 | \pagebreak\hspace{0pt} |
Fred Drake | 031ad4b | 1998-01-09 05:34:23 +0000 | [diff] [blame] | 302 | \fi |
| 303 | \fi |
| 304 | } |
Fred Drake | 737e73e | 1998-01-13 22:40:08 +0000 | [diff] [blame] | 305 | \pagebreak |
Fred Drake | 031ad4b | 1998-01-09 05:34:23 +0000 | [diff] [blame] | 306 | } |
Fred Drake | 8362d00 | 1998-01-13 17:29:31 +0000 | [diff] [blame] | 307 | |
| 308 | % Uncomment the following line to use a PostScript font instead of bitmaps: |
Fred Drake | b16166e | 1998-02-09 19:14:54 +0000 | [diff] [blame] | 309 | \RequirePackage{times}\typeout{Using times fonts instead of Computer Modern.} |