blob: ad376c6a5bcf300af8d792c51c91f14dba3d11d0 [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%
Fred Drakedbe132c1998-03-06 21:21:56 +000027\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.}
Fred Drakedbe132c1998-03-06 21:21:56 +000028
29
30% Required package:
31%
32% This gives us all the Python-specific markup that we really want.
33% This should come last. Do not change this.
34%
Fred Drakedbe132c1998-03-06 21:21:56 +000035\RequirePackage{python}
36
Fred Drake2fcadb21998-07-23 17:36:46 +000037% support for module synopsis sections:
38\newcommand{\py@ModSynopsisFilename}{\jobname.syn}
39
Fred Drakedbe132c1998-03-06 21:21:56 +000040
Fred Drake55730311998-03-25 15:41:23 +000041% need to do one of these....
Fred Drake2a3ab4f1998-04-28 18:31:50 +000042\newcommand{\py@doHorizontalRule}{\rule{\textwidth}{1pt}}
Fred Drake55730311998-03-25 15:41:23 +000043
44
Fred Drakedbe132c1998-03-06 21:21:56 +000045% Change the title page to look a bit better, and fit in with the
46% fncychap ``Bjarne'' style a bit better.
47%
48\renewcommand{\maketitle}{
Fred Drake2a3ab4f1998-04-28 18:31:50 +000049 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000050 \@ifundefined{pdfinfo}{}{
Fred Drakec0b2e451998-03-25 14:53:43 +000051 \pdfinfo{
52 /Author (\@author)
53 /Title (\@title)
54 }
Fred Drakedbe132c1998-03-06 21:21:56 +000055 }
56 \begin{flushright}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000057 {\rm\Huge\py@HeaderFamily \@title} \par
58 {\em\large\py@HeaderFamily \py@release} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000059 \vspace{25pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000060 {\Large\py@HeaderFamily \@author} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000061 \vspace{25pt}
62 \@date \par
Fred Drake2a3ab4f1998-04-28 18:31:50 +000063 \py@authoraddress \par
Fred Drakedbe132c1998-03-06 21:21:56 +000064 \end{flushright}
65 \@thanks
66 \setcounter{footnote}{0}
67 \let\thanks\relax\let\maketitle\relax
68 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
69}
70
71
Fred Drake2a3ab4f1998-04-28 18:31:50 +000072\let\py@OldTableofcontents=\tableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000073\renewcommand{\tableofcontents}{
74 \begingroup
75 \parskip = 0mm
Fred Drake2a3ab4f1998-04-28 18:31:50 +000076 \py@OldTableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000077 \endgroup
Fred Drake2a3ab4f1998-04-28 18:31:50 +000078 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000079 \vspace{12pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000080 \py@doing@page@targetstrue
Fred Drakedbe132c1998-03-06 21:21:56 +000081}
82
Fred Draked579ed81998-04-17 02:45:41 +000083% Fix the theindex environment to add an entry to the Table of
84% Contents; this is much nicer than just having to jump to the end of
85% the book and flip around, especially with multiple indexes.
86%
Fred Drake2a3ab4f1998-04-28 18:31:50 +000087\let\py@OldTheindex=\theindex
Fred Draked579ed81998-04-17 02:45:41 +000088\renewcommand{\theindex}{
89 \clearpage
Fred Drake2a3ab4f1998-04-28 18:31:50 +000090 \py@OldTheindex
Fred Draked579ed81998-04-17 02:45:41 +000091 \addcontentsline{toc}{section}{\indexname}
92}
93
Fred Drakedbe132c1998-03-06 21:21:56 +000094\@ifundefined{fancyhf}{
95 \pagestyle{plain}}{
96 \pagestyle{normal}} % start this way; change for
97\pagenumbering{arabic} % ToC & chapters
98\setcounter{secnumdepth}{2}
99
100\thispagestyle{empty}