elog2labfolder/_build/latex/sphinxmanual.cls
author weiher
Thu, 11 Jan 2018 12:10:42 +0100
changeset 3 b71be85a294c
permissions -rw-r--r--
Initial commit of labfolder at FHI documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     1
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     2
% sphinxmanual.cls for Sphinx (http://sphinx-doc.org/)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     3
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     4
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     5
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     6
\ProvidesClass{sphinxmanual}[2017/03/26 v1.6 Document class (Sphinx manual)]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     7
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     8
% chapters starting at odd pages (overridden by 'openany' document option)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     9
\PassOptionsToClass{openright}{\sphinxdocclass}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    10
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    11
% 'oneside' option overriding the 'twoside' default
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    12
\newif\if@oneside
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    13
\DeclareOption{oneside}{\@onesidetrue}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    14
% Pass remaining document options to the parent class.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    15
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    16
\ProcessOptions\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    17
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    18
% Defaults two-side document
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    19
\if@oneside
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    20
% nothing to do (oneside is the default)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    21
\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    22
\PassOptionsToClass{twoside}{\sphinxdocclass}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    23
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    24
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    25
\LoadClass{\sphinxdocclass}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    26
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    27
% Set some sane defaults for section numbering depth and TOC depth.  You can
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    28
% reset these counters in your preamble.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    29
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    30
\setcounter{secnumdepth}{2}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    31
\setcounter{tocdepth}{1}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    32
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    33
% Change the title page to look a bit better, and fit in with the fncychap
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    34
% ``Bjarne'' style a bit better.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    35
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    36
\renewcommand{\maketitle}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    37
  \let\spx@tempa\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    38
  \ifHy@pageanchor\def\spx@tempa{\Hy@pageanchortrue}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    39
  \hypersetup{pageanchor=false}% avoid duplicate destination warnings
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    40
  \begin{titlepage}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    41
    \let\footnotesize\small
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    42
    \let\footnoterule\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    43
    \noindent\rule{\textwidth}{1pt}\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    44
      \begingroup % for PDF information dictionary
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    45
       \def\endgraf{ }\def\and{\& }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    46
       \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    47
       \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    48
      \endgroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    49
    \begin{flushright}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    50
      \sphinxlogo
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    51
      \py@HeaderFamily
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    52
      {\Huge \@title \par}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    53
      {\itshape\LARGE \py@release\releaseinfo \par}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    54
      \vfill
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    55
      {\LARGE
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    56
        \begin{tabular}[t]{c}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    57
          \@author
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    58
        \end{tabular}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    59
        \par}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    60
      \vfill\vfill
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    61
      {\large
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    62
       \@date \par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    63
       \vfill
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    64
       \py@authoraddress \par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    65
      }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    66
    \end{flushright}%\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    67
    \@thanks
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    68
  \end{titlepage}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    69
  \setcounter{footnote}{0}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    70
  \let\thanks\relax\let\maketitle\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    71
  %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    72
  \if@openright\cleardoublepage\else\clearpage\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    73
  \spx@tempa
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    74
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    75
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    76
\newcommand{\sphinxtableofcontents}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    77
  \pagenumbering{roman}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    78
  \pagestyle{plain}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    79
  \begingroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    80
    \parskip \z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    81
    \tableofcontents
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    82
  \endgroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    83
  % before resetting page counter, let's do the right thing.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    84
  \if@openright\cleardoublepage\else\clearpage\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    85
  \pagenumbering{arabic}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    86
  \ifdefined\fancyhf\pagestyle{normal}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    87
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    88
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    89
% This is needed to get the width of the section # area wide enough in the
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    90
% library reference.  Doing it here keeps it the same for all the manuals.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    91
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    92
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    93
\renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    94
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    95
% Fix the bibliography environment to add an entry to the Table of
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    96
% Contents.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    97
% For a report document class this environment is a chapter.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    98
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    99
\newenvironment{sphinxthebibliography}[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   100
  \if@openright\cleardoublepage\else\clearpage\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   101
  % \phantomsection % not needed here since TeXLive 2010's hyperref
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   102
  \begin{thebibliography}{1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   103
  \addcontentsline{toc}{chapter}{\bibname}}{\end{thebibliography}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   104
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   105
% Same for the indices.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   106
% The memoir class already does this, so we don't duplicate it in that case.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   107
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   108
\@ifclassloaded{memoir}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   109
 {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   110
 {\newenvironment{sphinxtheindex}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   111
    \if@openright\cleardoublepage\else\clearpage\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   112
    \phantomsection % needed as no chapter, section, ... created
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   113
    \begin{theindex}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   114
    \addcontentsline{toc}{chapter}{\indexname}}{\end{theindex}}}