blob: c7ab75ed16e39ca4dc2b489cdac363428a3ddf77 [file] [log] [blame]
Fred Drake6659c301998-03-03 22:02:19 +00001%
2% manual.cls for the Python documentation
3%
4
5\NeedsTeXFormat{LaTeX2e}[1995/12/01]
6\ProvidesClass{manual}
Fred Drake28f13911998-03-04 21:47:59 +00007 [1998/03/03 Document class (Python manual)]
8
Fred Drake6659c301998-03-03 22:02:19 +00009
10% Change the options here to get a different set of basic options, This
11% is where to add things like "a4paper" or "10pt".
12%
13\LoadClass[twoside,openright]{report}
14
15
16% Optional packages:
17%
18% If processing of these documents fails at your TeX installation,
19% these may be commented out (independently) to make things work.
20% These are both supplied with the current version of the teTeX
21% distribution.
22%
23% The "fancyhdr" package makes nicer page footers reasonable to
24% implement, and is used to put the chapter and section information in
25% the footers.
26%
27% The "times" package makes the default font the PostScript Times
28% font, which makes for smaller PostScript and a font that more people
29% like.
30%
31\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.}
32\RequirePackage{times}\typeout{Using times fonts instead of Computer Modern.}
33
34
Fred Drake55730311998-03-25 15:41:23 +000035% Required packages:
36%
37% The "fncychap" package is used to get the nice chapter headers. The
38% .sty file is distributed with Python, so you should not need to disable
39% it. You'd also end up with a mixed page style; uglier than stock LaTeX!
40%
41\RequirePackage[Bjarne]{fncychap}\typeout{Using fancy chapter headings.}
42% Do horizontal rules it this way to match:
43\newcommand{\@doHorizontalRule}{\mghrulefill{\RW}}
44%
Fred Drake6659c301998-03-03 22:02:19 +000045%
46% This gives us all the Python-specific markup that we really want.
47% This should come last. Do not change this.
48%
49\RequirePackage{python}
Fred Drake28f13911998-03-04 21:47:59 +000050
51
52% Change the title page to look a bit better, and fit in with the
53% fncychap ``Bjarne'' style a bit better.
54%
55\renewcommand{\maketitle}{%
56 \begin{titlepage}%
57 \let\footnotesize\small
58 \let\footnoterule\relax
Fred Drake55730311998-03-25 15:41:23 +000059 \@doHorizontalRule%
Fred Drake28f13911998-03-04 21:47:59 +000060 \@ifundefined{pdfinfo}{}{
Fred Drakec0b2e451998-03-25 14:53:43 +000061 \pdfinfo{
62 /Author (\@author)
63 /Title (\@title)
64 }
Fred Drake28f13911998-03-04 21:47:59 +000065 }
66 \begin{flushright}%
67 {\rm\Huge\HeaderFamily \@title \par}%
68 {\em\LARGE\HeaderFamily \@release \par}
69 \vfill
70 {\LARGE\HeaderFamily \@author \par}
71 \vfill\vfill
72 {\large
73 \@date \par
74 \vfill
75 \@authoraddress \par
76 }%
77 \end{flushright}%\par
78 \@thanks
79 \end{titlepage}%
80 \setcounter{footnote}{0}%
81 \let\thanks\relax\let\maketitle\relax
82 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
83}
84
85
Fred Drakeaa54e2d1998-03-05 16:41:42 +000086% Catch the end of the {abstract} environment, but here make sure the
87% abstract is followed by a blank page if the 'openright' option is used.
88%
89\let\OldEndAbstract=\endabstract
90\renewcommand{\endabstract}{
91 \if@openright
92 \ifodd\value{page}
93 \typeout{Adding blank page after the abstract.}
94 \vfil\pagebreak
95 \fi
96 \fi
97 \OldEndAbstract
98}
99
Fred Drake28f13911998-03-04 21:47:59 +0000100% This wraps the \tableofcontents macro with all the magic to get the
101% spacing right and have the right number of pages if the 'openright'
102% option has been used. This eliminates a fair amount of crud in the
103% individual document files.
104%
105\let\OldTableofcontents=\tableofcontents
106\renewcommand{\tableofcontents}{%
107 \setcounter{page}{1}%
108 \pagebreak%
109 \pagestyle{plain}%
110 {%
111 \parskip = 0mm%
112 \OldTableofcontents%
113 \if@openright%
114 \ifodd\value{page}%
115 \typeout{Adding blank page after the table of contents.}%
116 \pagebreak\hspace{0pt}%
117 \fi%
118 \fi%
119 \cleardoublepage%
120 }%
121 \pagenumbering{arabic}%
122 \@ifundefined{fancyhf}{}{\pagestyle{normal}}%
Fred Drake48a16bf1998-03-27 05:24:03 +0000123 \@doing@page@targetstrue%
Fred Drake28f13911998-03-04 21:47:59 +0000124}