annotate Doc/texinputs/python.sty @ 14722:4d2e9cf1eb20 legacy-trunk

Add new environments: longtableii, longtableiii, and longtableiv, to support long tables which might break across page boundaries. Otherwise identical to tableii, tableiii, and tableiv.
author Fred Drake <fdrake@acm.org>
date Thu, 21 Sep 2000 15:58:02 +0000
parents 219e00221c84
children 5d2a2185c651
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
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
9 \RequirePackage{longtable}
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
10
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
11 % Uncomment these two lines to ignore the paper size and make the page
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
12 % size more like a typical published manual.
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
13 %\renewcommand{\paperheight}{9in}
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
14 %\renewcommand{\paperwidth}{8.5in} % typical squarish manual
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
15 %\renewcommand{\paperwidth}{7in} % O'Reilly ``Programmming Python''
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
16
7778
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
17 % These packages can be used to add marginal annotations which indicate
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
18 % index entries and labels; useful for reviewing this messy documentation!
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
19 %
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
20 %\RequirePackage{showkeys}
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
21 %\RequirePackage{showidx}
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
22
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
23 % 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
24 % (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
25 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
26 \newif\ifpy@doing@page@targets
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
27 \py@doing@page@targetsfalse
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
28
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
29 \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
30 \else
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
31 \input{pdfcolor}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
32 \let\py@LinkColor=\NavyBlue
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
33 \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
34 \pdfcompresslevel=9
8306
4674cd2f6f07 Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents: 8229
diff changeset
35 \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
36 \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
37 %
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
38 % 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
39 % of any other.
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
40 %
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
41 \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
42 \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
43 %
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
44 % 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
45 % 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
46 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
47 \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
48 %
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
49 % 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
50 % 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
51 % 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
52 % this style file.
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
53 \newcommand{\py@linkToName}[2]{%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
54 \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
55 \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
56 \pdfendlink%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
57 }
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
58 % 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
59 % \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
60 \renewcommand{\contentsline}[3]{%
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
61 \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
62 \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
63 }
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
64 \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
65 \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
66 }
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
67 \newcommand{\py@target}[1]{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
68 \ifpy@doing@page@targets%
10451
2b1dfc13951d Use more recent option to \pdfdest to not change the zoom factor.
Fred Drake <fdrake@acm.org>
parents: 10423
diff changeset
69 {\pdfdest name{#1} xyz}%
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
70 \fi%
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
71 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
72 \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
73 \renewcommand{\label}[1]{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
74 \py@OldLabel{#1}%
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
75 \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
76 }
8306
4674cd2f6f07 Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents: 8229
diff changeset
77 % 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
78 % 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
79 % 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
80 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
81 % 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
82 %
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
83 \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
84 \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
85 \@hyperfixhead
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
86 }
7597
39b84a3dceaa Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents: 7592
diff changeset
87 \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
88 \let\H@old@thehead\@thehead
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
89 \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
90 \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
91 \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
92 \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
93 }
7737
5d7e4d20c89e Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents: 7706
diff changeset
94 \fi\fi
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
95
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
96 % 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
97 \topmargin 0pt
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
98 \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
99 \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
100
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
101 % attempt to work a little better for A4 users
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
102 \textheight \paperheight
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
103 \advance\textheight by -2in
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
104
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
105 \oddsidemargin 0pt
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
106 \evensidemargin 0pt
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
107 %\evensidemargin -.25in % for ``manual size'' documents
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
108 \marginparwidth 0.5in
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
109
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
110 \textwidth \paperwidth
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
111 \advance\textwidth by -2in
7527
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
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
114 % 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
115 \raggedbottom
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
116 \sloppy
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
117 \parindent = 0mm
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
118 \parskip = 2mm
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
119 \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
120
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
121 \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
122 \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
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
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
165 \let\py@OldVerbatim=\verbatim
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
166 \let\py@OldEndVerbatim=\endverbatim
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
167 \RequirePackage{verbatim}
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
168
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
169 % Variable used by begin code command
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
170 \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
171
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
172 \renewcommand{\verbatim}{%
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
173 \setlength{\parindent}{1cm}%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
174 % 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
175 \setlength{\py@codewidth}{\linewidth}%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
176 \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
177 %
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
178 \par\indent%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
179 \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
180 \small%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
181 \py@OldVerbatim%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
182 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
183 \renewcommand{\endverbatim}{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
184 \py@OldEndVerbatim%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
185 \end{minipage}%
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
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
188
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
189 \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
190
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 %% 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
193
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
194 % 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
195 % 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
196 % 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
197 % 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
198 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
199 \newcommand{\py@idxcode}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
200 %\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
201
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
202 % 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
203 \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
204
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
205 % 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
206 \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
207
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
208 % 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
209 \newcommand{\indexiv}[4]{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
210 \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
211 \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
212 \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
213 \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
214 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
215
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
216 % 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
217 % operator.
8229
df752c08b462 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8190
diff changeset
218 \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
219 \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
220 \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
221 \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
222 \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
223 \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
224
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
225 % 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
226 \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
227 \newcommand{\refmodindex}[1]{\py@refmodule{#1}{}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
228 \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
229 \newcommand{\refexmodindex}[1]{\py@refmodule{#1}{extension }}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
230 \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
231
9868
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
232 % 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
233 % 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
234 \@ifundefined{pdfannotlink}{%
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
235 \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
236 }{%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
237 \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
238 \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
239 \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
240 }
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
241 }
a58f36352c4f \seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents: 9542
diff changeset
242
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
243 % support for the module index
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
244 \newif\ifpy@UseModuleIndex
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
245 \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
246
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
247 \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
248 \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
249 \openout\modindexfile=mod\jobname.idx
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
250 \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
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
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
253 % 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
254 \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
255 \renewcommand{\py@thismodule}{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
256 \setindexsubitem{(in module #1)}%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
257 \index{#1@{\py@idxcode{#1}} (#2module)|textbf}%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
258 \ifpy@UseModuleIndex%
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
259 \@ifundefined{py@modplat@\py@thismodulekey}{
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
260 \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
261 }{\write\modindexfile{\protect\indexentry{#1@{\texttt{#1} %
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
262 \emph{(\py@platformof[\py@thismodulekey]{})}}}{\thepage}}%
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
263 }
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
264 \fi%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
265 }
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
266
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
267 % *** XXX *** THE NEXT FOUR MACROS ARE NOW OBSOLETE !!! ***
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
268
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
269 % built-in & Python modules in the main distribution
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
270 \newcommand{\bimodindex}[1]{\py@modindex{#1}{built-in }%
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
271 \typeout{*** MACRO bimodindex IS OBSOLETE -- USE declaremodule INSTEAD!}}
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
272 \newcommand{\stmodindex}[1]{\py@modindex{#1}{standard }%
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
273 \typeout{*** MACRO stmodindex IS OBSOLETE -- USE declaremodule INSTEAD!}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
274
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
275 % Python & extension modules outside the main distribution
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
276 \newcommand{\modindex}[1]{\py@modindex{#1}{}%
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
277 \typeout{*** MACRO modindex IS OBSOLETE -- USE declaremodule INSTEAD!}}
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
278 \newcommand{\exmodindex}[1]{\py@modindex{#1}{extension }%
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
279 \typeout{*** MACRO exmodindex IS OBSOLETE -- USE declaremodule INSTEAD!}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
280
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
281 % Additional string for an index entry
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
282 \newif\ifpy@usingsubitem\py@usingsubitemfalse
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
283 \newcommand{\py@indexsubitem}{}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
284 \newcommand{\setindexsubitem}[1]{\renewcommand{\py@indexsubitem}{ #1}%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
285 \py@usingsubitemtrue}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
286 \newcommand{\ttindex}[1]{%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
287 \ifpy@usingsubitem
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
288 \index{#1@{\py@idxcode{#1}}\py@indexsubitem}%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
289 \else%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
290 \index{#1@{\py@idxcode{#1}}}%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
291 \fi%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
292 }
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
293 \newcommand{\withsubitem}[2]{%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
294 \begingroup%
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
295 \ifpy@usingsubitem%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
296 \def\index@subitem{#1}#2%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
297 \else%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
298 \def\index@subitem{#1}#2%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
299 \py@usingsubitemfalse%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
300 \fi
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
301 \endgroup%
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
302 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
303
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
304
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
305 % Module synopsis processing -----------------------------------------------
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
306 %
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
307 \newcommand{\py@thisclass}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
308 \newcommand{\py@thismodule}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
309 \newcommand{\py@thismodulekey}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
310 \newcommand{\py@thismoduletype}{}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
311
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
312 \newcommand{\py@standardIndexModule}[1]{\py@modindex{#1}{standard }}
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
313 \newcommand{\py@builtinIndexModule}[1]{\py@modindex{#1}{built-in }}
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
314 \newcommand{\py@extensionIndexModule}[1]{\py@modindex{#1}{extension }}
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
315 \newcommand{\py@IndexModule}[1]{\py@modindex{#1}{}}
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
316
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
317 \newif\ifpy@HaveModSynopsis \py@HaveModSynopsisfalse
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
318 \newif\ifpy@ModSynopsisFileIsOpen \py@ModSynopsisFileIsOpenfalse
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
319 \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
320
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
321 % \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
322 \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
323 \py@openModSynopsisFile
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
324 \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
325 \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
326 \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
327 \else
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
328 \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
329 \fi
10855
28887f40e344 \declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
330 \@ifundefined{py@#2IndexModule}{%
28887f40e344 \declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
331 \typeout{*** MACRO declaremodule called with unknown module type: `#2'}
10856
be0ac5abe83b \declaremodule: Typo.
Fred Drake <fdrake@acm.org>
parents: 10855
diff changeset
332 \py@IndexModule{#3}%
10855
28887f40e344 \declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
333 }{%
28887f40e344 \declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
334 \csname py@#2IndexModule\endcsname{#3}%
28887f40e344 \declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
335 }
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
336 \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
337 }
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
338 \newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
339 \newcommand{\py@ModPlatformFilename}{\jobname.pla}
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
340 \newcommand{\platform}[1]{
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
341 \ifpy@ModPlatformFileIsOpen\else
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
342 \newwrite\py@ModPlatformFile
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
343 \openout\py@ModPlatformFile=\py@ModPlatformFilename
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
344 \py@ModPlatformFileIsOpentrue
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
345 \fi
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
346 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
347 \InputIfFileExists{\jobname.pla}{}{}
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
348 \newcommand{\py@platformof}[2][\py@modulebadkey]{%
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
349 \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
350 \else \def\py@key{#1}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
351 \fi%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
352 \csname py@modplat@\py@key\endcsname%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
353 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
354 \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
355
8916
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
356 % \moduleauthor{name}{email}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
357 \newcommand{\moduleauthor}[2]{}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
358
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
359 % \sectionauthor{name}{email}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
360 \newcommand{\sectionauthor}[2]{}
6b633df41e59 \moduleauthor,
Fred Drake <fdrake@acm.org>
parents: 8779
diff changeset
361
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
362
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
363 \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
364 \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
365 \newcommand{\modulesynopsis}[1]{
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
366 \py@HaveModSynopsistrue
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
367 \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
368 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
369
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
370 % define the file
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
371 \newwrite\py@ModSynopsisFile
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
372
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
373 % 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
374 \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
375 \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
376 {\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
377 {\string#1}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
378 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
379 \newcommand{\py@closeModSynopsisFile}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
380 \ifpy@ModSynopsisFileIsOpen
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
381 \closeout\py@ModSynopsisFile
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
382 \py@ModSynopsisFileIsOpenfalse
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
383 \fi
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
384 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
385 \newcommand{\py@openModSynopsisFile}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
386 \ifpy@ModSynopsisFileIsOpen\else
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
387 \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
388 \py@ModSynopsisFileIsOpentrue
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
389 \fi
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
390 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
391
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
392 \newcommand{\py@ProcessModSynopsis}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
393 \ifpy@HaveModSynopsis
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
394 \py@writeModSynopsisFile{\modulesynopsis%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
395 {\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
396 {\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
397 \py@HaveModSynopsisfalse
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
398 \fi
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
399 \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
400 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
401 \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
402
10328
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
403
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
404 \long\def\py@writeModPlatformFile#1{%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
405 \protected@write\py@ModPlatformFile%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
406 {\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
407 {\string#1}%
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
408 }
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
409
f438c6e2b6c1 Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
410
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
411 \newcommand{\localmoduletable}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
412 \IfFileExists{\py@ModSynopsisFilename}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
413 \begin{synopsistable}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
414 \input{\py@ModSynopsisFilename}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
415 \end{synopsistable}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
416 }{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
417 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
418
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
419 \@ifundefined{pdfoutput}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
420 \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
421 }{
9968
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
422 \newcommand{\py@ModSynopsisSummary}[4]{%
485502c42d89 \py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents: 9958
diff changeset
423 \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
424 }
8713
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 \newenvironment{synopsistable}{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
427 % 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
428 \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
429 \begin{tabular}{ll}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
430 }{
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
431 \end{tabular}
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 % --------------------------------------------------------------------------
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
435
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
436
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
437 \newcommand{\py@reset}{
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
438 \py@usingsubitemfalse
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
439 \py@ProcessModSynopsis
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
440 \renewcommand{\py@thisclass}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
441 \renewcommand{\py@thismodule}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
442 \renewcommand{\py@thismodulekey}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
443 \renewcommand{\py@thismoduletype}{}
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
444 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
445
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
446 % 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
447 % 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
448 \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
449 \@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
450 {-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
451 {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
452 {\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
453 \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
454 {-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
455 {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
456 {\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
457 \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
458 {-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
459 {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
460 {\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
461 \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
462 {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
463 {-1em}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
464 {\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
465 \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
466 {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
467 {-1em}%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
468 {\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
469
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
470
8726
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
471 % 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
472 % 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
473
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
474 \DeclareTextCommandDefault{\textunderscore}{%
74ea4dfda82d \textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents: 8713
diff changeset
475 \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
476
8713
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
477 % 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
478 %
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
479 % 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
480 % Latex 2e.
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
481
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
482 \DeclareRobustCommand\hackscore{%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
483 \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
484 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
485 \begingroup
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
486 \catcode`\_\active
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
487 \def\next{%
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
488 \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
489 }
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
490 \expandafter\endgroup\next
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
491
ed8f4e2eb11a Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents: 8609
diff changeset
492
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
493 % 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
494 % 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
495 % 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
496
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
497
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
498 % {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
499 % 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
500 %
9078
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
501 \newcommand{\py@itemnewline}[1]{%
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
502 \@tempdima\linewidth%
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
503 \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}%
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
504 }
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
505
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
506 \newenvironment{fulllineitems}{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
507 \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
508 \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
509 \itemsep -\parsep
9078
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
510 \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
511 }{\end{list}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
512
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
513 % \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
514 % {*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
515 % be used in the debugger chapter.
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
516 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
517 % Typical usage:
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
518 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
519 % \begin{funcdesc}{myfunc}{reqparm\optional{, optparm}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
520 % ^^^ ^^^
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
521 % No space here No space here
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
522 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
523 % 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
524 % nested, not chained. This is right:
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
525 %
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
526 % \begin{funcdesc}{myfunc}{\optional{parm1\optional{, parm2}}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
527 %
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
528 \let\py@badkey=\@undefined
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
529
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
530 \newcommand{\optional}[1]{%
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
531 {\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
532
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
533 % This can be used when a function or method accepts an varying number
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
534 % of arguments, such as by using the *args syntax in the parameter list.
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
535 \newcommand{\py@moreargs}{...}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
536
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
537 % This can be used when you don't want to document the parameters to a
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
538 % function or method, but simply state that it's an alias for
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
539 % something else.
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
540 \newcommand{\py@unspecified}{...}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
541
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
542 % C functions ------------------------------------------------------------
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
543 % \begin{cfuncdesc}[refcount]{type}{name}{arglist}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
544 % Note that the [refcount] slot should only be filled in by
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
545 % tools/anno-api.py; it pulls the value from the refcounts database.
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
546 \newenvironment{cfuncdesc}[4][\py@badkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
547 \begin{fulllineitems}
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
548 \item[\code{#2 \bfcode{#3}(\py@varvars{#4})}\index{#3@{\py@idxcode{#3()}}}]
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
549 \ifx#1\@undefined\else%
12346
24d4116897dd cfuncdesc environment:
Fred Drake <fdrake@acm.org>
parents: 12215
diff changeset
550 \emph{Return value: \textbf{#1}.}\\
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
551 \fi
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
552 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
553
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
554 % C variables ------------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
555 % \begin{cvardesc}{type}{name}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
556 \newenvironment{cvardesc}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
557 \begin{fulllineitems}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
558 \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
559 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
560
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
561 % C data types -----------------------------------------------------------
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
562 % \begin{ctypedesc}[index name]{typedef name}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
563 \newenvironment{ctypedesc}[2][\py@badkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
564 \begin{fulllineitems}
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
565 \item[\bfcode{#2}%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
566 \ifx#1\@undefined%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
567 \withsubitem{(C type)}{\ttindex{#2}}%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
568 \else%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
569 \withsubitem{(C type)}{\ttindex{#1}}%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
570 \fi]
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
571 }{\end{fulllineitems}}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
572
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
573 % Funky macros -----------------------------------------------------------
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
574 % \begin{csimplemacro}{name}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
575 % -- "simple" because it has no args; NOT for constant definitions!
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
576 \newenvironment{csimplemacrodesc}[1]{
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
577 \begin{fulllineitems}
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
578 \item[\bfcode{#1}\withsubitem{(macro)}{\ttindex{#1}}]
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
579 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
580
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
581 % simple functions (not methods) -----------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
582 % \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
583 \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
584 \newenvironment{funcdesc}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
585 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
586 \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
587 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
588
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
589 % 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
590 \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
591 \newenvironment{funcdescni}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
592 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
593 \funclineni{#1}{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
594 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
595
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
596 % classes ----------------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
597 % \begin{classdesc}{name}{constructor args}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
598 \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
599 % 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
600 \global\def\py@thisclass{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
601 \begin{fulllineitems}
8075
e39145a13096 Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents: 8067
diff changeset
602 \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
603 \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
604 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
605
14490
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
606 % \begin{excclassdesc}{name}{constructor args}
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
607 % but indexes as an exception
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
608 \newenvironment{excclassdesc}[2]{
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
609 % Using \renewcommand doesn't work for this, for unknown reasons:
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
610 \global\def\py@thisclass{#1}
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
611 \begin{fulllineitems}
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
612 \item[\code{\bfcode{#1}(\py@varvars{#2})}%
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
613 \withsubitem{(exception in \py@thismodule)}{\ttindex{#1}}]
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
614 }{\end{fulllineitems}}
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
615
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
616
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
617 \let\py@classbadkey=\@undefined
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
618
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
619 % object method ----------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
620 % \begin{methoddesc}[classname]{methodname}{args}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
621 \newcommand{\methodline}[3][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
622 \methodlineni{#2}{#3}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
623 \ifx#1\@undefined
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
624 \withsubitem{(\py@thisclass\ method)}{\ttindex{#2()}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
625 \else
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
626 \withsubitem{(#1 method)}{\ttindex{#2()}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
627 \fi
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
628 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
629 \newenvironment{methoddesc}[3][\py@classbadkey]{
7764
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 \ifx#1\@undefined
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
632 \methodline{#2}{#3}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
633 \else
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
634 \def\py@thisclass{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
635 \methodline[#1]{#2}{#3}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
636 \fi
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
637 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
638
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
639 % 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
640 % (never actually uses the optional argument)
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
641 \newcommand{\methodlineni}[3][\py@classbadkey]{%
8075
e39145a13096 Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents: 8067
diff changeset
642 \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
643 \newenvironment{methoddescni}[3][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
644 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
645 \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
646 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
647
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
648 % object data attribute --------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
649 % \begin{memberdesc}[classname]{membername}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
650 \newcommand{\memberline}[2][\py@classbadkey]{%
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
651 \ifx#1\@undefined
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
652 \memberlineni{#2}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
653 \withsubitem{(\py@thisclass\ attribute)}{\ttindex{#2}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
654 \else
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
655 \memberlineni{#2}
7898
6a0299ebccef Data attributes of objects should not be indexed with trailing parentheses!
Fred Drake <fdrake@acm.org>
parents: 7850
diff changeset
656 \withsubitem{(#1 attribute)}{\ttindex{#2}}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
657 \fi
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
658 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
659 \newenvironment{memberdesc}[2][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
660 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
661 \ifx#1\@undefined
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
662 \memberline{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
663 \else
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
664 \def\py@thisclass{#1}
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
665 \memberline[#1]{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
666 \fi
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
667 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
668
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
669 % 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
670 % (never actually uses the optional argument)
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
671 \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
672 \newenvironment{memberdescni}[2][\py@classbadkey]{
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
673 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
674 \memberlineni{#2}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
675 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
676
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
677 % For exceptions: --------------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
678 % \begin{excdesc}{name}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
679 % -- 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
680 \newenvironment{excdesc}[1]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
681 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
682 \item[\bfcode{#1}\ttindex{#1}]
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
683 }{\end{fulllineitems}}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
684
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
685 % Module data or constants: ----------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
686 % \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
687 \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
688 \newenvironment{datadesc}[1]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
689 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
690 \dataline{#1}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
691 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
692
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
693 % 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
694 \newcommand{\datalineni}[1]{\item[\bfcode{#1}]\nopagebreak}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
695 \newenvironment{datadescni}[1]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
696 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
697 \datalineni{#1}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
698 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
699
7764
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
700 % bytecode instruction ---------------------------------------------------
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
701 % \begin{opcodedesc}{name}{var}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
702 % -- {var} may be {}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
703 \newenvironment{opcodedesc}[2]{
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
704 \begin{fulllineitems}
9d0dc11775a4 Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents: 7740
diff changeset
705 \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
706 }{\end{fulllineitems}}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
707
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
708
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
709 \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
710
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
711 % 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
712 % {\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
713 \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
714 \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
715 \newcommand{\POSIX}{POSIX}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
716 \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
717 \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
718 \newcommand{\C}{C}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
719 \newcommand{\EOF}{{\sc eof}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
720 \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
721
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
722 % 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
723
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
724 % code is the most difficult one...
13234
79f8f6b963c2 Try to make sure \code always uses roman (non-italic) text.
Fred Drake <fdrake@acm.org>
parents: 12638
diff changeset
725 \newcommand{\code}[1]{\textrm{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
726 \texttt{#1}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
727
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
728 \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
729 \newcommand{\kbd}[1]{\code{#1}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
730 \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
731 % 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
732 % 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
733 % 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
734 \newcommand{\var}[1]{%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
735 \ifmmode%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
736 \hbox{\normalsize\textrm{\textit{#1\/}}}%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
737 \else%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
738 \normalsize\textrm{\textit{#1\/}}%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
739 \fi%
1437c2335b3b Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents: 9524
diff changeset
740 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
741 \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
742 \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
743 \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
744 % 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
745 \newcommand{\file}[1]{`{\small\textsf{#1}}'}
10770
fb1733b6bef5 \filenq: Like \file, but don't use single-quotes; this looks better
Fred Drake <fdrake@acm.org>
parents: 10451
diff changeset
746 \newcommand{\filenq}[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
747
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
748 % 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
749 % 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
750 \@ifundefined{pdfannotlink}{
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
751 \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
752 }{
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
753 \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
754 \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
755 \py@LinkColor% color of the link text
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
756 \mbox{\small\textsf{#1}}%
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
757 \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
758 \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
759 }% formatting "box".
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
760 }
8067
48e2349d11c6 Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents: 8066
diff changeset
761 \let\url=\py@url
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
762 \newcommand{\email}[1]{{\small\textsf{#1}}}
7778
b17d200edf62 Added some comments.
Fred Drake <fdrake@acm.org>
parents: 7764
diff changeset
763 \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
764
13834
4aebd0f2a062 \py@varvars: Merge the various definitions to be the simplist one that
Fred Drake <fdrake@acm.org>
parents: 13234
diff changeset
765 \newcommand{\py@varvars}[1]{{%
12215
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
766 {\let\unspecified=\py@unspecified%
774817285b8c Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11450
diff changeset
767 \let\moreargs=\py@moreargs%
13834
4aebd0f2a062 \py@varvars: Merge the various definitions to be the simplist one that
Fred Drake <fdrake@acm.org>
parents: 13234
diff changeset
768 \var{#1}}}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
769
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
770 % 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
771 \newif\iftexi\texifalse
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
772
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
773 % 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
774 % 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
775 \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
776
9138272c1fe6 Define stuff to allow simple HTML-only selection using TeX's \if<foo>...\fi
Fred Drake <fdrake@acm.org>
parents: 8762
diff changeset
777
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
778 % 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
779 % 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
780 % 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
781 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
782 % 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
783 % 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
784 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
785 \newcommand{\module}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
786 \newcommand{\keyword}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
787 \newcommand{\exception}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
788 \newcommand{\class}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
789 \newcommand{\function}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
790 \newcommand{\member}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
791 \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
792
7801
047996666c81 Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents: 7792
diff changeset
793 \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
794
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
795 \newcommand{\cfunction}[1]{\texttt{#1}}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
796 \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
797 \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
798
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
799 \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
800 % 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
801 \newcommand{\regexp}[1]{%
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
802 {\tiny$^{^\lceil}\!\!$%
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
803 {\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
804 $\!\rfloor\!$%
7670
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
805 }}
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
806 \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
807 \$#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
808 \index{#1@{\$#1}}% $
8e6a58019887 \regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents: 7659
diff changeset
809 \index{environment variables!{\$#1}}% $
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
810 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
811 \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
812 \newcommand{\character}[1]{\samp{#1}}
7659
869373fa0bf8 \withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents: 7617
diff changeset
813
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
814 % 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
815 \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
816
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
817 \newcommand{\manpage}[2]{{\emph{#1}(#2)}}
14490
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
818 \newcommand{\pep}[1]{PEP #1\index{Python Enhancement Proposals!PEP #1}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
819 \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
820 \newcommand{\program}[1]{\strong{#1}}
11450
0a3bb403a430 \programopt: New macro, used to mark command-line parameters in the
Fred Drake <fdrake@acm.org>
parents: 11082
diff changeset
821 \newcommand{\programopt}[1]{\strong{#1}}
12377
052fbd931492 \longprogramopt: New macro.
Fred Drake <fdrake@acm.org>
parents: 12346
diff changeset
822 % Note that \longprogramopt provides the '--'!
052fbd931492 \longprogramopt: New macro.
Fred Drake <fdrake@acm.org>
parents: 12346
diff changeset
823 \newcommand{\longprogramopt}[1]{\strong{-{}-#1}}
11450
0a3bb403a430 \programopt: New macro, used to mark command-line parameters in the
Fred Drake <fdrake@acm.org>
parents: 11082
diff changeset
824
0a3bb403a430 \programopt: New macro, used to mark command-line parameters in the
Fred Drake <fdrake@acm.org>
parents: 11082
diff changeset
825 % cited titles: \citetitle{Title of Work}
0a3bb403a430 \programopt: New macro, used to mark command-line parameters in the
Fred Drake <fdrake@acm.org>
parents: 11082
diff changeset
826 % online: \citetitle[url-to-resource]{Title of Work}
14020
b4b2612ea333 \citetitle: Format the title, not the optional URL!
Fred Drake <fdrake@acm.org>
parents: 13834
diff changeset
827 \newcommand{\citetitle}[2][URL]{\emph{#2}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
828
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
829
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
830 % Deprecation stuff.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
831 % 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
832 % 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
833 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
834 % 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
835 % 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
836 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
837 % Example:
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
838 % \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
839 %
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
840 \newcommand{\deprecated}[2]{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
841 \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
842
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
843 % New stuff.
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
844 % This should be used to mark things which have been added to the
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
845 % development tree but that aren't in the release, but are documented.
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
846 % 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
847 % descriptions. Place at end of descriptor environment.
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
848 %
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
849 % Example:
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
850 % \versionadded{1.5.2}
13234
79f8f6b963c2 Try to make sure \code always uses roman (non-italic) text.
Fred Drake <fdrake@acm.org>
parents: 12638
diff changeset
851 % \versionchanged[short explanation]{2.0}
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
852 %
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
853 \newcommand{\versionadded}[1]{%
10077
80b215249b17 Make \versionadded and \versionchanged less prominant -- neither bold
Fred Drake <fdrake@acm.org>
parents: 9968
diff changeset
854 { New in version #1. }}
12549
efd1e5d2284a \versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents: 12500
diff changeset
855 \newcommand{\versionchanged}[2][\py@badkey]{%
efd1e5d2284a \versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents: 12500
diff changeset
856 \ifx#1\@undefined%
efd1e5d2284a \versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents: 12500
diff changeset
857 { Changed in version #2. }%
efd1e5d2284a \versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents: 12500
diff changeset
858 \else%
efd1e5d2284a \versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents: 12500
diff changeset
859 { Changed in version #2:\ #1. }%
efd1e5d2284a \versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents: 12500
diff changeset
860 \fi%
efd1e5d2284a \versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents: 12500
diff changeset
861 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
862
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
863
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
864 % Tables.
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
865 %
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
866 \newenvironment{tableii}[4]{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
867 \begin{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
868 \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}%
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
869 \begin{tabular}{#1}\strong{#3}&\strong{#4} \\* \hline\hline%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
870 }{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
871 \end{tabular}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
872 \end{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
873 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
874
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
875 \newenvironment{longtableii}[4]{%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
876 \begin{center}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
877 \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
878 \begin{longtable}[c]{#1}\strong{#3}&\strong{#4} \\* \hline\hline\endhead%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
879 }{%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
880 \end{longtable}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
881 \end{center}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
882 }
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
883
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
884 \newenvironment{tableiii}[5]{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
885 \begin{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
886 \def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}%
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
887 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5} \\%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
888 \hline\hline%
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
889 }{%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
890 \end{tabular}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
891 \end{center}%
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
892 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
893
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
894 \newenvironment{longtableiii}[5]{%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
895 \begin{center}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
896 \def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
897 \begin{longtable}[c]{#1}\strong{#3}&\strong{#4}&\strong{#5} \\%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
898 \hline\hline\endhead%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
899 }{%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
900 \end{longtable}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
901 \end{center}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
902 }
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
903
8751
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
904 \newenvironment{tableiv}[6]{%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
905 \begin{center}%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
906 \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
907 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6} \\%
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
908 \hline\hline%
8751
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
909 }{%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
910 \end{tabular}%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
911 \end{center}%
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
912 }
99793302d10d {tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents: 8726
diff changeset
913
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
914 \newenvironment{longtableiv}[6]{%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
915 \begin{center}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
916 \def\lineiv##1##2##3##4{\csname#2\endcsname{##1}&##2&##3&##4\\}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
917 \begin{longtable}[c]{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
918 \\%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
919 \hline\hline\endhead%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
920 }{%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
921 \end{longtable}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
922 \end{center}%
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
923 }
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14555
diff changeset
924
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
925 % 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
926 % Sample usage:
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
927 % \begin{seealso}
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
928 % \seemodule{rand}{Uniform random number generator.}; % Module xref
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
929 % \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
930 %
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
931 % % A funky case: module name contains '_'; have to supply an optional key
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
932 % \seemodule[copyreg]{copy_reg}{Interface constructor registration for
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
933 % \module{pickle}.}
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
934 % \end{seealso}
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
935 %
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
936 % Note that the last parameter for \seemodule and \seetext should be complete
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
937 % sentences and be terminated with the proper punctuation.
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
938
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
939 \@ifundefined{pdfannotlink}{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
940 \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
941 \par%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
942 \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
943 \begin{fulllineitems}
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
944 \item[Module \module{#2} (section \ref{module-\py@modulekey}):]
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
945 #3
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
946 \end{fulllineitems}
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
947 }
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
948 }{\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
949 \par%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
950 \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
951 \begin{fulllineitems}
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
952 \item[\py@linkToName{label-module-\py@modulekey}{Module \module{#2}}
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
953 (section \ref{module-\py@modulekey}):]
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
954 #3
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10770
diff changeset
955 \end{fulllineitems}
7585
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
956 }
2ef0aca96f2d Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents: 7561
diff changeset
957 }
14521
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
958 % \seetitle[url]{title}{why it's interesting}
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
959 \newcommand{\py@seetitle}[3][\py@modulebadkey]{%
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
960 \par
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
961 \begin{fulllineitems}
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
962 \item[\citetitle{#2}]
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
963 \ifx\py@modulebadkey#1\else
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
964 \item[{\small{(\url{#1})}}]
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
965 \fi
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
966 #3
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
967 \end{fulllineitems}
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
968 }
14490
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
969 % \seepep{number}{title}{why it's interesting}
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
970 \newcommand{\py@seepep}[3]{%
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
971 \par%
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
972 \begin{fulllineitems}
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
973 \item[\pep{#1}, ``\emph{#2}'']
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
974 #3
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
975 \end{fulllineitems}
f78f287b3add excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents: 14020
diff changeset
976 }
12500
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
977 % \seerfc{number}{title}{why it's interesting}
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
978 \newcommand{\py@seerfc}[3]{%
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
979 \par%
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
980 \begin{fulllineitems}
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
981 \item[\rfc{#1}, ``\emph{#2}'']
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
982 #3
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
983 \end{fulllineitems}
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
984 }
12638
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
985 % \seeurl{url}{why it's interesting}
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
986 \newcommand{\py@seeurl}[2]{%
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
987 \par%
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
988 \begin{fulllineitems}
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
989 \item[\url{#1}]
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
990 #2
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
991 \end{fulllineitems}
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
992 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
993 \newenvironment{seealso}[0]{
10423
9a4baf0c57ea Add some (commented out) macros to change the page size to the size of
Fred Drake <fdrake@acm.org>
parents: 10328
diff changeset
994 \par
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
995 \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
996 \def\seetext##1{\par{##1}}
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
997 \let\seemodule=\py@seemodule
14521
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
998 \let\seepep=\py@seepep
12500
eb433efa24de Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents: 12377
diff changeset
999 \let\seerfc=\py@seerfc
14521
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14490
diff changeset
1000 \let\seetitle=\py@seetitle
12638
def959352422 Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents: 12549
diff changeset
1001 \let\seeurl=\py@seeurl
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1002 }{\par}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1003
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1004
8762
4192a73ca430 \versionadded,
Fred Drake <fdrake@acm.org>
parents: 8751
diff changeset
1005 % 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
1006 % \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
1007 % 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
1008 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
1009 \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
1010 \newcommand{\version}{}
14555
219e00221c84 \shortversion,
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1011 \newcommand{\shortversion}{}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1012 \newcommand{\releasename}{Release}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1013 \newcommand{\release}[1]{%
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
1014 \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
1015 \renewcommand{\version}{#1}}
14555
219e00221c84 \shortversion,
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1016 \newcommand{\setshortversion}[1]{%
219e00221c84 \shortversion,
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1017 \renewcommand{\shortversion}{#1}}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1018
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1019 % 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
1020 % 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
1021 % 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
1022 %
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
1023 \newcommand{\py@authoraddress}{}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
1024 \newcommand{\authoraddress}[1]{\renewcommand{\py@authoraddress}{#1}}
8341
ebfde06fdb8d Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8306
diff changeset
1025 \let\developersaddress=\authoraddress
ebfde06fdb8d Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8306
diff changeset
1026 \let\developer=\author
ebfde06fdb8d Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8306
diff changeset
1027 \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
1028
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1029 % 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
1030 % 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
1031 %
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
1032 \@ifundefined{ChTitleVar}{}{
8190
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
1033 \ChNameVar{\raggedleft\normalsize\py@HeaderFamily}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
1034 \ChNumVar{\raggedleft \bfseries\Large\py@HeaderFamily}
25c2aea64501 Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents: 8076
diff changeset
1035 \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
1036 % 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
1037 \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
1038 {\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
1039 \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
1040 \DOCH
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1041 \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
1042 \interlinepenalty\@M
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1043 \DOTI{#1}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1044 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1045 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1046 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1047
8396
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
1048
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
1049 % 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
1050 % 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
1051 %
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
1052 \newenvironment{definitions}{%
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
1053 \begin{description}%
9078
18f81faf4bd9 \itembreak,
Fred Drake <fdrake@acm.org>
parents: 8916
diff changeset
1054 \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
1055 }{%
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
1056 \end{description}%
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
1057 }
79071a4e0eca Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents: 8341
diff changeset
1058
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1059 % 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
1060 \hyphenation{Base-HTTP-Re-quest-Hand-ler}