blob: 936e1faf3aa7dcd76f8e2e3a1197a409b812c84f [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 Drake8bdf0bf2000-09-05 15:19:56 +000053 \@ifundefined{pdfinfo}{}{{
54 % This \def is required to deal with multi-line authors; it
55 % changes \\ to ', ' (comma-space), making it pass muster for
56 % generating document info in the PDF file.
57 \def\\{, }
Fred Drakec0b2e451998-03-25 14:53:43 +000058 \pdfinfo{
59 /Author (\@author)
60 /Title (\@title)
61 }
Fred Drake8bdf0bf2000-09-05 15:19:56 +000062 }}
Fred Drakedbe132c1998-03-06 21:21:56 +000063 \begin{flushright}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000064 {\rm\Huge\py@HeaderFamily \@title} \par
Fred Drake7fe80a12002-03-15 22:38:16 +000065 {\em\large\py@HeaderFamily \py@release\releaseinfo} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000066 \vspace{25pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000067 {\Large\py@HeaderFamily \@author} \par
Fred Drakedbe132c1998-03-06 21:21:56 +000068 \vspace{25pt}
69 \@date \par
Fred Drake2a3ab4f1998-04-28 18:31:50 +000070 \py@authoraddress \par
Fred Drakedbe132c1998-03-06 21:21:56 +000071 \end{flushright}
72 \@thanks
73 \setcounter{footnote}{0}
74 \let\thanks\relax\let\maketitle\relax
75 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
76}
77
78
Fred Drake2a3ab4f1998-04-28 18:31:50 +000079\let\py@OldTableofcontents=\tableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000080\renewcommand{\tableofcontents}{
81 \begingroup
82 \parskip = 0mm
Fred Drake2a3ab4f1998-04-28 18:31:50 +000083 \py@OldTableofcontents
Fred Drakedbe132c1998-03-06 21:21:56 +000084 \endgroup
Fred Drake2a3ab4f1998-04-28 18:31:50 +000085 \py@doHorizontalRule
Fred Drakedbe132c1998-03-06 21:21:56 +000086 \vspace{12pt}
Fred Drake2a3ab4f1998-04-28 18:31:50 +000087 \py@doing@page@targetstrue
Fred Drakedbe132c1998-03-06 21:21:56 +000088}
89
Fred Draked579ed81998-04-17 02:45:41 +000090% Fix the theindex environment to add an entry to the Table of
91% Contents; this is much nicer than just having to jump to the end of
92% the book and flip around, especially with multiple indexes.
93%
Fred Drake2a3ab4f1998-04-28 18:31:50 +000094\let\py@OldTheindex=\theindex
Fred Draked579ed81998-04-17 02:45:41 +000095\renewcommand{\theindex}{
96 \clearpage
Fred Drake2a3ab4f1998-04-28 18:31:50 +000097 \py@OldTheindex
Fred Draked579ed81998-04-17 02:45:41 +000098 \addcontentsline{toc}{section}{\indexname}
99}
100
Fred Drakedbe132c1998-03-06 21:21:56 +0000101\@ifundefined{fancyhf}{
102 \pagestyle{plain}}{
103 \pagestyle{normal}} % start this way; change for
104\pagenumbering{arabic} % ToC & chapters
105\setcounter{secnumdepth}{2}
106
107\thispagestyle{empty}