summaryrefslogtreecommitdiff
path: root/sphinx/texinputs
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-10-28 18:06:53 +0100
committerGeorg Brandl <georg@python.org>2012-10-28 18:06:53 +0100
commitc33387e8816abb9f513733b704b029229b6c562d (patch)
treebe5e93c616be21345eeaecbe5c0453eb6eb022a6 /sphinx/texinputs
parent37fb2785f646d91ab4300b9e1791083160b700b2 (diff)
parent31394e589aac73387bbf6c3ae3103be2c78a947b (diff)
downloadsphinx-c33387e8816abb9f513733b704b029229b6c562d.tar.gz
Merged in klukas/sphinx/memoir (pull request #67)
Diffstat (limited to 'sphinx/texinputs')
-rw-r--r--sphinx/texinputs/sphinx.sty18
1 files changed, 11 insertions, 7 deletions
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index 5a422677..c9d3e100 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -8,8 +8,9 @@
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sphinx}[2010/01/15 LaTeX package (Sphinx markup)]
+\@ifclassloaded{memoir}{}{\RequirePackage{fancyhdr}}
+
\RequirePackage{textcomp}
-\RequirePackage{fancyhdr}
\RequirePackage{fancybox}
\RequirePackage{titlesec}
\RequirePackage{tabulary}
@@ -416,18 +417,21 @@
% 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.
%
-\let\py@OldTheindex=\theindex
-\renewcommand{\theindex}{
- \cleardoublepage
- \phantomsection
- \py@OldTheindex
- \addcontentsline{toc}{chapter}{\indexname}
+\@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