Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 1 | % |
| 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 | |
| 15 | |
| 16 | % Optional packages: |
| 17 | % |
| 18 | % If processing of these documents fails at your TeX installation, |
| 19 | % these may be commented out (independently) to make things work. |
| 20 | % These are both supplied with the current version of the teTeX |
| 21 | % distribution. |
| 22 | % |
| 23 | % The "fancyhdr" package makes nicer page footers reasonable to |
| 24 | % implement, and is used to put the chapter and section information in |
| 25 | % the footers. |
| 26 | % |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 27 | \RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.} |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 28 | |
| 29 | |
| 30 | % Required package: |
| 31 | % |
| 32 | % This gives us all the Python-specific markup that we really want. |
| 33 | % This should come last. Do not change this. |
| 34 | % |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 35 | \RequirePackage{python} |
| 36 | |
Fred Drake | 2fcadb2 | 1998-07-23 17:36:46 +0000 | [diff] [blame] | 37 | % support for module synopsis sections: |
| 38 | \newcommand{\py@ModSynopsisFilename}{\jobname.syn} |
| 39 | |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 40 | |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 41 | % need to do one of these.... |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 42 | \newcommand{\py@doHorizontalRule}{\rule{\textwidth}{1pt}} |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 43 | |
| 44 | |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 45 | % Change the title page to look a bit better, and fit in with the |
| 46 | % fncychap ``Bjarne'' style a bit better. |
| 47 | % |
| 48 | \renewcommand{\maketitle}{ |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 49 | \py@doHorizontalRule |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 50 | \@ifundefined{pdfinfo}{}{ |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 51 | \pdfinfo{ |
| 52 | /Author (\@author) |
| 53 | /Title (\@title) |
| 54 | } |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 55 | } |
| 56 | \begin{flushright} |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 57 | {\rm\Huge\py@HeaderFamily \@title} \par |
| 58 | {\em\large\py@HeaderFamily \py@release} \par |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 59 | \vspace{25pt} |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 60 | {\Large\py@HeaderFamily \@author} \par |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 61 | \vspace{25pt} |
| 62 | \@date \par |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 63 | \py@authoraddress \par |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 64 | \end{flushright} |
| 65 | \@thanks |
| 66 | \setcounter{footnote}{0} |
| 67 | \let\thanks\relax\let\maketitle\relax |
| 68 | \gdef\@thanks{}\gdef\@author{}\gdef\@title{} |
| 69 | } |
| 70 | |
| 71 | |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 72 | \let\py@OldTableofcontents=\tableofcontents |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 73 | \renewcommand{\tableofcontents}{ |
| 74 | \begingroup |
| 75 | \parskip = 0mm |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 76 | \py@OldTableofcontents |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 77 | \endgroup |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 78 | \py@doHorizontalRule |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 79 | \vspace{12pt} |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 80 | \py@doing@page@targetstrue |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 81 | } |
| 82 | |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 83 | % Fix the theindex environment to add an entry to the Table of |
| 84 | % Contents; this is much nicer than just having to jump to the end of |
| 85 | % the book and flip around, especially with multiple indexes. |
| 86 | % |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 87 | \let\py@OldTheindex=\theindex |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 88 | \renewcommand{\theindex}{ |
| 89 | \clearpage |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 90 | \py@OldTheindex |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 91 | \addcontentsline{toc}{section}{\indexname} |
| 92 | } |
| 93 | |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 94 | \@ifundefined{fancyhf}{ |
| 95 | \pagestyle{plain}}{ |
| 96 | \pagestyle{normal}} % start this way; change for |
| 97 | \pagenumbering{arabic} % ToC & chapters |
| 98 | \setcounter{secnumdepth}{2} |
| 99 | |
| 100 | \thispagestyle{empty} |