2 % manual.cls for Sphinx
5 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
6 \ProvidesClass{manual}[2008/10/18 Document class (Sphinx manual)]
8 % Pass all given class options to the parent class.
9 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
11 \LoadClass[twoside,openright]{report}
13 % Set some sane defaults for section numbering depth and TOC depth. You can
14 % reset these counters in your preamble.
16 \setcounter{secnumdepth}{2}
17 \setcounter{tocdepth}{1}
19 % Change the title page to look a bit better, and fit in with the fncychap
20 % ``Bjarne'' style a bit better.
22 \renewcommand{\maketitle}{%
24 \let\footnotesize\small
25 \let\footnoterule\relax
26 \rule{\textwidth}{1pt}%
29 % This \def is required to deal with multi-line authors; it
30 % changes \\ to ', ' (comma-space), making it pass muster for
31 % generating document info in the PDF file.
41 {\rm\Huge\py@HeaderFamily \@title \par}%
42 {\em\LARGE\py@HeaderFamily \py@release\releaseinfo \par}
44 {\LARGE\py@HeaderFamily \@author \par}
49 \py@authoraddress \par
55 \setcounter{footnote}{0}%
56 \let\thanks\relax\let\maketitle\relax
57 %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
61 % Catch the end of the {abstract} environment, but here make sure the abstract
62 % is followed by a blank page if the 'openright' option is used.
64 \let\py@OldEndAbstract=\endabstract
65 \renewcommand{\endabstract}{
68 \typeout{Adding blank page after the abstract.}
75 % This wraps the \tableofcontents macro with all the magic to get the spacing
76 % right and have the right number of pages if the 'openright' option has been
77 % used. This eliminates a fair amount of crud in the individual document files.
79 \let\py@OldTableofcontents=\tableofcontents
80 \renewcommand{\tableofcontents}{%
86 \py@OldTableofcontents%
89 \typeout{Adding blank page after the table of contents.}%
90 \pagebreak\hspace{0pt}%
95 \pagenumbering{arabic}%
96 \@ifundefined{fancyhf}{}{\pagestyle{normal}}%
99 % This is needed to get the width of the section # area wide enough in the
100 % library reference. Doing it here keeps it the same for all the manuals.
102 \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}
103 \renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}