Include hyperref as the last package. Fixes #4027.

This commit is contained in:
Georg Brandl 2008-10-17 11:24:43 +00:00
parent 7f6c5310d4
commit 884eb05a78
5 changed files with 19 additions and 63 deletions

View File

@ -125,6 +125,9 @@ Bugs fixed
* 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)
===========================

View File

@ -33,6 +33,7 @@ HEADER = r'''%% Generated by Sphinx.
%(babel)s
%(fontpkg)s
%(fncychap)s
\usepackage{sphinx}
%(preamble)s
\title{%(title)s}

View File

@ -3,9 +3,7 @@
%
\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}}
@ -17,17 +15,6 @@
%
\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.
%
@ -61,7 +48,6 @@
%\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
}
\let\py@OldTableofcontents=\tableofcontents
\renewcommand{\tableofcontents}{
\begingroup

View File

@ -3,9 +3,7 @@
%
\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}}
@ -18,17 +16,6 @@
\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.
%
@ -85,7 +72,6 @@
\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.
@ -110,14 +96,12 @@
\@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.

View File

@ -11,11 +11,14 @@
\RequirePackage{textcomp}
\RequirePackage{fancyvrb}
\RequirePackage{fancyhdr}
\RequirePackage{fancybox}
\RequirePackage{titlesec}
\RequirePackage{tabulary}
\RequirePackage{amsmath} % for \text
\RequirePackage{makeidx}
\RequirePackage{framed}
\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}
@ -25,17 +28,6 @@
\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}
@ -98,23 +90,6 @@
% 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.
@ -144,7 +119,7 @@
\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--}}
@ -153,7 +128,7 @@
\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{%
@ -703,3 +678,10 @@
\py@Oldincludegraphics[#1]{#2}%
\fi%
}
% Include hyperref last.
\RequirePackage[colorlinks,breaklinks,
linkcolor=InnerLinkColor,filecolor=OuterLinkColor,
menucolor=OuterLinkColor,pagecolor=OuterLinkColor,
urlcolor=OuterLinkColor]{hyperref}