Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1 | % |
| 2 | % manual.cls for the Python documentation |
| 3 | % |
| 4 | |
| 5 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] |
| 6 | \ProvidesClass{manual} |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 7 | [1998/03/03 Document class (Python manual)] |
| 8 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 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,openright]{report} |
| 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 | % |
| 27 | % The "times" package makes the default font the PostScript Times |
| 28 | % font, which makes for smaller PostScript and a font that more people |
| 29 | % like. |
| 30 | % |
| 31 | \RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.} |
| 32 | \RequirePackage{times}\typeout{Using times fonts instead of Computer Modern.} |
| 33 | |
| 34 | |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 35 | % Required packages: |
| 36 | % |
| 37 | % The "fncychap" package is used to get the nice chapter headers. The |
| 38 | % .sty file is distributed with Python, so you should not need to disable |
| 39 | % it. You'd also end up with a mixed page style; uglier than stock LaTeX! |
| 40 | % |
| 41 | \RequirePackage[Bjarne]{fncychap}\typeout{Using fancy chapter headings.} |
| 42 | % Do horizontal rules it this way to match: |
| 43 | \newcommand{\@doHorizontalRule}{\mghrulefill{\RW}} |
| 44 | % |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 45 | % |
| 46 | % This gives us all the Python-specific markup that we really want. |
| 47 | % This should come last. Do not change this. |
| 48 | % |
| 49 | \RequirePackage{python} |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 50 | |
| 51 | |
| 52 | % Change the title page to look a bit better, and fit in with the |
| 53 | % fncychap ``Bjarne'' style a bit better. |
| 54 | % |
| 55 | \renewcommand{\maketitle}{% |
| 56 | \begin{titlepage}% |
| 57 | \let\footnotesize\small |
| 58 | \let\footnoterule\relax |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 59 | \@doHorizontalRule% |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 60 | \@ifundefined{pdfinfo}{}{ |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 61 | \pdfinfo{ |
| 62 | /Author (\@author) |
| 63 | /Title (\@title) |
| 64 | } |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 65 | } |
| 66 | \begin{flushright}% |
| 67 | {\rm\Huge\HeaderFamily \@title \par}% |
| 68 | {\em\LARGE\HeaderFamily \@release \par} |
| 69 | \vfill |
| 70 | {\LARGE\HeaderFamily \@author \par} |
| 71 | \vfill\vfill |
| 72 | {\large |
| 73 | \@date \par |
| 74 | \vfill |
| 75 | \@authoraddress \par |
| 76 | }% |
| 77 | \end{flushright}%\par |
| 78 | \@thanks |
| 79 | \end{titlepage}% |
| 80 | \setcounter{footnote}{0}% |
| 81 | \let\thanks\relax\let\maketitle\relax |
| 82 | \gdef\@thanks{}\gdef\@author{}\gdef\@title{} |
| 83 | } |
| 84 | |
| 85 | |
Fred Drake | aa54e2d | 1998-03-05 16:41:42 +0000 | [diff] [blame] | 86 | % Catch the end of the {abstract} environment, but here make sure the |
| 87 | % abstract is followed by a blank page if the 'openright' option is used. |
| 88 | % |
| 89 | \let\OldEndAbstract=\endabstract |
| 90 | \renewcommand{\endabstract}{ |
| 91 | \if@openright |
| 92 | \ifodd\value{page} |
| 93 | \typeout{Adding blank page after the abstract.} |
| 94 | \vfil\pagebreak |
| 95 | \fi |
| 96 | \fi |
| 97 | \OldEndAbstract |
| 98 | } |
| 99 | |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 100 | % This wraps the \tableofcontents macro with all the magic to get the |
| 101 | % spacing right and have the right number of pages if the 'openright' |
| 102 | % option has been used. This eliminates a fair amount of crud in the |
| 103 | % individual document files. |
| 104 | % |
| 105 | \let\OldTableofcontents=\tableofcontents |
| 106 | \renewcommand{\tableofcontents}{% |
| 107 | \setcounter{page}{1}% |
| 108 | \pagebreak% |
| 109 | \pagestyle{plain}% |
| 110 | {% |
| 111 | \parskip = 0mm% |
| 112 | \OldTableofcontents% |
| 113 | \if@openright% |
| 114 | \ifodd\value{page}% |
| 115 | \typeout{Adding blank page after the table of contents.}% |
| 116 | \pagebreak\hspace{0pt}% |
| 117 | \fi% |
| 118 | \fi% |
| 119 | \cleardoublepage% |
| 120 | }% |
| 121 | \pagenumbering{arabic}% |
| 122 | \@ifundefined{fancyhf}{}{\pagestyle{normal}}% |
Fred Drake | 48a16bf | 1998-03-27 05:24:03 +0000 | [diff] [blame] | 123 | \@doing@page@targetstrue% |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 124 | } |