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 | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 9 | \RequirePackage{longtable} |
| 10 | |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 11 | % Uncomment these two lines to ignore the paper size and make the page |
| 12 | % size more like a typical published manual. |
| 13 | %\renewcommand{\paperheight}{9in} |
| 14 | %\renewcommand{\paperwidth}{8.5in} % typical squarish manual |
| 15 | %\renewcommand{\paperwidth}{7in} % O'Reilly ``Programmming Python'' |
| 16 | |
Fred Drake | 454a4fb | 1998-04-01 22:20:14 +0000 | [diff] [blame] | 17 | % These packages can be used to add marginal annotations which indicate |
| 18 | % index entries and labels; useful for reviewing this messy documentation! |
| 19 | % |
| 20 | %\RequirePackage{showkeys} |
| 21 | %\RequirePackage{showidx} |
| 22 | |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 23 | % for PDF output, use maximal compression & a lot of other stuff |
| 24 | % (test for PDF recommended by Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov>) |
| 25 | % |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 26 | \newif\ifpy@doing@page@targets |
| 27 | \py@doing@page@targetsfalse |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 28 | |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 29 | \ifx\pdfoutput\undefined\else\ifcase\pdfoutput |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 30 | \else |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 31 | \input{pdfcolor} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 32 | \let\py@LinkColor=\NavyBlue |
| 33 | \let\py@NormalColor=\Black |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 34 | \pdfcompresslevel=9 |
Fred Drake | ba1700c | 1998-05-11 20:42:54 +0000 | [diff] [blame] | 35 | \pdfpagewidth=\paperwidth % page width of PDF output |
| 36 | \pdfpageheight=\paperheight % page height of PDF output |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 37 | % |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 38 | % Pad the number with '0' to 3 digits wide so no page name is a prefix |
| 39 | % of any other. |
| 40 | % |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 41 | \newcommand{\py@targetno}[1]{\ifnum#1<100 0\fi\ifnum#1<10 0\fi#1} |
| 42 | \newcommand{\py@pageno}{\py@targetno\thepage} |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 43 | % |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 44 | % This definition allows the entries in the page-view of the ToC to be |
| 45 | % active links. Some work, some don't. |
| 46 | % |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 47 | \let\py@OldContentsline=\contentsline |
Fred Drake | aa2aea0 | 1999-01-27 17:37:36 +0000 | [diff] [blame] | 48 | % |
| 49 | % Macro that takes two args: the name to link to and the content of |
| 50 | % the link. This takes care of the PDF magic, getting the colors |
| 51 | % the same for each link, and avoids having lots of garbage all over |
| 52 | % this style file. |
| 53 | \newcommand{\py@linkToName}[2]{% |
| 54 | \pdfannotlink attr{/Border [0 0 0]} goto name{#1}% |
| 55 | \py@LinkColor#2\py@NormalColor% |
| 56 | \pdfendlink% |
| 57 | } |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 58 | % Compute the padded page number separately since we end up with a pair of |
| 59 | % \relax tokens; this gets the right string computed and works. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 60 | \renewcommand{\contentsline}[3]{% |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 61 | \def\my@pageno{\py@targetno{#3}}% |
Fred Drake | aa2aea0 | 1999-01-27 17:37:36 +0000 | [diff] [blame] | 62 | \py@OldContentsline{#1}{\py@linkToName{page\my@pageno}{#2}}{#3}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 63 | } |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 64 | \AtEndDocument{ |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 65 | \InputIfFileExists{\jobname.bkm}{\pdfcatalog{/PageMode /UseOutlines}}{} |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 66 | } |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 67 | \newcommand{\py@target}[1]{% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 68 | \ifpy@doing@page@targets% |
Fred Drake | 9b8afde | 1999-03-24 14:16:17 +0000 | [diff] [blame] | 69 | {\pdfdest name{#1} xyz}% |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 70 | \fi% |
| 71 | } |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 72 | \let\py@OldLabel=\label |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 73 | \renewcommand{\label}[1]{% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 74 | \py@OldLabel{#1}% |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 75 | \py@target{label-#1}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 76 | } |
Fred Drake | ba1700c | 1998-05-11 20:42:54 +0000 | [diff] [blame] | 77 | % This stuff adds a page# destination to every PDF page, where # is three |
| 78 | % digits wide, padded with leading zeros. This doesn't really help with |
| 79 | % the frontmatter, but does fine with the body. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 80 | % |
| 81 | % This is *heavily* based on the hyperref package. |
| 82 | % |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 83 | \def\@begindvi{% |
| 84 | \unvbox \@begindvibox |
| 85 | \@hyperfixhead |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 86 | } |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 87 | \def\@hyperfixhead{% |
| 88 | \let\H@old@thehead\@thehead |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 89 | \global\def\@foo{\py@target{page\py@pageno}}% |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 90 | \expandafter\ifx\expandafter\@empty\H@old@thehead |
| 91 | \def\H@old@thehead{\hfil}\fi |
| 92 | \def\@thehead{\@foo\relax\H@old@thehead}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 93 | } |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 94 | \fi\fi |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 95 | |
| 96 | % Increase printable page size (copied from fullpage.sty) |
| 97 | \topmargin 0pt |
| 98 | \advance \topmargin by -\headheight |
| 99 | \advance \topmargin by -\headsep |
| 100 | |
| 101 | % attempt to work a little better for A4 users |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 102 | \textheight \paperheight |
| 103 | \advance\textheight by -2in |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 104 | |
| 105 | \oddsidemargin 0pt |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 106 | \evensidemargin 0pt |
| 107 | %\evensidemargin -.25in % for ``manual size'' documents |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 108 | \marginparwidth 0.5in |
| 109 | |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 110 | \textwidth \paperwidth |
| 111 | \advance\textwidth by -2in |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 112 | |
| 113 | |
| 114 | % Style parameters and macros used by most documents here |
| 115 | \raggedbottom |
| 116 | \sloppy |
| 117 | \parindent = 0mm |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 118 | \parskip = 2mm |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 119 | \hbadness = 5000 % don't print trivial gripes |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 120 | |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 121 | \pagestyle{empty} % start this way; change for |
| 122 | \pagenumbering{roman} % ToC & chapters |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 123 | |
| 124 | % Use this to set the font family for headers and other decor: |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 125 | \newcommand{\py@HeaderFamily}{\sffamily} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 126 | |
| 127 | % Redefine the 'normal' header/footer style when using "fancyhdr" package: |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 128 | \@ifundefined{fancyhf}{}{ |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 129 | % Use \pagestyle{normal} as the primary pagestyle for text. |
| 130 | \fancypagestyle{normal}{ |
| 131 | \fancyhf{} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 132 | \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} |
| 133 | \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}} |
| 134 | \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 135 | \renewcommand{\headrulewidth}{0pt} |
| 136 | \renewcommand{\footrulewidth}{0.4pt} |
| 137 | } |
| 138 | % Update the plain style so we get the page number & footer line, |
| 139 | % but not a chapter or section title. This is to keep the first |
| 140 | % page of a chapter and the blank page between chapters `clean.' |
| 141 | \fancypagestyle{plain}{ |
| 142 | \fancyhf{} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 143 | \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 144 | \renewcommand{\headrulewidth}{0pt} |
| 145 | \renewcommand{\footrulewidth}{0.4pt} |
| 146 | } |
| 147 | % Redefine \cleardoublepage so that the blank page between chapters |
| 148 | % gets the plain style and not the fancy style. This is described |
| 149 | % in the documentation for the fancyhdr package by Piet von Oostrum. |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 150 | \@ifundefined{chapter}{}{ |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 151 | \renewcommand{\cleardoublepage}{ |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 152 | \clearpage\if@openright \ifodd\c@page\else |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 153 | \hbox{} |
| 154 | \thispagestyle{plain} |
| 155 | \newpage |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 156 | \if@twocolumn\hbox{}\newpage\fi\fi\fi |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 157 | } |
| 158 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 159 | } |
| 160 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 161 | % This sets up the {verbatim} environment to be indented and a minipage, |
| 162 | % and to have all the other mostly nice properties that we want for |
| 163 | % code samples. |
| 164 | |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 165 | \let\py@OldVerbatim=\verbatim |
| 166 | \let\py@OldEndVerbatim=\endverbatim |
| 167 | \RequirePackage{verbatim} |
| 168 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 169 | % Variable used by begin code command |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 170 | \newlength{\py@codewidth} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 171 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 172 | \renewcommand{\verbatim}{% |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 173 | \setlength{\parindent}{1cm}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 174 | % Calculate the text width for the minipage: |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 175 | \setlength{\py@codewidth}{\linewidth}% |
| 176 | \addtolength{\py@codewidth}{-\parindent}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 177 | % |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 178 | \par\indent% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 179 | \begin{minipage}[t]{\py@codewidth}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 180 | \small% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 181 | \py@OldVerbatim% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 182 | } |
| 183 | \renewcommand{\endverbatim}{% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 184 | \py@OldEndVerbatim% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 185 | \end{minipage}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 186 | } |
| 187 | |
Fred Drake | b5309a9 | 2001-04-10 15:53:06 +0000 | [diff] [blame] | 188 | % This does a similar thing for the {alltt} environment: |
| 189 | \RequirePackage{alltt} |
| 190 | \let\py@OldAllTT=\alltt |
| 191 | \let\py@OldEndAllTT=\endalltt |
| 192 | |
| 193 | \renewcommand{\alltt}{% |
| 194 | \setlength{\parindent}{1cm}% |
| 195 | % Calculate the text width for the minipage: |
| 196 | \setlength{\py@codewidth}{\linewidth}% |
| 197 | \addtolength{\py@codewidth}{-\parindent}% |
| 198 | % |
| 199 | \par\indent% |
| 200 | \begin{minipage}[t]{\py@codewidth}% |
| 201 | \small% |
| 202 | \py@OldAllTT% |
| 203 | } |
| 204 | \renewcommand{\endalltt}{% |
| 205 | \py@OldEndAllTT% |
| 206 | \end{minipage}% |
| 207 | } |
| 208 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 209 | |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 210 | \newcommand{\py@modulebadkey}{{--just-some-junk--}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 211 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 212 | |
| 213 | %% Lots of index-entry generation support. |
| 214 | |
| 215 | % Command to wrap around stuff that refers to function / module / |
| 216 | % attribute names in the index. Default behavior: like \code{}. To |
| 217 | % just keep the index entries in the roman font, uncomment the second |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 218 | % definition; it matches O'Reilly style more. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 219 | % |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 220 | \newcommand{\py@idxcode}[1]{\texttt{#1}} |
| 221 | %\renewcommand{\py@idxcode}[1]{#1} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 222 | |
| 223 | % Command to generate two index entries (using subentries) |
| 224 | \newcommand{\indexii}[2]{\index{#1!#2}\index{#2!#1}} |
| 225 | |
| 226 | % And three entries (using only one level of subentries) |
| 227 | \newcommand{\indexiii}[3]{\index{#1!#2 #3}\index{#2!#3, #1}\index{#3!#1 #2}} |
| 228 | |
| 229 | % And four (again, using only one level of subentries) |
| 230 | \newcommand{\indexiv}[4]{ |
| 231 | \index{#1!#2 #3 #4} |
| 232 | \index{#2!#3 #4, #1} |
| 233 | \index{#3!#4, #1 #2} |
| 234 | \index{#4!#1 #2 #3} |
| 235 | } |
| 236 | |
| 237 | % Command to generate a reference to a function, statement, keyword, |
| 238 | % operator. |
Fred Drake | 0cabff9 | 1998-05-06 19:36:01 +0000 | [diff] [blame] | 239 | \newcommand{\kwindex}[1]{\indexii{keyword}{#1@{\py@idxcode{#1}}}} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 240 | \newcommand{\stindex}[1]{\indexii{statement}{#1@{\py@idxcode{#1}}}} |
| 241 | \newcommand{\opindex}[1]{\indexii{operator}{#1@{\py@idxcode{#1}}}} |
| 242 | \newcommand{\exindex}[1]{\indexii{exception}{#1@{\py@idxcode{#1}}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 243 | \newcommand{\obindex}[1]{\indexii{object}{#1}} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 244 | \newcommand{\bifuncindex}[1]{% |
| 245 | \index{#1@{\py@idxcode{#1()}} (built-in function)}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 246 | |
| 247 | % Add an index entry for a module |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 248 | \newcommand{\py@refmodule}[2]{\index{#1@{\py@idxcode{#1}} (#2module)}} |
| 249 | \newcommand{\refmodindex}[1]{\py@refmodule{#1}{}} |
| 250 | \newcommand{\refbimodindex}[1]{\py@refmodule{#1}{built-in }} |
| 251 | \newcommand{\refexmodindex}[1]{\py@refmodule{#1}{extension }} |
| 252 | \newcommand{\refstmodindex}[1]{\py@refmodule{#1}{standard }} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 253 | |
Fred Drake | da94374 | 1999-01-13 17:09:06 +0000 | [diff] [blame] | 254 | % Refer to a module's documentation using a hyperlink of the module's |
| 255 | % name, at least if we're building PDF: |
| 256 | \@ifundefined{pdfannotlink}{% |
| 257 | \newcommand{\refmodule}[2][\py@modulebadkey]{\module{#2}} |
Fred Drake | aa2aea0 | 1999-01-27 17:37:36 +0000 | [diff] [blame] | 258 | }{% |
| 259 | \newcommand{\refmodule}[2][\py@modulebadkey]{% |
Fred Drake | da94374 | 1999-01-13 17:09:06 +0000 | [diff] [blame] | 260 | \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi% |
Fred Drake | aa2aea0 | 1999-01-27 17:37:36 +0000 | [diff] [blame] | 261 | \py@linkToName{label-module-\py@modulekey}{\module{#2}}% |
Fred Drake | da94374 | 1999-01-13 17:09:06 +0000 | [diff] [blame] | 262 | } |
| 263 | } |
| 264 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 265 | % support for the module index |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 266 | \newif\ifpy@UseModuleIndex |
| 267 | \py@UseModuleIndexfalse |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 268 | |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 269 | \newcommand{\makemodindex}{ |
| 270 | \newwrite\modindexfile |
| 271 | \openout\modindexfile=mod\jobname.idx |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 272 | \py@UseModuleIndextrue |
Fred Drake | b390daf | 1998-03-09 16:35:36 +0000 | [diff] [blame] | 273 | } |
| 274 | |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 275 | % Add the defining entry for a module |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 276 | \newcommand{\py@modindex}[2]{% |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 277 | \renewcommand{\py@thismodule}{#1} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 278 | \setindexsubitem{(in module #1)}% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 279 | \index{#1@{\py@idxcode{#1}} (#2module)|textbf}% |
| 280 | \ifpy@UseModuleIndex% |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 281 | \@ifundefined{py@modplat@\py@thismodulekey}{ |
| 282 | \write\modindexfile{\protect\indexentry{#1@{\texttt{#1}}}{\thepage}}% |
| 283 | }{\write\modindexfile{\protect\indexentry{#1@{\texttt{#1} % |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 284 | \emph{(\py@platformof[\py@thismodulekey]{})}}}{\thepage}}% |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 285 | } |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 286 | \fi% |
| 287 | } |
| 288 | |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 289 | % *** XXX *** THE NEXT FOUR MACROS ARE NOW OBSOLETE !!! *** |
| 290 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 291 | % built-in & Python modules in the main distribution |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 292 | \newcommand{\bimodindex}[1]{\py@modindex{#1}{built-in }% |
| 293 | \typeout{*** MACRO bimodindex IS OBSOLETE -- USE declaremodule INSTEAD!}} |
| 294 | \newcommand{\stmodindex}[1]{\py@modindex{#1}{standard }% |
| 295 | \typeout{*** MACRO stmodindex IS OBSOLETE -- USE declaremodule INSTEAD!}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 296 | |
| 297 | % Python & extension modules outside the main distribution |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 298 | \newcommand{\modindex}[1]{\py@modindex{#1}{}% |
| 299 | \typeout{*** MACRO modindex IS OBSOLETE -- USE declaremodule INSTEAD!}} |
| 300 | \newcommand{\exmodindex}[1]{\py@modindex{#1}{extension }% |
| 301 | \typeout{*** MACRO exmodindex IS OBSOLETE -- USE declaremodule INSTEAD!}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 302 | |
| 303 | % Additional string for an index entry |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 304 | \newif\ifpy@usingsubitem\py@usingsubitemfalse |
| 305 | \newcommand{\py@indexsubitem}{} |
| 306 | \newcommand{\setindexsubitem}[1]{\renewcommand{\py@indexsubitem}{ #1}% |
| 307 | \py@usingsubitemtrue} |
| 308 | \newcommand{\ttindex}[1]{% |
| 309 | \ifpy@usingsubitem |
| 310 | \index{#1@{\py@idxcode{#1}}\py@indexsubitem}% |
| 311 | \else% |
| 312 | \index{#1@{\py@idxcode{#1}}}% |
| 313 | \fi% |
| 314 | } |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 315 | \newcommand{\withsubitem}[2]{% |
| 316 | \begingroup% |
Fred Drake | ec77e65 | 2000-10-30 06:22:22 +0000 | [diff] [blame] | 317 | \def\ttindex##1{\index{##1@{\py@idxcode{##1}} #1}}% |
| 318 | #2% |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 319 | \endgroup% |
| 320 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 321 | |
Fred Drake | 5371497 | 1998-04-02 22:33:16 +0000 | [diff] [blame] | 322 | |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 323 | % Module synopsis processing ----------------------------------------------- |
| 324 | % |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 325 | \newcommand{\py@thisclass}{} |
| 326 | \newcommand{\py@thismodule}{} |
| 327 | \newcommand{\py@thismodulekey}{} |
| 328 | \newcommand{\py@thismoduletype}{} |
| 329 | |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 330 | \newcommand{\py@standardIndexModule}[1]{\py@modindex{#1}{standard }} |
| 331 | \newcommand{\py@builtinIndexModule}[1]{\py@modindex{#1}{built-in }} |
| 332 | \newcommand{\py@extensionIndexModule}[1]{\py@modindex{#1}{extension }} |
| 333 | \newcommand{\py@IndexModule}[1]{\py@modindex{#1}{}} |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 334 | |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 335 | \newif\ifpy@HaveModSynopsis \py@HaveModSynopsisfalse |
| 336 | \newif\ifpy@ModSynopsisFileIsOpen \py@ModSynopsisFileIsOpenfalse |
| 337 | \newif\ifpy@HaveModPlatform \py@HaveModPlatformfalse |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 338 | |
| 339 | % \declaremodule[key]{type}{name} |
| 340 | \newcommand{\declaremodule}[3][\py@modulebadkey]{ |
| 341 | \py@openModSynopsisFile |
| 342 | \renewcommand{\py@thismoduletype}{#2} |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 343 | \ifx\py@modulebadkey#1 |
| 344 | \renewcommand{\py@thismodulekey}{#3} |
| 345 | \else |
| 346 | \renewcommand{\py@thismodulekey}{#1} |
| 347 | \fi |
Fred Drake | 5bc8d99 | 1999-05-17 14:47:10 +0000 | [diff] [blame] | 348 | \@ifundefined{py@#2IndexModule}{% |
| 349 | \typeout{*** MACRO declaremodule called with unknown module type: `#2'} |
Fred Drake | 6682302 | 1999-05-17 14:57:26 +0000 | [diff] [blame] | 350 | \py@IndexModule{#3}% |
Fred Drake | 5bc8d99 | 1999-05-17 14:47:10 +0000 | [diff] [blame] | 351 | }{% |
| 352 | \csname py@#2IndexModule\endcsname{#3}% |
| 353 | } |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 354 | \label{module-\py@thismodulekey} |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 355 | } |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 356 | \newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse |
| 357 | \newcommand{\py@ModPlatformFilename}{\jobname.pla} |
| 358 | \newcommand{\platform}[1]{ |
| 359 | \ifpy@ModPlatformFileIsOpen\else |
| 360 | \newwrite\py@ModPlatformFile |
| 361 | \openout\py@ModPlatformFile=\py@ModPlatformFilename |
| 362 | \py@ModPlatformFileIsOpentrue |
| 363 | \fi |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 364 | } |
| 365 | \InputIfFileExists{\jobname.pla}{}{} |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 366 | \newcommand{\py@platformof}[2][\py@modulebadkey]{% |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 367 | \ifx\py@modulebadkey#1 \def\py@key{#2}% |
| 368 | \else \def\py@key{#1}% |
| 369 | \fi% |
| 370 | \csname py@modplat@\py@key\endcsname% |
| 371 | } |
| 372 | \newcommand{\ignorePlatformAnnotation}[1]{} |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 373 | |
Fred Drake | b75c615 | 1998-08-10 18:41:43 +0000 | [diff] [blame] | 374 | % \moduleauthor{name}{email} |
| 375 | \newcommand{\moduleauthor}[2]{} |
| 376 | |
| 377 | % \sectionauthor{name}{email} |
| 378 | \newcommand{\sectionauthor}[2]{} |
| 379 | |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 380 | |
| 381 | \newcommand{\py@defsynopsis}{Module has no synopsis.} |
| 382 | \newcommand{\py@modulesynopsis}{\py@defsynopsis} |
| 383 | \newcommand{\modulesynopsis}[1]{ |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 384 | \py@HaveModSynopsistrue |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 385 | \renewcommand{\py@modulesynopsis}{#1} |
| 386 | } |
| 387 | |
| 388 | % define the file |
| 389 | \newwrite\py@ModSynopsisFile |
| 390 | |
| 391 | % hacked from \addtocontents from latex.ltx: |
| 392 | \long\def\py@writeModSynopsisFile#1{% |
| 393 | \protected@write\py@ModSynopsisFile% |
| 394 | {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}% |
| 395 | {\string#1}% |
| 396 | } |
| 397 | \newcommand{\py@closeModSynopsisFile}{ |
| 398 | \ifpy@ModSynopsisFileIsOpen |
| 399 | \closeout\py@ModSynopsisFile |
| 400 | \py@ModSynopsisFileIsOpenfalse |
| 401 | \fi |
| 402 | } |
| 403 | \newcommand{\py@openModSynopsisFile}{ |
| 404 | \ifpy@ModSynopsisFileIsOpen\else |
| 405 | \openout\py@ModSynopsisFile=\py@ModSynopsisFilename |
| 406 | \py@ModSynopsisFileIsOpentrue |
| 407 | \fi |
| 408 | } |
| 409 | |
| 410 | \newcommand{\py@ProcessModSynopsis}{ |
| 411 | \ifpy@HaveModSynopsis |
| 412 | \py@writeModSynopsisFile{\modulesynopsis% |
| 413 | {\py@thismodulekey}{\py@thismodule}% |
| 414 | {\py@thismoduletype}{\py@modulesynopsis}}% |
| 415 | \py@HaveModSynopsisfalse |
| 416 | \fi |
| 417 | \renewcommand{\py@modulesynopsis}{\py@defsynopsis} |
| 418 | } |
| 419 | \AtEndDocument{\py@ProcessModSynopsis\py@closeModSynopsisFile} |
| 420 | |
Fred Drake | 0c275fa | 1999-03-02 16:17:44 +0000 | [diff] [blame] | 421 | |
| 422 | \long\def\py@writeModPlatformFile#1{% |
| 423 | \protected@write\py@ModPlatformFile% |
| 424 | {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}% |
| 425 | {\string#1}% |
| 426 | } |
| 427 | |
| 428 | |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 429 | \newcommand{\localmoduletable}{ |
| 430 | \IfFileExists{\py@ModSynopsisFilename}{ |
| 431 | \begin{synopsistable} |
| 432 | \input{\py@ModSynopsisFilename} |
| 433 | \end{synopsistable} |
| 434 | }{} |
| 435 | } |
| 436 | |
| 437 | \@ifundefined{pdfoutput}{ |
| 438 | \newcommand{\py@ModSynopsisSummary}[4]{\bfcode{#2} & #4\\} |
| 439 | }{ |
Fred Drake | aa2aea0 | 1999-01-27 17:37:36 +0000 | [diff] [blame] | 440 | \newcommand{\py@ModSynopsisSummary}[4]{% |
| 441 | \py@linkToName{label-module-#1}{\bfcode{#2}} & #4\\ |
| 442 | } |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 443 | } |
| 444 | \newenvironment{synopsistable}{ |
| 445 | % key, name, type, synopsis |
| 446 | \let\modulesynopsis=\py@ModSynopsisSummary |
| 447 | \begin{tabular}{ll} |
| 448 | }{ |
| 449 | \end{tabular} |
| 450 | } |
| 451 | % |
| 452 | % -------------------------------------------------------------------------- |
| 453 | |
| 454 | |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 455 | \newcommand{\py@reset}{ |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 456 | \py@usingsubitemfalse |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 457 | \py@ProcessModSynopsis |
| 458 | \renewcommand{\py@thisclass}{} |
| 459 | \renewcommand{\py@thismodule}{} |
| 460 | \renewcommand{\py@thismodulekey}{} |
| 461 | \renewcommand{\py@thismoduletype}{} |
| 462 | } |
| 463 | |
| 464 | % Augment the sectioning commands used to get our own font family in place, |
| 465 | % and reset some internal data items: |
| 466 | \renewcommand{\section}{\py@reset% |
| 467 | \@startsection{section}{1}{\z@}% |
| 468 | {-3.5ex \@plus -1ex \@minus -.2ex}% |
| 469 | {2.3ex \@plus.2ex}% |
| 470 | {\reset@font\Large\py@HeaderFamily}} |
| 471 | \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}% |
| 472 | {-3.25ex\@plus -1ex \@minus -.2ex}% |
| 473 | {1.5ex \@plus .2ex}% |
| 474 | {\reset@font\large\py@HeaderFamily}} |
| 475 | \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}% |
| 476 | {-3.25ex\@plus -1ex \@minus -.2ex}% |
| 477 | {1.5ex \@plus .2ex}% |
| 478 | {\reset@font\normalsize\py@HeaderFamily}} |
| 479 | \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}% |
| 480 | {3.25ex \@plus1ex \@minus.2ex}% |
| 481 | {-1em}% |
| 482 | {\reset@font\normalsize\py@HeaderFamily}} |
| 483 | \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\parindent}% |
| 484 | {3.25ex \@plus1ex \@minus .2ex}% |
| 485 | {-1em}% |
| 486 | {\reset@font\normalsize\py@HeaderFamily}} |
| 487 | |
| 488 | |
Fred Drake | 5420f33 | 1998-07-23 21:41:02 +0000 | [diff] [blame] | 489 | % This gets the underscores closer to the right width; the only change |
| 490 | % from standard LaTeX is the width specified. |
| 491 | |
| 492 | \DeclareTextCommandDefault{\textunderscore}{% |
| 493 | \leavevmode \kern.06em\vbox{\hrule\@width.55em}} |
| 494 | |
Fred Drake | a488f30 | 1998-07-23 17:50:45 +0000 | [diff] [blame] | 495 | % Underscore hack (only act like subscript operator if in math mode) |
| 496 | % |
| 497 | % The following is due to Mark Wooding (the old version didn't work with |
| 498 | % Latex 2e. |
| 499 | |
| 500 | \DeclareRobustCommand\hackscore{% |
| 501 | \ifmmode_\else\textunderscore\fi% |
| 502 | } |
| 503 | \begingroup |
| 504 | \catcode`\_\active |
| 505 | \def\next{% |
| 506 | \AtBeginDocument{\catcode`\_\active\def_{\hackscore{}}}% |
| 507 | } |
| 508 | \expandafter\endgroup\next |
| 509 | |
| 510 | |
Fred Drake | 5371497 | 1998-04-02 22:33:16 +0000 | [diff] [blame] | 511 | % Now for a lot of semantically-loaded environments that do a ton of magical |
| 512 | % things to get the right formatting and index entries for the stuff in |
| 513 | % Python modules and C API. |
| 514 | |
| 515 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 516 | % {fulllineitems} is used in one place in libregex.tex, but is really for |
| 517 | % internal use in this file. |
| 518 | % |
Fred Drake | f9acc59 | 1998-09-09 15:27:43 +0000 | [diff] [blame] | 519 | \newcommand{\py@itemnewline}[1]{% |
| 520 | \@tempdima\linewidth% |
| 521 | \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}% |
| 522 | } |
| 523 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 524 | \newenvironment{fulllineitems}{ |
| 525 | \begin{list}{}{\labelwidth \leftmargin \labelsep 0pt |
| 526 | \rightmargin 0pt \topsep -\parskip \partopsep \parskip |
| 527 | \itemsep -\parsep |
Fred Drake | f9acc59 | 1998-09-09 15:27:43 +0000 | [diff] [blame] | 528 | \let\makelabel=\py@itemnewline} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 529 | }{\end{list}} |
| 530 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 531 | % \optional is mostly for use in the arguments parameters to the various |
| 532 | % {*desc} environments defined below, but may be used elsewhere. Known to |
| 533 | % be used in the debugger chapter. |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 534 | % |
| 535 | % Typical usage: |
| 536 | % |
| 537 | % \begin{funcdesc}{myfunc}{reqparm\optional{, optparm}} |
| 538 | % ^^^ ^^^ |
| 539 | % No space here No space here |
| 540 | % |
| 541 | % When a function has multiple optional parameters, \optional should be |
| 542 | % nested, not chained. This is right: |
| 543 | % |
| 544 | % \begin{funcdesc}{myfunc}{\optional{parm1\optional{, parm2}}} |
| 545 | % |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 546 | \let\py@badkey=\@undefined |
| 547 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 548 | \newcommand{\optional}[1]{% |
| 549 | {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}} |
| 550 | |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 551 | % This can be used when a function or method accepts an varying number |
| 552 | % of arguments, such as by using the *args syntax in the parameter list. |
| 553 | \newcommand{\py@moreargs}{...} |
| 554 | |
| 555 | % This can be used when you don't want to document the parameters to a |
| 556 | % function or method, but simply state that it's an alias for |
| 557 | % something else. |
| 558 | \newcommand{\py@unspecified}{...} |
| 559 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 560 | % C functions ------------------------------------------------------------ |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 561 | % \begin{cfuncdesc}[refcount]{type}{name}{arglist} |
| 562 | % Note that the [refcount] slot should only be filled in by |
| 563 | % tools/anno-api.py; it pulls the value from the refcounts database. |
| 564 | \newenvironment{cfuncdesc}[4][\py@badkey]{ |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 565 | \begin{fulllineitems} |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 566 | \item[\code{#2 \bfcode{#3}(\py@varvars{#4})}\index{#3@{\py@idxcode{#3()}}}] |
| 567 | \ifx#1\@undefined\else% |
Fred Drake | 0a863da | 2000-04-10 18:21:38 +0000 | [diff] [blame] | 568 | \emph{Return value: \textbf{#1}.}\\ |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 569 | \fi |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 570 | }{\end{fulllineitems}} |
| 571 | |
| 572 | % C variables ------------------------------------------------------------ |
| 573 | % \begin{cvardesc}{type}{name} |
| 574 | \newenvironment{cvardesc}[2]{ |
| 575 | \begin{fulllineitems} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 576 | \item[\code{#1 \bfcode{#2}}\index{#2@{\py@idxcode{#2}}}] |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 577 | }{\end{fulllineitems}} |
| 578 | |
| 579 | % C data types ----------------------------------------------------------- |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 580 | % \begin{ctypedesc}[index name]{typedef name} |
| 581 | \newenvironment{ctypedesc}[2][\py@badkey]{ |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 582 | \begin{fulllineitems} |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 583 | \item[\bfcode{#2}% |
| 584 | \ifx#1\@undefined% |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 585 | \index{#2@{\py@idxcode{#2}} (C type)} |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 586 | \else% |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 587 | \index{#2@{\py@idxcode{#1}} (C type)} |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 588 | \fi] |
| 589 | }{\end{fulllineitems}} |
| 590 | |
| 591 | % Funky macros ----------------------------------------------------------- |
| 592 | % \begin{csimplemacro}{name} |
| 593 | % -- "simple" because it has no args; NOT for constant definitions! |
| 594 | \newenvironment{csimplemacrodesc}[1]{ |
| 595 | \begin{fulllineitems} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 596 | \item[\bfcode{#1}\index{#1@{\py@idxcode{#1}} (macro)}] |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 597 | }{\end{fulllineitems}} |
| 598 | |
| 599 | % simple functions (not methods) ----------------------------------------- |
| 600 | % \begin{funcdesc}{name}{args} |
Fred Drake | ec77e65 | 2000-10-30 06:22:22 +0000 | [diff] [blame] | 601 | \newcommand{\funcline}[2]{% |
| 602 | \funclineni{#1}{#2}% |
| 603 | \index{#1@{\py@idxcode{#1()}} (in module \py@thismodule)}} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 604 | \newenvironment{funcdesc}[2]{ |
| 605 | \begin{fulllineitems} |
| 606 | \funcline{#1}{#2} |
| 607 | }{\end{fulllineitems}} |
| 608 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 609 | % similar to {funcdesc}, but doesn't add to the index |
Fred Drake | 300775d | 1998-04-17 02:17:00 +0000 | [diff] [blame] | 610 | \newcommand{\funclineni}[2]{\item[\code{\bfcode{#1}(\py@varvars{#2})}]} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 611 | \newenvironment{funcdescni}[2]{ |
| 612 | \begin{fulllineitems} |
| 613 | \funclineni{#1}{#2} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 614 | }{\end{fulllineitems}} |
| 615 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 616 | % classes ---------------------------------------------------------------- |
| 617 | % \begin{classdesc}{name}{constructor args} |
| 618 | \newenvironment{classdesc}[2]{ |
Fred Drake | 1cbd196 | 1998-11-25 17:13:28 +0000 | [diff] [blame] | 619 | % Using \renewcommand doesn't work for this, for unknown reasons: |
| 620 | \global\def\py@thisclass{#1} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 621 | \begin{fulllineitems} |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 622 | \item[\strong{class }\code{\bfcode{#1}(\py@varvars{#2})}% |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 623 | \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 624 | }{\end{fulllineitems}} |
| 625 | |
Fred Drake | 06a01e8 | 2001-05-11 01:00:30 +0000 | [diff] [blame] | 626 | % \begin{classdesc*}{name} |
| 627 | \newenvironment{classdesc*}[1]{ |
| 628 | % Using \renewcommand doesn't work for this, for unknown reasons: |
| 629 | \global\def\py@thisclass{#1} |
| 630 | \begin{fulllineitems} |
| 631 | \item[\strong{class }\code{\bfcode{#1}}% |
| 632 | \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] |
| 633 | }{\end{fulllineitems}} |
| 634 | |
Fred Drake | 4e60796 | 2000-09-09 06:01:25 +0000 | [diff] [blame] | 635 | % \begin{excclassdesc}{name}{constructor args} |
| 636 | % but indexes as an exception |
| 637 | \newenvironment{excclassdesc}[2]{ |
| 638 | % Using \renewcommand doesn't work for this, for unknown reasons: |
| 639 | \global\def\py@thisclass{#1} |
| 640 | \begin{fulllineitems} |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 641 | \item[\strong{exception }\code{\bfcode{#1}(\py@varvars{#2})}% |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 642 | \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] |
Fred Drake | 4e60796 | 2000-09-09 06:01:25 +0000 | [diff] [blame] | 643 | }{\end{fulllineitems}} |
| 644 | |
Fred Drake | 06a01e8 | 2001-05-11 01:00:30 +0000 | [diff] [blame] | 645 | % There is no corresponding {excclassdesc*} environment. To describe |
| 646 | % a class exception without parameters, use the {excdesc} environment. |
| 647 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 648 | |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 649 | \let\py@classbadkey=\@undefined |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 650 | |
| 651 | % object method ---------------------------------------------------------- |
| 652 | % \begin{methoddesc}[classname]{methodname}{args} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 653 | \newcommand{\methodline}[3][\@undefined]{ |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 654 | \methodlineni{#2}{#3} |
| 655 | \ifx#1\@undefined |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 656 | \index{#2@{\py@idxcode{#2()}} (\py@thisclass\ method)} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 657 | \else |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 658 | \index{#2@{\py@idxcode{#2()}} (#1 method)} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 659 | \fi |
| 660 | } |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 661 | \newenvironment{methoddesc}[3][\@undefined]{ |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 662 | \begin{fulllineitems} |
| 663 | \ifx#1\@undefined |
| 664 | \methodline{#2}{#3} |
| 665 | \else |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 666 | \def\py@thisclass{#1} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 667 | \methodline{#2}{#3} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 668 | \fi |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 669 | }{\end{fulllineitems}} |
| 670 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 671 | % similar to {methoddesc}, but doesn't add to the index |
| 672 | % (never actually uses the optional argument) |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 673 | \newcommand{\methodlineni}[3][\py@classbadkey]{% |
Fred Drake | 300775d | 1998-04-17 02:17:00 +0000 | [diff] [blame] | 674 | \item[\code{\bfcode{#2}(\py@varvars{#3})}]} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 675 | \newenvironment{methoddescni}[3][\py@classbadkey]{ |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 676 | \begin{fulllineitems} |
| 677 | \methodlineni{#2}{#3} |
| 678 | }{\end{fulllineitems}} |
| 679 | |
| 680 | % object data attribute -------------------------------------------------- |
| 681 | % \begin{memberdesc}[classname]{membername} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 682 | \newcommand{\memberline}[2][\py@classbadkey]{% |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 683 | \ifx#1\@undefined |
| 684 | \memberlineni{#2} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 685 | \index{#2@{\py@idxcode{#2}} (\py@thisclass\ attribute)} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 686 | \else |
| 687 | \memberlineni{#2} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 688 | \index{#2@{\py@idxcode{#2}} (#1 attribute)} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 689 | \fi |
| 690 | } |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 691 | \newenvironment{memberdesc}[2][\py@classbadkey]{ |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 692 | \begin{fulllineitems} |
| 693 | \ifx#1\@undefined |
| 694 | \memberline{#2} |
| 695 | \else |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 696 | \def\py@thisclass{#1} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 697 | \memberline{#2} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 698 | \fi |
| 699 | }{\end{fulllineitems}} |
| 700 | |
| 701 | % similar to {memberdesc}, but doesn't add to the index |
| 702 | % (never actually uses the optional argument) |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 703 | \newcommand{\memberlineni}[2][\py@classbadkey]{\item[\bfcode{#2}]} |
| 704 | \newenvironment{memberdescni}[2][\py@classbadkey]{ |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 705 | \begin{fulllineitems} |
| 706 | \memberlineni{#2} |
| 707 | }{\end{fulllineitems}} |
| 708 | |
| 709 | % For exceptions: -------------------------------------------------------- |
| 710 | % \begin{excdesc}{name} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 711 | % -- for constructor information, use excclassdesc instead |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 712 | \newenvironment{excdesc}[1]{ |
| 713 | \begin{fulllineitems} |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 714 | \item[\strong{exception }\bfcode{#1}% |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 715 | \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 716 | }{\end{fulllineitems}} |
| 717 | |
| 718 | % Module data or constants: ---------------------------------------------- |
| 719 | % \begin{datadesc}{name} |
Fred Drake | a33c566 | 2000-10-29 05:19:16 +0000 | [diff] [blame] | 720 | \newcommand{\dataline}[1]{% |
| 721 | \datalineni{#1}\index{#1@{\py@idxcode{#1}} (data in \py@thismodule)}} |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 722 | \newenvironment{datadesc}[1]{ |
| 723 | \begin{fulllineitems} |
| 724 | \dataline{#1} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 725 | }{\end{fulllineitems}} |
| 726 | |
| 727 | % similar to {datadesc}, but doesn't add to the index |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 728 | \newcommand{\datalineni}[1]{\item[\bfcode{#1}]\nopagebreak} |
| 729 | \newenvironment{datadescni}[1]{ |
| 730 | \begin{fulllineitems} |
| 731 | \datalineni{#1} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 732 | }{\end{fulllineitems}} |
| 733 | |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 734 | % bytecode instruction --------------------------------------------------- |
| 735 | % \begin{opcodedesc}{name}{var} |
| 736 | % -- {var} may be {} |
| 737 | \newenvironment{opcodedesc}[2]{ |
| 738 | \begin{fulllineitems} |
| 739 | \item[\bfcode{#1}\quad\var{#2}] |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 740 | }{\end{fulllineitems}} |
| 741 | |
| 742 | |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 743 | \newcommand{\nodename}[1]{\label{#1}} |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 744 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 745 | % For these commands, use \command{} to get the typography right, not |
| 746 | % {\command}. This works better with the texinfo translation. |
| 747 | \newcommand{\ABC}{{\sc abc}} |
| 748 | \newcommand{\UNIX}{{\sc Unix}} |
| 749 | \newcommand{\POSIX}{POSIX} |
| 750 | \newcommand{\ASCII}{{\sc ascii}} |
| 751 | \newcommand{\Cpp}{C\protect\raisebox{.18ex}{++}} |
| 752 | \newcommand{\C}{C} |
| 753 | \newcommand{\EOF}{{\sc eof}} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 754 | \newcommand{\NULL}{\constant{NULL}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 755 | |
Fred Drake | 5371497 | 1998-04-02 22:33:16 +0000 | [diff] [blame] | 756 | % Also for consistency: spell Python "Python", not "python"! |
| 757 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 758 | % code is the most difficult one... |
Fred Drake | 46346ec | 2000-06-30 17:57:05 +0000 | [diff] [blame] | 759 | \newcommand{\code}[1]{\textrm{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 760 | \texttt{#1}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 761 | |
| 762 | \newcommand{\bfcode}[1]{\code{\bfseries#1}} % bold-faced code font |
Fred Drake | 8e54abe | 1998-07-01 14:49:25 +0000 | [diff] [blame] | 763 | \newcommand{\kbd}[1]{\code{#1}} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 764 | \newcommand{\samp}[1]{`\code{#1}'} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 765 | % This weird definition of \var{} allows it to always appear in roman |
| 766 | % italics, and won't get funky in code fragments when we play around |
Fred Drake | fa1cceb | 1998-11-30 14:42:59 +0000 | [diff] [blame] | 767 | % with fonts. This also works directly in math mode. |
| 768 | \newcommand{\var}[1]{% |
| 769 | \ifmmode% |
| 770 | \hbox{\normalsize\textrm{\textit{#1\/}}}% |
| 771 | \else% |
| 772 | \normalsize\textrm{\textit{#1\/}}% |
| 773 | \fi% |
| 774 | } |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 775 | \renewcommand{\emph}[1]{{\em #1}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 776 | \newcommand{\dfn}[1]{\emph{#1}} |
| 777 | \newcommand{\strong}[1]{{\bf #1}} |
| 778 | % let's experiment with a new font: |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 779 | \newcommand{\file}[1]{`{\small\textsf{#1}}'} |
Fred Drake | 0a0fd59 | 1999-04-28 14:59:44 +0000 | [diff] [blame] | 780 | \newcommand{\filenq}[1]{{\small\textsf{#1}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 781 | |
| 782 | % Use this def/redef approach for \url{} since hyperref defined this already, |
| 783 | % but only if we actually used hyperref: |
Fred Drake | 6cb7149 | 1998-03-27 05:22:53 +0000 | [diff] [blame] | 784 | \@ifundefined{pdfannotlink}{ |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 785 | \newcommand{\py@url}[1]{\mbox{\small\textsf{#1}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 786 | }{ |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 787 | \newcommand{\py@url}[1]{{% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 788 | \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}% |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 789 | \py@LinkColor% color of the link text |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 790 | \mbox{\small\textsf{#1}}% |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 791 | \py@NormalColor% Turn it back off; these are declarative |
| 792 | \pdfendlink}% and don't appear bound to the current |
| 793 | }% formatting "box". |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 794 | } |
Fred Drake | a2c2a83 | 1998-04-15 17:50:01 +0000 | [diff] [blame] | 795 | \let\url=\py@url |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 796 | \newcommand{\email}[1]{{\small\textsf{#1}}} |
Fred Drake | 454a4fb | 1998-04-01 22:20:14 +0000 | [diff] [blame] | 797 | \newcommand{\newsgroup}[1]{{\small\textsf{#1}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 798 | |
Fred Drake | cc2b81e | 2000-08-03 17:38:30 +0000 | [diff] [blame] | 799 | \newcommand{\py@varvars}[1]{{% |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 800 | {\let\unspecified=\py@unspecified% |
| 801 | \let\moreargs=\py@moreargs% |
Fred Drake | cc2b81e | 2000-08-03 17:38:30 +0000 | [diff] [blame] | 802 | \var{#1}}}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 803 | |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 804 | % I'd really like to get rid of this! |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 805 | \newif\iftexi\texifalse |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 806 | |
Fred Drake | 1e4973b | 1998-07-28 21:52:17 +0000 | [diff] [blame] | 807 | % This is used to get l2h to put the copyright and abstract on |
| 808 | % a separate HTML page. |
| 809 | \newif\ifhtml\htmlfalse |
| 810 | |
| 811 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 812 | % These should be used for all references to identifiers which are |
| 813 | % used to refer to instances of specific language constructs. See the |
| 814 | % names for specific semantic assignments. |
| 815 | % |
| 816 | % For now, don't do anything really fancy with them; just use them as |
| 817 | % logical markup. This might change in the future. |
| 818 | % |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 819 | \newcommand{\module}[1]{\texttt{#1}} |
| 820 | \newcommand{\keyword}[1]{\texttt{#1}} |
| 821 | \newcommand{\exception}[1]{\texttt{#1}} |
| 822 | \newcommand{\class}[1]{\texttt{#1}} |
| 823 | \newcommand{\function}[1]{\texttt{#1}} |
| 824 | \newcommand{\member}[1]{\texttt{#1}} |
| 825 | \newcommand{\method}[1]{\texttt{#1}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 826 | |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 827 | \newcommand{\pytype}[1]{#1} % built-in Python type |
Fred Drake | 5371497 | 1998-04-02 22:33:16 +0000 | [diff] [blame] | 828 | |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 829 | \newcommand{\cfunction}[1]{\texttt{#1}} |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 830 | \newcommand{\ctype}[1]{\texttt{#1}} % C struct or typedef name |
| 831 | \newcommand{\cdata}[1]{\texttt{#1}} % C variable, typically global |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 832 | |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 833 | \newcommand{\mimetype}[1]{{\small\textsf{#1}}} |
Fred Drake | 94fac13 | 1998-03-12 19:37:03 +0000 | [diff] [blame] | 834 | % The \! is a "negative thin space" in math mode. |
| 835 | \newcommand{\regexp}[1]{% |
| 836 | {\tiny$^{^\lceil}\!\!$% |
| 837 | {\normalsize\code{#1}}% |
Fred Drake | 47cfd03 | 1998-04-03 21:22:31 +0000 | [diff] [blame] | 838 | $\!\rfloor\!$% |
Fred Drake | 94fac13 | 1998-03-12 19:37:03 +0000 | [diff] [blame] | 839 | }} |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 840 | \newcommand{\envvar}[1]{% |
Fred Drake | 31ab298 | 2001-01-22 17:50:42 +0000 | [diff] [blame] | 841 | #1% |
| 842 | \index{#1@{#1}}% |
| 843 | \index{environment variables!{#1}}% |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 844 | } |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 845 | \newcommand{\makevar}[1]{#1} % variable in a Makefile |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 846 | \newcommand{\character}[1]{\samp{#1}} |
Fred Drake | 0ee9f72 | 1998-03-12 06:41:40 +0000 | [diff] [blame] | 847 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 848 | % constants defined in Python modules or C headers, not language constants: |
Fred Drake | ab357ec | 2001-03-02 18:57:05 +0000 | [diff] [blame] | 849 | \newcommand{\constant}[1]{\code{#1}} % manifest constant, not syntactic |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 850 | |
| 851 | \newcommand{\manpage}[2]{{\emph{#1}(#2)}} |
Fred Drake | 4e60796 | 2000-09-09 06:01:25 +0000 | [diff] [blame] | 852 | \newcommand{\pep}[1]{PEP #1\index{Python Enhancement Proposals!PEP #1}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 853 | \newcommand{\rfc}[1]{RFC #1\index{RFC!RFC #1}} |
| 854 | \newcommand{\program}[1]{\strong{#1}} |
Fred Drake | 7b8195a | 1999-11-09 17:02:11 +0000 | [diff] [blame] | 855 | \newcommand{\programopt}[1]{\strong{#1}} |
Fred Drake | 4936249 | 2000-04-11 18:47:59 +0000 | [diff] [blame] | 856 | % Note that \longprogramopt provides the '--'! |
| 857 | \newcommand{\longprogramopt}[1]{\strong{-{}-#1}} |
Fred Drake | 7b8195a | 1999-11-09 17:02:11 +0000 | [diff] [blame] | 858 | |
| 859 | % cited titles: \citetitle{Title of Work} |
| 860 | % online: \citetitle[url-to-resource]{Title of Work} |
Fred Drake | de9fec5 | 2000-08-17 04:25:59 +0000 | [diff] [blame] | 861 | \newcommand{\citetitle}[2][URL]{\emph{#2}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 862 | |
| 863 | |
| 864 | % Deprecation stuff. |
| 865 | % Should be extended to allow an index / list of deprecated stuff. But |
| 866 | % there's a lot of stuff that needs to be done to make that automatable. |
| 867 | % |
| 868 | % First parameter is the release number that deprecates the feature, the |
| 869 | % second is the action the should be taken by users of the feature. |
| 870 | % |
| 871 | % Example: |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 872 | % \deprecated{1.5.1}{Use \method{frobnicate()} instead.} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 873 | % |
| 874 | \newcommand{\deprecated}[2]{% |
| 875 | \strong{Deprecated since release #1.} #2\par} |
| 876 | |
Fred Drake | af958c7 | 1998-07-27 20:32:33 +0000 | [diff] [blame] | 877 | % New stuff. |
| 878 | % This should be used to mark things which have been added to the |
| 879 | % development tree but that aren't in the release, but are documented. |
| 880 | % This allows release of documentation that already includes updated |
Fred Drake | 2116d98 | 1999-02-02 18:02:48 +0000 | [diff] [blame] | 881 | % descriptions. Place at end of descriptor environment. |
Fred Drake | af958c7 | 1998-07-27 20:32:33 +0000 | [diff] [blame] | 882 | % |
| 883 | % Example: |
| 884 | % \versionadded{1.5.2} |
Fred Drake | 46346ec | 2000-06-30 17:57:05 +0000 | [diff] [blame] | 885 | % \versionchanged[short explanation]{2.0} |
Fred Drake | af958c7 | 1998-07-27 20:32:33 +0000 | [diff] [blame] | 886 | % |
Fred Drake | fdfb05b | 2001-04-18 03:08:54 +0000 | [diff] [blame] | 887 | \newcommand{\versionadded}[2][\py@badkey]{% |
| 888 | \ifx#1\@undefined% |
| 889 | { New in version #2. }% |
| 890 | \else% |
| 891 | { New in version #2:\ #1. }% |
| 892 | \fi% |
| 893 | } |
Fred Drake | a6e8339 | 2000-05-02 17:28:36 +0000 | [diff] [blame] | 894 | \newcommand{\versionchanged}[2][\py@badkey]{% |
| 895 | \ifx#1\@undefined% |
| 896 | { Changed in version #2. }% |
| 897 | \else% |
| 898 | { Changed in version #2:\ #1. }% |
| 899 | \fi% |
| 900 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 901 | |
Fred Drake | af958c7 | 1998-07-27 20:32:33 +0000 | [diff] [blame] | 902 | |
| 903 | % Tables. |
| 904 | % |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 905 | \newenvironment{tableii}[4]{% |
| 906 | \begin{center}% |
| 907 | \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}% |
Fred Drake | f61eac4 | 2000-10-24 02:18:30 +0000 | [diff] [blame] | 908 | \begin{tabular}{#1}\strong{#3}&\strong{#4} \\* \hline% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 909 | }{% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 910 | \end{tabular}% |
| 911 | \end{center}% |
| 912 | } |
| 913 | |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 914 | \newenvironment{longtableii}[4]{% |
| 915 | \begin{center}% |
| 916 | \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}% |
Fred Drake | f61eac4 | 2000-10-24 02:18:30 +0000 | [diff] [blame] | 917 | \begin{longtable}[c]{#1}\strong{#3}&\strong{#4} \\* \hline\endhead% |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 918 | }{% |
| 919 | \end{longtable}% |
| 920 | \end{center}% |
| 921 | } |
| 922 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 923 | \newenvironment{tableiii}[5]{% |
| 924 | \begin{center}% |
| 925 | \def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}% |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 926 | \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5} \\% |
Fred Drake | f61eac4 | 2000-10-24 02:18:30 +0000 | [diff] [blame] | 927 | \hline% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 928 | }{% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 929 | \end{tabular}% |
| 930 | \end{center}% |
| 931 | } |
| 932 | |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 933 | \newenvironment{longtableiii}[5]{% |
| 934 | \begin{center}% |
| 935 | \def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}% |
| 936 | \begin{longtable}[c]{#1}\strong{#3}&\strong{#4}&\strong{#5} \\% |
Fred Drake | f61eac4 | 2000-10-24 02:18:30 +0000 | [diff] [blame] | 937 | \hline\endhead% |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 938 | }{% |
| 939 | \end{longtable}% |
| 940 | \end{center}% |
| 941 | } |
| 942 | |
Fred Drake | 30e5265 | 1998-07-24 22:11:29 +0000 | [diff] [blame] | 943 | \newenvironment{tableiv}[6]{% |
| 944 | \begin{center}% |
| 945 | \def\lineiv##1##2##3##4{\csname#2\endcsname{##1}&##2&##3&##4\\}% |
| 946 | \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6} \\% |
Fred Drake | f61eac4 | 2000-10-24 02:18:30 +0000 | [diff] [blame] | 947 | \hline% |
Fred Drake | 30e5265 | 1998-07-24 22:11:29 +0000 | [diff] [blame] | 948 | }{% |
| 949 | \end{tabular}% |
| 950 | \end{center}% |
| 951 | } |
| 952 | |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 953 | \newenvironment{longtableiv}[6]{% |
| 954 | \begin{center}% |
| 955 | \def\lineiv##1##2##3##4{\csname#2\endcsname{##1}&##2&##3&##4\\}% |
| 956 | \begin{longtable}[c]{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6}% |
| 957 | \\% |
Fred Drake | f61eac4 | 2000-10-24 02:18:30 +0000 | [diff] [blame] | 958 | \hline\endhead% |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 959 | }{% |
| 960 | \end{longtable}% |
| 961 | \end{center}% |
| 962 | } |
| 963 | |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 964 | % Cross-referencing (AMK, new impl. FLD) |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 965 | % Sample usage: |
| 966 | % \begin{seealso} |
Fred Drake | 84bd6f3 | 1999-05-11 15:42:51 +0000 | [diff] [blame] | 967 | % \seemodule{rand}{Uniform random number generator.}; % Module xref |
| 968 | % \seetext{\emph{Encyclopedia Britannica}}. % Ref to a book |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 969 | % |
| 970 | % % A funky case: module name contains '_'; have to supply an optional key |
Fred Drake | 84bd6f3 | 1999-05-11 15:42:51 +0000 | [diff] [blame] | 971 | % \seemodule[copyreg]{copy_reg}{Interface constructor registration for |
| 972 | % \module{pickle}.} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 973 | % \end{seealso} |
Fred Drake | 84bd6f3 | 1999-05-11 15:42:51 +0000 | [diff] [blame] | 974 | % |
| 975 | % Note that the last parameter for \seemodule and \seetext should be complete |
| 976 | % sentences and be terminated with the proper punctuation. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 977 | |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 978 | \@ifundefined{pdfannotlink}{% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 979 | \newcommand{\py@seemodule}[3][\py@modulebadkey]{% |
Fred Drake | da94374 | 1999-01-13 17:09:06 +0000 | [diff] [blame] | 980 | \par% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 981 | \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi% |
Fred Drake | 84bd6f3 | 1999-05-11 15:42:51 +0000 | [diff] [blame] | 982 | \begin{fulllineitems} |
| 983 | \item[Module \module{#2} (section \ref{module-\py@modulekey}):] |
| 984 | #3 |
| 985 | \end{fulllineitems} |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 986 | } |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 987 | }{\newcommand{\py@seemodule}[3][\py@modulebadkey]{% |
Fred Drake | da94374 | 1999-01-13 17:09:06 +0000 | [diff] [blame] | 988 | \par% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 989 | \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi% |
Fred Drake | 84bd6f3 | 1999-05-11 15:42:51 +0000 | [diff] [blame] | 990 | \begin{fulllineitems} |
| 991 | \item[\py@linkToName{label-module-\py@modulekey}{Module \module{#2}} |
| 992 | (section \ref{module-\py@modulekey}):] |
| 993 | #3 |
| 994 | \end{fulllineitems} |
Fred Drake | ebcb658 | 1998-03-06 21:25:17 +0000 | [diff] [blame] | 995 | } |
| 996 | } |
Fred Drake | 4844998 | 2000-09-12 17:52:33 +0000 | [diff] [blame] | 997 | % \seetitle[url]{title}{why it's interesting} |
| 998 | \newcommand{\py@seetitle}[3][\py@modulebadkey]{% |
| 999 | \par |
| 1000 | \begin{fulllineitems} |
| 1001 | \item[\citetitle{#2}] |
| 1002 | \ifx\py@modulebadkey#1\else |
| 1003 | \item[{\small{(\url{#1})}}] |
| 1004 | \fi |
| 1005 | #3 |
| 1006 | \end{fulllineitems} |
| 1007 | } |
Fred Drake | 4e60796 | 2000-09-09 06:01:25 +0000 | [diff] [blame] | 1008 | % \seepep{number}{title}{why it's interesting} |
| 1009 | \newcommand{\py@seepep}[3]{% |
| 1010 | \par% |
| 1011 | \begin{fulllineitems} |
| 1012 | \item[\pep{#1}, ``\emph{#2}''] |
| 1013 | #3 |
| 1014 | \end{fulllineitems} |
| 1015 | } |
Fred Drake | 64b72b6 | 2000-04-26 18:13:58 +0000 | [diff] [blame] | 1016 | % \seerfc{number}{title}{why it's interesting} |
| 1017 | \newcommand{\py@seerfc}[3]{% |
| 1018 | \par% |
| 1019 | \begin{fulllineitems} |
| 1020 | \item[\rfc{#1}, ``\emph{#2}''] |
| 1021 | #3 |
| 1022 | \end{fulllineitems} |
| 1023 | } |
Fred Drake | 51313f1 | 2000-05-09 16:18:44 +0000 | [diff] [blame] | 1024 | % \seeurl{url}{why it's interesting} |
| 1025 | \newcommand{\py@seeurl}[2]{% |
| 1026 | \par% |
| 1027 | \begin{fulllineitems} |
| 1028 | \item[\url{#1}] |
| 1029 | #2 |
| 1030 | \end{fulllineitems} |
| 1031 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1032 | \newenvironment{seealso}[0]{ |
Fred Drake | 9466b9a | 1999-03-18 16:18:27 +0000 | [diff] [blame] | 1033 | \par |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1034 | \strong{See Also:}\par |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1035 | \def\seetext##1{\par{##1}} |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 1036 | \let\seemodule=\py@seemodule |
Fred Drake | 4844998 | 2000-09-12 17:52:33 +0000 | [diff] [blame] | 1037 | \let\seepep=\py@seepep |
Fred Drake | 64b72b6 | 2000-04-26 18:13:58 +0000 | [diff] [blame] | 1038 | \let\seerfc=\py@seerfc |
Fred Drake | 4844998 | 2000-09-12 17:52:33 +0000 | [diff] [blame] | 1039 | \let\seetitle=\py@seetitle |
Fred Drake | 51313f1 | 2000-05-09 16:18:44 +0000 | [diff] [blame] | 1040 | \let\seeurl=\py@seeurl |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1041 | }{\par} |
| 1042 | |
| 1043 | |
Fred Drake | af958c7 | 1998-07-27 20:32:33 +0000 | [diff] [blame] | 1044 | % Allow the Python release number to be specified independently of the |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1045 | % \date{}. This allows the date to reflect the document's date and |
| 1046 | % release to specify the Python release that is documented. |
| 1047 | % |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 1048 | \newcommand{\py@release}{} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1049 | \newcommand{\version}{} |
Fred Drake | af2b714 | 2000-09-14 20:11:05 +0000 | [diff] [blame] | 1050 | \newcommand{\shortversion}{} |
Fred Drake | c65218e | 2001-06-20 21:17:09 +0000 | [diff] [blame] | 1051 | \newcommand{\releaseinfo}{} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1052 | \newcommand{\releasename}{Release} |
| 1053 | \newcommand{\release}[1]{% |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 1054 | \renewcommand{\py@release}{\releasename\space\version}% |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1055 | \renewcommand{\version}{#1}} |
Fred Drake | af2b714 | 2000-09-14 20:11:05 +0000 | [diff] [blame] | 1056 | \newcommand{\setshortversion}[1]{% |
| 1057 | \renewcommand{\shortversion}{#1}} |
Fred Drake | c65218e | 2001-06-20 21:17:09 +0000 | [diff] [blame] | 1058 | \newcommand{\setreleaseinfo}[1]{% |
| 1059 | \renewcommand{\releaseinfo}{#1}} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1060 | |
| 1061 | % Allow specification of the author's address separately from the |
| 1062 | % author's name. This can be used to format them differently, which |
| 1063 | % is a good thing. |
| 1064 | % |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 1065 | \newcommand{\py@authoraddress}{} |
| 1066 | \newcommand{\authoraddress}[1]{\renewcommand{\py@authoraddress}{#1}} |
Fred Drake | 6df93ef | 1998-05-14 20:56:31 +0000 | [diff] [blame] | 1067 | \let\developersaddress=\authoraddress |
| 1068 | \let\developer=\author |
| 1069 | \let\developers=\author |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1070 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1071 | % This sets up the fancy chapter headings that make the documents look |
| 1072 | % at least a little better than the usual LaTeX output. |
| 1073 | % |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 1074 | \@ifundefined{ChTitleVar}{}{ |
Fred Drake | 24340ea | 1998-04-28 18:30:34 +0000 | [diff] [blame] | 1075 | \ChNameVar{\raggedleft\normalsize\py@HeaderFamily} |
| 1076 | \ChNumVar{\raggedleft \bfseries\Large\py@HeaderFamily} |
| 1077 | \ChTitleVar{\raggedleft \rm\Huge\py@HeaderFamily} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1078 | % This creates chapter heads without the leading \vspace*{}: |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 1079 | \def\@makechapterhead#1{% |
| 1080 | {\parindent \z@ \raggedright \normalfont |
| 1081 | \ifnum \c@secnumdepth >\m@ne |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1082 | \DOCH |
| 1083 | \fi |
Fred Drake | 1c8d0e0 | 1998-03-07 05:29:15 +0000 | [diff] [blame] | 1084 | \interlinepenalty\@M |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1085 | \DOTI{#1} |
| 1086 | } |
| 1087 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1088 | } |
| 1089 | |
Fred Drake | 3bf7865 | 1998-05-20 17:42:17 +0000 | [diff] [blame] | 1090 | |
| 1091 | % Definition lists; requested by AMK for HOWTO documents. Probably useful |
| 1092 | % elsewhere as well, so keep in in the general style support. |
| 1093 | % |
| 1094 | \newenvironment{definitions}{% |
| 1095 | \begin{description}% |
Fred Drake | f9acc59 | 1998-09-09 15:27:43 +0000 | [diff] [blame] | 1096 | \def\term##1{\item[##1]\mbox{}\\*[0mm]} |
Fred Drake | 3bf7865 | 1998-05-20 17:42:17 +0000 | [diff] [blame] | 1097 | }{% |
| 1098 | \end{description}% |
| 1099 | } |
| 1100 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1101 | % Tell TeX about pathological hyphenation cases: |
| 1102 | \hyphenation{Base-HTTP-Re-quest-Hand-ler} |