annotate Doc/texinputs/python.sty @ 7617:068a6942fe1a legacy-trunk

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