annotate Doc/texinputs/python.sty @ 10328:f438c6e2b6c1 legacy-trunk

Added support for \platform, \platformof, and \ignorePlatformAnnotation.
author Fred Drake <fdrake@acm.org>
date Tue, 02 Mar 1999 16:17:44 +0000
parents 80b215249b17
children 9a4baf0c57ea
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}
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
7 [1998/01/11 LaTeX package (Python markup)]
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
8
7778
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
9 % These packages can be used to add marginal annotations which indicate
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
10 % index entries and labels; useful for reviewing this messy documentation!
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
11 %
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
12 %\RequirePackage{showkeys}
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
13 %\RequirePackage{showidx}
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
14
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
15 % for PDF output, use maximal compression & a lot of other stuff
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
16 % (test for PDF recommended by Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov>)
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
17 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
18 \newif\ifpy@doing@page@targets
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
19 \py@doing@page@targetsfalse
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
20
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
21 \ifx\pdfoutput\undefined\else\ifcase\pdfoutput
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
22 \else
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
23 \input{pdfcolor}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
24 \let\py@LinkColor=\NavyBlue
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
25 \let\py@NormalColor=\Black
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
26 \pdfcompresslevel=9
8306
4674cd2f6f07 Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents: 8229
diff changeset
27 \pdfpagewidth=\paperwidth % page width of PDF output
4674cd2f6f07 Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents: 8229
diff changeset
28 \pdfpageheight=\paperheight % page height of PDF output
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
29 %
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
30 % Pad the number with '0' to 3 digits wide so no page name is a prefix
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
31 % of any other.
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
32 %
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
33 \newcommand{\py@targetno}[1]{\ifnum#1<100 0\fi\ifnum#1<10 0\fi#1}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
34 \newcommand{\py@pageno}{\py@targetno\thepage}
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
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 % 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
37 % 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
38 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
39 \let\py@OldContentsline=\contentsline
9968
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
40 %
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
41 % Macro that takes two args: the name to link to and the content of
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
42 % the link. This takes care of the PDF magic, getting the colors
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
43 % the same for each link, and avoids having lots of garbage all over
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
44 % this style file.
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
45 \newcommand{\py@linkToName}[2]{%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
46 \pdfannotlink attr{/Border [0 0 0]} goto name{#1}%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
47 \py@LinkColor#2\py@NormalColor%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
48 \pdfendlink%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
49 }
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
50 % Compute the padded page number separately since we end up with a pair of
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
51 % \relax tokens; this gets the right string computed and works.
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
52 \renewcommand{\contentsline}[3]{%
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
53 \def\my@pageno{\py@targetno{#3}}%
9968
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
54 \py@OldContentsline{#1}{\py@linkToName{page\my@pageno}{#2}}{#3}%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
55 }
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
56 \AtEndDocument{
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
57 \InputIfFileExists{\jobname.bkm}{\pdfcatalog{/PageMode /UseOutlines}}{}
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
58 }
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
59 \newcommand{\py@target}[1]{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
60 \ifpy@doing@page@targets%
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
61 {\pdfdest name{#1} fit}%
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
62 \fi%
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
63 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
64 \let\py@OldLabel=\label
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
65 \renewcommand{\label}[1]{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
66 \py@OldLabel{#1}%
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
67 \py@target{label-#1}%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
68 }
8306
4674cd2f6f07 Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents: 8229
diff changeset
69 % This stuff adds a page# destination to every PDF page, where # is three
4674cd2f6f07 Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents: 8229
diff changeset
70 % digits wide, padded with leading zeros. This doesn't really help with
4674cd2f6f07 Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents: 8229
diff changeset
71 % the frontmatter, but does fine with the body.
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
72 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
73 % 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
74 %
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
75 \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
76 \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
77 \@hyperfixhead
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
78 }
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
79 \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
80 \let\H@old@thehead\@thehead
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
81 \global\def\@foo{\py@target{page\py@pageno}}%
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
82 \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
83 \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
84 \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
85 }
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
86 \fi\fi
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
87
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
88 % 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
89 \topmargin 0pt
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
90 \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
91 \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
92
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
93 % 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
94 \@ifundefined{paperheight}{
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
95 \textheight 9in
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
96 }{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
97 \textheight \paperheight
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
98 \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
99 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
100
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
101 \oddsidemargin 0pt
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
102 \evensidemargin \oddsidemargin
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
103 \marginparwidth 0.5in
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
104
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
105 \@ifundefined{paperwidth}{
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
106 \textwidth 6.5in
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
107 }{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
108 \textwidth \paperwidth
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
109 \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
110 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
111
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
112
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
113 % 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
114 \raggedbottom
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
115 \sloppy
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
116 \parindent = 0mm
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
117 \parskip = 2mm
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
118 \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
119
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
120 \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
121 \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
122 \setcounter{secnumdepth}{1}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
123
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
124 % Use this to set the font family for headers and other decor:
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
125 \newcommand{\py@HeaderFamily}{\sffamily}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
126
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
127 % 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
128 \@ifundefined{fancyhf}{}{
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
129 % 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
130 \fancypagestyle{normal}{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
131 \fancyhf{}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
132 \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
133 \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
134 \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
135 \renewcommand{\headrulewidth}{0pt}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
136 \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
137 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
138 % 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
139 % 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
140 % 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
141 \fancypagestyle{plain}{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
142 \fancyhf{}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
143 \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
144 \renewcommand{\headrulewidth}{0pt}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
145 \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
146 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
147 % 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
148 % 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
149 % 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
150 \@ifundefined{chapter}{}{
7548
7eb19b1ce84d Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
151 \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
152 \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
153 \hbox{}
7eb19b1ce84d Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
154 \thispagestyle{plain}
7eb19b1ce84d Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
155 \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
156 \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
157 }
7eb19b1ce84d Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
158 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
159 }
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 % 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
162 % 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
163 % code samples.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
164
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
165 % Variable used by begin code command
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
166 \newlength{\py@codewidth}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
167
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
168 \newcommand{\py@examplevspace}{2mm}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
169 \newcommand{\py@exampleindent}{1cm}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
170
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
171 \let\py@OldVerbatim=\verbatim
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
172 \let\py@OldEndVerbatim=\endverbatim
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
173 \renewcommand{\verbatim}{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
174 \begingroup%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
175 \setlength{\parindent}\py@exampleindent%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
176 % Calculate the text width for the minipage:
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
177 \setlength{\py@codewidth}{\linewidth}%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
178 \addtolength{\py@codewidth}{-\parindent}%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
179 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
180 \par%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
181 \vspace\py@examplevspace%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
182 \indent%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
183 \begin{minipage}[t]{\py@codewidth}%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
184 \small%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
185 \py@OldVerbatim%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
186 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
187 \renewcommand{\endverbatim}{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
188 \py@OldEndVerbatim%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
189 \end{minipage}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
190 \endgroup%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
191 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
192
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
193
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
194 \newcommand{\py@modulebadkey}{{--just-some-junk--}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
195
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
196
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
197 %% 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
198
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
199 % 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
200 % 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
201 % just keep the index entries in the roman font, uncomment the second
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
202 % definition; it matches O'Reilly style more.
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
203 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
204 \newcommand{\py@idxcode}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
205 %\renewcommand{\py@idxcode}[1]{#1}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
206
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
207 % 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
208 \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
209
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
210 % 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
211 \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
212
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
213 % 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
214 \newcommand{\indexiv}[4]{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
215 \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
216 \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
217 \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
218 \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
219 }
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 % 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
222 % operator.
8229
df752c08b462 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8190
diff changeset
223 \newcommand{\kwindex}[1]{\indexii{keyword}{#1@{\py@idxcode{#1}}}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
224 \newcommand{\stindex}[1]{\indexii{statement}{#1@{\py@idxcode{#1}}}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
225 \newcommand{\opindex}[1]{\indexii{operator}{#1@{\py@idxcode{#1}}}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
226 \newcommand{\exindex}[1]{\indexii{exception}{#1@{\py@idxcode{#1}}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
227 \newcommand{\obindex}[1]{\indexii{object}{#1}}
7792
8d4148213cc0 \bifuncindex: Fix so entries combine correctly with those of the built-in
Fred Drake <fdrake@acm.org>
parents: 7786
diff changeset
228 \newcommand{\bifuncindex}[1]{\withsubitem{(built-in function)}{\ttindex{#1()}}}
7527
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 % Add an index entry for a module
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
231 \newcommand{\py@refmodule}[2]{\index{#1@{\py@idxcode{#1}} (#2module)}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
232 \newcommand{\refmodindex}[1]{\py@refmodule{#1}{}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
233 \newcommand{\refbimodindex}[1]{\py@refmodule{#1}{built-in }}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
234 \newcommand{\refexmodindex}[1]{\py@refmodule{#1}{extension }}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
235 \newcommand{\refstmodindex}[1]{\py@refmodule{#1}{standard }}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
236
9868
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
237 % Refer to a module's documentation using a hyperlink of the module's
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
238 % name, at least if we're building PDF:
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
239 \@ifundefined{pdfannotlink}{%
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
240 \newcommand{\refmodule}[2][\py@modulebadkey]{\module{#2}}
9968
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
241 }{%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
242 \newcommand{\refmodule}[2][\py@modulebadkey]{%
9868
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
243 \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
9968
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
244 \py@linkToName{label-module-\py@modulekey}{\module{#2}}%
9868
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
245 }
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
246 }
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
247
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
248 % support for the module index
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
249 \newif\ifpy@UseModuleIndex
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
250 \py@UseModuleIndexfalse
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
251
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
252 \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
253 \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
254 \openout\modindexfile=mod\jobname.idx
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
255 \py@UseModuleIndextrue
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
256 }
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
257
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
258 % Add the defining entry for a module
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
259 \newcommand{\py@modindex}[2]{%
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
260 \renewcommand{\py@thismodule}{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
261 \setindexsubitem{(in module #1)}%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
262 \index{#1@{\py@idxcode{#1}} (#2module)|textbf}%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
263 \ifpy@UseModuleIndex%
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
264 \@ifundefined{py@modplat@\py@thismodulekey}{
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
265 \write\modindexfile{\protect\indexentry{#1@{\texttt{#1}}}{\thepage}}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
266 }{\write\modindexfile{\protect\indexentry{#1@{\texttt{#1} %
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
267 \emph{(\platformof[\py@thismodulekey]{})}}}{\thepage}}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
268 }
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
269 \fi%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
270 }
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
271
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
272 % built-in & Python modules in the main distribution
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
273 \newcommand{\bimodindex}[1]{\py@modindex{#1}{built-in }}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
274 \newcommand{\stmodindex}[1]{\py@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
275
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
276 % Python & extension modules outside the main distribution
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
277 \newcommand{\modindex}[1]{\py@modindex{#1}{}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
278 \newcommand{\exmodindex}[1]{\py@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
279
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
280 % 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
281 \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
282 \newcommand{\setindexsubitem}[1]{\renewcommand{\index@subitem}{#1}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
283 \newcommand{\ttindex}[1]{\index{#1@{\py@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
284
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
285 \newcommand{\withsubitem}[2]{%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
286 \begingroup%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
287 \def\index@subitem{#1}#2%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
288 \endgroup%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
289 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
290
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
291
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
292 % Module synopsis processing -----------------------------------------------
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
293 %
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
294 \newcommand{\py@thisclass}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
295 \newcommand{\py@thismodule}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
296 \newcommand{\py@thismodulekey}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
297 \newcommand{\py@thismoduletype}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
298
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
299 \newcommand{\py@standardIndexModule}[1]{\stmodindex{#1}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
300 \newcommand{\py@builtinIndexModule}[1]{\bimodindex{#1}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
301 \newcommand{\py@extensionIndexModule}[1]{\exmodindex{#1}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
302 \newcommand{\py@IndexModule}[1]{\modindex{#1}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
303
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
304 \newif\ifpy@HaveModSynopsis \py@HaveModSynopsisfalse
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
305 \newif\ifpy@ModSynopsisFileIsOpen \py@ModSynopsisFileIsOpenfalse
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
306 \newif\ifpy@HaveModPlatform \py@HaveModPlatformfalse
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
307
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
308 % \declaremodule[key]{type}{name}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
309 \newcommand{\declaremodule}[3][\py@modulebadkey]{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
310 \py@openModSynopsisFile
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
311 \renewcommand{\py@thismoduletype}{#2}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
312 \ifx\py@modulebadkey#1
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
313 \renewcommand{\py@thismodulekey}{#3}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
314 \else
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
315 \renewcommand{\py@thismodulekey}{#1}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
316 \fi
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
317 \csname py@#2IndexModule\endcsname{#3}
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
318 \label{module-\py@thismodulekey}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
319 }
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
320 \newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
321 \newcommand{\py@ModPlatformFilename}{\jobname.pla}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
322 \newcommand{\platform}[1]{
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
323 \ifpy@ModPlatformFileIsOpen\else
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
324 \newwrite\py@ModPlatformFile
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
325 \openout\py@ModPlatformFile=\py@ModPlatformFilename
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
326 \py@ModPlatformFileIsOpentrue
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
327 \fi
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
328 \@ifundefined{py@modplat@\py@thismodulekey}{
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
329 \py@writeModPlatformFile{%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
330 \newcommand{\csname py@modplat@\py@thismodulekey\endcsname}{#1}}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
331 }{\py@writeModPlatformFile{%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
332 \newcommand{\string\py@modplat@\py@thismodulekey}{#1}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
333 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
334 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
335 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
336 \InputIfFileExists{\jobname.pla}{}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
337 \newcommand{\platformof}[2][\py@modulebadkey]{%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
338 \ifx\py@modulebadkey#1 \def\py@key{#2}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
339 \else \def\py@key{#1}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
340 \fi%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
341 \csname py@modplat@\py@key\endcsname%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
342 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
343 \newcommand{\ignorePlatformAnnotation}[1]{}
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
344
8916
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
345 % \moduleauthor{name}{email}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
346 \newcommand{\moduleauthor}[2]{}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
347
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
348 % \sectionauthor{name}{email}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
349 \newcommand{\sectionauthor}[2]{}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
350
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
351
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
352 \newcommand{\py@defsynopsis}{Module has no synopsis.}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
353 \newcommand{\py@modulesynopsis}{\py@defsynopsis}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
354 \newcommand{\modulesynopsis}[1]{
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
355 \py@HaveModSynopsistrue
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
356 \renewcommand{\py@modulesynopsis}{#1}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
357 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
358
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
359 % define the file
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
360 \newwrite\py@ModSynopsisFile
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
361
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
362 % hacked from \addtocontents from latex.ltx:
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
363 \long\def\py@writeModSynopsisFile#1{%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
364 \protected@write\py@ModSynopsisFile%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
365 {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
366 {\string#1}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
367 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
368 \newcommand{\py@closeModSynopsisFile}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
369 \ifpy@ModSynopsisFileIsOpen
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
370 \closeout\py@ModSynopsisFile
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
371 \py@ModSynopsisFileIsOpenfalse
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
372 \fi
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
373 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
374 \newcommand{\py@openModSynopsisFile}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
375 \ifpy@ModSynopsisFileIsOpen\else
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
376 \openout\py@ModSynopsisFile=\py@ModSynopsisFilename
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
377 \py@ModSynopsisFileIsOpentrue
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
378 \fi
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
379 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
380
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
381 \newcommand{\py@ProcessModSynopsis}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
382 \ifpy@HaveModSynopsis
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
383 \py@writeModSynopsisFile{\modulesynopsis%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
384 {\py@thismodulekey}{\py@thismodule}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
385 {\py@thismoduletype}{\py@modulesynopsis}}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
386 \py@HaveModSynopsisfalse
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
387 \fi
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
388 \renewcommand{\py@modulesynopsis}{\py@defsynopsis}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
389 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
390 \AtEndDocument{\py@ProcessModSynopsis\py@closeModSynopsisFile}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
391
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
392
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
393 \long\def\py@writeModPlatformFile#1{%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
394 \protected@write\py@ModPlatformFile%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
395 {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
396 {\string#1}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
397 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
398
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
399
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
400 \newcommand{\localmoduletable}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
401 \IfFileExists{\py@ModSynopsisFilename}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
402 \begin{synopsistable}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
403 \input{\py@ModSynopsisFilename}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
404 \end{synopsistable}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
405 }{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
406 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
407
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
408 \@ifundefined{pdfoutput}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
409 \newcommand{\py@ModSynopsisSummary}[4]{\bfcode{#2} & #4\\}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
410 }{
9968
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
411 \newcommand{\py@ModSynopsisSummary}[4]{%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
412 \py@linkToName{label-module-#1}{\bfcode{#2}} & #4\\
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
413 }
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
414 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
415 \newenvironment{synopsistable}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
416 % key, name, type, synopsis
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
417 \let\modulesynopsis=\py@ModSynopsisSummary
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
418 \begin{tabular}{ll}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
419 }{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
420 \end{tabular}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
421 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
422 %
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
423 % --------------------------------------------------------------------------
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
424
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
425
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
426 \newcommand{\py@reset}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
427 \py@ProcessModSynopsis
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
428 \renewcommand{\py@thisclass}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
429 \renewcommand{\py@thismodule}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
430 \renewcommand{\py@thismodulekey}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
431 \renewcommand{\py@thismoduletype}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
432 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
433
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
434 % Augment the sectioning commands used to get our own font family in place,
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
435 % and reset some internal data items:
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
436 \renewcommand{\section}{\py@reset%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
437 \@startsection{section}{1}{\z@}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
438 {-3.5ex \@plus -1ex \@minus -.2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
439 {2.3ex \@plus.2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
440 {\reset@font\Large\py@HeaderFamily}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
441 \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
442 {-3.25ex\@plus -1ex \@minus -.2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
443 {1.5ex \@plus .2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
444 {\reset@font\large\py@HeaderFamily}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
445 \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
446 {-3.25ex\@plus -1ex \@minus -.2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
447 {1.5ex \@plus .2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
448 {\reset@font\normalsize\py@HeaderFamily}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
449 \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
450 {3.25ex \@plus1ex \@minus.2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
451 {-1em}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
452 {\reset@font\normalsize\py@HeaderFamily}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
453 \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\parindent}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
454 {3.25ex \@plus1ex \@minus .2ex}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
455 {-1em}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
456 {\reset@font\normalsize\py@HeaderFamily}}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
457
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
458
8726
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
459 % This gets the underscores closer to the right width; the only change
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
460 % from standard LaTeX is the width specified.
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
461
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
462 \DeclareTextCommandDefault{\textunderscore}{%
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
463 \leavevmode \kern.06em\vbox{\hrule\@width.55em}}
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
464
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
465 % Underscore hack (only act like subscript operator if in math mode)
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
466 %
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
467 % The following is due to Mark Wooding (the old version didn't work with
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
468 % Latex 2e.
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
469
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
470 \DeclareRobustCommand\hackscore{%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
471 \ifmmode_\else\textunderscore\fi%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
472 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
473 \begingroup
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
474 \catcode`\_\active
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
475 \def\next{%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
476 \AtBeginDocument{\catcode`\_\active\def_{\hackscore{}}}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
477 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
478 \expandafter\endgroup\next
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
479
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
480
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
481 % Now for a lot of semantically-loaded environments that do a ton of magical
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
482 % things to get the right formatting and index entries for the stuff in
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
483 % Python modules and C API.
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
484
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
485
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
486 % {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
487 % 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
488 %
9078
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
489 \newcommand{\py@itemnewline}[1]{%
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
490 \@tempdima\linewidth%
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
491 \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}%
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
492 }
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
493
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
494 \newenvironment{fulllineitems}{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
495 \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
496 \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
497 \itemsep -\parsep
9078
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
498 \let\makelabel=\py@itemnewline}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
499 }{\end{list}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
500
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
501 % \optional is mostly for use in the arguments parameters to the various
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
502 % {*desc} environments defined below, but may be used elsewhere. Known to
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
503 % be used in the debugger chapter.
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
504 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
505 % Typical usage:
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
506 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
507 % \begin{funcdesc}{myfunc}{reqparm\optional{, optparm}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
508 % ^^^ ^^^
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
509 % No space here No space here
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
510 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
511 % When a function has multiple optional parameters, \optional should be
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
512 % nested, not chained. This is right:
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
513 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
514 % \begin{funcdesc}{myfunc}{\optional{parm1\optional{, parm2}}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
515 %
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
516 \newcommand{\optional}[1]{%
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
517 {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
518
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
519 % C functions ------------------------------------------------------------
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
520 % \begin{cfuncdesc}{type}{name}{arglist}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
521 \newenvironment{cfuncdesc}[3]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
522 \begin{fulllineitems}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
523 \item[\code{#1 \bfcode{#2}(\py@varvars{#3})}\index{#2@{\py@idxcode{#2()}}}]
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
524 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
525
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
526 % C variables ------------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
527 % \begin{cvardesc}{type}{name}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
528 \newenvironment{cvardesc}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
529 \begin{fulllineitems}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
530 \item[\code{#1 \bfcode{#2}}\index{#2@{\py@idxcode{#2}}}]
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
531 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
532
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
533 % C data types -----------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
534 % \begin{ctypedesc}{typedef name}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
535 \newenvironment{ctypedesc}[1]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
536 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
537 \item[\bfcode{#1}\ttindex{#1}]
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
538 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
539
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
540 % simple functions (not methods) -----------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
541 % \begin{funcdesc}{name}{args}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
542 \newcommand{\funcline}[2]{\funclineni{#1}{#2}\ttindex{#1()}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
543 \newenvironment{funcdesc}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
544 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
545 \funcline{#1}{#2}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
546 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
547
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
548 % similar to {funcdesc}, but doesn't add to the index
8075
e39145a13096 Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents: 8067
diff changeset
549 \newcommand{\funclineni}[2]{\item[\code{\bfcode{#1}(\py@varvars{#2})}]}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
550 \newenvironment{funcdescni}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
551 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
552 \funclineni{#1}{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
553 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
554
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
555 % classes ----------------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
556 % \begin{classdesc}{name}{constructor args}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
557 \newenvironment{classdesc}[2]{
9524
c6a1103efa8a Minor nit that fixes a bunch of indexing: the way the classdesc
Fred Drake <fdrake@acm.org>
parents: 9078
diff changeset
558 % Using \renewcommand doesn't work for this, for unknown reasons:
c6a1103efa8a Minor nit that fixes a bunch of indexing: the way the classdesc
Fred Drake <fdrake@acm.org>
parents: 9078
diff changeset
559 \global\def\py@thisclass{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
560 \begin{fulllineitems}
8075
e39145a13096 Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents: 8067
diff changeset
561 \item[\code{\bfcode{#1}(\py@varvars{#2})}%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
562 \withsubitem{(class in \py@thismodule)}{\ttindex{#1}}]
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
563 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
564
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
565
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
566 \let\py@classbadkey=\@undefined
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
567
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
568 % object method ----------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
569 % \begin{methoddesc}[classname]{methodname}{args}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
570 \newcommand{\methodline}[3][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
571 \methodlineni{#2}{#3}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
572 \ifx#1\@undefined
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
573 \withsubitem{(\py@thisclass\ method)}{\ttindex{#2()}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
574 \else
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
575 \withsubitem{(#1 method)}{\ttindex{#2()}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
576 \fi
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
577 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
578 \newenvironment{methoddesc}[3][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
579 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
580 \ifx#1\@undefined
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
581 \methodline{#2}{#3}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
582 \else
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
583 \def\py@thisclass{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
584 \methodline[#1]{#2}{#3}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
585 \fi
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
586 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
587
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
588 % similar to {methoddesc}, but doesn't add to the index
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
589 % (never actually uses the optional argument)
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
590 \newcommand{\methodlineni}[3][\py@classbadkey]{%
8075
e39145a13096 Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents: 8067
diff changeset
591 \item[\code{\bfcode{#2}(\py@varvars{#3})}]}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
592 \newenvironment{methoddescni}[3][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
593 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
594 \methodlineni{#2}{#3}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
595 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
596
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
597 % object data attribute --------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
598 % \begin{memberdesc}[classname]{membername}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
599 \newcommand{\memberline}[2][\py@classbadkey]{%
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
600 \ifx#1\@undefined
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
601 \memberlineni{#2}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
602 \withsubitem{(\py@thisclass\ attribute)}{\ttindex{#2}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
603 \else
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
604 \memberlineni{#2}
7898
6a0299ebccef Data attributes of objects should not be indexed with trailing parentheses!
Fred Drake <fdrake@acm.org>
parents: 7850
diff changeset
605 \withsubitem{(#1 attribute)}{\ttindex{#2}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
606 \fi
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
607 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
608 \newenvironment{memberdesc}[2][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
609 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
610 \ifx#1\@undefined
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
611 \memberline{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
612 \else
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
613 \def\py@thisclass{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
614 \memberline[#1]{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
615 \fi
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
616 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
617
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
618 % similar to {memberdesc}, but doesn't add to the index
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
619 % (never actually uses the optional argument)
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
620 \newcommand{\memberlineni}[2][\py@classbadkey]{\item[\bfcode{#2}]}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
621 \newenvironment{memberdescni}[2][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
622 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
623 \memberlineni{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
624 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
625
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
626 % For exceptions: --------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
627 % \begin{excdesc}{name}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
628 % -- need support for constructor; maybe use optional parameter?
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
629 \newenvironment{excdesc}[1]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
630 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
631 \item[\bfcode{#1}\ttindex{#1}]
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
632 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
633
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
634 % Module data or constants: ----------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
635 % \begin{datadesc}{name}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
636 \newcommand{\dataline}[1]{\datalineni{#1}\ttindex{#1}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
637 \newenvironment{datadesc}[1]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
638 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
639 \dataline{#1}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
640 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
641
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
642 % similar to {datadesc}, but doesn't add to the index
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
643 \newcommand{\datalineni}[1]{\item[\bfcode{#1}]\nopagebreak}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
644 \newenvironment{datadescni}[1]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
645 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
646 \datalineni{#1}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
647 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
648
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
649 % bytecode instruction ---------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
650 % \begin{opcodedesc}{name}{var}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
651 % -- {var} may be {}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
652 \newenvironment{opcodedesc}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
653 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
654 \item[\bfcode{#1}\quad\var{#2}]
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
655 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
656
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
657
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
658 \newcommand{\nodename}[1]{\label{#1}}
7740
423be7cd0479 Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents: 7737
diff changeset
659
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
660 % 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
661 % {\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
662 \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
663 \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
664 \newcommand{\POSIX}{POSIX}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
665 \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
666 \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
667 \newcommand{\C}{C}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
668 \newcommand{\EOF}{{\sc eof}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
669 \newcommand{\NULL}{\constant{NULL}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
670
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
671 % Also for consistency: spell Python "Python", not "python"!
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
672
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
673 % 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
674 \newcommand{\code}[1]{{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
675 \texttt{#1}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
676
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
677 \newcommand{\bfcode}[1]{\code{\bfseries#1}} % bold-faced code font
8609
ce295bfacef3 Fix the \kbd definition so it didn't leave the courier face on.
Fred Drake <fdrake@acm.org>
parents: 8396
diff changeset
678 \newcommand{\kbd}[1]{\code{#1}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
679 \newcommand{\samp}[1]{`\code{#1}'}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
680 % 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
681 % italics, and won't get funky in code fragments when we play around
9542
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
682 % with fonts. This also works directly in math mode.
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
683 \newcommand{\var}[1]{%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
684 \ifmmode%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
685 \hbox{\normalsize\textrm{\textit{#1\/}}}%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
686 \else%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
687 \normalsize\textrm{\textit{#1\/}}%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
688 \fi%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
689 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
690 \renewcommand{\emph}[1]{{\em #1}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
691 \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
692 \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
693 % let's experiment with a new font:
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
694 \newcommand{\file}[1]{`{\small\textsf{#1}}'}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
695
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
696 % 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
697 % but only if we actually used hyperref:
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
698 \@ifundefined{pdfannotlink}{
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
699 \newcommand{\py@url}[1]{\mbox{\small\textsf{#1}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
700 }{
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
701 \newcommand{\py@url}[1]{{%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
702 \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
703 \py@LinkColor% color of the link text
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
704 \mbox{\small\textsf{#1}}%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
705 \py@NormalColor% Turn it back off; these are declarative
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
706 \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
707 }% formatting "box".
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
708 }
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
709 \let\url=\py@url
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
710 \newcommand{\email}[1]{{\small\textsf{#1}}}
7778
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
711 \newcommand{\newsgroup}[1]{{\small\textsf{#1}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
712
8075
e39145a13096 Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents: 8067
diff changeset
713 \newcommand{\py@varvars}[1]{{\def\,{\/{\char`\,}}\var{#1}}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
714 % let's see if this breaks anything now; we may be able to simplify...
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
715 \renewcommand{\py@varvars}[1]{\var{#1}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
716
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
717 % I'd really like to get rid of this!
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
718 \newif\iftexi\texifalse
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
719
8779
9138272c1fe6 Define stuff to allow simple HTML-only selection using TeX's \if<foo>...\fi
Fred Drake <fdrake@acm.org>
parents: 8762
diff changeset
720 % This is used to get l2h to put the copyright and abstract on
9138272c1fe6 Define stuff to allow simple HTML-only selection using TeX's \if<foo>...\fi
Fred Drake <fdrake@acm.org>
parents: 8762
diff changeset
721 % a separate HTML page.
9138272c1fe6 Define stuff to allow simple HTML-only selection using TeX's \if<foo>...\fi
Fred Drake <fdrake@acm.org>
parents: 8762
diff changeset
722 \newif\ifhtml\htmlfalse
9138272c1fe6 Define stuff to allow simple HTML-only selection using TeX's \if<foo>...\fi
Fred Drake <fdrake@acm.org>
parents: 8762
diff changeset
723
9138272c1fe6 Define stuff to allow simple HTML-only selection using TeX's \if<foo>...\fi
Fred Drake <fdrake@acm.org>
parents: 8762
diff changeset
724
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
725 % 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
726 % 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
727 % 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
728 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
729 % 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
730 % 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
731 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
732 \newcommand{\module}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
733 \newcommand{\keyword}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
734 \newcommand{\exception}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
735 \newcommand{\class}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
736 \newcommand{\function}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
737 \newcommand{\member}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
738 \newcommand{\method}[1]{\texttt{#1}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
739
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
740 \newcommand{\pytype}[1]{#1} % built-in Python type
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
741
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
742 \newcommand{\cfunction}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
743 \newcommand{\ctype}[1]{\texttt{#1}} % C struct or typedef name
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
744 \newcommand{\cdata}[1]{\texttt{#1}} % C variable, typically global
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
745
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
746 \newcommand{\mimetype}[1]{{\small\textsf{#1}}}
7670
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
747 % The \! is a "negative thin space" in math mode.
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
748 \newcommand{\regexp}[1]{%
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
749 {\tiny$^{^\lceil}\!\!$%
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
750 {\normalsize\code{#1}}%
7850
db1e49d51fe1 Increase space between the end of a regexp and the little right floor symbol
Fred Drake <fdrake@acm.org>
parents: 7801
diff changeset
751 $\!\rfloor\!$%
7670
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
752 }}
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
753 \newcommand{\envvar}[1]{%
7670
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
754 \$#1% $ <-- bow to font-lock 3 times!
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
755 \index{#1@{\$#1}}% $
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
756 \index{environment variables!{\$#1}}% $
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
757 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
758 \newcommand{\makevar}[1]{#1} % variable in a Makefile
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
759 \newcommand{\character}[1]{\samp{#1}}
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
760
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
761 % constants defined in Python modules or C headers, not language constants:
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
762 \newcommand{\constant}[1]{\code{#1}} % manifest constant, not syntactic
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
763
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
764 \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
765 \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
766 \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
767
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
768
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
769 % Deprecation stuff.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
770 % 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
771 % 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
772 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
773 % 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
774 % 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
775 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
776 % Example:
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
777 % \deprecated{1.5.1}{Use \method{frobnicate()} instead.}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
778 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
779 \newcommand{\deprecated}[2]{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
780 \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
781
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
782 % New stuff.
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
783 % This should be used to mark things which have been added to the
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
784 % development tree but that aren't in the release, but are documented.
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
785 % This allows release of documentation that already includes updated
10077
80b215249b17 Make \versionadded and \versionchanged less prominant -- neither bold
Fred Drake <fdrake@acm.org>
parents: 9968
diff changeset
786 % descriptions. Place at end of descriptor environment.
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
787 %
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
788 % Example:
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
789 % \versionadded{1.5.2}
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
790 %
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
791 \newcommand{\versionadded}[1]{%
10077
80b215249b17 Make \versionadded and \versionchanged less prominant -- neither bold
Fred Drake <fdrake@acm.org>
parents: 9968
diff changeset
792 { New in version #1. }}
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
793 \newcommand{\versionchanged}[1]{%
10077
80b215249b17 Make \versionadded and \versionchanged less prominant -- neither bold
Fred Drake <fdrake@acm.org>
parents: 9968
diff changeset
794 { Changed in version #1. }}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
795
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
796
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
797 % Tables.
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
798 %
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
799 \newenvironment{tableii}[4]{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
800 \begin{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
801 \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}%
8018
011ae71fea96 Lighten up tables.
Fred Drake <fdrake@acm.org>
parents: 7898
diff changeset
802 \begin{tabular}{#1}\strong{#3}&\strong{#4} \\ \hline%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
803 }{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
804 \end{tabular}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
805 \end{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
806 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
807
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
808 \newenvironment{tableiii}[5]{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
809 \begin{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
810 \def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}%
8018
011ae71fea96 Lighten up tables.
Fred Drake <fdrake@acm.org>
parents: 7898
diff changeset
811 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5} \\ \hline%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
812 }{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
813 \end{tabular}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
814 \end{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
815 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
816
8751
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
817 \newenvironment{tableiv}[6]{%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
818 \begin{center}%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
819 \def\lineiv##1##2##3##4{\csname#2\endcsname{##1}&##2&##3&##4\\}%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
820 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6} \\%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
821 \hline%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
822 }{%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
823 \end{tabular}%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
824 \end{center}%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
825 }
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
826
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
827 % Cross-referencing (AMK, new impl. FLD)
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
828 % Sample usage:
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
829 % \begin{seealso}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
830 % \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
831 % \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
832 %
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
833 % % 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
834 % \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
835 %
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
836 % \end{seealso}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
837
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
838 \@ifundefined{pdfannotlink}{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
839 \newcommand{\py@seemodule}[3][\py@modulebadkey]{%
9868
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
840 \par%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
841 \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
842 \ref{module-\py@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
843 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
844 \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
845 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
846 }{\newcommand{\py@seemodule}[3][\py@modulebadkey]{%
9868
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
847 \par%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
848 \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
849 \ref{module-\py@modulekey}:\quad %
9968
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
850 \py@linkToName{label-module-\py@modulekey}{ Module \module{#2} }
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
851 \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
852 }
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
853 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
854 \newenvironment{seealso}[0]{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
855 \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
856 \def\seetext##1{\par{##1}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
857 \let\seemodule=\py@seemodule
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
858 }{\par}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
859
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
860
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
861 % Allow the Python release number to be specified independently of the
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
862 % \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
863 % 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
864 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
865 \newcommand{\py@release}{}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
866 \newcommand{\version}{}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
867 \newcommand{\releasename}{Release}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
868 \newcommand{\release}[1]{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
869 \renewcommand{\py@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
870 \renewcommand{\version}{#1}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
871
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
872 % 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
873 % 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
874 % 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
875 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
876 \newcommand{\py@authoraddress}{}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
877 \newcommand{\authoraddress}[1]{\renewcommand{\py@authoraddress}{#1}}
8341
ebfde06fdb8d Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8306
diff changeset
878 \let\developersaddress=\authoraddress
ebfde06fdb8d Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8306
diff changeset
879 \let\developer=\author
ebfde06fdb8d Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8306
diff changeset
880 \let\developers=\author
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
881
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
882 % 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
883 % 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
884 %
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
885 \@ifundefined{ChTitleVar}{}{
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
886 \ChNameVar{\raggedleft\normalsize\py@HeaderFamily}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
887 \ChNumVar{\raggedleft \bfseries\Large\py@HeaderFamily}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
888 \ChTitleVar{\raggedleft \rm\Huge\py@HeaderFamily}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
889 % 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
890 \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
891 {\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
892 \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
893 \DOCH
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
894 \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
895 \interlinepenalty\@M
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
896 \DOTI{#1}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
897 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
898 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
899 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
900
8396
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
901
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
902 % Definition lists; requested by AMK for HOWTO documents. Probably useful
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
903 % elsewhere as well, so keep in in the general style support.
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
904 %
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
905 \newenvironment{definitions}{%
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
906 \begin{description}%
9078
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
907 \def\term##1{\item[##1]\mbox{}\\*[0mm]}
8396
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
908 }{%
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
909 \end{description}%
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
910 }
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
911
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
912 % 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
913 \hyphenation{Base-HTTP-Re-quest-Hand-ler}