2 % sphinxhowto.cls for Sphinx (http://sphinx.pocoo.org/)
5 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
6 \ProvidesClass{sphinxhowto}[2009/06/02 Document class (Sphinx HOWTO)]
8 % 'oneside' option overriding the 'twoside' default
10 \DeclareOption{oneside}{\@onesidetrue}
11 % Pass remaining document options to the parent class.
12 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
15 % Default to two-side document
17 % nothing to do (oneside is the default)
19 \PassOptionsToClass{twoside}{\sphinxdocclass}
22 \LoadClass{\sphinxdocclass}
24 % Set some sane defaults for section numbering depth and TOC depth. You can
25 % reset these counters in your preamble.
27 \setcounter{secnumdepth}{2}
29 % Change the title page to look a bit better, and fit in with the fncychap
30 % ``Bjarne'' style a bit better.
32 \renewcommand{\maketitle}{
33 \rule{\textwidth}{1pt}
36 % These \defs are required to deal with multi-line authors; it
37 % changes \\ to ', ' (comma-space), making it pass muster for
38 % generating document info in the PDF file.
49 {\rm\Huge\py@HeaderFamily \@title} \par
50 {\em\large\py@HeaderFamily \py@release\releaseinfo} \par
52 {\Large\py@HeaderFamily
58 \py@authoraddress \par
61 \setcounter{footnote}{0}
62 \let\thanks\relax\let\maketitle\relax
63 %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
66 \let\py@OldTableofcontents=\tableofcontents
67 \renewcommand{\tableofcontents}{
70 \py@OldTableofcontents
72 \rule{\textwidth}{1pt}
76 \@ifundefined{fancyhf}{
78 \pagestyle{normal}} % start this way; change for
79 \pagenumbering{arabic} % ToC & chapters
83 % Fix the bibliography environment to add an entry to the Table of
85 % For an article document class this environment is a section,
86 % so no page break before it.
87 \let\py@OldThebibliography=\thebibliography
88 \renewcommand{\thebibliography}[1]{
90 \py@OldThebibliography{1}
91 \addcontentsline{toc}{section}{\bibname}