Debian Codegraph @

texmf-dist/source/latex/nomencl/nomencl.dtx

raw
1 % \iffalse
2 % File nomencl.dtx
3 % Copyright 1996-2021 Boris Veytsman, Bernd Shandl, Lee Netherton, CV
4 % Radhakrishnan, Brian Elmegaard
5 %
6 %
7 % Documentation and documented source code for the nomencl package.
8 %
9 % See the README file for instructions.
10 %
11 % This file can be redistributed and/or modified under the terms
12 % of the LaTeX Project Public License distributed from CTAN
13 % archives in the directory macros/latex/base/lppl.txt; either
14 % version 1.2 of the license, or (at your option) any later version.
15 %
16 % This work has the LPPL maintenance status `maintained'.
17 %
18 % The Current Maintainer of this work is Boris Veytsman,
19 % <[email protected]>
20 %
21 %
22 %
23 %<*dtx>
24 \ProvidesFile{nomencl.dtx}%
25 %</dtx>
26 %<package>\ProvidesPackage{nomencl}%
27 %<driver>\ProvidesFile{nomencl.drv}%
28 %<*package|driver>
29 % \fi
30 % \ProvidesFile{nomencl.dtx}%
31 [2021/11/10 v5.6 Nomenclature package]
32 %
33 % \iffalse
34 %</package|driver>
35 %<*driver>
36 \documentclass[11pt]{ltxdoc}%
37 \RequirePackage{fancyvrb}%
38 \RequirePackage{hypdoc}%
39 \RequirePackage[nocfg]{nomencl}%
40
41 \hypersetup{%
42 hyperindex=true,
43 colorlinks=true,
44 linkcolor=blue,
45 anchorcolor=blue,
46 citecolor=blue,
47 filecolor=blue,
48 menucolor=blue,
49 pagecolor=blue,
50 urlcolor=blue,
51 bookmarksnumbered=true,
52 pdftitle={Documentation for the nomencl Package},
53 pdfauthor={Boris Veytsman, Bernd Schandl, Lee Netherton, CV
54 Radhakrishnan},
55 pdfsubject={Provides nomenclature automation in LaTeX},
56 pdfkeywords={nomenclature latex generation symbol list}
57 }%
58
59 %% Comment out the next line if you want the documentation for the source code.
60 %%\OnlyDescription
61
62 \AtBeginDocument{\RecordChanges}
63 \AtEndDocument{\addcontentsline{toc}{section}{Change Log}\PrintChanges}
64
65 %% Uncomment the next two lines for a command index.
66 %% See also the instructions above (in nomencl.drv).
67 \AtBeginDocument{\CodelineIndex}
68 \AtEndDocument{\setcounter{IndexColumns}{2}\addcontentsline{toc}{section}{Index}\PrintIndex}
69
70 \begin{document}
71 \DocInput{nomencl.dtx}
72 \end{document}
73 %</driver>
74 % \fi
75 %
76 %
77 % \changes{v2.2 (1996/11/25)}{1996/11/25}{Last version released by
78 % Boris Veytsman}
79 % \changes{v2.5 (1999/03/13)}{1999/03/02}{Complete rewrite of the
80 % package and the documentation}
81 % \changes{v2.6 (1999/04/02)}{1999/04/01}{Use \cs{GetFileInfo}}
82 % \changes{v2.7a (1999/07/07)}{1999/07/07}{Merged \texttt{licence.txt}
83 % into \texttt{README}}
84 % \changes{v2.8 (1999/09/09)}{1999/09/09}{Email changed}
85 % \changes{v3.0 (2000/03/05)}{2000/03/05}{WWW address changed}
86 % \changes{v3.1 (2000/09/15)}{2000/09/15}{Do not read cfg file in
87 % documentation}
88 % \changes{v3.1 (2000/09/15)}{2000/09/15}{WWW address changed (again)}
89 % \changes{v3.1b (2001/09/30)}{2001/09/30}{WWW address changed (again)}
90 % \changes{v3.1c (2001/10/02)}{2001/10/02}{Minor documentation changes}
91 % \changes{v4.0 (2005/03/31)}{2005/03/31}{Improved compatibility with other
92 % Glossary/MakeIndex packages. Added option to insert Nomenclature into toc.
93 % Amended documentation accordingly.}
94 % \changes{v4.1 (2005/04/27)}{2005/04/27}{Improvements to the documentation,
95 % including hyperref support}
96 % \changes{v5.0}{2018/12/28}{Rewrote documentation}
97 % \changes{v5.2}{2019/05/05}{New options: tocbasic, notocbasic}
98 %
99 % \GetFileInfo{nomencl.dtx}
100 %
101 %
102 % \MakeShortVerb{\|}
103 % \setlength{\hfuzz}{8pt}
104 % \newcommand{\MakeIndex}{\textsl{MakeIndex}}
105 % \newcommand{\xindy}{\mbox{\normalfont\textbf{\textsf{x\kern-0.7pt%
106 % \shortstack{{\scriptsize$\circ$}\\[-2pt]\i}\kern-1pt ndy}}}}
107 % \let\package\textsf
108 % \let\tab\indent
109 % \let\example=\figure
110 % \let\endexample=\endfigure
111 %
112 % \title{\package{nomencl}:
113 % A Package to Create a Nomenclature}
114 % \author{Boris Veytsman\and
115 % Bernd Schandl\and
116 % Lee Netherton\and CV Radhakrishnan\and
117 % Brian Elmegaard\end{tabular}\\
118 % \begin{center}with contributions by\end{center}\begin{tabular}[t]{c}
119 % Stefan Pinnow\and
120 % Patrick Egan\and
121 % Rasmus Solmer Eriksen\and
122 % Andrea Kern\and
123 % Christian Faulhammer}
124 % \date{Package version \fileversion\ of \filedate}
125 % \maketitle
126 % \tableofcontents
127 % \listoffigures
128 % \clearpage
129 %
130 %
131 %
132 % \section{Introduction}
133 % How often did you try to understand a theorem in a book, but just
134 % couldn't figure out what all those strange symbols were all about? The
135 % \package{nomencl} package should help authors format a nomenclature.
136 % It uses the powerful capabilities of the \MakeIndex\ program to generate
137 % such a list automatically using information provided by the author
138 % throughout the text.
139 %
140 %
141 %\subsection{History}
142 %\label{sec:history}
143 %
144 % This package was written by Boris Veytsman for his paper in AiCHE in
145 % 1996. It was improved by Bernd Schandl,
146 % Lee Netherton, CV Radhakrishnan, and
147 % Brian Elmegaard up to 2006. In 2006 a version of \package{nomencl}
148 % for table-like nomenclature lists was released by Brian Elmegaard as
149 % \package{nomentbl}.
150 %
151 % In 2018 Boris Veytsman took over the package, and merged the
152 % \package{nomentbl} fork back. He also changed some code, trying to
153 % keep the compatibility with the older \package{nomencl} and
154 % \package{nomentbl}.
155 %
156 % \subsection{Important Notes for Users of Previous Versions}
157 %
158 % An update to the \package{nomencl} package has included some major
159 % changes to some of the commands. In particular, the |\makeglossary|
160 % and |\printglossary| commands have now been renamed to
161 % |\makenomenclature| and |\printnomenclature| respectively. The
162 % reason for this change is to increase the package's compatibility
163 % with other MakeIndex using packages. With this increased
164 % compatibility, users will be able to have nomenclatures, glossaries
165 % and indexes all in one document.
166 %
167 % There is a compatibility option that will allow you to still use
168 % your |\makeglossary| and |\printglossary| commands (see section
169 % \ref{sec:options}), but it is advised that you change your
170 % |\|\ldots|glossary| commands to the new |\|\ldots|nomenclature|
171 % commands in your \LaTeX\ files. For more information
172 % on the compatibility mode see section \ref{sec:compatibility}.
173 %
174 % \section{Usage}
175 %
176 % \subsection{The Basics}
177 %
178 % The creation of the nomenclature list is very similar to the creation of
179 % an index~\cite[App.~A]{lamp:late:1994}. You need to:
180 % \begin{itemize}
181 % \item Put |\usepackage[|\meta{options}|]{nomencl}| in the preamble of
182 % your document.
183 % \item \DescribeMacro{\makenomenclature}
184 % Put |\makenomenclature| in the preamble of your document.
185 % \item \DescribeMacro{\nomenclature}
186 % Issue the |\nomenclature| command (see Section~\ref{sec:Main-Command})
187 % for each symbol you want to have included in the nomenclature list.
188 % The best place for this command is immediately after you introduce
189 % the symbol for the first time.
190 % \item \DescribeMacro{\printnomenclature}
191 % Put |\printnomenclature| at the place you want to have your
192 % nomenclature list.
193 % \end{itemize}
194 %
195 % Now put your file through \LaTeX. The command |\makenomenclature| will
196 % instruct \LaTeX\ to open the nomenclature file \meta{filename}|.nlo|
197 % corresponding to your \LaTeX\ file \meta{filename}|.tex| and to
198 % write the information from your |\nomenclature| commands to this file.
199 %
200 % \changes{v2.7 (1999/05/14)}{1999/05/11}{Mention need to change quote
201 % character for German users}
202 % The next step is to invoke \MakeIndex. You should instruct
203 % \MakeIndex\ to use \meta{filename}|.nlo| as your input file,
204 % use |nomencl.ist| as your style
205 % file
206 % and write output to the file \meta{filename}|.nls|.
207 % How to do this depends on your implementation of \MakeIndex. For
208 % most UNIX implementations you should write something like
209 % \begin{center}
210 % |makeindex| \meta{filename}|.nlo -s nomencl.ist -o|
211 % \meta{filename}|.nls|
212 % \end{center}
213 %
214 %
215 %
216 % Now you have the file \meta{filename}|.nls| that contains your
217 % nomenclature list properly ordered. The last step is to invoke
218 % \LaTeX\ on your master file \meta{filename}|.tex| once more. It will
219 % input your |.nls| file and process it accordingly to the current
220 % options. That's all!
221 %
222 %
223 % \subsection{The Main Command}
224 % \label{sec:Main-Command}
225 %
226 % \DescribeMacro{\nomenclature}
227 % The main command of the \package{nomencl} package has the following
228 % syntax:
229 % \begin{center}
230 % |\nomenclature[|\meta{prefix}|]{|\meta{symbol}|}{|\meta{description}|}|
231 % \end{center}
232 % where \meta{prefix} is used for fine tuning the sort order,
233 % \meta{symbol} is the symbol you want to describe and \meta{description}
234 % is the actual description. The sortkey will be \meta{prefix}\meta{symbol},
235 % where \meta{prefix} is either the one from the optional argument or, if no
236 % optional argument was given, the default \meta{prefix} which may be empty.
237 % See Section~\ref{sec:sort} to make sense of this.
238 %
239 % Put this command immediately after the equation or text that
240 % introduces \meta{symbol}. Usually it is a good idea to avoid a space
241 % or an unquoted newline just in front of the |\nomenclature| command.
242 % Put a |%| at the end of the preceding line if necessary.
243 % Don't forget to enclose math in \meta{symbol} in |$| signs.
244 %
245 % Let's have a look at a simple example. If your input file looks like
246 % the one in Figure~\ref{fig:simple} then your nomenclature should
247 % look like Figure~\ref{fig:simple.out}.
248 %
249 % \begin{example}
250 % \begin{macrocode}
251 %<*sample01.tex>
252 \documentclass{article}
253 \usepackage[nocfg]{nomencl}
254 \makenomenclature
255 \begin{document}
256 \section*{Main equations}
257 \begin{equation}
258 a=\frac{N}{A}
259 \end{equation}%
260 \nomenclature{$a$}{The number of angels per unit area\nomrefeq}%
261 \nomenclature{$N$}{The number of angels per needle point\nomrefpage}%
262 \nomenclature{$A$}{The area of the needle point}%
263 The equation $\sigma = m a$%
264 \nomenclature{$\sigma$}{The total mass of angels per unit area\nomrefeqpage}%
265 \nomenclature{$m$}{The mass of one angel}
266 follows easily.
267 \eqdeclaration{32}
268 \printnomenclature
269 \end{document}
270 %</sample01.tex>
271 % \end{macrocode}
272 % \caption{Input for the simple example}
273 % \label{fig:simple}
274 % \end{example}
275 % \begin{example}
276 %\begin{thenomenclature}
277 %\nomgroup{A}
278 % \item [{$\sigma$}]\begingroup The total mass of angels per unit area\nomrefeqpage\nomeqref {1}\nompageref{1}
279 % \item [{$A$}]\begingroup The area of the needle point\nomeqref {1}\nompageref{1}
280 % \item [{$a$}]\begingroup The number of angels per unit area\nomrefeq\nomeqref {1}\nompageref{1}
281 % \item [{$m$}]\begingroup The mass of one angel\nomeqref {1}\nompageref{1}
282 % \item [{$N$}]\begingroup The number of angels per needle point\nomrefpage\nomeqref {1}\nompageref{1}
283 %\end{thenomenclature}
284 % \caption{The typeset output for the simple example}
285 % \label{fig:simple.out}
286 % \end{example}
287 %
288 % Note the necessary quoting of newlines to suppress spurious spaces.
289 %
290 % \changes{v2.6b (1999/04/10)}{1999/04/08}{Documentation change concerning line
291 % breaks between arguments}
292 % Due to the way \cs{nomenclature} scans its arguments you don't need to
293 % \cs{protect} any macros, but you also must not have any character in front
294 % of the first or between the
295 % first and the second argument, especially no line break (even with a |%|). So
296 %\begin{verbatim}
297 % \nomenclature{$x$}%
298 % {Description}
299 %\end{verbatim}
300 % does \emph{not} work. You can have have line breaks in the argument, but
301 % also no |%|.
302 %
303 % Note that |nomentbl| option described in Section~\ref{sec:nomentbl}
304 % changes the syntax of this command.
305 %
306 % \subsection{Package Options}
307 % \label{sec:options}
308 %
309 % The \package{nomencl} package has the following options:
310 % \begin{description}
311 % \item[refeq] The phrase ``, see equation (\meta{eq})'' is appended to
312 % every entry in the nomenclature where \meta{eq} is the number of the
313 % last equation in front of the corresponding command |\nomenclature|.
314 % \item[norefeq] No equation reference is printed. (default)
315 % \item[refpage] The phrase ``, page \meta{page}'' is appended to
316 % every entry in the nomenclature where \meta{page} is the number of the
317 % page on which the corresponding command |\nomenclature| appeared.
318 % \item[norefpage] No page reference is printed. (default)
319 % \item[prefix] Every sort key is preceded by the letter ``a'' (changeable);
320 % see Sections~\ref{sec:sort} and Section~\ref{sec:grouping} to
321 % learn why this might make sense. (default)
322 % \item[noprefix] No prefix is used.
323 % \changes{v5.0}{2018/12/28}{New options |stdsubgroups| and |nostdsubgroups|}
324 % \item[stdsubgroups] Use standard subgroups in nomenclature, see
325 % Section~\ref{sec:grouping}.
326 % \item[nostdsubgroups] Do not use standard subgroups in nomenclature, see
327 % Section~\ref{sec:grouping} (default).
328 % \changes{v3.0 (2000/03/05)}{2000/03/05}{New options
329 % \texttt{cfg}/\texttt{nocfg}}
330 % \item[cfg] A configuration file, by default, |nomencl.cfg| is
331 % loaded, if it exists (default). The variant |cfg=FILENAME| uses the
332 % configuration |FILENAME| instead of |nomencl.cfg|. This is used in
333 % the examples in the package documentation.
334 % \item[nocfg] The configuration file is not loaded.
335 % \item[intoc] Inserts the nomenclature in the Table of Contents.
336 % \item[notintoc] No entry for the nomenclature in the Table of Contents. (default)
337 % \item[tocbasic] Use \textsl{tocbasic} package from KOMA script
338 % bundle for TOC handling (default)
339 % \item[notocbasic] Do not use \textsl{tocbasic} package from KOMA
340 % script. You may need this option if \textsl{tocbasic} conflicts
341 % with other packages like \textsl{pgfopts}.
342 % \item[compatible] Run in compatibility mode. Older tex files may
343 % need this option selected to be able to compile. In the latest
344 % version of \package{nomencl} the commands |\makeglossary| and
345 % |\printglossary| were replaced with |\makenomenclature| and
346 % |\printnomenclature|. Selecting this option will redefine the old
347 % commands, but will lose the compatibility with other glossary
348 % packages.
349 % \item[noncompatible] Do not run in compatibility mode. (default)
350 % \item[nomentbl] Print nomenclature in the |nomentbl| style, see
351 % Section~\ref{sec:nomentbl}.
352 % \item[nonomentbl] Do not print nomenclature in the |nomentbl| style, see
353 % Section~\ref{sec:nomentbl} (default).
354 % \item[\hspace{-\labelsep}]
355 % \textbf{catalan, croatian, danish, english, french, german, italian,
356 % norwegian-bokmaal, norwegian-nynorsk, polish,
357 % portuguese, russian, slovene, spanish, ukrainian}
358 % The reference texts and the nomenclature title will appear in the
359 % corresponding language. Note that in order to use Russian or Ukrainian,
360 % you have to have Cyrillic fonts installed and you might need a replacement
361 % for \MakeIndex, e.\,g.~\xindy. Please help me out with other
362 % languages. (default: english)
363 % \end{description}
364 %
365 %
366 % \subsection{Referencing}
367 %
368 % \DescribeMacro{\nomrefeq}\DescribeMacro{\nomrefpage}%
369 % \DescribeMacro{\nomrefeqpage}%
370 % \DescribeMacro{\nomnorefeq}\DescribeMacro{\nomnorefpage}%
371 % \DescribeMacro{\nomnorefeqpage}%
372 % As explained in Section~\ref{sec:options}, you can turn referencing to
373 % equations and pages on/off globally using the package options. But sometimes
374 % you might want to change the referencing behavior for single entries. The
375 % following six macros can be used inside a |\nomenclature| macro:
376 % |\nomrefeq|, |\nomnorefeq|, |\nomrefpage|, |\nomnorefpage|, |\nomrefeqpage|,
377 % |\nomnorefeqpage|.
378 % The first four work similarly to the package options, only local to the
379 % entry; the last two are shortcuts, so saying |\nomrefeqpage| is equivalent
380 % to |\nomrefeq\nomrefpage|.
381 %
382 % If we changed the relevant parts of the last example as shown in
383 % Figure~\ref{fig:reference} then the nomenclature should look like
384 % Figure~\ref{fig:reference.out}.
385 %
386 % \begin{example}
387 %\begin{verbatim}
388 % \begin{equation}
389 % a=\frac{N}{A}
390 % \end{equation}%
391 % \nomenclature{$a$}{The number of angels per unit area\nomrefeqpage}%
392 % \nomenclature{$N$}{The number of angels per needle point\nomrefeq}%
393 % \nomenclature{$A$}{The area of the needle point\nomrefeq\nomrefpage}%
394 % The equation $\sigma = m a$%
395 % \nomenclature{$\sigma$}{The total mass of angels per unit area}%
396 % \nomenclature{$m$}{The mass of one angel\nomrefpage}
397 % follows easily.
398 % \printnomenclature
399 % \end{document}
400 %\end{verbatim}
401 % \caption{Explicit references}
402 % \label{fig:reference}
403 % \end{example}
404 % \begin{example}
405 % \begin{thenomenclature}
406 % \nomgroup{A}
407 % \item [$\sigma$]\begingroup The total mass of angels per unit area\nomeqref {1}
408 % \nompageref{1}
409 % \item [$A$]\begingroup The area of the needle point\nomrefeq\nomrefpage\nomeqref {1}
410 % \nompageref{1}
411 % \item [$a$]\begingroup The number of angels per unit area\nomrefeqpage\nomeqref {1}
412 % \nompageref{1}
413 % \item [$m$]\begingroup The mass of one angel\nomrefpage\nomeqref {1}
414 % \nompageref{1}
415 % \item [$N$]\begingroup The number of angels per needle point\nomrefeq\nomeqref {1}
416 % \nompageref{1}
417 % \end{thenomenclature}
418 % \caption{Typeset output for Figure~\ref{fig:reference}}
419 % \label{fig:reference.out}
420 % \end{example}
421 %
422 % While these macros do not have to be at the end of the entries, it's
423 % probably the most sensible place to put them. Note that such local request
424 % always supersede the package options.
425 %
426 %
427 % \subsection{Sorting}
428 % \label{sec:sort}
429 %
430 % The Greek letter $\sigma$ turned out to be first in the nomenclature
431 % list in the examples above because the backslash in |\sigma|
432 % precedes any alphabetical character. Sometimes this is not what you
433 % want. Then you can use \meta{prefix} to fine tune the sort order.
434 %
435 % Before we describe the usage of \meta{prefix}, we have to explain how
436 % \MakeIndex\ sorts entries, see~\cite{chen:auto:1987}. \MakeIndex\
437 % distinguishes three kinds of sort keys:
438 % \begin{description}
439 % \item[Strings] Everything that starts with a alphabetic letter (A\dots Z,
440 % a\dots z).
441 % \item[Numbers] Everything that starts and only contains digits (0\dots 9).
442 % \item[Symbols] Everything else.
443 % \end{description}
444 % Each group is sorted separately (and differently), then the groups are
445 % sorted in the order symbols, numbers, strings\footnote{With the |-g| switch
446 % of \MakeIndex, they are sorted in the order symbols, strings, numbers.}. For
447 % the groups the following algorithm is used:
448 % \begin{description}
449 % \item[Strings] If two letters are compared, the usual ordering is used
450 % (|a|\textless|C|\textless|q|), but if two words are the
451 % same except for the capitalization, then an upper case letter
452 % precedes the lower case letter (|Tea|\textless|tea|).
453 % If a letter is compared with a non-letter (digit,
454 % symbol), ASCII code is used (|1|\textless |A|\textless |~|).\footnote{An
455 % exception seems to be that the non-letters between upper and lower case
456 % letters (code 91--96) are put just before the capital letters (between
457 % code 64 and 65) while the non-letters after the lower case letters (code
458 % 123--127) are left there.} If two
459 % non-letters are compared (which can not happen at the first position of a
460 % string), ASCII code is used (|+|\textless |1|\textless |:|\textless
461 % |\|). Additionally there is the issue of word ordering (treat spaces as
462 % letters with ASCII code smaller than every printable symbol) and letter
463 % ordering (ignore spaces). \MakeIndex\ uses word ordering by default, but
464 % you can change it with some command line option (|-l| on my UNIX).
465 % \item[Numbers] The natural ordering is used
466 % (|8|\textless |34|\textless |111|).
467 % \item[Symbols] ASCII code is used
468 % (|+|\textless|1|\textless|:|\textless|A|\textless|\|\textless|a|).
469 % \end{description}
470 %
471 % Let's consider the following eight nomenclature entries
472 % (without the optional argument): |$~Ab$|, |$~aa$|, |$\Ab$|, |$\aa$|, |$Ab$|,
473 % |$aa$|, |Ab|, |aa|. Try to understand the following example with the help
474 % of the explanation above and an ASCII table.
475 %
476 % If you use \package{nomencl} with its default settings (i.\,e.~``a'' is
477 % added to every sort key, so every sort key is considered as a string), you
478 % will get the sort order |$\aa$|, |$\Ab$|, |$aa$|, |$Ab$|, |$~aa$|, |$~Ab$|,
479 % |aa|, |Ab|. Note that |aa| is in front of |Ab| in all four pairs; note
480 % also the order |$\Ab$|, |$Ab$|, |$~Ab$| which does not agree with the
481 % ASCII code.
482 %
483 % If you specify the option \package{noprefix}, then you will get |$Ab$|,
484 % |$\Ab$|, |$\aa$|, |$aa$|, |$~Ab$|, |$~aa$|, |aa|, |Ab|. The first six
485 % entries are considered as symbols and sorted according to the ASCII code
486 % (this time correctly). Note that |$\Ab$| is in front of |$\aa$| because
487 % |A| has the smaller ASCII code. The two strings follow at the end.
488 %
489 %
490 %\subsection{Subgroups}
491 %\label{sec:grouping}
492 %
493 % It often makes sense to separate index entries into several groups
494 % according to their meaning. The prefix parameter for the
495 % \cs{nomenclature} command provides a way to do it. The algorithm is:
496 % \begin{enumerate}
497 % \item Start prefixes with different letters for different
498 % subgroups.
499 % \item Define \cs{nomgroup} command (see Section~\ref{sec:format}
500 % below) to typeset group names.
501 % \end{enumerate}
502 %
503 % One of the popular choices, suggested by Brian Elmegaard in
504 % \package{nomentbl} is the following (the corresponding prefixes are
505 % in bold):
506 % \begin{description}
507 % \item[A] Latin letters
508 % \item[G] Greek letters
509 % \item[X] Superscripts
510 % \item[Z] Subscripts
511 % \end{description}
512 %
513 % This choice is implemented in the |stsubgroups| option of the
514 % package, see Figure~\ref{fig:stdsubgroups}. A further customization
515 % is discussed in Section~\ref{sec:custom}.
516 %
517 % \begin{example}
518 % \begin{macrocode}
519 %<*sample02.tex>
520 % Example provided by Stefan Pinnow (SP)
521 \documentclass{article}
522 \usepackage[stdsubgroups,nocfg]{nomencl}
523 \usepackage{setspace}
524 \makenomenclature
525 \begin{document}
526 \section*{Main equations}
527 Here an equation
528 \begin{equation}\label{eq:heatflux}
529 \dot{Q} = k \cdot A \cdot \Delta T
530 \end{equation}%
531 \nomenclature[aQ]{$\dot{Q}$}{heat flux}%
532 \nomenclature[ak]{$k$}{overall heat transfer
533 coefficient}%
534 \nomenclature[aA]{$A$}{area}%
535 \nomenclature[aL]{$L$}{length}%
536 \nomenclature[aT]{$T$}{temperature}%
537 \nomenclature[aT]{$\Delta T$}{temperature difference}%
538 or another one
539 \begin{equation}\label{eq:ohtc}
540 \frac{1}{k} = \left[\frac{1}{\alpha _{\mathrm{i}}\,r_{\mathrm{i}}} +
541 \sum^n_{j=1}\frac{1}{\lambda _j}\,
542 \ln \frac{r_{\mathrm{a},j}}{r_{\mathrm{i},j}} +
543 \frac{1}{\alpha _{\mathrm{a}}\,
544 r_{\mathrm{a}}}\right] \cdot r_{\mathrm{reference}}
545 \end{equation}%
546 \nomenclature[ga]{$\alpha$}{convection heat transfer coefficient}%
547 \nomenclature[zi]{i}{in}%
548 \nomenclature[gl]{$\lambda$}{thermal conductivity}%
549 \nomenclature[za]{a}{out}%
550 \nomenclature[zn]{$n$}{number of walls}%
551 \nomenclature[zj]{$j$}{running parameter}%
552 \onehalfspacing
553 \printnomenclature
554 \end{document}
555 %</sample02.tex>
556 % \end{macrocode}
557 % \caption{The \texttt{stdsubgroups} option}
558 % \label{fig:stdsubgroups}
559 % \end{example}
560 %
561 %
562 %\subsection{Tabular nomenclature (\texttt{nomentbl} style)}
563 %\label{sec:nomentbl}
564 %
565 % The option |nomentbl| changes the behavior of nomenclature.
566 %
567 % \DescribeMacro{\nomenclature}%
568 % The command \cs{nomenclature} now has four, rather than two,
569 % mandatory arguments:
570 % \begin{center}
571 % \cs{nomenclature}\oarg{prefix}\marg{symbol}\marg{description}\marg{units}\marg{note}
572 % \end{center}
573 % Here \oarg{prefix}, \marg{symbol}, and \marg{description} have the
574 % same meaning as for the usual \cs{nomenclature} command. The
575 % additional arguments are \marg{units}, which is internally enclosed
576 % in the \cs{si} command from |siunitx| package, and \cs{note}, which
577 % is an arbitrary note added to the description.
578 %
579 % \DescribeMacro{\setnomtableformat}
580 % The list is wrapped in a |longtable| with the default format
581 % \begin{center}
582 % |lp{0.4\textwidth}cp{0.3\textwidth}@{}l|
583 % \end{center}
584 % The command
585 % \cs{setnomtableformat}\marg{format} can be used to change it, for
586 % example,
587 % \begin{verbatim}
588 % \setnomtableformat{lllll}
589 % \end{verbatim}
590 %
591 % Note that the table has five columns: symbol, description, units,
592 % note, and reference. If you do not use references, you may suppress
593 % the last column using |@{}l| declaration.
594 %
595 % Figure~\ref{fig:nomentbl} provides an example of this option.
596 %
597 % \begin{example}
598 % \begin{macrocode}
599 %<*sample03.tex>
600 % Example provided by Stefan Pinnow (SP)
601 \documentclass{article}
602 \usepackage[nomentbl,stdsubgroups]{nomencl}
603 \usepackage{setspace}
604 \makenomenclature
605 \begin{document}
606 \section*{Main equations}
607 %
608 Here an equation
609 \begin{equation}\label{eq:heatflux}
610 \dot{Q} = k \cdot A \cdot \Delta T
611 \end{equation}%
612 \nomenclature[aQ]{$\dot{Q}$}{heat flux}{W}{}%
613 \nomenclature[ak]{$k$}{overall heat transfer
614 coefficient}{\watt\per(\square\meter\kelvin)}{see
615 eq.~(\ref{eq:ohtc})}%
616 \nomenclature[aA]{$A$}{area}{\square\meter}{}%
617 \nomenclature[aL]{$L$}{length}{\meter}{SI base quantity}%
618 \nomenclature[aT]{$T$}{temperature}{\kelvin}{SI base quantity}%
619 \nomenclature[aT]{$\Delta T$}{temperature difference}{\kelvin}{SI base quantity}%
620 or another one
621 \begin{equation}\label{eq:ohtc}
622 \frac{1}{k} = \left[\frac{1}{\alpha _{\mathrm{i}}\,r_{\mathrm{i}}} +
623 \sum^n_{j=1}\frac{1}{\lambda _j}\,
624 \ln \frac{r_{\mathrm{a},j}}{r_{\mathrm{i},j}} +
625 \frac{1}{\alpha _{\mathrm{a}}\,
626 r_{\mathrm{a}}}\right] \cdot r_{\mathrm{reference}}
627 \end{equation}%
628 \nomenclature[ga]{$\alpha$}{convection heat transfer
629 coefficient}{\watt\per(\square\meter\kelvin)}{}%
630 \nomenclature[zi]{i}{in}{}{}%
631 \nomenclature[gl]{$\lambda$}{thermal conductivity}{\watt\per\kelvin}{}%
632 \nomenclature[za]{a}{out}{}{}%
633 \nomenclature[zn]{$n$}{number of walls}{}{}%
634 \nomenclature[zj]{$j$}{running parameter}{}{}%
635
636 \onehalfspacing
637 \printnomenclature
638 \end{document}
639 %</sample03.tex>
640 % \end{macrocode}
641 % \caption{Use of \texttt{nomentbl} option}
642 % \label{fig:nomentbl}
643 % \end{example}
644 %
645 % \subsection{Customization}
646 % \label{sec:custom}
647 %
648 % Besides the things you can customize by using the package options, there are
649 % a few more commands that you might want to redefine. If you make the same
650 % changes in every file, it's probably easier to put all those in a file
651 % |nomencl.cfg| which is automatically read by the \package{nomencl} package
652 % whenever it exists in the search path (unless you specified the |nocfg|
653 % option). You can experiment with loading alternative configuration
654 % files using |cfg=FILENAME| version of this option.
655 %
656 %
657 % \subsubsection{Formatting the Nomenclature}
658 % \label{sec:format}
659 %
660 % \DescribeMacro{\printnomenclature}%
661 % \DescribeMacro{\nomlabelwidth}%
662 % Probably the most common change to the nomenclature is a different
663 % amount of space for the symbols. By default, the nomenclature is
664 % formatted as a list with the label width equal to |\nomlabelwidth|
665 % which is initialized to 1\,cm. You can change this dimension in the
666 % |cfg| file or you can use the optional argument of
667 % |\printnomenclature|. If you want to have a little more space for
668 % the labels (and you don't live in a metric world) you can use
669 % |\printnomenclature[0.5in]| instead of the simple
670 % |\printnomenclature|.
671 %
672 % \DescribeEnv{thenomenclature}%
673 % If you don't like the format of the nomenclature at all, you will have
674 % to redefine the |thenomenclature| environment. Maybe a look at the
675 % documented code of \package{nomencl} will help.
676 %
677 % \DescribeMacro{\nomname}%
678 % In case you don't like the name of the nomenclature, just redefine
679 % the |\nomname| macro, e.\,g.
680 % \begin{center}
681 % |\renewcommand{\nomname}{List of Symbols}|
682 % \end{center}
683 %
684 %
685 % \changes{v3.1b (2001/09/30)}{2001/03/12}{Explain how to get toc entry}
686 % \changes{v4.0 (2005/03/31)}{2005/03/31}{TOC entries now added with package option}
687 % Putting an entry for the nomenclature in the table of contents can
688 % be done by adding an \textbf{intoc} to the package options.
689 %
690 % \DescribeMacro{\nomgroup}%
691 % Usually, \MakeIndex\ inserts the macro |\indexspace| between every
692 % character group, i.\,e.~between symbols and numbers, numbers and
693 % letters and between every two letter groups. The \package{nomencl}
694 % package inserts the macro |\nomgroup{|\meta{arg}|}| \emph{instead},
695 % where \meta{arg} is either the string ``Symbols'' or the string
696 % ``Numbers'' or the capital letter of the group that is about to
697 % start. You can redefine |\nomgroup| to insert some white space
698 % |\renewcommand{\nomgroup}[1]{\medskip}|, or to print a fancy divider
699 %\begin{verbatim}
700 % \renewcommand{\nomgroup}[1]{%
701 % \item[]\hspace*{-\leftmargin}%
702 % \rule[2pt]{0.45\linewidth}{1pt}%
703 % \hfill #1\hfill
704 % \rule[2pt]{0.45\linewidth}{1pt}}
705 %\end{verbatim}
706 % Note that |\nomgroup| is executed in a list environment, so you need
707 % to have an |\item| first and then jump back to the beginning of the
708 % line with the |\hspace| command.
709 %
710 % \DescribeMacro{\nompreamble}\DescribeMacro{\nompostamble}%
711 % Maybe you want to explain something just between the title of the
712 % nomenclature and the start of the list or at the very end of the
713 % list. Just redefine the macros |\nompreamble| and |\nompostamble|
714 % which do nothing by default. Note that they are executed \emph{outside}
715 % of the list environment.
716 %
717 % \DescribeMacro{\nomitemsep}%
718 % The skip between two entries in the nomenclature can be adjusted using
719 % \cs{nomitemsep}. This should be done in the preamble or the file
720 % |nomencl.cfg|. Note that if you want no extra skip between entries
721 % you have to use
722 % |\setlength{\nomitemsep}{-\parsep}|
723 %
724 % \DescribeMacro{\nomprefix}%
725 % If you want, you can redefine the default prefix that is used for the
726 % sortkeys. By default, |\nomprefix| is set to ``a''; redefining it
727 % supersedes the package options \package{prefix} and \package{noprefix}.
728 %
729 %
730 % \subsubsection{Formatting the Entries}
731 %
732 % \DescribeMacro{\nomlabel}%
733 % By default, the labels are just shifted to the left within their
734 % allocated box. If you want to change this, redefine |\nomlabel|
735 % which should get one argument, e.\,g.
736 % |\renewcommand{\nomlabel}[1]{\hfil #1\hfil}| to center the symbols.
737 %
738 % \DescribeMacro{\nomentryend}%
739 % Maybe you would like to have a period at the end of every entry.
740 % Just say |\renewcommand{\nomentryend}{.}|, and there it
741 % is. Section~\ref{sec:tips:units} explains another nice application
742 % of this macro.
743 %
744 % \DescribeMacro{\eqdeclaration}\DescribeMacro{\pagedeclaration}%
745 % If you don't like the text that is used for the references to
746 % equations and pages, you can define |\eqdeclaration| and
747 % |\pagedeclaration|. Both should accept one argument, namely the
748 % equation and page number, respectively. An example is
749 % \begin{center}
750 % |\renewcommand{\eqdeclaration}[1]{, first used in eq.~(#1)}|.
751 % \end{center}
752 %
753 %
754 %
755 %
756 % \subsection{Tips and Tricks}
757 % \label{sec:tips}
758 %
759 % \changes{v3.1 (2000/09/15)}{2000/09/15}{Sample cfg files for most examples}
760 %
761 % \subsubsection{Advanced subgroups}
762 % \label{sec:tips:subgroups}
763 %
764 % The standard subgroups described in Section~\ref{sec:grouping} is
765 % just one of the possible ways to separate your index. You can do
766 % much more if you play with the \cs{nomgroup} command. Note that all
767 % entries sharing the first letter of prefix as grouped together and
768 % preceded by the \cs{nomgroup}\oarg{Uppercased first leter} command.
769 % So, for example, if you want to separate constants and variables,
770 % you may use prefixes |c...| for constants and |v...| for variables,
771 % and then write down (package \package{ifthen} being loaded by
772 % \package{nomencl})
773 % \begin{verbatim}
774 % \renewcommand{\nomgroup}[1]{%
775 % \ifthenelse{\equal{#1}{V}}{\item[\textbf{Variables}]}{%
776 % \ifthenelse{\equal{#1}{C}}{\item[\textbf{Constants}]}{}}}
777 % \end{verbatim}
778 %
779 %
780 % \subsubsection{Units}
781 % \label{sec:tips:units}
782 %
783 % Besides the obvious possibility of adding units for symbols in the
784 % description string, you can also use |\nomentryend| to shift the unit
785 % to the right margin. With package \package{siunitx} you can define
786 % \begin{macrocode}
787 %<*sample04.cfg>
788 \newcommand{\nomunit}[1]{%
789 \renewcommand{\nomentryend}{\hspace*{\fill}\si{#1}}}
790 %</sample04.cfg>
791 % \end{macrocode}
792 % and then define nomenclature as
793 % \begin{center}
794 % |\nomenclature{$l$}{Length\nomunit{\meter}}|
795 % \end{center}
796 %
797 % See Figure~\ref{fig:units} for the example of the input file.
798 %
799 % Option |nomentbl| allows an alternative way to add units to the
800 % nomenclature (Section~\ref{sec:nomentbl}).
801 %
802 % \begin{example}
803 % \begin{macrocode}
804 %<*sample04.tex>
805 \documentclass{article}
806 \usepackage[cfg=sample04.cfg]{nomencl}
807 \usepackage{siunitx}
808 \makenomenclature
809 \begin{document}
810 \section*{Main equations}
811 \begin{equation}
812 a=\frac{N}{A}
813 \end{equation}%
814 \nomenclature{$a$}{The number of angels per unit
815 area\nomunit{\per\square\meter}}%
816 \nomenclature{$N$}{The number of angels per needle point}%
817 \nomenclature{$A$}{The area of the needle
818 point\nomunit{\square\meter}}%
819 The equation $\sigma = m a$%
820 \nomenclature{$\sigma$}{The total mass of angels per unit
821 area\nomunit{\kilogram\per\square\meter}}%
822 \nomenclature{$m$}{The mass of one angel\nomunit{\kilogram}}
823 follows easily.
824 \printnomenclature
825 \end{document}
826 %</sample04.tex>
827 % \end{macrocode}
828 % \caption{A simple example with units}
829 % \label{fig:units}
830 % \end{example}
831 %
832 %
833 % \subsubsection{Expansion}
834 %
835 % \changes{v3.1 (2000/09/15)}{2000/09/01}{Expansion example added}
836 % The \package{nomencl} package tries hard to write the arguments of the
837 % |\nomenclature| macro verbatim to the glossary file. This is usually the
838 % right thing to do because some macros do not like to be expanded at the
839 % wrong moment or give weird results if they are. On the other hand, there are
840 % occasions where it is good to have the meaning (or expansion) of a macro in
841 % the glossary file instead of its name. There are quite some occasions
842 % where you will get in trouble with this expansion, for example, if the
843 % expansion of a macro contains~|@| (|\mathcal| expands to |\@mathcal|)
844 % because |@| is a special character for \MakeIndex\ and thus \MakeIndex\ will
845 % either fail or give unexpected results. You can avoid the expansion on a
846 % case by case basis by using |\protect| in front of the macro that should
847 % not be expanded.
848 %
849 % In order to get macro expansion, the redefinition of the |\@nomenclature|
850 % macro within the |\makenomenclature| macro has to be changed.
851 % \begin{macrocode}
852 %<*sample05.cfg>
853 \def\makenomenclature{%
854 \newwrite\@nomenclaturefile
855 \immediate\openout\@nomenclaturefile=\jobname\@outputfileextension
856 \def\@nomenclature{%
857 \@ifnextchar[%
858 {\@@@@nomenclature}{\@@@@nomenclature[\nomprefix]}}%
859 \PackageInfo{nomencl}{Writing nomenclature file \jobname\@outputfileextension}%
860 \let\makenomenclature\@empty}
861 % \end{macrocode}
862 % The new macro to be called by |\@nomenclature| just writes its arguments to
863 % the glossary file without further ado, so they will be expanded.
864 % \begin{macrocode}
865 \def\@@@@nomenclature[#1]#2#3{%
866 \protected@write\@nomenclaturefile{}%
867 {\string\nomenclatureentry{#1#2@[{#2}]%
868 \begingroup#3\protect\nomeqref{\theequation}%
869 |nompageref}{\thepage}}}%
870 %</sample05.cfg>
871 % \end{macrocode}
872 %
873 % The following file has completely different result when using
874 % expanded and non-expanded versions
875 % \begin{macrocode}
876 %<*sample05.tex>
877 \documentclass{article}
878 \usepackage[cfg=sample05.cfg]{nomencl}
879 \makenomenclature
880 \begin{document}
881 \section*{Main equations}
882 \begin{equation}
883 a=\frac{N}{A}
884 \end{equation}%
885 \newcommand{\magritte}{Not the number }
886 \nomenclature{$a$}{\magritte of angels per unit area}%
887 \nomenclature{$N$}{\magritte of angels per needle point}%
888 \nomenclature{$A$}{The area of the needle point}%
889 The equation $\sigma = m a$%
890 \nomenclature{$\sigma$}{The total mass of angels per unit area}%
891 \nomenclature{$m$}{The mass of one angel}
892 follows easily.
893
894 % We renew the command before printing nomenclature. However, since
895 % our nomencl.cfg uses expansion, it does not affect the result.
896 % Cf. nocfg option
897 \renewcommand{\magritte}{The number }
898 \printnomenclature
899 \end{document}
900 %</sample05.tex>
901 % \end{macrocode}
902 %
903 %
904 % \subsubsection{Glossary in ``Kopka Style''}
905 %
906 % \changes{v3.1 (2000/09/15)}{2000/09/16}{Kopka example added}
907 % I was told that the glossary in the \LaTeX\ book by Kopka looks roughly like
908 % in Figure~\ref{fig:kopka}. In order to get a glossary like this, there are
909 % quite some configurations to do.
910 %
911 % \begin{example}
912 % \textbf{Symbol}\dotfill\nopagebreak page number \\
913 % \hspace*{5mm}Explanation.
914 % \caption{Glossary entry in ``Kopka Style''}
915 % \label{fig:kopka}
916 % \end{example}
917 %
918 % First we have to change the macro |\@@@nomenclature| which takes care of
919 % writing the glossary entry to the glossary file. The only difference to the
920 % original definition is that we hand over the explanation of a symbol (\#3)
921 % and the equation number to |\nompageref| instead of writing it directly
922 % after the symbol (\#2). This is necessary because the explanation should
923 % appear after (actually below) the page number.
924 % \begin{macrocode}
925 %<*sample06.cfg>
926 \@printpagereftrue
927 \def\@@@nomenclature[#1]#2#3{%
928 \def\@tempa{#2}\def\@tempb{#3}%
929 \protected@write\@nomenclaturefile{}%
930 {\string\nomenclatureentry{#1\nom@verb\@tempa @[{\nom@verb\@tempa}]%
931 |nompageref{\begingroup\nom@verb\@tempb\protect\nomeqref{\theequation}}}%
932 {\thepage}}%
933 \endgroup
934 \@esphack}
935 % \end{macrocode}
936 % Now we change the definition of |\nompageref| so that it accepts two
937 % arguments, the explanation (\#1) and the page number (\#2). The page number
938 % is only printed if required, otherwise |\null| is used to avoid an error
939 % because of the following |\linebreak|. Note that it is \emph{not} possible
940 % to turn off the page number locally, because the explanation appears after
941 % the page number.
942 % \begin{macrocode}
943 \def\nompageref#1#2{%
944 \if@printpageref\pagedeclaration{#2}\else\leavevmode\fi
945 \linebreak#1\nomentryend\endgroup}
946 % \end{macrocode}
947 % And a few little things. We want dots and a space before the page number
948 % appears at the right margin; the explanation should end with a period; and
949 % the symbol should be printed in bold face (this only works for regular text,
950 % not for formulas).
951 % \begin{macrocode}
952 \def\pagedeclaration#1{\dotfill\nobreakspace#1}
953 \def\nomentryend{.}
954 \def\nomlabel#1{\textbf{#1}\hfil}
955 %</sample06.cfg>
956 % \end{macrocode}
957 %
958 %
959 % \subsection{Compatibility Mode}
960 % \label{sec:compatibility}
961 %
962 % With previous versions of the \package{nomencl}, the commands |\makeglossary|
963 % and |\pringlossary| were used to generate and display the nomenclature.
964 % These commands have now been depreciated, and replaced with the |\makenomenclature|
965 % and |\printnomenclature| commands. The new commands do exactly the same
966 % as the old commands, but because of the name changes, the package is
967 % now compatible with other packages which use the |\makeglossary| commands.
968 % The previous versions of \package{nomencl} also used the file extensions
969 % |.glo| and |.gls| for the generated output and input files. These extensions
970 % have now been changed to |.nlo| and |.nls| respectively---again, for increased
971 % compatibility.
972 %
973 % For all of the legacy \LaTeX\ files out there which use the old commands
974 % there is a compatibility option available so that the old commands will still
975 % work without having to change any of the existing code. To enable the
976 % compatibility mode simply supply the \textbf{compatible} option
977 % when using the package. For example:
978 % \begin{verbatim}
979 % \usepackage[compatible]{nomencl}
980 % \end{verbatim}
981 % Under compatibility mode, the package will generate and use files
982 % with the old-style file extensions (i.e. |.glo| and |.gls|).
983 %
984 % It is worth noting that even though the compatibility mode is available,
985 % it is highly recommended to update your \LaTeX\ files to use the new
986 % nomenclature commands.
987 %
988 %
989 %
990 % \subsection{Acknowledgements}
991 %
992 % Since version 5.0 the package incorporates the code from
993 % |nomentbl.dtx| by Brian Elmegaard.
994 %
995 % The authors want to thank Stefan
996 % B\"ohm and Karl Heinz Marbaise who helped testing this package.
997 %
998 % The translations were done by Joan Queralt (Catalan), Branka
999 % Lon\v{c}arevi\'{c} (Croatian), Brian Elmegaard (Danish), Denis
1000 % B.~Roegel (French), Sani Egisto (Italian), wishfort36 (Norwegian),
1001 % Artur Gorka (Polish), Pedro Areal (Portuguese), joder (Slovene),
1002 % Alejandro Lopez-Valencia (Spanish), and Boris Veytsman (Russian and
1003 % Ukrainian).
1004 %
1005 %
1006 % \subsection{Releases and Legal Issues}
1007 % \label{sec:legal}
1008 %
1009 % This package can be redistributed and/or modified under the terms
1010 % of the \LaTeX\ Project Public License distributed from CTAN
1011 % archives in the directory \url{macros/latex/base/lppl.txt}, see
1012 % e.\,g.~\cite{ctan}; either
1013 % version 1.2 of the license, or (at your option) any later version.
1014 %
1015 %
1016 % \StopEventually{%
1017 % \begin{thebibliography}{5}
1018 % \bibitem[1]{braa:ltid:1996}
1019 % Braams, Johannes; Carlisle, David; Jeffrey, Alan; Lamport, Leslie;
1020 % Mittelbach, Frank; Rowley, Chris; Sch\"opf, Rainer (1996).
1021 % \newblock\texttt{ltidxglo.dtx} -- 1996/01/20 v1.1e LaTeX Kernel
1022 % (Index and Glossary).
1023 % \newblock \href{http://mirror.ctan.org/macros/latex/base/ltidxglo.dtx}{CTAN/macros/latex/base/ltidxglo.dtx}.
1024 % \bibitem[2]{chen:auto:1987}
1025 % Chen, Pehong; Harrison, Michael~A. (1987).
1026 % \newblock Automating Index Preparation.
1027 % \newblock Report UCB/CSD 87/347, Computer Science Division, University of
1028 % California, Berkeley, CA.
1029 % \bibitem[3]{ctan}
1030 % Comprehensive {\TeX} Archive Network CTAN.
1031 % \newblock \url{ftp://ctan.tug.org/tex-archive/}.
1032 % \bibitem[4]{jone:anew:1995}
1033 % Jones, David M. (1995).
1034 % \newblock A new implementation of \LaTeX's indexing commands,
1035 % Version v4.1beta of 1995/09/28.
1036 % \newblock \href{http://mirror.ctan.org/macros/latex/contrib/camel/index.dtx}{CTAN/macros/latex/contrib/supported/camel/index.dtx}.
1037 % \bibitem[5]{knut:thet:1984}
1038 % Knuth, Donald E. (1984).
1039 % \newblock \emph{The \TeX book}.
1040 % \newblock Addison-Wesley Publishing Company, Reading, MA.
1041 % \bibitem[6]{lamp:late:1994}
1042 % Lamport, Leslie (1994).
1043 % \newblock \emph{{\LaTeX}: A Document Preparation System}.
1044 % \newblock Addison-Wesley Publishing Company, Reading, MA.
1045 % \bibitem[7]{veyt:pack:1996}
1046 % Veytsman, Boris (1996).
1047 % \newblock Package nomencl, Version 4.0.
1048 % \newblock \url{http://sarovar.org/projects/nomencl} (2000/09/15).
1049 % \end{thebibliography}}
1050 %
1051 %
1052 % \section{Implementation}
1053 %
1054 % \subsection{The \LaTeX\ Package File}
1055 %
1056 % At the beginning of this file, the |\ProvidesPackage| macro was executed. So
1057 % we only need to to state that we need \LaTeXe.
1058 % \begin{macrocode}
1059 %<*package>
1060 \NeedsTeXFormat{LaTeX2e}
1061 % \end{macrocode}
1062 %
1063 % \changes{v5.0}{2018/12/28}{Moved to xkeyval}
1064 % \changes{v5.0}{2018/12/28}{Added ifthen package}
1065 % We need \textsl{xkeyval} package for some options and \textsl{ifthen}
1066 % for grouping and \textsl{tocbasic} for TOC
1067 % \begin{macrocode}
1068 \RequirePackage{xkeyval}
1069 \RequirePackage{ifthen}
1070 % \end{macrocode}
1071 %
1072 %
1073 % \begin{macro}{\if@printeqref}
1074 % \begin{macro}{\if@printpageref}
1075 % We need two switches to decide whether references to equations and pages
1076 % should be printed.
1077 % \begin{macrocode}
1078 \newif\if@printeqref
1079 \newif\if@printpageref
1080 % \end{macrocode}
1081 % \end{macro} \end{macro}
1082 % \begin{macro}{\if@intoc}
1083 % Another switch to decide whether to add an entry to the TOC.
1084 % \begin{macrocode}
1085 \newif\if@intoc
1086 % \end{macrocode}
1087 % \end{macro}
1088 % \begin{macro}{\if@compatibilitymode}
1089 % Another switch to decide whether to run in compatibility mode.
1090 % \begin{macrocode}
1091 \newif\if@compatibilitymode
1092 % \end{macrocode}
1093 % \end{macro}
1094 %
1095 % \begin{macro}{\if@nomencl@tocbasic}
1096 % \changes{v5.2}{2019/05/05}{Reintroduced macro}
1097 % Whether we are to use tocbasic
1098 % \begin{macrocode}
1099 \newif\if@nomencl@tocbasic
1100 \@nomencl@tocbasictrue
1101 % \end{macrocode}
1102 %
1103 % \end{macro}
1104 %
1105 % And the options to set these switches globally.
1106 % \begin{macrocode}
1107 \DeclareOptionX{refeq}{\@printeqreftrue}
1108 \DeclareOptionX{norefeq}{\@printeqreffalse}
1109 \DeclareOptionX{refpage}{\@printpagereftrue}
1110 \DeclareOptionX{norefpage}{\@printpagereffalse}
1111 \DeclareOptionX{intoc}{\@intoctrue}
1112 \DeclareOptionX{notintoc}{\@intocfalse}
1113 \DeclareOptionX{compatible}{\@compatibilitymodetrue}
1114 \DeclareOptionX{noncompatible}{\@compatibilitymodefalse}
1115 \DeclareOptionX{tocbasic}{\@nomencl@tocbasictrue}
1116 \DeclareOptionX{notocbasic}{\@nomencl@tocbasicfalse}
1117 % \end{macrocode}
1118 % \begin{macro}{\nomprefix}
1119 % It might make sense to add the prefix ``a'' to every sortkey, see
1120 % Section~\ref{sec:sort}.
1121 % \begin{macrocode}
1122 \DeclareOptionX{prefix}{\def\nomprefix{a}}
1123 \DeclareOptionX{noprefix}{\def\nomprefix{}}
1124 % \end{macrocode}
1125 % \end{macro}
1126 %
1127 % \begin{macro}{\if@nomentbl}
1128 % \changes{v5.0}{2018/12/28}{New macro}
1129 % Whether to use nomentbl format
1130 % \begin{macrocode}
1131 \newif\if@nomentbl
1132 \DeclareOptionX{nomentbl}{\@nomentbltrue}
1133 \DeclareOptionX{norefeq}{\@nomentblfalse}
1134 % \end{macrocode}
1135 %
1136 % \end{macro}
1137 %
1138 % \begin{macro}{\if@loadcfg}
1139 % \changes{v5.0}{2018/12/28}{Added settable cfg file}
1140 % Another switch and the corresponding options to decide whether we
1141 % should look for a configuration file.
1142 % \begin{macrocode}
1143 \newif\if@loadcfg
1144 \DeclareOptionX{cfg}[nomencl.cfg]{\@loadcfgtrue\gdef\@cfgfile{#1}}
1145 \DeclareOptionX{nocfg}{\@loadcfgfalse}
1146 % \end{macrocode}
1147 % \end{macro}
1148 %
1149 % \begin{macro}{\if@stdsubgroups}
1150 % \changes{v5.0}{2018/12/28}{New macro}
1151 % Whether we use standard subgroups
1152 % \begin{macrocode}
1153 \newif\if@stdsubgroups
1154 \DeclareOptionX{stdsubgroups}{\@stdsubgroupstrue}
1155 \DeclareOptionX{nostdsubgroups}{\@stdsubgroupsfalse}
1156 % \end{macrocode}
1157 % \end{macro}
1158 %
1159 % \begin{macro}{\eqdeclaration}
1160 % \begin{macro}{\pagedeclaration}
1161 % \begin{macro}{\nomname}
1162 % \begin{macro}{\nomAname}
1163 % \begin{macro}{\nomGname}
1164 % \begin{macro}{\nomXname}
1165 % \begin{macro}{\nomZname}
1166 % \changes{v2.5a (1999/03/22)}{1999/03/17}{Added Danish}
1167 % \changes{v2.6 (1999/04/02)}{1999/03/23}{Added French}
1168 % \changes{v2.6 (1999/04/02)}{1999/04/01}{Use \cs{nobreakspace} instead of
1169 % \texttt{\textasciitilde} in package options}
1170 % \changes{v2.6a (1999/04/06)}{1999/04/02}{Added Russian, Spanish, Ukrainian}
1171 % \changes{v2.6b (1999/04/10)}{1999/04/06}{Added Polish}
1172 % \changes{v2.7a (1999/07/07)}{1999/07/07}{Added Italian}
1173 % \changes{v4.0 (2005/04/07)}{2005/04/07}{Updated Italian option (thanks to Lapo Mori)}
1174 % \changes{v3.1 (2000/09/15)}{2000/08/30}{Added Croatian}
1175 % \changes{v3.1a (2000/12/03)}{2000/12/03}{Added Portuguese}
1176 % \changes{v5.0}{2018/12/28}{Added defaults}
1177 % \changes{v5.1}{2019/02/08}{Changed \# to \#\# in options.}
1178 % \changes{v5.3}{2019/11/23}{Added Slovene (joder)}
1179 % \changes{v5.4}{2020/03/01}{Added Norwegian (wishfort36)}
1180 % \changes{v5.4}{2020/12/29}{Added Catalan (Joan Queralt)}
1181 % If you can help out with translations for some other languages, let me know.
1182 % \begin{macrocode}
1183 \DeclareOptionX{catalan}{%
1184 \def\eqdeclaration##1{, vegeu l'equaci\’o\nobreakspace(##1)}%
1185 \def\pagedeclaration##1{, p\`agina\nobreakspace##1}
1186 \def\nomname{Nomenclatura}
1187 \def\nomAname{Lletres llatines}%
1188 \def\nomGname{Lletres gregues}
1189 \def\nomXname{Super{\’\i}ndexs}%
1190 \def\nomZname{Sub{\’\i}ndexs}}
1191 \DeclareOptionX{croatian}{%
1192 \def\eqdeclaration##1{, vidi jednad\v{z}bu\nobreakspace(##1)}%
1193 \def\pagedeclaration##1{, stranica\nobreakspace##1}%
1194 \def\nomname{Popis simbola}%
1195 \def\nomAname{Latini\v{c}na slova}%
1196 \def\nomGname{Gr\v{c}ka slova}%
1197 \def\nomXname{Exponenats}%
1198 \def\nomZname{Indeksi}}
1199 \DeclareOptionX{danish}{%
1200 \def\eqdeclaration##1{, se ligning\nobreakspace(##1)}%
1201 \def\pagedeclaration##1{, side\nobreakspace##1}%
1202 \def\nomname{Symbolliste}%
1203 \def\nomAname{Romerske bogstaver}%
1204 \def\nomGname{Gr{\ae}ske bogstaver}%
1205 \def\nomXname{(H{\o}jtstillede) indices}%
1206 \def\nomZname{Indices}}
1207 \DeclareOptionX{english}{%
1208 \def\eqdeclaration##1{, see equation\nobreakspace(##1)}%
1209 \def\pagedeclaration##1{, page\nobreakspace##1}%
1210 \def\nomname{Nomenclature}%
1211 \def\nomAname{Latin Letters}%
1212 \def\nomGname{Greek Letters}%
1213 \def\nomXname{Superscripts}%
1214 \def\nomZname{Subscripts}}
1215 \DeclareOptionX{french}{%
1216 \def\eqdeclaration##1{, voir \'equation\nobreakspace(##1)}%
1217 \def\pagedeclaration##1{, page\nobreakspace##1}%
1218 \def\nomname{Liste des symboles}%
1219 \def\nomAname{Lettres latines}%
1220 \def\nomGname{Lettres grecques}%
1221 \def\nomXname{Indices sup{\'e}rieurs}%
1222 \def\nomZname{Indices}}
1223 \DeclareOptionX{german}{%
1224 \def\eqdeclaration##1{, siehe Gleichung\nobreakspace(##1)}%
1225 \def\pagedeclaration##1{, Seite\nobreakspace##1}%
1226 \def\nomname{Symbolverzeichnis}%
1227 \def\nomAname{Lateinische Buchstaben}%
1228 \def\nomGname{Griechische Buchstaben}%
1229 \def\nomXname{(hochgestellte) Indizes}%
1230 \def\nomZname{Indizes}}
1231 \DeclareOptionX{italian}{%
1232 \def\eqdeclaration##1{, vedi equazione\nobreakspace(##1)}%
1233 \def\pagedeclaration##1{, pagina\nobreakspace##1}%
1234 \def\nomname{Elenco dei simboli}%
1235 \def\nomAname{Lettere latine}%
1236 \def\nomGname{Lettere greche}%
1237 \def\nomXname{Apici}%
1238 \def\nomZname{Indici}}
1239 \DeclareOptionX{norwegian-bokmaal}{%
1240 \def\eqdeclaration##1{, se ligning\nobreakspace(##1)}%
1241 \def\pagedeclaration##1{, side\nobreakspace##1}%
1242 \def\nomname{Nomenklatur}%
1243 \def\nomAname{Romerske bokstaver}%
1244 \def\nomGname{Greske bokstaver}%
1245 \def\nomXname{Hevet skrift}%
1246 \def\nomZname{Senket skrift}}
1247 \DeclareOptionX{norwegian-nynorsk}{%
1248 \def\eqdeclaration##1{, se likning\nobreakspace(##1)}%
1249 \def\pagedeclaration##1{, side\nobreakspace##1}%
1250 \def\nomname{Nomenklatur}%
1251 \def\nomAname{Romarske bokstavar}%
1252 \def\nomGname{Greske bokstavar}%
1253 \def\nomXname{Hevd skrift}%
1254 \def\nomZname{Senka skrift}}
1255 \DeclareOptionX{polish}{%
1256 \def\eqdeclaration##1{, porownaj rownanie\nobreakspace(##1)}%
1257 \def\pagedeclaration##1{, strona\nobreakspace##1}%
1258 \def\nomname{Lista symboli}%
1259 \def\nomAname{Litery {\l}aci\'nskie}%
1260 \def\nomGname{Litery greckie}%
1261 \def\nomXname{Indeksy g\'orny}%
1262 \def\nomZname{Indeksy dolne}}
1263 \DeclareOptionX{portuguese}{%
1264 \def\eqdeclaration##1{, veja equa\c{c}\~ao\nobreakspace(##1)}%
1265 \def\pagedeclaration##1{, p\'agina\nobreakspace##1}%
1266 \def\nomname{Nomenclatura}%
1267 \def\nomAname{Letras latinas}%
1268 \def\nomGname{Letras gregas}%
1269 \def\nomXname{Sobrescritos}%
1270 \def\nomZname{Subscritos}}
1271 \DeclareOptionX{russian}{%
1272 \def\eqdeclaration##1{, \cyrs\cyrm.\nobreakspace(##1)}%
1273 \def\pagedeclaration##1{, \cyrs\cyrt\cyrr.\nobreakspace##1}%
1274 \def\nomname{\CYRS\cyrp\cyri\cyrs\cyro\cyrk%
1275 \ \cyro\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyri%
1276 \cyrishrt}%
1277 \def\nomAname{\CYRL\cyra\cyrt\cyri\cyrn\cyrs\cyrk\cyri\cyre\
1278 \cyrb\cyru\cyrk\cyrv\cyrery}%
1279 \def\nomGname{\CYRG\cyrr\cyre\cyrch\cyre\cyrs\cyrk\cyri\cyre\
1280 \cyrb\cyru\cyrk\cyrv\cyrery}%
1281 \def\nomXname{\CYRN\cyra\cyrd\cyrs\cyrt\cyrr\cyro\cyrch\cyrn\cyrery\cyre\
1282 \cyri\cyrn\cyrd\cyre\cyrk\cyrs\cyrery}%
1283 \def\nomZname{\CYRP\cyro\cyrd\cyrs\cyrt\cyrr\cyro\cyrch\cyrn\cyrery\cyre\
1284 \cyri\cyrn\cyrd\cyre\cyrk\cyrs\cyrery}}
1285 \DeclareOptionX{slovene}{%
1286 \def\eqdeclaration##1{, glej ena\v{c}bo\nobreakspace(##1)}%
1287 \def\pagedeclaration##1{, stran\nobreakspace##1}%
1288 \def\nomname{Seznam simbolov}%
1289 \def\nomAname{Latinske \v{c}rke}%
1290 \def\nomGname{Gr\v{s}ke \v{c}rke}%
1291 \def\nomXname{Eksponenti}%
1292 \def\nomZname{Indeksi}}
1293 \DeclareOptionX{spanish}{%
1294 \def\eqdeclaration##1{, v\'ease la ecuaci\'on\nobreakspace(##1)}%
1295 \def\pagedeclaration##1{, p\'agina\nobreakspace##1}%
1296 \def\nomname{Nomenclatura}%
1297 \def\nomAname{Letras latinas}%
1298 \def\nomGname{Letras griegas}%
1299 \def\nomXname{Super{\'\i}ndices}%
1300 \def\nomZname{Sub{\'\i}ndices}}
1301 \DeclareOptionX{ukrainian}{%
1302 \def\eqdeclaration##1{, \cyrd\cyri\cyrv.\nobreakspace(##1)}%
1303 \def\pagedeclaration##1{, \cyrs\cyrt\cyro\cyrr.\nobreakspace##1}%
1304 \def\nomname{\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk%
1305 \ \cyrp\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyrsftsn}%
1306 \def\nomAname{\CYRL\cyra\cyrt\cyri\cyrn\cyrs\cyrsftsn\cyrk\cyrii\
1307 \cyrl\cyrii\cyrt\cyre\cyrr\cyri}%
1308 \def\nomGname{\CYRG\cyrr\cyre\cyrc\cyrsftsn\cyrk\cyrii\
1309 \cyrl\cyrii\cyrt\cyre\cyrr\cyri}%
1310 \def\nomXname{\CYRV\cyre\cyrr\cyrh\cyrn\cyrii\
1311 \cyrii\cyrn\cyrd\cyre\cyrk\cyrs\cyri}%
1312 \def\nomZname{\CYRII\cyrn\cyrd\cyre\cyrk\cyrs\cyri}}
1313 % \end{macrocode}
1314 % \end{macro}\end{macro}\end{macro}
1315 % \end{macro}\end{macro}\end{macro}\end{macro}
1316 % Finally set the default options and process everything.
1317 % \begin{macrocode}
1318 \ExecuteOptionsX{noncompatible,notintoc,norefeq,norefpage,prefix,cfg,english,nostdsubgroups,tocbasic}
1319 \ProcessOptionsX\relax
1320 % \end{macrocode}
1321 %
1322 % In the |nomentbl| mode we need a couple more packages
1323 % \begin{macrocode}
1324 \if@nomentbl
1325 \RequirePackage{array,longtable, siunitx}
1326 \fi
1327 % \end{macrocode}
1328 %
1329 % In |tocbasic| mode we need to load \textsl{tocbasic}
1330 % \begin{macrocode}
1331 \if@nomencl@tocbasic
1332 \RequirePackage{tocbasic}
1333 \addtotoclist[nomencl]{nlo}
1334 \addtotoclist[nomencl]{nls}
1335 \fi
1336 % \end{macrocode}
1337 %
1338 %
1339 % Checking whether we need nomenclature in toc
1340 % \begin{macrocode}
1341 \if@intoc
1342 \if@nomencl@tocbasic
1343 \setuptoc{nls}{totoc}
1344 \fi
1345 \fi
1346 % \end{macrocode}
1347 %
1348 %
1349 % \begin{macro}{\@outputfileextension}
1350 % \begin{macro}{\@inputfileextension}
1351 % The default file extension for the output and input nomenclature files are
1352 % |.nlo| and |.nls| respectively. In compatibility mode, these are changes to |.glo|
1353 % and |.gls|.
1354 % \begin{macrocode}
1355 \if@compatibilitymode%
1356 \def\@outputfileextension{.glo}%
1357 \def\@inputfileextension{.gls}%
1358 \else%
1359 \def\@outputfileextension{.nlo}%
1360 \def\@inputfileextension{.nls}%
1361 \fi%
1362 % \end{macrocode}
1363 % \end{macro}
1364 % \end{macro}
1365 % \begin{macro}{\makenomenclature}
1366 % The definition of \cs{makenomenclature} is pretty much the same as in the \LaTeX\
1367 % kernel for \cs{makeglossary}, we only use \cs{@nomenclature} instead of \cs{glossary}.
1368 % \begin{macrocode}
1369 \def\makenomenclature{%
1370 \newwrite\@nomenclaturefile
1371 \immediate\openout\@nomenclaturefile=\jobname\@outputfileextension
1372 \def\@nomenclature{%
1373 \@bsphack
1374 \begingroup
1375 \@sanitize
1376 \@ifnextchar[%
1377 {\@@@nomenclature}{\@@@nomenclature[\nomprefix]}}%
1378 \PackageInfo{nomencl}{Writing nomenclature file \jobname\@outputfileextension}%
1379 \let\makenomenclature\@empty}
1380 % \end{macrocode}
1381 % \end{macro}
1382 % \begin{macro}{\makeglossary}
1383 % The |\makeglossary| command has been depreciated, and is only available in compatibility mode.
1384 % \begin{macrocode}
1385 \if@compatibilitymode\let\makeglossary\makenomenclature\fi%
1386 % \end{macrocode}
1387 % \end{macro}
1388 % \begin{macro}{\nom@verb}
1389 % \changes{v2.7 (1999/05/14)}{1999/05/11}{Added macro}
1390 % The macro \cs{nom@verb}, which is copied from~\cite{jone:anew:1995}
1391 % and~\cite[p.~382]{knut:thet:1984}, makes it possible to use
1392 % \cs{nomenclature} in another macro.
1393 % \begin{macrocode}
1394 \def\nom@verb{\expandafter\strip@prefix\meaning}
1395 % \end{macrocode}
1396 % \end{macro}
1397 % \begin{macro}{\nomenclature}
1398 % \changes{v2.7 (1999/05/14)}{1999/05/11}{Protected}
1399 % This macro just protects the ``real'' \cs{@nomenclature} macro. I am not
1400 % sure whether this makes sense because you shouldn't use \cs{nomenclature}
1401 % in something like \cs{section} anyway, but it doesn't hurt.
1402 % \begin{macrocode}
1403 \def\nomenclature{\protect\@nomenclature}
1404 % \end{macrocode}
1405 % \end{macro}
1406 %
1407 %
1408 % \begin{macro}{\@nomenclature}
1409 % \begin{macro}{\@@nomenclature}
1410 % \changes{v5.0}{2018/12/28}{Nomentbl option}
1411 % Without an executed \cs{makenomenclature}, \cs{@nomenclature} will only
1412 % change some catcodes and call the macro \cs{@@nomenclature}
1413 % to gobble its arguments.
1414 % \begin{macrocode}
1415 \def\@nomenclature{%
1416 \@bsphack
1417 \begingroup
1418 \@sanitize
1419 \@ifnextchar[%
1420 {\@@nomenclature}{\@@nomenclature[\nomprefix]}}
1421 \if@nomentbl
1422 \def\@@nomenclature[#1]#2#3#4#5{\endgroup\@esphack}
1423 \else
1424 \def\@@nomenclature[#1]#2#3{\endgroup\@esphack}
1425 \fi
1426 % \end{macrocode}
1427 % \end{macro} \end{macro}
1428 % \begin{macro}{\@@@nomenclature}
1429 % \changes{v2.7 (1999/05/14)}{1999/05/11}{More robust by using \cs{nom@verb}}
1430 % \changes{v5.0}{2018/12/28}{Nomentbl option}
1431 % \changes{v5.6}{2021/11/10}{Nomentbl option now does not use the
1432 % deprecated |s| columnstyle}
1433 % If \cs{makenomenclature} was already executed, then \cs{@nomenclature}
1434 % calls the macro \cs{@@@nomenclature} which writes to the nomenclature file.
1435 % It puts the prefix in front of the entry, adds brackets |[]| around the
1436 % entry (because it will be the argument of an \cs{item}) and adds
1437 % possible references at the end of the entry description. A group
1438 % is started to keep changes to the reference switches local.
1439 % The arguments are written using \cs{nom@verb} so they will not be
1440 % expanded, even when \cs{nomenclature} is used within another macro.
1441 % By the way, \cs{@bsphack} and \cs{@esphack} makes \cs{nomenclature}
1442 % disappear between two spaces; unfortunately this doesn't work if
1443 % \cs{nomenclature} is the first thing in a line.
1444 % \begin{macrocode}
1445 \if@nomentbl
1446 \def\@@@nomenclature[#1]#2#3#4#5{%
1447 \def\@tempa{#2}\def\@tempb{#3}%
1448 \protected@write\@nomenclaturefile{}%
1449 {\string\nomenclatureentry{#1\nom@verb\@tempa @&{\nom@verb\@tempa}&%
1450 \begingroup\nom@verb\@tempb\endgroup &\unit{#4}&%
1451 \begingroup#5\endgroup&\begingroup\protect\nomeqref{\theequation}%
1452 |nompageref}{\thepage}}%
1453 \endgroup
1454 \@esphack}
1455 \else
1456 \def\@@@nomenclature[#1]#2#3{%
1457 \def\@tempa{#2}\def\@tempb{#3}%
1458 \protected@write\@nomenclaturefile{}%
1459 {\string\nomenclatureentry{#1\nom@verb\@tempa @[{\nom@verb\@tempa}]%
1460 \begingroup\nom@verb\@tempb\protect\nomeqref{\theequation}%
1461 |nompageref}{\thepage}}%
1462 \endgroup
1463 \@esphack}
1464 \fi
1465 % \end{macrocode}
1466 % \end{macro}
1467 % \begin{macro}{\nomgroup}
1468 % \changes{v5.0}{2018/12/28}{Rewrote}
1469 % The next macro is executed between each character group in the
1470 % nomenclature. The argument is the first character of the group.
1471 % \begin{macrocode}
1472 \if@stdsubgroups
1473 \if@nomentbl
1474 \def\nomgroup#1{%
1475 \ifthenelse{\equal{#1}{A}}{%
1476 \item&\multicolumn{5}{@{}l}{\textbf{\nomAname}}}{%
1477 \ifthenelse{\equal{#1}{G}}{%
1478 \item&\multicolumn{5}{@{}l}{\textbf{\nomGname}}}{%
1479 \ifthenelse{\equal{#1}{X}}{%
1480 \item&\multicolumn{5}{@{}l}{\textbf{\nomXname}}}{%
1481 \ifthenelse{\equal{#1}{Z}}{%
1482 \item&\multicolumn{5}{@{}l}{\textbf{\nomZname}}}{%
1483 {}}}}}}
1484 \else
1485 \def\nomgroup#1{%
1486 \ifthenelse{\equal{#1}{A}}{%
1487 \item[\textbf{\nomAname}]}{%
1488 \ifthenelse{\equal{#1}{G}}{%
1489 \item[\textbf{\nomGname}]}{%
1490 \ifthenelse{\equal{#1}{X}}{%
1491 \item[\textbf{\nomXname}]}{%
1492 \ifthenelse{\equal{#1}{Z}}{%
1493 \item[\textbf{\nomZname}]}{%
1494 {}}}}}}
1495 \fi
1496 \else
1497 \def\nomgroup#1{}
1498 \fi
1499 % \end{macrocode}
1500 % \end{macro}
1501 % \begin{macro}{\nomlabelwidth}
1502 % This is the default label width for the nomenclature. It can be changed
1503 % e.\,g.~in the |cfg| file.
1504 % \begin{macrocode}
1505 \newdimen\nomlabelwidth
1506 \nomlabelwidth1cm\relax
1507 % \end{macrocode}
1508 % \end{macro}
1509 % \begin{macro}{\nom@tempdim}
1510 % \changes{v2.9 (1999/11/23)}{1999/11/23}{New temporary dimension}
1511 % \begin{macro}{\printnomenclature}
1512 % \begin{macro}{\@printnomenclature}
1513 % The optional argument is read and assigned to \cs{nom@tempdim}. Then
1514 % the |gls| file is read.
1515 % \begin{macrocode}
1516 \newdimen\nom@tempdim
1517 \def\printnomenclature{%
1518 \@ifnextchar[%
1519 {\@printnomenclature}{\@printnomenclature[\nomlabelwidth]}}
1520 \def\@printnomenclature[#1]{%
1521 \nom@tempdim#1\relax
1522 \@input@{\jobname\@inputfileextension}}
1523 % \end{macrocode}
1524 % \end{macro} \end{macro} \end{macro}
1525 % \begin{macro}{\printglossary}
1526 % The |\printglossary| command has been depreciated, and is only available in compatibility mode.
1527 % \begin{macrocode}
1528 \if@compatibilitymode\let\printglossary\printnomenclature\fi%
1529 % \end{macrocode}
1530 % \end{macro}
1531 % \begin{macro}{\nomlabel}
1532 % \begin{macro}{\nompreamble}
1533 % \begin{macro}{\nompostamble}
1534 % \begin{macro}{\nomentryend}
1535 % Now some bells and whistles to format the nomenclature:
1536 % the definition of the label, the preamble, the postamble and the
1537 % symbol that is added at the end of an entry. The last three are
1538 % defined to do nothing by default.
1539 % \begin{macrocode}
1540 \def\nomlabel#1{#1\hfil}
1541 \def\nompreamble{}
1542 \def\nompostamble{}
1543 \def\nomentryend{}
1544 % \end{macrocode}
1545 % \end{macro} \end{macro} \end{macro} \end{macro}
1546 % \begin{macro}{\nomitemsep}
1547 % \changes{v2.8 (1999/09/09)}{1999/09/09}{New skip \cs{nomitemsep}}
1548 % The skip between two items is adjustable by changing \cs{nomitemsep}.
1549 % It defaults to \cs{itemsep}.
1550 % \begin{macrocode}
1551 \newskip\nomitemsep
1552 \nomitemsep\itemsep
1553 % \end{macrocode}
1554 % \end{macro}
1555 %
1556 % \begin{macro}{\setnomtableformat}
1557 % \changes{v5.0}{2018/12/28}{Added macro}
1558 % \changes{v5.6}{2021/11/10}{Switched to |c| column for units}
1559 % The format of the nomenclature table. We insert an empty left
1560 % column due to the way \TeX\ sees \cs{multicolumn} in \cs{nomgroup}
1561 % command.
1562 % \begin{macrocode}
1563 \def\setnomtableformat#1{\def\@nomtableformat{l@{}#1}}
1564 \setnomtableformat{lp{0.45\textwidth}cp{0.3\textwidth}@{}l}
1565 % \end{macrocode}
1566 %
1567 % \end{macro}
1568 %
1569 %
1570 % \begin{environment}{thenomenclature}
1571 %\changes{v5.1}{2019/01/27}{Changed \cs{markboth} to \cs{@mkboth} for
1572 % chapters}
1573 % \changes{v5.1}{2019/02/08}{Added tocbasic}
1574 % \changes{v5.2}{2019/05/05}{Made tocbasic optional}
1575 % The |thenomenclature| environment formats its title and optionally
1576 % inserts an item in the TOC, both are dependant on
1577 % whether the \cs{chapter} command is available or not. After
1578 % printing the preamble, a list is started with the \cs{labelwidth}
1579 % being set to the value defined in the optional argument of
1580 % \cs{printnomenclature}, unless |nomentbl| is chosen. In the latter
1581 % case we start a longtable. Note that each row of the table starts
1582 % with \cs{item}, so we need to make the first \cs{item} noop, and all
1583 % the subsequent ones to produce \cs{cr}. We also add \cs{cr} at the
1584 % end of the table.
1585 % \begin{macrocode}
1586 \def\thenomenclature{%
1587 \providecommand*{\listofnlsname}{\nomname}%
1588 \if@nomencl@tocbasic
1589 \let\list@fname\listofnlsname
1590 \def\@currext{nls}%
1591 \tocbasic@listhead{\list@fname}%
1592 \else
1593 \@ifundefined{chapter}%
1594 {
1595 \section*{\nomname}
1596 \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
1597 }%
1598 {
1599 \chapter*{\nomname}
1600 \@mkboth{\nomname}{\nomname}%
1601 \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
1602 }%
1603 \fi
1604 \nompreamble
1605 \if@nomentbl
1606 \let\itemOrig=\item
1607 \def\item{\gdef\item{\\}}%
1608 \expandafter\longtable\expandafter{\@nomtableformat}
1609 \else
1610 \list{}{%
1611 \labelwidth\nom@tempdim
1612 \leftmargin\labelwidth
1613 \advance\leftmargin\labelsep
1614 \itemsep\nomitemsep
1615 \let\makelabel\nomlabel}%
1616 \fi
1617 }
1618 \def\endthenomenclature{%
1619 \if@nomentbl
1620 \item\endlongtable
1621 \global\let\item=\itemOrig
1622 \else
1623 \endlist
1624 \fi
1625 \nompostamble}
1626 % \end{macrocode}
1627 % \end{environment}
1628 % \begin{macro}{\nomrefeq}
1629 % \begin{macro}{\refpage}
1630 % \begin{macro}{\refeqpage}
1631 % \begin{macro}{\norefeq}
1632 % \begin{macro}{\norefpage}
1633 % \begin{macro}{\norefeqpage}
1634 % These are the switches to turn referencing on or off locally for a
1635 % single entry.
1636 % \begin{macrocode}
1637 \def\nomrefeq{\@printeqreftrue}
1638 \def\nomrefpage{\@printpagereftrue}
1639 \def\nomrefeqpage{\@printeqreftrue\@printpagereftrue}
1640 \def\nomnorefeq{\@printeqreffalse}
1641 \def\nomnorefpage{\@printpagereffalse}
1642 \def\nomnorefeqpage{\@printeqreffalse\@printpagereffalse}
1643 % \end{macrocode}
1644 % \end{macro} \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
1645 % \begin{macro}{\nomeqref}
1646 % The equation is only referenced if the corresponding switch is
1647 % true. Since \MakeIndex\ tends to insert a line break just before
1648 % the page number, we have to add \cs{ignorespaces} at the end.
1649 % \begin{macrocode}
1650 \def\nomeqref#1{\if@printeqref\eqdeclaration{#1}\fi\ignorespaces}
1651 % \end{macrocode}
1652 % \end{macro}
1653 % \begin{macro}{\nompageref}
1654 % The page is also only referenced if requested. Then the end symbol is
1655 % added and finally the group started in \cs{@@@nomenclature} is closed.
1656 % \begin{macrocode}
1657 \def\nompageref#1{\if@printpageref\pagedeclaration{#1}\fi%
1658 \nomentryend\endgroup}
1659 % \end{macrocode}
1660 % \end{macro}
1661 %
1662 % The commands defined in the \texttt{.ist} file
1663 %
1664 % Read the config file if it exists and the corresponding option was given.
1665 % \begin{macrocode}
1666 \if@loadcfg
1667 \InputIfFileExists{\@cfgfile}{%
1668 \PackageInfo{nomencl}{Using the configuration file \@cfgfile}}{}
1669 \fi
1670 % \end{macrocode}
1671 %
1672 %
1673 %
1674 %
1675 % The end.
1676 % \begin{macrocode}
1677 %</package>
1678 % \end{macrocode}
1679 %
1680 %
1681 % \subsection{The \MakeIndex\ Style File}
1682 % \label{sec:ist}
1683 %
1684 % The ``magic word'' for \MakeIndex\ in the input file is
1685 % \cs{nomenclatureentry}.
1686 % \begin{macrocode}
1687 %<*idxstyle>
1688 %% ---- for input file ----
1689 keyword "\\nomenclatureentry"
1690 % We use % as a quote character since " is active in some languages
1691 quote '%'
1692 % \end{macrocode}
1693 % Define what is printed at the beginning and the end of the file and
1694 % the skip between groups. Since we already write \cs{nomgroup} between
1695 % groups, we define |group_skip| to just input an empty line.
1696 % \begin{macrocode}
1697 %% ---- for output file ----
1698 preamble "\n\\begin{thenomenclature} \n"%
1699 postamble "\n\n\\end{thenomenclature}\n" group_skip "\n"
1700 % \end{macrocode}
1701 % Since we can't handle multiple pages for an entry anyway, we also
1702 % don't need any delimiters.
1703 % \begin{macrocode}
1704 delim_0 ""
1705 delim_1 ""
1706 delim_2 ""
1707 % \end{macrocode}
1708 % Now the macro between the groups. Since the flag is positive, the
1709 % character will be inserted as a capital letter. As the comment
1710 % states, this will cause some warnings. If someone has a better
1711 % solution, let me know.
1712 % \begin{macrocode}
1713 %% The next lines will produce some warnings when
1714 %% running Makeindex as they try to cover two different
1715 %% versions of the program:
1716 lethead_prefix "\\nomgroup{"
1717 lethead_suffix "}"
1718 lethead_flag 1
1719 heading_prefix "\\nomgroup{"
1720 heading_suffix "}"
1721 headings_flag 1
1722 line_max 1000
1723 %</idxstyle>
1724 % \end{macrocode}
1725 %
1726 %
1727 %
1728 % \Finale