blob: 5fc7a704691dd3c37bc6d0cc8e8eee59ae160792 [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
Fred Drake2ed27d32000-11-17 19:05:12 +00009\RequirePackage{pypaper}
Fred Drakedbe132c1998-03-06 21:21:56 +000010
11% Change the options here to get a different set of basic options, This
12% is where to add things like "a4paper" or "10pt".
13%
14\LoadClass[twoside]{article}
15
Fred Draked85b5a41999-06-29 18:15:59 +000016\setcounter{secnumdepth}{1}
Fred Drakedbe132c1998-03-06 21:21:56 +000017
18% Optional packages:
19%
20% If processing of these documents fails at your TeX installation,
21% these may be commented out (independently) to make things work.
22% These are both supplied with the current version of the teTeX
23% distribution.
24%
25% The "fancyhdr" package makes nicer page footers reasonable to
26% implement, and is used to put the chapter and section information in
27% the footers.
28%
Fred Drakedbe132c1998-03-06 21:21:56 +000029\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.}
Fred Drakedbe132c1998-03-06 21:21:56 +000030
31
32% Required package:
33%
34% This gives us all the Python-specific markup that we really want.
35% This should come last. Do not change this.
36%
Fred Drakedbe132c1998-03-06 21:21:56 +000037\RequirePackage{python}
38
Fred Drake2fcadb21998-07-23 17:36:46 +000039% support for module synopsis sections:
40\newcommand{\py@ModSynopsisFilename}{\jobname.syn}
41
Fred Drakedbe132c1998-03-06 21:21:56 +000042
Fred Drake55730311998-03-25 15:41:23 +000043% need to do one of these....
Fred Drake2a3ab4f1998-04-28 18:31:50 +000044\newcommand{\py@doHorizontalRule}{\rule{\textwidth}{1pt}}
Fred Drake55730311998-03-25 15:41:23 +000045
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 Drake2a3ab4f1998-04-28 18:31:50 +000051 \py@doHorizontalRule
Fred Drake8bdf0bf2000-09-05 15:19:56 +000052 \@ifundefined{pdfinfo}{}{{
53 % This \def is required to deal with multi-line authors; it
54 % changes \\ to ', ' (comma-space), making it pass muster for
55 % generating document info in the PDF file.
56 \def\\{, }
Fred Drakec0b2e451998-03-25 14:53:43 +000057 \pdfinfo{
58 /Author (\@author)
59 /Title (\@title)
60 }
Fred Drake8bdf0bf2000-09-05 15:19:56 +000061 }}
Fred Drakedbe132c1998-03-06 21:21:56 +000062 \begin{flushright}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000063 {\rm\Huge\py@HeaderFamily \@title} \par
Fred Drake7fe80a12002-03-15 22:38:16 +000064 {\em\large\py@HeaderFamily \py@release\releaseinfo} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000065 \vspace{25pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000066 {\Large\py@HeaderFamily \@author} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000067 \vspace{25pt}
68 \@date \par
Fred Drake2a3ab4f1998-04-28 18:31:50 +000069 \py@authoraddress \par
Fred Drakedbe132c1998-03-06 21:21:56 +000070 \end{flushright}
71 \@thanks
72 \setcounter{footnote}{0}
73 \let\thanks\relax\let\maketitle\relax
74 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
75}
76
77
Fred Drake2a3ab4f1998-04-28 18:31:50 +000078\let\py@OldTableofcontents=\tableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000079\renewcommand{\tableofcontents}{
80 \begingroup
81 \parskip = 0mm
Fred Drake2a3ab4f1998-04-28 18:31:50 +000082 \py@OldTableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000083 \endgroup
Fred Drake2a3ab4f1998-04-28 18:31:50 +000084 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000085 \vspace{12pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000086 \py@doing@page@targetstrue
Fred Drakedbe132c1998-03-06 21:21:56 +000087}
88
Fred Draked579ed81998-04-17 02:45:41 +000089% Fix the theindex environment to add an entry to the Table of
90% Contents; this is much nicer than just having to jump to the end of
91% the book and flip around, especially with multiple indexes.
92%
Fred Drake2a3ab4f1998-04-28 18:31:50 +000093\let\py@OldTheindex=\theindex
Fred Draked579ed81998-04-17 02:45:41 +000094\renewcommand{\theindex}{
95 \clearpage
Fred Drake2a3ab4f1998-04-28 18:31:50 +000096 \py@OldTheindex
Fred Draked579ed81998-04-17 02:45:41 +000097 \addcontentsline{toc}{section}{\indexname}
98}
99
Fred Drakedbe132c1998-03-06 21:21:56 +0000100\@ifundefined{fancyhf}{
101 \pagestyle{plain}}{
102 \pagestyle{normal}} % start this way; change for
103\pagenumbering{arabic} % ToC & chapters
104\setcounter{secnumdepth}{2}
105
106\thispagestyle{empty}