blob: 127edc4a2d90db7047c22dee7fc47266f851c5e8 [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
Fred Draked85b5a41999-06-29 18:15:59 +000015\setcounter{secnumdepth}{1}
Fred Drakedbe132c1998-03-06 21:21:56 +000016
17% Optional packages:
18%
19% If processing of these documents fails at your TeX installation,
20% these may be commented out (independently) to make things work.
21% These are both supplied with the current version of the teTeX
22% distribution.
23%
24% The "fancyhdr" package makes nicer page footers reasonable to
25% implement, and is used to put the chapter and section information in
26% the footers.
27%
Fred Drakedbe132c1998-03-06 21:21:56 +000028\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.}
Fred Drakedbe132c1998-03-06 21:21:56 +000029
30
31% Required package:
32%
33% This gives us all the Python-specific markup that we really want.
34% This should come last. Do not change this.
35%
Fred Drakedbe132c1998-03-06 21:21:56 +000036\RequirePackage{python}
37
Fred Drake2fcadb21998-07-23 17:36:46 +000038% support for module synopsis sections:
39\newcommand{\py@ModSynopsisFilename}{\jobname.syn}
40
Fred Drakedbe132c1998-03-06 21:21:56 +000041
Fred Drake55730311998-03-25 15:41:23 +000042% need to do one of these....
Fred Drake2a3ab4f1998-04-28 18:31:50 +000043\newcommand{\py@doHorizontalRule}{\rule{\textwidth}{1pt}}
Fred Drake55730311998-03-25 15:41:23 +000044
45
Fred Drakedbe132c1998-03-06 21:21:56 +000046% Change the title page to look a bit better, and fit in with the
47% fncychap ``Bjarne'' style a bit better.
48%
49\renewcommand{\maketitle}{
Fred Drake2a3ab4f1998-04-28 18:31:50 +000050 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000051 \@ifundefined{pdfinfo}{}{
Fred Drakec0b2e451998-03-25 14:53:43 +000052 \pdfinfo{
53 /Author (\@author)
54 /Title (\@title)
55 }
Fred Drakedbe132c1998-03-06 21:21:56 +000056 }
57 \begin{flushright}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000058 {\rm\Huge\py@HeaderFamily \@title} \par
59 {\em\large\py@HeaderFamily \py@release} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000060 \vspace{25pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000061 {\Large\py@HeaderFamily \@author} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000062 \vspace{25pt}
63 \@date \par
Fred Drake2a3ab4f1998-04-28 18:31:50 +000064 \py@authoraddress \par
Fred Drakedbe132c1998-03-06 21:21:56 +000065 \end{flushright}
66 \@thanks
67 \setcounter{footnote}{0}
68 \let\thanks\relax\let\maketitle\relax
69 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
70}
71
72
Fred Drake2a3ab4f1998-04-28 18:31:50 +000073\let\py@OldTableofcontents=\tableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000074\renewcommand{\tableofcontents}{
75 \begingroup
76 \parskip = 0mm
Fred Drake2a3ab4f1998-04-28 18:31:50 +000077 \py@OldTableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000078 \endgroup
Fred Drake2a3ab4f1998-04-28 18:31:50 +000079 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000080 \vspace{12pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000081 \py@doing@page@targetstrue
Fred Drakedbe132c1998-03-06 21:21:56 +000082}
83
Fred Draked579ed81998-04-17 02:45:41 +000084% Fix the theindex environment to add an entry to the Table of
85% Contents; this is much nicer than just having to jump to the end of
86% the book and flip around, especially with multiple indexes.
87%
Fred Drake2a3ab4f1998-04-28 18:31:50 +000088\let\py@OldTheindex=\theindex
Fred Draked579ed81998-04-17 02:45:41 +000089\renewcommand{\theindex}{
90 \clearpage
Fred Drake2a3ab4f1998-04-28 18:31:50 +000091 \py@OldTheindex
Fred Draked579ed81998-04-17 02:45:41 +000092 \addcontentsline{toc}{section}{\indexname}
93}
94
Fred Drakedbe132c1998-03-06 21:21:56 +000095\@ifundefined{fancyhf}{
96 \pagestyle{plain}}{
97 \pagestyle{normal}} % start this way; change for
98\pagenumbering{arabic} % ToC & chapters
99\setcounter{secnumdepth}{2}
100
101\thispagestyle{empty}