Closes #995: Fix table-of-contents and page numbering for the LaTeX "howto" class.

This commit is contained in:
Georg Brandl 2013-03-30 14:00:43 +01:00
parent c18479a772
commit 44d1f1e952
4 changed files with 28 additions and 23 deletions

View File

@ -194,6 +194,7 @@ Bugs fixed
* #1015: Stop overriding jQuery contains() in the JavaScript.
* #1010: Make pngmath images transparent by default; IE7+ should handle it.
* #1008: Fix test failures with Python 3.3.
* #995: Fix table-of-contents and page numbering for the LaTeX "howto" class.
* #976: Fix gettext does not extract index entries.
* PR#72: #975: Fix gettext not extracting definition terms before docutils 0.10.
* #961: Fix LaTeX output for triple quotes in code snippets.

View File

@ -102,8 +102,7 @@
\sloppy
\hbadness = 5000 % don't print trivial gripes
\pagestyle{empty} % start this way; change for
\pagenumbering{roman} % ToC & chapters
\pagestyle{empty} % start this way
% Use this to set the font family for headers and other decor:
\newcommand{\py@HeaderFamily}{\sffamily\bfseries}
@ -413,27 +412,6 @@
\fi%
}
% Fix the index 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.
% The memoir class already does this, so we don't duplicate it in that case.
%
% A similiar fix must be done to the bibliography environment, although
% dependant on document class. In particular, the '\addcontentsline' command
% should use 'chapter' for a report and 'section' for an article.
% See sphinxmanual.cls and sphinxhowto.cls for specific fixes.
%
\@ifclassloaded{memoir}{}{
\let\py@OldTheindex=\theindex
\renewcommand{\theindex}{
\cleardoublepage
\phantomsection
\py@OldTheindex
\addcontentsline{toc}{chapter}{\indexname}
}
}
% to make pdf with correct encoded bookmarks in Japanese
% this should precede the hyperref package
\ifx\kanjiskip\undefined\else

View File

@ -90,3 +90,15 @@
\py@OldThebibliography{1}
\addcontentsline{toc}{section}{\bibname}
}
% 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}{
\phantomsection
\py@OldTheindex
\addcontentsline{toc}{section}{\indexname}
}
}

View File

@ -114,6 +114,7 @@
\pagenumbering{arabic}%
\@ifundefined{fancyhf}{}{\pagestyle{normal}}%
}
\pagenumbering{roman}
% 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.
@ -131,3 +132,16 @@
\py@OldThebibliography{1}
\addcontentsline{toc}{chapter}{\bibname}
}
% 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}{
\cleardoublepage
\phantomsection
\py@OldTheindex
\addcontentsline{toc}{chapter}{\indexname}
}
}