Mercurial > cpython-lru_cache-weakref
annotate Doc/texinputs/python.sty @ 30723:6f15e73b59f2 2.3
Backport checkin:
Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Mon, 20 Oct 2003 14:34:48 +0000 |
| parents | dbae05c29e93 |
| children | ec75ff8c7721 |
| 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 % |
| 30723 | 2 % python.sty for the Python docummentation [works only 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 | 17 % These packages can be used to add marginal annotations which indicate |
| 18 % index entries and labels; useful for reviewing this messy documentation! | |
| 19 % | |
| 20 %\RequirePackage{showkeys} | |
| 21 %\RequirePackage{showidx} | |
| 22 | |
|
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 |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
29 \newif\ifpdf\pdffalse |
|
7737
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
30 \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
|
31 \else |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
32 \pdftrue |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
33 \input{pdfcolor} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
34 \let\py@LinkColor=\NavyBlue |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
35 \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
|
36 \pdfcompresslevel=9 |
|
8306
4674cd2f6f07
Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents:
8229
diff
changeset
|
37 \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
|
38 \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
|
39 % |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
40 % 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
|
41 % of any other. |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
42 % |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
43 \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
|
44 \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
|
45 % |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
46 % 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
|
47 % 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
|
48 % |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
49 \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
|
50 % |
|
22320
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
51 % Backward compatibility hack: pdfTeX 0.13 defined \pdfannotlink, |
|
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
52 % but it changed to \pdfstartlink in 0.14. This let's us use either |
|
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
53 % version and still get useful behavior. |
|
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
54 % |
|
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
55 \@ifundefined{pdfstartlink}{ |
|
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
56 \let\pdfstartlink=\pdfannotlink |
|
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
57 }{} |
|
dc6054e5b642
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
Fred Drake <fdrake@acm.org>
parents:
22316
diff
changeset
|
58 % |
|
9968
485502c42d89
\py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents:
9958
diff
changeset
|
59 % 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
|
60 % 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
|
61 % 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
|
62 % this style file. |
|
485502c42d89
\py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents:
9958
diff
changeset
|
63 \newcommand{\py@linkToName}[2]{% |
|
22316
cc788b3b21b6
Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents:
21418
diff
changeset
|
64 \pdfstartlink attr{/Border [0 0 0]} goto name{#1}% |
|
9968
485502c42d89
\py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents:
9958
diff
changeset
|
65 \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
|
66 \pdfendlink% |
|
22316
cc788b3b21b6
Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents:
21418
diff
changeset
|
67 } |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
68 % 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
|
69 % \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
|
70 \renewcommand{\contentsline}[3]{% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
71 \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
|
72 \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
|
73 } |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
74 \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
|
75 \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
|
76 } |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
77 \newcommand{\py@target}[1]{% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
78 \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
|
79 {\pdfdest name{#1} xyz}% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
80 \fi% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
81 } |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
82 \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
|
83 \renewcommand{\label}[1]{% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
84 \py@OldLabel{#1}% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
85 \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
|
86 } |
|
8306
4674cd2f6f07
Set the right page size in the PDF output.
Fred Drake <fdrake@acm.org>
parents:
8229
diff
changeset
|
87 % 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
|
88 % 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
|
89 % 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
|
90 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
91 % 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
|
92 % |
|
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
|
93 \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
|
94 \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
|
95 \@hyperfixhead |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
96 } |
|
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
|
97 \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
|
98 \let\H@old@thehead\@thehead |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
99 \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
|
100 \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
|
101 \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
|
102 \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
|
103 } |
|
7737
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
104 \fi\fi |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
105 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
106 % 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
|
107 \topmargin 0pt |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
108 \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
|
109 \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
|
110 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
111 % 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
|
112 \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
|
113 \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
|
114 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
115 \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
|
116 \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
|
117 %\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
|
118 \marginparwidth 0.5in |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
119 |
|
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
|
120 \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
|
121 \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
|
122 |
|
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 % 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
|
125 \raggedbottom |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
126 \sloppy |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
127 \parindent = 0mm |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
128 \parskip = 2mm |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
129 \hbadness = 5000 % don't print trivial gripes |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
130 |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
131 \pagestyle{empty} % start this way; change for |
|
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
132 \pagenumbering{roman} % ToC & chapters |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
133 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
134 % 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
|
135 \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
|
136 |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
137 % Set up abstract ways to get the normal and smaller font sizes that |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
138 % work even in footnote context. |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
139 \newif\ifpy@infootnote \py@infootnotefalse |
|
26015
5be5c84dea23
Thinking on comp.text.tex seems to be that it's better to override
Fred Drake <fdrake@acm.org>
parents:
25979
diff
changeset
|
140 \let\py@oldmakefntext\@makefntext |
|
5be5c84dea23
Thinking on comp.text.tex seems to be that it's better to override
Fred Drake <fdrake@acm.org>
parents:
25979
diff
changeset
|
141 \def\@makefntext#1{% |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
142 \bgroup% |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
143 \py@infootnotetrue |
|
26015
5be5c84dea23
Thinking on comp.text.tex seems to be that it's better to override
Fred Drake <fdrake@acm.org>
parents:
25979
diff
changeset
|
144 \py@oldmakefntext{#1}% |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
145 \egroup% |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
146 } |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
147 \def\py@defaultsize{% |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
148 \ifpy@infootnote\footnotesize\else\normalsize\fi% |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
149 } |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
150 \def\py@smallsize{% |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
151 \ifpy@infootnote\scriptsize\else\small\fi% |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
152 } |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
153 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
154 % 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
|
155 \@ifundefined{fancyhf}{}{ |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
156 % 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
|
157 \fancypagestyle{normal}{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
158 \fancyhf{} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
159 \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
160 \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
161 \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
|
162 \renewcommand{\headrulewidth}{0pt} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
163 \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
|
164 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
165 % 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
|
166 % 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
|
167 % 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
|
168 \fancypagestyle{plain}{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
169 \fancyhf{} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
170 \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
|
171 \renewcommand{\headrulewidth}{0pt} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
172 \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
|
173 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
174 % 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
|
175 % 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
|
176 % 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
|
177 \@ifundefined{chapter}{}{ |
|
7548
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
178 \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
|
179 \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
|
180 \hbox{} |
|
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
181 \thispagestyle{plain} |
|
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
182 \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
|
183 \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
|
184 } |
|
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
185 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
186 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
187 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
188 % 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
|
189 % 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
|
190 % code samples. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
191 |
|
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
|
192 \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
|
193 \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
|
194 \RequirePackage{verbatim} |
|
22637
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
195 \let\py@OldVerbatimInput=\verbatiminput |
|
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
|
196 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
197 % Variable used by begin code command |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
198 \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
|
199 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
200 \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
|
201 \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
|
202 % 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
|
203 \setlength{\py@codewidth}{\linewidth}% |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
204 \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
|
205 % |
|
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
|
206 \par\indent% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
207 \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
|
208 \small% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
209 \py@OldVerbatim% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
210 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
211 \renewcommand{\endverbatim}{% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
212 \py@OldEndVerbatim% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
213 \end{minipage}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
214 } |
|
22637
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
215 \renewcommand{\verbatiminput}[1]{% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
216 {\setlength{\parindent}{1cm}% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
217 % Calculate the text width for the minipage: |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
218 \setlength{\py@codewidth}{\linewidth}% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
219 \addtolength{\py@codewidth}{-\parindent}% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
220 % |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
221 \small% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
222 \begin{list}{}{\setlength{\leftmargin}{1cm}} |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
223 \item% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
224 \py@OldVerbatimInput{#1}% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
225 \end{list} |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
226 }% |
|
d778ea9de780
Extend \verbatiminput so that the typeset version provides the same appearance
Fred Drake <fdrake@acm.org>
parents:
22589
diff
changeset
|
227 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
228 |
|
17380
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
229 % This does a similar thing for the {alltt} environment: |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
230 \RequirePackage{alltt} |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
231 \let\py@OldAllTT=\alltt |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
232 \let\py@OldEndAllTT=\endalltt |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
233 |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
234 \renewcommand{\alltt}{% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
235 \setlength{\parindent}{1cm}% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
236 % Calculate the text width for the minipage: |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
237 \setlength{\py@codewidth}{\linewidth}% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
238 \addtolength{\py@codewidth}{-\parindent}% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
239 % |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
240 \par\indent% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
241 \begin{minipage}[t]{\py@codewidth}% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
242 \small% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
243 \py@OldAllTT% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
244 } |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
245 \renewcommand{\endalltt}{% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
246 \py@OldEndAllTT% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
247 \end{minipage}% |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
248 } |
|
4622af4da9e2
Import the alltt package and wrap that environment in a similar way to
Fred Drake <fdrake@acm.org>
parents:
16966
diff
changeset
|
249 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
250 |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
251 \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
|
252 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
253 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
254 %% 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
|
255 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
256 % Command to 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
|
257 % 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
|
258 % 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
|
259 % 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
|
260 % |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
261 \newcommand{\py@idxcode}[1]{\texttt{#1}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
262 %\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
|
263 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
264 % 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
|
265 \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
|
266 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
267 % 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
|
268 \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
|
269 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
270 % 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
|
271 \newcommand{\indexiv}[4]{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
272 \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
|
273 \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
|
274 \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
|
275 \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
|
276 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
277 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
278 % 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
|
279 % operator. |
| 8229 | 280 \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
|
281 \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
|
282 \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
|
283 \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
|
284 \newcommand{\obindex}[1]{\indexii{object}{#1}} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
285 \newcommand{\bifuncindex}[1]{% |
|
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
286 \index{#1@{\py@idxcode{#1()}} (built-in function)}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
287 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
288 % 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
|
289 \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
|
290 \newcommand{\refmodindex}[1]{\py@refmodule{#1}{}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
291 \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
|
292 \newcommand{\refexmodindex}[1]{\py@refmodule{#1}{extension }} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
293 \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
|
294 |
|
9868
a58f36352c4f
\seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents:
9542
diff
changeset
|
295 % 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
|
296 % name, at least if we're building PDF: |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
297 \ifpdf |
|
9968
485502c42d89
\py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents:
9958
diff
changeset
|
298 \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
|
299 \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
|
300 \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
|
301 } |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
302 \else |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
303 \newcommand{\refmodule}[2][\py@modulebadkey]{\module{#2}} |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
304 \fi |
|
9868
a58f36352c4f
\seemodule: Fix so that each \seemodule entry gets its own paragraph,
Fred Drake <fdrake@acm.org>
parents:
9542
diff
changeset
|
305 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
306 % support for the module index |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
307 \newif\ifpy@UseModuleIndex |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
308 \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
|
309 |
|
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
|
310 \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
|
311 \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
|
312 \openout\modindexfile=mod\jobname.idx |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
313 \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
|
314 } |
|
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
|
315 |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
316 % 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
|
317 \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
|
318 \renewcommand{\py@thismodule}{#1} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
319 \setindexsubitem{(in module #1)}% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
320 \index{#1@{\py@idxcode{#1}} (#2module)|textbf}% |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
321 \ifpy@UseModuleIndex% |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
322 \@ifundefined{py@modplat@\py@thismodulekey}{ |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
323 \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
|
324 }{\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
|
325 \emph{(\py@platformof[\py@thismodulekey]{})}}}{\thepage}}% |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
326 } |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
327 \fi% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
328 } |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
329 |
|
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
|
330 % *** 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
|
331 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
332 % 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
|
333 \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
|
334 \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
|
335 \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
|
336 \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
|
337 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
338 % 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
|
339 \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
|
340 \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
|
341 \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
|
342 \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
|
343 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
344 % 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
|
345 \newif\ifpy@usingsubitem\py@usingsubitemfalse |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
346 \newcommand{\py@indexsubitem}{} |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
347 \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
|
348 \py@usingsubitemtrue} |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
349 \newcommand{\ttindex}[1]{% |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
350 \ifpy@usingsubitem |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
351 \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
|
352 \else% |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
353 \index{#1@{\py@idxcode{#1}}}% |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
354 \fi% |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
355 } |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
356 \newcommand{\withsubitem}[2]{% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
357 \begingroup% |
|
15362
9a17cdcd3320
Fix \withsubitem so that it actually works if the only indexing macro in
Fred Drake <fdrake@acm.org>
parents:
15360
diff
changeset
|
358 \def\ttindex##1{\index{##1@{\py@idxcode{##1}} #1}}% |
|
9a17cdcd3320
Fix \withsubitem so that it actually works if the only indexing macro in
Fred Drake <fdrake@acm.org>
parents:
15360
diff
changeset
|
359 #2% |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
360 \endgroup% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
361 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
362 |
|
7801
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
363 |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
364 % Module synopsis processing ----------------------------------------------- |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
365 % |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
366 \newcommand{\py@thisclass}{} |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
367 \newcommand{\py@thismodule}{} |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
368 \newcommand{\py@thismodulekey}{} |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
369 \newcommand{\py@thismoduletype}{} |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
370 |
|
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
|
371 \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
|
372 \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
|
373 \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
|
374 \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
|
375 |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
376 \newif\ifpy@HaveModSynopsis \py@HaveModSynopsisfalse |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
377 \newif\ifpy@ModSynopsisFileIsOpen \py@ModSynopsisFileIsOpenfalse |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
378 \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
|
379 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
380 % \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
|
381 \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
|
382 \py@openModSynopsisFile |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
383 \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
|
384 \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
|
385 \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
|
386 \else |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
387 \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
|
388 \fi |
|
10855
28887f40e344
\declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents:
10846
diff
changeset
|
389 \@ifundefined{py@#2IndexModule}{% |
|
28887f40e344
\declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents:
10846
diff
changeset
|
390 \typeout{*** MACRO declaremodule called with unknown module type: `#2'} |
| 10856 | 391 \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
|
392 }{% |
|
28887f40e344
\declaremodule: Make this more robust. Only attempt to add an index
Fred Drake <fdrake@acm.org>
parents:
10846
diff
changeset
|
393 \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
|
394 } |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
395 \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
|
396 } |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
397 \newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
398 \newcommand{\py@ModPlatformFilename}{\jobname.pla} |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
399 \newcommand{\platform}[1]{ |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
400 \ifpy@ModPlatformFileIsOpen\else |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
401 \newwrite\py@ModPlatformFile |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
402 \openout\py@ModPlatformFile=\py@ModPlatformFilename |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
403 \py@ModPlatformFileIsOpentrue |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
404 \fi |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
405 } |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
406 \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
|
407 \newcommand{\py@platformof}[2][\py@modulebadkey]{% |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
408 \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
|
409 \else \def\py@key{#1}% |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
410 \fi% |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
411 \csname py@modplat@\py@key\endcsname% |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
412 } |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
413 \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
|
414 |
| 8916 | 415 % \moduleauthor{name}{email} |
| 416 \newcommand{\moduleauthor}[2]{} | |
| 417 | |
| 418 % \sectionauthor{name}{email} | |
| 419 \newcommand{\sectionauthor}[2]{} | |
| 420 | |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
421 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
422 \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
|
423 \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
|
424 \newcommand{\modulesynopsis}[1]{ |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
425 \py@HaveModSynopsistrue |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
426 \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
|
427 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
428 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
429 % define the file |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
430 \newwrite\py@ModSynopsisFile |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
431 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
432 % 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
|
433 \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
|
434 \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
|
435 {\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
|
436 {\string#1}% |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
437 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
438 \newcommand{\py@closeModSynopsisFile}{ |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
439 \ifpy@ModSynopsisFileIsOpen |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
440 \closeout\py@ModSynopsisFile |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
441 \py@ModSynopsisFileIsOpenfalse |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
442 \fi |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
443 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
444 \newcommand{\py@openModSynopsisFile}{ |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
445 \ifpy@ModSynopsisFileIsOpen\else |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
446 \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
|
447 \py@ModSynopsisFileIsOpentrue |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
448 \fi |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
449 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
450 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
451 \newcommand{\py@ProcessModSynopsis}{ |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
452 \ifpy@HaveModSynopsis |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
453 \py@writeModSynopsisFile{\modulesynopsis% |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
454 {\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
|
455 {\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
|
456 \py@HaveModSynopsisfalse |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
457 \fi |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
458 \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
|
459 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
460 \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
|
461 |
|
10328
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
462 |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
463 \long\def\py@writeModPlatformFile#1{% |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
464 \protected@write\py@ModPlatformFile% |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
465 {\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
|
466 {\string#1}% |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
467 } |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
468 |
|
f438c6e2b6c1
Added support for \platform, \platformof, and \ignorePlatformAnnotation.
Fred Drake <fdrake@acm.org>
parents:
10077
diff
changeset
|
469 |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
470 \newcommand{\localmoduletable}{ |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
471 \IfFileExists{\py@ModSynopsisFilename}{ |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
472 \begin{synopsistable} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
473 \input{\py@ModSynopsisFilename} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
474 \end{synopsistable} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
475 }{} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
476 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
477 |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
478 \ifpdf |
|
9968
485502c42d89
\py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents:
9958
diff
changeset
|
479 \newcommand{\py@ModSynopsisSummary}[4]{% |
|
485502c42d89
\py@linkToName: New macro to consolidate support for most internal
Fred Drake <fdrake@acm.org>
parents:
9958
diff
changeset
|
480 \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
|
481 } |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
482 \else |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
483 \newcommand{\py@ModSynopsisSummary}[4]{\bfcode{#2} & #4\\} |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
484 \fi |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
485 \newenvironment{synopsistable}{ |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
486 % 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
|
487 \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
|
488 \begin{tabular}{ll} |
|
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 \end{tabular} |
|
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 % |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
493 % -------------------------------------------------------------------------- |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
494 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
495 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
496 \newcommand{\py@reset}{ |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
497 \py@usingsubitemfalse |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
498 \py@ProcessModSynopsis |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
499 \renewcommand{\py@thisclass}{} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
500 \renewcommand{\py@thismodule}{} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
501 \renewcommand{\py@thismodulekey}{} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
502 \renewcommand{\py@thismoduletype}{} |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
503 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
504 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
505 % 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
|
506 % 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
|
507 \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
|
508 \@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
|
509 {-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
|
510 {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
|
511 {\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
|
512 \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
|
513 {-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
|
514 {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
|
515 {\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
|
516 \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
|
517 {-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
|
518 {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
|
519 {\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
|
520 \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
|
521 {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
|
522 {-1em}% |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
523 {\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
|
524 \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
|
525 {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
|
526 {-1em}% |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
527 {\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
|
528 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
529 |
|
8726
74ea4dfda82d
\textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents:
8713
diff
changeset
|
530 % 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
|
531 % 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
|
532 |
|
74ea4dfda82d
\textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents:
8713
diff
changeset
|
533 \DeclareTextCommandDefault{\textunderscore}{% |
|
74ea4dfda82d
\textunderscore: Re-define with a width that's more appropriate for the
Fred Drake <fdrake@acm.org>
parents:
8713
diff
changeset
|
534 \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
|
535 |
|
8713
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
536 % 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
|
537 % |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
538 % 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
|
539 % Latex 2e. |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
540 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
541 \DeclareRobustCommand\hackscore{% |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
542 \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
|
543 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
544 \begingroup |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
545 \catcode`\_\active |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
546 \def\next{% |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
547 \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
|
548 } |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
549 \expandafter\endgroup\next |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
550 |
|
ed8f4e2eb11a
Lots of new stuff for "module synopsis support." Public interface consists
Fred Drake <fdrake@acm.org>
parents:
8609
diff
changeset
|
551 |
|
7801
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
552 % 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
|
553 % 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
|
554 % 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
|
555 |
|
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
556 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
557 % {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
|
558 % 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
|
559 % |
| 9078 | 560 \newcommand{\py@itemnewline}[1]{% |
| 561 \@tempdima\linewidth% | |
| 562 \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}% | |
| 563 } | |
| 564 | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
565 \newenvironment{fulllineitems}{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
566 \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
|
567 \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
|
568 \itemsep -\parsep |
| 9078 | 569 \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
|
570 }{\end{list}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
571 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
572 % \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
|
573 % {*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
|
574 % be used in the debugger chapter. |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
575 % |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
576 % Typical usage: |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
577 % |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
578 % \begin{funcdesc}{myfunc}{reqparm\optional{, optparm}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
579 % ^^^ ^^^ |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
580 % No space here No space here |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
581 % |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
582 % 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
|
583 % nested, not chained. This is right: |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
584 % |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
585 % \begin{funcdesc}{myfunc}{\optional{parm1\optional{, parm2}}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
586 % |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
587 \let\py@badkey=\@undefined |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
588 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
589 \newcommand{\optional}[1]{% |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
590 {\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
|
591 |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
592 % 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
|
593 % 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
|
594 \newcommand{\py@moreargs}{...} |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
595 |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
596 % 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
|
597 % 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
|
598 % something else. |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
599 \newcommand{\py@unspecified}{...} |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
600 |
|
24090
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
601 |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
602 \newlength{\py@argswidth} |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
603 \newcommand{\py@sigparams}[1]{% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
604 \parbox[t]{\py@argswidth}{\py@varvars{#1}\code{)}}} |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
605 \newcommand{\py@sigline}[2]{% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
606 \settowidth{\py@argswidth}{#1\code{(}}% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
607 \addtolength{\py@argswidth}{-2\py@argswidth}% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
608 \addtolength{\py@argswidth}{\textwidth}% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
609 \item[#1\code{(}\py@sigparams{#2}]} |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
610 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
611 % C functions ------------------------------------------------------------ |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
612 % \begin{cfuncdesc}[refcount]{type}{name}{arglist} |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
613 % 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
|
614 % tools/anno-api.py; it pulls the value from the refcounts database. |
|
23063
530aba3116a4
Separate out a \cfuncline macro from the cfuncdesc environment.
Fred Drake <fdrake@acm.org>
parents:
23013
diff
changeset
|
615 \newcommand{\cfuncline}[3]{ |
|
24090
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
616 \py@sigline{\code{#1 \bfcode{#2}}}{#3}% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
617 \index{#2@{\py@idxcode{#2()}}} |
|
23063
530aba3116a4
Separate out a \cfuncline macro from the cfuncdesc environment.
Fred Drake <fdrake@acm.org>
parents:
23013
diff
changeset
|
618 } |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
619 \newenvironment{cfuncdesc}[4][\py@badkey]{ |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
620 \begin{fulllineitems} |
|
23063
530aba3116a4
Separate out a \cfuncline macro from the cfuncdesc environment.
Fred Drake <fdrake@acm.org>
parents:
23013
diff
changeset
|
621 \cfuncline{#2}{#3}{#4} |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
622 \ifx#1\@undefined\else% |
| 12346 | 623 \emph{Return value: \textbf{#1}.}\\ |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
624 \fi |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
625 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
626 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
627 % C variables ------------------------------------------------------------ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
628 % \begin{cvardesc}{type}{name} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
629 \newenvironment{cvardesc}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
630 \begin{fulllineitems} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
631 \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
|
632 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
633 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
634 % C data types ----------------------------------------------------------- |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
635 % \begin{ctypedesc}[index name]{typedef name} |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
636 \newenvironment{ctypedesc}[2][\py@badkey]{ |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
637 \begin{fulllineitems} |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
638 \item[\bfcode{#2}% |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
639 \ifx#1\@undefined% |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
640 \index{#2@{\py@idxcode{#2}} (C type)} |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
641 \else% |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
642 \index{#2@{\py@idxcode{#1}} (C type)} |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
643 \fi] |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
644 }{\end{fulllineitems}} |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
645 |
|
23013
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
646 % C type fields ---------------------------------------------------------- |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
647 % \begin{cmemberdesc}{container type}{ctype}{membername} |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
648 \newcommand{\cmemberline}[3]{ |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
649 \item[\code{#2 \bfcode{#3}}] |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
650 \index{#3@{\py@idxcode{#3}} (#1 member)} |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
651 } |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
652 \newenvironment{cmemberdesc}[3]{ |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
653 \begin{fulllineitems} |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
654 \cmemberline{#1}{#2}{#3} |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
655 }{\end{fulllineitems}} |
|
d6322983069e
Additional support for describing C structure members.
Fred Drake <fdrake@acm.org>
parents:
22921
diff
changeset
|
656 |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
657 % Funky macros ----------------------------------------------------------- |
|
22921
3c876ff29a83
Add \csimplemacro to parallel the csimplemacrodesc environment.
Fred Drake <fdrake@acm.org>
parents:
22637
diff
changeset
|
658 % \begin{csimplemacrodesc}{name} |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
659 % -- "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
|
660 \newenvironment{csimplemacrodesc}[1]{ |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
661 \begin{fulllineitems} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
662 \item[\bfcode{#1}\index{#1@{\py@idxcode{#1}} (macro)}] |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
663 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
664 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
665 % simple functions (not methods) ----------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
666 % \begin{funcdesc}{name}{args} |
|
15362
9a17cdcd3320
Fix \withsubitem so that it actually works if the only indexing macro in
Fred Drake <fdrake@acm.org>
parents:
15360
diff
changeset
|
667 \newcommand{\funcline}[2]{% |
|
9a17cdcd3320
Fix \withsubitem so that it actually works if the only indexing macro in
Fred Drake <fdrake@acm.org>
parents:
15360
diff
changeset
|
668 \funclineni{#1}{#2}% |
|
9a17cdcd3320
Fix \withsubitem so that it actually works if the only indexing macro in
Fred Drake <fdrake@acm.org>
parents:
15360
diff
changeset
|
669 \index{#1@{\py@idxcode{#1()}} (in module \py@thismodule)}} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
670 \newenvironment{funcdesc}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
671 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
672 \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
|
673 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
674 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
675 % similar to {funcdesc}, but doesn't add to the index |
|
24090
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
676 \newcommand{\funclineni}[2]{% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
677 \py@sigline{\bfcode{#1}}{#2}} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
678 \newenvironment{funcdescni}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
679 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
680 \funclineni{#1}{#2} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
681 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
682 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
683 % classes ---------------------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
684 % \begin{classdesc}{name}{constructor args} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
685 \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
|
686 % 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
|
687 \global\def\py@thisclass{#1} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
688 \begin{fulllineitems} |
|
24090
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
689 \py@sigline{\strong{class }\bfcode{#1}}{#2}% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
690 \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
691 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
692 |
|
17778
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
693 % \begin{classdesc*}{name} |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
694 \newenvironment{classdesc*}[1]{ |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
695 % Using \renewcommand doesn't work for this, for unknown reasons: |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
696 \global\def\py@thisclass{#1} |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
697 \begin{fulllineitems} |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
698 \item[\strong{class }\code{\bfcode{#1}}% |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
699 \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
700 }{\end{fulllineitems}} |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
701 |
|
14490
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
702 % \begin{excclassdesc}{name}{constructor args} |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
703 % but indexes as an exception |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
704 \newenvironment{excclassdesc}[2]{ |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
705 % 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
|
706 \global\def\py@thisclass{#1} |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
707 \begin{fulllineitems} |
|
24090
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
708 \py@sigline{\strong{exception }\bfcode{#1}}{#2}% |
|
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
709 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)} |
|
14490
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
710 }{\end{fulllineitems}} |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
711 |
|
17778
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
712 % There is no corresponding {excclassdesc*} environment. To describe |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
713 % a class exception without parameters, use the {excdesc} environment. |
|
b4b3657cb1fa
Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents:
17560
diff
changeset
|
714 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
715 |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
716 \let\py@classbadkey=\@undefined |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
717 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
718 % object method ---------------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
719 % \begin{methoddesc}[classname]{methodname}{args} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
720 \newcommand{\methodline}[3][\@undefined]{ |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
721 \methodlineni{#2}{#3} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
722 \ifx#1\@undefined |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
723 \index{#2@{\py@idxcode{#2()}} (\py@thisclass\ method)} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
724 \else |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
725 \index{#2@{\py@idxcode{#2()}} (#1 method)} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
726 \fi |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
727 } |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
728 \newenvironment{methoddesc}[3][\@undefined]{ |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
729 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
730 \ifx#1\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
731 \methodline{#2}{#3} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
732 \else |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
733 \def\py@thisclass{#1} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
734 \methodline{#2}{#3} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
735 \fi |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
736 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
737 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
738 % 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
|
739 % (never actually uses the optional argument) |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
740 \newcommand{\methodlineni}[3][\py@classbadkey]{% |
|
24090
bc00eeef0ac7
Abstract the creation of signature lines for callable things; the new
Fred Drake <fdrake@acm.org>
parents:
23063
diff
changeset
|
741 \py@sigline{\bfcode{#2}}{#3}} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
742 \newenvironment{methoddescni}[3][\py@classbadkey]{ |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
743 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
744 \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
|
745 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
746 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
747 % object data attribute -------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
748 % \begin{memberdesc}[classname]{membername} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
749 \newcommand{\memberline}[2][\py@classbadkey]{% |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
750 \ifx#1\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
751 \memberlineni{#2} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
752 \index{#2@{\py@idxcode{#2}} (\py@thisclass\ attribute)} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
753 \else |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
754 \memberlineni{#2} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
755 \index{#2@{\py@idxcode{#2}} (#1 attribute)} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
756 \fi |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
757 } |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
758 \newenvironment{memberdesc}[2][\py@classbadkey]{ |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
759 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
760 \ifx#1\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
761 \memberline{#2} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
762 \else |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
763 \def\py@thisclass{#1} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
764 \memberline{#2} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
765 \fi |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
766 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
767 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
768 % 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
|
769 % (never actually uses the optional argument) |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
770 \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
|
771 \newenvironment{memberdescni}[2][\py@classbadkey]{ |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
772 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
773 \memberlineni{#2} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
774 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
775 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
776 % For exceptions: -------------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
777 % \begin{excdesc}{name} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
778 % -- for constructor information, use excclassdesc instead |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
779 \newenvironment{excdesc}[1]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
780 \begin{fulllineitems} |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
781 \item[\strong{exception }\bfcode{#1}% |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
782 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
783 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
784 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
785 % Module data or constants: ---------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
786 % \begin{datadesc}{name} |
|
15360
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
787 \newcommand{\dataline}[1]{% |
|
74e1d79520fd
Avoid using \withsubitem and \ttindex internally; they have not proven
Fred Drake <fdrake@acm.org>
parents:
15310
diff
changeset
|
788 \datalineni{#1}\index{#1@{\py@idxcode{#1}} (data in \py@thismodule)}} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
789 \newenvironment{datadesc}[1]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
790 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
791 \dataline{#1} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
792 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
793 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
794 % 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
|
795 \newcommand{\datalineni}[1]{\item[\bfcode{#1}]\nopagebreak} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
796 \newenvironment{datadescni}[1]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
797 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
798 \datalineni{#1} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
799 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
800 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
801 % bytecode instruction --------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
802 % \begin{opcodedesc}{name}{var} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
803 % -- {var} may be {} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
804 \newenvironment{opcodedesc}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
805 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
806 \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
|
807 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
808 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
809 |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
810 \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
|
811 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
812 % 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
|
813 % {\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
|
814 \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
|
815 \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
|
816 \newcommand{\POSIX}{POSIX} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
817 \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
|
818 \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
|
819 \newcommand{\C}{C} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
820 \newcommand{\EOF}{{\sc eof}} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
821 \newcommand{\NULL}{\constant{NULL}} |
| 18230 | 822 \newcommand{\infinity}{\ensuremath{\infty}} |
| 823 \newcommand{\plusminus}{\ensuremath{\pm}} | |
|
24496
2670a5db6843
Add a comment showing how one of the macros should be used.
Fred Drake <fdrake@acm.org>
parents:
24090
diff
changeset
|
824 % \menuselection{Start \sub Programs \sub Python} |
|
29897
dbae05c29e93
Make it easier to figure out the where a menuselection starts and ends
Fred Drake <fdrake@acm.org>
parents:
26875
diff
changeset
|
825 \newcommand{\menuselection}[1]{\textsf{\def\sub{ \ensuremath{>} }#1}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
826 |
|
7801
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
827 % 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
|
828 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
829 % 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
|
830 \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
|
831 \texttt{#1}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
832 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
833 \newcommand{\bfcode}[1]{\code{\bfseries#1}} % bold-faced code font |
|
22921
3c876ff29a83
Add \csimplemacro to parallel the csimplemacrodesc environment.
Fred Drake <fdrake@acm.org>
parents:
22637
diff
changeset
|
834 \newcommand{\csimplemacro}[1]{\code{#1}} |
|
8609
ce295bfacef3
Fix the \kbd definition so it didn't leave the courier face on.
Fred Drake <fdrake@acm.org>
parents:
8396
diff
changeset
|
835 \newcommand{\kbd}[1]{\code{#1}} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
836 \newcommand{\samp}[1]{`\code{#1}'} |
|
9542
1437c2335b3b
Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents:
9524
diff
changeset
|
837 \newcommand{\var}[1]{% |
|
1437c2335b3b
Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents:
9524
diff
changeset
|
838 \ifmmode% |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
839 \hbox{\py@defaultsize\textrm{\textit{#1\/}}}% |
|
9542
1437c2335b3b
Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents:
9524
diff
changeset
|
840 \else% |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
841 \py@defaultsize\textrm{\textit{#1\/}}% |
|
9542
1437c2335b3b
Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents:
9524
diff
changeset
|
842 \fi% |
|
1437c2335b3b
Make \var work correctly in math mode.
Fred Drake <fdrake@acm.org>
parents:
9524
diff
changeset
|
843 } |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
844 \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
|
845 \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
|
846 \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
|
847 % let's experiment with a new font: |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
848 \newcommand{\file}[1]{`\filenq{#1}'} |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
849 \newcommand{\filenq}[1]{{\py@smallsize\textsf{#1}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
850 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
851 % 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
|
852 % but only if we actually used hyperref: |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
853 \ifpdf |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
854 \newcommand{\url}[1]{{% |
|
22589
66e85a732ddd
Make \url to force horizontal mode.
Fred Drake <fdrake@acm.org>
parents:
22320
diff
changeset
|
855 \noindent% |
|
22316
cc788b3b21b6
Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents:
21418
diff
changeset
|
856 \pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}% |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
857 \py@LinkColor% color of the link text |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
858 \py@smallsize\sf #1% |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
859 \py@NormalColor% Turn it back off; these are declarative |
|
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
860 \pdfendlink}% and don't appear bound to the current |
|
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
861 }% formatting "box". |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
862 \else |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
863 \newcommand{\url}[1]{\mbox{\py@smallsize\textsf{#1}}} |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
864 \fi |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
865 \newcommand{\email}[1]{{\py@smallsize\textsf{#1}}} |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
866 \newcommand{\newsgroup}[1]{{\py@smallsize\textsf{#1}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
867 |
|
13834
4aebd0f2a062
\py@varvars: Merge the various definitions to be the simplist one that
Fred Drake <fdrake@acm.org>
parents:
13234
diff
changeset
|
868 \newcommand{\py@varvars}[1]{{% |
|
12215
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
869 {\let\unspecified=\py@unspecified% |
|
774817285b8c
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11450
diff
changeset
|
870 \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
|
871 \var{#1}}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
872 |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
873 % 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
|
874 \newif\iftexi\texifalse |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
875 |
|
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
|
876 % 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
|
877 % 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
|
878 \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
|
879 |
|
9138272c1fe6
Define stuff to allow simple HTML-only selection using TeX's \if<foo>...\fi
Fred Drake <fdrake@acm.org>
parents:
8762
diff
changeset
|
880 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
881 % 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
|
882 % 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
|
883 % 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
|
884 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
885 % 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
|
886 % 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
|
887 % |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
888 \newcommand{\module}[1]{\texttt{#1}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
889 \newcommand{\keyword}[1]{\texttt{#1}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
890 \newcommand{\exception}[1]{\texttt{#1}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
891 \newcommand{\class}[1]{\texttt{#1}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
892 \newcommand{\function}[1]{\texttt{#1}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
893 \newcommand{\member}[1]{\texttt{#1}} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
894 \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
|
895 |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
896 \newcommand{\pytype}[1]{#1} % built-in Python type |
|
7801
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
897 |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
898 \newcommand{\cfunction}[1]{\texttt{#1}} |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
899 \newcommand{\ctype}[1]{\texttt{#1}} % C struct or typedef name |
|
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
900 \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
|
901 |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
902 \newcommand{\mailheader}[1]{{\py@smallsize\textsf{#1:}}} |
|
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
903 \newcommand{\mimetype}[1]{{\py@smallsize\textsf{#1}}} |
|
7670
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
904 % 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
|
905 \newcommand{\regexp}[1]{% |
|
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
906 {\tiny$^{^\lceil}\!\!$% |
|
25979
d812b8aaefb3
Define abstract way to get the normal and smaller font sizes that work
Fred Drake <fdrake@acm.org>
parents:
25972
diff
changeset
|
907 {\py@defaultsize\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
|
908 $\!\rfloor\!$% |
|
7670
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
909 }} |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
910 \newcommand{\envvar}[1]{% |
|
16118
64545c986b98
Remove the dollar sign from the formatting of environment variables --
Fred Drake <fdrake@acm.org>
parents:
15362
diff
changeset
|
911 #1% |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
912 \index{#1}% |
|
16118
64545c986b98
Remove the dollar sign from the formatting of environment variables --
Fred Drake <fdrake@acm.org>
parents:
15362
diff
changeset
|
913 \index{environment variables!{#1}}% |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
914 } |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
915 \newcommand{\makevar}[1]{#1} % variable in a Makefile |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
916 \newcommand{\character}[1]{\samp{#1}} |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
917 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
918 % constants defined in Python modules or C headers, not language constants: |
|
16966
38e17a089492
Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents:
16118
diff
changeset
|
919 \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
|
920 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
921 \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
|
922 \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
|
923 \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
|
924 \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
|
925 \newcommand{\programopt}[1]{\strong{#1}} |
| 12377 | 926 % Note that \longprogramopt provides the '--'! |
| 927 \newcommand{\longprogramopt}[1]{\strong{-{}-#1}} | |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
928 |
|
18427
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
929 % \ulink{link text}{URL} |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
930 \ifpdf |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
931 % The \noindent here is a hack -- we're forcing pdfTeX into |
|
22316
cc788b3b21b6
Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents:
21418
diff
changeset
|
932 % horizontal mode since \pdfstartlink requires that. |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
933 \newcommand{\ulink}[2]{\noindent{% |
|
22316
cc788b3b21b6
Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents:
21418
diff
changeset
|
934 \pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#2)}% |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
935 \py@LinkColor% color of the link text |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
936 #1% |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
937 \py@NormalColor% Turn it back off; these are declarative |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
938 \pdfendlink}% and don't appear bound to the current |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
939 }% formatting "box". |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
940 \else |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
941 \newcommand{\ulink}[2]{#1} |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
942 \fi |
|
11450
0a3bb403a430
\programopt: New macro, used to mark command-line parameters in the
Fred Drake <fdrake@acm.org>
parents:
11082
diff
changeset
|
943 |
|
0a3bb403a430
\programopt: New macro, used to mark command-line parameters in the
Fred Drake <fdrake@acm.org>
parents:
11082
diff
changeset
|
944 % 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
|
945 % online: \citetitle[url-to-resource]{Title of Work} |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
946 \ifpdf |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
947 \newcommand{\citetitle}[2][\py@modulebadkey]{% |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
948 \ifx\py@modulebadkey#1\emph{#2}\else\ulink{\emph{#2}}{#1}\fi% |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
949 } |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
950 \else |
|
20841
eacf81df6c42
Fix stupid bug recently introduced for DVI version of the docs (used to
Fred Drake <fdrake@acm.org>
parents:
20751
diff
changeset
|
951 \newcommand{\citetitle}[2][URL]{\emph{#2}} |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
952 \fi |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
953 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
954 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
955 |
|
21347
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
956 % This version is being checked in for the historical record; it shows |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
957 % how I've managed to get some aspects of this to work. It will not |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
958 % be used in practice, so a subsequent revision will change things |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
959 % again. This version has problems, but shows how to do something |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
960 % that proved more tedious than I'd expected, so I don't want to lose |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
961 % the example completely. |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
962 % |
|
19412
d4ba6e2aaae3
New \grammartoken markup, similar to \token but allowed everywhere.
Fred Drake <fdrake@acm.org>
parents:
18981
diff
changeset
|
963 \newcommand{\grammartoken}[1]{\texttt{#1}} |
|
18427
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
964 \newenvironment{productionlist}[1][\py@badkey]{ |
|
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
965 \def\optional##1{{\Large[}##1{\Large]}} |
|
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
966 \def\production##1##2{\code{##1}&::=&\code{##2}\\} |
|
22316
cc788b3b21b6
Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents:
21418
diff
changeset
|
967 \def\productioncont##1{& &\code{##1}\\} |
|
18427
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
968 \def\token##1{##1} |
|
19412
d4ba6e2aaae3
New \grammartoken markup, similar to \token but allowed everywhere.
Fred Drake <fdrake@acm.org>
parents:
18981
diff
changeset
|
969 \let\grammartoken=\token |
|
21347
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
970 \parindent=2em |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
971 \indent |
|
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
972 \begin{tabular}{lcl} |
|
18427
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
973 }{% |
|
21347
f59c6b5dd122
Save a new version of the productionlist environment for safe-keeping; this
Fred Drake <fdrake@acm.org>
parents:
21116
diff
changeset
|
974 \end{tabular} |
|
18427
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
975 } |
|
6a5ef1994153
Add \ulink, grammar production markup.
Fred Drake <fdrake@acm.org>
parents:
18230
diff
changeset
|
976 |
|
21418
571d5b7b746c
Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents:
21347
diff
changeset
|
977 \newcommand{\py@noticelabel@note}{Note:} |
|
571d5b7b746c
Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents:
21347
diff
changeset
|
978 \newcommand{\py@noticelabel@warning}{Warning:} |
|
571d5b7b746c
Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents:
21347
diff
changeset
|
979 \newenvironment{notice}[1][note]{ |
|
571d5b7b746c
Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents:
21347
diff
changeset
|
980 \par\strong{\csname py@noticelabel@#1\endcsname} |
|
571d5b7b746c
Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents:
21347
diff
changeset
|
981 }{} |
|
571d5b7b746c
Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents:
21347
diff
changeset
|
982 \newcommand{\note}[1]{\strong{\py@noticelabel@note} #1} |
|
571d5b7b746c
Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents:
21347
diff
changeset
|
983 \newcommand{\warning}[1]{\strong{\py@noticelabel@warning} #1} |
|
20336
1b3ffdf12150
New markup: \note{...} and \warning{...}
Fred Drake <fdrake@acm.org>
parents:
20113
diff
changeset
|
984 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
985 % Deprecation stuff. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
986 % 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
|
987 % 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
|
988 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
989 % 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
|
990 % 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
|
991 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
992 % Example: |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
993 % \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
|
994 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
995 \newcommand{\deprecated}[2]{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
996 \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
|
997 |
| 8762 | 998 % New stuff. |
| 999 % This should be used to mark things which have been added to the | |
| 1000 % development tree but that aren't in the release, but are documented. | |
| 1001 % 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
|
1002 % descriptions. Place at end of descriptor environment. |
| 8762 | 1003 % |
| 1004 % Example: | |
| 1005 % \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
|
1006 % \versionchanged[short explanation]{2.0} |
| 8762 | 1007 % |
|
17560
db928a277f8b
\versionadded: Add support for including an explanatory note along with
Fred Drake <fdrake@acm.org>
parents:
17380
diff
changeset
|
1008 \newcommand{\versionadded}[2][\py@badkey]{% |
|
db928a277f8b
\versionadded: Add support for including an explanatory note along with
Fred Drake <fdrake@acm.org>
parents:
17380
diff
changeset
|
1009 \ifx#1\@undefined% |
|
db928a277f8b
\versionadded: Add support for including an explanatory note along with
Fred Drake <fdrake@acm.org>
parents:
17380
diff
changeset
|
1010 { New in version #2. }% |
|
db928a277f8b
\versionadded: Add support for including an explanatory note along with
Fred Drake <fdrake@acm.org>
parents:
17380
diff
changeset
|
1011 \else% |
|
db928a277f8b
\versionadded: Add support for including an explanatory note along with
Fred Drake <fdrake@acm.org>
parents:
17380
diff
changeset
|
1012 { New in version #2:\ #1. }% |
|
db928a277f8b
\versionadded: Add support for including an explanatory note along with
Fred Drake <fdrake@acm.org>
parents:
17380
diff
changeset
|
1013 \fi% |
|
db928a277f8b
\versionadded: Add support for including an explanatory note along with
Fred Drake <fdrake@acm.org>
parents:
17380
diff
changeset
|
1014 } |
|
12549
efd1e5d2284a
\versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents:
12500
diff
changeset
|
1015 \newcommand{\versionchanged}[2][\py@badkey]{% |
|
efd1e5d2284a
\versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents:
12500
diff
changeset
|
1016 \ifx#1\@undefined% |
|
efd1e5d2284a
\versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents:
12500
diff
changeset
|
1017 { Changed in version #2. }% |
|
efd1e5d2284a
\versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents:
12500
diff
changeset
|
1018 \else% |
|
efd1e5d2284a
\versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents:
12500
diff
changeset
|
1019 { Changed in version #2:\ #1. }% |
|
efd1e5d2284a
\versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents:
12500
diff
changeset
|
1020 \fi% |
|
efd1e5d2284a
\versionchanged: Added optional parameter for explanation of change.
Fred Drake <fdrake@acm.org>
parents:
12500
diff
changeset
|
1021 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1022 |
| 8762 | 1023 |
| 1024 % Tables. | |
| 1025 % | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1026 \newenvironment{tableii}[4]{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1027 \begin{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1028 \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}% |
|
15310
5d2a2185c651
Remove second horizontal line below table headers; it is just too
Fred Drake <fdrake@acm.org>
parents:
14722
diff
changeset
|
1029 \begin{tabular}{#1}\strong{#3}&\strong{#4} \\* \hline% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1030 }{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1031 \end{tabular}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1032 \end{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1033 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1034 |
|
14722
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1035 \newenvironment{longtableii}[4]{% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1036 \begin{center}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1037 \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}% |
|
15310
5d2a2185c651
Remove second horizontal line below table headers; it is just too
Fred Drake <fdrake@acm.org>
parents:
14722
diff
changeset
|
1038 \begin{longtable}[c]{#1}\strong{#3}&\strong{#4} \\* \hline\endhead% |
|
14722
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1039 }{% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1040 \end{longtable}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1041 \end{center}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1042 } |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1043 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1044 \newenvironment{tableiii}[5]{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1045 \begin{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1046 \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
|
1047 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5} \\% |
|
15310
5d2a2185c651
Remove second horizontal line below table headers; it is just too
Fred Drake <fdrake@acm.org>
parents:
14722
diff
changeset
|
1048 \hline% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1049 }{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1050 \end{tabular}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1051 \end{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1052 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1053 |
|
14722
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1054 \newenvironment{longtableiii}[5]{% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1055 \begin{center}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1056 \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
|
1057 \begin{longtable}[c]{#1}\strong{#3}&\strong{#4}&\strong{#5} \\% |
|
15310
5d2a2185c651
Remove second horizontal line below table headers; it is just too
Fred Drake <fdrake@acm.org>
parents:
14722
diff
changeset
|
1058 \hline\endhead% |
|
14722
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1059 }{% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1060 \end{longtable}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1061 \end{center}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1062 } |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1063 |
|
8751
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1064 \newenvironment{tableiv}[6]{% |
|
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1065 \begin{center}% |
|
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1066 \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
|
1067 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6} \\% |
|
15310
5d2a2185c651
Remove second horizontal line below table headers; it is just too
Fred Drake <fdrake@acm.org>
parents:
14722
diff
changeset
|
1068 \hline% |
|
8751
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1069 }{% |
|
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1070 \end{tabular}% |
|
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1071 \end{center}% |
|
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1072 } |
|
99793302d10d
{tableiv} environment: Four-column table.
Fred Drake <fdrake@acm.org>
parents:
8726
diff
changeset
|
1073 |
|
14722
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1074 \newenvironment{longtableiv}[6]{% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1075 \begin{center}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1076 \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
|
1077 \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
|
1078 \\% |
|
15310
5d2a2185c651
Remove second horizontal line below table headers; it is just too
Fred Drake <fdrake@acm.org>
parents:
14722
diff
changeset
|
1079 \hline\endhead% |
|
14722
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1080 }{% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1081 \end{longtable}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1082 \end{center}% |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1083 } |
|
4d2e9cf1eb20
Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents:
14555
diff
changeset
|
1084 |
|
18683
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1085 \newenvironment{tablev}[7]{% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1086 \begin{center}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1087 \def\linev##1##2##3##4##5{\csname#2\endcsname{##1}&##2&##3&##4&##5\\}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1088 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6}&\strong{#7} \\% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1089 \hline% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1090 }{% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1091 \end{tabular}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1092 \end{center}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1093 } |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1094 |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1095 \newenvironment{longtablev}[7]{% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1096 \begin{center}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1097 \def\linev##1##2##3##4##5{\csname#2\endcsname{##1}&##2&##3&##4&##5\\}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1098 \begin{longtable}[c]{#1}\strong{#3}&\strong{#4}&\strong{#5}&\strong{#6}&\strong{#7}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1099 \\% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1100 \hline\endhead% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1101 }{% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1102 \end{longtable}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1103 \end{center}% |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1104 } |
|
8ca70c9c1971
Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents:
18427
diff
changeset
|
1105 |
|
26875
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1106 % XXX Don't think we can use this yet, though it cleans up some |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1107 % tedious markup. There's no equivalent for the HTML transform yet, |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1108 % and that needs to exist. I don't know how to write it. |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1109 % |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1110 % This should really have something that makes it easier to bind a |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1111 % table's ``Notes'' column and an associated tablenotes environment, |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1112 % and generates the right magic for getting the numbers right in the |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1113 % table. |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1114 % |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1115 % So this is quite incomplete. |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1116 % |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1117 \newcounter{py@tablenotescounter} |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1118 \newenvironment{tablenotes}{% |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1119 \noindent Notes: |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1120 \par |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1121 \setcounter{py@tablenotescounter}{0} |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1122 \begin{list}{(\arabic{py@tablenotescounter})}% |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1123 {\usecounter{py@tablenotescounter}} |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1124 }{\end{list}} |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1125 |
|
d177dd0ca8f7
Start something that might make table notes easier to deal with,
Fred Drake <fdrake@acm.org>
parents:
26015
diff
changeset
|
1126 |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1127 % 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
|
1128 % Sample usage: |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1129 % \begin{seealso} |
|
10846
b7378df3db56
Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents:
10770
diff
changeset
|
1130 % \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
|
1131 % \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
|
1132 % |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
1133 % % 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
|
1134 % \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
|
1135 % \module{pickle}.} |
|
b7378df3db56
Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents:
10770
diff
changeset
|
1136 % \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
|
1137 % |
|
10846
b7378df3db56
Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents:
10770
diff
changeset
|
1138 % 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
|
1139 % 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
|
1140 |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1141 \ifpdf |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1142 \newcommand{\py@seemodule}[3][\py@modulebadkey]{% |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1143 \par% |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1144 \ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi% |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1145 \begin{fulllineitems} |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1146 \item[\py@linkToName{label-module-\py@modulekey}{Module \module{#2}} |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1147 (section \ref{module-\py@modulekey}):] |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1148 #3 |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1149 \end{fulllineitems} |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1150 } |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1151 \else |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1152 \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
|
1153 \par% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1154 \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
|
1155 \begin{fulllineitems} |
|
b7378df3db56
Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents:
10770
diff
changeset
|
1156 \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
|
1157 #3 |
|
b7378df3db56
Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents:
10770
diff
changeset
|
1158 \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
|
1159 } |
|
20751
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1160 \fi |
|
85109a6099b5
Revise the PDF support in the LaTeX style sheet. This still isn't quite
Fred Drake <fdrake@acm.org>
parents:
20336
diff
changeset
|
1161 |
|
14521
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1162 % \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
|
1163 \newcommand{\py@seetitle}[3][\py@modulebadkey]{% |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1164 \par |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1165 \begin{fulllineitems} |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1166 \item[\citetitle{#2}] |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1167 \ifx\py@modulebadkey#1\else |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1168 \item[{\small{(\url{#1})}}] |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1169 \fi |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1170 #3 |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1171 \end{fulllineitems} |
|
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1172 } |
|
14490
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
1173 % \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
|
1174 \newcommand{\py@seepep}[3]{% |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
1175 \par% |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
1176 \begin{fulllineitems} |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
1177 \item[\pep{#1}, ``\emph{#2}''] |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
1178 #3 |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
1179 \end{fulllineitems} |
|
f78f287b3add
excclassdesc: New environment. For use in documenting class-based
Fred Drake <fdrake@acm.org>
parents:
14020
diff
changeset
|
1180 } |
|
12500
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1181 % \seerfc{number}{title}{why it's interesting} |
|
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1182 \newcommand{\py@seerfc}[3]{% |
|
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1183 \par% |
|
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1184 \begin{fulllineitems} |
|
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1185 \item[\rfc{#1}, ``\emph{#2}''] |
|
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1186 #3 |
|
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1187 \end{fulllineitems} |
|
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1188 } |
|
12638
def959352422
Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents:
12549
diff
changeset
|
1189 % \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
|
1190 \newcommand{\py@seeurl}[2]{% |
|
def959352422
Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents:
12549
diff
changeset
|
1191 \par% |
|
def959352422
Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents:
12549
diff
changeset
|
1192 \begin{fulllineitems} |
|
def959352422
Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents:
12549
diff
changeset
|
1193 \item[\url{#1}] |
|
def959352422
Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents:
12549
diff
changeset
|
1194 #2 |
|
def959352422
Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents:
12549
diff
changeset
|
1195 \end{fulllineitems} |
|
def959352422
Define \seeurl in the seealso environment. Two parameters: url, why.
Fred Drake <fdrake@acm.org>
parents:
12549
diff
changeset
|
1196 } |
|
21116
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1197 |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1198 \newenvironment{seealso*}{ |
|
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
|
1199 \par |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1200 \def\seetext##1{\par{##1}} |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1201 \let\seemodule=\py@seemodule |
|
14521
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1202 \let\seepep=\py@seepep |
|
12500
eb433efa24de
Define \seerfc within the seealso environment.
Fred Drake <fdrake@acm.org>
parents:
12377
diff
changeset
|
1203 \let\seerfc=\py@seerfc |
|
14521
9fed4eebc586
\seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents:
14490
diff
changeset
|
1204 \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
|
1205 \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
|
1206 }{\par} |
|
21116
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1207 \newenvironment{seealso}{ |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1208 \par |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1209 \strong{See Also:} |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1210 \par |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1211 \def\seetext##1{\par{##1}} |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1212 \let\seemodule=\py@seemodule |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1213 \let\seepep=\py@seepep |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1214 \let\seerfc=\py@seerfc |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1215 \let\seetitle=\py@seetitle |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1216 \let\seeurl=\py@seeurl |
|
0a67463f8b7d
Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents:
20841
diff
changeset
|
1217 }{\par} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1218 |
| 8762 | 1219 % 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
|
1220 % \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
|
1221 % 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
|
1222 % |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1223 \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
|
1224 \newcommand{\version}{} |
| 14555 | 1225 \newcommand{\shortversion}{} |
|
18180
c25876a51f1b
Add a little more support for describing version information. This
Fred Drake <fdrake@acm.org>
parents:
17778
diff
changeset
|
1226 \newcommand{\releaseinfo}{} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1227 \newcommand{\releasename}{Release} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1228 \newcommand{\release}[1]{% |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1229 \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
|
1230 \renewcommand{\version}{#1}} |
| 14555 | 1231 \newcommand{\setshortversion}[1]{% |
| 1232 \renewcommand{\shortversion}{#1}} | |
|
18180
c25876a51f1b
Add a little more support for describing version information. This
Fred Drake <fdrake@acm.org>
parents:
17778
diff
changeset
|
1233 \newcommand{\setreleaseinfo}[1]{% |
|
c25876a51f1b
Add a little more support for describing version information. This
Fred Drake <fdrake@acm.org>
parents:
17778
diff
changeset
|
1234 \renewcommand{\releaseinfo}{#1}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1235 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1236 % 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
|
1237 % 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
|
1238 % 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
|
1239 % |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1240 \newcommand{\py@authoraddress}{} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1241 \newcommand{\authoraddress}[1]{\renewcommand{\py@authoraddress}{#1}} |
|
8341
ebfde06fdb8d
Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents:
8306
diff
changeset
|
1242 \let\developersaddress=\authoraddress |
|
ebfde06fdb8d
Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents:
8306
diff
changeset
|
1243 \let\developer=\author |
|
ebfde06fdb8d
Added definitions for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents:
8306
diff
changeset
|
1244 \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
|
1245 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1246 % 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
|
1247 % 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
|
1248 % |
|
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
|
1249 \@ifundefined{ChTitleVar}{}{ |
|
8190
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1250 \ChNameVar{\raggedleft\normalsize\py@HeaderFamily} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1251 \ChNumVar{\raggedleft \bfseries\Large\py@HeaderFamily} |
|
25c2aea64501
Fixed \code so word wrapping is allowed.
Fred Drake <fdrake@acm.org>
parents:
8076
diff
changeset
|
1252 \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
|
1253 % 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
|
1254 \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
|
1255 {\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
|
1256 \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
|
1257 \DOCH |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1258 \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
|
1259 \interlinepenalty\@M |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1260 \DOTI{#1} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1261 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1262 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1263 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1264 |
|
8396
79071a4e0eca
Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents:
8341
diff
changeset
|
1265 |
|
79071a4e0eca
Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents:
8341
diff
changeset
|
1266 % 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
|
1267 % 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
|
1268 % |
|
79071a4e0eca
Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents:
8341
diff
changeset
|
1269 \newenvironment{definitions}{% |
|
79071a4e0eca
Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents:
8341
diff
changeset
|
1270 \begin{description}% |
| 9078 | 1271 \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
|
1272 }{% |
|
79071a4e0eca
Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents:
8341
diff
changeset
|
1273 \end{description}% |
|
79071a4e0eca
Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents:
8341
diff
changeset
|
1274 } |
|
79071a4e0eca
Added {definitions} environment, which has \term to define indivual terms.
Fred Drake <fdrake@acm.org>
parents:
8341
diff
changeset
|
1275 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1276 % 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
|
1277 \hyphenation{Base-HTTP-Re-quest-Hand-ler} |
