summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nomencl/nomencl.dtx
blob: ff5f3dedcdd9c1b7af5290013a10ddb0fdef5b43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
% \iffalse
% File nomencl.dtx
% Copyright 1996-2020 Boris Veytsman, Bernd Shandl, Lee Netherton, CV
% Radhakrishnan, Brian Elmegaard
% 
%
% Documentation and documented source code for the nomencl package.
%
% See the README file for instructions.
%
% This file can be redistributed and/or modified under the terms
% of the LaTeX Project Public License distributed from CTAN
% archives in the directory macros/latex/base/lppl.txt; either
% version 1.2 of the license, or (at your option) any later version.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Boris Veytsman,
% <borisv@lk.net>
% 
%
%
%<*dtx>
          \ProvidesFile{nomencl.dtx}%
%</dtx>
%<package>\ProvidesPackage{nomencl}%
%<driver>\ProvidesFile{nomencl.drv}%
%<*package|driver>
% \fi
%         \ProvidesFile{nomencl.dtx}%
          [2020/03/01 v5.4 Nomenclature package]
%
% \iffalse
%</package|driver>
%<*driver>
\documentclass[11pt]{ltxdoc}%
\RequirePackage{fancyvrb}%
\RequirePackage{hypdoc}%
\RequirePackage[nocfg]{nomencl}%

\hypersetup{%
    hyperindex=true,
    colorlinks=true,
    linkcolor=blue,
    anchorcolor=blue,
    citecolor=blue,
    filecolor=blue,
    menucolor=blue,
    pagecolor=blue,
    urlcolor=blue,
    bookmarksnumbered=true,
    pdftitle={Documentation for the nomencl Package},
    pdfauthor={Boris Veytsman, Bernd Schandl, Lee Netherton, CV
    Radhakrishnan},
    pdfsubject={Provides nomenclature automation in LaTeX},
    pdfkeywords={nomenclature latex generation symbol list}
}%

%% Comment out the next line if you want the documentation for the source code.
%%\OnlyDescription

\AtBeginDocument{\RecordChanges}
\AtEndDocument{\addcontentsline{toc}{section}{Change Log}\PrintChanges}

%% Uncomment the next two lines for a command index.
%% See also the instructions above (in nomencl.drv).
\AtBeginDocument{\CodelineIndex}
\AtEndDocument{\setcounter{IndexColumns}{2}\addcontentsline{toc}{section}{Index}\PrintIndex}

\begin{document}
  \DocInput{nomencl.dtx}
\end{document}
%</driver>
% \fi
%
%
% \changes{v2.2 (1996/11/25)}{1996/11/25}{Last version released by
%   Boris Veytsman}
% \changes{v2.5 (1999/03/13)}{1999/03/02}{Complete rewrite of the
%   package and the documentation}
% \changes{v2.6 (1999/04/02)}{1999/04/01}{Use \cs{GetFileInfo}}
% \changes{v2.7a (1999/07/07)}{1999/07/07}{Merged \texttt{licence.txt}
%   into \texttt{README}}
% \changes{v2.8 (1999/09/09)}{1999/09/09}{Email changed}
% \changes{v3.0 (2000/03/05)}{2000/03/05}{WWW address changed}
% \changes{v3.1 (2000/09/15)}{2000/09/15}{Do not read cfg file in
%   documentation}
% \changes{v3.1 (2000/09/15)}{2000/09/15}{WWW address changed (again)}
% \changes{v3.1b (2001/09/30)}{2001/09/30}{WWW address changed (again)}
% \changes{v3.1c (2001/10/02)}{2001/10/02}{Minor documentation changes}
% \changes{v4.0 (2005/03/31)}{2005/03/31}{Improved compatibility with other
% Glossary/MakeIndex packages. Added option to insert Nomenclature into toc.
% Amended documentation accordingly.}
% \changes{v4.1 (2005/04/27)}{2005/04/27}{Improvements to the documentation,
% including hyperref support}
% \changes{v5.0}{2018/12/28}{Rewrote documentation}
% \changes{v5.2}{2019/05/05}{New options: tocbasic, notocbasic}
%
% \GetFileInfo{nomencl.dtx}
%
%
% \MakeShortVerb{\|}
% \setlength{\hfuzz}{8pt}
% \newcommand{\MakeIndex}{\textsl{MakeIndex}}
% \newcommand{\xindy}{\mbox{\normalfont\textbf{\textsf{x\kern-0.7pt%
%         \shortstack{{\scriptsize$\circ$}\\[-2pt]\i}\kern-1pt ndy}}}}
% \let\package\textsf
% \let\tab\indent
% \let\example=\figure
% \let\endexample=\endfigure
%
% \title{\package{nomencl}:
%   A Package to Create a Nomenclature}
% \author{Boris Veytsman\and
%       Bernd Schandl\and
%       Lee Netherton\and CV Radhakrishnan\and
%       Brian Elmegaard\end{tabular}\\
%       \begin{center}with contributions by\end{center}\begin{tabular}[t]{c}  
%       Stefan Pinnow\and
%       Patrick Egan\and
%       Rasmus Solmer Eriksen\and
%       Andrea Kern\and
%       Christian Faulhammer}
% \date{Package version \fileversion\ of \filedate}
% \maketitle
% \tableofcontents
% \listoffigures
% \clearpage
%
% 
%
% \section{Introduction}
% How often did you try to understand a theorem in a book, but just
% couldn't figure out what all those strange symbols were all about? The
% \package{nomencl} package should help authors format a nomenclature.
% It uses the powerful capabilities of the \MakeIndex\ program to generate
% such a list automatically using information provided by the author
% throughout the text.
%
%
%\subsection{History}
%\label{sec:history}
%
% This package was written by Boris Veytsman for his paper in AiCHE in
% 1996.  It was improved by Bernd Schandl,
% Lee Netherton, CV Radhakrishnan, and
% Brian Elmegaard up to 2006.  In 2006 a version of \package{nomencl}
% for table-like nomenclature lists was released by Brian Elmegaard as
% \package{nomentbl}. 
%
% In 2018 Boris Veytsman took over the package, and merged the
% \package{nomentbl} fork back.  He also changed some code, trying to
% keep the compatibility with the older \package{nomencl} and
% \package{nomentbl}.
%
% \subsection{Important Notes for Users of Previous Versions}
%
% An update to the \package{nomencl} package has included some major
% changes to some of the commands. In particular, the |\makeglossary|
% and |\printglossary| commands have now been renamed to
% |\makenomenclature| and |\printnomenclature| respectively. The
% reason for this change is to increase the package's compatibility
% with other MakeIndex using packages. With this increased
% compatibility, users will be able to have nomenclatures, glossaries
% and indexes all in one document.
%
% There is a compatibility option that will allow you to still use
% your |\makeglossary| and |\printglossary| commands (see section
% \ref{sec:options}), but it is advised that you change your
% |\|\ldots|glossary| commands to the new |\|\ldots|nomenclature|
% commands in your \LaTeX\ files. For more information
% on the compatibility mode see section \ref{sec:compatibility}.
%
% \section{Usage}
%
% \subsection{The Basics}
%
% The creation of the nomenclature list is very similar to the creation of
% an index~\cite[App.~A]{lamp:late:1994}. You need to:
% \begin{itemize}
% \item Put |\usepackage[|\meta{options}|]{nomencl}| in the preamble of
%   your document.
% \item \DescribeMacro{\makenomenclature}
%   Put |\makenomenclature| in the preamble of your document.
% \item \DescribeMacro{\nomenclature}
%   Issue the |\nomenclature| command (see Section~\ref{sec:Main-Command})
%   for each symbol you want to have included in the nomenclature list.
%   The best place for this command is immediately after you introduce
%   the symbol for the first time.
% \item \DescribeMacro{\printnomenclature}
%   Put |\printnomenclature| at the place you want to have your
%   nomenclature list.
% \end{itemize}
%
% Now put your file through \LaTeX. The command |\makenomenclature| will
% instruct \LaTeX\ to open the nomenclature file \meta{filename}|.nlo|
% corresponding to your \LaTeX\ file \meta{filename}|.tex| and to
% write the information from your |\nomenclature| commands to this file.
%
% \changes{v2.7 (1999/05/14)}{1999/05/11}{Mention need to change quote
%   character for German users}
% The next step is to invoke \MakeIndex. You should instruct
% \MakeIndex\ to use \meta{filename}|.nlo| as your input file,
% use |nomencl.ist| as your style
% file
% and write output to the file \meta{filename}|.nls|.
% How to do this depends on your implementation of \MakeIndex. For
% most UNIX implementations you should write something like
% \begin{center}
% |makeindex| \meta{filename}|.nlo -s nomencl.ist -o|
%   \meta{filename}|.nls|  
% \end{center}
% 
% 
%
% Now you have the file \meta{filename}|.nls| that contains your
% nomenclature list properly ordered. The last step is to invoke
% \LaTeX\ on your master file \meta{filename}|.tex| once more. It will
% input your |.nls| file and process it accordingly to the current
% options. That's all!
%
%
% \subsection{The Main Command}
% \label{sec:Main-Command}
%
% \DescribeMacro{\nomenclature}
% The main command of the \package{nomencl} package has the following
% syntax:
% \begin{center}
%   |\nomenclature[|\meta{prefix}|]{|\meta{symbol}|}{|\meta{description}|}|
% \end{center}
% where \meta{prefix} is used for fine tuning the sort order,
% \meta{symbol} is the symbol you want to describe and \meta{description}
% is the actual description. The sortkey will be \meta{prefix}\meta{symbol},
% where \meta{prefix} is either the one from the optional argument or, if no
% optional argument was given, the default \meta{prefix} which may be empty.
% See Section~\ref{sec:sort} to make sense of this.
%
% Put this command immediately after the equation or text that
% introduces \meta{symbol}. Usually it is a good idea to avoid a space
% or an unquoted newline just in front of the |\nomenclature| command.
% Put a |%| at the end of the preceding line if necessary.
% Don't forget to enclose math in \meta{symbol} in |$| signs.
%
% Let's have a look at a simple example. If your input file looks like
% the one in Figure~\ref{fig:simple} then your nomenclature should
% look like Figure~\ref{fig:simple.out}.
%
% \begin{example}
%    \begin{macrocode}
%<*sample01.tex>
\documentclass{article}
\usepackage[nocfg]{nomencl}
\makenomenclature
\begin{document}
\section*{Main equations}
\begin{equation}
  a=\frac{N}{A}
\end{equation}%
\nomenclature{$a$}{The number of angels per unit area\nomrefeq}%
\nomenclature{$N$}{The number of angels per needle point\nomrefpage}%
\nomenclature{$A$}{The area of the needle point}%
The equation $\sigma = m a$%
\nomenclature{$\sigma$}{The total mass of angels per unit area\nomrefeqpage}%
\nomenclature{$m$}{The mass of one angel}
follows easily.
\eqdeclaration{32}
\printnomenclature
\end{document}
%</sample01.tex>
%    \end{macrocode}
% \caption{Input for the simple example}
% \label{fig:simple}
% \end{example}
% \begin{example}
%\begin{thenomenclature} 
%\nomgroup{A}
%  \item [{$\sigma$}]\begingroup The total mass of angels per unit area\nomrefeqpage\nomeqref {1}\nompageref{1}
%  \item [{$A$}]\begingroup The area of the needle point\nomeqref {1}\nompageref{1}
%  \item [{$a$}]\begingroup The number of angels per unit area\nomrefeq\nomeqref {1}\nompageref{1}
%  \item [{$m$}]\begingroup The mass of one angel\nomeqref {1}\nompageref{1}
%  \item [{$N$}]\begingroup The number of angels per needle point\nomrefpage\nomeqref {1}\nompageref{1}
%\end{thenomenclature}
% \caption{The typeset output for the simple example}
% \label{fig:simple.out}
% \end{example}
%
% Note the necessary quoting of newlines to suppress spurious spaces.  
%
% \changes{v2.6b (1999/04/10)}{1999/04/08}{Documentation change concerning line
%   breaks between arguments}
% Due to the way \cs{nomenclature} scans its arguments you don't need to
% \cs{protect} any macros, but you also must not have any character in front
% of the first or between the
% first and the second argument, especially no line break (even with a |%|). So
%\begin{verbatim}
%   \nomenclature{$x$}%
%     {Description}
%\end{verbatim}
% does \emph{not} work. You can have have line breaks in the argument, but
% also no |%|.
%
% Note that |nomentbl| option described in Section~\ref{sec:nomentbl}
% changes the syntax of this command.
%
% \subsection{Package Options}
% \label{sec:options}
%
% The \package{nomencl} package has the following options:
% \begin{description}
% \item[refeq] The phrase ``, see equation (\meta{eq})'' is appended to
%   every entry in the nomenclature where \meta{eq} is the number of the
%   last equation in front of the corresponding command |\nomenclature|.
% \item[norefeq] No equation reference is printed. (default)
% \item[refpage] The phrase ``, page \meta{page}'' is appended to
%   every entry in the nomenclature where \meta{page} is the number of the
%   page on which the corresponding command |\nomenclature| appeared.
% \item[norefpage] No page reference is printed. (default)
% \item[prefix] Every sort key is preceded by the letter ``a'' (changeable);
%   see Sections~\ref{sec:sort} and Section~\ref{sec:grouping} to
%   learn why this might make sense. (default) 
% \item[noprefix] No prefix is used.
% \changes{v5.0}{2018/12/28}{New options |stdsubgroups| and |nostdsubgroups|}
% \item[stdsubgroups] Use standard subgroups in nomenclature, see
% Section~\ref{sec:grouping}. 
% \item[nostdsubgroups] Do not use standard subgroups in nomenclature, see
% Section~\ref{sec:grouping} (default).
% \changes{v3.0 (2000/03/05)}{2000/03/05}{New options
% \texttt{cfg}/\texttt{nocfg}}
% \item[cfg] A configuration file, by default, |nomencl.cfg| is
% loaded, if it exists (default).  The variant |cfg=FILENAME| uses the
% configuration |FILENAME| instead of |nomencl.cfg|.  This is used in
% the examples in the package documentation.  
% \item[nocfg] The configuration file is not loaded.
% \item[intoc] Inserts the nomenclature in the Table of Contents.
% \item[notintoc] No entry for the nomenclature in the Table of Contents. (default)
% \item[tocbasic] Use \textsl{tocbasic} package from KOMA script
% bundle for TOC handling (default)
% \item[notocbasic] Do not use \textsl{tocbasic} package from KOMA
% script.  You may need this option if \textsl{tocbasic} conflicts
% with other packages like \textsl{pgfopts}.  
% \item[compatible] Run in compatibility mode. Older tex files may
%   need this option selected to be able to compile. In the latest
%   version of \package{nomencl} the commands |\makeglossary| and
%   |\printglossary| were replaced with |\makenomenclature| and
%   |\printnomenclature|.  Selecting this option will redefine the old
%   commands, but will lose the compatibility with other glossary
%   packages.
% \item[noncompatible] Do not run in compatibility mode. (default)
% \item[nomentbl] Print nomenclature in the |nomentbl| style, see
% Section~\ref{sec:nomentbl}. 
% \item[nonomentbl] Do not print nomenclature in the |nomentbl| style, see
% Section~\ref{sec:nomentbl} (default).
% \item[\hspace{-\labelsep}]
%   \textbf{croatian, danish, english, french, german, italian,
%     norwegian-bokmaal, norwegian-nynorsk, polish,
%     portuguese, russian, slovene, spanish, ukrainian}
%   The reference texts and the nomenclature title will appear in the
%   corresponding language. Note that in order to use Russian or Ukrainian,
%   you have to have Cyrillic fonts installed and you might need a replacement
%   for \MakeIndex, e.\,g.~\xindy. Please help me out with other
%   languages. (default: english)
% \end{description}
%
%
% \subsection{Referencing}
%
% \DescribeMacro{\nomrefeq}\DescribeMacro{\nomrefpage}%
% \DescribeMacro{\nomrefeqpage}%
% \DescribeMacro{\nomnorefeq}\DescribeMacro{\nomnorefpage}%
% \DescribeMacro{\nomnorefeqpage}%
% As explained in Section~\ref{sec:options}, you can turn referencing to
% equations and pages on/off globally using the package options. But sometimes
% you might want to change the referencing behavior for single entries. The
% following six macros can be used inside a |\nomenclature| macro:
% |\nomrefeq|, |\nomnorefeq|, |\nomrefpage|, |\nomnorefpage|, |\nomrefeqpage|,
% |\nomnorefeqpage|.
% The first four work similarly to the package options, only local to the
% entry; the last two are shortcuts, so saying |\nomrefeqpage| is equivalent
% to |\nomrefeq\nomrefpage|.
%
% If we changed the relevant parts of the last example as shown in
% Figure~\ref{fig:reference} then the nomenclature should look like
% Figure~\ref{fig:reference.out}.
%
% \begin{example}
%\begin{verbatim}
% \begin{equation}
%   a=\frac{N}{A}
% \end{equation}%
% \nomenclature{$a$}{The number of angels per unit area\nomrefeqpage}%
% \nomenclature{$N$}{The number of angels per needle point\nomrefeq}%
% \nomenclature{$A$}{The area of the needle point\nomrefeq\nomrefpage}%
% The equation $\sigma = m a$%
% \nomenclature{$\sigma$}{The total mass of angels per unit area}%
% \nomenclature{$m$}{The mass of one angel\nomrefpage}
% follows easily.
% \printnomenclature
% \end{document}
%\end{verbatim}
% \caption{Explicit references}
% \label{fig:reference}
% \end{example}
% \begin{example}
% \begin{thenomenclature}
% \nomgroup{A}
%  \item [$\sigma$]\begingroup The total mass of angels per unit area\nomeqref {1}
%                \nompageref{1}
%  \item [$A$]\begingroup The area of the needle point\nomrefeq\nomrefpage\nomeqref {1}
%                \nompageref{1}
%  \item [$a$]\begingroup The number of angels per unit area\nomrefeqpage\nomeqref {1}
%                \nompageref{1}
%  \item [$m$]\begingroup The mass of one angel\nomrefpage\nomeqref {1}
%                \nompageref{1}
%  \item [$N$]\begingroup The number of angels per needle point\nomrefeq\nomeqref {1}
%                \nompageref{1}
% \end{thenomenclature}
% \caption{Typeset output for Figure~\ref{fig:reference}}
% \label{fig:reference.out}
% \end{example}
%
% While these macros do not have to be at the end of the entries, it's
% probably the most sensible place to put them. Note that such local request
% always supersede the package options.
%
%
% \subsection{Sorting}
% \label{sec:sort}
%
% The Greek letter $\sigma$ turned out to be first in the nomenclature
% list in the examples above because the backslash in |\sigma|
% precedes any alphabetical character. Sometimes this is not what you
% want.  Then you can use \meta{prefix} to fine tune the sort order.
%
% Before we describe the usage of \meta{prefix}, we have to explain how
% \MakeIndex\ sorts entries, see~\cite{chen:auto:1987}. \MakeIndex\
% distinguishes three kinds of sort keys:
% \begin{description}
% \item[Strings] Everything that starts with a alphabetic letter (A\dots Z,
%   a\dots z).
% \item[Numbers] Everything that starts and only contains digits (0\dots 9).
% \item[Symbols] Everything else.
% \end{description}
% Each group is sorted separately (and differently), then the groups are
% sorted in the order symbols, numbers, strings\footnote{With the |-g| switch
% of \MakeIndex, they are sorted in the order symbols, strings, numbers.}. For
% the groups the following algorithm is used:
% \begin{description}
% \item[Strings] If two letters are compared, the usual ordering is used
%   (|a|\textless|C|\textless|q|), but if two words are the
%   same except for the capitalization, then an upper case letter
%   precedes the lower case letter (|Tea|\textless|tea|).
%   If a letter is compared with a non-letter (digit,
%   symbol), ASCII code is used (|1|\textless |A|\textless |~|).\footnote{An
%   exception seems to be that the non-letters between upper and lower case
%   letters (code 91--96) are put just before the capital letters (between
%   code 64 and 65) while the non-letters after the lower case letters (code
%   123--127) are left there.} If two
%   non-letters are compared (which can not happen at the first position of a
%   string), ASCII code is used (|+|\textless |1|\textless |:|\textless
%   |\|). Additionally there is the issue of word ordering (treat spaces as
%   letters with ASCII code smaller than every printable symbol) and letter
%   ordering (ignore spaces). \MakeIndex\ uses word ordering by default, but
%   you can change it with some command line option (|-l| on my UNIX).
% \item[Numbers] The natural ordering is used
%   (|8|\textless |34|\textless |111|).
% \item[Symbols] ASCII code is used
%   (|+|\textless|1|\textless|:|\textless|A|\textless|\|\textless|a|).
% \end{description}
%
% Let's consider the following eight nomenclature entries
% (without the optional argument): |$~Ab$|, |$~aa$|, |$\Ab$|, |$\aa$|, |$Ab$|,
% |$aa$|, |Ab|, |aa|. Try to understand the following example with the help
% of the explanation above and an ASCII table.
%
% If you use \package{nomencl} with its default settings (i.\,e.~``a'' is
% added to every sort key, so every sort key is considered as a string), you
% will get the sort order |$\aa$|, |$\Ab$|, |$aa$|, |$Ab$|, |$~aa$|, |$~Ab$|,
% |aa|, |Ab|. Note that |aa| is in front of |Ab| in all four pairs; note
% also the order |$\Ab$|, |$Ab$|, |$~Ab$| which does not agree with the
% ASCII code.
%
% If you specify the option \package{noprefix}, then you will get |$Ab$|,
% |$\Ab$|, |$\aa$|, |$aa$|, |$~Ab$|, |$~aa$|, |aa|, |Ab|. The first six
% entries are considered as symbols and sorted according to the ASCII code
% (this time correctly). Note that |$\Ab$| is in front of |$\aa$| because
% |A| has the smaller ASCII code. The two strings follow at the end.
%
%
%\subsection{Subgroups}
%\label{sec:grouping}
%
% It often makes sense to separate index entries into several groups
% according to their meaning.  The prefix parameter for the
% \cs{nomenclature} command provides a way to do it.  The algorithm is:
% \begin{enumerate}
% \item Start prefixes with different letters for different
% subgroups. 
% \item Define \cs{nomgroup} command (see Section~\ref{sec:format}
% below) to typeset group names.
% \end{enumerate}
%
% One of the popular choices, suggested by Brian Elmegaard in
% \package{nomentbl} is the following (the corresponding prefixes are
% in bold):
% \begin{description}
% \item[A] Latin letters
% \item[G] Greek letters
% \item[X] Superscripts
% \item[Z] Subscripts
% \end{description}
%
% This choice is implemented in the |stsubgroups| option of the
% package, see Figure~\ref{fig:stdsubgroups}.  A further customization
% is discussed in Section~\ref{sec:custom}.  
%
% \begin{example}
%    \begin{macrocode}
%<*sample02.tex>
% Example provided by Stefan Pinnow (SP) 
\documentclass{article}
\usepackage[stdsubgroups,nocfg]{nomencl}
\usepackage{setspace}
    \makenomenclature
\begin{document}
\section*{Main equations}
Here an equation
    \begin{equation}\label{eq:heatflux}
        \dot{Q} = k \cdot A \cdot \Delta T
    \end{equation}%
    \nomenclature[aQ]{$\dot{Q}$}{heat flux}%
    \nomenclature[ak]{$k$}{overall heat transfer
      coefficient}%
    \nomenclature[aA]{$A$}{area}%
    \nomenclature[aL]{$L$}{length}%
    \nomenclature[aT]{$T$}{temperature}%
    \nomenclature[aT]{$\Delta T$}{temperature difference}%
or another one
    \begin{equation}\label{eq:ohtc}
        \frac{1}{k} = \left[\frac{1}{\alpha _{\mathrm{i}}\,r_{\mathrm{i}}} +
        \sum^n_{j=1}\frac{1}{\lambda _j}\,
        \ln \frac{r_{\mathrm{a},j}}{r_{\mathrm{i},j}} +
        \frac{1}{\alpha _{\mathrm{a}}\,
          r_{\mathrm{a}}}\right] \cdot r_{\mathrm{reference}}
    \end{equation}%
    \nomenclature[ga]{$\alpha$}{convection heat transfer coefficient}%
    \nomenclature[zi]{i}{in}%
    \nomenclature[gl]{$\lambda$}{thermal conductivity}%
    \nomenclature[za]{a}{out}%
    \nomenclature[zn]{$n$}{number of walls}%
    \nomenclature[zj]{$j$}{running parameter}%
\onehalfspacing
\printnomenclature
\end{document}
%</sample02.tex>
%    \end{macrocode}
%   \caption{The \texttt{stdsubgroups} option}
%   \label{fig:stdsubgroups}
% \end{example}
%
%
%\subsection{Tabular nomenclature (\texttt{nomentbl} style)}
%\label{sec:nomentbl}
%
% The option |nomentbl| changes the behavior of nomenclature.
%
% \DescribeMacro{\nomenclature}%
% The command \cs{nomenclature} now has four, rather than two,
% mandatory arguments:
% \begin{center}
%   \cs{nomenclature}\oarg{prefix}\marg{symbol}\marg{description}\marg{units}\marg{note} 
% \end{center}
% Here \oarg{prefix}, \marg{symbol}, and \marg{description} have the
% same meaning as for the usual \cs{nomenclature} command.  The
% additional arguments are \marg{units}, which is internally enclosed
% in the \cs{si} command from |siunitx| package, and \cs{note}, which
% is an arbitrary note added to the description.
%
% \DescribeMacro{\setnomtableformat}
% The list is wrapped in a |longtable| with the default format
% \begin{center}
% |lp{0.4\textwidth}sp{0.3\textwidth}@{}l|  
% \end{center}
% The command
% \cs{setnomtableformat}\marg{format} can be used to change it, for
% example,
% \begin{verbatim}
% \setnomtableformat{lllll}
% \end{verbatim}
%
% Note that the table has five columns: symbol, description, units,
% note, and reference.  If you do not use references, you may suppress
% the last column using |@{}l| declaration.  The |s| column is used
% for units in the \package{siunitx} format.
%
% Figure~\ref{fig:nomentbl} provides an example of this option.
%
% \begin{example}
%    \begin{macrocode}
%<*sample03.tex>
% Example provided by Stefan Pinnow (SP) 
\documentclass{article}
\usepackage[nomentbl,stdsubgroups]{nomencl}
\usepackage{setspace}
\makenomenclature
\begin{document}
\section*{Main equations}
%
Here an equation
    \begin{equation}\label{eq:heatflux}
        \dot{Q} = k \cdot A \cdot \Delta T
    \end{equation}%
    \nomenclature[aQ]{$\dot{Q}$}{heat flux}{W}{}%
    \nomenclature[ak]{$k$}{overall heat transfer
      coefficient}{\watt\per(\square\meter\kelvin)}{see
      eq.~(\ref{eq:ohtc})}% 
    \nomenclature[aA]{$A$}{area}{\square\meter}{}%
    \nomenclature[aL]{$L$}{length}{\meter}{SI base quantity}%
    \nomenclature[aT]{$T$}{temperature}{\kelvin}{SI base quantity}%
    \nomenclature[aT]{$\Delta T$}{temperature difference}{\kelvin}{SI base quantity}%
or another one
    \begin{equation}\label{eq:ohtc}
        \frac{1}{k} = \left[\frac{1}{\alpha _{\mathrm{i}}\,r_{\mathrm{i}}} +
        \sum^n_{j=1}\frac{1}{\lambda _j}\,
        \ln \frac{r_{\mathrm{a},j}}{r_{\mathrm{i},j}} +
        \frac{1}{\alpha _{\mathrm{a}}\,
          r_{\mathrm{a}}}\right] \cdot r_{\mathrm{reference}}
    \end{equation}%
    \nomenclature[ga]{$\alpha$}{convection heat transfer
      coefficient}{\watt\per(\square\meter\kelvin)}{}% 
    \nomenclature[zi]{i}{in}{}{}%
    \nomenclature[gl]{$\lambda$}{thermal conductivity}{\watt\per\kelvin}{}%
    \nomenclature[za]{a}{out}{}{}%
    \nomenclature[zn]{$n$}{number of walls}{}{}%
    \nomenclature[zj]{$j$}{running parameter}{}{}%
    
\onehalfspacing
\printnomenclature
\end{document}
%</sample03.tex>
%    \end{macrocode}
%   \caption{Use of \texttt{nomentbl} option}
%   \label{fig:nomentbl}
% \end{example}
% 
% \subsection{Customization}
% \label{sec:custom}
%
% Besides the things you can customize by using the package options, there are
% a few more commands that you might want to redefine. If you make the same
% changes in every file, it's probably easier to put all those in a file
% |nomencl.cfg| which is automatically read by the \package{nomencl} package
% whenever it exists in the search path (unless you specified the |nocfg|
% option).  You can experiment with loading alternative configuration
% files using |cfg=FILENAME| version of this option.
%
%
% \subsubsection{Formatting the Nomenclature}
% \label{sec:format}
%
% \DescribeMacro{\printnomenclature}%
% \DescribeMacro{\nomlabelwidth}%
% Probably the most common change to the nomenclature is a different
% amount of space for the symbols. By default, the nomenclature is
% formatted as a list with the label width equal to |\nomlabelwidth|
% which is initialized to 1\,cm. You can change this dimension in the
% |cfg| file or you can use the optional argument of
% |\printnomenclature|. If you want to have a little more space for
% the labels (and you don't live in a metric world) you can use
% |\printnomenclature[0.5in]| instead of the simple
% |\printnomenclature|.
%
% \DescribeEnv{thenomenclature}%
% If you don't like the format of the nomenclature at all, you will have
% to redefine the |thenomenclature| environment. Maybe a look at the
% documented code of \package{nomencl} will help.
%
% \DescribeMacro{\nomname}%
% In case you don't like the name of the nomenclature, just redefine
% the |\nomname| macro, e.\,g.
% \begin{center}
% |\renewcommand{\nomname}{List of Symbols}|  
% \end{center}
% 
%
% \changes{v3.1b (2001/09/30)}{2001/03/12}{Explain how to get toc entry}
% \changes{v4.0 (2005/03/31)}{2005/03/31}{TOC entries now added with package option}
% Putting an entry for the nomenclature in the table of contents can
% be done by adding an \textbf{intoc} to the package options.
%
% \DescribeMacro{\nomgroup}%
% Usually, \MakeIndex\ inserts the macro |\indexspace| between every
% character group, i.\,e.~between symbols and numbers, numbers and
% letters and between every two letter groups. The \package{nomencl}
% package inserts the macro |\nomgroup{|\meta{arg}|}| \emph{instead},
% where \meta{arg} is either the string ``Symbols'' or the string
% ``Numbers'' or the capital letter of the group that is about to
% start. You can redefine |\nomgroup| to insert some white space
% |\renewcommand{\nomgroup}[1]{\medskip}|, or to print a fancy divider
%\begin{verbatim}
%   \renewcommand{\nomgroup}[1]{%
%     \item[]\hspace*{-\leftmargin}%
%     \rule[2pt]{0.45\linewidth}{1pt}%
%     \hfill #1\hfill
%     \rule[2pt]{0.45\linewidth}{1pt}}
%\end{verbatim}
% Note that |\nomgroup| is executed in a list environment, so you need
% to have an |\item| first and then jump back to the beginning of the
% line with the |\hspace| command.
%
% \DescribeMacro{\nompreamble}\DescribeMacro{\nompostamble}%
% Maybe you want to explain something just between the title of the
% nomenclature and the start of the list or at the very end of the
% list. Just redefine the macros |\nompreamble| and |\nompostamble|
% which do nothing by default. Note that they are executed \emph{outside}
% of the list environment.
%
% \DescribeMacro{\nomitemsep}%
% The skip between two entries in the nomenclature can be adjusted using
% \cs{nomitemsep}. This should be done in the preamble or the file
% |nomencl.cfg|. Note that if you want no extra skip between entries
% you have to use
% |\setlength{\nomitemsep}{-\parsep}|
%
% \DescribeMacro{\nomprefix}%
% If you want, you can redefine the default prefix that is used for the
% sortkeys. By default, |\nomprefix| is set to ``a''; redefining it
% supersedes the package options \package{prefix} and \package{noprefix}.
%
%
% \subsubsection{Formatting the Entries}
%
% \DescribeMacro{\nomlabel}%
% By default, the labels are just shifted to the left within their
% allocated box. If you want to change this, redefine |\nomlabel|
% which should get one argument, e.\,g.
% |\renewcommand{\nomlabel}[1]{\hfil #1\hfil}| to center the symbols.
%
% \DescribeMacro{\nomentryend}%
% Maybe you would like to have a period at the end of every entry.
% Just say |\renewcommand{\nomentryend}{.}|, and there it
% is. Section~\ref{sec:tips:units} explains another nice application
% of this macro.
%
% \DescribeMacro{\eqdeclaration}\DescribeMacro{\pagedeclaration}%
% If you don't like the text that is used for the references to
% equations and pages, you can define |\eqdeclaration| and
% |\pagedeclaration|. Both should accept one argument, namely the
% equation and page number, respectively. An example is
% \begin{center}
% |\renewcommand{\eqdeclaration}[1]{, first used in eq.~(#1)}|.  
% \end{center}
% 
% 
%
%
% \subsection{Tips and Tricks}
% \label{sec:tips}
%
% \changes{v3.1 (2000/09/15)}{2000/09/15}{Sample cfg files for most examples}
%
% \subsubsection{Advanced subgroups}
% \label{sec:tips:subgroups}
%
% The standard subgroups described in Section~\ref{sec:grouping} is
% just one of the possible ways to separate your index.  You can do
% much more if you play with the \cs{nomgroup} command.  Note that all
% entries sharing the first letter of prefix as grouped together and
% preceded by the \cs{nomgroup}\oarg{Uppercased first leter} command.
% So, for example, if you want to separate constants and variables,
% you may use prefixes |c...| for constants and |v...| for variables,
% and then write down (package \package{ifthen} being loaded by
% \package{nomencl})
% \begin{verbatim} 
% \renewcommand{\nomgroup}[1]{%
% \ifthenelse{\equal{#1}{V}}{\item[\textbf{Variables}]}{%
% \ifthenelse{\equal{#1}{C}}{\item[\textbf{Constants}]}{}}}
% \end{verbatim}
%
%
% \subsubsection{Units}
% \label{sec:tips:units}
%
% Besides the obvious possibility of adding units for symbols in the
% description string, you can also use |\nomentryend| to shift the unit
% to the right margin. With package \package{siunitx} you can define
%    \begin{macrocode}
%<*sample04.cfg>
\newcommand{\nomunit}[1]{%
  \renewcommand{\nomentryend}{\hspace*{\fill}\si{#1}}}
%</sample04.cfg>
%    \end{macrocode}
% and then define nomenclature as
% \begin{center}
% |\nomenclature{$l$}{Length\nomunit{\meter}}|  
% \end{center}
%
% See Figure~\ref{fig:units} for the example of the input file.
%
% Option |nomentbl| allows an alternative way to add units to the
% nomenclature (Section~\ref{sec:nomentbl}).  
%
% \begin{example}
%    \begin{macrocode}
%<*sample04.tex>
\documentclass{article}
\usepackage[cfg=sample04.cfg]{nomencl}
\usepackage{siunitx}
\makenomenclature
\begin{document}
\section*{Main equations}
\begin{equation}
  a=\frac{N}{A}
\end{equation}%
\nomenclature{$a$}{The number of angels per unit
  area\nomunit{\per\square\meter}}% 
\nomenclature{$N$}{The number of angels per needle point}% 
\nomenclature{$A$}{The area of the needle
  point\nomunit{\square\meter}}% 
The equation $\sigma = m a$%
\nomenclature{$\sigma$}{The total mass of angels per unit
  area\nomunit{\kilogram\per\square\meter}}% 
\nomenclature{$m$}{The mass of one angel\nomunit{\kilogram}}
follows easily.
\printnomenclature
\end{document}
%</sample04.tex>      
%    \end{macrocode} 
%   \caption{A simple example with units}
%   \label{fig:units}
% \end{example}
%
%
% \subsubsection{Expansion}
%
% \changes{v3.1 (2000/09/15)}{2000/09/01}{Expansion example added}
% The \package{nomencl} package tries hard to write the arguments of the
% |\nomenclature| macro verbatim to the glossary file. This is usually the
% right thing to do because some macros do not like to be expanded at the
% wrong moment or give weird results if they are. On the other hand, there are
% occasions where it is good to have the meaning (or expansion) of a macro in
% the glossary file instead of its name. There are quite some occasions
% where you will get in trouble with this expansion, for example, if the
% expansion of a macro contains~|@| (|\mathcal| expands to |\@mathcal|)
% because |@| is a special character for \MakeIndex\ and thus \MakeIndex\ will
% either fail or give unexpected results. You can avoid the expansion on a
% case by case basis by using |\protect| in front of the macro that should
% not be expanded.
%
% In order to get macro expansion, the redefinition of the |\@nomenclature|
% macro within the |\makenomenclature| macro has to be changed.
%    \begin{macrocode}
%<*sample05.cfg>
\def\makenomenclature{%
  \newwrite\@nomenclaturefile
  \immediate\openout\@nomenclaturefile=\jobname\@outputfileextension
  \def\@nomenclature{%
    \@ifnextchar[%
      {\@@@@nomenclature}{\@@@@nomenclature[\nomprefix]}}%
  \PackageInfo{nomencl}{Writing nomenclature file \jobname\@outputfileextension}%
  \let\makenomenclature\@empty}
%    \end{macrocode}
% The new macro to be called by |\@nomenclature| just writes its arguments to
% the glossary file without further ado, so they will be expanded.
%    \begin{macrocode}
\def\@@@@nomenclature[#1]#2#3{%
 \protected@write\@nomenclaturefile{}%
  {\string\nomenclatureentry{#1#2@[{#2}]%
      \begingroup#3\protect\nomeqref{\theequation}%
        |nompageref}{\thepage}}}%
%</sample05.cfg>
%    \end{macrocode}
%
% The following file has completely different result when using
% expanded and non-expanded versions
%    \begin{macrocode}
%<*sample05.tex>
\documentclass{article}
\usepackage[cfg=sample05.cfg]{nomencl}
\makenomenclature
\begin{document}
\section*{Main equations}
\begin{equation}
  a=\frac{N}{A}
\end{equation}%
\newcommand{\magritte}{Not the number }
\nomenclature{$a$}{\magritte of angels per unit area}%
\nomenclature{$N$}{\magritte of angels per needle point}%
\nomenclature{$A$}{The area of the needle point}%
The equation $\sigma = m a$%
\nomenclature{$\sigma$}{The total mass of angels per unit area}%
\nomenclature{$m$}{The mass of one angel}
follows easily.

% We renew the command before printing nomenclature.  However, since
% our nomencl.cfg uses expansion, it does not affect the result.
% Cf. nocfg option
\renewcommand{\magritte}{The number }
\printnomenclature
\end{document}
%</sample05.tex>
%    \end{macrocode}
% 
%
% \subsubsection{Glossary in ``Kopka Style''}
%
% \changes{v3.1 (2000/09/15)}{2000/09/16}{Kopka example added}
% I was told that the glossary in the \LaTeX\ book by Kopka looks roughly like
% in Figure~\ref{fig:kopka}. In order to get a glossary like this, there are
% quite some configurations to do.
%
% \begin{example}
% \textbf{Symbol}\dotfill\nopagebreak page number \\
% \hspace*{5mm}Explanation.
% \caption{Glossary entry in ``Kopka Style''}
% \label{fig:kopka}
% \end{example}
%
% First we have to change the macro |\@@@nomenclature| which takes care of
% writing the glossary entry to the glossary file. The only difference to the
% original definition is that we hand over the explanation of a symbol (\#3)
% and the equation number to |\nompageref| instead of writing it directly
% after the symbol (\#2). This is necessary because the explanation should
% appear after (actually below) the page number.
%    \begin{macrocode}
%<*sample06.cfg>
\@printpagereftrue
\def\@@@nomenclature[#1]#2#3{%
 \def\@tempa{#2}\def\@tempb{#3}%
 \protected@write\@nomenclaturefile{}%
  {\string\nomenclatureentry{#1\nom@verb\@tempa @[{\nom@verb\@tempa}]%
    |nompageref{\begingroup\nom@verb\@tempb\protect\nomeqref{\theequation}}}%
    {\thepage}}%
 \endgroup
 \@esphack}
%    \end{macrocode}
% Now we change the definition of |\nompageref| so that it accepts two
% arguments, the explanation (\#1) and the page number (\#2). The page number
% is only printed if required, otherwise  |\null| is used to avoid an error
% because of the following |\linebreak|. Note that it is \emph{not} possible
% to turn off the page number locally, because the explanation appears after
% the page number. 
%    \begin{macrocode}
\def\nompageref#1#2{%
  \if@printpageref\pagedeclaration{#2}\else\leavevmode\fi
  \linebreak#1\nomentryend\endgroup}
%    \end{macrocode}
% And a few little things. We want dots and a space before the page number
% appears at the right margin; the explanation should end with a period; and
% the symbol should be printed in bold face (this only works for regular text,
% not for formulas).
%    \begin{macrocode}
\def\pagedeclaration#1{\dotfill\nobreakspace#1}
\def\nomentryend{.}
\def\nomlabel#1{\textbf{#1}\hfil}
%</sample06.cfg>
%    \end{macrocode}
%
%
% \subsection{Compatibility Mode}
% \label{sec:compatibility}
%
% With previous versions of the \package{nomencl}, the commands |\makeglossary|
% and |\pringlossary| were used to generate and display the nomenclature.
% These commands have now been depreciated, and replaced with the |\makenomenclature|
% and |\printnomenclature| commands. The new commands do exactly the same
% as the old commands, but because of the name changes, the package is
% now compatible with other packages which use the |\makeglossary| commands.
% The previous versions of \package{nomencl} also used the file extensions
% |.glo| and |.gls| for the generated output and input files. These extensions
% have now been changed to |.nlo| and |.nls| respectively---again, for increased
% compatibility.
%
% For all of the legacy \LaTeX\ files out there which use the old commands
% there is a compatibility option available so that the old commands will still
% work without having to change any of the existing code. To enable the
% compatibility mode simply supply the \textbf{compatible} option
% when using the package. For example:
% \begin{verbatim}
%   \usepackage[compatible]{nomencl}
% \end{verbatim}
% Under compatibility mode, the package will generate and use files
% with the old-style file extensions (i.e. |.glo| and |.gls|).
%
% It is worth noting that even though the compatibility mode is available,
% it is highly recommended to update your \LaTeX\ files to use the new
% nomenclature commands.
%
%
%
% \subsection{Acknowledgements}
%
% Since version 5.0 the package incorporates the code from
% |nomentbl.dtx| by Brian Elmegaard.  
%
% The authors  want to thank Stefan
% B\"ohm and Karl Heinz Marbaise who helped testing this package.
%
% The translations were done by Branka Lon\v{c}arevi\'{c} (Croatian),
% Brian Elmegaard (Danish), Denis B.~Roegel (French), Sani Egisto
% (Italian), Artur Gorka (Polish), Pedro Areal (Portuguese), Alejandro
% Lopez-Valencia (Spanish), joder (Slovene),
% and Boris Veytsman (Russian and Ukrainian).
%
%
% \subsection{Releases and Legal Issues}
% \label{sec:legal}
%
% This package can be redistributed and/or modified under the terms
% of the \LaTeX\ Project Public License distributed from CTAN
% archives in the directory \url{macros/latex/base/lppl.txt}, see
% e.\,g.~\cite{ctan}; either
% version 1.2 of the license, or (at your option) any later version.
%
%
% \StopEventually{%
% \begin{thebibliography}{5}
% \bibitem[1]{braa:ltid:1996}
% Braams, Johannes; Carlisle, David; Jeffrey, Alan; Lamport, Leslie;
% Mittelbach, Frank; Rowley, Chris; Sch\"opf, Rainer (1996).
% \newblock\texttt{ltidxglo.dtx} -- 1996/01/20 v1.1e LaTeX Kernel
% (Index and Glossary).
% \newblock \href{http://mirror.ctan.org/macros/latex/base/ltidxglo.dtx}{CTAN/macros/latex/base/ltidxglo.dtx}.
% \bibitem[2]{chen:auto:1987}
% Chen, Pehong; Harrison, Michael~A. (1987).
% \newblock Automating Index Preparation.
% \newblock Report UCB/CSD 87/347, Computer Science Division, University of
%   California, Berkeley, CA.
% \bibitem[3]{ctan}
% Comprehensive {\TeX} Archive Network CTAN.
% \newblock \url{ftp://ctan.tug.org/tex-archive/}.
% \bibitem[4]{jone:anew:1995}
% Jones, David M. (1995).
% \newblock A new implementation of \LaTeX's indexing commands,
%   Version v4.1beta of 1995/09/28.
% \newblock \href{http://mirror.ctan.org/macros/latex/contrib/camel/index.dtx}{CTAN/macros/latex/contrib/supported/camel/index.dtx}.
% \bibitem[5]{knut:thet:1984}
% Knuth, Donald E. (1984).
% \newblock \emph{The \TeX book}.
% \newblock Addison-Wesley Publishing Company, Reading, MA.
% \bibitem[6]{lamp:late:1994}
% Lamport, Leslie (1994).
% \newblock \emph{{\LaTeX}: A Document Preparation System}.
% \newblock Addison-Wesley Publishing Company, Reading, MA.
% \bibitem[7]{veyt:pack:1996}
% Veytsman, Boris (1996).
% \newblock Package nomencl, Version 4.0.
% \newblock \url{http://sarovar.org/projects/nomencl} (2000/09/15).
% \end{thebibliography}}
%
%
% \section{Implementation}
%
% \subsection{The \LaTeX\ Package File}
%
% At the beginning of this file, the |\ProvidesPackage| macro was executed. So
% we only need to to state that we need \LaTeXe.
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
%    \end{macrocode}
%
% \changes{v5.0}{2018/12/28}{Moved to xkeyval}
% \changes{v5.0}{2018/12/28}{Added ifthen package}
% We need \textsl{xkeyval} package for some options and \textsl{ifthen}
% for grouping and \textsl{tocbasic} for TOC
%    \begin{macrocode}
\RequirePackage{xkeyval}
\RequirePackage{ifthen}
%    \end{macrocode}
%
%
% \begin{macro}{\if@printeqref}
% \begin{macro}{\if@printpageref}
% We need two switches to decide whether references to equations and pages
% should be printed.
%    \begin{macrocode}
\newif\if@printeqref
\newif\if@printpageref
%    \end{macrocode}
% \end{macro} \end{macro}
% \begin{macro}{\if@intoc}
% Another switch to decide whether to add an entry to the TOC.
%    \begin{macrocode}
\newif\if@intoc
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\if@compatibilitymode}
% Another switch to decide whether to run in compatibility mode.
%    \begin{macrocode}
\newif\if@compatibilitymode
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@nomencl@tocbasic}
% \changes{v5.2}{2019/05/05}{Reintroduced macro}
% Whether we are to use tocbasic
%    \begin{macrocode}
\newif\if@nomencl@tocbasic
\@nomencl@tocbasictrue
%    \end{macrocode}
% 
% \end{macro}
%
% And the options to set these switches globally.
%    \begin{macrocode}
\DeclareOptionX{refeq}{\@printeqreftrue}
\DeclareOptionX{norefeq}{\@printeqreffalse}
\DeclareOptionX{refpage}{\@printpagereftrue}
\DeclareOptionX{norefpage}{\@printpagereffalse}
\DeclareOptionX{intoc}{\@intoctrue}
\DeclareOptionX{notintoc}{\@intocfalse}
\DeclareOptionX{compatible}{\@compatibilitymodetrue}
\DeclareOptionX{noncompatible}{\@compatibilitymodefalse}
\DeclareOptionX{tocbasic}{\@nomencl@tocbasictrue}
\DeclareOptionX{notocbasic}{\@nomencl@tocbasicfalse}
%    \end{macrocode}
% \begin{macro}{\nomprefix}
% It might make sense to add the prefix ``a'' to every sortkey, see
% Section~\ref{sec:sort}.
%    \begin{macrocode}
\DeclareOptionX{prefix}{\def\nomprefix{a}}
\DeclareOptionX{noprefix}{\def\nomprefix{}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@nomentbl}
%   \changes{v5.0}{2018/12/28}{New macro}
%   Whether to use nomentbl format
%    \begin{macrocode}
\newif\if@nomentbl
\DeclareOptionX{nomentbl}{\@nomentbltrue}
\DeclareOptionX{norefeq}{\@nomentblfalse}
%    \end{macrocode}
%   
% \end{macro}
%
% \begin{macro}{\if@loadcfg}
% \changes{v5.0}{2018/12/28}{Added settable cfg file}
% Another switch and the corresponding options to decide whether we
% should look for a configuration file.
%    \begin{macrocode}
\newif\if@loadcfg
\DeclareOptionX{cfg}[nomencl.cfg]{\@loadcfgtrue\gdef\@cfgfile{#1}}
\DeclareOptionX{nocfg}{\@loadcfgfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@stdsubgroups}
% \changes{v5.0}{2018/12/28}{New macro}
%   Whether we use standard subgroups
%    \begin{macrocode}
\newif\if@stdsubgroups
\DeclareOptionX{stdsubgroups}{\@stdsubgroupstrue}
\DeclareOptionX{nostdsubgroups}{\@stdsubgroupsfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\eqdeclaration}
% \begin{macro}{\pagedeclaration}
% \begin{macro}{\nomname}
% \begin{macro}{\nomAname}
% \begin{macro}{\nomGname}
% \begin{macro}{\nomXname}
% \begin{macro}{\nomZname}
% \changes{v2.5a (1999/03/22)}{1999/03/17}{Added Danish}
% \changes{v2.6 (1999/04/02)}{1999/03/23}{Added French}
% \changes{v2.6 (1999/04/02)}{1999/04/01}{Use \cs{nobreakspace} instead of
%   \texttt{\textasciitilde} in package options}
% \changes{v2.6a (1999/04/06)}{1999/04/02}{Added Russian, Spanish, Ukrainian}
% \changes{v2.6b (1999/04/10)}{1999/04/06}{Added Polish}
% \changes{v2.7a (1999/07/07)}{1999/07/07}{Added Italian}
% \changes{v4.0 (2005/04/07)}{2005/04/07}{Updated Italian option (thanks to Lapo Mori)}
% \changes{v3.1 (2000/09/15)}{2000/08/30}{Added Croatian}
% \changes{v3.1a (2000/12/03)}{2000/12/03}{Added Portuguese}
% \changes{v5.0}{2018/12/28}{Added defaults}
% \changes{v5.1}{2019/02/08}{Changed \# to \#\# in options.}
% \changes{v5.3}{2019/11/23}{Added Slovene (joder)}
% \changes{v5.4}{2020/03/01}{Added Norwegian (wishfort36)}
% If you can help out with translations for some other languages, let me know.
%    \begin{macrocode}
\DeclareOptionX{croatian}{%
  \def\eqdeclaration##1{, vidi jednad\v{z}bu\nobreakspace(##1)}%
  \def\pagedeclaration##1{, stranica\nobreakspace##1}%
  \def\nomname{Popis simbola}%
  \def\nomAname{Latini\v{c}na slova}%
  \def\nomGname{Gr\v{c}ka slova}%
  \def\nomXname{Exponenats}%
  \def\nomZname{Indeksi}}
\DeclareOptionX{danish}{%
  \def\eqdeclaration##1{, se ligning\nobreakspace(##1)}%
  \def\pagedeclaration##1{, side\nobreakspace##1}%
  \def\nomname{Symbolliste}%
  \def\nomAname{Romerske bogstaver}%
  \def\nomGname{Gr{\ae}ske bogstaver}%
  \def\nomXname{(H{\o}jtstillede) indices}%
  \def\nomZname{Indices}}
\DeclareOptionX{english}{%
  \def\eqdeclaration##1{, see equation\nobreakspace(##1)}%
  \def\pagedeclaration##1{, page\nobreakspace##1}%
  \def\nomname{Nomenclature}%
  \def\nomAname{Latin Letters}%
  \def\nomGname{Greek Letters}%
  \def\nomXname{Superscripts}%
  \def\nomZname{Subscripts}}
\DeclareOptionX{french}{%
  \def\eqdeclaration##1{, voir \'equation\nobreakspace(##1)}%
  \def\pagedeclaration##1{, page\nobreakspace##1}%
  \def\nomname{Liste des symboles}%
  \def\nomAname{Lettres latines}%
  \def\nomGname{Lettres grecques}%
  \def\nomXname{Indices sup{\'e}rieurs}%
  \def\nomZname{Indices}}
\DeclareOptionX{german}{%
  \def\eqdeclaration##1{, siehe Gleichung\nobreakspace(##1)}%
  \def\pagedeclaration##1{, Seite\nobreakspace##1}%
  \def\nomname{Symbolverzeichnis}%
   \def\nomAname{Lateinische Buchstaben}%
   \def\nomGname{Griechische Buchstaben}%
   \def\nomXname{(hochgestellte) Indizes}%
   \def\nomZname{Indizes}}
\DeclareOptionX{italian}{%
  \def\eqdeclaration##1{, vedi equazione\nobreakspace(##1)}%
  \def\pagedeclaration##1{, pagina\nobreakspace##1}%
  \def\nomname{Elenco dei simboli}%
   \def\nomAname{Lettere latine}%
   \def\nomGname{Lettere greche}%
   \def\nomXname{Apici}%
   \def\nomZname{Indici}}
\DeclareOptionX{norwegian-bokmaal}{%
  \def\eqdeclaration##1{, se ligning\nobreakspace(##1)}%
  \def\pagedeclaration##1{, side\nobreakspace##1}%
  \def\nomname{Nomenklatur}%
  \def\nomAname{Romerske bokstaver}%
  \def\nomGname{Greske bokstaver}%
  \def\nomXname{Hevet skrift}%
  \def\nomZname{Senket skrift}}
\DeclareOptionX{norwegian-nynorsk}{%
  \def\eqdeclaration##1{, se likning\nobreakspace(##1)}%
  \def\pagedeclaration##1{, side\nobreakspace##1}%
  \def\nomname{Nomenklatur}%
  \def\nomAname{Romarske bokstavar}%
  \def\nomGname{Greske bokstavar}%
  \def\nomXname{Hevd skrift}%
  \def\nomZname{Senka skrift}}
\DeclareOptionX{polish}{%
  \def\eqdeclaration##1{, porownaj rownanie\nobreakspace(##1)}%
  \def\pagedeclaration##1{, strona\nobreakspace##1}%
  \def\nomname{Lista symboli}%
   \def\nomAname{Litery {\l}aci\'nskie}%
   \def\nomGname{Litery greckie}%
   \def\nomXname{Indeksy g\'orny}%
   \def\nomZname{Indeksy dolne}}
\DeclareOptionX{portuguese}{%
  \def\eqdeclaration##1{, veja equa\c{c}\~ao\nobreakspace(##1)}%
  \def\pagedeclaration##1{, p\'agina\nobreakspace##1}%
  \def\nomname{Nomenclatura}%
  \def\nomAname{Letras latinas}%
  \def\nomGname{Letras gregas}%
  \def\nomXname{Sobrescritos}%
  \def\nomZname{Subscritos}}
\DeclareOptionX{russian}{%
  \def\eqdeclaration##1{, \cyrs\cyrm.\nobreakspace(##1)}%
  \def\pagedeclaration##1{, \cyrs\cyrt\cyrr.\nobreakspace##1}%
  \def\nomname{\CYRS\cyrp\cyri\cyrs\cyro\cyrk%
    \ \cyro\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyri%
    \cyrishrt}%
   \def\nomAname{\CYRL\cyra\cyrt\cyri\cyrn\cyrs\cyrk\cyri\cyre\
     \cyrb\cyru\cyrk\cyrv\cyrery}% 
   \def\nomGname{\CYRG\cyrr\cyre\cyrch\cyre\cyrs\cyrk\cyri\cyre\
     \cyrb\cyru\cyrk\cyrv\cyrery}% 
   \def\nomXname{\CYRN\cyra\cyrd\cyrs\cyrt\cyrr\cyro\cyrch\cyrn\cyrery\cyre\
     \cyri\cyrn\cyrd\cyre\cyrk\cyrs\cyrery}% 
   \def\nomZname{\CYRP\cyro\cyrd\cyrs\cyrt\cyrr\cyro\cyrch\cyrn\cyrery\cyre\
     \cyri\cyrn\cyrd\cyre\cyrk\cyrs\cyrery}} 
\DeclareOptionX{slovene}{%
  \def\eqdeclaration##1{, glej ena\v{c}bo\nobreakspace(##1)}%
  \def\pagedeclaration##1{, stran\nobreakspace##1}%
  \def\nomname{Seznam simbolov}%
  \def\nomAname{Latinske \v{c}rke}%
  \def\nomGname{Gr\v{s}ke \v{c}rke}%
  \def\nomXname{Eksponenti}%
  \def\nomZname{Indeksi}}
\DeclareOptionX{spanish}{%
  \def\eqdeclaration##1{, v\'ease la ecuaci\'on\nobreakspace(##1)}%
  \def\pagedeclaration##1{, p\'agina\nobreakspace##1}%
  \def\nomname{Nomenclatura}%
   \def\nomAname{Letras latinas}%
   \def\nomGname{Letras griegas}%
   \def\nomXname{Super{\'\i}ndices}%
   \def\nomZname{Sub{\'\i}ndices}}
\DeclareOptionX{ukrainian}{%
  \def\eqdeclaration##1{, \cyrd\cyri\cyrv.\nobreakspace(##1)}%
  \def\pagedeclaration##1{, \cyrs\cyrt\cyro\cyrr.\nobreakspace##1}%
  \def\nomname{\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk%
    \ \cyrp\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyrsftsn}%
   \def\nomAname{\CYRL\cyra\cyrt\cyri\cyrn\cyrs\cyrsftsn\cyrk\cyrii\
     \cyrl\cyrii\cyrt\cyre\cyrr\cyri}% 
   \def\nomGname{\CYRG\cyrr\cyre\cyrc\cyrsftsn\cyrk\cyrii\
     \cyrl\cyrii\cyrt\cyre\cyrr\cyri}% 
   \def\nomXname{\CYRV\cyre\cyrr\cyrh\cyrn\cyrii\
     \cyrii\cyrn\cyrd\cyre\cyrk\cyrs\cyri}% 
   \def\nomZname{\CYRII\cyrn\cyrd\cyre\cyrk\cyrs\cyri}}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}
% Finally set the default options and process everything.
%    \begin{macrocode}
\ExecuteOptionsX{noncompatible,notintoc,norefeq,norefpage,prefix,cfg,english,nostdsubgroups,tocbasic}
\ProcessOptionsX\relax
%    \end{macrocode}
%
% In the |nomentbl| mode we need a couple more packages
%    \begin{macrocode}
\if@nomentbl
\RequirePackage{array,longtable, siunitx}
\fi
%    \end{macrocode}
%
% In |tocbasic| mode we need to load \textsl{tocbasic}
%    \begin{macrocode}
\if@nomencl@tocbasic
  \RequirePackage{tocbasic}
  \addtotoclist[nomencl]{nlo}
  \addtotoclist[nomencl]{nls}
\fi
%    \end{macrocode}
% 
%
% Checking whether we need nomenclature in toc
%    \begin{macrocode}
\if@intoc
  \if@nomencl@tocbasic
    \setuptoc{nls}{totoc}
  \fi
\fi
%    \end{macrocode}
% 
%
% \begin{macro}{\@outputfileextension}
% \begin{macro}{\@inputfileextension}
% The default file extension for the output and input nomenclature files are
% |.nlo| and |.nls| respectively. In compatibility mode, these are changes to |.glo|
% and |.gls|.
%    \begin{macrocode}
\if@compatibilitymode%
    \def\@outputfileextension{.glo}%
    \def\@inputfileextension{.gls}%
\else%
    \def\@outputfileextension{.nlo}%
    \def\@inputfileextension{.nls}%
\fi%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\makenomenclature}
% The definition of \cs{makenomenclature} is pretty much the same as in the \LaTeX\
% kernel for \cs{makeglossary}, we only use \cs{@nomenclature} instead of \cs{glossary}.
%    \begin{macrocode}
\def\makenomenclature{%
  \newwrite\@nomenclaturefile
  \immediate\openout\@nomenclaturefile=\jobname\@outputfileextension
  \def\@nomenclature{%
    \@bsphack
    \begingroup
    \@sanitize
    \@ifnextchar[%
      {\@@@nomenclature}{\@@@nomenclature[\nomprefix]}}%
  \PackageInfo{nomencl}{Writing nomenclature file \jobname\@outputfileextension}%
  \let\makenomenclature\@empty}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\makeglossary}
% The |\makeglossary| command has been depreciated, and is only available in compatibility mode.
%    \begin{macrocode}
\if@compatibilitymode\let\makeglossary\makenomenclature\fi%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\nom@verb}
% \changes{v2.7 (1999/05/14)}{1999/05/11}{Added macro}
% The macro \cs{nom@verb}, which is copied from~\cite{jone:anew:1995}
% and~\cite[p.~382]{knut:thet:1984}, makes it possible to use
% \cs{nomenclature} in another macro.
%    \begin{macrocode}
\def\nom@verb{\expandafter\strip@prefix\meaning}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\nomenclature}
% \changes{v2.7 (1999/05/14)}{1999/05/11}{Protected}
% This macro just protects the ``real'' \cs{@nomenclature} macro. I am not
% sure whether this makes sense because you shouldn't use \cs{nomenclature}
% in something like \cs{section} anyway, but it doesn't hurt.
%    \begin{macrocode}
\def\nomenclature{\protect\@nomenclature}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@nomenclature}
% \begin{macro}{\@@nomenclature}
% \changes{v5.0}{2018/12/28}{Nomentbl option}
% Without an executed \cs{makenomenclature}, \cs{@nomenclature} will only
% change some catcodes and call the macro \cs{@@nomenclature}
% to gobble its arguments.
%    \begin{macrocode}
\def\@nomenclature{%
  \@bsphack
  \begingroup
  \@sanitize
  \@ifnextchar[%
  {\@@nomenclature}{\@@nomenclature[\nomprefix]}}
\if@nomentbl
  \def\@@nomenclature[#1]#2#3#4#5{\endgroup\@esphack}
\else
  \def\@@nomenclature[#1]#2#3{\endgroup\@esphack}
\fi
%    \end{macrocode}
% \end{macro} \end{macro}
% \begin{macro}{\@@@nomenclature}
% \changes{v2.7 (1999/05/14)}{1999/05/11}{More robust by using \cs{nom@verb}}
% \changes{v5.0}{2018/12/28}{Nomentbl option}
% If \cs{makenomenclature} was already executed, then \cs{@nomenclature}
% calls the macro \cs{@@@nomenclature} which writes to the nomenclature file.
% It puts the prefix in front of the entry, adds brackets |[]| around the
% entry (because it will be the argument of an \cs{item}) and adds
% possible references at the end of the entry description. A group
% is started to keep changes to the reference switches local.
% The arguments are written using \cs{nom@verb} so they will not be
% expanded, even when \cs{nomenclature} is used within another macro.
% By the way, \cs{@bsphack} and \cs{@esphack} makes \cs{nomenclature}
% disappear between two spaces; unfortunately this doesn't work if
% \cs{nomenclature} is the first thing in a line.
%    \begin{macrocode}
\if@nomentbl
  \def\@@@nomenclature[#1]#2#3#4#5{%
    \def\@tempa{#2}\def\@tempb{#3}%
    \protected@write\@nomenclaturefile{}%
    {\string\nomenclatureentry{#1\nom@verb\@tempa @&{\nom@verb\@tempa}&%
        \begingroup\nom@verb\@tempb\endgroup &\begingroup#4\endgroup&%
        \begingroup#5\endgroup&\begingroup\protect\nomeqref{\theequation}%
        |nompageref}{\thepage}}%
    \endgroup
    \@esphack}
\else
  \def\@@@nomenclature[#1]#2#3{%
    \def\@tempa{#2}\def\@tempb{#3}%
    \protected@write\@nomenclaturefile{}%
    {\string\nomenclatureentry{#1\nom@verb\@tempa @[{\nom@verb\@tempa}]%
        \begingroup\nom@verb\@tempb\protect\nomeqref{\theequation}%
        |nompageref}{\thepage}}%
    \endgroup
    \@esphack}
\fi
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\nomgroup}
% \changes{v5.0}{2018/12/28}{Rewrote}
% The next macro is executed between each character group in the
% nomenclature.  The argument is the first character of the group.
%    \begin{macrocode}
\if@stdsubgroups
  \if@nomentbl
  \def\nomgroup#1{%
    \ifthenelse{\equal{#1}{A}}{%
      \item&\multicolumn{5}{@{}l}{\textbf{\nomAname}}}{%
        \ifthenelse{\equal{#1}{G}}{%
        \item&\multicolumn{5}{@{}l}{\textbf{\nomGname}}}{%
          \ifthenelse{\equal{#1}{X}}{%
          \item&\multicolumn{5}{@{}l}{\textbf{\nomXname}}}{%
            \ifthenelse{\equal{#1}{Z}}{%
            \item&\multicolumn{5}{@{}l}{\textbf{\nomZname}}}{%
              {}}}}}}
  \else
    \def\nomgroup#1{%
      \ifthenelse{\equal{#1}{A}}{%
      \item[\textbf{\nomAname}]}{%
        \ifthenelse{\equal{#1}{G}}{%
        \item[\textbf{\nomGname}]}{%
          \ifthenelse{\equal{#1}{X}}{%
          \item[\textbf{\nomXname}]}{%
            \ifthenelse{\equal{#1}{Z}}{%
            \item[\textbf{\nomZname}]}{%
              {}}}}}}
    \fi
\else
  \def\nomgroup#1{}
\fi
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\nomlabelwidth}
% This is the default label width for the nomenclature. It can be changed
% e.\,g.~in the |cfg| file.
%    \begin{macrocode}
\newdimen\nomlabelwidth
\nomlabelwidth1cm\relax
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\nom@tempdim}
% \changes{v2.9 (1999/11/23)}{1999/11/23}{New temporary dimension}
% \begin{macro}{\printnomenclature}
% \begin{macro}{\@printnomenclature}
% The optional argument is read and assigned to \cs{nom@tempdim}. Then
% the |gls| file is read.
%    \begin{macrocode}
\newdimen\nom@tempdim
\def\printnomenclature{%
  \@ifnextchar[%
    {\@printnomenclature}{\@printnomenclature[\nomlabelwidth]}}
\def\@printnomenclature[#1]{%
  \nom@tempdim#1\relax
  \@input@{\jobname\@inputfileextension}}
%    \end{macrocode}
% \end{macro} \end{macro} \end{macro}
% \begin{macro}{\printglossary}
% The |\printglossary| command has been depreciated, and is only available in compatibility mode.
%    \begin{macrocode}
\if@compatibilitymode\let\printglossary\printnomenclature\fi%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\nomlabel}
% \begin{macro}{\nompreamble}
% \begin{macro}{\nompostamble}
% \begin{macro}{\nomentryend}
% Now some bells and whistles to format the nomenclature:
% the definition of the label, the preamble, the postamble and the
% symbol that is added at the end of an entry. The last three are
% defined to do nothing by default.
%    \begin{macrocode}
\def\nomlabel#1{#1\hfil}
\def\nompreamble{}
\def\nompostamble{}
\def\nomentryend{}
%    \end{macrocode}
% \end{macro} \end{macro} \end{macro} \end{macro}
% \begin{macro}{\nomitemsep}
% \changes{v2.8 (1999/09/09)}{1999/09/09}{New skip \cs{nomitemsep}}
% The skip between two items is adjustable by changing \cs{nomitemsep}.
% It defaults to \cs{itemsep}.
%    \begin{macrocode}
\newskip\nomitemsep
\nomitemsep\itemsep
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\setnomtableformat}
%\changes{v5.0}{2018/12/28}{Added macro}
% The format of the nomenclature table.  We insert an empty left
% column due to the way \TeX\ sees \cs{multicolumn} in \cs{nomgroup}
% command.  
%    \begin{macrocode}
\def\setnomtableformat#1{\def\@nomtableformat{l@{}#1}}
\setnomtableformat{lp{0.45\textwidth}sp{0.3\textwidth}@{}l}
%    \end{macrocode}
% 
% \end{macro}
%
%
% \begin{environment}{thenomenclature}
%\changes{v5.1}{2019/01/27}{Changed \cs{markboth} to \cs{@mkboth} for
% chapters}
% \changes{v5.1}{2019/02/08}{Added tocbasic}
% \changes{v5.2}{2019/05/05}{Made tocbasic optional}
% The |thenomenclature| environment formats its title and optionally
% inserts an item in the TOC, both are dependant on
% whether the \cs{chapter} command is available or not. After
% printing the preamble, a list is started with the \cs{labelwidth}
% being set to the value defined in the optional argument of
% \cs{printnomenclature}, unless |nomentbl| is chosen.  In the latter
% case we start a longtable.  Note that each row of the table starts
% with \cs{item}, so we need to make the first \cs{item} noop, and all
% the subsequent ones to produce \cs{cr}.  We also add \cs{cr} at the
% end of the table.
%    \begin{macrocode}
\def\thenomenclature{%
  \providecommand*{\listofnlsname}{\nomname}%
  \if@nomencl@tocbasic
    \let\list@fname\listofnlsname
    \def\@currext{nls}%
    \tocbasic@listhead{\list@fname}%
   \else
    \@ifundefined{chapter}%
    {
      \section*{\nomname}
      \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
    }%
    {
      \chapter*{\nomname}
      \@mkboth{\nomname}{\nomname}%
      \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
    }%
  \fi
  \nompreamble
  \if@nomentbl
    \let\itemOrig=\item
    \def\item{\gdef\item{\\}}%
    \expandafter\longtable\expandafter{\@nomtableformat}
  \else
    \list{}{%
      \labelwidth\nom@tempdim
      \leftmargin\labelwidth
      \advance\leftmargin\labelsep
      \itemsep\nomitemsep
      \let\makelabel\nomlabel}%
  \fi
}
\def\endthenomenclature{%
  \if@nomentbl
    \item\endlongtable
    \global\let\item=\itemOrig
  \else
    \endlist
  \fi
  \nompostamble}
%    \end{macrocode}
% \end{environment}
% \begin{macro}{\nomrefeq}
% \begin{macro}{\refpage}
% \begin{macro}{\refeqpage}
% \begin{macro}{\norefeq}
% \begin{macro}{\norefpage}
% \begin{macro}{\norefeqpage}
% These are the switches to turn referencing on or off locally for a
% single entry.
%    \begin{macrocode}
\def\nomrefeq{\@printeqreftrue}
\def\nomrefpage{\@printpagereftrue}
\def\nomrefeqpage{\@printeqreftrue\@printpagereftrue}
\def\nomnorefeq{\@printeqreffalse}
\def\nomnorefpage{\@printpagereffalse}
\def\nomnorefeqpage{\@printeqreffalse\@printpagereffalse}
%    \end{macrocode}
% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
% \begin{macro}{\nomeqref}
% The equation is only referenced if the corresponding switch is
% true. Since \MakeIndex\ tends to insert a line break just before
% the page number, we have to add \cs{ignorespaces} at the end.
%    \begin{macrocode}
\def\nomeqref#1{\if@printeqref\eqdeclaration{#1}\fi\ignorespaces}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\nompageref}
% The page is also only referenced if requested. Then the end symbol is
% added and finally the group started in \cs{@@@nomenclature} is closed.
%    \begin{macrocode}
\def\nompageref#1{\if@printpageref\pagedeclaration{#1}\fi%
  \nomentryend\endgroup}
%    \end{macrocode}
% \end{macro}
%
% The commands defined in the \texttt{.ist} file
%
% Read the config file if it exists and the corresponding option was given.
%    \begin{macrocode}
\if@loadcfg
  \InputIfFileExists{\@cfgfile}{%
    \PackageInfo{nomencl}{Using the configuration file \@cfgfile}}{}
\fi
%    \end{macrocode}
%
% 
% 
%
% The end.
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
%
% \subsection{The \MakeIndex\ Style File}
% \label{sec:ist}
%
% The ``magic word'' for \MakeIndex\ in the input file is
% \cs{nomenclatureentry}. 
%    \begin{macrocode}
%<*idxstyle>
%% ---- for input file ----
keyword    "\\nomenclatureentry"
% We use % as a quote character since " is active in some languages
quote '%'
%    \end{macrocode}
% Define what is printed at the beginning and the end of the file and
% the skip between groups. Since we already write \cs{nomgroup} between
% groups, we define |group_skip| to just input an empty line.
%    \begin{macrocode}
%% ---- for output file ----
preamble   "\n\\begin{thenomenclature} \n"%
postamble  "\n\n\\end{thenomenclature}\n" group_skip "\n"
%    \end{macrocode}
% Since we can't handle multiple pages for an entry anyway, we also
% don't need any delimiters.
%    \begin{macrocode}
delim_0    ""
delim_1    ""
delim_2    ""
%    \end{macrocode}
% Now the macro between the groups. Since the flag is positive, the
% character will be inserted as a capital letter. As the comment
% states, this will cause some warnings. If someone has a better
% solution, let me know.
%    \begin{macrocode}
%% The next lines will produce some warnings when
%% running Makeindex as they try to cover two different
%% versions of the program:
lethead_prefix "\\nomgroup{"
lethead_suffix "}"
lethead_flag   1
heading_prefix "\\nomgroup{"
heading_suffix "}"
headings_flag  1
line_max 1000
%</idxstyle>
%    \end{macrocode}
%
%
%
% \Finale