blob: f2c1ecd9d20ab068017bf0221afe180875d426a1 [file] [log] [blame]
Fred Drakedbe132c1998-03-06 21:21:56 +00001%
2% howto.cls for the Python documentation
3%
4
5\NeedsTeXFormat{LaTeX2e}[1995/12/01]
6\ProvidesClass{howto}
7 [1998/02/25 Document class (Python HOWTO)]
8
9
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]{article}
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
35% Required package:
36%
37% This gives us all the Python-specific markup that we really want.
38% This should come last. Do not change this.
39%
Fred Drakedbe132c1998-03-06 21:21:56 +000040\RequirePackage{python}
41
42
Fred Drake55730311998-03-25 15:41:23 +000043% need to do one of these....
44\newcommand{\@doHorizontalRule}{\rule{\textwidth}{1pt}}
45
46
Fred Drakedbe132c1998-03-06 21:21:56 +000047% Change the title page to look a bit better, and fit in with the
48% fncychap ``Bjarne'' style a bit better.
49%
50\renewcommand{\maketitle}{
Fred Drake55730311998-03-25 15:41:23 +000051 \@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000052 \@ifundefined{pdfinfo}{}{
Fred Drakec0b2e451998-03-25 14:53:43 +000053 \pdfinfo{
54 /Author (\@author)
55 /Title (\@title)
56 }
Fred Drakedbe132c1998-03-06 21:21:56 +000057 }
58 \begin{flushright}
59 {\rm\Huge\HeaderFamily \@title} \par
60 {\em\large\HeaderFamily \@release} \par
61 \vspace{25pt}
62 {\Large\HeaderFamily \@author} \par
63 \vspace{25pt}
64 \@date \par
65 \@authoraddress \par
66 \end{flushright}
67 \@thanks
68 \setcounter{footnote}{0}
69 \let\thanks\relax\let\maketitle\relax
70 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
71}
72
73
74\let\OldTableofcontents=\tableofcontents
75\renewcommand{\tableofcontents}{
76 \begingroup
77 \parskip = 0mm
78 \OldTableofcontents
79 \endgroup
Fred Drake55730311998-03-25 15:41:23 +000080 \@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000081 \vspace{12pt}
Fred Drake48a16bf1998-03-27 05:24:03 +000082 \@doing@page@targetstrue
Fred Drakedbe132c1998-03-06 21:21:56 +000083}
84
Fred Draked579ed81998-04-17 02:45:41 +000085% Fix the theindex environment to add an entry to the Table of
86% Contents; this is much nicer than just having to jump to the end of
87% the book and flip around, especially with multiple indexes.
88%
89\let\OldTheindex=\theindex
90\renewcommand{\theindex}{
91 \clearpage
92 \OldTheindex
93 \addcontentsline{toc}{section}{\indexname}
94}
95
Fred Drakedbe132c1998-03-06 21:21:56 +000096\@ifundefined{fancyhf}{
97 \pagestyle{plain}}{
98 \pagestyle{normal}} % start this way; change for
99\pagenumbering{arabic} % ToC & chapters
100\setcounter{secnumdepth}{2}
101
102\thispagestyle{empty}