From da941ef27c882bd4e5c31a56af484924c1e38466 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Fri, 2 Jan 1998 02:57:41 +0000 Subject: [PATCH] Added support for storing information to build a module index. Enhance the "theindex" environment to add an entry to the table of contents. --- Doc/myformat.sty | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Doc/myformat.sty b/Doc/myformat.sty index c502c31f5d..e4c9ff571c 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}% +} -- 2.40.0