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