elog2labfolder/_build/latex/sphinxhowto.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
% sphinxhowto.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{sphinxhowto}[2017/03/26 v1.6 Document class (Sphinx HOWTO)]
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
% 'oneside' option overriding the 'twoside' default
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     9
\newif\if@oneside
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    10
\DeclareOption{oneside}{\@onesidetrue}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    11
% Pass remaining document options to the parent class.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    12
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    13
\ProcessOptions\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    14
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    15
% Default to two-side document
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    16
\if@oneside
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    17
% nothing to do (oneside is the default)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    18
\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    19
\PassOptionsToClass{twoside}{\sphinxdocclass}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    20
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    21
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    22
\LoadClass{\sphinxdocclass}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    23
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    24
% 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
    25
% reset these counters in your preamble.
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
\setcounter{secnumdepth}{2}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    28
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    29
% 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
    30
% ``Bjarne'' style a bit better.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    31
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    32
\renewcommand{\maketitle}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    33
  \noindent\rule{\textwidth}{1pt}\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    34
    \begingroup % for PDF information dictionary
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    35
       \def\endgraf{ }\def\and{\& }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    36
       \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    37
       \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    38
    \endgroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    39
  \begin{flushright}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    40
    \sphinxlogo
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    41
    \py@HeaderFamily
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    42
    {\Huge \@title }\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    43
    {\itshape\large \py@release \releaseinfo}\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    44
    \vspace{25pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    45
    {\Large
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    46
      \begin{tabular}[t]{c}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    47
        \@author
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    48
      \end{tabular}}\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    49
    \vspace{25pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    50
    \@date \par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    51
    \py@authoraddress \par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    52
  \end{flushright}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    53
  \@thanks
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    54
  \setcounter{footnote}{0}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    55
  \let\thanks\relax\let\maketitle\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    56
  %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    57
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    58
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    59
\newcommand{\sphinxtableofcontents}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    60
  \begingroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    61
    \parskip = 0mm
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    62
    \tableofcontents
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    63
  \endgroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    64
  \rule{\textwidth}{1pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    65
  \vspace{12pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    66
}  
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    67
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    68
\@ifundefined{fancyhf}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    69
  \pagestyle{plain}}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    70
  \pagestyle{normal}}		% start this way; change for
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    71
\pagenumbering{arabic}		% ToC & chapters
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    72
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    73
\thispagestyle{empty}
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
% Fix the bibliography environment to add an entry to the Table of
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    76
% Contents.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    77
% For an article document class this environment is a section,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    78
% so no page break before it.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    79
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    80
\newenvironment{sphinxthebibliography}[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    81
  % \phantomsection % not needed here since TeXLive 2010's hyperref
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    82
  \begin{thebibliography}{1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    83
  \addcontentsline{toc}{section}{\ifdefined\refname\refname\else\ifdefined\bibname\bibname\fi\fi}}{\end{thebibliography}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    84
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    85
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    86
% Same for the indices.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    87
% 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
    88
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    89
\@ifclassloaded{memoir}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    90
 {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    91
 {\newenvironment{sphinxtheindex}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    92
    \phantomsection % needed because no chapter, section, ... is created by theindex
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    93
    \begin{theindex}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    94
    \addcontentsline{toc}{section}{\indexname}}{\end{theindex}}}