blob: 33db125ff206dc1e9944af1dd25ff4eacafef00e [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 Drake8bdf0bf2000-09-05 15:19:56 +000051 \@ifundefined{pdfinfo}{}{{
52 % This \def is required to deal with multi-line authors; it
53 % changes \\ to ', ' (comma-space), making it pass muster for
54 % generating document info in the PDF file.
55 \def\\{, }
Fred Drakec0b2e451998-03-25 14:53:43 +000056 \pdfinfo{
57 /Author (\@author)
58 /Title (\@title)
59 }
Fred Drake8bdf0bf2000-09-05 15:19:56 +000060 }}
Fred Drakedbe132c1998-03-06 21:21:56 +000061 \begin{flushright}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000062 {\rm\Huge\py@HeaderFamily \@title} \par
63 {\em\large\py@HeaderFamily \py@release} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000064 \vspace{25pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000065 {\Large\py@HeaderFamily \@author} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000066 \vspace{25pt}
67 \@date \par
Fred Drake2a3ab4f1998-04-28 18:31:50 +000068 \py@authoraddress \par
Fred Drakedbe132c1998-03-06 21:21:56 +000069 \end{flushright}
70 \@thanks
71 \setcounter{footnote}{0}
72 \let\thanks\relax\let\maketitle\relax
73 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
74}
75
76
Fred Drake2a3ab4f1998-04-28 18:31:50 +000077\let\py@OldTableofcontents=\tableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000078\renewcommand{\tableofcontents}{
79 \begingroup
80 \parskip = 0mm
Fred Drake2a3ab4f1998-04-28 18:31:50 +000081 \py@OldTableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000082 \endgroup
Fred Drake2a3ab4f1998-04-28 18:31:50 +000083 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000084 \vspace{12pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000085 \py@doing@page@targetstrue
Fred Drakedbe132c1998-03-06 21:21:56 +000086}
87
Fred Draked579ed81998-04-17 02:45:41 +000088% Fix the theindex environment to add an entry to the Table of
89% Contents; this is much nicer than just having to jump to the end of
90% the book and flip around, especially with multiple indexes.
91%
Fred Drake2a3ab4f1998-04-28 18:31:50 +000092\let\py@OldTheindex=\theindex
Fred Draked579ed81998-04-17 02:45:41 +000093\renewcommand{\theindex}{
94 \clearpage
Fred Drake2a3ab4f1998-04-28 18:31:50 +000095 \py@OldTheindex
Fred Draked579ed81998-04-17 02:45:41 +000096 \addcontentsline{toc}{section}{\indexname}
97}
98
Fred Drakedbe132c1998-03-06 21:21:56 +000099\@ifundefined{fancyhf}{
100 \pagestyle{plain}}{
101 \pagestyle{normal}} % start this way; change for
102\pagenumbering{arabic} % ToC & chapters
103\setcounter{secnumdepth}{2}
104
105\thispagestyle{empty}