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 | |
Fred Drake | 2ed27d3 | 2000-11-17 19:05:12 +0000 | [diff] [blame] | 9 | \RequirePackage{pypaper} |
Fred Drake | 862b46b | 2004-03-31 08:08:34 +0000 | [diff] [blame] | 10 | \RequirePackage{fancybox} |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 11 | |
| 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 Drake | e8e241b | 2003-07-17 04:15:35 +0000 | [diff] [blame] | 15 | \LoadClass[\py@paper,\py@ptsize,twoside]{article} |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 16 | |
Fred Drake | d85b5a4 | 1999-06-29 18:15:59 +0000 | [diff] [blame] | 17 | \setcounter{secnumdepth}{1} |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 18 | |
| 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 Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 30 | \RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.} |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 31 | |
| 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 Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 38 | \RequirePackage{python} |
| 39 | |
Fred Drake | 2fcadb2 | 1998-07-23 17:36:46 +0000 | [diff] [blame] | 40 | % support for module synopsis sections: |
| 41 | \newcommand{\py@ModSynopsisFilename}{\jobname.syn} |
| 42 | |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 43 | |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 44 | % need to do one of these.... |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 45 | \newcommand{\py@doHorizontalRule}{\rule{\textwidth}{1pt}} |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 46 | |
| 47 | |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 48 | % 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 Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 52 | \py@doHorizontalRule |
Fred Drake | 8bdf0bf | 2000-09-05 15:19:56 +0000 | [diff] [blame] | 53 | \@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 Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 58 | \pdfinfo{ |
| 59 | /Author (\@author) |
| 60 | /Title (\@title) |
| 61 | } |
Fred Drake | 8bdf0bf | 2000-09-05 15:19:56 +0000 | [diff] [blame] | 62 | }} |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 63 | \begin{flushright} |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 64 | {\rm\Huge\py@HeaderFamily \@title} \par |
Fred Drake | 7fe80a1 | 2002-03-15 22:38:16 +0000 | [diff] [blame] | 65 | {\em\large\py@HeaderFamily \py@release\releaseinfo} \par |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 66 | \vspace{25pt} |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 67 | {\Large\py@HeaderFamily \@author} \par |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 68 | \vspace{25pt} |
| 69 | \@date \par |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 70 | \py@authoraddress \par |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 71 | \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 Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 79 | \let\py@OldTableofcontents=\tableofcontents |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 80 | \renewcommand{\tableofcontents}{ |
| 81 | \begingroup |
| 82 | \parskip = 0mm |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 83 | \py@OldTableofcontents |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 84 | \endgroup |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 85 | \py@doHorizontalRule |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 86 | \vspace{12pt} |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 87 | \py@doing@page@targetstrue |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 88 | } |
| 89 | |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 90 | % 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 Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 94 | \let\py@OldTheindex=\theindex |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 95 | \renewcommand{\theindex}{ |
| 96 | \clearpage |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 97 | \py@OldTheindex |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 98 | \addcontentsline{toc}{section}{\indexname} |
| 99 | } |
| 100 | |
Fred Drake | dbe132c | 1998-03-06 21:21:56 +0000 | [diff] [blame] | 101 | \@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} |