blob: c9beb4a5ca419db71f1e97f74848c870233f47ae [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 Drake862b46b2004-03-31 08:08:34 +000010\RequirePackage{fancybox}
Fred Drakedbe132c1998-03-06 21:21:56 +000011
12% Change the options here to get a different set of basic options, This
13% is where to add things like "a4paper" or "10pt".
14%
Fred Drakee8e241b2003-07-17 04:15:35 +000015\LoadClass[\py@paper,\py@ptsize,twoside]{article}
Fred Drakedbe132c1998-03-06 21:21:56 +000016
Fred Draked85b5a41999-06-29 18:15:59 +000017\setcounter{secnumdepth}{1}
Fred Drakedbe132c1998-03-06 21:21:56 +000018
19% Optional packages:
20%
21% If processing of these documents fails at your TeX installation,
22% these may be commented out (independently) to make things work.
23% These are both supplied with the current version of the teTeX
24% distribution.
25%
26% The "fancyhdr" package makes nicer page footers reasonable to
27% implement, and is used to put the chapter and section information in
28% the footers.
29%
Fred Drakedbe132c1998-03-06 21:21:56 +000030\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.}
Fred Drakedbe132c1998-03-06 21:21:56 +000031
32
33% Required package:
34%
35% This gives us all the Python-specific markup that we really want.
36% This should come last. Do not change this.
37%
Fred Drakedbe132c1998-03-06 21:21:56 +000038\RequirePackage{python}
39
Fred Drake2fcadb21998-07-23 17:36:46 +000040% support for module synopsis sections:
41\newcommand{\py@ModSynopsisFilename}{\jobname.syn}
42
Fred Drakedbe132c1998-03-06 21:21:56 +000043
Fred Drake55730311998-03-25 15:41:23 +000044% need to do one of these....
Fred Drake2a3ab4f1998-04-28 18:31:50 +000045\newcommand{\py@doHorizontalRule}{\rule{\textwidth}{1pt}}
Fred Drake55730311998-03-25 15:41:23 +000046
47
Fred Drakedbe132c1998-03-06 21:21:56 +000048% Change the title page to look a bit better, and fit in with the
49% fncychap ``Bjarne'' style a bit better.
50%
51\renewcommand{\maketitle}{
Fred Drake2a3ab4f1998-04-28 18:31:50 +000052 \py@doHorizontalRule
Fred Drakefe256432005-07-29 17:17:19 +000053 \ifpdf
54 \begingroup
Fred Drake8bdf0bf2000-09-05 15:19:56 +000055 % This \def is required to deal with multi-line authors; it
56 % changes \\ to ', ' (comma-space), making it pass muster for
57 % generating document info in the PDF file.
58 \def\\{, }
Fred Drakec0b2e451998-03-25 14:53:43 +000059 \pdfinfo{
60 /Author (\@author)
61 /Title (\@title)
62 }
Fred Drakefe256432005-07-29 17:17:19 +000063 \endgroup
64 \fi
Fred Drakedbe132c1998-03-06 21:21:56 +000065 \begin{flushright}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000066 {\rm\Huge\py@HeaderFamily \@title} \par
Fred Drake7fe80a12002-03-15 22:38:16 +000067 {\em\large\py@HeaderFamily \py@release\releaseinfo} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000068 \vspace{25pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000069 {\Large\py@HeaderFamily \@author} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000070 \vspace{25pt}
71 \@date \par
Fred Drake2a3ab4f1998-04-28 18:31:50 +000072 \py@authoraddress \par
Fred Drakedbe132c1998-03-06 21:21:56 +000073 \end{flushright}
74 \@thanks
75 \setcounter{footnote}{0}
76 \let\thanks\relax\let\maketitle\relax
77 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
78}
79
80
Fred Drake2a3ab4f1998-04-28 18:31:50 +000081\let\py@OldTableofcontents=\tableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000082\renewcommand{\tableofcontents}{
83 \begingroup
84 \parskip = 0mm
Fred Drake2a3ab4f1998-04-28 18:31:50 +000085 \py@OldTableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000086 \endgroup
Fred Drake2a3ab4f1998-04-28 18:31:50 +000087 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000088 \vspace{12pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000089 \py@doing@page@targetstrue
Fred Drakedbe132c1998-03-06 21:21:56 +000090}
91
Fred Draked579ed81998-04-17 02:45:41 +000092% Fix the theindex environment to add an entry to the Table of
93% Contents; this is much nicer than just having to jump to the end of
94% the book and flip around, especially with multiple indexes.
95%
Fred Drake2a3ab4f1998-04-28 18:31:50 +000096\let\py@OldTheindex=\theindex
Fred Draked579ed81998-04-17 02:45:41 +000097\renewcommand{\theindex}{
98 \clearpage
Fred Drake2a3ab4f1998-04-28 18:31:50 +000099 \py@OldTheindex
Fred Draked579ed81998-04-17 02:45:41 +0000100 \addcontentsline{toc}{section}{\indexname}
101}
102
Fred Drakedbe132c1998-03-06 21:21:56 +0000103\@ifundefined{fancyhf}{
104 \pagestyle{plain}}{
105 \pagestyle{normal}} % start this way; change for
106\pagenumbering{arabic} % ToC & chapters
107\setcounter{secnumdepth}{2}
108
109\thispagestyle{empty}