2 % manual.cls for the Python documentation
5 \NeedsTeXFormat{LaTeX2e
}[1995/
12/
01]
7 [1998/
03/
03 Document class (Python manual)
]
9 \RequirePackage{pypaper
}
10 \RequirePackage{fancybox
}
12 % Change the options here to get a different set of basic options, but only
13 % if you have to. Paper and font size should be adjusted in pypaper.sty.
15 \LoadClass[\py@paper,
\py@ptsize,twoside,openright
]{report}
17 \setcounter{secnumdepth
}{2}
21 % If processing of these documents fails at your TeX installation,
22 % these may be commented out (independently) to make things work.
23 % These are both supplied with the current version of the teTeX
26 % The "fancyhdr" package makes nicer page footers reasonable to
27 % implement, and is used to put the chapter and section information in
30 \RequirePackage{fancyhdr
}\typeout{Using fancier footers than usual.
}
35 % The "fncychap" package is used to get the nice chapter headers. The
36 % .sty file is distributed with Python, so you should not need to disable
37 % it. You'd also end up with a mixed page style; uglier than stock LaTeX!
39 \RequirePackage[Bjarne
]{fncychap
}\typeout{Using fancy chapter headings.
}
40 % Do horizontal rules it this way to match:
41 \newcommand{\py@doHorizontalRule
}{\mghrulefill{\RW}}
44 % This gives us all the Python-specific markup that we really want.
45 % This should come last. Do not change this.
47 \RequirePackage{python
}
49 % support for module synopsis sections:
50 \newcommand{\py@ModSynopsisFilename
}{\jobname\thechapter.syn
}
51 \let\py@OldChapter=
\chapter
52 \renewcommand{\chapter}{
53 \py@ProcessModSynopsis
54 \py@closeModSynopsisFile
59 % Change the title page to look a bit better, and fit in with the
60 % fncychap ``Bjarne'' style a bit better.
62 \renewcommand{\maketitle}{%
64 \let\footnotesize\small
65 \let\footnoterule\relax
67 \@ifundefined
{pdfinfo
}{}{{
68 % This \def is required to deal with multi-line authors; it
69 % changes \\ to ', ' (comma-space), making it pass muster for
70 % generating document info in the PDF file.
78 {\rm\Huge\py@HeaderFamily \@title
\par}%
79 {\em\LARGE\py@HeaderFamily
\py@release
\releaseinfo \par}
81 {\LARGE\py@HeaderFamily \@author
\par}
86 \py@authoraddress
\par
91 \setcounter{footnote
}{0}%
92 \let\thanks\relax\let\maketitle\relax
93 \gdef\@thanks
{}\gdef\@author
{}\gdef\@title
{}
97 % Catch the end of the {abstract} environment, but here make sure the
98 % abstract is followed by a blank page if the 'openright' option is used.
100 \let\py@OldEndAbstract=
\endabstract
101 \renewcommand{\endabstract}{
104 \typeout{Adding blank page after the abstract.
}
111 % This wraps the \tableofcontents macro with all the magic to get the
112 % spacing right and have the right number of pages if the 'openright'
113 % option has been used. This eliminates a fair amount of crud in the
114 % individual document files.
116 \let\py@OldTableofcontents=
\tableofcontents
117 \renewcommand{\tableofcontents}{%
118 \setcounter{page
}{1}%
123 \py@OldTableofcontents
%
126 \typeout{Adding blank page after the table of contents.
}%
127 \pagebreak\hspace{0pt
}%
132 \pagenumbering{arabic
}%
133 \@ifundefined
{fancyhf
}{}{\pagestyle{normal
}}%
134 \py@doing@page@targetstrue
%
136 % This is needed to get the width of the section # area wide enough in the
137 % library reference. Doing it here keeps it the same for all the manuals.
139 \renewcommand*
\l@section
{\@dottedtocline
{1}{1.5em
}{2.6em
}}
140 \renewcommand*
\l@subsection
{\@dottedtocline
{2}{4.1em
}{3.5em
}}
141 \setcounter{tocdepth}{1}
144 % Fix the theindex environment to add an entry to the Table of
145 % Contents; this is much nicer than just having to jump to the end of
146 % the book and flip around, especially with multiple indexes.
148 \let\py@OldTheindex=
\theindex
149 \renewcommand{\theindex}{
152 \addcontentsline{toc
}{chapter
}{\indexname}