Mercurial > cpython-lru_cache-weakref
annotate Doc/texinputs/python.sty @ 8075:e39145a13096 legacy-trunk
Hide \varvars from "public" interface.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Fri, 17 Apr 1998 02:17:00 +0000 |
| parents | 48e2349d11c6 |
| children | de029e6f9838 |
| rev | line source |
|---|---|
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1 % |
|
7592
09440606aac5
Oops; file copy error somewhere along the way....
Fred Drake <fdrake@acm.org>
parents:
7585
diff
changeset
|
2 % python.sty for the Python docummentation [works only with with Latex2e] |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
3 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
4 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
5 \NeedsTeXFormat{LaTeX2e}[1995/12/01] |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
6 \ProvidesPackage{python} |
|
7737
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
7 [1998/01/11 LaTeX package (Python markup)] |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
8 |
| 7778 | 9 % These packages can be used to add marginal annotations which indicate |
| 10 % index entries and labels; useful for reviewing this messy documentation! | |
| 11 % | |
| 12 %\RequirePackage{showkeys} | |
| 13 %\RequirePackage{showidx} | |
| 14 | |
|
7737
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
15 % for PDF output, use maximal compression & a lot of other stuff |
|
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
16 % (test for PDF recommended by Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov>) |
|
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
17 % |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
18 \newif\if@doing@page@targets |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
19 \@doing@page@targetsfalse |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
20 |
|
7737
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
21 \ifx\pdfoutput\undefined\else\ifcase\pdfoutput |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
22 \let\LinkColor=\relax |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
23 \let\NormalColor=\relax |
|
7737
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
24 \else |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
25 \input{pdfcolor} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
26 \let\LinkColor=\NavyBlue |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
27 \let\NormalColor=\Black |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
28 \pdfcompresslevel=9 |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
29 % |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
30 % Pad the number with '0' to 3 digits wide so no page name is a prefix |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
31 % of any other. |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
32 % |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
33 \def\py@targetno#1{\ifnum#1<100 0\fi\ifnum#1<10 0\fi#1} |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
34 \def\py@pageno{\py@targetno\thepage} |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
35 % |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
36 % This definition allows the entries in the page-view of the ToC to be |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
37 % active links. Some work, some don't. |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
38 % |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
39 \let\OldContentsline=\contentsline |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
40 % 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
|
41 % \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
|
42 \renewcommand{\contentsline}[3]{% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
43 \def\my@pageno{\py@targetno{#3}}% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
44 \OldContentsline{#1}{% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
45 \pdfannotlink attr{/Border [0 0 0]} goto name{page\my@pageno}% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
46 \LinkColor#2\NormalColor% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
47 \pdfendlink% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
48 }{#3}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
49 } |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
50 % |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
51 % This is supposed to build the "outline" view of the document; it seems |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
52 % quite fragile. The breakages are the same as in the ToC. |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
53 % |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
54 \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
|
55 \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
|
56 } |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
57 \newcommand{\py@target}[1]{% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
58 \if@doing@page@targets% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
59 {\pdfdest name{#1} fit}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
60 \fi% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
61 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
62 \let\OldLabel=\label |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
63 \renewcommand{\label}[1]{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
64 \OldLabel{#1}% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
65 \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
|
66 } |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
67 % This stuff adds a page# destination to every PDF page, where # has |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
68 % the same formatting as the displayed page number. This doesn't really |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
69 % help with the frontmatter, but does fine with the body. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
70 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
71 % 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
|
72 % |
|
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
|
73 \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
|
74 \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
|
75 \@hyperfixhead |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
76 } |
|
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
|
77 \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
|
78 \let\H@old@thehead\@thehead |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
79 \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
|
80 \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
|
81 \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
|
82 \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
|
83 } |
|
7737
5d7e4d20c89e
Change uses of \pdfinfo and \pdfcatalog to use the new syntax from the
Fred Drake <fdrake@acm.org>
parents:
7706
diff
changeset
|
84 \fi\fi |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
85 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
86 % 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
|
87 \topmargin 0pt |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
88 \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
|
89 \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
|
90 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
91 % attempt to work a little better for A4 users |
|
7597
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
92 \@ifundefined{paperheight}{ |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
93 \textheight 9in |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
94 }{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
95 \textheight \paperheight |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
96 \advance\textheight by -2in |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
97 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
98 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
99 \oddsidemargin 0pt |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
100 \evensidemargin \oddsidemargin |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
101 \marginparwidth 0.5in |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
102 |
|
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
|
103 \@ifundefined{paperwidth}{ |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
104 \textwidth 6.5in |
|
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 \textwidth \paperwidth |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
107 \advance\textwidth by -2in |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
108 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
109 |
|
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 % 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
|
112 \raggedbottom |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
113 \sloppy |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
114 \parindent = 0mm |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
115 \parskip = 2mm |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
116 \hbadness = 5000 % don't print trivial gripes |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
117 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
118 \pagestyle{empty} % start this way; change for |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
119 \pagenumbering{roman} % ToC & chapters |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
120 \setcounter{secnumdepth}{1} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
121 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
122 % Use this to set the font family for headers and other decor: |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
123 \newcommand{\HeaderFamily}{\sffamily} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
124 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
125 % 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
|
126 \@ifundefined{fancyhf}{}{ |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
127 % 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
|
128 \fancypagestyle{normal}{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
129 \fancyhf{} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
130 \fancyfoot[LE,RO]{{\HeaderFamily\thepage}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
131 \fancyfoot[LO]{{\HeaderFamily\nouppercase{\rightmark}}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
132 \fancyfoot[RE]{{\HeaderFamily\nouppercase{\leftmark}}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
133 \renewcommand{\headrulewidth}{0pt} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
134 \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
|
135 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
136 % 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
|
137 % 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
|
138 % 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
|
139 \fancypagestyle{plain}{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
140 \fancyhf{} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
141 \fancyfoot[LE,RO]{{\HeaderFamily\thepage}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
142 \renewcommand{\headrulewidth}{0pt} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
143 \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
|
144 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
145 % 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
|
146 % 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
|
147 % 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
|
148 \@ifundefined{chapter}{}{ |
|
7548
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
149 \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
|
150 \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
|
151 \hbox{} |
|
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
152 \thispagestyle{plain} |
|
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
153 \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
|
154 \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
|
155 } |
|
7eb19b1ce84d
Improve separation of document class and python semantic constructs. This
Fred Drake <fdrake@acm.org>
parents:
7527
diff
changeset
|
156 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
157 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
158 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
159 % old code font selections: |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
160 \let\codefont=\tt |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
161 \let\sectcodefont=\tt |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
162 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
163 % (Haven't found a new one that gets <, >, and _ right without being |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
164 % monospaced.) |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
165 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
166 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
167 % 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
|
168 % 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
|
169 % code samples. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
170 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
171 % Variable used by begin code command |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
172 \newlength{\codewidth} |
|
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 \newcommand{\examplevspace}{2mm} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
175 \newcommand{\exampleindent}{1cm} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
176 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
177 \let\OldVerbatim=\verbatim |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
178 \let\OldEndVerbatim=\endverbatim |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
179 \renewcommand{\verbatim}{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
180 \begingroup% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
181 \setlength{\parindent}\exampleindent% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
182 % Calculate the text width for the minipage: |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
183 \setlength{\codewidth}{\linewidth}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
184 \addtolength{\codewidth}{-\parindent}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
185 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
186 \par% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
187 \vspace\examplevspace% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
188 \indent% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
189 \begin{minipage}[t]{\codewidth}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
190 \small% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
191 \OldVerbatim% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
192 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
193 \renewcommand{\endverbatim}{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
194 \OldEndVerbatim% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
195 \end{minipage}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
196 \endgroup% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
197 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
198 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
199 \newcommand{\reset@python}{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
200 \global\let\@thisclass=\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
201 \global\let\@thismodule=\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
202 } |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
203 \reset@python |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
204 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
205 % Augment the sectioning commands used to get our own font family in place, |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
206 % and reset some internal data items: |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
207 \renewcommand{\section}{\reset@python% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
208 \@startsection{section}{1}{\z@}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
209 {-3.5ex \@plus -1ex \@minus -.2ex}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
210 {2.3ex \@plus.2ex}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
211 {\reset@font\Large\HeaderFamily}} |
|
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
|
212 \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
213 {-3.25ex\@plus -1ex \@minus -.2ex}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
214 {1.5ex \@plus .2ex}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
215 {\reset@font\large\HeaderFamily}} |
|
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
|
216 \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
217 {-3.25ex\@plus -1ex \@minus -.2ex}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
218 {1.5ex \@plus .2ex}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
219 {\reset@font\normalsize\HeaderFamily}} |
|
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
|
220 \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
221 {3.25ex \@plus1ex \@minus.2ex}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
222 {-1em}% |
|
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
223 {\reset@font\normalsize\HeaderFamily}} |
|
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
|
224 \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\parindent}% |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
225 {3.25ex \@plus1ex \@minus .2ex}% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
226 {-1em}% |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
227 {\reset@font\normalsize\HeaderFamily}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
228 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
229 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
230 % Underscore hack (only act like subscript operator if in math mode) |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
231 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
232 % The following is due to Mark Wooding (the old version didn't work with |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
233 % Latex 2e. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
234 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
235 \DeclareRobustCommand\hackscore{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
236 \ifmmode_\else\textunderscore\fi% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
237 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
238 \begingroup |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
239 \catcode`\_\active |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
240 \def\next{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
241 \AtBeginDocument{\catcode`\_\active\def_{\hackscore{}}}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
242 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
243 \expandafter\endgroup\next |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
244 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
245 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
246 %% 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
|
247 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
248 % 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
|
249 % 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
|
250 % just keep the index entries in the roman font, uncomment the second |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
251 % definition to use instead; it matches O'Reilly style more. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
252 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
253 \newcommand{\idxcode}[1]{\codefont{#1}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
254 %\renewcommand{\idxcode}[1]{#1} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
255 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
256 % Command to generate 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
|
257 \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
|
258 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
259 % 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
|
260 \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
|
261 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
262 % 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
|
263 \newcommand{\indexiv}[4]{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
264 \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
|
265 \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
|
266 \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
|
267 \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
|
268 } |
|
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 % 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
|
271 % operator. |
|
7597
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
272 \newcommand{\stindex}[1]{\indexii{statement}{#1@{\idxcode{#1}}}} |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
273 \newcommand{\opindex}[1]{\indexii{operator}{#1@{\idxcode{#1}}}} |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
274 \newcommand{\exindex}[1]{\indexii{exception}{#1@{\idxcode{#1}}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
275 \newcommand{\obindex}[1]{\indexii{object}{#1}} |
|
7792
8d4148213cc0
\bifuncindex: Fix so entries combine correctly with those of the built-in
Fred Drake <fdrake@acm.org>
parents:
7786
diff
changeset
|
276 \newcommand{\bifuncindex}[1]{\withsubitem{(built-in function)}{\ttindex{#1()}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
277 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
278 % Add an index entry for a module |
|
7597
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
279 \newcommand{\refmodule}[2]{\index{#1@{\idxcode{#1}} (#2module)}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
280 \newcommand{\refmodindex}[1]{\refmodule{#1}{}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
281 \newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
282 \newcommand{\refexmodindex}[1]{\refmodule{#1}{extension }} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
283 \newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
284 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
285 % support for the module index |
|
7617
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
286 \newif\if@UseModuleIndex |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
287 \@UseModuleIndexfalse |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
288 |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
289 % Fix the theindex environment to add an entry to the Table of |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
290 % Contents; this is much nicer than just having to jump to the end of |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
291 % the book and flip around, especially with multiple indexes. |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
292 % |
|
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
|
293 \let\OldTheindex=\theindex |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
294 \renewcommand{\theindex}{ |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
295 \cleardoublepage |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
296 \OldTheindex |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
297 \addcontentsline{toc}{chapter}{\indexname} |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
298 } |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
299 |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
300 \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
|
301 \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
|
302 \openout\modindexfile=mod\jobname.idx |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
303 \@UseModuleIndextrue |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
304 } |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
305 |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
306 % Add the defining entry for a module |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
307 \newcommand{\@modindex}[2]{% |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
308 \global\def\@thismodule{#1} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
309 \setindexsubitem{(in module #1)}% |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
310 \index{#1@{\idxcode{#1}} (#2module)|textbf}% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
311 \if@UseModuleIndex% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
312 \write\modindexfile{\protect\indexentry{#1@{\tt #1}}{\thepage}}% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
313 \fi% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
314 } |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
315 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
316 % built-in & Python modules in the main distribution |
|
7617
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
317 \newcommand{\bimodindex}[1]{\@modindex{#1}{built-in }} |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
318 \newcommand{\stmodindex}[1]{\@modindex{#1}{standard }} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
319 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
320 % Python & extension modules outside the main distribution |
|
7617
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
321 \newcommand{\modindex}[1]{\@modindex{#1}{}} |
|
068a6942fe1a
Adjust the index support a bit to make it easier to deal with module index.
Fred Drake <fdrake@acm.org>
parents:
7597
diff
changeset
|
322 \newcommand{\exmodindex}[1]{\@modindex{#1}{extension }} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
323 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
324 % Additional string for an index entry |
|
7597
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
325 \newcommand{\index@subitem}{} |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
326 \newcommand{\setindexsubitem}[1]{\renewcommand{\index@subitem}{#1}} |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
327 \newcommand{\ttindex}[1]{\index{#1@{\idxcode{#1}} \index@subitem}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
328 |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
329 \newcommand{\withsubitem}[2]{% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
330 \begingroup% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
331 \def\index@subitem{#1}#2% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
332 \endgroup% |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
333 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
334 |
|
7801
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
335 |
|
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
336 % 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
|
337 % 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
|
338 % 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
|
339 |
|
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
340 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
341 % {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
|
342 % 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
|
343 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
344 \newenvironment{fulllineitems}{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
345 \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
|
346 \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
|
347 \itemsep -\parsep |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
348 \let\makelabel=\itemnewline} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
349 }{\end{list}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
350 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
351 % \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
|
352 % {*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
|
353 % be used in the debugger chapter. |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
354 \newcommand{\optional}[1]{% |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
355 {\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
|
356 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
357 % C functions ------------------------------------------------------------ |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
358 % \begin{cfuncdesc}{type}{name}{arglist} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
359 \newenvironment{cfuncdesc}[3]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
360 \begin{fulllineitems} |
|
8075
e39145a13096
Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents:
8067
diff
changeset
|
361 \item[\code{#1 \bfcode{#2}(\py@varvars{#3})}\index{#2@{\idxcode{#2()}}}] |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
362 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
363 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
364 % C variables ------------------------------------------------------------ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
365 % \begin{cvardesc}{type}{name} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
366 \newenvironment{cvardesc}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
367 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
368 \item[\code{#1 \bfcode{#2}}\index{#2@{\idxcode{#2}}}] |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
369 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
370 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
371 % C data types ----------------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
372 % \begin{ctypedesc}{typedef name} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
373 \newenvironment{ctypedesc}[1]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
374 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
375 \item[\bfcode{#1}\ttindex{#1}] |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
376 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
377 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
378 % simple functions (not methods) ----------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
379 % \begin{funcdesc}{name}{args} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
380 \newcommand{\funcline}[2]{\funclineni{#1}{#2}\ttindex{#1()}} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
381 \newenvironment{funcdesc}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
382 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
383 \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
|
384 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
385 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
386 % similar to {funcdesc}, but doesn't add to the index |
|
8075
e39145a13096
Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents:
8067
diff
changeset
|
387 \newcommand{\funclineni}[2]{\item[\code{\bfcode{#1}(\py@varvars{#2})}]} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
388 \newenvironment{funcdescni}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
389 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
390 \funclineni{#1}{#2} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
391 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
392 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
393 % classes ---------------------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
394 % \begin{classdesc}{name}{constructor args} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
395 \newenvironment{classdesc}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
396 \global\def\@thisclass{#1} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
397 \begin{fulllineitems} |
|
8075
e39145a13096
Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents:
8067
diff
changeset
|
398 \item[\code{\bfcode{#1}(\py@varvars{#2})}% |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
399 \withsubitem{(class in \@thismodule)}{\ttindex{#1}}] |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
400 \def\baseclasses##1{} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
401 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
402 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
403 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
404 \newcommand{\@classbadkey}{--bad current class--} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
405 \let\@classbadkey=\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
406 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
407 % object method ---------------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
408 % \begin{methoddesc}[classname]{methodname}{args} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
409 \newcommand{\methodline}[3][\@classbadkey]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
410 \methodlineni{#2}{#3} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
411 \ifx#1\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
412 \withsubitem{(\@thisclass\ method)}{\ttindex{#2()}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
413 \else |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
414 \withsubitem{(#1 method)}{\ttindex{#2()}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
415 \fi |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
416 } |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
417 \newenvironment{methoddesc}[3][\@classbadkey]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
418 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
419 \ifx#1\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
420 \methodline{#2}{#3} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
421 \else |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
422 \def\@thisclass{#1} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
423 \methodline[#1]{#2}{#3} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
424 \fi |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
425 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
426 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
427 % 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
|
428 % (never actually uses the optional argument) |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
429 \newcommand{\methodlineni}[3][\@classbadkey]{% |
|
8075
e39145a13096
Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents:
8067
diff
changeset
|
430 \item[\code{\bfcode{#2}(\py@varvars{#3})}]} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
431 \newenvironment{methoddescni}[3][\@classbadkey]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
432 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
433 \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
|
434 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
435 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
436 % object data attribute -------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
437 % \begin{memberdesc}[classname]{membername} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
438 \newcommand{\memberline}[2][\@classbadkey]{% |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
439 \ifx#1\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
440 \memberlineni{#2} |
|
7898
6a0299ebccef
Data attributes of objects should not be indexed with trailing parentheses!
Fred Drake <fdrake@acm.org>
parents:
7850
diff
changeset
|
441 \withsubitem{(\@thisclass\ attribute)}{\ttindex{#2}} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
442 \else |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
443 \memberlineni{#2} |
|
7898
6a0299ebccef
Data attributes of objects should not be indexed with trailing parentheses!
Fred Drake <fdrake@acm.org>
parents:
7850
diff
changeset
|
444 \withsubitem{(#1 attribute)}{\ttindex{#2}} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
445 \fi |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
446 } |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
447 \newenvironment{memberdesc}[2][\@classbadkey]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
448 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
449 \ifx#1\@undefined |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
450 \memberline{#2} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
451 \else |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
452 \def\@thisclass{#1} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
453 \memberline[#1]{#2} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
454 \fi |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
455 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
456 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
457 % 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
|
458 % (never actually uses the optional argument) |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
459 \newcommand{\memberlineni}[2][\@classbadkey]{\item[\bfcode{#2}]} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
460 \newenvironment{memberdescni}[2][\@classbadkey]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
461 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
462 \memberlineni{#2} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
463 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
464 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
465 % For exceptions: -------------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
466 % \begin{excdesc}{name} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
467 % -- need support for constructor; maybe use optional parameter? |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
468 \newenvironment{excdesc}[1]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
469 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
470 \item[\bfcode{#1}\ttindex{#1}] |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
471 }{\end{fulllineitems}} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
472 |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
473 % Module data or constants: ---------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
474 % \begin{datadesc}{name} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
475 \newcommand{\dataline}[1]{\datalineni{#1}\ttindex{#1}} |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
476 \newenvironment{datadesc}[1]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
477 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
478 \dataline{#1} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
479 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
480 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
481 % 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
|
482 \newcommand{\datalineni}[1]{\item[\bfcode{#1}]\nopagebreak} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
483 \newenvironment{datadescni}[1]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
484 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
485 \datalineni{#1} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
486 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
487 |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
488 % bytecode instruction --------------------------------------------------- |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
489 % \begin{opcodedesc}{name}{var} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
490 % -- {var} may be {} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
491 \newenvironment{opcodedesc}[2]{ |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
492 \begin{fulllineitems} |
|
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
493 \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
|
494 }{\end{fulllineitems}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
495 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
496 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
497 \let\nodename=\label |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
498 |
|
7740
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
499 \newcommand{\sectcode}[1]{{\sectcodefont{#1}}} |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
500 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
501 % 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
|
502 % {\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
|
503 \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
|
504 \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
|
505 \newcommand{\POSIX}{POSIX} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
506 \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
|
507 \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
|
508 \newcommand{\C}{C} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
509 \newcommand{\EOF}{{\sc eof}} |
|
7740
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
510 \newcommand{\NULL}{\sectcode{NULL}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
511 |
|
7801
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
512 % 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
|
513 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
514 % code is the most difficult one... |
|
7597
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
515 \newcommand{\code}[1]{{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
516 \mbox{\codefont{#1}}}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
517 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
518 \newcommand{\bfcode}[1]{\code{\bfseries#1}} % bold-faced code font |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
519 \newcommand{\kbd}[1]{\mbox{\tt #1}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
520 \newcommand{\key}[1]{\mbox{\tt #1}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
521 \newcommand{\samp}[1]{\mbox{`\code{#1}'}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
522 % This weird definition of \var{} allows it to always appear in roman |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
523 % italics, and won't get funky in code fragments when we play around |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
524 % with fonts. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
525 \newcommand{\var}[1]{\mbox{\normalsize\textrm{\textit{#1\/}}}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
526 \renewcommand{\emph}[1]{{\em #1\/}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
527 \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
|
528 \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
|
529 % let's experiment with a new font: |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
530 \newcommand{\file}[1]{`{\small\textsf{#1}}'} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
531 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
532 % 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
|
533 % but only if we actually used hyperref: |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
534 \@ifundefined{pdfannotlink}{ |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
535 \newcommand{\py@url}[1]{\mbox{\small\textsf{#1}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
536 }{ |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
537 \newcommand{\py@url}[1]{{% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
538 \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
539 \LinkColor% color of the link text |
|
7764
9d0dc11775a4
Add comments about several of the environments.
Fred Drake <fdrake@acm.org>
parents:
7740
diff
changeset
|
540 {\small\textsf{#1}}% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
541 \NormalColor% Turn it back off; these are declarative |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
542 \pdfendlink}% and don't appear bound to the current |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
543 }% formatting "box". |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
544 } |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
545 \let\url=\py@url |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
546 \newcommand{\email}[1]{{\small\textsf{#1}}} |
| 7778 | 547 \newcommand{\newsgroup}[1]{{\small\textsf{#1}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
548 |
|
8075
e39145a13096
Hide \varvars from "public" interface.
Fred Drake <fdrake@acm.org>
parents:
8067
diff
changeset
|
549 \newcommand{\py@varvars}[1]{{\def\,{\/{\char`\,}}\var{#1}}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
550 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
551 \newif\iftexi\texifalse |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
552 \newif\iflatex\latextrue |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
553 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
554 % 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
|
555 % 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
|
556 % 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
|
557 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
558 % 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
|
559 % 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
|
560 % |
|
7740
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
561 \let\module=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
562 \let\keyword=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
563 \let\exception=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
564 \let\class=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
565 \let\function=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
566 \let\member=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
567 \let\method=\sectcode |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
568 |
|
7801
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
569 \newcommand{\pytype}[1]{#1} % built-in Python type |
|
047996666c81
Removed an obsolete hack that's been commented out for a long time.
Fred Drake <fdrake@acm.org>
parents:
7792
diff
changeset
|
570 |
|
7740
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
571 \let\cfunction=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
572 \let\ctype=\sectcode |
|
423be7cd0479
Don't use the fncychap package for HOWTO documents; appendices break. Still
Fred Drake <fdrake@acm.org>
parents:
7737
diff
changeset
|
573 \let\cdata=\sectcode |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
574 |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
575 \newcommand{\mimetype}[1]{{\small\textsf{#1}}} |
|
7670
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
576 % 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
|
577 \newcommand{\regexp}[1]{% |
|
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
578 {\tiny$^{^\lceil}\!\!$% |
|
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
579 {\normalsize\code{#1}}% |
|
7850
db1e49d51fe1
Increase space between the end of a regexp and the little right floor symbol
Fred Drake <fdrake@acm.org>
parents:
7801
diff
changeset
|
580 $\!\rfloor\!$% |
|
7670
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
581 }} |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
582 \newcommand{\envvar}[1]{% |
|
7670
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
583 \$#1% $ <-- bow to font-lock 3 times! |
|
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
584 \index{#1@{\$#1}}% $ |
|
8e6a58019887
\regexp{}: Rewritten to look like Freidl's book. Too rip-off?
Fred Drake <fdrake@acm.org>
parents:
7659
diff
changeset
|
585 \index{environment variables!{\$#1}}% $ |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
586 } |
|
7786
6adf917ee773
Fix one remaining internal use of \code{} that could use the simpler form.
Fred Drake <fdrake@acm.org>
parents:
7778
diff
changeset
|
587 \newcommand{\makevar}[1]{#1} |
|
7659
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
588 \let\character=\samp |
|
869373fa0bf8
\withsubitem{}: New macro. Change indexsubitem temporarily for another
Fred Drake <fdrake@acm.org>
parents:
7617
diff
changeset
|
589 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
590 % constants defined in Python modules or C headers, not language constants: |
|
7786
6adf917ee773
Fix one remaining internal use of \code{} that could use the simpler form.
Fred Drake <fdrake@acm.org>
parents:
7778
diff
changeset
|
591 \let\constant=\sectcode |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
592 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
593 \newcommand{\manpage}[2]{{\emph{#1}(#2)}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
594 \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
|
595 \newcommand{\program}[1]{\strong{#1}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
596 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
597 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
598 % Deprecation stuff. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
599 % 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
|
600 % 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
|
601 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
602 % 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
|
603 % 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
|
604 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
605 % Example: |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
606 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
607 % \deprecated {1.5.1} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
608 % {Use \method{frobnicate()} instead.} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
609 % |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
610 \newcommand{\deprecated}[2]{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
611 \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
|
612 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
613 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
614 \newenvironment{tableii}[4]{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
615 \begin{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
616 \def\lineii##1##2{\csname#2\endcsname{##1}&##2\\}% |
| 8018 | 617 \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
|
618 }{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
619 \end{tabular}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
620 \end{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
621 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
622 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
623 \newenvironment{tableiii}[5]{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
624 \begin{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
625 \def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}% |
| 8018 | 626 \begin{tabular}{#1}\strong{#3}&\strong{#4}&\strong{#5} \\ \hline% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
627 }{% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
628 \end{tabular}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
629 \end{center}% |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
630 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
631 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
632 \newcommand{\itemnewline}[1]{% |
|
7597
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
633 \@tempdima\linewidth% |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
634 \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
635 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
636 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
637 % Cross-referencing (AMK) |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
638 % Sample usage: |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
639 % \begin{seealso} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
640 % \seemodule{rand}{Uniform random number generator}; % Module xref |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
641 % \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
|
642 % |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
643 % % A funky case: module name contains '_'; have to supply an optional key |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
644 % \seemodule[copyreg]{copy_reg}{pickle interface constructor registration} |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
645 % |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
646 % \end{seealso} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
647 |
|
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
|
648 \newcommand{\@modulebadkey}{{--just-some-junk--}} |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
649 |
|
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
|
650 \@ifundefined{pdfannotlink}{% |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
651 \newcommand{\seemodule}[3][\@modulebadkey]{% |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
652 \ifx\@modulebadkey#1\def\@modulekey{#2}\else\def\@modulekey{#1}\fi% |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
653 \ref{module-\@modulekey}:\quad % |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
654 Module \module{#2}% |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
655 \quad (#3)% |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
656 } |
|
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
|
657 }{\newcommand{\seemodule}[3][\@modulebadkey]{% |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
658 \ifx\@modulebadkey#1\def\@modulekey{#2}\else\def\@modulekey{#1}\fi% |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
659 \ref{module-\@modulekey}:\quad % |
|
8067
48e2349d11c6
Fix the broken PDF links, really this time!
Fred Drake <fdrake@acm.org>
parents:
8066
diff
changeset
|
660 {\pdfannotlink attr{/Border [0 0 0]} goto name{label-module-\@modulekey}% |
|
7585
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
661 \LinkColor Module \module{#2} \NormalColor% |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
662 \pdfendlink% |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
663 }% |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
664 \quad (#3)% |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
665 } |
|
2ef0aca96f2d
Revise some of the PDF support to get at least preliminary outline support.
Fred Drake <fdrake@acm.org>
parents:
7561
diff
changeset
|
666 } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
667 \newenvironment{seealso}[0]{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
668 \strong{See Also:}\par |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
669 \def\seetext##1{\par{##1}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
670 }{\par} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
671 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
672 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
673 % Allow the release number to be specified independently of the |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
674 % \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
|
675 % 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
|
676 % |
|
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
|
677 \newcommand{\@release}{} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
678 \newcommand{\version}{} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
679 \newcommand{\releasename}{Release} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
680 \newcommand{\release}[1]{% |
|
7597
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
681 \renewcommand{\@release}{\releasename\space\version}% |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
682 \renewcommand{\version}{#1}} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
683 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
684 % 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
|
685 % 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
|
686 % 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
|
687 % |
|
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
|
688 \newcommand{\@authoraddress}{} |
|
39b84a3dceaa
Never, NEVER try to recover a screwed up file by carving a chunk out of an
Fred Drake <fdrake@acm.org>
parents:
7592
diff
changeset
|
689 \newcommand{\authoraddress}[1]{\renewcommand{\@authoraddress}{#1}} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
690 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
691 % 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
|
692 % 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
|
693 % |
|
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
|
694 \@ifundefined{ChTitleVar}{}{ |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
695 \ChNameVar{\raggedleft\normalsize\HeaderFamily} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
696 \ChNumVar{\raggedleft \bfseries\Large\HeaderFamily} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
697 \ChTitleVar{\raggedleft \rm\Huge\HeaderFamily} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
698 % 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
|
699 \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
|
700 {\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
|
701 \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
|
702 \DOCH |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
703 \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
|
704 \interlinepenalty\@M |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
705 \DOTI{#1} |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
706 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
707 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
708 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
709 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
710 % 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
|
711 \hyphenation{Base-HTTP-Re-quest-Hand-ler} |
