summaryrefslogtreecommitdiffstats
path: root/Doc/myformat.sty
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-01-02 02:57:41 (GMT)
committerFred Drake <fdrake@acm.org>1998-01-02 02:57:41 (GMT)
commitda941ef27c882bd4e5c31a56af484924c1e38466 (patch)
tree2750810646412c2fe3141ee80e32c40fcfe31def /Doc/myformat.sty
parent875c807c9243aed464e4150f7eac0ea0ffd4bec2 (diff)
downloadcpython-da941ef27c882bd4e5c31a56af484924c1e38466.zip
cpython-da941ef27c882bd4e5c31a56af484924c1e38466.tar.gz
cpython-da941ef27c882bd4e5c31a56af484924c1e38466.tar.bz2
Added support for storing information to build a module index.
Enhance the "theindex" environment to add an entry to the table of contents.
Diffstat (limited to 'Doc/myformat.sty')
-rw-r--r--Doc/myformat.sty17
1 files changed, 16 insertions, 1 deletions
diff --git a/Doc/myformat.sty b/Doc/myformat.sty
index c502c31..e4c9ff5 100644
--- a/Doc/myformat.sty
+++ b/Doc/myformat.sty
@@ -101,8 +101,13 @@
\newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }}
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
+% support for the module index
+\newwrite\modindexfile
+\openout\modindexfile=modules.idx
+
% Add the defining entry for a module
-\newcommand{\defmodindex}[2]{\index{#1@{\tt#1} (#2module)|textbf}}
+\newcommand{\defmodindex}[2]{\index{#1@{\tt#1} (#2module)|textbf}%
+ \write\modindexfile{#1 \thepage}}
\newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }}
\newcommand{\stmodindex}[1]{\defmodindex{#1}{standard }}
@@ -238,3 +243,13 @@
\newenvironment{seealso}[0]{{\bf See Also: }}{\par}
\newcommand{\seemodule}[2]{\ref{module-#1}: {\tt #1} (#2)}
\newcommand{\seetext}[1]{\par{#1}}
+
+% 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.
+%
+\let\OldTheindex=\theindex
+\def\theindex{%
+ \OldTheindex%
+ \addcontentsline{toc}{chapter}{\indexname}%
+}