Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d579ed8

Browse files
committed
Shift (re-)definition of \theindex to the document classes so that it doesn't
break HOWTO documents.
1 parent 300775d commit d579ed8

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

Doc/texinputs/howto.cls

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@
8282
\@doing@page@targetstrue
8383
}
8484

85+
% Fix the theindex environment to add an entry to the Table of
86+
% Contents; this is much nicer than just having to jump to the end of
87+
% the book and flip around, especially with multiple indexes.
88+
%
89+
\let\OldTheindex=\theindex
90+
\renewcommand{\theindex}{
91+
\clearpage
92+
\OldTheindex
93+
\addcontentsline{toc}{section}{\indexname}
94+
}
95+
8596
\@ifundefined{fancyhf}{
8697
\pagestyle{plain}}{
8798
\pagestyle{normal}} % start this way; change for

Doc/texinputs/manual.cls

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,15 @@
122122
\@ifundefined{fancyhf}{}{\pagestyle{normal}}%
123123
\@doing@page@targetstrue%
124124
}
125+
126+
127+
% Fix the theindex environment to add an entry to the Table of
128+
% Contents; this is much nicer than just having to jump to the end of
129+
% the book and flip around, especially with multiple indexes.
130+
%
131+
\let\OldTheindex=\theindex
132+
\renewcommand{\theindex}{
133+
\cleardoublepage
134+
\OldTheindex
135+
\addcontentsline{toc}{chapter}{\indexname}
136+
}

Doc/texinputs/python.sty

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,6 @@
286286
\newif\if@UseModuleIndex
287287
\@UseModuleIndexfalse
288288

289-
% Fix the theindex environment to add an entry to the Table of
290-
% Contents; this is much nicer than just having to jump to the end of
291-
% the book and flip around, especially with multiple indexes.
292-
%
293-
\let\OldTheindex=\theindex
294-
\renewcommand{\theindex}{
295-
\cleardoublepage
296-
\OldTheindex
297-
\addcontentsline{toc}{chapter}{\indexname}
298-
}
299-
300289
\newcommand{\makemodindex}{
301290
\newwrite\modindexfile
302291
\openout\modindexfile=mod\jobname.idx

0 commit comments

Comments
 (0)