diff options
Diffstat (limited to 'sphinx/texinputs/sphinxhowto.cls')
-rw-r--r-- | sphinx/texinputs/sphinxhowto.cls | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/sphinx/texinputs/sphinxhowto.cls b/sphinx/texinputs/sphinxhowto.cls index 8d5c59232..3e34063ef 100644 --- a/sphinx/texinputs/sphinxhowto.cls +++ b/sphinx/texinputs/sphinxhowto.cls @@ -3,13 +3,7 @@ % \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesClass{sphinxhowto}[2009/06/02 Document class (Sphinx HOWTO)] - -\ifx\directlua\undefined\else -% if compiling with lualatex 0.85 or later load compatibility patch issued by -% the LaTeX team for older packages relying on \pdf<name> named primitives. - \IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{} -\fi +\ProvidesClass{sphinxhowto}[2016/10/12 v1.5 Document class (Sphinx HOWTO)] % 'oneside' option overriding the 'twoside' default \newif\if@oneside @@ -70,11 +64,10 @@ %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} } -\let\py@OldTableofcontents=\tableofcontents -\renewcommand{\tableofcontents}{ +\newcommand{\sphinxtableofcontents}{ \begingroup \parskip = 0mm - \py@OldTableofcontents + \tableofcontents \endgroup \rule{\textwidth}{1pt} \vspace{12pt} @@ -91,21 +84,21 @@ % Contents. % For an article document class this environment is a section, % so no page break before it. -\let\py@OldThebibliography=\thebibliography -\renewcommand{\thebibliography}[1]{ +% +% Note: \phantomsection is required for TeXLive 2009 +% http://tex.stackexchange.com/questions/44088/when-do-i-need-to-invoke-phantomsection#comment166081_44091 +\newenvironment{sphinxthebibliography}[1]{% \phantomsection - \py@OldThebibliography{1} - \addcontentsline{toc}{section}{\bibname} -} + \begin{thebibliography}{1}% + \addcontentsline{toc}{section}{\ifdefined\refname\refname\else\ifdefined\bibname\bibname\fi\fi}}{\end{thebibliography}} + % Same for the indices. % The memoir class already does this, so we don't duplicate it in that case. % -\@ifclassloaded{memoir}{}{ - \let\py@OldTheindex=\theindex - \renewcommand{\theindex}{ +\@ifclassloaded{memoir} + {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}} + {\newenvironment{sphinxtheindex}{% \phantomsection - \py@OldTheindex - \addcontentsline{toc}{section}{\indexname} - } -} + \begin{theindex}% + \addcontentsline{toc}{section}{\indexname}}{\end{theindex}}} |