1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
30 %%% From File: ltidxglo.dtx
34 \ProvidesFile{ltidxglo.dtx}
35 [1996/01/20 v1.1e LaTeX Kernel (Index and Glossary)]
37 \documentclass{ltxdoc}
38 \GetFileInfo{ltidxglo.dtx}
51 \MaintainedByLaTeXTeam{latex}
60 % \section{Index and Glossary Generation}
61 % Index and Glossary commands.
63 % \DescribeMacro{\makeindex} A preamble command to turn on indexing.
65 % \DescribeMacro{\makeglossary} A preamble command to turn on making
68 % \DescribeMacro{\index} Make an index entry for |#1|.
70 % \DescribeMacro{\glossary} Make a glossary entry for |#1|.
75 % \changes{v1.0a}{1994/03/31}{Initial version of ltidxbib.dtx,
76 % split from ltherest.dtx}
77 % \changes{v1.1a}{1994/05/19}{Initial version of ltidxglo.dtx,
78 % split from ltidxbib.dtx}
79 % \changes{v1.1d}{1995/10/25}{Doc cleanup}
85 % \index == BEGIN \@bsphack
87 % \protect{X} == \string X\space
88 % %% added 3 Feb 87 for \index commands
90 % re-\catcode special characters
97 % write of {\indexentry{ITEM}{page number}}
104 % \index == BEGIN \@bsphack
106 % re-\catcode special characters (in case '%' there)
110 % \@index{ITEM} == BEGIN \endgroup \@esphack END
112 % Changes made 14 Apr 89 to write \glossaryentry's instead of
113 % \indexentry's on the .glo file.
121 % \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from
124 % \begin{macro}{\makeindex}
128 \immediate\openout\@indexfile=\jobname.idx
129 \def\index{\@bsphack\begingroup
132 {Writing index file \jobname.idx}%
134 % \changes{v1.1e}{1996/01/20}{Make no-op after use pr/2048}
135 % Opening the write channel should be done only once
136 % since on some OS multiple opens are forbidden and in
137 % any case it is useless. So we turn this into a no-op after
140 \let\makeindex\@empty
142 \@onlypreamble\makeindex
146 % \begin{macro}{\@wrindex}
147 % \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to
151 \protected@write\@indexfile{}%
152 {\string\indexentry{#1}{\thepage}}%
158 % \begin{macro}{\index}
160 \def\index{\@bsphack\begingroup \@sanitize\@index}
164 % \begin{macro}{\@index}
166 \def\@index#1{\endgroup\@esphack}
170 % \begin{macro}{\makeglossary}
171 % \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from
172 % \cs{makeglossary}.}
175 \newwrite\@glossaryfile
176 \immediate\openout\@glossaryfile=\jobname.glo
177 \def\glossary{\@bsphack\begingroup
179 \@wrglossary}\typeout
180 {Writing glossary file \jobname.glo }%
182 % \changes{v1.1e}{1996/01/20}{Make no-op after use pr/2048}
183 % Opening the write channel should be done only once
184 % since on some OS multiple opens are forbidden and in
185 % any case it is useless. So we turn this into a no-op after
188 \let\makeglossary\@empty
190 \@onlypreamble\makeglossary
194 % \begin{macro}{\@wrglossary}
195 % \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to
199 \protected@write\@glossaryfile{}%
200 {\string\glossaryentry{#1}{\thepage}}%
206 % \begin{macro}{\glossary}
208 \def\glossary{\@bsphack\begingroup\@sanitize\@index}