[Python-checkins] r66955 - in doctools/trunk: CHANGES sphinx/latexwriter.py sphinx/texinputs/howto.cls sphinx/texinputs/manual.cls sphinx/texinputs/sphinx.sty
georg.brandl
python-checkins at python.org
Fri Oct 17 13:24:43 CEST 2008
Author: georg.brandl
Date: Fri Oct 17 13:24:43 2008
New Revision: 66955
Log:
Include hyperref as the last package. Fixes #4027.
Modified:
doctools/trunk/CHANGES
doctools/trunk/sphinx/latexwriter.py
doctools/trunk/sphinx/texinputs/howto.cls
doctools/trunk/sphinx/texinputs/manual.cls
doctools/trunk/sphinx/texinputs/sphinx.sty
Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES (original)
+++ doctools/trunk/CHANGES Fri Oct 17 13:24:43 2008
@@ -125,6 +125,9 @@
* 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)
===========================
Modified: doctools/trunk/sphinx/latexwriter.py
==============================================================================
--- doctools/trunk/sphinx/latexwriter.py (original)
+++ doctools/trunk/sphinx/latexwriter.py Fri Oct 17 13:24:43 2008
@@ -33,6 +33,7 @@
%(babel)s
%(fontpkg)s
%(fncychap)s
+\usepackage{sphinx}
%(preamble)s
\title{%(title)s}
Modified: doctools/trunk/sphinx/texinputs/howto.cls
==============================================================================
--- doctools/trunk/sphinx/texinputs/howto.cls (original)
+++ doctools/trunk/sphinx/texinputs/howto.cls Fri Oct 17 13:24:43 2008
@@ -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 at OldTableofcontents=\tableofcontents
\renewcommand{\tableofcontents}{
\begingroup
Modified: doctools/trunk/sphinx/texinputs/manual.cls
==============================================================================
--- doctools/trunk/sphinx/texinputs/manual.cls (original)
+++ doctools/trunk/sphinx/texinputs/manual.cls Fri Oct 17 13:24:43 2008
@@ -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 at 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 at section{\@dottedtocline{1}{1.5em}{2.6em}}
\renewcommand*\l at 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.
Modified: doctools/trunk/sphinx/texinputs/sphinx.sty
==============================================================================
--- doctools/trunk/sphinx/texinputs/sphinx.sty (original)
+++ doctools/trunk/sphinx/texinputs/sphinx.sty Fri Oct 17 13:24:43 2008
@@ -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 at HeaderFamily}{\sffamily\bfseries}
-% Set up abstract ways to get the normal and smaller font sizes that
-% work even in footnote context.
-\newif\ifpy at infootnote \py at infootnotefalse
-\let\py at oldmakefntext\@makefntext
-\renewcommand{\@makefntext}[1]{%
- \begingroup%
- \py at infootnotetrue
- \py at oldmakefntext{#1}%
- \endgroup%
-}
-\def\py at defaultsize{%
- \ifpy at infootnote\footnotesize\else\normalsize\fi%
-}
-\def\py at smallsize{%
- \ifpy at 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 at smallsize\textsf{#1}}}
+\newcommand{\email}[1]{\textsf{#1}}
\newcommand{\py at 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 at Oldincludegraphics[#1]{#2}%
\fi%
}
+
+
+% Include hyperref last.
+\RequirePackage[colorlinks,breaklinks,
+ linkcolor=InnerLinkColor,filecolor=OuterLinkColor,
+ menucolor=OuterLinkColor,pagecolor=OuterLinkColor,
+ urlcolor=OuterLinkColor]{hyperref}
More information about the Python-checkins
mailing list