1. Georg Brandl
  2. sphinx

Commits

georg.brandl  committed 6290d53

Include hyperref as the last package. Fixes #4027.

  • Participants
  • Parent commits 2bd66fd
  • Branches default

Comments (0)

Files changed (5)

File CHANGES

View file
 * Update to newest fncychap.sty, to fix problems with non-ASCII
   characters at the start of chapter titles.
 
+* Fix a problem with index generation in LaTeX output, caused by
+  hyperref not being included last.
+
 
 Release 0.4.3 (Oct 8, 2008)
 ===========================

File sphinx/latexwriter.py

View file
 %(babel)s
 %(fontpkg)s
 %(fncychap)s
+\usepackage{sphinx}
 %(preamble)s
 
 \title{%(title)s}

File sphinx/texinputs/howto.cls

View file
 %
 
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{howto}[2008/09/12 Document class (Sphinx HOWTO)]
-
-\RequirePackage{fancybox}
+\ProvidesClass{howto}[2008/10/18 Document class (Sphinx HOWTO)]
 
 % Pass all given class options to the parent class.
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
 %
 \setcounter{secnumdepth}{2}
 
-% This gives us all the Python-specific markup that we really want.  This should
-% come last.  Do not change this.
-%
-\RequirePackage{sphinx}
-
-% This comes after python.sty because it otherwise defines its own "seealso"
-% command.
-%
-\RequirePackage{makeidx}
-
-
 % Change the title page to look a bit better, and fit in with the fncychap
 % ``Bjarne'' style a bit better.
 %
   %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
 }
 
-
 \let\py@OldTableofcontents=\tableofcontents
 \renewcommand{\tableofcontents}{
   \begingroup

File sphinx/texinputs/manual.cls

View file
 %
 
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{manual}[2008/09/12 Document class (Sphinx manual)]
-
-\RequirePackage{fancybox}
+\ProvidesClass{manual}[2008/10/18 Document class (Sphinx manual)]
 
 % Pass all given class options to the parent class.
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
 \setcounter{secnumdepth}{2}
 \setcounter{tocdepth}{1}
 
-% This gives us all the Sphinx-specific markup that we really want.  This should
-% come last.  Do not change this.
-%
-\RequirePackage{sphinx}
-
-% This comes after sphinx.sty because it otherwise defines its own "seealso"
-% command.
-%
-\RequirePackage{makeidx}
-
-
 % Change the title page to look a bit better, and fit in with the fncychap
 % ``Bjarne'' style a bit better.
 %
   \py@OldEndAbstract
 }
 
-
 % This wraps the \tableofcontents macro with all the magic to get the spacing
 % right and have the right number of pages if the 'openright' option has been
 % used.  This eliminates a fair amount of crud in the individual document files.
   \@ifundefined{fancyhf}{}{\pagestyle{normal}}%
 }
 
-
 % This is needed to get the width of the section # area wide enough in the
 % library reference.  Doing it here keeps it the same for all the manuals.
 %
 \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}
 \renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}
 
-
 % Fix the theindex environment to add an entry to the Table of Contents; this is
 % much nicer than just having to jump to the end of the book and flip around,
 % especially with multiple indexes.

File sphinx/texinputs/sphinx.sty

View file
 \RequirePackage{textcomp}
 \RequirePackage{fancyvrb}
 \RequirePackage{fancyhdr}
+\RequirePackage{fancybox}
 \RequirePackage{titlesec}
 \RequirePackage{tabulary}
 \RequirePackage{amsmath} % for \text
+\RequirePackage{makeidx}
+\RequirePackage{framed}
+\RequirePackage{color}
 
-\RequirePackage{color}
 % Redefine these colors to your liking in the preamble.
 \definecolor{TitleColor}{rgb}{0.126,0.263,0.361}
 \definecolor{InnerLinkColor}{rgb}{0.208,0.374,0.486}
 \definecolor{VerbatimColor}{rgb}{1,1,1}
 \definecolor{VerbatimBorderColor}{rgb}{1,1,1}
 
-\RequirePackage[colorlinks,
-		breaklinks,
-		linkcolor=InnerLinkColor,
-		filecolor=OuterLinkColor,
-		menucolor=OuterLinkColor,
-		pagecolor=OuterLinkColor,
-		urlcolor=OuterLinkColor,
-	       ]{hyperref}
-
-\RequirePackage{framed}
-
 % Uncomment these two lines to ignore the paper size and make the page 
 % size more like a typical published manual.
 %\renewcommand{\paperheight}{9in}
 % Use this to set the font family for headers and other decor:
 \newcommand{\py@HeaderFamily}{\sffamily\bfseries}
 
-% Set up abstract ways to get the normal and smaller font sizes that
-% work even in footnote context.
-\newif\ifpy@infootnote \py@infootnotefalse
-\let\py@oldmakefntext\@makefntext
-\renewcommand{\@makefntext}[1]{%
-  \begingroup%
-    \py@infootnotetrue
-    \py@oldmakefntext{#1}%
-  \endgroup%
-}
-\def\py@defaultsize{%
-  \ifpy@infootnote\footnotesize\else\normalsize\fi%
-}
-\def\py@smallsize{%
-  \ifpy@infootnote\scriptsize\else\small\fi%
-}
-
 % Redefine the 'normal' header/footer style when using "fancyhdr" package:
 \@ifundefined{fancyhf}{}{
   % Use \pagestyle{normal} as the primary pagestyle for text.
 \newcommand{\code}[1]{\texttt{#1}}
 \newcommand{\bfcode}[1]{\code{\bfseries#1}}
 \newcommand{\samp}[1]{`\code{#1}'}
-\newcommand{\email}[1]{{\py@smallsize\textsf{#1}}}
+\newcommand{\email}[1]{\textsf{#1}}
 
 \newcommand{\py@modulebadkey}{{--just-some-junk--}}
 
 \let\OriginalVerbatim=\Verbatim
 \let\endOriginalVerbatim=\endVerbatim
 
-% Play with vpsace to be able to keep the indentation.
+% Play with vspace to be able to keep the indentation.
 \newlength\distancetoright
 \newlength\leftsidespace
 \def\mycolorbox#1{%
     \py@Oldincludegraphics[#1]{#2}%
   \fi%
 }
+
+
+% Include hyperref last.
+\RequirePackage[colorlinks,breaklinks,
+                linkcolor=InnerLinkColor,filecolor=OuterLinkColor,
+                menucolor=OuterLinkColor,pagecolor=OuterLinkColor,
+                urlcolor=OuterLinkColor]{hyperref}