
ulalume3@11: %
ulalume3@11: % sphinxmanual.cls for Sphinx (http://sphinx.pocoo.org/)
ulalume3@11: %
ulalume3@11: 
ulalume3@11: \NeedsTeXFormat{LaTeX2e}[1995/12/01]
ulalume3@11: \ProvidesClass{sphinxmanual}[2009/06/02 Document class (Sphinx manual)]
ulalume3@11: 
ulalume3@11: % chapters starting at odd pages (overridden by 'openany' document option)
ulalume3@11: \PassOptionsToClass{openright}{\sphinxdocclass}
ulalume3@11: 
ulalume3@11: % 'oneside' option overriding the 'twoside' default
ulalume3@11: \newif\if@oneside
ulalume3@11: \DeclareOption{oneside}{\@onesidetrue}
ulalume3@11: % Pass remaining document options to the parent class.
ulalume3@11: \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
ulalume3@11: \ProcessOptions\relax
ulalume3@11: 
ulalume3@11: % Defaults two-side document
ulalume3@11: \if@oneside
ulalume3@11: % nothing to do (oneside is the default)
ulalume3@11: \else
ulalume3@11: \PassOptionsToClass{twoside}{\sphinxdocclass}
ulalume3@11: \fi
ulalume3@11: 
ulalume3@11: \LoadClass{\sphinxdocclass}
ulalume3@11: 
ulalume3@11: % Set some sane defaults for section numbering depth and TOC depth.  You can
ulalume3@11: % reset these counters in your preamble.
ulalume3@11: %
ulalume3@11: \setcounter{secnumdepth}{2}
ulalume3@11: \setcounter{tocdepth}{1}
ulalume3@11: 
ulalume3@11: % Change the title page to look a bit better, and fit in with the fncychap
ulalume3@11: % ``Bjarne'' style a bit better.
ulalume3@11: %
ulalume3@11: \renewcommand{\maketitle}{%
ulalume3@11:   \begin{titlepage}%
ulalume3@11:     \let\footnotesize\small
ulalume3@11:     \let\footnoterule\relax
ulalume3@11:     \rule{\textwidth}{1pt}%
ulalume3@11:     \ifsphinxpdfoutput
ulalume3@11:       \begingroup
ulalume3@11:       % These \defs are required to deal with multi-line authors; it
ulalume3@11:       % changes \\ to ', ' (comma-space), making it pass muster for
ulalume3@11:       % generating document info in the PDF file.
ulalume3@11:       \def\\{, }
ulalume3@11:       \def\and{and }
ulalume3@11:       \pdfinfo{
ulalume3@11:         /Author (\@author)
ulalume3@11:         /Title (\@title)
ulalume3@11:       }
ulalume3@11:       \endgroup
ulalume3@11:     \fi
ulalume3@11:     \begin{flushright}%
ulalume3@11:       \sphinxlogo%
ulalume3@11:       {\rm\Huge\py@HeaderFamily \@title \par}%
ulalume3@11:       {\em\LARGE\py@HeaderFamily \py@release\releaseinfo \par}
ulalume3@11:       \vfill
ulalume3@11:       {\LARGE\py@HeaderFamily
ulalume3@11:         \begin{tabular}[t]{c}
ulalume3@11:           \@author
ulalume3@11:         \end{tabular}
ulalume3@11:         \par}
ulalume3@11:       \vfill\vfill
ulalume3@11:       {\large
ulalume3@11:        \@date \par
ulalume3@11:        \vfill
ulalume3@11:        \py@authoraddress \par
ulalume3@11:       }%
ulalume3@11:     \end{flushright}%\par
ulalume3@11:     \@thanks
ulalume3@11:   \end{titlepage}%
ulalume3@11:   \cleardoublepage%
ulalume3@11:   \setcounter{footnote}{0}%
ulalume3@11:   \let\thanks\relax\let\maketitle\relax
ulalume3@11:   %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
ulalume3@11: }
ulalume3@11: 
ulalume3@11: 
ulalume3@11: % Catch the end of the {abstract} environment, but here make sure the abstract
ulalume3@11: % is followed by a blank page if the 'openright' option is used.
ulalume3@11: %
ulalume3@11: \let\py@OldEndAbstract=\endabstract
ulalume3@11: \renewcommand{\endabstract}{
ulalume3@11:   \if@openright
ulalume3@11:     \ifodd\value{page}
ulalume3@11:       \typeout{Adding blank page after the abstract.}
ulalume3@11:       \vfil\pagebreak
ulalume3@11:     \fi
ulalume3@11:   \fi
ulalume3@11:   \py@OldEndAbstract
ulalume3@11: }
ulalume3@11: 
ulalume3@11: % This wraps the \tableofcontents macro with all the magic to get the spacing
ulalume3@11: % right and have the right number of pages if the 'openright' option has been
ulalume3@11: % used.  This eliminates a fair amount of crud in the individual document files.
ulalume3@11: %
ulalume3@11: \let\py@OldTableofcontents=\tableofcontents
ulalume3@11: \renewcommand{\tableofcontents}{%
ulalume3@11:   \setcounter{page}{1}%
ulalume3@11:   \pagebreak%
ulalume3@11:   \pagestyle{plain}%
ulalume3@11:   {%
ulalume3@11:     \parskip = 0mm%
ulalume3@11:     \py@OldTableofcontents%
ulalume3@11:     \if@openright%
ulalume3@11:       \ifodd\value{page}%
ulalume3@11:         \typeout{Adding blank page after the table of contents.}%
ulalume3@11:         \pagebreak\hspace{0pt}%
ulalume3@11:       \fi%
ulalume3@11:     \fi%
ulalume3@11:     \cleardoublepage%
ulalume3@11:   }%
ulalume3@11:   \pagenumbering{arabic}%
ulalume3@11:   \@ifundefined{fancyhf}{}{\pagestyle{normal}}%
ulalume3@11: }
ulalume3@11: 
ulalume3@11: % This is needed to get the width of the section # area wide enough in the
ulalume3@11: % library reference.  Doing it here keeps it the same for all the manuals.
ulalume3@11: %
ulalume3@11: \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}
ulalume3@11: \renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}




