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 | 724473f | 1998-04-25 04:12:17 +0000 | [diff] [blame] | 9 | \RequirePackage{pypaper} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 10 | |
Fred Drake | 724473f | 1998-04-25 04:12:17 +0000 | [diff] [blame] | 11 | % Change the options here to get a different set of basic options, but only |
| 12 | % if you have to. Paper and font size should be adjusted in pypaper.sty. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 13 | % |
Fred Drake | 724473f | 1998-04-25 04:12:17 +0000 | [diff] [blame] | 14 | \LoadClass[\py@paper,\py@ptsize,twoside,openright]{report} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 15 | |
| 16 | |
| 17 | % Optional packages: |
| 18 | % |
| 19 | % If processing of these documents fails at your TeX installation, |
| 20 | % these may be commented out (independently) to make things work. |
| 21 | % These are both supplied with the current version of the teTeX |
| 22 | % distribution. |
| 23 | % |
| 24 | % The "fancyhdr" package makes nicer page footers reasonable to |
| 25 | % implement, and is used to put the chapter and section information in |
| 26 | % the footers. |
| 27 | % |
| 28 | % The "times" package makes the default font the PostScript Times |
| 29 | % font, which makes for smaller PostScript and a font that more people |
| 30 | % like. |
| 31 | % |
| 32 | \RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.} |
| 33 | \RequirePackage{times}\typeout{Using times fonts instead of Computer Modern.} |
| 34 | |
| 35 | |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 36 | % Required packages: |
| 37 | % |
| 38 | % The "fncychap" package is used to get the nice chapter headers. The |
| 39 | % .sty file is distributed with Python, so you should not need to disable |
| 40 | % it. You'd also end up with a mixed page style; uglier than stock LaTeX! |
| 41 | % |
| 42 | \RequirePackage[Bjarne]{fncychap}\typeout{Using fancy chapter headings.} |
| 43 | % Do horizontal rules it this way to match: |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 44 | \newcommand{\py@doHorizontalRule}{\mghrulefill{\RW}} |
Fred Drake | 5573031 | 1998-03-25 15:41:23 +0000 | [diff] [blame] | 45 | % |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 46 | % |
| 47 | % This gives us all the Python-specific markup that we really want. |
| 48 | % This should come last. Do not change this. |
| 49 | % |
| 50 | \RequirePackage{python} |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 51 | |
| 52 | |
| 53 | % Change the title page to look a bit better, and fit in with the |
| 54 | % fncychap ``Bjarne'' style a bit better. |
| 55 | % |
| 56 | \renewcommand{\maketitle}{% |
| 57 | \begin{titlepage}% |
| 58 | \let\footnotesize\small |
| 59 | \let\footnoterule\relax |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 60 | \py@doHorizontalRule% |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 61 | \@ifundefined{pdfinfo}{}{ |
Fred Drake | c0b2e45 | 1998-03-25 14:53:43 +0000 | [diff] [blame] | 62 | \pdfinfo{ |
| 63 | /Author (\@author) |
| 64 | /Title (\@title) |
| 65 | } |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 66 | } |
| 67 | \begin{flushright}% |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 68 | {\rm\Huge\py@HeaderFamily \@title \par}% |
| 69 | {\em\LARGE\py@HeaderFamily \py@release \par} |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 70 | \vfill |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 71 | {\LARGE\py@HeaderFamily \@author \par} |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 72 | \vfill\vfill |
| 73 | {\large |
| 74 | \@date \par |
| 75 | \vfill |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 76 | \py@authoraddress \par |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 77 | }% |
| 78 | \end{flushright}%\par |
| 79 | \@thanks |
| 80 | \end{titlepage}% |
| 81 | \setcounter{footnote}{0}% |
| 82 | \let\thanks\relax\let\maketitle\relax |
| 83 | \gdef\@thanks{}\gdef\@author{}\gdef\@title{} |
| 84 | } |
| 85 | |
| 86 | |
Fred Drake | aa54e2d | 1998-03-05 16:41:42 +0000 | [diff] [blame] | 87 | % Catch the end of the {abstract} environment, but here make sure the |
| 88 | % abstract is followed by a blank page if the 'openright' option is used. |
| 89 | % |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 90 | \let\py@OldEndAbstract=\endabstract |
Fred Drake | aa54e2d | 1998-03-05 16:41:42 +0000 | [diff] [blame] | 91 | \renewcommand{\endabstract}{ |
| 92 | \if@openright |
| 93 | \ifodd\value{page} |
| 94 | \typeout{Adding blank page after the abstract.} |
| 95 | \vfil\pagebreak |
| 96 | \fi |
| 97 | \fi |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 98 | \py@OldEndAbstract |
Fred Drake | aa54e2d | 1998-03-05 16:41:42 +0000 | [diff] [blame] | 99 | } |
| 100 | |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 101 | % This wraps the \tableofcontents macro with all the magic to get the |
| 102 | % spacing right and have the right number of pages if the 'openright' |
| 103 | % option has been used. This eliminates a fair amount of crud in the |
| 104 | % individual document files. |
| 105 | % |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 106 | \let\py@OldTableofcontents=\tableofcontents |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 107 | \renewcommand{\tableofcontents}{% |
| 108 | \setcounter{page}{1}% |
| 109 | \pagebreak% |
| 110 | \pagestyle{plain}% |
| 111 | {% |
| 112 | \parskip = 0mm% |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 113 | \py@OldTableofcontents% |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 114 | \if@openright% |
| 115 | \ifodd\value{page}% |
| 116 | \typeout{Adding blank page after the table of contents.}% |
| 117 | \pagebreak\hspace{0pt}% |
| 118 | \fi% |
| 119 | \fi% |
| 120 | \cleardoublepage% |
| 121 | }% |
| 122 | \pagenumbering{arabic}% |
| 123 | \@ifundefined{fancyhf}{}{\pagestyle{normal}}% |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 124 | \py@doing@page@targetstrue% |
Fred Drake | 28f1391 | 1998-03-04 21:47:59 +0000 | [diff] [blame] | 125 | } |
Fred Drake | 255284b | 1998-04-20 16:55:14 +0000 | [diff] [blame] | 126 | % This is needed to get the width of the section # area wide enough in the |
| 127 | % library reference. Doing it here keeps it the same for all the manuals. |
| 128 | % |
| 129 | \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}} |
| 130 | \renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}} |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 131 | |
| 132 | |
| 133 | % Fix the theindex environment to add an entry to the Table of |
| 134 | % Contents; this is much nicer than just having to jump to the end of |
| 135 | % the book and flip around, especially with multiple indexes. |
| 136 | % |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 137 | \let\py@OldTheindex=\theindex |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 138 | \renewcommand{\theindex}{ |
| 139 | \cleardoublepage |
Fred Drake | 2a3ab4f | 1998-04-28 18:31:50 +0000 | [diff] [blame] | 140 | \py@OldTheindex |
Fred Drake | d579ed8 | 1998-04-17 02:45:41 +0000 | [diff] [blame] | 141 | \addcontentsline{toc}{chapter}{\indexname} |
| 142 | } |