Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1 | % |
Fred Drake | 6663b22 | 1998-03-06 22:33:06 +0000 | [diff] [blame] | 2 | % python.sty for the Python docummentation [works only with with Latex2e] |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 3 | % |
| 4 | |
| 5 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] |
| 6 | \ProvidesPackage{python} |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 7 | [1998/01/11 LaTeX package (Python markup)] |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 8 | |
Fred Drake | 454a4fb | 1998-04-01 22:20:14 +0000 | [diff] [blame] | 9 | % These packages can be used to add marginal annotations which indicate |
| 10 | % index entries and labels; useful for reviewing this messy documentation! |
| 11 | % |
| 12 | %\RequirePackage{showkeys} |
| 13 | %\RequirePackage{showidx} |
| 14 | |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 15 | % for PDF output, use maximal compression & a lot of other stuff |
| 16 | % (test for PDF recommended by Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov>) |
| 17 | % |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 18 | \newif\if@doing@page@targets |
| 19 | \@doing@page@targetsfalse |
| 20 | |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 21 | \ifx\pdfoutput\undefined\else\ifcase\pdfoutput |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 22 | \let\LinkColor=\relax |
| 23 | \let\NormalColor=\relax |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 24 | \else |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 25 | \input{pdfcolor} |
| 26 | \let\LinkColor=\NavyBlue |
| 27 | \let\NormalColor=\Black |
| 28 | \pdfcompresslevel=9 |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 29 | % |
| 30 | % This definition allows the entries in the page-view of the ToC to be |
| 31 | % active links. Some work, some don't. |
| 32 | % |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 33 | \let\OldContentsline=\contentsline |
| 34 | \renewcommand{\contentsline}[3]{% |
| 35 | \OldContentsline{#1}{% |
| 36 | \pdfannotlink attr{/Border [0 0 0]} goto name{page.#3}% |
| 37 | \LinkColor#2\NormalColor% |
| 38 | \pdfendlink% |
| 39 | }{#3}% |
| 40 | } |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 41 | % |
| 42 | % This is supposed to build the "outline" view of the document; it seems |
| 43 | % quite fragile. The breakages are the same as in the ToC. |
| 44 | % |
| 45 | \AtEndDocument{ |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 46 | \InputIfFileExists{\jobname.bkm}{\pdfcatalog{/PageMode /UseOutlines}}{} |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 47 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 48 | \let\OldLabel=\label |
| 49 | \renewcommand{\label}[1]{% |
| 50 | \OldLabel{#1}% |
| 51 | {\pdfdest name{label.#1} fit}% |
| 52 | } |
| 53 | % This stuff adds a page.# destination to every PDF page, where # has |
| 54 | % the same formatting as the displayed page number. This doesn't really |
| 55 | % help with the frontmatter, but does fine with the body. |
| 56 | % |
| 57 | % This is *heavily* based on the hyperref package. |
| 58 | % |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 59 | \def\@begindvi{% |
| 60 | \unvbox \@begindvibox |
| 61 | \@hyperfixhead |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 62 | } |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 63 | \def\@hyperfixhead{% |
| 64 | \let\H@old@thehead\@thehead |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 65 | \gdef\@foo{\if@doing@page@targets\pdfdest name{page.\thepage} fit\fi}% |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 66 | \expandafter\ifx\expandafter\@empty\H@old@thehead |
| 67 | \def\H@old@thehead{\hfil}\fi |
| 68 | \def\@thehead{\@foo\relax\H@old@thehead}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 69 | } |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 70 | \fi\fi |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 71 | |
| 72 | % Increase printable page size (copied from fullpage.sty) |
| 73 | \topmargin 0pt |
| 74 | \advance \topmargin by -\headheight |
| 75 | \advance \topmargin by -\headsep |
| 76 | |
| 77 | % attempt to work a little better for A4 users |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 78 | \@ifundefined{paperheight}{ |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 79 | \textheight 9in |
| 80 | }{ |
| 81 | \textheight \paperheight |
| 82 | \advance\textheight by -2in |
| 83 | } |
| 84 | |
| 85 | \oddsidemargin 0pt |
| 86 | \evensidemargin \oddsidemargin |
| 87 | \marginparwidth 0.5in |
| 88 | |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 89 | \@ifundefined{paperwidth}{ |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 90 | \textwidth 6.5in |
| 91 | }{ |
| 92 | \textwidth \paperwidth |
| 93 | \advance\textwidth by -2in |
| 94 | } |
| 95 | |
| 96 | |
| 97 | % Style parameters and macros used by most documents here |
| 98 | \raggedbottom |
| 99 | \sloppy |
| 100 | \parindent = 0mm |
| 101 | \parskip = 2mm |
| 102 | \hbadness = 5000 % don't print trivial gripes |
| 103 | |
| 104 | \pagestyle{empty} % start this way; change for |
| 105 | \pagenumbering{roman} % ToC & chapters |
| 106 | \setcounter{secnumdepth}{1} |
| 107 | |
| 108 | % Use this to set the font family for headers and other decor: |
| 109 | \newcommand{\HeaderFamily}{\sffamily} |
| 110 | |
| 111 | % Redefine the 'normal' header/footer style when using "fancyhdr" package: |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 112 | \@ifundefined{fancyhf}{}{ |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 113 | % Use \pagestyle{normal} as the primary pagestyle for text. |
| 114 | \fancypagestyle{normal}{ |
| 115 | \fancyhf{} |
| 116 | \fancyfoot[LE,RO]{{\HeaderFamily\thepage}} |
| 117 | \fancyfoot[LO]{{\HeaderFamily\nouppercase{\rightmark}}} |
| 118 | \fancyfoot[RE]{{\HeaderFamily\nouppercase{\leftmark}}} |
| 119 | \renewcommand{\headrulewidth}{0pt} |
| 120 | \renewcommand{\footrulewidth}{0.4pt} |
| 121 | } |
| 122 | % Update the plain style so we get the page number & footer line, |
| 123 | % but not a chapter or section title. This is to keep the first |
| 124 | % page of a chapter and the blank page between chapters `clean.' |
| 125 | \fancypagestyle{plain}{ |
| 126 | \fancyhf{} |
| 127 | \fancyfoot[LE,RO]{{\HeaderFamily\thepage}} |
| 128 | \renewcommand{\headrulewidth}{0pt} |
| 129 | \renewcommand{\footrulewidth}{0.4pt} |
| 130 | } |
| 131 | % Redefine \cleardoublepage so that the blank page between chapters |
| 132 | % gets the plain style and not the fancy style. This is described |
| 133 | % in the documentation for the fancyhdr package by Piet von Oostrum. |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 134 | \@ifundefined{chapter}{}{ |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 135 | \renewcommand{\cleardoublepage}{ |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 136 | \clearpage\if@openright \ifodd\c@page\else |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 137 | \hbox{} |
| 138 | \thispagestyle{plain} |
| 139 | \newpage |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 140 | \if@twocolumn\hbox{}\newpage\fi\fi\fi |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 141 | } |
| 142 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | % old code font selections: |
| 146 | \let\codefont=\tt |
| 147 | \let\sectcodefont=\tt |
| 148 | |
| 149 | % (Haven't found a new one that gets <, >, and _ right without being |
| 150 | % monospaced.) |
| 151 | |
| 152 | |
| 153 | % This sets up the {verbatim} environment to be indented and a minipage, |
| 154 | % and to have all the other mostly nice properties that we want for |
| 155 | % code samples. |
| 156 | |
| 157 | % Variable used by begin code command |
| 158 | \newlength{\codewidth} |
| 159 | |
| 160 | \newcommand{\examplevspace}{2mm} |
| 161 | \newcommand{\exampleindent}{1cm} |
| 162 | |
| 163 | \let\OldVerbatim=\verbatim |
| 164 | \let\OldEndVerbatim=\endverbatim |
| 165 | \renewcommand{\verbatim}{% |
| 166 | \begingroup% |
| 167 | \setlength{\parindent}\exampleindent% |
| 168 | % Calculate the text width for the minipage: |
| 169 | \setlength{\codewidth}{\linewidth}% |
| 170 | \addtolength{\codewidth}{-\parindent}% |
| 171 | % |
| 172 | \par% |
| 173 | \vspace\examplevspace% |
| 174 | \indent% |
| 175 | \begin{minipage}[t]{\codewidth}% |
| 176 | \small% |
| 177 | \OldVerbatim% |
| 178 | } |
| 179 | \renewcommand{\endverbatim}{% |
| 180 | \OldEndVerbatim% |
| 181 | \end{minipage}% |
| 182 | \endgroup% |
| 183 | } |
| 184 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 185 | \newcommand{\reset@python}{ |
| 186 | \global\let\@thisclass=\@undefined |
| 187 | \global\let\@thismodule=\@undefined |
| 188 | } |
| 189 | \reset@python |
| 190 | |
| 191 | % Augment the sectioning commands used to get our own font family in place, |
| 192 | % and reset some internal data items: |
| 193 | \renewcommand{\section}{\reset@python% |
| 194 | \@startsection {section}{1}{\z@}% |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 195 | {-3.5ex \@plus -1ex \@minus -.2ex}% |
| 196 | {2.3ex \@plus.2ex}% |
| 197 | {\reset@font\Large\HeaderFamily}} |
| 198 | \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}% |
| 199 | {-3.25ex\@plus -1ex \@minus -.2ex}% |
| 200 | {1.5ex \@plus .2ex}% |
| 201 | {\reset@font\large\HeaderFamily}} |
| 202 | \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}% |
| 203 | {-3.25ex\@plus -1ex \@minus -.2ex}% |
| 204 | {1.5ex \@plus .2ex}% |
| 205 | {\reset@font\normalsize\HeaderFamily}} |
| 206 | \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}% |
| 207 | {3.25ex \@plus1ex \@minus.2ex}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 208 | {-1em}% |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 209 | {\reset@font\normalsize\HeaderFamily}} |
| 210 | \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\parindent}% |
| 211 | {3.25ex \@plus1ex \@minus .2ex}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 212 | {-1em}% |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 213 | {\reset@font\normalsize\HeaderFamily}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 214 | |
| 215 | |
| 216 | % Underscore hack (only act like subscript operator if in math mode) |
| 217 | % |
| 218 | % The following is due to Mark Wooding (the old version didn't work with |
| 219 | % Latex 2e. |
| 220 | |
| 221 | \DeclareRobustCommand\hackscore{% |
| 222 | \ifmmode_\else\textunderscore\fi% |
| 223 | } |
| 224 | \begingroup |
| 225 | \catcode`\_\active |
| 226 | \def\next{% |
| 227 | \AtBeginDocument{\catcode`\_\active\def_{\hackscore{}}}% |
| 228 | } |
| 229 | \expandafter\endgroup\next |
| 230 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 231 | |
| 232 | %% Lots of index-entry generation support. |
| 233 | |
| 234 | % Command to wrap around stuff that refers to function / module / |
| 235 | % attribute names in the index. Default behavior: like \code{}. To |
| 236 | % just keep the index entries in the roman font, uncomment the second |
| 237 | % definition to use instead; it matches O'Reilly style more. |
| 238 | % |
| 239 | \newcommand{\idxcode}[1]{\codefont{#1}} |
| 240 | %\renewcommand{\idxcode}[1]{#1} |
| 241 | |
| 242 | % Command to generate two index entries (using subentries) |
| 243 | \newcommand{\indexii}[2]{\index{#1!#2}\index{#2!#1}} |
| 244 | |
| 245 | % And three entries (using only one level of subentries) |
| 246 | \newcommand{\indexiii}[3]{\index{#1!#2 #3}\index{#2!#3, #1}\index{#3!#1 #2}} |
| 247 | |
| 248 | % And four (again, using only one level of subentries) |
| 249 | \newcommand{\indexiv}[4]{ |
| 250 | \index{#1!#2 #3 #4} |
| 251 | \index{#2!#3 #4, #1} |
| 252 | \index{#3!#4, #1 #2} |
| 253 | \index{#4!#1 #2 #3} |
| 254 | } |
| 255 | |
| 256 | % Command to generate a reference to a function, statement, keyword, |
| 257 | % operator. |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 258 | \newcommand{\stindex}[1]{\indexii{statement}{#1@{\idxcode{#1}}}} |
| 259 | \newcommand{\opindex}[1]{\indexii{operator}{#1@{\idxcode{#1}}}} |
| 260 | \newcommand{\exindex}[1]{\indexii{exception}{#1@{\idxcode{#1}}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 261 | \newcommand{\obindex}[1]{\indexii{object}{#1}} |
Fred Drake | 2351c80 | 1998-04-02 18:48:32 +0000 | [diff] [blame] | 262 | \newcommand{\bifuncindex}[1]{\withsubitem{(built-in function)}{\ttindex{#1()}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 263 | |
| 264 | % Add an index entry for a module |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 265 | \newcommand{\refmodule}[2]{\index{#1@{\idxcode{#1}} (#2module)}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 266 | \newcommand{\refmodindex}[1]{\refmodule{#1}{}} |
| 267 | \newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }} |
| 268 | \newcommand{\refexmodindex}[1]{\refmodule{#1}{extension }} |
| 269 | \newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }} |
| 270 | |
| 271 | % support for the module index |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 272 | \newif\if@UseModuleIndex |
| 273 | \@UseModuleIndexfalse |
| 274 | |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 275 | % Fix the theindex environment to add an entry to the Table of |
| 276 | % Contents; this is much nicer than just having to jump to the end of |
| 277 | % the book and flip around, especially with multiple indexes. |
| 278 | % |
| 279 | \let\OldTheindex=\theindex |
| 280 | \renewcommand{\theindex}{ |
| 281 | \cleardoublepage |
| 282 | \OldTheindex |
| 283 | \addcontentsline{toc}{chapter}{\indexname} |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 284 | } |
| 285 | |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 286 | \newcommand{\makemodindex}{ |
| 287 | \newwrite\modindexfile |
| 288 | \openout\modindexfile=mod\jobname.idx |
| 289 | \@UseModuleIndextrue |
| 290 | } |
| 291 | |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 292 | % Add the defining entry for a module |
| 293 | \newcommand{\@modindex}[2]{% |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 294 | \global\def\@thismodule{#1} |
| 295 | \setindexsubitem{(in module #1)}% |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 296 | \index{#1@{\idxcode{#1}} (#2module)|textbf}% |
| 297 | \if@UseModuleIndex% |
| 298 | \write\modindexfile{\protect\indexentry{#1@{\tt #1}}{\thepage}}% |
| 299 | \fi% |
| 300 | } |
| 301 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 302 | % built-in & Python modules in the main distribution |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 303 | \newcommand{\bimodindex}[1]{\@modindex{#1}{built-in }} |
| 304 | \newcommand{\stmodindex}[1]{\@modindex{#1}{standard }} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 305 | |
| 306 | % Python & extension modules outside the main distribution |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 307 | \newcommand{\modindex}[1]{\@modindex{#1}{}} |
| 308 | \newcommand{\exmodindex}[1]{\@modindex{#1}{extension }} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 309 | |
| 310 | % Additional string for an index entry |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 311 | \newcommand{\index@subitem}{} |
| 312 | \newcommand{\setindexsubitem}[1]{\renewcommand{\index@subitem}{#1}} |
| 313 | \newcommand{\ttindex}[1]{\index{#1@{\idxcode{#1}} \index@subitem}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 314 | |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 315 | \newcommand{\withsubitem}[2]{% |
| 316 | \begingroup% |
| 317 | \def\index@subitem{#1}#2% |
| 318 | \endgroup% |
| 319 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 320 | |
Fred Drake | 5371497 | 1998-04-02 22:33:16 +0000 | [diff] [blame] | 321 | |
| 322 | % Now for a lot of semantically-loaded environments that do a ton of magical |
| 323 | % things to get the right formatting and index entries for the stuff in |
| 324 | % Python modules and C API. |
| 325 | |
| 326 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 327 | % {fulllineitems} is used in one place in libregex.tex, but is really for |
| 328 | % internal use in this file. |
| 329 | % |
| 330 | \newenvironment{fulllineitems}{ |
| 331 | \begin{list}{}{\labelwidth \leftmargin \labelsep 0pt |
| 332 | \rightmargin 0pt \topsep -\parskip \partopsep \parskip |
| 333 | \itemsep -\parsep |
| 334 | \let\makelabel=\itemnewline} |
| 335 | }{\end{list}} |
| 336 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 337 | % \optional is mostly for use in the arguments parameters to the various |
| 338 | % {*desc} environments defined below, but may be used elsewhere. Known to |
| 339 | % be used in the debugger chapter. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 340 | \newcommand{\optional}[1]{% |
| 341 | {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}} |
| 342 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 343 | % C functions ------------------------------------------------------------ |
| 344 | % \begin{cfuncdesc}{type}{name}{arglist} |
| 345 | \newenvironment{cfuncdesc}[3]{ |
| 346 | \begin{fulllineitems} |
| 347 | \item[\code{#1 \bfcode{#2}(\varvars{#3})}\index{#2@{\idxcode{#2()}}}] |
| 348 | }{\end{fulllineitems}} |
| 349 | |
| 350 | % C variables ------------------------------------------------------------ |
| 351 | % \begin{cvardesc}{type}{name} |
| 352 | \newenvironment{cvardesc}[2]{ |
| 353 | \begin{fulllineitems} |
| 354 | \item[\code{#1 \bfcode{#2}}\index{#2@{\idxcode{#2}}}] |
| 355 | }{\end{fulllineitems}} |
| 356 | |
| 357 | % C data types ----------------------------------------------------------- |
| 358 | % \begin{ctypedesc}{typedef name} |
| 359 | \newenvironment{ctypedesc}[1]{ |
| 360 | \begin{fulllineitems} |
| 361 | \item[\bfcode{#1}\ttindex{#1}] |
| 362 | }{\end{fulllineitems}} |
| 363 | |
| 364 | % simple functions (not methods) ----------------------------------------- |
| 365 | % \begin{funcdesc}{name}{args} |
| 366 | \newcommand{\funcline}[2]{\funclineni{#1}{#2}\ttindex{#1()}} |
| 367 | \newenvironment{funcdesc}[2]{ |
| 368 | \begin{fulllineitems} |
| 369 | \funcline{#1}{#2} |
| 370 | }{\end{fulllineitems}} |
| 371 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 372 | % similar to {funcdesc}, but doesn't add to the index |
| 373 | \newcommand{\funclineni}[2]{\item[\code{\bfcode{#1}(\varvars{#2})}]} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 374 | \newenvironment{funcdescni}[2]{ |
| 375 | \begin{fulllineitems} |
| 376 | \funclineni{#1}{#2} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 377 | }{\end{fulllineitems}} |
| 378 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 379 | % classes ---------------------------------------------------------------- |
| 380 | % \begin{classdesc}{name}{constructor args} |
| 381 | \newenvironment{classdesc}[2]{ |
| 382 | \global\def\@thisclass{#1} |
| 383 | \begin{fulllineitems} |
| 384 | \item[\code{\bfcode{#1}(\varvars{#2})}% |
| 385 | \withsubitem{(class in \@thismodule)}{\ttindex{#1}}] |
| 386 | \def\baseclasses##1{} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 387 | }{\end{fulllineitems}} |
| 388 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 389 | |
| 390 | \newcommand{\@classbadkey}{--bad current class--} |
| 391 | \let\@classbadkey=\@undefined |
| 392 | |
| 393 | % object method ---------------------------------------------------------- |
| 394 | % \begin{methoddesc}[classname]{methodname}{args} |
| 395 | \newcommand{\methodline}[3][\@classbadkey]{ |
| 396 | \methodlineni{#2}{#3} |
| 397 | \ifx#1\@undefined |
| 398 | \withsubitem{(\@thisclass\ method)}{\ttindex{#2()}} |
| 399 | \else |
| 400 | \withsubitem{(#1 method)}{\ttindex{#2()}} |
| 401 | \fi |
| 402 | } |
| 403 | \newenvironment{methoddesc}[3][\@classbadkey]{ |
| 404 | \begin{fulllineitems} |
| 405 | \ifx#1\@undefined |
| 406 | \methodline{#2}{#3} |
| 407 | \else |
| 408 | \def\@thisclass{#1} |
| 409 | \methodline[#1]{#2}{#3} |
| 410 | \fi |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 411 | }{\end{fulllineitems}} |
| 412 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 413 | % similar to {methoddesc}, but doesn't add to the index |
| 414 | % (never actually uses the optional argument) |
| 415 | \newcommand{\methodlineni}[3][\@classbadkey]{% |
| 416 | \item[\code{\bfcode{#2}(\varvars{#3})}]} |
| 417 | \newenvironment{methoddescni}[3][\@classbadkey]{ |
| 418 | \begin{fulllineitems} |
| 419 | \methodlineni{#2}{#3} |
| 420 | }{\end{fulllineitems}} |
| 421 | |
| 422 | % object data attribute -------------------------------------------------- |
| 423 | % \begin{memberdesc}[classname]{membername} |
| 424 | \newcommand{\memberline}[2][\@classbadkey]{% |
| 425 | \ifx#1\@undefined |
| 426 | \memberlineni{#2} |
| 427 | \withsubitem{(\@thisclass\ attribute)}{\ttindex{#2()}} |
| 428 | \else |
| 429 | \memberlineni{#2} |
| 430 | \withsubitem{(#1 attribute)}{\ttindex{#2()}} |
| 431 | \fi |
| 432 | } |
| 433 | \newenvironment{memberdesc}[2][\@classbadkey]{ |
| 434 | \begin{fulllineitems} |
| 435 | \ifx#1\@undefined |
| 436 | \memberline{#2} |
| 437 | \else |
| 438 | \def\@thisclass{#1} |
| 439 | \memberline[#1]{#2} |
| 440 | \fi |
| 441 | }{\end{fulllineitems}} |
| 442 | |
| 443 | % similar to {memberdesc}, but doesn't add to the index |
| 444 | % (never actually uses the optional argument) |
| 445 | \newcommand{\memberlineni}[2][\@classbadkey]{\item[\bfcode{#2}]} |
| 446 | \newenvironment{memberdescni}[2][\@classbadkey]{ |
| 447 | \begin{fulllineitems} |
| 448 | \memberlineni{#2} |
| 449 | }{\end{fulllineitems}} |
| 450 | |
| 451 | % For exceptions: -------------------------------------------------------- |
| 452 | % \begin{excdesc}{name} |
| 453 | % -- need support for constructor; maybe use optional parameter? |
| 454 | \newenvironment{excdesc}[1]{ |
| 455 | \begin{fulllineitems} |
| 456 | \item[\bfcode{#1}\ttindex{#1}] |
| 457 | }{\end{fulllineitems}} |
| 458 | |
| 459 | % Module data or constants: ---------------------------------------------- |
| 460 | % \begin{datadesc}{name} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 461 | \newcommand{\dataline}[1]{\datalineni{#1}\ttindex{#1}} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 462 | \newenvironment{datadesc}[1]{ |
| 463 | \begin{fulllineitems} |
| 464 | \dataline{#1} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 465 | }{\end{fulllineitems}} |
| 466 | |
| 467 | % similar to {datadesc}, but doesn't add to the index |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 468 | \newcommand{\datalineni}[1]{\item[\bfcode{#1}]\nopagebreak} |
| 469 | \newenvironment{datadescni}[1]{ |
| 470 | \begin{fulllineitems} |
| 471 | \datalineni{#1} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 472 | }{\end{fulllineitems}} |
| 473 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 474 | % bytecode instruction --------------------------------------------------- |
| 475 | % \begin{opcodedesc}{name}{var} |
| 476 | % -- {var} may be {} |
| 477 | \newenvironment{opcodedesc}[2]{ |
| 478 | \begin{fulllineitems} |
| 479 | \item[\bfcode{#1}\quad\var{#2}] |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 480 | }{\end{fulllineitems}} |
| 481 | |
| 482 | |
| 483 | \let\nodename=\label |
| 484 | |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 485 | \newcommand{\sectcode}[1]{{\sectcodefont{#1}}} |
| 486 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 487 | % For these commands, use \command{} to get the typography right, not |
| 488 | % {\command}. This works better with the texinfo translation. |
| 489 | \newcommand{\ABC}{{\sc abc}} |
| 490 | \newcommand{\UNIX}{{\sc Unix}} |
| 491 | \newcommand{\POSIX}{POSIX} |
| 492 | \newcommand{\ASCII}{{\sc ascii}} |
| 493 | \newcommand{\Cpp}{C\protect\raisebox{.18ex}{++}} |
| 494 | \newcommand{\C}{C} |
| 495 | \newcommand{\EOF}{{\sc eof}} |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 496 | \newcommand{\NULL}{\sectcode{NULL}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 497 | |
Fred Drake | 5371497 | 1998-04-02 22:33:16 +0000 | [diff] [blame] | 498 | % Also for consistency: spell Python "Python", not "python"! |
| 499 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 500 | % code is the most difficult one... |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 501 | \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 | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 502 | \mbox{\codefont{#1}}}} |
| 503 | |
| 504 | \newcommand{\bfcode}[1]{\code{\bfseries#1}} % bold-faced code font |
| 505 | \newcommand{\kbd}[1]{\mbox{\tt #1}} |
| 506 | \newcommand{\key}[1]{\mbox{\tt #1}} |
| 507 | \newcommand{\samp}[1]{\mbox{`\code{#1}'}} |
| 508 | % This weird definition of \var{} allows it to always appear in roman |
| 509 | % italics, and won't get funky in code fragments when we play around |
| 510 | % with fonts. |
| 511 | \newcommand{\var}[1]{\mbox{\normalsize\textrm{\textit{#1\/}}}} |
| 512 | \renewcommand{\emph}[1]{{\em #1\/}} |
| 513 | \newcommand{\dfn}[1]{\emph{#1}} |
| 514 | \newcommand{\strong}[1]{{\bf #1}} |
| 515 | % let's experiment with a new font: |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 516 | \newcommand{\file}[1]{`{\small\textsf{#1}}'} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 517 | |
| 518 | % Use this def/redef approach for \url{} since hyperref defined this already, |
| 519 | % but only if we actually used hyperref: |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 520 | \@ifundefined{pdfannotlink}{ |
| 521 | \newcommand{\pythonurl}[1]{\mbox{\small\textsf{#1}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 522 | }{ |
| 523 | \newcommand{\pythonurl}[1]{{% |
| 524 | \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}% |
| 525 | \LinkColor% color of the link text |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 526 | {\small\textsf{#1}}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 527 | \NormalColor% Turn it back off; these are declarative |
| 528 | \pdfendlink}% and don't appear bound to the current |
| 529 | }% formatting "box". |
| 530 | } |
| 531 | \let\url=\pythonurl |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 532 | \newcommand{\email}[1]{{\small\textsf{#1}}} |
Fred Drake | 454a4fb | 1998-04-01 22:20:14 +0000 | [diff] [blame] | 533 | \newcommand{\newsgroup}[1]{{\small\textsf{#1}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 534 | |
| 535 | \newcommand{\varvars}[1]{{\def\,{\/{\char`\,}}\var{#1}}} |
| 536 | |
| 537 | \newif\iftexi\texifalse |
| 538 | \newif\iflatex\latextrue |
| 539 | |
| 540 | % These should be used for all references to identifiers which are |
| 541 | % used to refer to instances of specific language constructs. See the |
| 542 | % names for specific semantic assignments. |
| 543 | % |
| 544 | % For now, don't do anything really fancy with them; just use them as |
| 545 | % logical markup. This might change in the future. |
| 546 | % |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 547 | \let\module=\sectcode |
| 548 | \let\keyword=\sectcode |
| 549 | \let\exception=\sectcode |
| 550 | \let\class=\sectcode |
| 551 | \let\function=\sectcode |
| 552 | \let\member=\sectcode |
| 553 | \let\method=\sectcode |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 554 | |
Fred Drake | 5371497 | 1998-04-02 22:33:16 +0000 | [diff] [blame] | 555 | \newcommand{\pytype}[1]{#1} % built-in Python type |
| 556 | |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 557 | \let\cfunction=\sectcode |
| 558 | \let\ctype=\sectcode |
| 559 | \let\cdata=\sectcode |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 560 | |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 561 | \newcommand{\mimetype}[1]{{\small\textsf{#1}}} |
Fred Drake | 94fac13 | 1998-03-12 19:37:03 +0000 | [diff] [blame] | 562 | % The \! is a "negative thin space" in math mode. |
| 563 | \newcommand{\regexp}[1]{% |
| 564 | {\tiny$^{^\lceil}\!\!$% |
| 565 | {\normalsize\code{#1}}% |
Fred Drake | 47cfd03 | 1998-04-03 21:22:31 +0000 | [diff] [blame] | 566 | $\!\rfloor\!$% |
Fred Drake | 94fac13 | 1998-03-12 19:37:03 +0000 | [diff] [blame] | 567 | }} |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 568 | \newcommand{\envvar}[1]{% |
Fred Drake | 94fac13 | 1998-03-12 19:37:03 +0000 | [diff] [blame] | 569 | \$#1% $ <-- bow to font-lock 3 times! |
| 570 | \index{#1@{\$#1}}% $ |
| 571 | \index{environment variables!{\$#1}}% $ |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 572 | } |
Fred Drake | f14e2f8 | 1998-04-02 16:09:02 +0000 | [diff] [blame] | 573 | \newcommand{\makevar}[1]{#1} |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 574 | \let\character=\samp |
| 575 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 576 | % constants defined in Python modules or C headers, not language constants: |
Fred Drake | f14e2f8 | 1998-04-02 16:09:02 +0000 | [diff] [blame] | 577 | \let\constant=\sectcode |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 578 | |
| 579 | \newcommand{\manpage}[2]{{\emph{#1}(#2)}} |
| 580 | \newcommand{\rfc}[1]{RFC #1\index{RFC!RFC #1}} |
| 581 | \newcommand{\program}[1]{\strong{#1}} |
| 582 | |
| 583 | |
| 584 | % Deprecation stuff. |
| 585 | % Should be extended to allow an index / list of deprecated stuff. But |
| 586 | % there's a lot of stuff that needs to be done to make that automatable. |
| 587 | % |
| 588 | % First parameter is the release number that deprecates the feature, the |
| 589 | % second is the action the should be taken by users of the feature. |
| 590 | % |
| 591 | % Example: |
| 592 | % |
| 593 | % \deprecated {1.5.1} |
| 594 | % {Use \method{frobnicate()} instead.} |
| 595 | % |
| 596 | \newcommand{\deprecated}[2]{% |
| 597 | \strong{Deprecated since release #1.} #2\par} |
| 598 | |
| 599 | |
| 600 | \newenvironment{tableii}[4]{% |
| 601 | \begin{center}% |
| 602 | \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}% |
| 603 | \begin{tabular}{#1}\hline \strong{#3}&\strong{#4} \\ \hline% |
| 604 | }{% |
| 605 | \hline% |
| 606 | \end{tabular}% |
| 607 | \end{center}% |
| 608 | } |
| 609 | |
| 610 | \newenvironment{tableiii}[5]{% |
| 611 | \begin{center}% |
| 612 | \def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}% |
| 613 | \begin{tabular}{#1}\hline \strong{#3}&\strong{#4}&\strong{#5} \\ \hline% |
| 614 | }{% |
| 615 | \hline% |
| 616 | \end{tabular}% |
| 617 | \end{center}% |
| 618 | } |
| 619 | |
| 620 | \newcommand{\itemnewline}[1]{% |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 621 | \@tempdima\linewidth% |
| 622 | \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 623 | } |
| 624 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 625 | % Cross-referencing (AMK) |
| 626 | % Sample usage: |
| 627 | % \begin{seealso} |
| 628 | % \seemodule{rand}{Uniform random number generator}; % Module xref |
| 629 | % \seetext{\emph{Encyclopedia Britannica}}. % Ref to a book |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 630 | % |
| 631 | % % A funky case: module name contains '_'; have to supply an optional key |
| 632 | % \seemodule[copyreg]{copy_reg}{pickle interface constructor registration} |
| 633 | % |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 634 | % \end{seealso} |
| 635 | |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 636 | \newcommand{\@modulebadkey}{{--just-some-junk--}} |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 637 | |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 638 | \@ifundefined{pdfannotlink}{% |
| 639 | \newcommand{\seemodule}[3][\@modulebadkey]{% |
| 640 | \ifx\@modulebadkey#1\def\@modulekey{#2}\else\def\@modulekey{#1}\fi% |
| 641 | \ref{module-\@modulekey}:\quad % |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 642 | Module \module{#2}% |
| 643 | \quad (#3)% |
| 644 | } |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 645 | }{\newcommand{\seemodule}[3][\@modulebadkey]{% |
| 646 | \ifx\@modulebadkey#1\def\@modulekey{#2}\else\def\@modulekey{#1}\fi% |
| 647 | \ref{module-\@modulekey}:\quad % |
| 648 | {\pdfannotlink attr{/Border [0 0 0]} goto name{label.module-\@modulekey}% |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 649 | \LinkColor Module \module{#2} \NormalColor% |
| 650 | \pdfendlink% |
| 651 | }% |
| 652 | \quad (#3)% |
| 653 | } |
| 654 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 655 | \newenvironment{seealso}[0]{ |
| 656 | \strong{See Also:}\par |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 657 | \def\seetext##1{\par{##1}} |
| 658 | }{\par} |
| 659 | |
| 660 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 661 | % Allow the release number to be specified independently of the |
| 662 | % \date{}. This allows the date to reflect the document's date and |
| 663 | % release to specify the Python release that is documented. |
| 664 | % |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 665 | \newcommand{\@release}{} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 666 | \newcommand{\version}{} |
| 667 | \newcommand{\releasename}{Release} |
| 668 | \newcommand{\release}[1]{% |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 669 | \renewcommand{\@release}{\releasename\space\version}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 670 | \renewcommand{\version}{#1}} |
| 671 | |
| 672 | % Allow specification of the author's address separately from the |
| 673 | % author's name. This can be used to format them differently, which |
| 674 | % is a good thing. |
| 675 | % |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 676 | \newcommand{\@authoraddress}{} |
| 677 | \newcommand{\authoraddress}[1]{\renewcommand{\@authoraddress}{#1}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 678 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 679 | % This sets up the fancy chapter headings that make the documents look |
| 680 | % at least a little better than the usual LaTeX output. |
| 681 | % |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 682 | \@ifundefined{ChTitleVar}{}{ |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 683 | \ChNameVar{\raggedleft\normalsize\HeaderFamily} |
| 684 | \ChNumVar{\raggedleft \bfseries\Large\HeaderFamily} |
| 685 | \ChTitleVar{\raggedleft \rm\Huge\HeaderFamily} |
| 686 | % This creates chapter heads without the leading \vspace*{}: |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 687 | \def\@makechapterhead#1{% |
| 688 | {\parindent \z@ \raggedright \normalfont |
| 689 | \ifnum \c@secnumdepth >\m@ne |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 690 | \DOCH |
| 691 | \fi |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 692 | \interlinepenalty\@M |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 693 | \DOTI{#1} |
| 694 | } |
| 695 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 696 | } |
| 697 | |
| 698 | % Tell TeX about pathological hyphenation cases: |
| 699 | \hyphenation{Base-HTTP-Re-quest-Hand-ler} |