elog2labfolder/_build/latex/sphinx.sty
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
% sphinx.sty
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
% Adapted from the old python.sty, mostly written by Fred Drake,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     5
% by Georg Brandl.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     6
%
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
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
     9
\ProvidesPackage{sphinx}[2017/12/12 v1.6.6 LaTeX package (Sphinx markup)]
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
% provides \ltx@ifundefined
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    12
% (many packages load ltxcmds: graphicx does for pdftex and lualatex but
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    13
% not xelatex, and anyhow kvoptions does, but it may be needed in future to
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    14
% use \sphinxdeprecationwarning earlier, and it needs \ltx@ifundefined)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    15
\RequirePackage{ltxcmds}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    16
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    17
%% for deprecation warnings
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    18
\newcommand\sphinxdeprecationwarning[4]{% #1 the deprecated macro or name,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    19
% #2 = when deprecated, #3 = when removed, #4 = additional info
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    20
  \edef\spx@tempa{\detokenize{#1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    21
  \ltx@ifundefined{sphinx_depr_\spx@tempa}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    22
     \global\expandafter\let\csname sphinx_depr_\spx@tempa\endcsname\spx@tempa
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    23
     \expandafter\AtEndDocument\expandafter{\expandafter\let\expandafter
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    24
         \sphinxdeprecatedmacro\csname sphinx_depr_\spx@tempa\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    25
         \PackageWarningNoLine{sphinx}{^^J**** SPHINX DEPRECATION WARNING:^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    26
         \sphinxdeprecatedmacro^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    27
         \@spaces- is deprecated at Sphinx #2^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    28
         \@spaces- and removed at Sphinx #3.^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    29
         #4^^J****}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    30
  }{% warning already emitted (at end of latex log), don't repeat
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
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    33
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    34
%% PACKAGES
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
% we delay handling of options to after having loaded packages, because
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    37
% of the need to use \definecolor.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    38
\RequirePackage{graphicx}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    39
\@ifclassloaded{memoir}{}{\RequirePackage{fancyhdr}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    40
% for \text macro and \iffirstchoice@ conditional even if amsmath not loaded
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    41
\RequirePackage{amstext}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    42
\RequirePackage[warn]{textcomp}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    43
\RequirePackage{titlesec}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    44
\@ifpackagelater{titlesec}{2016/03/15}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    45
 {\@ifpackagelater{titlesec}{2016/03/21}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    46
  {}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    47
  {\newif\ifsphinx@ttlpatch@ok
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    48
   \IfFileExists{etoolbox.sty}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    49
     \RequirePackage{etoolbox}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    50
     \patchcmd{\ttlh@hang}{\parindent\z@}{\parindent\z@\leavevmode}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    51
                                {\sphinx@ttlpatch@oktrue}{}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    52
     \ifsphinx@ttlpatch@ok
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    53
     \patchcmd{\ttlh@hang}{\noindent}{}{}{\sphinx@ttlpatch@okfalse}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    54
     \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    55
   }{}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    56
   \ifsphinx@ttlpatch@ok
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    57
     \typeout{^^J Package Sphinx Info: ^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    58
              **** titlesec 2.10.1 successfully patched for bugfix ****^^J}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    59
   \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    60
     \AtEndDocument{\PackageWarningNoLine{sphinx}{^^J%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    61
******** titlesec 2.10.1 has a bug, (section numbers disappear) ......|^^J%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    62
******** and Sphinx could not patch it, perhaps because your local ...|^^J%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    63
******** copy is already fixed without a changed release date. .......|^^J%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    64
******** If not, you must update titlesec! ...........................|}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    65
   \fi
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
\RequirePackage{tabulary}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    69
% tabulary has a bug with its re-definition of \multicolumn in its first pass
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    70
% which is not \long. But now Sphinx does not use LaTeX's \multicolumn but its
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    71
% own macro. Hence we don't even need to patch tabulary. See sphinxmulticell.sty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    72
% X or S (Sphinx) may have meanings if some table package is loaded hence
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    73
% \X was chosen to avoid possibility of conflict
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    74
\newcolumntype{\X}[2]{p{\dimexpr
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    75
      (\linewidth-\arrayrulewidth)*#1/#2-\tw@\tabcolsep-\arrayrulewidth\relax}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    76
\newcolumntype{\Y}[1]{p{\dimexpr
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    77
      #1\dimexpr\linewidth-\arrayrulewidth\relax-\tw@\tabcolsep-\arrayrulewidth\relax}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    78
% using here T (for Tabulary) feels less of a problem than the X could be
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    79
\newcolumntype{T}{J}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    80
% For tables allowing pagebreaks
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    81
\RequirePackage{longtable}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    82
% User interface to set-up whitespace before and after tables:
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    83
\newcommand*\sphinxtablepre {0pt}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    84
\newcommand*\sphinxtablepost{\medskipamount}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    85
\newcommand*\sphinxbelowcaptionspace{.5\sphinxbaselineskip}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    86
% as one can not use \baselineskip from inside longtable (it is zero there)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    87
% we need \sphinxbaselineskip, which defaults to \baselineskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    88
\def\sphinxbaselineskip{\baselineskip}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    89
% These commands are inserted by the table templates
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    90
\def\sphinxatlongtablestart
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    91
   {\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    92
    \vskip\parskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    93
    \vskip\dimexpr\sphinxtablepre\relax % adjust vertical position
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    94
    \vbox{}% get correct baseline from above
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    95
    \LTpre\z@skip\LTpost\z@skip % set to zero longtable's own skips
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    96
    \edef\sphinxbaselineskip{\dimexpr\the\dimexpr\baselineskip\relax\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    97
   }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    98
\def\sphinxatlongtableend{\prevdepth\z@\vskip\sphinxtablepost\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
    99
\def\sphinxlongtablecapskipadjust
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   100
   {\dimexpr-\dp\strutbox-\sphinxbaselineskip+\sphinxbelowcaptionspace\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   101
% Now for tables not using longtable
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   102
\def\sphinxattablestart
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   103
   {\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   104
    \vskip\dimexpr\sphinxtablepre\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   105
   }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   106
\let\sphinxattableend\sphinxatlongtableend
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   107
% longtable's wraps captions to a maximal width of \LTcapwidth
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   108
% so we do the same for all tables
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   109
\newcommand*\sphinxcapstartof[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   110
   \vskip\parskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   111
   \vbox{}% force baselineskip for good positioning by capstart of hyperanchor
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   112
   \def\@captype{#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   113
   \capstart
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   114
% move back vertically to compensate space inserted by next paragraph
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   115
   \vskip-\baselineskip\vskip-\parskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   116
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   117
\newcommand\sphinxcaption[2][\LTcapwidth]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   118
   \noindent\hb@xt@\linewidth{\hss
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   119
      \vtop{\@tempdima\dimexpr#1\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   120
% don't exceed linewidth for the caption width
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   121
            \ifdim\@tempdima>\linewidth\hsize\linewidth\else\hsize\@tempdima\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   122
% longtable ignores \abovecaptionskip/\belowcaptionskip, so do the same here
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   123
            \abovecaptionskip\z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   124
            \belowcaptionskip\z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   125
            \caption[{#2}]%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   126
               {\strut\ignorespaces#2\ifhmode\unskip\@finalstrut\strutbox\fi}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   127
           }\hss}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   128
   \par\prevdepth\dp\strutbox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   129
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   130
\newcommand\sphinxaftercaption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   131
{% this default definition serves with a caption *above* a table, to make sure
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   132
 % its last baseline is \sphinxbelowcaptionspace above table top
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   133
 \nobreak
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   134
   \vskip\dimexpr\sphinxbelowcaptionspace\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   135
   \vskip-\baselineskip\vskip-\parskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   136
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   137
% varwidth is crucial for our handling of general contents in merged cells
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   138
\RequirePackage{varwidth}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   139
% but addition of a compatibility patch with hyperref is needed
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   140
% (tested with varwidth v 0.92  Mar 2009)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   141
\AtBeginDocument {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   142
    \let\@@vwid@Hy@raisedlink\Hy@raisedlink
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   143
    \long\def\@vwid@Hy@raisedlink#1{\@vwid@wrap{\@@vwid@Hy@raisedlink{#1}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   144
    \edef\@vwid@setup{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   145
      \let\noexpand\Hy@raisedlink\noexpand\@vwid@Hy@raisedlink % HYPERREF !
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   146
      \unexpanded\expandafter{\@vwid@setup}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   147
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   148
% Homemade package to handle merged cells
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   149
\RequirePackage{sphinxmulticell}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   150
\RequirePackage{makeidx}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   151
% For framing code-blocks and warning type notices, and shadowing topics
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   152
\RequirePackage{framed}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   153
% The xcolor package draws better fcolorboxes around verbatim code
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   154
\IfFileExists{xcolor.sty}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   155
    \RequirePackage{xcolor}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   156
}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   157
    \RequirePackage{color}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   158
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   159
% For highlighted code.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   160
\RequirePackage{fancyvrb}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   161
\fvset{fontsize=\small}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   162
\define@key{FV}{hllines}{\def\sphinx@verbatim@checkifhl##1{\in@{, ##1,}{#1}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   163
% For hyperlinked footnotes in tables; also for gathering footnotes from
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   164
% topic and warning blocks. Also to allow code-blocks in footnotes.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   165
\RequirePackage{footnotehyper-sphinx}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   166
% For the H specifier. Do not \restylefloat{figure}, it breaks Sphinx code
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   167
% for allowing figures in tables.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   168
\RequirePackage{float}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   169
% For floating figures in the text. Better to load after float.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   170
\RequirePackage{wrapfig}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   171
% Separate paragraphs by space by default.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   172
\RequirePackage{parskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   173
% For parsed-literal blocks.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   174
\RequirePackage{alltt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   175
% Display "real" single quotes in literal blocks.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   176
\RequirePackage{upquote}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   177
% control caption around literal-block
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   178
\RequirePackage{capt-of}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   179
\RequirePackage{needspace}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   180
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   181
% to make pdf with correct encoded bookmarks in Japanese
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   182
% this should precede the hyperref package
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   183
\ifx\kanjiskip\undefined
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   184
% for non-Japanese: make sure bookmarks are ok also with lualatex
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   185
  \PassOptionsToPackage{pdfencoding=unicode}{hyperref}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   186
\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   187
  \RequirePackage{atbegshi}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   188
  \ifx\ucs\undefined
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   189
    \ifnum 42146=\euc"A4A2
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   190
      \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   191
    \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   192
      \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   193
    \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   194
  \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   195
    \AtBeginShipoutFirst{\special{pdf:tounicode UTF8-UCS2}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   196
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   197
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   198
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   199
\ifx\@jsc@uplatextrue\undefined\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   200
  \PassOptionsToPackage{setpagesize=false}{hyperref}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   201
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   202
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   203
% These options can be overriden inside  'hyperref' key
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   204
% or by later use of \hypersetup.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   205
\PassOptionsToPackage{colorlinks,breaklinks,%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   206
 linkcolor=InnerLinkColor,filecolor=OuterLinkColor,%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   207
 menucolor=OuterLinkColor,urlcolor=OuterLinkColor,%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   208
 citecolor=InnerLinkColor}{hyperref}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   209
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   210
% stylesheet for highlighting with pygments
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   211
\RequirePackage{sphinxhighlight}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   212
% fix baseline increase from Pygments latex formatter in case of error tokens
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   213
% and keep \fboxsep's scope local via added braces
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   214
\def\PYG@tok@err{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   215
    \def\PYG@bc##1{{\setlength{\fboxsep}{-\fboxrule}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   216
                    \fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   217
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   218
\def\PYG@tok@cs{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   219
    \def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   220
    \def\PYG@bc##1{{\setlength{\fboxsep}{0pt}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   221
                    \colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   222
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   223
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   224
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   225
%% OPTIONS
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   226
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   227
% Handle options via "kvoptions" (later loaded by hyperref anyhow)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   228
\RequirePackage{kvoptions}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   229
\SetupKeyvalOptions{prefix=spx@opt@} % use \spx@opt@ prefix
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   230
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   231
% Sphinx legacy text layout: 1in margins on all four sides
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   232
\ifx\@jsc@uplatextrue\undefined
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   233
\DeclareStringOption[1in]{hmargin}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   234
\DeclareStringOption[1in]{vmargin}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   235
\DeclareStringOption[.5in]{marginpar}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   236
\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   237
% Japanese standard document classes handle \mag in a special way
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   238
\DeclareStringOption[\inv@mag in]{hmargin}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   239
\DeclareStringOption[\inv@mag in]{vmargin}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   240
\DeclareStringOption[.5\dimexpr\inv@mag in\relax]{marginpar}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   241
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   242
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   243
\DeclareBoolOption{dontkeepoldnames} % \ifspx@opt@dontkeepoldnames = \iffalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   244
\DeclareStringOption[0]{maxlistdepth}% \newcommand*\spx@opt@maxlistdepth{0}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   245
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   246
% dimensions, we declare the \dimen registers here.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   247
\newdimen\sphinxverbatimsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   248
\newdimen\sphinxverbatimborder
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   249
\newdimen\sphinxshadowsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   250
\newdimen\sphinxshadowsize
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   251
\newdimen\sphinxshadowrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   252
% \DeclareStringOption is not convenient for the handling of these dimensions
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   253
% because we want to assign the values to the corresponding registers. Even if
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   254
% we added the code to the key handler it would be too late for the initial
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   255
% set-up and we would need to do initial assignments explicitely. We end up
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   256
% using \define@key directly.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   257
% verbatim
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   258
\sphinxverbatimsep=\fboxsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   259
  \define@key{sphinx}{verbatimsep}{\sphinxverbatimsep\dimexpr #1\relax}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   260
\sphinxverbatimborder=\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   261
  \define@key{sphinx}{verbatimborder}{\sphinxverbatimborder\dimexpr #1\relax}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   262
% topic boxes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   263
\sphinxshadowsep =5pt
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   264
  \define@key{sphinx}{shadowsep}{\sphinxshadowsep\dimexpr #1\relax}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   265
\sphinxshadowsize=4pt
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   266
  \define@key{sphinx}{shadowsize}{\sphinxshadowsize\dimexpr #1\relax}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   267
\sphinxshadowrule=\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   268
  \define@key{sphinx}{shadowrule}{\sphinxshadowrule\dimexpr #1\relax}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   269
% verbatim
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   270
\DeclareBoolOption[true]{verbatimwithframe}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   271
\DeclareBoolOption[true]{verbatimwrapslines}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   272
\DeclareBoolOption[false]{verbatimhintsturnover}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   273
\DeclareBoolOption[true]{inlineliteralwraps}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   274
% parsed literal
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   275
\DeclareBoolOption[true]{parsedliteralwraps}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   276
% \textvisiblespace for compatibility with fontspec+XeTeX/LuaTeX
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   277
\DeclareStringOption[\textcolor{red}{\textvisiblespace}]{verbatimvisiblespace}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   278
\DeclareStringOption % must use braces to hide the brackets
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   279
  [{\makebox[2\fontcharwd\font`\x][r]{\textcolor{red}{\tiny$\m@th\hookrightarrow$}}}]%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   280
  {verbatimcontinued}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   281
% notices/admonitions
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   282
% the dimensions for notices/admonitions are kept as macros and assigned to
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   283
% \spx@notice@border at time of use, hence \DeclareStringOption is ok for this
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   284
\newdimen\spx@notice@border
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   285
\DeclareStringOption[0.5pt]{noteborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   286
\DeclareStringOption[0.5pt]{hintborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   287
\DeclareStringOption[0.5pt]{importantborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   288
\DeclareStringOption[0.5pt]{tipborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   289
\DeclareStringOption[1pt]{warningborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   290
\DeclareStringOption[1pt]{cautionborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   291
\DeclareStringOption[1pt]{attentionborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   292
\DeclareStringOption[1pt]{dangerborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   293
\DeclareStringOption[1pt]{errorborder}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   294
% footnotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   295
\DeclareStringOption[\mbox{ }]{AtStartFootnote}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   296
% we need a public macro name for direct use in latex file
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   297
\newcommand*{\sphinxAtStartFootnote}{\spx@opt@AtStartFootnote}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   298
% no such need for this one, as it is used inside other macros
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   299
\DeclareStringOption[\leavevmode\unskip]{BeforeFootnote}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   300
% some font styling.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   301
\DeclareStringOption[\sffamily\bfseries]{HeaderFamily}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   302
% colours
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   303
% same problems as for dimensions: we want the key handler to use \definecolor.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   304
% first, some colours with no prefix, for backwards compatibility
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   305
\newcommand*{\sphinxDeclareColorOption}[2]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   306
   \definecolor{#1}#2%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   307
   \define@key{sphinx}{#1}{\definecolor{#1}##1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   308
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   309
\sphinxDeclareColorOption{TitleColor}{{rgb}{0.126,0.263,0.361}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   310
\sphinxDeclareColorOption{InnerLinkColor}{{rgb}{0.208,0.374,0.486}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   311
\sphinxDeclareColorOption{OuterLinkColor}{{rgb}{0.216,0.439,0.388}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   312
\sphinxDeclareColorOption{VerbatimColor}{{rgb}{1,1,1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   313
\sphinxDeclareColorOption{VerbatimBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   314
% now the colours defined with "sphinx" prefix in their names
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   315
\newcommand*{\sphinxDeclareSphinxColorOption}[2]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   316
   % set the initial default
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   317
   \definecolor{sphinx#1}#2%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   318
   % set the key handler. The "value" ##1 must be acceptable by \definecolor.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   319
   \define@key{sphinx}{#1}{\definecolor{sphinx#1}##1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   320
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   321
% Default color chosen to be as in minted.sty LaTeX package!
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   322
\sphinxDeclareSphinxColorOption{VerbatimHighlightColor}{{rgb}{0.878,1,1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   323
% admonition boxes, "light" style
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   324
\sphinxDeclareSphinxColorOption{noteBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   325
\sphinxDeclareSphinxColorOption{hintBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   326
\sphinxDeclareSphinxColorOption{importantBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   327
\sphinxDeclareSphinxColorOption{tipBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   328
% admonition boxes, "heavy" style
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   329
\sphinxDeclareSphinxColorOption{warningBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   330
\sphinxDeclareSphinxColorOption{cautionBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   331
\sphinxDeclareSphinxColorOption{attentionBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   332
\sphinxDeclareSphinxColorOption{dangerBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   333
\sphinxDeclareSphinxColorOption{errorBorderColor}{{rgb}{0,0,0}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   334
\sphinxDeclareSphinxColorOption{warningBgColor}{{rgb}{1,1,1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   335
\sphinxDeclareSphinxColorOption{cautionBgColor}{{rgb}{1,1,1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   336
\sphinxDeclareSphinxColorOption{attentionBgColor}{{rgb}{1,1,1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   337
\sphinxDeclareSphinxColorOption{dangerBgColor}{{rgb}{1,1,1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   338
\sphinxDeclareSphinxColorOption{errorBgColor}{{rgb}{1,1,1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   339
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   340
\DeclareDefaultOption{\@unknownoptionerror}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   341
\ProcessKeyvalOptions*
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   342
% don't allow use of maxlistdepth via \sphinxsetup.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   343
\DisableKeyvalOption{sphinx}{maxlistdepth}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   344
% user interface: options can be changed midway in a document!
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   345
\newcommand\sphinxsetup[1]{\setkeys{sphinx}{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   346
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   347
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   348
%% MAXLISTDEPTH
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   349
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   350
% remove LaTeX's cap on nesting depth if 'maxlistdepth' key used.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   351
% This is a hack, which works with the standard classes: it assumes \@toodeep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   352
% is always used in "true" branches: "\if ... \@toodeep \else .. \fi."
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   353
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   354
% will force use the "false" branch (if there is one)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   355
\def\spx@toodeep@hack{\fi\iffalse}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   356
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   357
% do nothing if 'maxlistdepth' key not used or if package enumitem loaded.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   358
\ifnum\spx@opt@maxlistdepth=\z@\expandafter\@gobbletwo\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   359
\AtBeginDocument{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   360
\@ifpackageloaded{enumitem}{\remove@to@nnil}{}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   361
  \let\spx@toodeepORI\@toodeep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   362
  \def\@toodeep{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   363
    \ifnum\@listdepth<\spx@opt@maxlistdepth\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   364
      \expandafter\spx@toodeep@hack
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   365
    \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   366
      \expandafter\spx@toodeepORI
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   367
    \fi}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   368
% define all missing \@list... macros
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   369
  \count@\@ne
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   370
  \loop
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   371
     \ltx@ifundefined{@list\romannumeral\the\count@}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   372
       {\iffalse}{\iftrue\advance\count@\@ne}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   373
  \repeat
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   374
  \loop
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   375
     \ifnum\count@>\spx@opt@maxlistdepth\relax\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   376
       \expandafter\let
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   377
         \csname @list\romannumeral\the\count@\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   378
         \csname @list\romannumeral\the\numexpr\count@-\@ne\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   379
       % workaround 2.6--3.2d babel-french issue (fixed in 3.2e; no change needed)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   380
       \ltx@ifundefined{leftmargin\romannumeral\the\count@}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   381
       {\expandafter\let
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   382
         \csname leftmargin\romannumeral\the\count@\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   383
         \csname leftmargin\romannumeral\the\numexpr\count@-\@ne\endcsname}{}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   384
     \advance\count@\@ne
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   385
  \repeat
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   386
% define all missing enum... counters and \labelenum... macros and \p@enum..
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   387
  \count@\@ne
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   388
  \loop
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   389
     \ltx@ifundefined{c@enum\romannumeral\the\count@}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   390
       {\iffalse}{\iftrue\advance\count@\@ne}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   391
  \repeat
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   392
  \loop
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   393
     \ifnum\count@>\spx@opt@maxlistdepth\relax\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   394
       \newcounter{enum\romannumeral\the\count@}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   395
       \expandafter\def
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   396
         \csname labelenum\romannumeral\the\count@\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   397
         \expandafter
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   398
         {\csname theenum\romannumeral\the\numexpr\count@\endcsname.}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   399
       \expandafter\def
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   400
         \csname p@enum\romannumeral\the\count@\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   401
         \expandafter
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   402
         {\csname p@enum\romannumeral\the\numexpr\count@-\@ne\expandafter
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   403
          \endcsname\csname theenum\romannumeral\the\numexpr\count@-\@ne\endcsname.}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   404
     \advance\count@\@ne
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   405
  \repeat
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   406
% define all missing labelitem... macros
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   407
  \count@\@ne
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   408
  \loop
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   409
     \ltx@ifundefined{labelitem\romannumeral\the\count@}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   410
     {\iffalse}{\iftrue\advance\count@\@ne}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   411
  \repeat
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   412
  \loop
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   413
     \ifnum\count@>\spx@opt@maxlistdepth\relax\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   414
       \expandafter\let
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   415
         \csname labelitem\romannumeral\the\count@\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   416
         \csname labelitem\romannumeral\the\numexpr\count@-\@ne\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   417
     \advance\count@\@ne
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   418
  \repeat
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   419
  \PackageInfo{sphinx}{maximal list depth extended to \spx@opt@maxlistdepth}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   420
\@gobble\@nnil
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   421
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   422
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   423
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   424
%% INDEX, BIBLIOGRAPHY, APPENDIX, TABLE OF CONTENTS
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   425
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   426
% fix the double index and bibliography on the table of contents
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   427
% in jsclasses (Japanese standard document classes)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   428
\ifx\@jsc@uplatextrue\undefined\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   429
  \renewenvironment{sphinxtheindex}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   430
    {\cleardoublepage\phantomsection
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   431
     \begin{theindex}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   432
    {\end{theindex}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   433
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   434
  \renewenvironment{sphinxthebibliography}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   435
    {\cleardoublepage% \phantomsection % not needed here since TeXLive 2010's hyperref
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   436
     \begin{thebibliography}{1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   437
    {\end{thebibliography}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   438
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   439
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   440
% disable \@chappos in Appendix in pTeX
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   441
\ifx\kanjiskip\undefined\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   442
  \let\py@OldAppendix=\appendix
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   443
  \renewcommand{\appendix}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   444
    \py@OldAppendix
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   445
    \gdef\@chappos{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   446
  }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   447
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   448
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   449
% make commands known to non-Sphinx document classes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   450
\providecommand*{\sphinxtableofcontents}{\tableofcontents}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   451
\ltx@ifundefined{sphinxthebibliography}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   452
 {\newenvironment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   453
  {sphinxthebibliography}{\begin{thebibliography}}{\end{thebibliography}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   454
 }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   455
 {}% else clause of ifundefined
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   456
\ltx@ifundefined{sphinxtheindex}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   457
 {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   458
 {}% else clause of ifundefined
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   459
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   460
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   461
%% COLOR (general)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   462
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   463
% FIXME: \normalcolor should probably be used in place of \py@NormalColor
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   464
% elsewhere, and \py@NormalColor should never be defined. \normalcolor
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   465
% switches to the colour from last \color call in preamble.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   466
\def\py@NormalColor{\color{black}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   467
% FIXME: it is probably better to use \color{TitleColor}, as TitleColor
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   468
% can be customized from 'sphinxsetup', and drop usage of \py@TitleColor
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   469
\def\py@TitleColor{\color{TitleColor}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   470
% FIXME: this line should be dropped, as "9" is default anyhow.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   471
\ifdefined\pdfcompresslevel\pdfcompresslevel = 9 \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   472
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   473
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   474
%% PAGE STYLING
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   475
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   476
% Style parameters and macros used by most documents here
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   477
\raggedbottom
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   478
\sloppy
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   479
\hbadness = 5000                % don't print trivial gripes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   480
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   481
\pagestyle{empty}               % start this way
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   482
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   483
% Redefine the 'normal' header/footer style when using "fancyhdr" package:
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   484
% Note: this presupposes "twoside". If "oneside" class option, there will be warnings.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   485
\ltx@ifundefined{fancyhf}{}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   486
  % Use \pagestyle{normal} as the primary pagestyle for text.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   487
  \fancypagestyle{normal}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   488
    \fancyhf{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   489
% (for \py@HeaderFamily cf "TITLES")
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   490
    \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   491
    \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   492
    \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   493
    \fancyhead[LE,RO]{{\py@HeaderFamily \@title, \py@release}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   494
    \renewcommand{\headrulewidth}{0.4pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   495
    \renewcommand{\footrulewidth}{0.4pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   496
    % define chaptermark with \@chappos when \@chappos is available for Japanese
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   497
    \ltx@ifundefined{@chappos}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   498
      {\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   499
  }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   500
  % Update the plain style so we get the page number & footer line,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   501
  % but not a chapter or section title.  This is to keep the first
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   502
  % page of a chapter and the blank page between chapters `clean.'
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   503
  \fancypagestyle{plain}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   504
    \fancyhf{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   505
    \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   506
    \renewcommand{\headrulewidth}{0pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   507
    \renewcommand{\footrulewidth}{0.4pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   508
  }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   509
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   510
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   511
% geometry
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   512
\ifx\kanjiskip\undefined
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   513
  \PassOptionsToPackage{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   514
     hmargin={\unexpanded{\spx@opt@hmargin}},%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   515
     vmargin={\unexpanded{\spx@opt@vmargin}},%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   516
     marginpar=\unexpanded{\spx@opt@marginpar}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   517
  {geometry}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   518
\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   519
 % set text width for Japanese documents to be integer multiple of 1zw
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   520
 % and text height to be integer multiple of \baselineskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   521
 % the execution is delayed to \sphinxsetup then geometry.sty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   522
 \normalsize\normalfont
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   523
 \newcommand*\sphinxtextwidthja[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   524
    \if@twocolumn\tw@\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   525
    \dimexpr
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   526
       \numexpr\dimexpr\paperwidth-\tw@\dimexpr#1\relax\relax/
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   527
               \dimexpr\if@twocolumn\tw@\else\@ne\fi zw\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   528
    zw\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   529
 \newcommand*\sphinxmarginparwidthja[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   530
    \dimexpr\numexpr\dimexpr#1\relax/\dimexpr1zw\relax zw\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   531
 \newcommand*\sphinxtextlinesja[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   532
    \numexpr\@ne+\dimexpr\paperheight-\topskip-\tw@\dimexpr#1\relax\relax/
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   533
                 \baselineskip\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   534
 \ifx\@jsc@uplatextrue\undefined\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   535
 % the way we found in order for the papersize special written by
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   536
 % geometry in the dvi file to be correct in case of jsbook class
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   537
   \ifnum\mag=\@m\else % do nothing special if nomag class option or 10pt
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   538
     \PassOptionsToPackage{truedimen}{geometry}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   539
   \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   540
 \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   541
 \PassOptionsToPackage{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   542
    hmarginratio={1:1},%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   543
    textwidth=\unexpanded{\sphinxtextwidthja{\spx@opt@hmargin}},%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   544
    vmarginratio={1:1},%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   545
    lines=\unexpanded{\sphinxtextlinesja{\spx@opt@vmargin}},%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   546
    marginpar=\unexpanded{\sphinxmarginparwidthja{\spx@opt@marginpar}},%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   547
    footskip=2\baselineskip,%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   548
  }{geometry}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   549
 \AtBeginDocument
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   550
 {% update a dimension used by the jsclasses
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   551
  \ifx\@jsc@uplatextrue\undefined\else\fullwidth\textwidth\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   552
  % for some reason, jreport normalizes all dimensions with \@settopoint
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   553
  \@ifclassloaded{jreport}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   554
    {\@settopoint\textwidth\@settopoint\textheight\@settopoint\marginparwidth}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   555
    {}% <-- "false" clause of \@ifclassloaded
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   556
  }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   557
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   558
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   559
% fix fncychap's bug which uses prematurely the \textwidth value
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   560
\@ifpackagewith{fncychap}{Bjornstrup}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   561
 {\AtBeginDocument{\mylen\textwidth\advance\mylen-2\myhi}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   562
 {}% <-- "false" clause of \@ifpackagewith
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   563
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   564
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   565
%% TITLES
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   566
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   567
% Since Sphinx 1.5, users should use HeaderFamily key to 'sphinxsetup' rather
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   568
% than defining their own \py@HeaderFamily command (which is still possible).
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   569
% Memo: \py@HeaderFamily is also used by \maketitle as defined in
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   570
% sphinxmanual.cls/sphinxhowto.cls
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   571
\newcommand{\py@HeaderFamily}{\spx@opt@HeaderFamily}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   572
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   573
% This sets up the fancy chapter headings that make the documents look
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   574
% at least a little better than the usual LaTeX output.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   575
\@ifpackagewith{fncychap}{Bjarne}{
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   576
  \ChNameVar {\raggedleft\normalsize \py@HeaderFamily}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   577
  \ChNumVar  {\raggedleft\Large      \py@HeaderFamily}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   578
  \ChTitleVar{\raggedleft\Large      \py@HeaderFamily}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   579
  % This creates (numbered) chapter heads without the leading \vspace*{}:
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   580
  \def\@makechapterhead#1{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   581
    {\parindent \z@ \raggedright \normalfont
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   582
      \ifnum \c@secnumdepth >\m@ne
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   583
        \if@mainmatter
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   584
          \DOCH
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   585
        \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   586
      \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   587
      \interlinepenalty\@M
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   588
      \if@mainmatter
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   589
        \DOTI{#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   590
      \else%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   591
        \DOTIS{#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   592
      \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   593
    }}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   594
}{}% <-- "false" clause of \@ifpackagewith
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   595
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   596
% Augment the sectioning commands used to get our own font family in place,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   597
% and reset some internal data items (\titleformat from titlesec package)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   598
\titleformat{\section}{\Large\py@HeaderFamily}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   599
            {\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   600
\titleformat{\subsection}{\large\py@HeaderFamily}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   601
            {\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   602
\titleformat{\subsubsection}{\py@HeaderFamily}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   603
            {\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   604
% By default paragraphs (and subsubsections) will not be numbered because
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   605
% sphinxmanual.cls and sphinxhowto.cls set secnumdepth to 2
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   606
\titleformat{\paragraph}{\py@HeaderFamily}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   607
            {\py@TitleColor\theparagraph}{0.5em}{\py@TitleColor}{\py@NormalColor}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   608
\titleformat{\subparagraph}{\py@HeaderFamily}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   609
            {\py@TitleColor\thesubparagraph}{0.5em}{\py@TitleColor}{\py@NormalColor}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   610
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   611
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   612
%% GRAPHICS
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   613
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   614
% \sphinxincludegraphics defined to resize images larger than the line width,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   615
% except if height or width option present.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   616
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   617
% If scale is present, rescale before fitting to line width. (since 1.5)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   618
\newbox\spx@image@box
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   619
\newcommand*{\sphinxincludegraphics}[2][]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   620
  \in@{height}{#1}\ifin@\else\in@{width}{#1}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   621
  \ifin@ % height or width present
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   622
    \includegraphics[#1]{#2}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   623
  \else % no height nor width (but #1 may be "scale=...")
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   624
    \setbox\spx@image@box\hbox{\includegraphics[#1,draft]{#2}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   625
    \ifdim \wd\spx@image@box>\linewidth
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   626
      \setbox\spx@image@box\box\voidb@x % clear memory
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   627
      \includegraphics[#1,width=\linewidth]{#2}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   628
    \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   629
      \includegraphics[#1]{#2}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   630
    \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   631
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   632
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   633
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   634
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   635
%% FIGURE IN TABLE
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   636
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   637
\newenvironment{sphinxfigure-in-table}[1][\linewidth]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   638
  \def\@captype{figure}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   639
  \sphinxsetvskipsforfigintablecaption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   640
  \begin{minipage}{#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   641
}{\end{minipage}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   642
% store original \caption macro for use with figures in longtable and tabulary
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   643
\AtBeginDocument{\let\spx@originalcaption\caption}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   644
\newcommand*\sphinxfigcaption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   645
  {\ifx\equation$%$% this is trick to identify tabulary first pass
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   646
       \firstchoice@false\else\firstchoice@true\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   647
   \spx@originalcaption }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   648
\newcommand*\sphinxsetvskipsforfigintablecaption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   649
  {\abovecaptionskip\smallskipamount
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   650
   \belowcaptionskip\smallskipamount}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   651
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   652
%% FOOTNOTES
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   653
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   654
% Support large numbered footnotes in minipage
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   655
% But now obsolete due to systematic use of \savenotes/\spewnotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   656
% when minipages are in use in the various macro definitions next.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   657
\def\thempfootnote{\arabic{mpfootnote}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   658
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   659
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   660
%% LITERAL BLOCKS
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   661
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   662
% Based on use of "fancyvrb.sty"'s Verbatim.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   663
% - with framing allowing page breaks ("framed.sty")
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   664
% - with breaking of long lines (exploits Pygments mark-up),
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   665
% - with possibly of a top caption, non-separable by pagebreak.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   666
% - and usable inside tables or footnotes ("footnotehyper-sphinx").
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   667
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   668
% For extensions which use \OriginalVerbatim and compatibility with Sphinx <
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   669
% 1.5, we define and use these when (unmodified) Verbatim will be needed. But
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   670
% Sphinx >= 1.5 does not modify the \Verbatim macro anymore.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   671
\let\OriginalVerbatim   \Verbatim
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   672
\let\endOriginalVerbatim\endVerbatim
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   673
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   674
% if the available space on page is less than \literalblockneedspace, insert pagebreak
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   675
\newcommand{\sphinxliteralblockneedspace}{5\baselineskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   676
\newcommand{\sphinxliteralblockwithoutcaptionneedspace}{1.5\baselineskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   677
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   678
% for captions of literal blocks
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   679
% also define `\theH...` macros for hyperref
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   680
\newcounter{literalblock}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   681
\ltx@ifundefined{c@chapter}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   682
  {\@addtoreset{literalblock}{section}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   683
  \def\theliteralblock {\ifnum\c@section>\z@ \thesection.\fi\arabic{literalblock}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   684
  \def\theHliteralblock {\theHsection.\arabic{literalblock}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   685
  {\@addtoreset{literalblock}{chapter}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   686
  \def\theliteralblock {\ifnum\c@chapter>\z@ \thechapter.\fi\arabic{literalblock}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   687
  \def\theHliteralblock {\theHchapter.\arabic{literalblock}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   688
% at start of caption title
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   689
\newcommand*{\fnum@literalblock}{\literalblockname\nobreakspace\theliteralblock}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   690
% this will be overwritten in document preamble by Babel translation
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   691
\newcommand*{\literalblockname}{Listing }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   692
% file extension needed for \caption's good functioning, the file is created
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   693
% only if a \listof{literalblock}{foo} command is encountered, which is
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   694
% analogous to \listoffigures, but for the code listings (foo = chosen title.)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   695
\newcommand*{\ext@literalblock}{lol}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   696
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   697
% The title (caption) is specified from outside as macro \sphinxVerbatimTitle.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   698
% \sphinxVerbatimTitle is reset to empty after each use of Verbatim.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   699
\newcommand*\sphinxVerbatimTitle {}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   700
% This box to typeset the caption before framed.sty multiple passes for framing.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   701
\newbox\spx@Verbatim@TitleBox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   702
% Holder macro for labels of literal blocks. Set-up by LaTeX writer.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   703
\newcommand*\sphinxLiteralBlockLabel {}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   704
\newcommand*\sphinxSetupCaptionForVerbatim [1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   705
{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   706
    \needspace{\sphinxliteralblockneedspace}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   707
% insert a \label via \sphinxLiteralBlockLabel
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   708
% reset to normal the color for the literal block caption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   709
% the caption inserts \abovecaptionskip whitespace above itself (usually 10pt)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   710
% there is also \belowcaptionskip but it is usually zero, hence the \smallskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   711
    \def\sphinxVerbatimTitle
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   712
       {\py@NormalColor
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   713
        \captionof{literalblock}{\sphinxLiteralBlockLabel #1}\smallskip }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   714
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   715
\newcommand*\sphinxSetupCodeBlockInFootnote {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   716
  \fvset{fontsize=\footnotesize}\let\caption\sphinxfigcaption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   717
  \sphinxverbatimwithminipagetrue % reduces vertical spaces
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   718
  % we counteract float.sty's \caption which does \@normalsize
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   719
  \let\normalsize\footnotesize\let\@parboxrestore\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   720
  \abovecaptionskip \smallskipamount \belowcaptionskip \z@skip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   721
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   722
\newif\ifspx@inframed % flag set if we are already in a framed environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   723
% if forced use of minipage encapsulation is needed (e.g. table cells)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   724
\newif\ifsphinxverbatimwithminipage   \sphinxverbatimwithminipagefalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   725
\long\def\spx@colorbox #1#2#3{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   726
% let the framing obey the current indentation (adapted from framed.sty's code).
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   727
  \hskip\@totalleftmargin
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   728
  \hskip-\fboxsep\hskip-\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   729
  \spx@fcolorbox{VerbatimBorderColor}{VerbatimColor}{#1}{#2}{#3}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   730
  \hskip-\fboxsep\hskip-\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   731
  \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   732
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   733
% use of \color@b@x here is compatible with both xcolor.sty and color.sty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   734
\long\def\spx@fcolorbox #1#2#3#4%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   735
  {\color@b@x {\color{#1}\spx@VerbatimFBox{#3}{#4}}{\color{#2}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   736
% Frame drawing macro
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   737
% #1 = used by default for title above frame, may contain "continued" hint
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   738
% #2 = for material underneath frame, used for "continues on next page" hint
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   739
% #3 = actual contents with background color
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   740
\long\def\spx@VerbatimFBox#1#2#3{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   741
  \leavevmode
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   742
  \begingroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   743
  \setbox\@tempboxa\hbox{{#3}}% inner braces to avoid color leaks
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   744
  \hbox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   745
   {\lower\dimexpr\fboxrule+\dp\@tempboxa\hbox{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   746
      \vbox{#1% above frame
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   747
            % draw frame border _latest_ to avoid pdf viewer issue
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   748
            \kern\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   749
            \hbox{\kern\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   750
                  \copy\@tempboxa
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   751
                  \kern-\wd\@tempboxa\kern-\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   752
                  \vrule\@width\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   753
                  \kern\wd\@tempboxa
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   754
                  \vrule\@width\fboxrule}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   755
            \kern-\dimexpr\ht\@tempboxa+\dp\@tempboxa+\fboxrule\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   756
            \hrule\@height\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   757
            \kern\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   758
            \hrule\@height\fboxrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   759
            #2% below frame
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   760
          }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   761
    }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   762
   }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   763
  \endgroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   764
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   765
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   766
% Customize framed.sty \MakeFramed to glue caption to literal block
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   767
% and add optional hint "continued on next page"
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   768
\def\spx@Verbatim@FrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   769
   {\spx@colorbox\spx@Verbatim@Title{}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   770
% Macros for a frame with page breaks:
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   771
\def\spx@Verbatim@FirstFrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   772
   {\spx@colorbox\spx@Verbatim@Title\spx@Verbatim@Continues}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   773
\def\spx@Verbatim@MidFrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   774
   {\spx@colorbox\spx@Verbatim@Continued\spx@Verbatim@Continues}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   775
\def\spx@Verbatim@LastFrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   776
   {\spx@colorbox\spx@Verbatim@Continued{}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   777
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   778
\def\spx@Verbatim@Title{% hide width from framed.sty measuring
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   779
  \moveright\dimexpr\fboxrule+.5\wd\@tempboxa
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   780
  \hb@xt@\z@{\hss\unhcopy\spx@Verbatim@TitleBox\hss}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   781
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   782
\def\spx@Verbatim@Continued{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   783
  \moveright\dimexpr\fboxrule+\wd\@tempboxa-\fboxsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   784
  \hb@xt@\z@{\hss
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   785
             {\normalcolor\sphinxstylecodecontinued\literalblockcontinuedname}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   786
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   787
\def\spx@Verbatim@Continues{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   788
  \moveright\dimexpr\fboxrule+\wd\@tempboxa-\fboxsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   789
  \hb@xt@\z@{\hss
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   790
             {\normalcolor\sphinxstylecodecontinues\literalblockcontinuesname}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   791
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   792
% Defaults are redefined in document preamble according to language
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   793
\newcommand*\literalblockcontinuedname{continued from previous page}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   794
\newcommand*\literalblockcontinuesname{continues on next page}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   795
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   796
% For linebreaks inside Verbatim environment from package fancyvrb.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   797
\newbox\sphinxcontinuationbox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   798
\newbox\sphinxvisiblespacebox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   799
\newcommand*\sphinxafterbreak {\copy\sphinxcontinuationbox}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   800
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   801
% Take advantage of the already applied Pygments mark-up to insert
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   802
% potential linebreaks for TeX processing.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   803
%        {, <, #, %, $, ' and ": go to next line.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   804
%        _, }, ^, &, >, - and ~: stay at end of broken line.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   805
% Use of \textquotesingle for straight quote.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   806
% FIXME: convert this to package options ?
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   807
\newcommand*\sphinxbreaksbeforelist {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   808
    \do\PYGZob\{\do\PYGZlt\<\do\PYGZsh\#\do\PYGZpc\%% {, <, #, %,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   809
    \do\PYGZdl\$\do\PYGZdq\"% $, "
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   810
    \def\PYGZsq
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   811
     {\discretionary{}{\sphinxafterbreak\textquotesingle}{\textquotesingle}}% '
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   812
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   813
\newcommand*\sphinxbreaksafterlist {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   814
    \do\PYGZus\_\do\PYGZcb\}\do\PYGZca\^\do\PYGZam\&% _, }, ^, &,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   815
    \do\PYGZgt\>\do\PYGZhy\-\do\PYGZti\~% >, -, ~
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   816
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   817
\newcommand*\sphinxbreaksatspecials {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   818
  \def\do##1##2%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   819
     {\def##1{\discretionary{}{\sphinxafterbreak\char`##2}{\char`##2}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   820
  \sphinxbreaksbeforelist
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   821
  \def\do##1##2%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   822
     {\def##1{\discretionary{\char`##2}{\sphinxafterbreak}{\char`##2}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   823
  \sphinxbreaksafterlist
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   824
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   825
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   826
\def\sphinx@verbatim@nolig@list {\do \`}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   827
% Some characters . , ; ? ! / are not pygmentized.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   828
% This macro makes them "active" and they will insert potential linebreaks.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   829
% Not compatible with math mode (cf \sphinxunactivateextras).
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   830
\newcommand*\sphinxbreaksbeforeactivelist {}% none
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   831
\newcommand*\sphinxbreaksafteractivelist  {\do\.\do\,\do\;\do\?\do\!\do\/}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   832
\newcommand*\sphinxbreaksviaactive {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   833
   \def\do##1{\lccode`\~`##1%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   834
    \lowercase{\def~}{\discretionary{}{\sphinxafterbreak\char`##1}{\char`##1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   835
    \catcode`##1\active}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   836
   \sphinxbreaksbeforeactivelist
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   837
   \def\do##1{\lccode`\~`##1%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   838
    \lowercase{\def~}{\discretionary{\char`##1}{\sphinxafterbreak}{\char`##1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   839
    \catcode`##1\active}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   840
   \sphinxbreaksafteractivelist
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   841
   \lccode`\~`\~
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   842
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   843
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   844
% If the linebreak is at a space, the latter will be displayed as visible
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   845
% space at end of first line, and a continuation symbol starts next line.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   846
\def\spx@verbatim@space {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   847
     \nobreak\hskip\z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   848
     \discretionary{\copy\sphinxvisiblespacebox}{\sphinxafterbreak}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   849
                   {\kern\fontdimen2\font}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   850
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   851
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   852
% needed to create wrapper environments of fancyvrb's Verbatim
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   853
\newcommand*{\sphinxVerbatimEnvironment}{\gdef\FV@EnvironName{sphinxVerbatim}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   854
% serves to implement line highlighting and line wrapping
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   855
\newcommand\sphinxFancyVerbFormatLine[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   856
  \expandafter\sphinx@verbatim@checkifhl\expandafter{\the\FV@CodeLineNo}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   857
  \ifin@
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   858
     \sphinxVerbatimHighlightLine{#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   859
  \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   860
     \sphinxVerbatimFormatLine{#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   861
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   862
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   863
\newcommand\sphinxVerbatimHighlightLine[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   864
  \edef\sphinxrestorefboxsep{\fboxsep\the\fboxsep\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   865
  \fboxsep0pt\relax % cf LaTeX bug graphics/4524
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   866
  \colorbox{sphinxVerbatimHighlightColor}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   867
           {\sphinxrestorefboxsep\sphinxVerbatimFormatLine{#1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   868
  % no need to restore \fboxsep here, as this ends up in a \hbox from fancyvrb
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   869
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   870
% \sphinxVerbatimFormatLine will be set locally to one of those two:
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   871
\newcommand\sphinxVerbatimFormatLineWrap[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   872
    \hsize\linewidth
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   873
    \vtop{\raggedright\hyphenpenalty\z@\exhyphenpenalty\z@
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   874
          \doublehyphendemerits\z@\finalhyphendemerits\z@
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   875
          \strut #1\strut}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   876
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   877
\newcommand\sphinxVerbatimFormatLineNoWrap[1]{\hb@xt@\linewidth{\strut #1\hss}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   878
\g@addto@macro\FV@SetupFont{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   879
    \sbox\sphinxcontinuationbox {\spx@opt@verbatimcontinued}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   880
    \sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   881
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   882
% Sphinx <1.5 optional argument was in fact mandatory. It is now really
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   883
% optional and handled by original Verbatim.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   884
\newenvironment{sphinxVerbatim}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   885
  % quit horizontal mode if we are still in a paragraph
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   886
  \par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   887
  % list starts new par, but we don't want it to be set apart vertically
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   888
  \parskip\z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   889
  % first, let's check if there is a caption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   890
  \ifx\sphinxVerbatimTitle\empty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   891
      \addvspace\z@% counteract possible previous negative skip (French lists!)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   892
      \smallskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   893
      % there was no caption. Check if nevertheless a label was set.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   894
      \ifx\sphinxLiteralBlockLabel\empty\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   895
      % we require some space to be sure hyperlink target from \phantomsection
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   896
      % will not be separated from upcoming verbatim by a page break
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   897
          \needspace{\sphinxliteralblockwithoutcaptionneedspace}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   898
          \phantomsection\sphinxLiteralBlockLabel
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   899
      \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   900
      \let\spx@Verbatim@Title\@empty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   901
  \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   902
  % non-empty \sphinxVerbatimTitle has label inside it (in case there is one)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   903
     \setbox\spx@Verbatim@TitleBox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   904
            \hbox{\begin{minipage}{\linewidth}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   905
                    \sphinxVerbatimTitle
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   906
                  \end{minipage}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   907
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   908
  \fboxsep\sphinxverbatimsep \fboxrule\sphinxverbatimborder
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   909
  % setting borderwidth to zero is simplest for no-frame effect with same pagebreaks
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   910
  \ifspx@opt@verbatimwithframe\else\fboxrule\z@\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   911
  \let\FrameCommand     \spx@Verbatim@FrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   912
  \let\FirstFrameCommand\spx@Verbatim@FirstFrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   913
  \let\MidFrameCommand  \spx@Verbatim@MidFrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   914
  \let\LastFrameCommand \spx@Verbatim@LastFrameCommand
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   915
  \ifspx@opt@verbatimhintsturnover\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   916
      \let\spx@Verbatim@Continued\@empty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   917
      \let\spx@Verbatim@Continues\@empty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   918
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   919
  \ifspx@opt@verbatimwrapslines
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   920
  % fancyvrb's Verbatim puts each input line in (unbreakable) horizontal boxes.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   921
  % This customization wraps each line from the input in a \vtop, thus
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   922
  % allowing it to wrap and display on two or more lines in the latex output.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   923
  %     - The codeline counter will be increased only once.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   924
  %     - The wrapped material will not break across pages, it is impossible
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   925
  %       to achieve this without extensive rewrite of fancyvrb.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   926
  %     - The (not used in sphinx) obeytabs option to Verbatim is
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   927
  %       broken by this change (showtabs and tabspace work).
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   928
    \let\sphinxVerbatimFormatLine\sphinxVerbatimFormatLineWrap
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   929
    \let\FV@Space\spx@verbatim@space
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   930
  % Allow breaks at special characters using \PYG... macros.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   931
    \sphinxbreaksatspecials
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   932
  % Breaks at punctuation characters . , ; ? ! and / (needs catcode activation)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   933
    \fvset{codes*=\sphinxbreaksviaactive}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   934
  \else % end of conditional code for wrapping long code lines
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   935
    \let\sphinxVerbatimFormatLine\sphinxVerbatimFormatLineNoWrap
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   936
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   937
  \let\FancyVerbFormatLine\sphinxFancyVerbFormatLine
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   938
  % workaround to fancyvrb's check of \@currenvir
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   939
  \let\VerbatimEnvironment\sphinxVerbatimEnvironment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   940
  % workaround to fancyvrb's check of current list depth
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   941
  \def\@toodeep {\advance\@listdepth\@ne}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   942
  % The list environment is needed to control perfectly the vertical space.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   943
  % Note: \OuterFrameSep used by framed.sty is later set to \topsep hence 0pt.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   944
  % - if caption: vertical space above caption = (\abovecaptionskip + D) with
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   945
  %   D = \baselineskip-\FrameHeightAdjust, and then \smallskip above frame.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   946
  % - if no caption: (\smallskip + D) above frame. By default D=6pt.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   947
  % Use trivlist rather than list to avoid possible "too deeply nested" error.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   948
  \itemsep   \z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   949
  \topsep    \z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   950
  \partopsep \z@skip% trivlist will set \parsep to \parskip = zero (see above)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   951
  % \leftmargin will be set to zero by trivlist
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   952
  \rightmargin\z@
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   953
  \parindent  \z@% becomes \itemindent. Default zero, but perhaps overwritten.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   954
  \trivlist\item\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   955
     \ifsphinxverbatimwithminipage\spx@inframedtrue\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   956
     % use a minipage if we are already inside a framed environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   957
     \ifspx@inframed\noindent\begin{minipage}{\linewidth}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   958
     \MakeFramed {% adapted over from framed.sty's snugshade environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   959
        \advance\hsize-\width\@totalleftmargin\z@\linewidth\hsize\@setminipage
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   960
        }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   961
     % For grid placement from \strut's in \FancyVerbFormatLine
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   962
     \lineskip\z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   963
     % active comma should not be overwritten by \@noligs
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   964
     \ifspx@opt@verbatimwrapslines
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   965
       \let\verbatim@nolig@list \sphinx@verbatim@nolig@list
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   966
     \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   967
     % will fetch its optional arguments if any
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   968
     \OriginalVerbatim
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   969
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   970
{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   971
  \endOriginalVerbatim
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   972
  \par\unskip\@minipagefalse\endMakeFramed % from framed.sty snugshade
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   973
  \ifspx@inframed\end{minipage}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   974
  \endtrivlist
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   975
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   976
\newenvironment {sphinxVerbatimNoFrame}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   977
  {\spx@opt@verbatimwithframefalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   978
   % needed for fancyvrb as literal code will end in \end{sphinxVerbatimNoFrame}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   979
   \def\sphinxVerbatimEnvironment{\gdef\FV@EnvironName{sphinxVerbatimNoFrame}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   980
   \begin{sphinxVerbatim}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   981
  {\end{sphinxVerbatim}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   982
\newenvironment {sphinxVerbatimintable}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   983
  {% don't use a frame if in a table cell
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   984
   \spx@opt@verbatimwithframefalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   985
   \sphinxverbatimwithminipagetrue
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   986
   % counteract longtable redefinition of caption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   987
   \let\caption\sphinxfigcaption
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   988
   % reduce above caption space if in a table cell
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   989
   \abovecaptionskip\smallskipamount
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   990
   \def\sphinxVerbatimEnvironment{\gdef\FV@EnvironName{sphinxVerbatimintable}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   991
   \begin{sphinxVerbatim}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   992
  {\end{sphinxVerbatim}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   993
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   994
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   995
%% PARSED LITERALS
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   996
% allow long lines to wrap like they do in code-blocks
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   997
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   998
% this should be kept in sync with definitions in sphinx.util.texescape
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
   999
\newcommand*\sphinxbreaksattexescapedchars{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1000
  \def\do##1##2% put potential break point before character
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1001
     {\def##1{\discretionary{}{\sphinxafterbreak\char`##2}{\char`##2}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1002
  \do\{\{\do\textless\<\do\#\#\do\%\%\do\$\$% {, <, #, %, $
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1003
  \def\do##1##2% put potential break point after character
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1004
     {\def##1{\discretionary{\char`##2}{\sphinxafterbreak}{\char`##2}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1005
  \do\_\_\do\}\}\do\textasciicircum\^\do\&\&% _, }, ^, &,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1006
  \do\textgreater\>\do\textasciitilde\~% >, ~
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1007
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1008
\newcommand*\sphinxbreaksviaactiveinparsedliteral{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1009
  \sphinxbreaksviaactive % by default handles . , ; ? ! /
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1010
  \do\-% we need also the hyphen character (ends up "as is" in parsed-literal)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1011
  \lccode`\~`\~ %
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1012
  % update \dospecials as it is used by \url
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1013
  % but deactivation will already have been done hence this is unneeded:
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1014
  %  \expandafter\def\expandafter\dospecials\expandafter{\dospecials
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1015
  %   \sphinxbreaksbeforeactivelist\sphinxbreaksafteractivelist\do\-}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1016
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1017
\newcommand*\sphinxbreaksatspaceinparsedliteral{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1018
  \lccode`~32 \lowercase{\let~}\spx@verbatim@space\lccode`\~`\~
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1019
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1020
\newcommand*{\sphinxunactivateextras}{\let\do\@makeother
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1021
      \sphinxbreaksbeforeactivelist\sphinxbreaksafteractivelist\do\-}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1022
% the \catcode13=5\relax (deactivate end of input lines) is left to callers
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1023
\newcommand*{\sphinxunactivateextrasandspace}{\catcode32=10\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1024
      \sphinxunactivateextras}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1025
% now for the modified alltt environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1026
\newenvironment{sphinxalltt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1027
{% at start of next line to workaround Emacs/AUCTeX issue with this file
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1028
\begin{alltt}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1029
 \ifspx@opt@parsedliteralwraps
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1030
   \sbox\sphinxcontinuationbox {\spx@opt@verbatimcontinued}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1031
   \sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1032
   \sphinxbreaksattexescapedchars
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1033
   \sphinxbreaksviaactiveinparsedliteral
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1034
   \sphinxbreaksatspaceinparsedliteral
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1035
% alltt takes care of the ' as derivative ("prime") in math mode
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1036
   \everymath\expandafter{\the\everymath\sphinxunactivateextrasandspace
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1037
             \catcode`\<=12\catcode`\>=12\catcode`\^=7\catcode`\_=8 }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1038
% not sure if displayed math (align,...) can end up in parsed-literal, anyway
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1039
   \everydisplay\expandafter{\the\everydisplay
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1040
             \catcode13=5 \sphinxunactivateextrasandspace
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1041
             \catcode`\<=12\catcode`\>=12\catcode`\^=7\catcode`\_=8 }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1042
 \fi }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1043
{\end{alltt}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1044
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1045
% Protect \href's first argument in contexts such as sphinxalltt (or
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1046
% \sphinxcode). Sphinx uses \#, \%, \& ... always inside \sphinxhref.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1047
\protected\def\sphinxhref#1#2{{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1048
    \sphinxunactivateextrasandspace % never do \scantokens with active space!
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1049
    \endlinechar\m@ne\everyeof{{#2}}% keep catcode regime for #2
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1050
    \scantokens{\href{#1}}% normalise it for #1 during \href expansion
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1051
}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1052
% Same for \url. And also \nolinkurl for coherence.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1053
\protected\def\sphinxurl#1{{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1054
    \sphinxunactivateextrasandspace\everyeof{}% (<- precaution for \scantokens)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1055
    \endlinechar\m@ne\scantokens{\url{#1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1056
}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1057
\protected\def\sphinxnolinkurl#1{{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1058
    \sphinxunactivateextrasandspace\everyeof{}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1059
    \endlinechar\m@ne\scantokens{\nolinkurl{#1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1060
}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1061
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1062
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1063
%% TOPIC AND CONTENTS BOXES
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1064
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1065
% Again based on use of "framed.sty", this allows breakable framed boxes.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1066
\long\def\spx@ShadowFBox#1{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1067
  \leavevmode\begingroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1068
  % first we frame the box #1
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1069
  \setbox\@tempboxa
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1070
   \hbox{\vrule\@width\sphinxshadowrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1071
         \vbox{\hrule\@height\sphinxshadowrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1072
               \kern\sphinxshadowsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1073
               \hbox{\kern\sphinxshadowsep #1\kern\sphinxshadowsep}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1074
               \kern\sphinxshadowsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1075
               \hrule\@height\sphinxshadowrule}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1076
         \vrule\@width\sphinxshadowrule}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1077
  % Now we add the shadow, like \shadowbox from fancybox.sty would do
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1078
  \dimen@\dimexpr.5\sphinxshadowrule+\sphinxshadowsize\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1079
  \hbox{\vbox{\offinterlineskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1080
              \hbox{\copy\@tempboxa\kern-.5\sphinxshadowrule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1081
                    % add shadow on right side
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1082
                    \lower\sphinxshadowsize
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1083
                          \hbox{\vrule\@height\ht\@tempboxa \@width\dimen@}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1084
                    }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1085
              \kern-\dimen@ % shift back vertically to bottom of frame
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1086
              % and add shadow at bottom
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1087
              \moveright\sphinxshadowsize
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1088
                    \vbox{\hrule\@width\wd\@tempboxa \@height\dimen@}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1089
              }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1090
        % move left by the size of right shadow so shadow adds no width
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1091
        \kern-\sphinxshadowsize
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1092
       }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1093
  \endgroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1094
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1095
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1096
% use framed.sty to allow page breaks in frame+shadow
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1097
% works well inside Lists and Quote-like environments
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1098
% produced by ``topic'' directive (or local contents)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1099
% could nest if LaTeX writer authorized it
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1100
\newenvironment{sphinxShadowBox}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1101
  {\def\FrameCommand {\spx@ShadowFBox }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1102
   % configure framed.sty not to add extra vertical spacing
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1103
   \ltx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1104
   % the \trivlist will add the vertical spacing on top and bottom which is
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1105
   % typical of center environment as used in Sphinx <= 1.4.1
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1106
   % the \noindent has the effet of an extra blank line on top, to
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1107
   % imitate closely the layout from Sphinx <= 1.4.1; the \FrameHeightAdjust
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1108
   % will put top part of frame on this baseline.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1109
   \def\FrameHeightAdjust {\baselineskip}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1110
   % use package footnote to handle footnotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1111
   \savenotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1112
   \trivlist\item\noindent
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1113
    % use a minipage if we are already inside a framed environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1114
    \ifspx@inframed\begin{minipage}{\linewidth}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1115
    \MakeFramed {\spx@inframedtrue
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1116
    % framed.sty puts into "\width" the added width (=2shadowsep+2shadowrule)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1117
    % adjust \hsize to what the contents must use
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1118
    \advance\hsize-\width
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1119
    % adjust LaTeX parameters to behave properly in indented/quoted contexts
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1120
    \FrameRestore
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1121
    % typeset the contents as in a minipage (Sphinx <= 1.4.1 used a minipage and
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1122
    % itemize/enumerate are therein typeset more tightly, we want to keep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1123
    % that). We copy-paste from LaTeX source code but don't do a real minipage.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1124
    \@pboxswfalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1125
    \let\@listdepth\@mplistdepth \@mplistdepth\z@
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1126
    \@minipagerestore
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1127
    \@setminipage
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1128
    }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1129
  }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1130
  {% insert the "endminipage" code
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1131
    \par\unskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1132
    \@minipagefalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1133
   \endMakeFramed
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1134
     \ifspx@inframed\end{minipage}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1135
   \endtrivlist
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1136
   % output the stored footnotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1137
   \spewnotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1138
  }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1139
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1140
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1141
%% NOTICES AND ADMONITIONS
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1142
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1143
% Some are quite plain
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1144
% the spx@notice@bordercolor etc are set in the sphinxadmonition environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1145
\newenvironment{sphinxlightbox}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1146
  \par\allowbreak
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1147
  \noindent{\color{spx@notice@bordercolor}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1148
            \rule{\linewidth}{\spx@notice@border}}\par\nobreak
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1149
  {\parskip\z@skip\noindent}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1150
  }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1151
  {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1152
  \par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1153
  % counteract previous possible negative skip (French lists!):
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1154
  % (we can't cancel that any earlier \vskip introduced a potential pagebreak)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1155
  \ifdim\lastskip<\z@\vskip-\lastskip\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1156
  \nobreak\vbox{\noindent\kern\@totalleftmargin
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1157
      {\color{spx@notice@bordercolor}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1158
       \rule[\dimexpr.4\baselineskip-\spx@notice@border\relax]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1159
             {\linewidth}{\spx@notice@border}}\hss}\allowbreak
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1160
  }% end of sphinxlightbox environment definition
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1161
% may be renewenvironment'd by user for complete customization
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1162
\newenvironment{sphinxnote}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1163
  {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1164
\newenvironment{sphinxhint}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1165
  {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1166
\newenvironment{sphinximportant}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1167
  {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1168
\newenvironment{sphinxtip}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1169
  {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1170
% or just use the package options
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1171
% these are needed for common handling by notice environment of lightbox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1172
% and heavybox but they are  currently not used by lightbox environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1173
% and there is consequently no corresponding package option
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1174
\definecolor{sphinxnoteBgColor}{rgb}{1,1,1}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1175
\definecolor{sphinxhintBgColor}{rgb}{1,1,1}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1176
\definecolor{sphinximportantBgColor}{rgb}{1,1,1}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1177
\definecolor{sphinxtipBgColor}{rgb}{1,1,1}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1178
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1179
% Others get more distinction
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1180
% Code adapted from framed.sty's "snugshade" environment.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1181
% Nesting works (inner frames do not allow page breaks).
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1182
\newenvironment{sphinxheavybox}{\par
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1183
   \setlength{\FrameRule}{\spx@notice@border}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1184
   \setlength{\FrameSep}{\dimexpr.6\baselineskip-\FrameRule\relax}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1185
   % configure framed.sty's parameters to obtain same vertical spacing
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1186
   % as for "light" boxes. We need for this to manually insert parskip glue and
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1187
   % revert a skip done by framed before the frame.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1188
    \ltx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1189
    \vspace{\FrameHeightAdjust}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1190
   % copied/adapted from framed.sty's snugshade
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1191
   \def\FrameCommand##1{\hskip\@totalleftmargin
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1192
       \fboxsep\FrameSep \fboxrule\FrameRule
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1193
       \fcolorbox{spx@notice@bordercolor}{spx@notice@bgcolor}{##1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1194
       \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1195
   \savenotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1196
   % use a minipage if we are already inside a framed environment
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1197
   \ifspx@inframed
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1198
       \noindent\begin{minipage}{\linewidth}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1199
   \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1200
       % handle case where notice is first thing in a list item (or is quoted)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1201
       \if@inlabel
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1202
        \noindent\par\vspace{-\baselineskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1203
       \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1204
        \vspace{\parskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1205
       \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1206
   \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1207
   \MakeFramed {\spx@inframedtrue
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1208
     \advance\hsize-\width \@totalleftmargin\z@ \linewidth\hsize
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1209
     % minipage initialization copied from LaTeX source code.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1210
     \@pboxswfalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1211
     \let\@listdepth\@mplistdepth \@mplistdepth\z@
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1212
     \@minipagerestore
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1213
     \@setminipage }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1214
   }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1215
   {%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1216
   \par\unskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1217
   \@minipagefalse
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1218
   \endMakeFramed
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1219
   \ifspx@inframed\end{minipage}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1220
   % set footnotes at bottom of page
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1221
   \spewnotes
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1222
   % arrange for similar spacing below frame as for "light" boxes.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1223
   \vskip .4\baselineskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1224
   }% end of sphinxheavybox environment definition
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1225
% may be renewenvironment'd by user for complete customization
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1226
\newenvironment{sphinxwarning}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1227
  {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1228
\newenvironment{sphinxcaution}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1229
  {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1230
\newenvironment{sphinxattention}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1231
  {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1232
\newenvironment{sphinxdanger}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1233
  {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1234
\newenvironment{sphinxerror}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1235
  {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1236
% or just use package options
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1237
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1238
% the \colorlet of xcolor (if at all loaded) is overkill for our use case
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1239
\newcommand{\sphinxcolorlet}[2]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1240
    {\expandafter\let\csname\@backslashchar color@#1\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1241
                     \csname\@backslashchar color@#2\endcsname }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1242
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1243
% the main dispatch for all types of notices
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1244
\newenvironment{sphinxadmonition}[2]{% #1=type, #2=heading
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1245
  % can't use #1 directly in definition of end part
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1246
  \def\spx@noticetype {#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1247
  % set parameters of heavybox/lightbox
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1248
  \sphinxcolorlet{spx@notice@bordercolor}{sphinx#1BorderColor}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1249
  \sphinxcolorlet{spx@notice@bgcolor}{sphinx#1BgColor}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1250
  \spx@notice@border \dimexpr\csname spx@opt@#1border\endcsname\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1251
  % start specific environment, passing the heading as argument
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1252
  \begin{sphinx#1}{#2}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1253
  % workaround some LaTeX "feature" of \end command
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1254
 {\edef\spx@temp{\noexpand\end{sphinx\spx@noticetype}}\spx@temp}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1255
% use of ``notice'' is for backwards compatibility and will be removed in
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1256
% Sphinx 1.7.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1257
\newenvironment{notice}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1258
  {\sphinxdeprecationwarning {notice}{1.6}{1.7}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1259
  This document was probably built with a Sphinx extension using ``notice''^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1260
  environment. At Sphinx 1.7, ``notice'' environment will be removed. Please^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1261
  report to extension author to use ``sphinxadmonition'' instead.^^J%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1262
  ****}\begin{sphinxadmonition}}{\end{sphinxadmonition}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1263
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1264
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1265
%% PYTHON DOCS MACROS AND ENVIRONMENTS
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1266
%  (some macros here used by \maketitle in sphinxmanual.cls and sphinxhowto.cls)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1267
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1268
% \moduleauthor{name}{email}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1269
\newcommand{\moduleauthor}[2]{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1270
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1271
% \sectionauthor{name}{email}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1272
\newcommand{\sectionauthor}[2]{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1273
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1274
% Allow the release number to be specified independently of the
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1275
% \date{}.  This allows the date to reflect the document's date and
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1276
% release to specify the release that is documented.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1277
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1278
\newcommand{\py@release}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1279
\newcommand{\version}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1280
\newcommand{\shortversion}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1281
\newcommand{\releaseinfo}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1282
\newcommand{\releasename}{Release}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1283
\newcommand{\release}[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1284
  \renewcommand{\py@release}{\releasename\space\version}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1285
  \renewcommand{\version}{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1286
\newcommand{\setshortversion}[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1287
  \renewcommand{\shortversion}{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1288
\newcommand{\setreleaseinfo}[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1289
  \renewcommand{\releaseinfo}{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1290
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1291
% Allow specification of the author's address separately from the
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1292
% author's name.  This can be used to format them differently, which
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1293
% is a good thing.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1294
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1295
\newcommand{\py@authoraddress}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1296
\newcommand{\authoraddress}[1]{\renewcommand{\py@authoraddress}{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1297
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1298
% {fulllineitems} is the main environment for object descriptions.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1299
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1300
\newcommand{\py@itemnewline}[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1301
  \kern\labelsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1302
  \@tempdima\linewidth
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1303
  \advance\@tempdima \labelwidth\makebox[\@tempdima][l]{#1}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1304
  \kern-\labelsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1305
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1306
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1307
\newenvironment{fulllineitems}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1308
  \begin{list}{}{\labelwidth \leftmargin
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1309
                 \rightmargin \z@ \topsep -\parskip \partopsep \parskip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1310
                 \itemsep -\parsep
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1311
                 \let\makelabel=\py@itemnewline}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1312
}{\end{list}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1313
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1314
% Signatures, possibly multi-line
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1315
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1316
\newlength{\py@argswidth}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1317
\newcommand{\py@sigparams}[2]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1318
  \parbox[t]{\py@argswidth}{#1\sphinxcode{)}#2}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1319
\newcommand{\pysigline}[1]{\item[{#1}]}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1320
\newcommand{\pysiglinewithargsret}[3]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1321
  \settowidth{\py@argswidth}{#1\sphinxcode{(}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1322
  \addtolength{\py@argswidth}{-2\py@argswidth}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1323
  \addtolength{\py@argswidth}{\linewidth}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1324
  \item[{#1\sphinxcode{(}\py@sigparams{#2}{#3}}]}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1325
\newcommand{\pysigstartmultiline}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1326
 \def\pysigstartmultiline{\vskip\smallskipamount\parskip\z@skip\itemsep\z@skip}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1327
 \edef\pysigstopmultiline
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1328
     {\noexpand\leavevmode\parskip\the\parskip\relax\itemsep\the\itemsep\relax}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1329
 \parskip\z@skip\itemsep\z@skip
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1330
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1331
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1332
% Production lists
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1333
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1334
\newenvironment{productionlist}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1335
%  \def\sphinxoptional##1{{\Large[}##1{\Large]}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1336
  \def\production##1##2{\\\sphinxcode{##1}&::=&\sphinxcode{##2}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1337
  \def\productioncont##1{\\& &\sphinxcode{##1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1338
  \parindent=2em
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1339
  \indent
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1340
  \setlength{\LTpre}{0pt}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1341
  \setlength{\LTpost}{0pt}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1342
  \begin{longtable}[l]{lcl}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1343
}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1344
  \end{longtable}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1345
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1346
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1347
% Definition lists; requested by AMK for HOWTO documents.  Probably useful
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1348
% elsewhere as well, so keep in in the general style support.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1349
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1350
\newenvironment{definitions}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1351
  \begin{description}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1352
  \def\term##1{\item[{##1}]\mbox{}\\*[0mm]}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1353
}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1354
  \end{description}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1355
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1356
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1357
%% FROM DOCTUTILS LATEX WRITER
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1358
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1359
% The following is stuff copied from docutils' latex writer.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1360
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1361
\newcommand{\optionlistlabel}[1]{\normalfont\bfseries #1 \hfill}% \bf deprecated
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1362
\newenvironment{optionlist}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1363
{\begin{list}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1364
  {\setlength{\labelwidth}{#1}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1365
   \setlength{\rightmargin}{1cm}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1366
   \setlength{\leftmargin}{\rightmargin}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1367
   \addtolength{\leftmargin}{\labelwidth}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1368
   \addtolength{\leftmargin}{\labelsep}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1369
   \renewcommand{\makelabel}{\optionlistlabel}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1370
}{\end{list}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1371
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1372
\newlength{\lineblockindentation}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1373
\setlength{\lineblockindentation}{2.5em}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1374
\newenvironment{lineblock}[1]
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1375
{\begin{list}{}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1376
  {\setlength{\partopsep}{\parskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1377
   \addtolength{\partopsep}{\baselineskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1378
   \topsep0pt\itemsep0.15\baselineskip\parsep0pt
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1379
   \leftmargin#1\relax}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1380
 \raggedright}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1381
{\end{list}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1382
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1383
% From docutils.writers.latex2e
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1384
% inline markup (custom roles)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1385
% \DUrole{#1}{#2} tries \DUrole#1{#2}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1386
\providecommand*{\DUrole}[2]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1387
  \ifcsname DUrole\detokenize{#1}\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1388
    \csname DUrole\detokenize{#1}\endcsname{#2}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1389
  \else% backwards compatibility: try \docutilsrole#1{#2}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1390
    \ifcsname docutilsrole\detokenize{#1}\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1391
      \csname docutilsrole\detokenize{#1}\endcsname{#2}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1392
    \else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1393
      #2%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1394
    \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1395
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1396
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1397
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1398
\providecommand*{\DUprovidelength}[2]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1399
  \ifdefined#1\else\newlength{#1}\setlength{#1}{#2}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1400
}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1401
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1402
\DUprovidelength{\DUlineblockindent}{2.5em}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1403
\ifdefined\DUlineblock\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1404
  \newenvironment{DUlineblock}[1]{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1405
    \list{}{\setlength{\partopsep}{\parskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1406
            \addtolength{\partopsep}{\baselineskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1407
            \setlength{\topsep}{0pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1408
            \setlength{\itemsep}{0.15\baselineskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1409
            \setlength{\parsep}{0pt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1410
            \setlength{\leftmargin}{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1411
    \raggedright
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1412
  }
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1413
  {\endlist}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1414
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1415
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1416
%% TEXT STYLING
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1417
%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1418
% Some custom font markup commands.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1419
% *** the macros without \sphinx prefix are still defined farther down ***
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1420
\protected\def\sphinxstrong#1{{\textbf{#1}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1421
% to obtain straight quotes we execute \@noligs as patched by upquote, and
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1422
% \scantokens is needed in cases where it would be too late for the macro to
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1423
% first set catcodes and then fetch its argument. We also make the contents
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1424
% breakable at non-escaped . , ; ? ! / using \sphinxbreaksviaactive.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1425
% the macro must be protected if it ends up used in moving arguments,
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1426
% in 'alltt' \@noligs is done already, and the \scantokens must be avoided.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1427
\protected\def\sphinxcode#1{{\def\@tempa{alltt}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1428
  \ifx\@tempa\@currenvir\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1429
   \ifspx@opt@inlineliteralwraps
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1430
      \sphinxbreaksviaactive\let\sphinxafterbreak\empty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1431
      % do not overwrite the comma set-up
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1432
      \let\verbatim@nolig@list\sphinx@literal@nolig@list
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1433
   \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1434
   % fix a space-gobbling issue due to LaTeX's original \do@noligs
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1435
   \let\do@noligs\sphinx@do@noligs
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1436
   \@noligs\endlinechar\m@ne\everyeof{}% (<- in case inside \sphinxhref)
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1437
   \expandafter\scantokens
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1438
  \fi {\texttt{#1}}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1439
\def\sphinx@do@noligs #1{\catcode`#1\active\begingroup\lccode`\~`#1\relax
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1440
    \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1 }}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1441
\def\sphinx@literal@nolig@list {\do\`\do\<\do\>\do\'\do\-}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1442
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1443
\protected\def\sphinxbfcode#1{\sphinxcode{\bfseries{}#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1444
\protected\def\sphinxemail#1{\textsf{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1445
\protected\def\sphinxtablecontinued#1{\textsf{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1446
\protected\def\sphinxtitleref#1{\emph{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1447
\protected\def\sphinxmenuselection#1{\emph{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1448
\protected\def\sphinxaccelerator#1{\underline{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1449
\protected\def\sphinxcrossref#1{\emph{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1450
\protected\def\sphinxtermref#1{\emph{#1}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1451
% \optional is used for ``[, arg]``, i.e. desc_optional nodes.
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1452
\long\protected\def\sphinxoptional#1{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1453
  {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1454
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1455
\ifspx@opt@dontkeepoldnames\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1456
  \let\spx@alreadydefinedlist\@empty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1457
  \typeout{** (sphinx) defining (legacy) text style macros without \string\sphinx\space prefix}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1458
  \typeout{** if clashes with packages, do not set latex_keep_old_macro_names=True
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1459
    in conf.py}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1460
  \@for\@tempa:=code,strong,bfcode,email,tablecontinued,titleref,%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1461
                menuselection,accelerator,crossref,termref,optional\do
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1462
 {% first, check if command with no prefix already exists
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1463
  \ltx@ifundefined{\@tempa}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1464
  % give it the meaning defined so far with \sphinx prefix
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1465
  \expandafter\let\csname\@tempa\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1466
                  \csname sphinx\@tempa\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1467
  % redefine the \sphinx prefixed macro to expand to non-prefixed one
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1468
  \expandafter\def\csname sphinx\@tempa\expandafter\endcsname
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1469
                  \expandafter{\csname\@tempa\endcsname}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1470
  }{\edef\spx@alreadydefinedlist{\spx@alreadydefinedlist{\@tempa}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1471
 }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1472
  \ifx\spx@alreadydefinedlist\@empty\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1473
    \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\spx@alreadydefinedlist\do
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1474
    {% emit warning now
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1475
     \PackageWarning{sphinx}{not redefining already existing \@backslashchar\@tempa\space!^^J%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1476
        Anyhow, Sphinx mark-up uses only \string\sphinx\@tempa.}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1477
     % and also at end of log for better visibility
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1478
     \expandafter\sphinxdeprecationwarning\expandafter{\csname\@tempa\endcsname}{1.6}{1.7}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1479
       {\sphinxdeprecatedmacro already existed at Sphinx loading time! Not redefined!^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1480
         Sphinx mark-up uses only \string\sphinx\expandafter\@gobble\sphinxdeprecatedmacro.^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1481
         Note: if this warning is about macro \string\strong, it presumably results^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1482
         from fontspec 2.6 having defined it prior to Sphinx. No need for alarm!}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1483
    }%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1484
  \fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1485
  \sphinxdeprecationwarning{latex_keep_old_macro_names=True}{1.6}{1.7}{}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1486
\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1487
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1488
% additional customizable styling
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1489
% FIXME: convert this to package options ?
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1490
\protected\def\sphinxstyleindexentry     {\texttt}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1491
\protected\def\sphinxstyleindexextra #1{ \emph{(#1)}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1492
\protected\def\sphinxstyleindexpageref   {, \pageref}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1493
\protected\def\sphinxstyletopictitle #1{\textbf{#1}\par\medskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1494
\let\sphinxstylesidebartitle\sphinxstyletopictitle
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1495
\protected\def\sphinxstyleothertitle     {\textbf}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1496
\protected\def\sphinxstylesidebarsubtitle #1{~\\\textbf{#1} \smallskip}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1497
% \text.. commands do not allow multiple paragraphs
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1498
\let\sphinxstylethead\empty
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1499
\protected\def\sphinxstyletheadfamily {\ifx\sphinxstylethead\empty\sffamily\fi}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1500
\AtBeginDocument{\ifx\sphinxstylethead\empty\else
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1501
\sphinxdeprecationwarning{\sphinxstylethead}{1.6}{1.7}{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1502
    \string\sphinxstyletheadfamily\space replaces it
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1503
    (it defaults to \string\sffamily) to allow use^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1504
    with multiple paragraphs. Backwards compatibility is maintained, but please^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1505
    move customization into \string\sphinxstyletheadfamily\space
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1506
    in time for 1.7.^^J
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1507
    And if you do it now, you will spare yourself this warning!}\fi}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1508
\protected\def\sphinxstyleemphasis       {\emph}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1509
\protected\def\sphinxstyleliteralemphasis#1{\emph{\sphinxcode{#1}}}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1510
\protected\def\sphinxstylestrong         {\textbf}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1511
\protected\def\sphinxstyleliteralstrong  {\sphinxbfcode}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1512
\protected\def\sphinxstyleabbreviation   {\textsc}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1513
\protected\def\sphinxstyleliteralintitle {\sphinxcode}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1514
\newcommand*\sphinxstylecodecontinued[1]{\footnotesize(#1)}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1515
\newcommand*\sphinxstylecodecontinues[1]{\footnotesize(#1)}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1516
% figure legend comes after caption and may contain arbitrary body elements
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1517
\newenvironment{sphinxlegend}{\par\small}{\par}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1518
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1519
% Declare Unicode characters used by linux tree command to pdflatex utf8/utf8x
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1520
\def\spx@bd#1#2{%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1521
  \leavevmode
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1522
  \begingroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1523
  \ifx\spx@bd@height   \@undefined\def\spx@bd@height{\baselineskip}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1524
  \ifx\spx@bd@width    \@undefined\setbox0\hbox{0}\def\spx@bd@width{\wd0 }\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1525
  \ifx\spx@bd@thickness\@undefined\def\spx@bd@thickness{.6\p@}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1526
  \ifx\spx@bd@lower    \@undefined\def\spx@bd@lower{\dp\strutbox}\fi
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1527
  \lower\spx@bd@lower#1{#2}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1528
  \endgroup
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1529
}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1530
\@namedef{sphinx@u2500}% BOX DRAWINGS LIGHT HORIZONTAL
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1531
  {\spx@bd{\vbox to\spx@bd@height}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1532
          {\vss\hrule\@height\spx@bd@thickness
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1533
                     \@width\spx@bd@width\vss}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1534
\@namedef{sphinx@u2502}% BOX DRAWINGS LIGHT VERTICAL
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1535
  {\spx@bd{\hb@xt@\spx@bd@width}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1536
          {\hss\vrule\@height\spx@bd@height
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1537
                     \@width \spx@bd@thickness\hss}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1538
\@namedef{sphinx@u2514}% BOX DRAWINGS LIGHT UP AND RIGHT
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1539
  {\spx@bd{\hb@xt@\spx@bd@width}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1540
          {\hss\raise.5\spx@bd@height
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1541
           \hb@xt@\z@{\hss\vrule\@height.5\spx@bd@height
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1542
                                \@width \spx@bd@thickness\hss}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1543
           \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1544
                                            \@width.5\spx@bd@width\vss}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1545
\@namedef{sphinx@u251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1546
  {\spx@bd{\hb@xt@\spx@bd@width}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1547
          {\hss
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1548
           \hb@xt@\z@{\hss\vrule\@height\spx@bd@height
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1549
                                \@width \spx@bd@thickness\hss}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1550
           \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1551
                                            \@width.5\spx@bd@width\vss}}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1552
\protected\def\sphinxunichar#1{\@nameuse{sphinx@u#1}}%
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1553
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1554
% Tell TeX about pathological hyphenation cases:
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1555
\hyphenation{Base-HTTP-Re-quest-Hand-ler}
b71be85a294c Initial commit of labfolder at FHI documentation
weiher
parents:
diff changeset
  1556
\endinput