Debian Codegraph @

texmf-dist/source/latex/base/ltidxglo.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2025
4 % The LaTeX Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
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 % https://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2008 or later.
17 %
18 % This file has the LPPL maintenance status "maintained".
19 %
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
22 % information.
23 %
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.
27 %
28 % \fi
29 % \iffalse
30 %%% From File: ltidxglo.dtx
31 %
32 %<*driver>
33 % \fi
34 \ProvidesFile{ltidxglo.dtx}
35 [2019/08/27 v1.1f LaTeX Kernel (Index and Glossary)]
36 % \iffalse
37 \documentclass{ltxdoc}
38 \GetFileInfo{ltidxglo.dtx}
39 \title{\filename}
40 \date{\filedate}
41 \author{%
42 Johannes Braams\and
43 David Carlisle\and
44 Alan Jeffrey\and
45 Leslie Lamport\and
46 Frank Mittelbach\and
47 Chris Rowley\and
48 Rainer Sch\"opf}
49
50 \begin{document}
51 \MaintainedByLaTeXTeam{latex}
52 \maketitle
53 \DocInput{\filename}
54 \end{document}
55 %</driver>
56 % \fi
57 %
58 %
59 % \section{Index and Glossary Generation}
60 % Index and Glossary commands.
61 %
62 % \DescribeMacro{\makeindex} A preamble command to turn on indexing.
63 %
64 % \DescribeMacro{\makeglossary} A preamble command to turn on making
65 % glossary entries.
66 %
67 % \DescribeMacro{\index} Make an index entry for |#1|.
68 %
69 % \DescribeMacro{\glossary} Make a glossary entry for |#1|.
70 %
71 % \MaybeStop{}
72 %
73 %
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}
79 % \changes{v1.1f}{2019/08/27}{Make \cs{index} and \cs{glossary} robust}
80 %
81 %
82 % \begin{oldcomments}
83 % \makeindex ==
84 % BEGIN
85 % \index == BEGIN \@bsphack
86 % \begingroup
87 % \protect{X} == \string X\space
88 % %% added 3 Feb 87 for \index commands
89 % %% in \footnotes
90 % re-\catcode special characters
91 % to 'other'
92 % \@wrindex
93 % END
94 %
95 % \@wrindex{ITEM} ==
96 % BEGIN
97 % write of {\indexentry{ITEM}{page number}}
98 % \endgroup
99 % \@esphack
100 % END
101 %
102 % INITIALIZATION:
103 %
104 % \index == BEGIN \@bsphack
105 % \begingroup
106 % re-\catcode special characters (in case '%' there)
107 % \@index
108 % END
109 %
110 % \@index{ITEM} == BEGIN \endgroup \@esphack END
111 %
112 % Changes made 14 Apr 89 to write \glossaryentry's instead of
113 % \indexentry's on the .glo file.
114 % \end{oldcomments}
115 %
116 % \begin{macrocode}
117 %<*2ekernel>
118 \message{index,}
119 % \end{macrocode}
120 %
121 % \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from
122 % \cs{makeindex}.}
123 %
124 % \begin{macro}{\makeindex}
125 % \begin{macrocode}
126 \def\makeindex{%
127 \newwrite\@indexfile
128 \immediate\openout\@indexfile=\jobname.idx
129 \def\index{\@bsphack\begingroup
130 \@sanitize
131 \@wrindex}\typeout
132 {Writing index file \jobname.idx}%
133 % \end{macrocode}
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
138 % use.
139 % \begin{macrocode}
140 \let\makeindex\@empty
141 }
142 \@onlypreamble\makeindex
143 % \end{macrocode}
144 % \end{macro}
145 %
146 % \begin{macro}{\@wrindex}
147 % \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to
148 % \cs{@wrindex}.}
149 % \begin{macrocode}
150 \def\@wrindex#1{%
151 \protected@write\@indexfile{}%
152 {\string\indexentry{#1}{\thepage}}%
153 \endgroup
154 \@esphack}
155 % \end{macrocode}
156 % \end{macro}
157 %
158 % \begin{macro}{\index}
159 % \begin{macrocode}
160 \def\index{\@bsphack\begingroup \@sanitize\@index}
161 % \end{macrocode}
162 % \end{macro}
163 %
164 % \begin{macro}{\@index}
165 % \begin{macrocode}
166 \def\@index#1{\endgroup\@esphack}
167 % \end{macrocode}
168 % \end{macro}
169 %
170 % \begin{macro}{\makeglossary}
171 % \changes{v1.1b}{1994/11/04}{Removed \cs{if@filesw} from
172 % \cs{makeglossary}.}
173 % \begin{macrocode}
174 \def\makeglossary{%
175 \newwrite\@glossaryfile
176 \immediate\openout\@glossaryfile=\jobname.glo
177 \def\glossary{\@bsphack\begingroup
178 \@sanitize
179 \@wrglossary}\typeout
180 {Writing glossary file \jobname.glo }%
181 % \end{macrocode}
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
186 % use.
187 % \begin{macrocode}
188 \let\makeglossary\@empty
189 }
190 \@onlypreamble\makeglossary
191 % \end{macrocode}
192 % \end{macro}
193 %
194 % \begin{macro}{\@wrglossary}
195 % \changes{v1.1b}{1994/11/04}{Added \cs{protected@write} to
196 % \cs{@wrglossary}.}
197 % \begin{macrocode}
198 \def\@wrglossary#1{%
199 \protected@write\@glossaryfile{}%
200 {\string\glossaryentry{#1}{\thepage}}%
201 \endgroup
202 \@esphack}
203 % \end{macrocode}
204 % \end{macro}
205 %
206 % \begin{macro}{\glossary}
207 % \begin{macrocode}
208 \def\glossary{\@bsphack\begingroup\@sanitize\@index}
209 % \end{macrocode}
210 % \end{macro}
211 %
212 % \begin{macrocode}
213 %</2ekernel>
214 % \end{macrocode}
215 %
216 %
217 % \Finale
218 %