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}
59 % \section{Index and Glossary Generation}
60 % Index and Glossary commands.
62 % \DescribeMacro{\makeindex} A preamble command to turn on indexing.
64 % \DescribeMacro{\makeglossary} A preamble command to turn on making
67 % \DescribeMacro{\index} Make an index entry for |#1|.
69 % \DescribeMacro{\glossary} Make a glossary entry for |#1|.
74 % \changes{v1.0a}{1994/03/31}{Initial version of ltidxbib.dtx,
75 % split from ltherest.dtx}
76 % \changes{v1.1a}{1994/05/19}{Initial version of ltidxglo.dtx,
77 % split from ltidxbib.dtx}
78 % \changes{v1.1d}{1995/10/25}{Doc cleanup}
84 % \index == BEGIN \@bsphack
86 % \protect{X} == \string X\space
87 % %% added 3 Feb 87 for \index commands
89 % re-\catcode special characters
96 % write of {\indexentry{ITEM}{page number}}
103 % \index == BEGIN \@bsphack
105 % re-\catcode special characters (in case '%' there)
109 % \@index{ITEM} == BEGIN \endgroup \@esphack END
111 % Changes made 14 Apr 89 to write \glossaryentry's instead of
112 % \indexentry's on the .glo file.
120 % \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from
123 % \begin{macro}{\makeindex}
127 \immediate\openout\@indexfile=\jobname.idx
128 \def\index{\@bsphack\begingroup
131 {Writing index file \jobname.idx}%
133 % \changes{v1.1e}{1996/01/20}{Make no-op after use pr/2048}
134 % Opening the write channel should be done only once
135 % since on some OS multiple opens are forbidden and in
136 % any case it is useless. So we turn this into a no-op after
139 \let\makeindex\@empty
141 \@onlypreamble\makeindex
145 % \begin{macro}{\@wrindex}
146 % \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to
150 \protected@write\@indexfile{}%
151 {\string\indexentry{#1}{\thepage}}%
157 % \begin{macro}{\index}
159 \def\index{\@bsphack\begingroup \@sanitize\@index}
163 % \begin{macro}{\@index}
165 \def\@index#1{\endgroup\@esphack}
169 % \begin{macro}{\makeglossary}
170 % \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from
171 % \cs{makeglossary}.}
174 \newwrite\@glossaryfile
175 \immediate\openout\@glossaryfile=\jobname.glo
176 \def\glossary{\@bsphack\begingroup
178 \@wrglossary}\typeout
179 {Writing glossary file \jobname.glo }%
181 % \changes{v1.1e}{1996/01/20}{Make no-op after use pr/2048}
182 % Opening the write channel should be done only once
183 % since on some OS multiple opens are forbidden and in
184 % any case it is useless. So we turn this into a no-op after
187 \let\makeglossary\@empty
189 \@onlypreamble\makeglossary
193 % \begin{macro}{\@wrglossary}
194 % \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to
198 \protected@write\@glossaryfile{}%
199 {\string\glossaryentry{#1}{\thepage}}%
205 % \begin{macro}{\glossary}
207 \def\glossary{\@bsphack\begingroup\@sanitize\@index}