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
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
|
%\iffalse
% glossary.dtx generated using makedtx version 0.9b (c) Nicola Talbot
% Command line args:
% -macrocode ".*\.p.*l"
% -macrocode ".*\.bat"
% -setambles ".*\.p.*l=>\nopreamble\nopostamble"
% -setambles ".*\.bat=>\nopreamble\nopostamble"
% -src "(.+)\.(sty)=>\1.\2"
% -src "(.+)\.(pl)=>\1.\2"
% -src "(.+)\.(bat)=>\1.\2"
% -src "(.+)\.(perl)=>\1.\2"
% -src "(.+)\.(tex)=>\1.\2"
% -doc "manual.tex"
% -author "Nicola Talbot"
% -dir "source"
% glossary
% Created on 2005/9/27 12:20
%\fi
%\iffalse
%<*package>
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%</package>
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2005 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
\documentclass[a4paper]{ltxdoc}
\usepackage{ifthen}
\usepackage[colorlinks,
bookmarks,
hyperindex=false,
pdfauthor={N.L.C. Talbot},
pdftitle={glossary.sty: LaTeX2e Package to Assist Generating Glossaries},
pdfkeywords={LaTeX,package,glossary}]{hyperref}
%hyperindex conflicts with doc
%(end up with |usage|hyperpage in indexentry)
%This unfortunately means that the changes section doesn't
%have active links, but at least it will keep makeindex happy.
\renewcommand{\usage}[1]{\textit{\hyperpage{#1}}}
\renewcommand{\main}[1]{\hyperpage{#1}}
\newcommand{\see}[2]{\emph{see} #1}
\makeatletter
\def\index@prologue{\section*{Index}}
\makeatother
\RecordChanges
\PageIndex
\OnlyDescription
\newcommand{\cmdname}[1]{\texttt{\symbol{92}#1}}
\newcommand{\istkey}[1]{\texttt{#1}\index{makeindex key>#1|hyperpage}}
\newcommand{\icmdname}[1]{\texttt{\symbol{92}#1}\SpecialMainIndex{#1}}
\newcommand{\appname}[1]{\texttt{#1}\index{#1=\texttt{#1}|hyperpage}}
\newcommand{\gloskey}[1]{\texttt{#1}\index{glossary keys=\cmdname{glossary} keys>#1|hyperpage}}
\newcommand{\setglos}[1]{\texttt{#1}\index{setglossary keys=\cmdname{setglossary} keys>#1|hyperpage}}
\newcommand{\glsnumfmt}[1]{\texttt{#1}%
\index{page number formats>#1|hyperpage}%
\index{glossary keys=\cmdname{glossary} keys>format>#1|hyperpage}}
\newcommand{\pkgopt}[2][]{%
\ifthenelse{\equal{#1}{}}{%
\texttt{#2}\index{package options>#2|hyperpage}}{%
\texttt{#2=#1}\index{package options>#2>#1|hyperpage}}}
\newcommand{\pkgoptval}[2]{\texttt{#1}\index{package options>#2>#1|hyperpage}}
\newcommand{\filetype}[1]{\texttt{#1}\index{file types>#1|hyperpage}}
\newcommand{\stynamefmt}[1]{\textsf{#1}\index{#1=\textsf{#1}|hyperpage}}
\newcommand{\envname}[1]{\textsf{#1}}
\begin{document}
\DocInput{glossary.dtx}
\end{document}
%</driver>
%\fi
%\MakeShortVerb{"}
%\DeleteShortVerb{\|}
%
% \title{glossary.sty v 2.24: \LaTeXe\ Package to Assist Generating Glossaries}
% \author{Nicola L.C. Talbot}
% \date{27th September 2005}
% \maketitle
%\tableofcontents
%
% \section{Introduction}
% \changes{1.0}{2004 July 29}{Initial version}
% The \stynamefmt{glossary} package is provided to assist
%generating a glossary. It has a certain amount of flexibility,
%allowing the user to customize the format of the glossary, and
%define new glossary-style objects.
%
%\section{Installation}
%
%You need to make sure you have downloaded the following three
%files:
%\begin{verbatim}
%glossary.ins
%glossary.dtx
%README
%\end{verbatim}
%To extract the code from the \texttt{glossary.dtx} file, you
%will need to run the installation file through LaTeX:
%\begin{verbatim}
%latex glossary.ins
%\end{verbatim}
%This will create the following files:
%\begin{verbatim}
%glossary.sty
%glossary.perl
%makeglos.pl
%makeglos.bat
%\end{verbatim}
%along with several sample files. The file \texttt{glossary.sty}
%should be placed somewhere in the \LaTeX\ path, e.g.\
%\texttt{texmf/tex/latex/glossary/}. The file
%\texttt{glossary.perl} is a \LaTeX2HTML\ style file, and should
%be placed in the \LaTeX2HTML\ style file directory (usually
%\texttt{latex2html/styles/}). The file \texttt{makeglos.pl}
%is a Perl script which calls \appname{makeindex}. If you are
%using UNIX or Linux, you will need to set the permissions so
%that you can execute the file:
%\begin{verbatim}
%chmod a+x makeglos.pl
%\end{verbatim}
%You should then place this file somewhere on your path.
%(You may also need to edit the first line of
%this file, if \appname{perl} is located in a directory other than \verb"/usr/bin/"\footnote{and you can also remove the \texttt{.pl}
%extension which isn't to everyone's liking.}.)
%
%If you are not using UNIX or Linux, you may have to explicitly
%load the file into Perl, so you would need to do
%\texttt{perl makeglos.pl} instead of just \texttt{makeglos.pl}.
%If you are using Windows, a batch file, \texttt{makeglos.bat}
%is provided which will run Perl on \texttt{makeglos.pl}.
%Both \texttt{makeglos.pl} and \texttt{makeglos.bat} should
%be placed somewhere specified by the PATH environment
%variable. (For example, put them both in the same
%directory as \appname{makeindex}, which will probably
%be in \verb+\texmf\miktex\bin\+).
%\changes{2.22}{2005 Sept 12}{added makeglos.bat file}
%
%If you don't have Perl installed on your system, you can just use
%\appname{makeindex}, only you will have to remember all the
%command line switches, and you won't be able to merge entries
%that have the same name, but different descriptions.
%
% \section{Generating Glossary Information}
%
% The standard \LaTeX\ command \cmdname{makeglossary}\DescribeMacro{\makeglossary}{} (analogous to \cmdname{makeindex})
% should be placed in the document preamble. If this command
%is omitted, glossary information will be ignored. Glossary
%entries are generated using the command
%\cmdname{glossary}\verb"{"\meta{key-val list}\verb'}'\DescribeMacro{\glossary}.
% This command is a slightly modified version of the standard
%\cmdname{glossary} command, in order to separate out the
%information into \meta{entry-name} and \meta{entry-description}.
%The argument to \cmdname{glossary} must be a comma-separated
%list of \meta{key}=\meta{value} pairs. The following keys are
%available:
%\begin{center}
%\begin{tabular}{ll}
%\bfseries Key & \bfseries Value\\
%\ttfamily \gloskey{name} & The entry name\\
%\ttfamily \gloskey{description} & A description about the entry\\
%\ttfamily \gloskey{sort} & How to sort the entry. (Entry name used if sort omitted)\\
%\ttfamily \gloskey{format} & How to format the page number
%\end{tabular}
%\end{center}
% For example:
%\begin{verbatim}
%\glossary{name={singular matrix},
% description={A matrix with zero determinant}}
%\end{verbatim}
% The following example sorts on the text \texttt{U} instead of
%\verb"$\mathcal{U}$":
%\begin{verbatim}
%\glossary{name={$\mathcal{U}$},
% description={The universal set},
% sort=U}
%\end{verbatim}
%The page format for individual entries can be changed using the
%\gloskey{format} key. This should be the name of a \LaTeX\
%formatting command without the preceding \verb'\' (as with the
%\verb'|' operator in \cmdname{index}.) For example:
%\begin{verbatim}
%\glossary{name={$\mathbb{R}$},
% description={The set of real numbers},
% sort=R,
% format=textbf}
%\end{verbatim}
%In addition, the following formats are also available:
%\changes{2.0}{2004 September 21}{Hyper page formats:
%\texttt{'hypersf}, \texttt{'hypertt}, \texttt{'hyperbf} and
%\texttt{'hyperbf}}
%\changes{2.12}{2004 November 1}{Hyper page format:
%\texttt{'hyperrm}}
%\begin{center}
%\begin{tabular}{ll}
%\glsnumfmt{hyperrm} & The number is a hyper link in roman \\
%\glsnumfmt{hypersf} & The number is a hyper link in sans-serif \\
%\glsnumfmt{hypertt} & The number is a hyper link in typewriter font \\
%\glsnumfmt{hyperbf} & The number is a hyper link in bold \\
%\glsnumfmt{hyperit} & The number is a hyper link in italic
%\end{tabular}
%\end{center}
%If the \pkgopt{hyper} option has not been set,
%\glsnumfmt{hyperrm} etc are equivalent to \texttt{textrm} etc.
%You should use \icmdname{hyperrm} instead of
%\cmdname{hyperpage}, as \cmdname{hyperpage} won't
%work on a list or range of numbers in the glossary%
%\footnote{This is because the list and number ranges are
%delimited using \cmdname{delimR} and \cmdname{delimN} instead of
%explicitly using a comma or en-dash.}.
%
%As with the \cmdname{index} command, care must be taken if you
%want to use the special characters: \verb'@' \verb/|/ \verb+"+ and
%\verb'!'. These characters should be preceded by the double quote
%character. For example:
%\begin{verbatim}
%\glossary{name={$"|\mathcal{S}"|$,
%description=The cardinality of the set \mathcal{S}}}
%\end{verbatim}
%There is no provision for sub-entries, as these are
%generally only applicable in an index, and not in a glossary.
%
%\changes{2.14}{2005 May 28}{'xglossary added}%
%As from version 2.14, there is an additional command available:
%\DescribeMacro{\xglossary}
%\par\vspace{10pt}\noindent\cmdname{xglossary}\verb'{'\meta{gls-entry}%
%\verb'}{'\meta{text}\verb"}"
%\par\vspace{10pt}\noindent This is equivalent to\meta{text}\icmdname{glossary}\verb'{'\meta{gls-entry}\verb"}",
%where \meta{text} will be made a hyperlink to the
%relevant entry in the glossary, if hyper
%links are supported.
%
%\subsection{Storing Glossary Information}
%
%\changes{2.17}{2005 June 28}{'storeglosentry added}
%\DescribeMacro{\storeglosentry}
%The following command:\\[10pt]
%\begin{ttfamily}
%\cmdname{storeglosentry}[\textrm{\meta{gls-type}}]\{\textrm{\meta{label}}\}\{\textrm{\meta{gls-entry}}\}
%\end{ttfamily}\\[10pt]
%can be used to store glossary information. That information
%can then be used later with any of the following commands:
%\changes{2.14}{2005 May 28}{'useglosentry added}
%\changes{2.14}{2005 May 28}{'useGlosentry added}
%\changes{2.18}{2005 July 5}{'gls added}
%\DescribeMacro{\useglosentry}
%\DescribeMacro{\useGlosentry}
%\DescribeMacro{\gls}\\[10pt]
%\begin{ttfamily}
%\cmdname{useglosentry}[\textrm{\meta{opt}}]\{\textrm{\meta{label}}\}\\
%\cmdname{useGlosentry}[\textrm{\meta{opt}}]\{\textrm{\meta{label}}\}\{\textrm{\meta{text}}\}\\
%\cmdname{gls}[\textrm{\meta{opt}}]\{\textrm{\meta{label}}\}
%\end{ttfamily}\\[10pt]
%\cmdname{useglosentry} adds the stored glossary entry
%\meta{gls-entry} to the appropriate glossary,
%\cmdname{useGlosentry} adds the stored glossary entry, and
%makes \meta{text} a hyperlink to that entry (if hyperlinks are
%supported). The third command, \cmdname{gls}, is like
%\cmdname{useGlosentry}, but forms \meta{text} from the name
%given in \meta{gls-entry}.
%
%Returning to an earlier example, instead of typing:
%\begin{verbatim}
%\glossary{name={$\mathcal{U}$},
% description={The universal set},
% sort=U}
%\end{verbatim}
%every time you want to add this entry to the glossary, you
%can instead store the information:
%\changes{2.19}{2005 July 8}{fixed bug in 'storeglosentry}
%\begin{verbatim}
%\storeglosentry{glos:U}{name={$\protect\mathcal{U}$},
% description={The universal set},
% sort=U}
%\end{verbatim}
%(Note the use of \cmdname{protect}.) Now, instead of continually
%copying and pasting the glossary command for this entry (which
%can have quite a large \gloskey{description} field), you can use either:
%\begin{verbatim}
%\useglosentry{glos:U}
%\end{verbatim}
%which is equivalent to:
%\begin{verbatim}
%\glossary{name={$\mathcal{U}$},
% description={The universal set},
% sort=U}
%\end{verbatim}
%or you can use:
%\begin{verbatim}
%\useGlosentry{glos:U}{text}
%\end{verbatim}
%which is equivalent to:
%\begin{verbatim}
%\xglossary{name={$\mathcal{U}$},
% description={The universal set},
% sort=U}{text}
%\end{verbatim}
%or you can use:
%\begin{verbatim}
%\gls{glos:U}
%\end{verbatim}
%which is equivalent to:
%\begin{verbatim}
%\xglossary{name={$\mathcal{U}$},
% description={The universal set},
% sort=U}{$\mathcal{U}$}
%\end{verbatim}
%The optional argument \meta{gls-type} indicates the glossary
%type (see \autoref{sec:newglostype} to find out how to define new
%glossary types). If omitted, the standard glossary is used.
%
%The optional argument \meta{opt} allows you to add additional
%information to the glossary entry, for example:
%\begin{verbatim}
%\useglosentry[format=textbf]{glos:U}
%\end{verbatim}
%is equivalent to:
%\begin{verbatim}
%\glossary{name={$\mathcal{U}$},
% description={The universal set},
% sort=U,
% format=textbf}
%\end{verbatim}
%The identifying label, \meta{label}, should not contain any
%special characters, and since \cmdname{storeglosentry} is
%fragile, care should be taken when using commands within its
%argument. If in doubt, use \cmdname{protect}.
%
%\section{makeglos.pl}
%
%The glossary information (as given by the commands
%\cmdname{glossary} and \cmdname{xglossary}) is saved in the file
%with the extension \filetype{glo} (unless the
%\icmdname{makeglossary} command is omitted, in which case the
%glossary information is simply ignored.) A \appname{makeindex}
%style file\index{makeindex style file (.ist)|see{file types, ist}}
%(\filetype{ist}) is also created, which is customized for the
%document, and can be passed to \appname{makeindex}.
%
%For example, suppose your document is called \texttt{mydoc.tex},
%the glossary will be saved in the file
%\texttt{mydoc.}\filetype{glo}, and the \appname{makeindex} style
%file \texttt{mydoc.}\filetype{ist} will be created.
% These files can then be passed to \appname{makeindex} as follows:
%\begin{verbatim}
%makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo
%\end{verbatim}
%which generates the output file \texttt{mydoc.}\filetype{gls},
%with transcript written to
%\texttt{mydoc.}\filetype{glg}.
%
%The Perl script \appname{makeglos.pl} provided with this package
%allows you to use \appname{makeindex} without having to remember
%all the command line options. The command
%\begin{verbatim}
%makeglos.pl mydoc.glo
%\end{verbatim}
%will perform the command:
%\begin{verbatim}
%makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo
%\end{verbatim}
%The \filetype{glo} extension may be omitted. In addition,
%\appname{makeglos.pl} also takes the option
%\texttt{-m} which can be used to collate entries where the
%same name has multiple descriptions.
%\changes{2.14}{2005 May 28}{makeglos -m switch added}
%
%\appname{makeglos.pl} has the following syntax:
%\begin{verbatim}
%makeglos.pl [-ilqrgm] [-s sty] [-o gls] [-t log] [-p num] <filename>
%\end{verbatim}
%where all switches, apart from \texttt{-m} are the same as
%those for \appname{makeindex}. In addition, if the extension
%to the input file name is omitted, \filetype{glo} will be
%assumed. If there are multiple glossary types (see
%\autoref{sec:newglostype}) and the file extension is omitted, \appname{makeglos.pl} will
%iterate through each glossary type.
%
%The name of the \filetype{ist} file can be changed by redefining
%the command \cmdname{istfilename}\DescribeMacro{\istfilename}.
%For example:
%\begin{verbatim}
%\renewcommand{\istfilename}{foo.ist}
%\end{verbatim}
%However, you will need to explicitly pass the name of this
%file to \appname{makeglos.pl} using the \texttt{-s} switch.
%
%Creation of the \filetype{ist} file can be suppressed by issuing
%the command \cmdname{noist}\DescribeMacro{\noist}\ before
%\icmdname{makeglossary}. It will also be suppressed when the
%command \icmdname{nofiles} is used, or if the command
%\icmdname{makeglossary} is omitted.
%
%It should be noted that there are a few packages that can
%cause problems with the creation of the \filetype{ist} file,
%for example \stynamefmt{ngerman}. If you encounter problems
%when \LaTeX\ is processing the \icmdname{makeglossary} command,
%or if you get errors from \appname{makeindex} complaining about
%the style file, this is the most probable cause.
%See \autoref{sec:trouble}, item~\ref{itm:ngerman} for
%information on how to fix this.
%
%\section{Displaying the Glossary}
%
% Once the \filetype{gls} file has been created by
%\appname{makeindex} (as described in the previous
% section) the glossary can then be included in the document with
%the command \cmdname{printglossary}\DescribeMacro{\printglossary}.
% If chapters are defined, the glossary will start
%with\SpecialMainIndex{glossaryname}
%\begin{verbatim}
%\chapter*{\glossaryname}
%\end{verbatim}
%If not, it will start with
%\begin{verbatim}
%\section*{\glossaryname}
%\end{verbatim}
%The format of the main body of the glossary depends on the
%options passed to the package.
%
%\section{Package Options}
%
%The package options must be specified as a comma-separated list
%of \meta{key}=\meta{value} pairs. Available options are:
%\begin{description}
%\item[\pkgopt{style}] The glossary style. Values:
%\index{glossary style|see{package options, style}}
%\begin{description}
%\item[\pkgoptval{list}{style}] use
%\envname{description} environment in the glossary
%\item[\pkgoptval{altlist}{style}] modified
%version of \pkgopt[list]{style}. The description starts on the
%line following the name of the term being defined.
%\changes{2.0}{2004 September 21}{Package option \texttt{altlist}
%style}
%\item[\pkgoptval{super}{style}] use
%\envname{supertabular} environment in the glossary
%\item[\pkgoptval{long}{style}] use
%\envname{longtable} environment in the glossary (Default)
%\end{description}
%
%\item[\pkgopt{header}]\index{glossary header|see{package options, header}} Glossary
%header. Values:
%\begin{description}
%\item[\pkgoptval{none}{header}] The glossary
%doesn't have a heading (Default)
%\item[\pkgoptval{plain}{header}] The glossary
%has a heading
%\end{description}
%
%\item[\pkgopt{border}]\index{glossary border|see{package options, border}} Glossary
%border. Values:
%\begin{description}
%\item[\pkgoptval{none}{border}] The glossary
%doesn't have a border (Default)
%\item[\pkgoptval{plain}{border}] Border
%around the main body of the glossary
%\end{description}
%
%\item[\pkgopt{cols}]\index{glossary columns|see{package options, cols}} Number of
%columns. Values:
%\begin{description}
%\item[\pkgoptval{2}{cols}] The entry name and description are in two separate
%columns with the associated page numbers in the same column as
%the description. (Default)
%\item[\pkgoptval{3}{cols}] The entry name, description and associated page numbers
%are in three separate columns.
%\end{description}
%
% \changes{1.1}{2004 August 14}{Package option \texttt{number}}
%\item[\pkgopt{number}]
% Associated number corresponding to each entry. Values:
%\begin{description}
%\item[\pkgoptval{page}{number}]
%Each entry has the corresponding page number(s) where the
%entry is defined. (Default)
%\item[\pkgoptval{section}{number}]
%Each entry has the corresponding section number(s) where
%the entry is defined.
%\item[\pkgoptval{none}{number}] The corresponding numbers are
%suppressed.
%\end{description}
%
%\item[\pkgopt{toc}]\index{table of contents, adding to|see{package options, toc}}
%Boolean variable:
%\changes{2.0}{2004 September 21}{Package option \texttt{toc}}
%\begin{description}
%\item[\pkgoptval{true}{toc}] Add glossary to table of contents
%\item[\pkgoptval{false}{toc}] Omit glossary from table of contents (Default)
%\end{description}
%Note that if you specify this option, you will need to run
%\LaTeX\ twice after generating the glossary.
%
%\item[\pkgopt{hypertoc}]
%Boolean variable. This is similar to the package option
%\pkgopt{toc}, but if you are using the \stynamefmt{hyperref}
%package, \pkgopt{hypertoc} will generate a link to the
%beginning of the page, whereas \pkgopt{toc} will have
%a hyperlink to jst after the glossary title. Note
%that you can not use both \pkgopt[true]{toc} and
%\pkgopt[true]{hypertoc}. Default value:
%\pkgopt[false]{hypertoc}.
%\changes{2.24}{2005 September 27}{Package option \texttt{hypertoc}}
%
%\item[\pkgopt{hyper}] Boolean
%variable:
%\changes{2.0}{2004 September 21}{Package option \texttt{hyper}}
%\begin{description}
%\item[\pkgoptval{true}{hyper}] Make associated numbers in the
%glossary a hypertext link, and also make acronyms, and the text
%given by \icmdname{xglossary} have a hyperlink to their
%corresponding entries in the glossary.
%\item[\pkgoptval{false}{hyper}] Don't make associated numbers a hypertext link
%\end{description}
%If the \stynamefmt{hyperref} or \stynamefmt{html} package has
%been loaded prior to loading \texttt{glossary.sty},
%\pkgopt[true]{hyper} is set, otherwise
%the default is \pkgopt[false]{hyper}. Note that this package
%option now encompasses the old \pkgopt{hyperacronym} option.
%
%\item[\pkgopt{section}] Boolean variable:
%\changes{2.12}{2004 November 1}{Package option \texttt{section}}
%\begin{description}
%\item[\pkgoptval{true}{section}] Make the glossary an unnumbered
%section, even if chapters are defined%
%
%\item[\pkgoptval{false}{section}] Only make glossary an
%unnumbered section if chapters are not defined (default).
%\end{description}
%
%\item[\pkgopt{acronym}] Boolean variable:
%\changes{2.17}{2005 June 28}{Package option \texttt{acronym}}
%\begin{description}
%\item[\pkgoptval{true}{acronym}] Make the list of acronyms
%separate from the main glossary.
%
%\item[\pkgoptval{false}{acronym}] The acronyms will all
%be placed in the main glossary. (Default)
%\end{description}
%\end{description}
% The \pkgopt{border}, \pkgopt{header} and \pkgopt{cols} options
%should not be used in conjunction with \pkgopt[list]{style}
%or \pkgopt[altlist]{style}, as they only make sense with one of
%the tabular-style options.
%The value for the boolean variables can be omitted if they are
%to be set. For example
% \pkgopt{toc} is equivalent to \pkgopt[true]{toc}. Note that the
%\pkgoptval{altlist}{style} style is better suited to
%glossaries with long entry names.
%
%You can set up your own preferred defaults in a configuration
%file%
%\index{glossary.cfg|see{file type, cfg}}.
%The file must be called \texttt{glossary.}\filetype{cfg} and
%should be placed somewhere on the \TeX\ path. In this file you
%can use the command \DescribeMacro{\glossarypackageoptions}%
%\noindent
%\cmdname{glossarypackageoptions}\verb'{'\meta{option-list}\verb/}/
%\noindent
%where \meta{option-list} is a comma-separated list of
%\meta{key}=\meta{value} pairs, as passed to the
%\stynamefmt{glossary}
%package. Note that this command may only be used in the
%configuration file.
%
%\subsection{Examples}
% Suppose the document has the following \icmdname{glossary}
%commands:
%\begin{center}\ttfamily
%\begin{tabular}{@{\rmfamily}ll@{}l}
%\bfseries Page & \multicolumn{2}{c}{\bfseries\rmfamily Command}\\
%1 & \cmdname{glossary}\{&name=diagonal matrix,\\
% & &description=Matrix whose only non-zero\\
% & &entries are along the leading diagonal\}\\
%2 & \cmdname{glossary}\{&name=identity matrix,\\
% & &description=Diagonal matrix with 1s along the \\
% & &leading diagonal\}\\
%4 & \cmdname{glossary}\{&name=singular matrix,\\
% & &description=Matrix with zero determinant\}
%\end{tabular}
%\end{center}
%
%\noindent Variations:
%\begin{enumerate}
%\item If \pkgopt[list]{style} is chosen, the glossary will look like:
%\begin{description}
%\item[diagonal matrix] Matrix whose only non-zero entries are along the leading
% diagonal, 1
%\item[identity matrix] Diagonal matrix with 1s along the leading diagonal, 2
%\item[singular matrix] Matrix with zero determinant, 4
%\end{description}
%
%\item If \pkgopt[altlist]{style} is chosen, the glossary will look like:
%\begin{description}
%\item[diagonal matrix]\mbox{}\par Matrix whose only non-zero entries are along the leading
% diagonal, 1
%\item[identity matrix]\mbox{}\par Diagonal matrix with 1s along the leading diagonal, 2
%\item[singular matrix]\mbox{}\par Matrix with zero determinant, 4
%\end{description}
%
%\item If \pkgopt[list]{style},\pkgopt[none]{number}%
% is chosen, the glossary will look like:
%\begin{description}
%\item[diagonal matrix] Matrix whose only non-zero entries are along the leading
% diagonal
%\item[identity matrix] Diagonal matrix with 1s along the leading diagonal
%\item[singular matrix] Matrix with zero determinant
%\end{description}
%
%\item If \pkgopt[long]{style},\pkgopt[none]{border},%
%\pkgopt[none]{header},\pkgopt[page]{number}
%is chosen (default), the glossary will look like:\\[10pt]
%\newlength{\descriptionwidth}\setlength{\descriptionwidth}{0.6\textwidth}
%\begin{tabular}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}} &
%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
% diagonal, 1
%\\ &
%\\identity matrix & Diagonal matrix with 1s along the leading diagonal, 2
%\\ &
%\\ singular matrix & Matrix with zero determinant, 4
%\end{tabular}
%
%\item If \pkgopt[long]{style},\pkgopt[plain]{border},%
%\pkgopt[none]{header} is chosen,
%the glossary will look like:
%\\[10pt]
%\begin{tabular}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}\hline &
%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
% diagonal, 1
%\\ &
%\\identity matrix & Diagonal matrix with 1s along the leading diagonal, 2
%\\ &
%\\ singular matrix & Matrix with zero determinant, 4
%\\ & \\\hline
%\end{tabular}
%
%\item If \pkgopt[long]{style},\pkgopt[plain]{border},%
%\pkgopt[plain]{header} is
%chosen, the glossary will look like:
%\\[10pt]
%\begin{tabular}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}\hline
%\bfseries Notation & \bfseries Description\\\hline\hline &
%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
% diagonal, 1
%\\ &
%\\identity matrix & Diagonal matrix with 1s along the leading diagonal, 2
%\\ &
%\\ singular matrix & Matrix with zero determinant, 4
%\\ & \\\hline
%\end{tabular}
%
%\item If \pkgopt[long]{style},\pkgopt[none]{border},%
%\pkgopt[plain]{header},\pkgopt[3]{cols} is chosen, the
%glossary will look like:
%\\[10pt]
%\begin{tabular}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l}
%\bfseries Notation & \bfseries Description & \\ &
%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
% diagonal & 1
%\\ &
%\\identity matrix & Diagonal matrix with 1s along the leading diagonal & 2
%\\ &
%\\ singular matrix & Matrix with zero determinant & 4
%\\ & \\
%\end{tabular}
%\end{enumerate}
%
%
%\section{Defining New Glossary Types}
%\label{sec:newglostype}
%
%A new type of glossary can be defined using the command:\DescribeMacro{\newglossarytype}\\[5pt]
%\cmdname{newglossarytype}\verb/[/\meta{log-ext}\verb"]{"\meta{name}\verb'}{'\meta{out-ext}\verb+}{+\meta{in-ext}\verb!}!\\[5pt]
%For example, suppose you want your document to have a separate
%index of terms and index of notation,
%you could use \icmdname{makeglossary}, \icmdname{glossary},
%\icmdname{xglossary} and \icmdname{printglossary} for the first
%glossary, and define a new type of glossary called say,
%\texttt{notation}, using
%\begin{verbatim}
%\newglossarytype[nlg]{notation}{not}{ntn}
%\end{verbatim}
%which will create the analogous commands:
%\cmdname{makenotation}, \cmdname{notation}, \cmdname{xnotation}
%and \cmdname{printnotation} which can be used for the second
%glossary.
%
%The command \cmdname{newglossarytype} should only occur in the
%preamble. The new commands
% \cmdname{make}\meta{name}, \verb'\'\meta{name},
%\verb'\x'\meta{name} and \cmdname{print}\meta{name} all have the
%same format as their ``glossary'' counter-parts.
%
%The glossary information will be saved to a file
%with the extension given by \meta{out-ext} (analogous to
%\filetype{glo}), which can then be passed to \appname{makeindex}
%either directly or via \appname{makeglos.pl},
%and the file to be read in (i.e.\ the file created by
%\appname{makeindex}) will have the extension \meta{in-ext}
%(analogous to \filetype{gls}).
%
%The optional argument \meta{log-ext} indicates
%the extension for the \appname{makeindex} log file, if omitted the
%extension \filetype{glg} is used. This is not used by \LaTeX,
%however \appname{makeglos.pl} reads in this information from
%the \LaTeX\ auxiliary file and passes it to \appname{makeindex}.\changes{2.22}{2005 Sept 12}{changed makeglos to read information in from .aux instead of .log file}
%
%For the above \texttt{notation}
%example, if your document is called, say, \texttt{mydoc.tex},
% you will need to do the following:
%\begin{verbatim}
%latex mydoc
%makeglos.pl mydoc
%latex mydoc
%\end{verbatim}
%(You may need to do an extra \verb"latex mydoc" to get
%cross-references up-to-date.) Note that if you don't specify the
%file extension when using \appname{makeglos.pl}, it will
%check the transcript file from the \LaTeX\ run to determine
%all the glossary types, so, for this example,
%\begin{verbatim}
%makeglos.pl mydoc
%\end{verbatim}
%is equivalent to:
%\begin{verbatim}
%makeglos.pl mydoc.glo
%makeglos.pl mydoc.not
%\end{verbatim}
%since \appname{makeglos.pl} has read in the information
%for the \texttt{notation} glossary type from the file
%\texttt{mydoc.log}.
%
%If you don't have Perl installed
%on your system, or for any other reason are unable to use
%\appname{makeglos.pl}, you can call \appname{makeindex}
%explicitly:
%\begin{verbatim}
%latex mydoc
%makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo
%makeindex -s mydoc.ist -t mydoc.nlg -o mydoc.ntn mydoc.not
%latex mydoc
%\end{verbatim}
%
%Note that you can use the command
%\icmdname{printglossary}\texttt[\meta{name}\texttt]
%instead of \verb'\print'\meta{name}.
%These two commands have the same effect when using \LaTeX,
%however, they have a slightly different effect when
%using \LaTeX2HTML (see \autoref{sec:l2h}).
%
%If the command \verb'\'\meta{glossary-type}\verb"name"
%is defined, (e.g.\ \verb'\notationname' in the above example)
%this will be used as the title for the specified
%glossary. If this command is not defined, \icmdname{glossaryname}
%will be used instead.
%If the command \verb'\short'\meta{glossary-type}\verb"name"
%is defined, (e.g.\ \cmdname{shortnotationname} in the above
%example) this will be used for the table of contents
%entry, otherwise \verb'\'\meta{glossary-type}\verb"name" will
%be used instead.
%For example:
%\begin{verbatim}
%\newglossarytype[nlg]{notation}{not}{ntn}
%\newcommand{\notationname}{Index of Notation}
%\newcommand{\shortnotationname}{Notation}
%\end{verbatim}
%
%\section{Acronyms}
%
%\changes{2.0}{2004 September 21}{Acronyms}
%The \stynamefmt{glossary} package provides the command\DescribeMacro{\newacronym}:\\[5pt]
%\begin{ttfamily}
%\cmdname{newacronym}[\textrm{\meta{cmd-name}}]\{\textrm{\meta{acronym}}\}\{\textrm{\meta{long}}\}\{\textrm{\meta{glossary entry}}\}
%\end{ttfamily}\\[5pt]
%which can be used to define acronyms. The argument \meta{long}
%is the full name, the argument \meta{acronym} is the acronym for
%\meta{long} and \meta{glossary entry} is the glossary information
%in the form used by the \icmdname{glossary} command. If the
%optional argument \meta{cmd-name} is missing,
%\cmdname{newacronym} will create a command called
%\verb!\!\meta{acronym}, otherwise it will create a command
%called \verb'\'\meta{cmd-name} (henceforth denoted \cmdname{}\meta{acr-name}).
%This command can then be used throughout the text. The first
%instance of this command is equivalent to:\\[10pt]
%\meta{long} \texttt(\icmdname{xacronym}\verb"{"\gloskey{name}\texttt{=}\meta{long} \texttt(\meta{acronym}\texttt{),}\meta{glossary entry}\verb'}{'\meta{acronym}\verb/}/\texttt)\\[10pt]
%subsequent instances will be equivalent to:\\[10pt]
%\icmdname{xacronym}\verb"{"\gloskey{name}\texttt{=}\meta{long} \texttt(\meta{acronym}\texttt{),}\meta{glossary entry}\verb'}{'\meta{acronym}\verb/}/\\[10pt]
%The command \cmdname{}\meta{acr-name} also has a starred
%version, which will make the first letter of \meta{long}
%uppercase (for use at the start of a sentence).
%
%Note that if you want to change the format of the acronym,
%for example, if you want the acronym to appear in small caps,
%you will need to not only use the optional argument, but you
%will also need to use the \gloskey{sort} key, otherwise you
%will get an error. For example:
%\begin{verbatim}
%\newacronym[SVM]{\textsc{svm}}{Support Vector Machine}%
%{description=Statistical pattern recognition
%technique,sort=svm}
%\end{verbatim}
%
%If the package option \pkgopt{acronym} is not set (default)
%\icmdname{xacronym}, is a synonym for \icmdname{xglossary}.
%If the package option \pkgopt[true]{acronym} is specified, a
%new glossary type called \texttt{acronym} will be defined as:
%\begin{verbatim}
%\newglossarytype[alg]{acronym}{acr}{acn}
%\newcommand{\acronymname}{List of Acronyms}
%\end{verbatim}
%You will then need to use the commands \icmdname{makeacronym}
%and \icmdname{printacronym} to make the list of acronyms appear.
%You will also need to run the \filetype{acr} file through
%\appname{makeindex} (or \appname{makeglos.pl}). For example:
%\begin{verbatim}
%makeindex -s mydoc.ist -t mydoc.alg -o mydoc.acn mydoc.acr
%\end{verbatim}
%alternatively:
%\begin{verbatim}
%makeglos.pl mydoc
%\end{verbatim}
%Note that the package option \pkgopt[true]{acronym} is only
%appropriate if you want both a glossary and a separate list of
%acronyms.
%
%\changes{2.1}{2004 October 25}{name field can be omitted in
%\texttt{'newacronym}}
%The \gloskey{name} key is not used in \meta{glossary
%entry}, as it is constructed from \meta{long} and
%\meta{acronym}. By default this will be in the form:
%\meta{long} (\meta{acronym}), however the format can be
%overridden using the
%command:\DescribeMacro{\setacronymnamefmt}\\[10pt]
%\cmdname{setacronymnamefmt}\{\meta{format}\}\\[10pt]
%Within \meta{format} the following commands may
%be used to represent \meta{long} and \meta{acronym}:
%\DescribeMacro{\glolong}\icmdname{glolong} and
%\DescribeMacro{\gloshort}\icmdname{gloshort}. For example,
%suppose you just want the acronym to appear in the glossary entry,
%and not its full length name, then you would need to do:
%\begin{verbatim}
%\setacronymnamefmt{\gloshort}
%\end{verbatim}
%
%Given an acronym named \meta{acr-name} (the command name
%associated with the acronym as defined in
%\cmdname{newacronym} without the preceding backslash),
%the following commands are also available:
%
%\vspace{10pt}
%\changes{2.11}{2004 October 25}{\texttt{'useacronym}}
%\changes{2.18}{2005 July 5}{Fixed bug in 'useacronym}
%\noindent
%\cmdname{useacronym}\verb"["\meta{insert}\verb']{'\meta{acr-name}\verb!}!\DescribeMacro{\useacronym}\\[5pt]
%This command can be used instead of \cmdname{}\meta{acr-name}.
%\cmdname{useacronym} also has a starred version equivalent to
%\cmdname{}\meta{acr-name}\texttt{*}.
%The optional argument \meta{insert} allows you to insert text
%after \meta{long}, if this is the first occurrence of the
%acronym, or after the acronym on subsequent occurrences.
%
%\vspace{10pt}
%\changes{2.14}{2005 May 28}{'resetacronym added}\noindent
%\cmdname{resetacronym}\verb'{'\meta{acr-name}\verb"}"
%\DescribeMacro{\resetacronym}\\[10pt]
%This command will cause the next use of \cmdname{}\meta{acr-name}
%to produce the long version. To reset all acronyms
%do \cmdname{resetallacronyms}.\DescribeMacro{\resetallacronyms}
%\changes{2.21}{2005 July 27}{'resetallacronyms added}
%
%\vspace{10pt}
%\changes{2.14}{2005 May 28}{'ifacronymfirstuse added}\noindent
%\cmdname{ifacronymfirstuse}%
%\verb'{'\meta{acr-name}%
%\verb'}{'\meta{true text}\verb"}{"\meta{false text}\verb!}!
%\DescribeMacro{\ifacronymfirstuse}\\[10pt]
%This will test if the acronym has been used yet. If it has been
%used, \meta{true text} will be implemented, otherwise
%\meta{false text} will be implemented.
%
%The long and short forms of an acronym can be produced explicitly
%without a corresponding glossary entry, using the commands:\\[10pt]
%\changes{2.19}{2005 July 8}{'acrln added}%
%\cmdname{acrln}\verb'{'\meta{acr-name}\verb/}/\DescribeMacro{\acrln}\\
%\cmdname{acrsh}\verb'{'\meta{acr-name}\verb/}/\DescribeMacro{\acrsh}
%\changes{2.19}{2005 July 8}{'acrsh added}\\[10pt]
%Or, alternatively:\\[10pt]
%\cmdname{}\meta{acr-name}\texttt{long}\\
%\cmdname{}\meta{acr-name}\texttt{short}\\[10pt]
%The first two commands (\cmdname{acrln} and \cmdname{acrsh})
%have a starred form that makes the first letter uppercase.
%The other two commands, simply contain \meta{long} and
%\meta{acronym}.
%
%Note that since these four commands do not generate glossary
%entries they will therefore not contain any hyperlinks, even if
%you have specified the \pkgopt{hyper} package option. They are
%provided for use in situations where the associated glossary
%command may cause problems (e.g.\ in the table of contents entry.)
%
%Note that, as with all \LaTeX\ commands, spaces following
%command names are ignored so if, for example, you defined
%a new acronym called, say, SVM, then the \verb/\SVM/ will
%ignore any spaces following it. To force a space, you
%can either place an empty set of braces after the command
%name (e.g.\ \verb/\SVM{}/) or use
%\cmdname{\textvisiblespace} i.e.\ a backslash followed by
%a space (e.g.\ \verb/\SVM\ /). Alternatively, as from
%version 2.22, if you load the \stynamefmt{xspace} package
%before loading the \stynamefmt{glossary} package, spaces will
%be put in automatically using \icmdname{xspace}.
%\changes{2.22}{2005 Sept 16}{Added provision for 'xspace}
%\changes{2.23}{2005 Sept 17}{Fixed minor bug with hyperlinks and 'glsxspace}
%
%\DescribeMacro{\acronymfont}
%\changes{2.22}{2005 Sept 12}{Added 'acronymfont}%
%If you want the acronym to appear in a particular font,
%for example, small caps, you can redefine the command
%\cmdname{acronymfont}. For example:
%\begin{verbatim}
%\renewcommand{\acronymfont}[1]{\textsc{#1}}
%\end{verbatim}
%The default definition of \cmdname{acronymfont} is:
%\begin{verbatim}
%\newcommand{\acronymfont}[1]{#1}
%\end{verbatim}
%
%\subsection{Examples}
%
%\begin{verbatim}
%\newacronym{SVM}{Support Vector Machine}{description=Statistical
%pattern recognition technique}
%\end{verbatim}
%This will define the command \cmdname{SVM}. The first time this
%command is used will display the text: Support Vector Machine
%(SVM). Subsequent use will simply display: SVM. The next
%example uses the optional argument \meta{cmd-name} since the
%acronym contains a non-alphabetical character:
%\begin{verbatim}
%\newacronym[KSVM]{K-SVM}{Kernel Support Vector
%Machine}{description=Statistical pattern recognition
%technique using the ``kernel trick''}
%\end{verbatim}
%This will define the command \cmdname{KSVM}. The first time
%this command is used will display the text: Kernel Support Vector
%Machine (K-SVM). Subsequent use will simply display: K-SVM.
%
%To test whether or not an acronym has been used:
%\begin{verbatim}
%\ifacronymfirstuse{SVM}{a}{an} \SVM\ is \ldots
%\end{verbatim}
%If the acronym has not been used, the following text will
%be produced:\\[10pt]
%a Support Vector Machine is \ldots\\[10pt]
%otherwise it will produce:\\[10pt]
%an SVM is \ldots\\[10pt]
%To expand the acronym a second time:
%\begin{verbatim}
%\chapter{An overview of the \protect\SVM}
%\resetacronym{SVM}
%The \SVM\ \ldots
%\end{verbatim}
%Note the use of \cmdname{protect} (see
%note~\ref{itm:fragile} on page~\pageref{itm:fragile}.) In fact, in this situation
%it would be better to do:
%\begin{verbatim}
%\chapter[An overview of the \SVMlong]{An overview of the \protect\SVM}
%\resetacronym{SVM}
%The \SVM\ \ldots
%\end{verbatim}
%
%Now suppose you want the text: support vector machine,
%instead of Support Vector Machine (i.e.\ you don't like the
%uppercase letters). You can define the acronym as follows:
%\begin{verbatim}
%\newacronym{SVM}{support vector machine}{description=Statistical
%pattern recognition technique}
%\end{verbatim}
%however, if the command \cmdname{SVM} occurs at the start of the
%sentence, you would clearly want the first letter as an
%uppercase letter. This can be done using \cmdname{SVM*} instead
%of \cmdname{SVM}. For example:
%\begin{verbatim}
%\SVM*\ techniques are widely used \ldots
%\end{verbatim}
%This will then come out as: Support vector machine (SVM)
%techniques are widely used \ldots (Assuming this is the first
%use of either \cmdname{SVM} or \cmdname{SVM*}.)
%
%Alternatively, \icmdname{useacronym}\verb'{SVM}' can be used instead of
%\cmdname{SVM}. For example:
%\begin{verbatim}
%\useacronym*[s]{SVM} are widely used in the area of pattern
%recognition.
%\end{verbatim}
%If this is the first use of the acronym SVM, it will produce the
%following text:\\[10pt]
%Support vector machines (SVM) are widely used in the area of
%pattern recognition.\\[10pt]
%If this is not the first use of this acronym, it will produce the
%following text:\\[10pt]
%SVMs are widely used in the area of pattern recognition.
%
%\section{Customizing the Glossary}
%The \stynamefmt{glossary} package provides commands which can be redefined to customize the
%glossary. The following name commands are defined by this package:
%\begin{center}\DescribeMacro{\glossaryname}\DescribeMacro{\entryname}\DescribeMacro{\descriptionname}\relax
%\begin{tabular}{ll}
%\bfseries Command & \bfseries Default Value\\
%\cmdname{glossaryname} & Glossary\\
%\cmdname{shortglossaryname} & \cmdname{glossaryname}\\
%\cmdname{entryname} & Notation\\
%\cmdname{descriptionname} & Description
%\end{tabular}
%\end{center}
%\changes{2.2}{2005 July 15}{'glossaryname now defined using 'providecommand instead of 'newcommand}
% \changes{2.15}{2005 June 5}{'shortglossaryname}
%\changes{2.16}{2005 June 8}{fixed bug preventing changes
%to 'glossaryname and 'shortglossaryname}
%\DescribeMacro{\shortglossaryname}
%The command \cmdname{shortglossaryname} is used for the
%page headers and table of contents entry.
% \changes{1.1}{2004 August 14}{'glossarypreamble}%
% \changes{1.1}{2004 August 14}{'glossarypostamble}%
%Any text required before or after the glossary can be added
%by redefining the commands \DescribeMacro{\glossarypreamble}\cmdname{glossarypreamble}
%and \DescribeMacro{\glossarypostamble}\cmdname{glossarypostamble}.
%For example.
%\begin{verbatim}
%\renewcommand{\glossarypreamble}{Page numbers in
%italic indicate the main definition\par}
%\end{verbatim}
%By default, \cmdname{glossarypreamble} and \cmdname{glossarypostamble} do nothing.
%
%\changes{1.1}{2004 August 14}{\relax Increased User Flexibility}%
%\changes{2.14}{2005 May 29}{'setglossary added}
%\DescribeMacro{\setglossary}
%The command \cmdname{setglossary}\verb'{'\meta{key-val list}\verb"}"
%can be used to modify some of the glossary settings. The argument
%\meta{key-val list} is a comma-separated list of
%\meta{key}=\meta{value} pairs. Available keys are:
%\begin{description}
%\item[\setglos{type}] This is the glossary type.
%If it is omitted, the standard glossary is assumed.
%
%\item[\setglos{glsnumformat}]
%\changes{1.1}{2004 August 14}{\texttt{'glsnumformat}}%
%This is the name of the command,
%\emph{without} the preceding backslash\footnote{Note, you should
%no longer try redefining the command \cmdname{glsnumformat}, as
%this now takes an optional argument, allowing for different
%glossary types}, to format the
%entry numbers. For example, to make all the entry numbers italic,
%do:
%\begin{verbatim}
%\setglossary{glsnumformat=textit}
%\end{verbatim}
%To suppress numbering altogether, you can do:
%\begin{verbatim}
%\setglossary{glsnumformat=ignore}
%\end{verbatim}
%
%\item[\setglos{glodelim}] This
%specifies what to do after the entry description and
%before the page numbers. The default value is a comma, unless the \pkgopt[3]{cols} option is specified,
%in which case it has the value \verb"&", or if
%\pkgopt[altlist]{style},
%in which case it is simply a space\footnote{This
%is because the \texttt{altlist} style is intended for use with long descriptions that will look better ending with a
% full stop which the user can add if desired.}. If the package option \pkgopt[none]{number} is
%specified, \setglos{glodelim} will have an empty value (unless
%\pkgopt[3]{cols} is specified,
%where, again, it will have the value \verb"&".)
%This setting corresponds to the \istkey{delim\_0} key in the
%\appname{makeindex} style file.
%
%\item[\setglos{delimN}]
%\changes{1.1}{2004 August 14}{\texttt{'delimN}}
%The delimiter to be inserted between two
%page numbers for the same entry. (This corresponds to the
%\istkey{delim\_n} key in the \appname{makeindex} style file.)
%By default, this has the value
%\texttt{,\textvisiblespace} (comma followed by a space). If the
%package option \pkgopt[none]{number} is chosen, the value is set
%to empty.
%
%\item[\setglos{delimR}]
%\changes{1.1}{2004 August 14}{'delimR}
%The delimiter to be inserted between the starting and ending page
%number range for the same entry. (This corresponds to the
%\istkey{delim\_r} key in the \appname{makeindex} style file.)
%By default, this has the value \verb"--". If the
%package option \pkgopt[none]{number} is chosen, the value is set
%to empty.
%
%\end{description}
%Note that:
%\begin{verbatim}
%\setglossary{glsnumformat=ignore}
%\end{verbatim}
%is equivalent to
%\begin{verbatim}
%\setglossary{glsnumformat=ignore,delimN={},delimR={}}
%\end{verbatim}
%
%The number associated with each entry is, by default, the page number where
% that entry was defined. If the package option
%\pkgopt[section]{number} has been chosen, this
% will be the section number instead. You can choose a different counter
% by changing the value of the command \cmdname{theglossarynum}\DescribeMacro{\theglossarynum}.
%For example, suppose you have the following code:
%\begin{verbatim}
%\begin{equation}
%\Gamma(z) = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
%\end{equation}
%\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
%\end{verbatim}
%and you want the glossary to refer to the equation number, instead of the
%page or section number, this can be done by redefining \cmdname{theglossarynum}
%as follows:
%\begin{verbatim}
%\renewcommand{\theglossarynum}{\theequation}
%\end{verbatim}
%If the equation number depends on another counter (such as
%\texttt{chapter})
%you will need to specify that the number is in the form \meta{NUM}.\meta{num}
% (e.g.\ 3.24). This can be done by redefining the \cmdname{pagecompositor}\DescribeMacro{\pagecompositor}\ command:
%\begin{verbatim}
%\renewcommand{\pagecompositor}{.}
%\end{verbatim}
%(By default this value is \texttt{-}, unless the package option
%\pkgopt[section]{number} has
%been chosen, in which case this command has the value \texttt{.}\
%(full stop), as in the example above).
%The \cmdname{pagecompositor} command must be
%redefined before \icmdname{makeglossary} for it to have any effect.
%If the package option \pkgopt[none]{number} is used,
%the numbering will be suppressed, regardless
%of the value of \icmdname{theglossarynum}.
%This command corresponds to the \istkey{page\_compositor} key
%in the \appname{makeindex} style file.
%
%The start and end of the main body of the glossary is given by the commands:
%\cmdname{beforeglossary}\DescribeMacro{\beforeglossary}{} and
%\cmdname{afterglossary}\DescribeMacro{\afterglossary}.
%If the \pkgopt[list]{style}
%or \pkgopt[altlist]{style}
%package options are chosen these commands simply begin and end
%the \envname{description}
%environment, otherwise these commands begin and end the
%\envname{longtable} or
%\envname{supertabular}
%environment with argument specified by
%\cmdname{glossaryalignment}.\DescribeMacro{\glossaryalignment}
%
%\changes{2.1}{2004 October 25}{made glossary compatible with array package}
%The above conflicts with the \stynamefmt{array} package, so as
%from version 2.1, if the \stynamefmt{array} package has been
%loaded \emph{prior} to loading the \stynamefmt{glossary} package,
%the new column type \texttt{G} will be defined and used
%instead of \cmdname{glossaryalignment}.
%
%The command \cmdname{gloitem}\DescribeMacro{\gloitem}\ indicates
%what to do at the start of each glossary entry.
%This command takes one argument, which will be the text specified by the \gloskey{name} key
%in the \icmdname{glossary} command. In the case of the
%\pkgopt[list]{style} option,
%\cmdname{gloitem}\verb"{"\meta{text}\verb'}'
%will do\\[5pt]
%\verb"\item["\meta{text}\verb']'\\[5pt]
%or if \pkgopt[altlist]{style}:\\[5pt]
%\verb"\item["\meta{text}\verb']\mbox{}\par'\\[5pt]
%otherwise it will do\\[5pt]
%\meta{text}\verb" &"\\[5pt]
%if it's the first
%item of the page or\\[5pt]
%\verb'\\ '\meta{text}\verb" &"\\[5pt]
%otherwise.
%This command corresponds to the \istkey{item\_0} key in the
%\appname{makeindex} style file.
%
%The command \cmdname{gloskip}\DescribeMacro{\gloskip}\ specifies what to do between groups.
%If \pkgopt[list]{style} or \pkgopt[altlist]{style} this has the
%value \cmdname{indexspace}, otherwise it creates a blank line
% in the \envname{longtable} or \envname{supertabular} environment.
%This command corresponds to the \istkey{group\_skip} key in
%the \appname{makeindex} style file.
%
%The command \cmdname{glossaryheader}\DescribeMacro{\glossaryheader}\ (if \pkgopt[long]{style} or \pkgopt[super]{style} is selected)
%indicates what to do at the start of the \envname{longtable} or
%\envname{supertabular} environment. If \pkgopt[none]{border}, it
%is defined as:
%\begin{verbatim}
%\bfseries\entryname & \bfseries \descriptionname\\
%\end{verbatim}
%So, if you want the \icmdname{descriptionname} to be centred, you could do:
%\begin{verbatim}
%\renewcommand{\glossaryheader}{\bfseries\entryname &
% \hfil\bfseries\descriptionname\\}
%\end{verbatim}
%The command \cmdname{glosstail}\DescribeMacro{\glosstail}\ indicates what to do at the end of
%the \envname{longtable} or \envname{supertabular} environment.
%
%The width of the second column for the tabular-type styles is given by the length
%\cmdname{descriptionwidth}\DescribeMacro{\descriptionwidth}. This value can be changed using
%the \cmdname{setlength} command (the default value is \verb"0.6\textwidth").
%
%\section{Sample Documents}
%This package comes with the following sample documents:
%\begin{itemize}
%\item \texttt{sampleSec.tex} --- This document uses the options:
%\pkgopt[altlist]{style}, \pkgopt{toc} and
%\pkgopt[section]{number}. It also loads the
%\stynamefmt{hyperref} package before loading the
%\stynamefmt{glossary} package, so the glossary has hyperlinks
%to the section numbers. Experimenting with different package
%options, will illustrate the different glossary styles.
%You will need to do:
%\begin{verbatim}
%pdflatex sampleSec
%makeglos.pl sampleSec
%pdflatex sampleSec
%pdflatex sampleSec
%\end{verbatim}
%If you don't want to use \appname{makeglos.pl}, you will need
%to do
%\begin{verbatim}
%makeindex -s sampleSec.ist -t sampleSec.glg -o sampleSec.gls sampleSec.glo
%\end{verbatim}
%
%\item \texttt{sampleNtn.tex} --- This has a glossary and defines
%a new glossary type called \texttt{notation}. The glossary has
%associated page numbers, but the new glossary type doesn't.
%You will need to do:
%\begin{verbatim}
%latex sampleNtn
%makeglos.pl sampleNtn
%latex sampleNtn
%latex sampleNtn
%\end{verbatim}
%If you don't want to use \appname{makeglos.pl}, you will need
%to do
%\begin{verbatim}
%makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
%makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.ntn sampleNtn.not
%\end{verbatim}
%
%\item \texttt{sampleNtn2.tex} ---This is similar to
%\texttt{sampleNtn.tex}, but uses \icmdname{storeglosentry}.
%
%\item \texttt{sampleEq.tex} --- This has a glossary where the
%numbers in the glossary refer to the equation number rather than
%the page number. The \icmdname{pagecompositor},
%\icmdname{theglossarynum}, \icmdname{glossaryname} and
%\icmdname{glossaryheader} are all redefined to customize the
%glossary. You will need to do:
%\begin{verbatim}
%latex sampleEq
%makeglos.pl sampleEq
%latex sampleEq
%\end{verbatim}
%If you don't want to use \appname{makeglos.pl}, you will need
%to do
%\begin{verbatim}
%makeindex -s sampleEq.ist -t sampleEq.glg -o sampleEq.gls sampleEq.glo
%\end{verbatim}
%
%\item \texttt{sampleEqPg.tex} --- This is a modified version of
%\texttt{sampleEq.tex}. This example has one glossary, where some
%of the entry numbers refer to the corresponding page number, and
%some of the entry numbers refer to the corresponding equation
%number. You will need to do:
%\begin{verbatim}
%latex sampleEqPg
%makeglos.pl sampleEqPg
%latex sampleEqPg
%\end{verbatim}
%If you don't want to use \appname{makeglos.pl}, you will need
%to do
%\begin{verbatim}
%makeindex -s sampleEqPg.ist -t sampleEqPg.glg -o sampleEqPg.gls sampleEqPg.glo
%\end{verbatim}
%
%\item \texttt{sampleAcr.tex} --- This has a glossary containing
%acronyms. It uses the style \pkgoptval{altlist}{style} as this is better
%suited to glossaries with long names. It also uses the
%\stynamefmt{hyperref} package, so the page numbers in the
%glossary will automatically be hyperlinks, and the acronyms
%within the text will have hyperlinks to their corresponding entry
%in the glossary. You will need to do:
%\begin{verbatim}
%pdflatex sampleAcr
%makeglos.pl sampleAcr
%pdflatex sampleAcr
%pdflatex sampleAcr
%\end{verbatim}
%If you don't want to use \appname{makeglos.pl}, you will need
%to do
%\begin{verbatim}
%makeindex -s sampleAcr.ist -t sampleAcr.glg -o sampleAcr.gls sampleAcr.glo
%\end{verbatim}
%
%
%\item \texttt{sample.tex} --- This has a glossary entry
%with two different definitions of the same name.
%If you just use \appname{makeindex}, the two entries
%will be treated separately, however, if you want them
%concatenated, you can use \appname{makeglos.pl} with
%the \texttt{-m} switch. You will need to do:
%\begin{verbatim}
%pdflatex sample
%makeglos.pl -m sample
%pdflatex sample
%pdflatex sample
%\end{verbatim}
%(Depending on the configuration of your system, you
%may have to do \texttt{perl makeglos.pl} instead of
%just \appname{makeglos.pl})
%
%If you don't want to use \appname{makeglos.pl}, you will need
%to do
%\begin{verbatim}
%makeindex -s sample.ist -t sample.glg -o sample.gls sample.glo
%\end{verbatim}
%however, the entries with the same name but multiple descriptions
%will not be merged.
%
%\end{itemize}
%
%\section{LaTeX2HTML Style File}
%\label{sec:l2h}
%
%A \LaTeX2HTML\ Perl script, \texttt{glossary.}\filetype{perl}, is
%provided with this package for those wishing to use the
%glossary package with the \LaTeX2HTML translator.
%The file \texttt{glossary.}\filetype{perl} should be extracted
%along with \texttt{glossary.sty} when you run the
%installation script (\texttt{glossary.ins}) through \LaTeX.
%
%\subsection{Limitations}
%
%\begin{itemize}
%\item The only package options supported are:
%\pkgopt[altlist]{style}, \pkgopt[true]{hyper}, \pkgopt[true]{toc},
%\pkgopt[true]{acronym} and \pkgopt[false]{acronym}.
%
%\item If you have more than one glossary type, the
%secondary glossaries will occur in the same segment
%as the primary glossary if you use the command
%\verb'\print'\meta{name} instead of
%\verb'\printglossary['\meta{name}\verb"]", where
%\meta{name} is the name of the glossary type.
%
%\item The command \icmdname{setglossary} must be
%placed in the preamble to have an effect.
%
%\item The \icmdname{storeglosentry} commands must be in
%the document environment to have an effect. (They don't
%seem to work in the preamble, I don't know why.)
%
%\item If you place a \icmdname{glossary} command
%inside an environment not translated by \LaTeX2HTML
%(for example, inside a mathematics environment),
%it will not be entered into the glossary.
%
%\item The combinations \verb'""', \verb!"|!, \verb+"!+
%and \verb'"@' will be correctly translated, unless they
%occur within a maths environment. This is because
%the maths environment is translated before being
%passed to \icmdname{glossary}. You can overcome this
%by doing, e.g.:\\
%\cmdname{begin}\verb'{latexonly}'\\
%\verb'\glossary{name=$"|\mathcal{S}"|$,description=cardinality of set'\\
%\verb'$\mathcal{S}$,sort=cardinality}'\\
%\cmdname{end}\verb'{latexonly}'\\
%\cmdname{begin}\verb'{htmlonly}'\\
%\verb'\glossary{name=$|\mathcal{S}|$,description=cardinality of set'\\
%\verb'$\mathcal{S}$,sort=cardinality}'\\
%\cmdname{end}\verb'{htmlonly}'
%
%Alternative, you can use \cmdname{mid} instead:
%\begin{verbatim}
%\glossary{name=$\mid\mathcal{S}\mid$,description=cardinality of
%set $\mathcal{S}$,sort=cardinality}
%\end{verbatim}
%
%\item Glossary items with the same names but different
%definitions will not be merged.
%
%\item The command \icmdname{theglossarynum} is ignored
%by \LaTeX2HTML, as page numbers have no meaning within
%HTML files.
%
%\item The configuration file \texttt{glossary.cfg} is ignored.
%
%\end{itemize}
%
%
%\section{Troubleshooting}
%\label{sec:trouble}
%\begin{enumerate}
%\item My glossary hasn't appeared.
%
%Check the following:
%\begin{itemize}
%\item Have you included the command \icmdname{makeglossary}
%in the preamble?
%
%\item Have you put the command \icmdname{printglossary} where
%you want the glossary to appear?
%
%\item Have you used \appname{makeglos.pl} or \appname{makeindex},
%and if you did, did it successfully create the \filetype{gls}
%file? (Check the transcript \filetype{glg} file.)
%
%\begin{itemize}
%\item If you used \appname{makeindex} directly, did you specify
%the \filetype{ist} file created by \icmdname{makeglossary},
%and did you remember to specify the output file with the extension
%\filetype{gls}?
%
%\item When \appname{makeindex} scans the \filetype{ist} file,
%it should generate the message:
%\begin{verbatim}
%9 attributes redefined, 0 ignored
%\end{verbatim}
%If you have a number other than 0 ignored, then there is something
%wrong with the \filetype{ist} file. Some packages can cause
%problems with the creation of this file, see
%item~\ref{itm:ngerman} below.
%\end{itemize}
%
%\item Have you remembered to \LaTeX\ your document again
%after using \appname{makeglos.pl} or \appname{makeindex}?
%
%\item Have you used \icmdname{glossary} or \icmdname{xglossary}?
%
%\item If you have used \icmdname{storeglosentry}, have you also
%used \icmdname{useglosentry}, \icmdname{useGlosentry} or
%\icmdname{gls}?
%\end{itemize}
%
%If you have defined a new glossary type, have you checked
%all the analogous commands to the above?
%
%\item My list of acronyms hasn't appeared.
%
%Have you used the \pkgopt[true]{acronym} package option? If no,
%check the answers to the previous item, if yes, make sure
%you have used \icmdname{makeacronym} and \icmdname{printacronym}.
%Have you used any of the acronyms you have defined? Remember
%that \cmdname{acrsh}, \cmdname{acrln},
%\cmdname{}\meta{acr-name}\texttt{short} and
%\cmdname{}\meta{acr-name}\texttt{long} don't generate entries
%in the list of acronyms, where \cmdname{}\meta{acr-name} is the
%name of an acronym command.
%
%\item I get an error when using the command
%\icmdname{saveglosentry}.
%
%Don't use this command it's obsolete, use
%\icmdname{storeglosentry} instead.
%
%\item One of more of my glossary entries hasn't appeared.
%
%Check the following
%\begin{itemize}
%\item If you defined the entry using \icmdname{storeglosentry}
%have you used either \icmdname{useglosentry},
%\icmdname{useGlosentry} or \icmdname{gls}?
%
%\item Have you remembered to \icmdname{protect} commands
%such as \cmdname{mathcal} within \icmdname{storeglosentry}?
%
%\item Have you used the characters \texttt{@} \texttt{!}
%\texttt{\textbar} \verb'"'? If so, have you preceded them
%with a double quote character?
%\end{itemize}
%
%Check the \appname{makeindex} log file to see if there are
%any error messages.
%
%\item My glossary has duplicate entries on separate lines.
%
%\LaTeX\ treats multiple spaces equivalent to a single space, but \appname{makeindex}
%takes spaces into account when determining whether two entries are identical.
%For example:
%\begin{verbatim*}
%\glossary{name=Identity matrix,
%description=diagonal matrix with 1's along the diagonal}
%\end{verbatim*}
%and
%\begin{verbatim*}
%\glossary{name=Identity matrix,
%description=diagonal matrix with 1's along the diagonal}
%\end{verbatim*}
%will be treated as different entries by \appname{makeindex},
%because the first has only one space
%between `Identity' and `matrix' and the second has two.
%The easiest way to ensure consistency is to use
%\icmdname{storeglosentry} together with \icmdname{useglosentry},
%\icmdname{useGlosentry} or \icmdname{gls}.
%
%\item I had an error, fixed it, but I keep getting the same error message.
%
%Suppose you've made an error in the \icmdname{glossary} command. For example:
%\begin{verbatim}
%\glossary{name=Java,description=A programming language,format=texbf}
%\end{verbatim}
%In this case \texttt{textbf} has been mis-spelt. This error will be copied to the \filetype{glo} file,
%which in turn will be copied to the \filetype{gls} file by
%\appname{makeindex}. A subsequent run of \LaTeX\ will
%read this error in. If you fix the error in your main document, the error will still be read in from
%the \filetype{gls} file. The best thing to do is to delete the
%\filetype{gls} file, and try again.
%
%\item My glossary has ended up wider than my page.
%
%This may occur if you have long entry names, and you are using
%either the \pkgopt[long]{style} or \pkgopt[super]{style}
%options. The width of the description column is proportional to
%the text width (in fact, it's \verb"0.6\textwidth")
%but the first column is as wide as the widest entry name. You
%can either redefine \icmdname{glossaryalignment} to change the
%column specifications, or use one of the list-type styles.
%
%\item The page numbers in my glossary don't match up with the actual page numbers where the entry
%was defined.
%
%You may need to \LaTeX\ your document again (just as you have to do with \cmdname{tableofcontents}, \cmdname{listoffigures} etc).
%
%\item I'm getting a \appname{keyval} error.
%
%The \stynamefmt{glossary} package uses the \stynamefmt{keyval}
%package to extract the information from \meta{key}=\meta{value}
%comma separated lists. You need to make sure the syntax is correct. If your \meta{value} contains a
%comma, you will need to enclose \meta{value} in curly braces. See the \stynamefmt{keyval} documentation for
%further information\footnote{This should be in the directory
%\texttt{texmf/doc/latex/graphics/}}.
%
%\item I've used the \pkgopt{hyper} option, but nothing happens
%when I click on the numbers in the glossary.
%
%Check the following:
%\begin{enumerate}
%\item Have you remembered to use PDF\LaTeX\ instead of \LaTeX,
%or used a driver that understands hyperlinks?
%\item Have you remembered to use the \stynamefmt{hyperref} or
%\stynamefmt{html} package?
%\item Have you remembered to use a formatting command which uses \cmdname{hyperlink}? (E.g.\ using \glsnumfmt{hyperbf} instead
%of \texttt{textbf})? Remember to check the \gloskey{format} key
%in your \icmdname{glossary} commands, and the
%\setglos{glsnumformat} key in the \icmdname{setglossary}
%command.
%\item What application are you using to view the PDF file?
%Ghostview can display a PDF file, but ignores the links. If you are using Windows, try
%using Adobe's Acrobat Reader, or if you are using UNIX or Linux, try using \appname{xpdf} or \appname{acroread}.
%\end{enumerate}
%
%\item The \stynamefmt{glossary} package conflicts with the
%\stynamefmt{datetime} package.
%\changes{2.01}{21 Oct 2004}{Fixed conflict with datetime package}
%
%This has been fixed in version 2.01.
%
%\item I get an error when using certain commands, such as \cmdname{cite} or \verb"~" in \icmdname{newacronym}.
%
%This has been fixed in version 2.1.
%
%\item I get the following error:
%\begin{verbatim}
%! Package array Error: Illegal pream-token (\glossaryalignment): `c' used.
%\end{verbatim}
%
%The \stynamefmt{glossary} package used to conflict with the
%\stynamefmt{array} package. This was fixed in version 2.1,
%however, you must load the \stynamefmt{array} package
%\emph{prior} to loading the \stynamefmt{glossary} package.
%
%\item\label{itm:fragile} I get the following error:
%\begin{verbatim}
%Use of \@chapter doesn't match its definition
%\end{verbatim}
%or
%\begin{verbatim}
%! Argument of \@sect has an extra }
%\end{verbatim}
%
%If you want to use an acronym command in a moving argument (such as a chapter heading)
%you need to \cmdname{protect} it first. Note that if you do put an acronym in a chapter etc
%heading, it will be expanded for the first time in the table of contents, not
%in the chapter heading. The best way to get around this is to use the
%optional argument, e.g.
%\begin{verbatim}
%\chapter[Introduction to Kernel Support Vector Machines]{Introduction
%to \protect\KSVM}
%\end{verbatim}
%You will also need to do this if you are using bookmarks in a PDF document.
%
%Alternatively, you can do:
%\begin{verbatim}
%\resetacronym{KSVM}
%\chapter{Introduction to \protect\KSVM}
%\end{verbatim}
%or if you are using PDFLaTeX:
%\begin{verbatim}
%\resetacronym{KSVM}
%\chapter{Introduction to \texorpdfstring{\protect\KSVM}{KSVM}}
%\end{verbatim}
%
%\item\label{itm:ngerman} The \stynamefmt{glossary} package conflicts with
%\stynamefmt{ngerman}.
%
%This problem is caused by the fact that \stynamefmt{ngerman}
%redefines the effect of the double quote
%character, but this character is used in the creation of the
%\filetype{ist} \appname{makeindex} style file.
%Try one of the following methods:
%\begin{enumerate}
%\item Include the \stynamefmt{ngerman} package after the
%\icmdname{makeglossary} command:
%\begin{verbatim}
%\usepackage{glossary}
%\makeglossary
%\usepackage{ngerman}
%\end{verbatim}
%
%\item First omit the \stynamefmt{ngerman} package and include
%\icmdname{makeglossary} then \LaTeX\ your document.
%This will create the \filetype{ist} file. Then include the
%\stynamefmt{ngerman} package, and insert \icmdname{noist} before
%the \icmdname{makeglossary} command, this will prevent further attempts to generate the \filetype{ist} file.
%\begin{verbatim}
%\usepackage{ngerman}
%\usepackage{glossary}
%\noist\makeglossary
%\end{verbatim}
%
%\item Use \icmdname{noist}, as above, and create the
%\filetype{ist} file
%in an ordinary text editor. The file should contain the
%following lines:
%\begin{verbatim}
%keyword "\\glossaryentry"
%preamble "\\begin{theglossary}"
%postamble "\n\\end{theglossary}\n"
%group_skip "\\gloskip "
%item_0 "\n\\gloitem "
%delim_0 "\n\\glodelim "
%page_compositor "-"
%delim_n "\\delimN "
%delim_r "\\delimR "
%\end{verbatim}
%\end{enumerate}
%It is possible that there may be other packages which will
%also cause a problem, if so, try any of the above.
%
%\item \appname{makeglos.pl} gives the following error message:
%\begin{verbatim}
%unable to extract name from glossary item:
%\end{verbatim}
%
%You are using an old version of \appname{makeglos.pl} with a
%new version of the \stynamefmt{glossary} package. You will need
%to update your version \appname{makeglos.pl}.
%\end{enumerate}
%Let me know if you encounter any other problems or if you have any comments regarding this package.
%
%\section{Obsolete Commands}
%
%The commands described in this section are now obsolete, but
%are currently still provided for backwards compatibility. Their
%use is deprecated.
%
%\changes{2.14}{2005 May 28}{'saveglosentry added}
%\DescribeMacro{\saveglosentry}
%\icmdname{saveglosentry}\{\textrm{\meta{name}}\}\{\meta{description}\}\\
%This command has now been replaced by \cmdname{storeglosentry}.
%
%\changes{2.0}{2004 November 1}{primary acronym number format
%\texttt{'glsprimaryfmt}}
%\changes{2.12}{2004 November 1}{primary acronym number format
%\texttt{'glsprimaryfmt} no longer used}
%\DescribeMacro{\glsprimaryfmt}%
%The command \cmdname{glsprimaryfmt} is no longer used in \icmdname{newacronym} as you can end up with duplicate
%page numbers, however the command is currently still defined (although it
% may be removed in future versions.)
%
%The package option \pkgopt{hyperacronym} is now superseded by the package option
%\pkgopt{hyper}. This option was implemented prior to the
%introduction of the command \icmdname{xglossary}. Since the
%acronyms now use \icmdname{xglossary}, there is no difference
%between the \pkgopt{hyperacronym} and \pkgopt{hyper} options.
%This option has a boolean value:
%\changes{2.13}{2004 December 1}{Package option \texttt{hyperacronym}}
%\begin{description}
%\item[\pkgoptval{true}{hyperacronym}] Make acronyms link to their corresponding entry in the glossary
%\item[\pkgoptval{false}{hyperacronym}] Acronyms don't have a hyperlink.
%\end{description}
%If the \stynamefmt{hyperref} package has been loaded prior to
%loading \texttt{glossary.sty} or if \pkgopt[true]{hyper} is set,
%\pkgopt[true]{hyperacronym} otherwise
%\pkgopt[false]{hyperacronym}.%
%
%\section{Contact Details}
%\noindent
%Dr Nicola Talbot\\
%School of Computing Sciences\\
%University of East Anglia\\
%Norwich. Norfolk\\
%NR4 7TJ. United Kingdom.\\
%\url{http://theoval.cmp.uea.ac.uk/~nlct/}
%
%\section{Acknowledgements}
%
%I would like to thank the following people for their
%suggestions:
%Jens~Happe,
%Dmitry~Katsubo,
%Markus~Lazanowski,
%Slava~Pestov and
%Dario~Teixeira
%
% \StopEventually{\PrintChanges\addcontentsline{toc}{section}{Change History}\PrintIndex\addcontentsline{toc}{section}{Index}}
%
%
%
%
%\section{The Code}
% \begin{macrocode}
%<*glossary.sty>
% \end{macrocode}
% \subsection{Package Definition}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glossary}[2005/09/27 2.24 (NLCT)]
% \end{macrocode}
% Load packages needed by glossary.sty:
% \begin{macrocode}
\RequirePackage{ifthen}
\RequirePackage{keyval}
% \end{macrocode}
% The package options are in the form of a comma-separated list of
% \meta{key}=\meta{value} pairs. First need to set up the keys.
% \begin{macrocode}
\define@key{gloss}
{style}
{\ifthenelse{\equal{#1}{list} \or \equal{#1}{altlist} \or \equal{#1}{super} \or \equal{#1}{long}}
{\def\gls@style{#1}}
{\PackageError{glossary}
{Unknown glossary style '#1'}
{Available styles are: list, altlist, super and long}}}
\define@key{gloss}
{header}[plain]{\ifthenelse{\equal{#1}{none} \or \equal{#1}{plain}}
{\def\gls@header{#1}}
{\PackageError{glossary}
{Unknown glossary style '#1'}
{Available styles are: none and plain}}}
\define@key{gloss}
{border}[plain]{\ifthenelse{\equal{#1}{none} \or \equal{#1}{plain}}
{\def\gls@border{#1}}
{\PackageError{glossary}
{Unknown glossary border '#1'}
{Available styles are: none and plain}}}
\newcount\gls@cols
\define@key{gloss}{cols}{\gls@cols=#1\relax
\ifthenelse{\gls@cols<2 \or \gls@cols>3}
{\PackageError{glossary}
{invalid number of columns}
{The cols option can only be 2 or 3}}
{}}
\define@key{gloss}
{number}
{\ifthenelse{\equal{#1}{none}\or\equal{#1}{page}\or\equal{#1}{section}}
{\def\gls@number{#1}}
{\PackageError{glossary}
{Unknown glossary number style '#1'}
{Available styles are: none, page and section}}}
\newif\ifgls@toc
\define@key{gloss}{toc}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
{\csname gls@toc#1\endcsname}
{\PackageError{glossary}{Glossary option 'toc' is boolean}
{The value of 'toc' can only be set to 'true' or 'false'}}}
\newif\ifgls@hypertoc
\define@key{gloss}{hypertoc}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
{\csname gls@hypertoc#1\endcsname}
{\PackageError{glossary}{Glossary option 'hypertoc' is boolean}
{The value of 'hypertoc' can only be set to 'true' or 'false'}}}
\newif\ifgls@section
\define@key{gloss}{section}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
{\csname gls@section#1\endcsname}
{\PackageError{glossary}{Glossary option 'section' is boolean}
{The value of 'section' can only be set to 'true' or 'false'}}}
\gls@sectionfalse
\newif\ifglshyper
\newif\ifglshyperacronym
\define@key{gloss}{hyper}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
{\csname glshyper#1\endcsname\glshyperacronymtrue}
{\PackageError{glossary}{Glossary option 'hyper' is boolean}
{The value of 'hyper' can only be set to 'true' or 'false'}}}
\define@key{gloss}{hyperacronym}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
{\csname glshyperacronym#1\endcsname}
{\PackageError{glossary}{Glossary option 'hyperacronym' is boolean}
{The value of 'hyperacronym' can only be set to 'true' or 'false'}}}
\newif\ifglsacronym
\define@key{gloss}{acronym}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}{\setboolean{glsacronym}{#1}}{%
\PackageError{glossary}{Glossary option 'acronym' is boolean}{The value of 'acronym' canonly be set to 'true' or 'false'}}}
% \end{macrocode}
% Set up defaults
% \begin{macrocode}
\def\gls@style{long}
\def\gls@header{none}
\def\gls@border{none}
\def\gls@number{page}
\gls@cols=2\relax
\gls@tocfalse
\@ifundefined{hyperpage}{\glshyperfalse\glshyperacronymfalse}{\glshypertrue\glshyperacronymtrue}
\@ifundefined{hypertarget}{
% no hyperlinks
\newcommand{\glosslabel}[2]{#2}%
\newcommand{\glossref}[2]{#2}%
}{%
\newcommand{\glosslabel}[2]{\hypertarget{#1}{#2}}%
\newcommand{\glossref}[2]{\hyperlink{#1}{#2}}
}
% \end{macrocode}
% If the xspace package has been loaded, use \verb/\xspace/
% in acronyms.
% \begin{macrocode}
\@ifundefined{xspace}{%
\let\glsxspace\relax}{%
\let\glsxspace\xspace}
% \end{macrocode}
% Temporarily disable xspace:
% \begin{macrocode}
\newcommand{\gls@noxspace}[1]{{\let\glsxspace\relax#1}}
% \end{macrocode}
% Load configuation file if it exists
% \begin{macrocode}
\newcommand{\glossarypackageoptions}[1]{\setkeys{gloss}{#1}}
\InputIfFileExists{glossary.cfg}{%
\typeout{Glossary configuration file loaded}}{%
\typeout{No configuration file glossary.cfg found}}
\renewcommand{\glossarypackageoptions}[1]{%
\PackageError{glossary}{Command \string\glossarypackageoptions
^^Jcan only be used in configuration file}{}}
% \end{macrocode}
% Process options
% \begin{macrocode}
\DeclareOption*{\edef\@pkg@ptions{\noexpand\setkeys{gloss}{\CurrentOption}}
\ifthenelse{\equal{\CurrentOption}{}}{}{\@pkg@ptions}}
\ProcessOptions
% \end{macrocode}
%Check to make sure that the options don't conflict.
% \begin{macrocode}
\ifthenelse{\(\equal{\gls@style}{list} \or \equal{\gls@style}{altlist}\) \and \(\not\equal{\gls@header}{none} \or \not\equal{\gls@border}{none} \or \gls@cols=3\)}
{\PackageError{glossary}{You can't have option 'style=list' or 'style=altlist' in combination with any of the other options}
{The 'list' and 'altlist' options don't have a header, border or number of columns option.}}
{}
% \end{macrocode}
% Can't have both toc and hypertoc. Make it a warning rather
% than an error.
% \begin{macrocode}
\ifthenelse{\boolean{gls@hypertoc} \and \boolean{gls@toc}}{%
\PackageWarning{glossary}{Can't have both 'toc' and
'hypertoc', ignoring 'toc' option}
\ifgls@hypertoc\gls@tocfalse\fi}{}
% \end{macrocode}
%\subsection{Redefining \texttt{\symbol{92}glossary} format}
% The glossary is going to be redefined so that it accepts \meta{key}=\meta{value}
% information, so need to define the keys (see keyval documentation for further details
% on how to do this)
% \begin{macrocode}
\define@key{wrgloss}{name}{\gdef\@glo@n@me{#1}}
\define@key{wrgloss}{description}{\def\@descr{#1}}
\define@key{wrgloss}{sort}{\gdef\@s@rt{#1}}
\define@key{wrgloss}{format}{\def\@f@rm@t{#1}}
% \end{macrocode}
% Redefine "\@wrglossary" so that it separates out the entry name and
% entry description. Substitute "\thepage" for "\theglossarynum" which
% the user can redefine to be "\theequation" etc,
% \begin{macrocode}
\newcommand{\@@wrglossary}{}
\newcommand{\@glo@l@bel}{}
\renewcommand{\@wrglossary}[1]{\relax
\gdef\@glo@n@me{}\def\@descr{}\def\@s@rt{}\def\@f@rm@t{}\relax
\setkeys{wrgloss}{#1}\relax
\ifthenelse{\equal{\@s@rt}{}}{\gdef\@s@rt{\@glo@n@me}}{}%
\ifthenelse{\equal{\@glo@l@bel}{}}{\gdef\@glo@l@bel{GGG:\@s@rt}}{}%
\ifthenelse{\equal{\@f@rm@t}{}}
{\protected@write\@glossaryfile{}%
{\string\glossaryentry{\@s@rt @{%
\string\glosslabel{\@glo@l@bel}{\@glo@n@me}}\@descr
\string\relax|glsnumformat}{\theglossarynum}}}
{\protected@write\@glossaryfile{}%
{\string\glossaryentry{\@s@rt @{%
\string\glosslabel{\@glo@l@bel}{\@glo@n@me}}\@descr
\string\relax|\@f@rm@t}{\theglossarynum}}}\relax
\endgroup\@esphack
\@@wrglossary
}
% \end{macrocode}
% Command to extract name key from glossary entry.
% \begin{macrocode}
\newcommand{\@gls@getn@me}[1]{\@bsphack\begingroup\@sanitize
\gdef\@glo@n@me{}\setkeys{wrgloss}{#1}\relax
\endgroup\@esphack}
% \end{macrocode}
% Now do macro so you can have a hyperlink that takes
% you to the entry in the glossary
% \begin{macrocode}
\newcommand{\xglossary}{\renewcommand{\@@wrglossary}[1]{%
\glossref{\@glo@l@bel}{##1}\renewcommand{\@@wrglossary}{}}%
\glossary}
% \end{macrocode}
% Save a bit of typing. The followig command is new to v2.17
% \begin{macrocode}
\newcommand*{\storeglosentry}[3][glossary]{%
\@ifundefined{glo@#2@entry}{%
\expandafter\def\csname glo@#2@type\endcsname{#1}%
\expandafter\def\csname glo@#2@entry\endcsname{#3}%
\@gls@getn@me{#3}%
\expandafter\protected@edef\csname glo@#2@name\endcsname{\@glo@n@me}%
}{%
\PackageError{glossary}{Glossary entry '#2' already
defined}{There already exists a glossary entry with the label '#2'}}%
}
\providecommand{\useglosentry}[2][\relax]{%
\@ifundefined{glo@#2@type}{%
\PackageError{glossary}{Glossary entry '#2' undefined}{You need
to define the entry using \string\storeglosentry\space before
using it.}}{%
\edef\@glostype{\csname glo@#2@type\endcsname}%
\ifx#1\relax
\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype\endcsname{\csname glo@#2@entry\endcsname}}%
\else
\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype{\csname glo@#2@entry\endcsname,#1}}%
\fi
\@glo@cmd
}}
\providecommand{\useGlosentry}[3][\relax]{%
\@ifundefined{glo@#2@type}{%
\PackageError{glossary}{Glossary entry '#2' undefined}{You need
to define the entry using \string\storeglosentry\space before
using it.}}{%
\edef\@glostype{x\csname glo@#2@type\endcsname}%
\ifx#1\relax
\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype\endcsname{\csname glo@#2@entry\endcsname}}%
\else
\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype\endcsname{\csname glo@#2@entry\endcsname,#1}}%
\fi
\@glo@cmd{#3}%
}}
\newcommand{\gls}[2][\relax]{\useGlosentry[#1]{#2}{\csname glo@#2@name\endcsname}}
% \end{macrocode}
% This command was defined in earlier verions, but doesn't
% work very well, currently retained for backwards compatibility,
% but may well be removed at a later date.
% \begin{macrocode}
\providecommand{\saveglosentry}[3][glossary]{%
\expandafter\def\csname glo@#2@type\endcsname{#1}%
\expandafter\def\csname glo@#2@entry\endcsname{name={#2},description={#3}}
}
% \end{macrocode}
%Set up default number formats, dependent on the package "number" option.
%Define default page compositor. Any redefinition of the page compositor
%will need to come before the ".ist" file is written. The other commands
%can be redefined at any point before "\printglossary"
% \begin{macrocode}
\ifthenelse{\equal{\gls@number}{page}}{
\newcommand{\theglossarynum}{\thepage}
\newcommand{\pagecompositor}{-}
\newcommand{\@glossary@delimN}{, }
\newcommand{\@glossary@delimR}{--}
\ifglshyper
\newcommand{\glsXglossaryXnumformat}[1]{\hyperrm{#1}}%
\else
\newcommand{\glsXglossaryXnumformat}[1]{#1}\fi}
{\ifthenelse{\equal{\gls@number}{section}}
{\newcommand{\theglossarynum}{\thesection}
\newcommand{\pagecompositor}{.}
\newcommand{\@glossary@delimN}{, }
\newcommand{\@glossary@delimR}{--}
\ifglshyper
\newcommand{\glsXglossaryXnumformat}[1]{\hyperrm{#1}}%
\else
\newcommand{\glsXglossaryXnumformat}[1]{#1}%
\fi}
{\newcommand{\theglossarynum}{\thepage}
\newcommand{\pagecompositor}{-}
\newcommand{\@glossary@delimN}{}
\newcommand{\@glossary@delimR}{}
\newcommand{\glsXglossaryXnumformat}[1]{}}}
\newcommand{\glsnumformat}[2][glossary]{%
\@ifundefined{glsX#1Xnumformat}{%
\PackageError{glossary}{Glossary type '#1' undefined}{}}{%
\csname glsX#1Xnumformat\endcsname{#2}}}
\def\@glostype{glossary}
\newcommand{\delimN}{\csname @\@glostype @delimN\endcsname}
\newcommand{\delimR}{\csname @\@glostype @delimR\endcsname}
\newcommand{\glodelim}{\csname @\@glostype @glodelim\endcsname}
% \end{macrocode}
% Allow user to change number format for different
% glossary types.
% \begin{macrocode}
\define@key{glossnum}{glsnumformat}{\def\@glsnumformat{#1}}
\define@key{glossnum}{type}{\def\@glsnumtype{#1}}
\define@key{glossnum}{delimN}{\def\@delimN{#1}}
\define@key{glossnum}{delimR}{\def\@delimR{#1}}
\define@key{glossnum}{glodelim}{\def\@glodelim{#1}}
\providecommand{\ignore}[1]{}
\newcommand{\setglossary}[1]{%
\def\@glsnumformat{}%
\def\@glsnumtype{glossary}%
\def\@delimN{@dontchange@}%
\def\@delimR{@dontchange@}%
\def\@glodelim{@dontchange@}%
\setkeys{glossnum}{#1}\relax
\@ifundefined{print\@glsnumtype}{%
\PackageError{glossary}{Invalid glossary type '\@glsnumtype'}{%
Glossary type '\@glsnumtype' has not been defined}
}{%
\ifthenelse{\equal{\@glsnumformat}{}}{}{%
\expandafter\xdef\csname glsX\@glsnumtype Xnumformat\endcsname{%
\noexpand\csname\@glsnumformat\noexpand\endcsname}%
\ifthenelse{\equal{\@glsnumformat}{ignore}}{%
\expandafter\xdef\csname @\@glsnumtype @delimN\endcsname{}%
\expandafter\xdef\csname @\@glsnumtype @delimR\endcsname{}%
}{}%
}%
\ifthenelse{\equal{\@delimN}{@dontchange@}}{}{%
\expandafter\xdef\csname @\@glsnumtype @delimN\endcsname{%
\@delimN}}
\ifthenelse{\equal{\@delimR}{@dontchange@}}{}{%
\expandafter\xdef\csname @\@glsnumtype @delimR\endcsname{%
\@delimR}}
\ifthenelse{\equal{\@glodelim}{@dontchange@}}{}{%
\expandafter\xdef\csname @\@glsnumtype @glodelim\endcsname{%
\@glodelim}
}
}}
% \end{macrocode}
% Now define the command "\printglossary" which will print the contents of the glossary file.
% \begin{macrocode}
\newcommand{\@gls@glossary@inext}{gls}
\newcommand\printglossary[1][glossary]{%
\def\@glostype{#1}%
\@ifundefined{#1name}{%
\renewcommand{\@glossaryname}{\glossaryname}}{%
\renewcommand{\@glossaryname}{\csname #1name\endcsname}}%
\@ifundefined{short#1name}{%
\renewcommand{\@shortglossaryname}{\@glossaryname}}{%
\renewcommand{\@shortglossaryname}{\csname short#1name\endcsname}}%
\@input@{\jobname.\csname @gls@#1@inext\endcsname}}
% \end{macrocode}
% Define contextual names. Changed \verb/\newcommand/
% to \verb/\providecommand/ in version 2.2.
% \begin{macrocode}
\providecommand{\glossaryname}{Glossary}
\newcommand{\shortglossaryname}{\glossaryname}
\newcommand{\entryname}{Notation}
\newcommand{\descriptionname}{Description}
\newcommand{\istfilename}{\jobname.ist}
\def\@glossaryname{\glossaryname}
\def\@shortglossaryname{\shortglossaryname}
% \end{macrocode}
% Define command to generate glossary title (new to
% version 2.24)
% \begin{macrocode}
\providecommand{\glossarytitle}{%
\@ifundefined{chapter}
{\section*{\@glossaryname}\relax
\ifgls@toc\@glosaddtoc{section}\fi}
{\ifthenelse{\boolean{gls@section}}
{\section*{\@glossaryname}\relax
\ifgls@toc\@glosaddtoc{section}\fi}
{\ifgls@hypertoc\@ifundefined{if@twoside}{\clearpage}{%
\if@twoside\@ifundefined{cleardoublepage}{\cleardoublepage}{\clearpage}\else
\clearpage\fi}\phantomsection\@glosaddtoc{chapter}\fi\chapter*{\@glossaryname}\relax
\ifgls@toc\@glosaddtoc{chapter}\fi}}
\markboth{\@shortglossaryname}{\@shortglossaryname}%
}
% \end{macrocode}
% Now define theglossary environment. Version 2.2:
% check to see if defined already
% \begin{macrocode}
\@ifundefined{theglossary}{
\newenvironment{theglossary}
{\glossarytitle
\glossarypreamble\@bef@reglos}
{\@ftergl@s\glossarypostamble}
}{%
\PackageWarning{glossary}{Redefining 'theglossary' environment}
\renewenvironment{theglossary}
{\glossarytitle
\glossarypreamble\@bef@reglos}
{\@ftergl@s\glossarypostamble}
}
% \end{macrocode}
% Provide a means to add text to the beginning or end
% of the glossary.
% \begin{macrocode}
\newcommand{\glossarypreamble}{}
\newcommand{\glossarypostamble}{}
% \end{macrocode}
% By default, add the short title to the table of contents.
% \begin{macrocode}
\newcommand{\@glosaddtoc}[1]{%
\addcontentsline{toc}{#1}{\@shortglossaryname}
}
% \end{macrocode}
% Set up switch to determine whether the item is the first item in the
% glossary (in the event that a special case is needed for the first item)
% \begin{macrocode}
\newif\ifgloitemfirst
\newcommand{\@bef@reglos}{\global\gloitemfirsttrue\beforeglossary}
\newcommand{\@ftergl@s}{\afterglossary\global\gloitemfirstfalse}
% \end{macrocode}
% Now define what to do depending on which style has been selected.
%First deal with the "list" and "altlist" style, as they're the easiest.
% \begin{macrocode}
\ifthenelse{\equal{\gls@style}{list} \or \equal{\gls@style}{altlist}}
{
\newcommand{\beforeglossary}{\begin{description}}
\newcommand{\afterglossary}{\end{description}}
\newcommand{\gloskip}{\indexspace}
\ifthenelse{\equal{\gls@style}{list}}
{\newcommand{\gloitem}[1]{\item[#1]}
\newcommand{\@glossary@glodelim}{, }}
{\newcommand{\gloitem}[1]{\item[#1]\mbox{}\par}
\newcommand{\@glossary@glodelim}{ }}
}{
% \end{macrocode}
%Now deal with the other styles. I orginally used a "tabular" environment,
%but obviously this doesn't work for a glossary longer than one page.
%Nick van Foreest recommended the "supertabular" environment. The
% "longtable" environment also works, so have both options, and leave it to
% the user.
% \begin{macrocode}
\ifthenelse{\equal{\gls@style}{super}}{
\IfFileExists{supertab.sty}{\RequirePackage{supertab}}
{\IfFileExists{supertabular.sty}{\RequirePackage{supertabular}}
{\PackageError{glossary}{Option "super" chosen, but can't find "supertab" package}
{If you want the "super" option, you have to have the "supertab" package installed.}}}
}
{\RequirePackage{longtable}}
\newlength{\descriptionwidth}
\setlength{\descriptionwidth}{0.6\textwidth}
\ifthenelse{\equal{\gls@header}{none}}
{
\ifthenelse{\equal{\gls@border}{none}}
{\newcommand{\glossaryheader}{}}
{\newcommand{\glossaryheader}{\hline }}
}
{
\ifnum\gls@cols=2\relax
\ifthenelse{\equal{\gls@border}{none}}
{\newcommand{\glossaryheader}
{\bfseries\entryname & \bfseries \descriptionname\\}}
{\newcommand{\glossaryheader}
{\hline\bfseries\entryname & \bfseries\descriptionname
\\\hline\hline}}
\else
\ifthenelse{\equal{\gls@border}{none}}
{\newcommand{\glossaryheader}
{\bfseries\entryname & \bfseries \descriptionname & \\}}
{\newcommand{\glossaryheader}
{\hline\bfseries\entryname &\bfseries\descriptionname &
\\\hline\hline}}
\fi
}
\ifthenelse{\equal{\gls@border}{none}}
{
\ifnum\gls@cols=2\relax
\@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}}}{
\newcolumntype{G}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}}}
\else
\@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l}}{
\newcolumntype{G}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l}}
\fi
\ifthenelse{\equal{\gls@style}{super}}{
\newcommand{\afterglossary}{ \\\end{supertabular}}
}
{
\newcommand{\afterglossary}{ \\\end{longtable}}
}
\newcommand{\glosstail}{}
}
{
\ifnum\gls@cols=2\relax
\@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}}{
\newcolumntype{G}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}}
\else
\@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l|}}{
\newcolumntype{G}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l|}}
\fi
\ifthenelse{\equal{\gls@style}{super}}{
\newcommand{\afterglossary}{ \\\hline\end{supertabular}}
}
{
\newcommand{\afterglossary}{ \\\hline\end{longtable}}
}
\newcommand{\glosstail}{\hline}
}
\ifthenelse{\equal{\gls@style}{super}}
{
\@ifundefined{newcolumntype}{
\newcommand{\beforeglossary}
{\tablehead{\glossaryheader}\tabletail{\glosstail}
\begin{supertabular}{\glossaryalignment}}}
{\newcommand{\beforeglossary}
{\tablehead{\glossaryheader}\tabletail{\glosstail}
\begin{supertabular}{G}}}
}
{
\@ifundefined{newcolumntype}{\newcommand{\beforeglossary}
{\begin{longtable}{\glossaryalignment}
\glossaryheader\endhead\glosstail\endfoot}}
{\newcommand{\beforeglossary}
{\begin{longtable}{G}
\glossaryheader\endhead\glosstail\endfoot}}
}
\ifnum\gls@cols=2\relax
\newcommand{\gloskip}{\ifgloitemfirst\global\gloitemfirstfalse \else\\ \fi &}
\newcommand{\@glossary@glodelim}{, }
\else
\newcommand{\gloskip}{\ifgloitemfirst\global\gloitemfirstfalse \else\\ \fi & &}
\newcommand{\@glossary@glodelim}{& }
\fi
\newcommand{\gloitem}[1]{\ifgloitemfirst\global\gloitemfirstfalse #1 \else \\#1 \fi &}
}
\ifthenelse{\equal{\gls@number}{none} \and \gls@cols<3}{\renewcommand{\@glossary@glodelim}{}}{}
% \end{macrocode}
% \subsection{Makeindex style file}
%This is the code to generate the ".ist" file.
% \begin{macrocode}
\newif\ifist
\let\noist=\istfalse
\if@filesw\isttrue\else\istfalse\fi
\newwrite\istfile
\catcode`\%11\relax
\newcommand{\writeist}{
\openout\istfile=\istfilename
\write\istfile{% makeindex style file created by LaTeX for document "\jobname" on \the\year-\the\month-\the\day}
\write\istfile{keyword "\string\\glossaryentry"}
\write\istfile{preamble "\string\\begin{theglossary}"}
\write\istfile{postamble "\string\n\string\\end{theglossary}\string\n"}
\write\istfile{group_skip "\string\\gloskip "}
\write\istfile{item_0 "\string\n\string\\gloitem "}
\write\istfile{delim_0 "\string\n\string\\glodelim "}
\write\istfile{page_compositor "\pagecompositor"}
\write\istfile{delim_n "\string\\delimN "}
\write\istfile{delim_r "\string\\delimR "}
\closeout\istfile
}
\catcode`\%14\relax
% \end{macrocode}
%Redefine "\makeglossary" so that it creates the ".ist" file. Once it is
% created, the "\ifist" flag is set to false to prevent repeated creation of
% the file in the event that another glossary-style type is created. If a
% different ".ist" file is desired for each glossary type, you will need
% to precede each "\make"\meta{type} with "\isttrue" and changed the definition
% of "\istfilename". (This is unlikely to occur unless more than one type
% of page compositor is required.)
% The "\glossary" command has been modified to allow for
% an optional argument to modify the label.
% \begin{macrocode}
\renewcommand{\makeglossary}{
\newwrite\@glossaryfile
\immediate\openout\@glossaryfile=\jobname.glo
\renewcommand{\glossary}[1][]{\gdef\@glo@l@bel{##1}%
\@bsphack \begingroup \@sanitize \@wrglossary }
\typeout {Writing glossary file \jobname .glo }
\let \makeglossary \@empty
\ifist\writeist\fi
\noist}
\renewcommand{\glossary}[1][]{%
\@bsphack\begingroup\@sanitize\@index}
% \end{macrocode}
%\subsection{Defining new glossary type}
%First parameter name of new glossary type e.g.\ "notation".
%Second parameter extension of output file (equivalent to "ind" or "glo".
%Third parameter extension of input file (equivalent to "idx" or "gls").
% \begin{macrocode}
\newcommand{\@newglossarytype}[4][glg]{}
\newcommand{\newglossarytype}[4][glg]{
\@ifundefined{#2}{%
\protected@write\@auxout{}{\@newglossarytype[#1]{#2}{#3}{#4}}%
\def\@glstype{#2}\def\@glsout{#3}\def\@glsin{#4}%
\expandafter\gdef\csname glsX\@glstype Xnumformat\endcsname{\glsXglossaryXnumformat}%
\expandafter\gdef\csname @\@glstype @delimN\endcsname{\@glossary@delimN}%
\expandafter\gdef\csname @\@glstype @delimR\endcsname{\@glossary@delimR}%
\expandafter\gdef\csname @\@glstype @glodelim\endcsname{\@glossary@glodelim}%
\expandafter\gdef\csname @gls@\@glstype @inext\endcsname{#4}%
\expandafter\def\csname @gls@#2@type\endcsname{#4}%
\expandafter\edef\csname make\@glstype\endcsname{%
\noexpand\@m@kegl@ss{\@glstype}{\@glsout}}
\expandafter\edef\csname \@glstype\endcsname{%
\noexpand\@gl@ss@ary{\@glstype}}
\expandafter\edef\csname x\@glstype\endcsname{%
\noexpand\@Gl@ss@ary{\@glstype}}
\expandafter\edef\csname print\@glstype\endcsname{%
\noexpand\def\noexpand\@glostype{\@glstype}%
\noexpand\@ifundefined{\@glstype name}{%
\noexpand\def\noexpand\@glossaryname{\noexpand\glossaryname}%
}{%
\noexpand\def\noexpand\@glossaryname{%
\noexpand\csname\@glstype name\noexpand\endcsname}}%
%
\noexpand\@ifundefined{short\@glstype name}{%
\noexpand\def\noexpand\@shortglossaryname{\noexpand\@glossaryname}%
}{%
\noexpand\edef\noexpand\@shortglossaryname{%
\noexpand\csname short\@glstype name\noexpand\endcsname}}%
\noexpand\@prntgl@ss@ry{\@glsin}}
}{\PackageError{glossary}{Command
\expandafter\string\csname #2\endcsname \space already defined}{%
You can't call your new glossary type '#2' because there already
exists a command with this name}}
}
% \end{macrocode}
% Define equivalent of "\makeglossary":
% \begin{macrocode}
\newcommand\@m@kegl@ss[2]{
\expandafter\newwrite\csname @#1file\endcsname
\expandafter\immediate\expandafter
\openout\csname @#1file\endcsname=\jobname.#2
\typeout {Writing #1 file \jobname .#2 }
\expandafter\let \csname make#1\endcsname \@empty
\ifist\writeist\fi
\expandafter\def\csname the#1num\endcsname{\thepage}
\noist
}
% \end{macrocode}
% Define equivalent of "\@wrglossary":
% \begin{macrocode}
\newcommand{\@wrgl@ss@ry}[2]{\relax
\gdef\@glo@n@me{}\def\@descr{}\def\@s@rt{}\def\@f@rm@t{}\relax
\xdef\@pr@fix{\csname @gls@#1@type\endcsname}%
\ifthenelse{\equal{\@s@rt}{}}{\gdef\@s@rt{\@glo@n@me}}{}%
\ifthenelse{\equal{\@glo@l@bel}{}}{\gdef\@glo@l@bel{\@pr@fix:\@s@rt}}{}%
\setkeys{wrgloss}{#2}\relax
\ifthenelse{\equal{\@f@rm@t}{}}
{\expandafter\protected@write\csname @#1file\endcsname{}{%
\string\glossaryentry{\@s@rt @{%
\string\glosslabel{\@glo@l@bel}{\@glo@n@me}}%
\@descr\string\relax|glsnumformat[#1]}{\csname the#1num\endcsname}}}
{\expandafter\protected@write\csname @#1file\endcsname{}{%
\string\glossaryentry{\@s@rt @{%
\string\glosslabel{\@glo@l@bel}{\@glo@n@me}}%
\@descr\string\relax|\@f@rm@t}{\csname the#1num\endcsname}}}\relax
\endgroup\@esphack
\@@wrgl@ss@ry
}
\newcommand{\@@wrgl@ss@ry}{}
% \end{macrocode}
% Define the equivalent of "\glossary".
% \begin{macrocode}
\newcommand\@gl@ss@ary[2][]{\@ifundefined{@#2file}{%
\@bsphack\begingroup \@sanitize \@index}{%
\gdef\@glo@l@bel{#1}%
\@bsphack \begingroup \@sanitize \@wrgl@ss@ry{#2}}}
% \end{macrocode}
% Define the equivalent of "\xglossary".
% \begin{macrocode}
\newcommand{\@Gl@ss@ary}{%
\renewcommand{\@@wrgl@ss@ry}[1]{%
\glossref{\@glo@l@bel}{##1}\renewcommand{\@@wrgl@ss@ry}{}}%
\@gl@ss@ary}
% \end{macrocode}
% Define equivalent of "\printglossary".
% \begin{macrocode}
\newcommand\@prntgl@ss@ry[1]{\@input@{\jobname.#1}}
% \end{macrocode}
% The command "\newglossarytype" should only be used in the preamble.
% \begin{macrocode}
\@onlypreamble{\newglossarytype}
% \end{macrocode}
% Define "\newacronym"[\meta{cmd-name}]\{\meta{abbrv}\}\{\meta{long name}\}\{\meta{glos entry}\}
% \begin{macrocode}
\newcommand\@acrnmsh{}
\newcommand\@sacrnmsh{}
\newcommand\@acrnmln{}
\newcommand\@acrnmcmd{}
\newcommand\@acrnmgls{}
\newcommand\@acrnmins{}
% \end{macrocode}
% List of all defined acronyms.
% \begin{macrocode}
\toksdef\@glo@tb=2
\newcommand{\@acr@list}{}
% \end{macrocode}
% append acronym to list
% \begin{macrocode}
\newcommand{\@acr@addtolist}[1]{\edef\@glo@ta{#1}%
\ifthenelse{\equal{\@acr@list}{}}{%
\edef\@acr@list{\@glo@ta}}{%
\@glo@tb=\expandafter{\@acr@list}%
\edef\@acr@list{\the\@glo@tb,\@glo@ta}}}
% \end{macrocode}
% This should no longer be used
% \begin{macrocode}
\newcommand{\glsprimaryfmt}[1]{\textbf{\glsnumformat{#1}}}
% \end{macrocode}
% \begin{macrocode}
%\newcommand{\acronymlabprefix}{GGG}
\newcommand{\@acronymnamefmt}{\glolong\ (\gloshort)}
\newcommand{\setacronymnamefmt}[1]{\def\@acronymnamefmt{#1}}
% \end{macrocode}
% Format the acronym abbreviation in the format specified
% by \verb'\acronymfont'. This simply prints its
% argument by default.
% \begin{macrocode}
\newcommand{\acronymfont}[1]{#1}
% \end{macrocode}
% This command has been restructured as from v2.17
% \begin{macrocode}
\newcommand{\newacronym}[4][]{%
\ifthenelse{\equal{#1}{}}{\renewcommand\@acrnmcmd{#2}}{\renewcommand\@acrnmcmd{#1}}
\@ifundefined{\@acrnmcmd}{%
\expandafter\newcommand\csname\@acrnmcmd short\endcsname{#2\protect\glsxspace}
\expandafter\newcommand\csname\@acrnmcmd long\endcsname{#3\protect\glsxspace}
\def\@acrn@entry{#4}
{
\def\glolong{#3}%
\def\gloshort{\noexpand\acronymfont{#2}}%
\expandafter\protected@xdef\expandafter\@acrnamefmt{\@acronymnamefmt}
}
\@acr@addtolist{\@acrnmcmd}
\protected@edef\@acr@glsentry{name=\@acrnamefmt,format=glsnumformat,sort=\@acrnmcmd,\@acrn@entry}
\newboolean{\@acrnmcmd first}\setboolean{\@acrnmcmd first}{true}
\expandafter\protected@edef\csname \@acrnmcmd\endcsname{\noexpand\@ifstar{\csname @s@\@acrnmcmd\endcsname}{\csname @\@acrnmcmd\endcsname}}
\ifglshyperacronym
% unstarred version
\expandafter\protected@edef\csname @\@acrnmcmd\endcsname{%
\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
\noexpand\gls@noxspace{\csname\@acrnmcmd long\endcsname\noexpand\@acrnmins\
(\noexpand\xacronym{\@acr@glsentry}{%
\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
})}\noexpand\setboolean{\@acrnmcmd first}{false}%
}{\noexpand\xacronym{\@acr@glsentry}{%
\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}\noexpand\@acrnmins}}\noexpand\glsxspace}
% starred version
\expandafter\protected@edef\csname @s@\@acrnmcmd\endcsname{%
\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
\noexpand\gls@noxspace{\noexpand\expandafter\noexpand\MakeUppercase
\csname\@acrnmcmd long\endcsname\noexpand\@acrnmins\
(\noexpand\xacronym{\@acr@glsentry}{%
\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
})}%
\noexpand\setboolean{\@acrnmcmd first}{false}}{%
\noexpand\xacronym{\@acr@glsentry}{%
\noexpand\acronymfont{\noexpand\expandafter\noexpand\MakeUppercase
\csname\@acrnmcmd short\endcsname}%
\noexpand\@acrnmins}}\noexpand\glsxspace}
\else
% unstarred version
\expandafter\protected@edef\csname @\@acrnmcmd\endcsname{%
\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
\noexpand\gls@noxspace{\csname\@acrnmcmd long\endcsname\
(\noexpand\acronym{\@acr@glsentry}{%
\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
})}\noexpand\setboolean{\@acrnmcmd first}{false}%
}{\noexpand\acronym{\@acr@glsentry}{%
\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}}}%
\noexpand\glsxspace}
% starred version
\expandafter\protected@edef\csname @s@\@acrnmcmd\endcsname{%
\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
\noexpand\gls@noxspace{\noexpand\expandafter
\noexpand\MakeUppercase
\csname\@acrnmcmd long\endcsname\noexpand\@acrnmins\
(\noexpand\acronym{\@acr@glsentry}{%
\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
})}%
\noexpand\setboolean{\@acrnmcmd first}{false}}{%
\noexpand\acronym{\@acr@glsentry}{%
\noexpand\acronymfont{\noexpand\expandafter\noexpand\MakeUppercase
\csname\@acrnmcmd short\endcsname}%
\noexpand\@acrnmins}}\noexpand\glsxspace}
\fi
}{%
\PackageError{glossary}{Command '\expandafter\string\csname\@acrnmcmd\endcsname' already defined}{
The command name specified by \string\newacronym already exists.}}}
\newcommand{\useacronym}{\@ifstar\@suseacronym\@useacronym}
\newcommand{\@suseacronym}[2][]{{\let\glsxspace\relax
\def\@acrnmins{#1}\csname @s@#2\endcsname}%
\setboolean{#2first}{false}}
\newcommand{\@useacronym}[2][]{{\let\glsxspace\relax
\def\@acrnmins{#1}\csname @#2\endcsname}%
\setboolean{#2first}{false}}
\newcommand{\acrln}{\@ifstar\@sacrln\@acrln}
\newcommand{\@acrln}[1]{\@ifundefined{#1long}{%
\PackageError{glossary}{Acronym '#1' has not been defined}{}}{%
\gls@noxspace{\csname#1long\endcsname}}}
\newcommand{\@sacrln}[1]{\@ifundefined{#1long}{%
\PackageError{glossary}{Acronym '#1' has not been defined}{}}{%
\gls@noxspace{\expandafter\expandafter\expandafter
\MakeUppercase\csname#1long\endcsname}}}
\newcommand{\acrsh}{\@ifstar\@sacrsh\@acrsh}
\newcommand{\@acrsh}[1]{\@ifundefined{#1short}{%
\PackageError{glossary}{Acronym '#1' has not been defined}{}}{\acronymfont{\gls@noxspace{\csname#1short\endcsname}}}}
\newcommand{\@sacrsh}[1]{\@ifundefined{#1short}{%
\PackageError{glossary}{Acronym '#1' has not been defined}{}}{%
\acronymfont{\gls@noxspace{\expandafter\expandafter\expandafter\MakeUppercase\csname#1short\endcsname}}}}
\newcommand{\ifacronymfirstuse}[3]{%
\@ifundefined{if#1first}{%
\PackageError{glossary}{Acronym '#1' not defined}{}}{%
\ifthenelse{\boolean{#1first}}{#2}{#3}}}
\newcommand{\resetacronym}[1]{%
\@ifundefined{if#1first}{%
\PackageError{glossary}{Acronym '#1' not defined}{}}{%
\setboolean{#1first}{true}}}
\newcommand{\resetallacronyms}{%
\@for\@acr:=\@acr@list\do{\resetacronym{\@acr}}}
% \end{macrocode}
%These commands are provided to make it easier change the page number format to bf, sf, tt and it
%if you are using hyperlinks
% \begin{macrocode}
\ifglshyper
% this is modified from definition of "\hyperpage" in "hyperref.sty"
\def\glshyperpage#1{\@glshyperpage#1\delimR \delimR \\}
\def\@glshyperpage#1\delimR #2\delimR #3\\{%
\ifx\\#2\\%
\@delimNhyperpage{#1}%
\else
\@ifundefined{hyperlink}{#1\delimR #2}{\hyperlink{page.#1}{#1}\delimR \hyperlink{page.#2}{#2}}%
\fi
}
\def\@delimNhyperpage#1{\@@delimNhyperpage#1\delimN \delimN\\}
\def\@@delimNhyperpage#1\delimN #2\delimN #3\\{%
\ifx\\#2\\%
\@ifundefined{hyperlink}{#1}{\hyperlink{page.#1}{#1}}%
\else
\@ifundefined{hyperlink}{#1\delimN #2}{\hyperlink{page.#1}{#1}\delimN \hyperlink{page.#2}{#2}}%
\fi
}
\def\glshypersection#1{\@glshypersection#1\delimR \delimR \\}
\def\@glshypersection#1\delimR #2\delimR #3\\{%
\ifx\\#2\\%
\@delimNhypersection{#1}%
\else
\@ifundefined{hyperlink}{#1\delimR #2}{\hyperlink{section.#1}{#1}\delimR \hyperlink{section.#2}{#2}}%
\fi
}
\def\@delimNhypersection#1{\@@delimNhypersection#1\delimN \delimN\\}
\def\@@delimNhypersection#1\delimN #2\delimN #3\\{%
\ifx\\#2\\%
\@ifundefined{hyperlink}{#1}{\hyperlink{section.#1}{#1}}%
\else
\@ifundefined{hyperlink}{#1\delimN #2}{\hyperlink{section.#1}{#1}\delimN \hyperlink{section.#2}{#2}}%
\fi
}
\ifthenelse{\equal{\gls@number}{section}}{
\ifglshyper
\@ifundefined{chapter}
{}
{\let\@gls@old@chapter\@chapter
\def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}\@ifundefined{hyperdef}{}{\hyperdef{section}{\thechapter.0}{}}}}
\fi
\providecommand\hyperrm[1]{\textrm{\glshypersection{#1}}}
\providecommand\hypersf[1]{\textsf{\glshypersection{#1}}}
\providecommand\hypertt[1]{\texttt{\glshypersection{#1}}}
\providecommand\hyperbf[1]{\textbf{\glshypersection{#1}}}
\providecommand\hyperit[1]{\textit{\glshypersection{#1}}}
}
{
\providecommand\hyperrm[1]{\textrm{\glshyperpage{#1}}}
\providecommand\hypersf[1]{\textsf{\glshyperpage{#1}}}
\providecommand\hypertt[1]{\texttt{\glshyperpage{#1}}}
\providecommand\hyperbf[1]{\textbf{\glshyperpage{#1}}}
\providecommand\hyperit[1]{\textit{\glshyperpage{#1}}}
}
\else
\providecommand\hyperrm[1]{\textsf{#1}}
\providecommand\hypersf[1]{\textsf{#1}}
\providecommand\hypertt[1]{\texttt{#1}}
\providecommand\hyperbf[1]{\textbf{#1}}
\providecommand\hyperit[1]{\textit{#1}}
\fi
% \end{macrocode}
% Check to see if acronyms should be separate from glossary
% \begin{macrocode}
\ifglsacronym
\newglossarytype[alg]{acronym}{acr}{acn}
\newcommand{\acronymname}{List of Acronyms}
\else
\let\acronym=\glossary
\let\xacronym=\xglossary
\fi
% \end{macrocode}
%\subsection{makeglos code}
% \begin{macrocode}
%</glossary.sty>
% \end{macrocode}
% \begin{macrocode}
%<*makeglos.pl>
% \end{macrocode}
% \begin{macrocode}
#!/usr/bin/perl
# File : makeglos
# Author : Nicola Talbot
# Version : 1.3 (2005/06/28)
# Description: simple Perl script that calls makeindex.
# Intended for use with "glossary.sty" (saves having to remember
# all the various switches)
use Getopt::Std;
if ($#ARGV < 0)
{
die "Syntax : $0 [-ilqrcgm] [-s sty] [-o gls] [-t log] [-p num] <filename>\n";
}
getopt('sotp');
getopts('ilqrcgm');
# define known extensions
%exttype = (
glossary => {in=>'glo', out=>'gls', 'log'=>'glg'},
);
$ext = '';
if (length(@ARGV[0]) < 4)
{
$name = @ARGV[0];
}
elsif (substr(@ARGV[0],-4,1) eq ".")
{
$name = substr(@ARGV[0],0,length(@ARGV[0])-4);
$ext = substr(@ARGV[0],-3,3);
}
else
{
$name = @ARGV[0];
}
# check log file for other glossary types
if (open AUXFILE, "$name.aux")
{
while (<AUXFILE>)
{
if (m/\\\@newglossarytype\s*\[(.*)\]{(.*)}{(.*)}{(.*)}/)
{
$exttype{$2}{'in'} = $3;
$exttype{$2}{'out'} = $4;
$exttype{$2}{'log'} = $1;
if (!$opt_q)
{
print "added glossary type '$2' ($3,$4,$1)\n";
}
}
}
close AUXFILE;
}
else
{
print "unable to open $name.aux\n";
}
# save all the general makeindex switches
$mkidxopts = '';
if ($opt_i)
{
$mkidxopts .= " -i";
}
if ($opt_l)
{
$mkidxopts .= " -l";
}
if ($opt_q)
{
$mkidxopts .= " -q";
}
if ($opt_r)
{
$mkidxopts .= " -r";
}
if ($opt_c)
{
$mkidxopts .= " -c";
}
if ($opt_g)
{
$mkidxopts .= " -g";
}
unless ($opt_p eq "")
{
$mkidxopts .= " -p $opt_p";
}
if ($opt_s eq "")
{
$istfile = "$name.ist";
}
else
{
$istfile = $opt_s;
}
if ($ext ne '')
{
%thistype = %{$exttype{'glossary'}}; #default
foreach $type (keys %exttype)
{
if ($exttype{$type}{'in'} eq $ext)
{
%thistype = %{$exttype{$type}};
last;
}
}
if ($opt_o eq "")
{
$outfile = "$name.$thistype{out}";
}
else
{
$outfile = $opt_o;
}
if ($opt_t eq "")
{
$transcript = "$name.$thistype{'log'}";
}
else
{
$transcript = $opt_t;
}
&makeindex("$name.$ext",$outfile,$transcript,$istfile,
$mkidxopts,$opt_q,$opt_m);
}
else
{
foreach $type (keys %exttype)
{
%thistype = %{$exttype{$type}};
$inputfile = "$name.$thistype{in}";
if (-r $inputfile)
{
if ($opt_o eq "")
{
$outfile = "$name.$thistype{out}";
}
else
{
$outfile = $opt_o;
}
if ($opt_t eq "")
{
$transcript = "$name.$thistype{'log'}";
}
else
{
$transcript = $opt_t;
}
&makeindex($inputfile,$outfile,$transcript,
$istfile,$mkidxopts,$opt_q,$opt_m);
}
elsif (!$opt_q)
{
print "no read access for '$inputfile'\n";
}
}
}
sub makeindex{
local($in,$out,$trans,$ist,$rest,$quiet,$merge) = @_;
local($name,$cmdstr,$buffer,$n,$i,$j);
local(@stuff,@item);
if ($merge)
{
$cmdstr = "$rest -s $ist -t $trans -o tmp_$out $in";
}
else
{
$cmdstr = "$rest -s $ist -t $trans -o $out $in";
}
unless ($quiet)
{
print "makeindex $cmdstr\n";
}
`makeindex $cmdstr`;
if ($merge)
{
print "Merging entries\n";
open INPUT, "<tmp_$out";
$buffer = "";
while (<INPUT>)
{
$buffer .= $_;
}
close INPUT;
open OUTPUT, ">$out";
@stuff = split /\\gloitem /, $buffer;
$n = scalar(@stuff);
if ($n < 2)
{
print OUTPUT $buffer;
}
else
{
print OUTPUT $stuff[0];
for ($i = 1, $j=-1; $i < $n; $i++)
{
if ($stuff[$i]=~s/{\\glosslabel{(.+)}{(.+)}}//)
{
$name = $&;
if ($j==-1)
{
$j = 0;
$item[0]{'name'} = $name;
$item[0]{'desc'} = $stuff[$i];
}
else
{
# makeindex has already sorted the entries
# alphabetically, so duplicate entries
# will be one after the other
if ($item[$j]{'name'} eq $name)
{
$item[$j]{'desc'} .= $stuff[$i];
print "collating $name\n";
}
else
{
$j++;
$item[$j]{'name'} = $name;
$item[$j]{'desc'} = $stuff[$i];
}
}
}
else
{
print STDERR
"unable to extract name from glossary item:\n",
$stuff[$i];
}
}
for ($i=0; $i <= $j; $i++)
{
print OUTPUT "\\gloitem ", $item[$i]{'name'},
$item[$i]{'desc'};
}
}
close OUTPUT;
print "Output written in $out\n";
unlink "tmp_$out" or print "Can't delete tmp_$out: $!\n";
}
}
1;
% \end{macrocode}
% \begin{macrocode}
%</makeglos.pl>
% \end{macrocode}
% \begin{macrocode}
%<*makeglos.bat>
% \end{macrocode}
% \begin{macrocode}
@rem = '-*- Perl -*-
@echo off
perl -S %0.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
% \end{macrocode}
% \begin{macrocode}
%</makeglos.bat>
% \end{macrocode}
% \begin{macrocode}
%<*glossary.perl>
% \end{macrocode}
% \begin{macrocode}
# File : glossary.perl
# Author : Nicola Talbot
# Date : 8 July 2005
# Version : 1.02
# Description : LaTeX2HTML implementation of glossary package.
package main;
# These are the only package options implemented.
sub do_glossary_style_altlist{
}
sub do_glossary_style_hyper{
}
sub do_glossary_style_hyper_true{
}
sub do_glossary_style_hyperacronym{
}
sub do_glossary_style_hyperacronym_true{
}
sub do_glossary_toc{
}
sub do_glossary_toc_true{
}
$acronymtype = 'glossary';
sub do_glossary_acronym{
&do_glossary_acronym_true
}
sub do_glossary_acronym_true{
$gls_mark{'acronym'} = "<tex2html_acronym_mark>";
$gls_file_mark{'acronym'} = "<tex2html_acronym_file_mark>";
$gls_title{'acronym'} = "\\acronymname";
$delimN{'acronym'} = ", ";
$glodelim{'acronym'} = " ";
$glsnumformat{'acronym'} = "textrm";
$acronymtype = 'acronym';
}
sub do_glossary_acronym_false{
$acronymtype = 'glossary';
}
sub do_cmd_acronymname{
join('', 'List of Acronyms', $_[0]);
}
# modify set_depth_levels so that glossary is added
$gls_mark{'glossary'} = "<tex2html_gls_mark>";
$gls_file_mark{'glossary'} = "<tex2html_gls_file_mark>";
$gls_title{'glossary'} = "Glossary";
$delimN{'glossary'} = ", ";
$glodelim{'glossary'} = " ";
$glsnumformat{'glossary'} = "textrm";
sub replace_glossary_markers{
foreach $type (keys %gls_mark)
{
if (defined &add_gls_hook)
{&add_gls_hook if (/$gls_mark{$type}/);}
else
{&add_gls($type) if (/$gls_mark{$type}/);}
s/$gls_file_mark{$type}/$glsfile{$type}/g;
}
}
# there must be a better way of doing this
# other than copying the orginal code and adding to it.
sub replace_general_markers {
if (defined &replace_infopage_hook) {&replace_infopage_hook if (/$info_page_mark/);}
else { &replace_infopage if (/$info_page_mark/); }
if (defined &add_idx_hook) {&add_idx_hook if (/$idx_mark/);}
else {&add_idx if (/$idx_mark/);}
&replace_glossary_markers;
if ($segment_figure_captions) {
s/$lof_mark/$segment_figure_captions/o
} else { s/$lof_mark/$figure_captions/o }
if ($segment_table_captions) {
s/$lot_mark/$segment_table_captions/o
} else { s/$lot_mark/$table_captions/o }
&replace_morelinks();
if (defined &replace_citations_hook) {&replace_citations_hook if /$bbl_mark/;}
else {&replace_bbl_marks if /$bbl_mark/;}
if (defined &add_toc_hook) {&add_toc_hook if (/$toc_mark/);}
else {&add_toc if (/$toc_mark/);}
if (defined &add_childs_hook) {&add_childs_hook if (/$childlinks_on_mark/);}
else {&add_childlinks if (/$childlinks_on_mark/);}
&remove_child_marks;
if (defined &replace_cross_references_hook) {&replace_cross_references_hook;}
else {&replace_cross_ref_marks if /$cross_ref_mark||$cross_ref_visible_mark/;}
if (defined &replace_external_references_hook) {&replace_external_references_hook;}
else {&replace_external_ref_marks if /$external_ref_mark/;}
if (defined &replace_cite_references_hook) {&replace_cite_references_hook;}
else { &replace_cite_marks if /$cite_mark/; }
if (defined &replace_user_references) {
&replace_user_references if /$user_ref_mark/; }
}
sub add_gls{
local($sidx_style, $eidx_style) =('<STRONG>','</STRONG>');
if ($INDEX_STYLES) {
if ($INDEX_STYLES =~/,/) {
local(@styles) = split(/\s*,\s*/,$INDEX_STYLES);
$sidx_style = join('','<', join('><',@styles) ,'>');
$eidx_style = join('','</', join('></',reverse(@styles)) ,'>');
} else {
$sidx_style = join('','<', $INDEX_STYLES,'>');
$eidx_style = join('','</', $INDEX_STYLES,'>');
}
}
&add_real_gls
}
sub gloskeysort{
local($x, $y) = ($a, $b);
$x=~s/^(.*)###(\d+)$/\l\1/;
local($x_id) = $2;
$y=~s/^(.*)###(\d+)$/\l\1/;
local($y_id) = $2;
local($n) = ($x cmp $y);
if ($n == 0)
{
$n = ($x_id <=> $y_id);
}
$n;
}
sub add_real_gls{
local($type) = @_;
print "\nDoing the $type ...";
local($key, $str, @keys, $glossary, $level, $count,
@previous, @current, $id, $linktext, $delimN);
@keys = keys %{$glossary{$type}};
@keys = sort gloskeysort @keys;
$level = 0;
$delimN = $delimN{$type};
foreach $key (@keys) {
$current = $key;
$str = $current;
$str =~ s/\#\#\#\d+$//o; # Remove the unique id's
#$linktext = $cross_ref_visible_mark;
$id = ++$global{'max_id'};
$linktext = "\\$glossary_format{$type}{$key}${OP}$id${CP}$glossary_linktext{$type}{$key}${OP}$id${CP}";
$linktext = &translate_commands($linktext);
$glossary .=
# If it's the same string don't start a new line
(&index_key_eq($current, $previous) ?
$delimN
. $glossary{$type}{$key}
. $linktext
. "</A>\n"
: "<DT>"
. $glossary_name{$type}{$key}
. "<DD>". $glossary_desc{$type}{$key}
. $glodelim{$type} . $glossary{$type}{$key}
. $linktext. "</A>\n");
$previous = $current;
}
$glossary = '<DD>'.$glossary unless ($glossary =~ /^\s*<D(T|D)>/);
$glossary =~ s/(<A [^>]*>)(<D(T|D)>)/$2$1/g;
$str = &translate_commands("\\glossarypostamble");
s/$gls_mark{$type}/$preglossary\n<DL COMPACT>\n$glossary<\/DL>$str\n/s;
}
sub set_depth_levels {
# Sets $outermost_level
local($level);
# scan the document body, not the preamble, for use of sectioning commands
my ($contents) = $_;
if ($contents =~ /\\begin\s*((?:$O|$OP)\d+(?:$C|$CP))document\1|\\startdocument/s) {
$contents = $';
}
foreach $level ("part", "chapter", "section", "subsection",
"subsubsection", "paragraph") {
last if (($outermost_level) = $contents =~ /\\($level)$delimiter_rx/);
last if (($outermost_level) = $contents =~ /\\endsegment\s*\[\s*($level)\s*\]/s);
if ($contents =~ /\\segment\s*($O\d+$C)[^<]+\1\s*($O\d+$C)\s*($level)\s*\2/s)
{ $outermost_level = $3; last };
}
$level = ($outermost_level ? $section_commands{$outermost_level} :
do {$outermost_level = 'section'; 3;});
if ($REL_DEPTH && $MAX_SPLIT_DEPTH) {
$MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH;
} elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 };
%unnumbered_section_commands = (
'tableofcontents', $level
, 'listoffigures', $level
, 'listoftables', $level
, 'bibliography', $level
, 'textohtmlindex', $level
, 'textohtmlglossary', $level
, %unnumbered_section_commands
);
%section_commands = (
%unnumbered_section_commands
, %section_commands
);
}
sub add_bbl_and_idx_dummy_commands {
local($id) = $global{'max_id'};
s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg;
## if ($bbl_cnt == 1) {
s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo;
#}
$global{'max_id'} = $id;
s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
s/[\\]printindex/\\textohtmlindex /o;
&add_gls_dummy_commands;
&lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands);
}
# this gets called before do_cmd_newglossarytype
# so currently only substitutes \\printglossary and \\printacronym
sub add_gls_dummy_commands{
#foreach $type (keys %gls_mark)
#{
# #$id = ++$global{'max_id'};
# s/[\\]print$type/\\textohtmlglossary[$type]/sg;
#}
s/[\\]printglossary/\\textohtmlglossary/sg;
s/[\\]printacronym/\\textohtmlglossary[$acronymtype]/sg;
}
# This is modified from do_cmd_textohtmlindex
sub do_cmd_textohtmlglossary{
local($_) = @_;
local($type);
$_[0]=~s/^\s*\[([^]]*)\]//;
$type = $1;
if ($type eq '') {$type = 'glossary';}
unless (defined $gls_mark{$type})
{
&write_warnings("glossary type '$type' not implemented");
}
if (eval "(defined \&do_cmd_${type}name) ||\$new_command{\"${type}name\"}")
{
local($br_id)=++$global{'max_id'};
$TITLE = &translate_environments("$O$br_id$C\\${type}name$O$br_id$C");
}
else
{ $TITLE = $gls_title{$type} }
$toc_sec_title = $TITLE;
$glsfile{$type} = $CURRENT_FILE;
if (%glossary_labels) { &make_glossary_labels(); }
if (($SHORT_INDEX) && (%glossary_segment))
{ &make_preglossary(); }
else
{ $preglossary = &translate_commands("\\glossarypreamble"); }
local $idx_head = $section_headings{'textohtmlindex'};
local($heading) = join(''
, &make_section_heading($TITLE, $idx_head)
, $gls_mark{$type} );
local($pre,$post) = &minimize_open_tags($heading);
join('',"<BR>\n" , $pre, $_[0]);
}
sub make_glossary_labels {
local($key, @keys);
@keys = keys %glossary_labels;
foreach $key (@keys) {
if (($ref_files{$key}) && !($ref_files{$key} eq "$glsfile{'glossary'}")) {
local($tmp) = $ref_files{$key};
&write_warnings("\nmultiple label $key , target in $glsfile{'glossary'} masks $tmp ");
}
$ref_files{$key} .= $glsfile{'glossary'};
}
}
sub make_preglossary{ &make_real_preglossary }
sub make_real_preglossary{
local($key, @keys, $head, $body);
$head = "<HR>\n<H4>Legend:</H4>\n<DL COMPACT>";
@keys = keys %glossary_segment;
foreach $key (@keys) {
local($tmp) = "segment$key";
$tmp = $ref_files{$tmp};
$body .= "\n<DT>$key<DD>".&make_named_href('',$tmp,$glossary_segment{$key});
}
$preglossary = join('', $head, $body, "\n</DL>") if ($body);
}
sub do_cmd_glossary { &do_real_glossary(@_) }
sub do_real_glossary {
local($_) = @_;
local($br_id, $str);
local($type) = "glossary";
local($anchor);
if (s/^\S*$OP(\d+)${CP}type=(.+)$OP\1$CP//)
{
$type = $2;
}
local($idx_option,$pat) = &get_next_optional_argument;
$str = &missing_braces unless (
(s/$next_pair_pr_rx/($br_id, $str) = ($1, $2);''/eo)
||(s/$next_pair_rx/($br_id, $str) = ($1, $2);''/eo));
# the maths gets processed before being passed
# to do_cmd_glossary. How can I do this
# substitution before it gets converted to an image?
$str=~s/\"\"/\"/gs;
$str=~s/\"\|/\|/gs;
$str=~s/\"@/@/gs;
$str=~s/\"!/!/gs;
$str=~s/;SPMquot;;SPMquot;/;SPMquot;/gs;
$str=~s/;SPMquot;\|/\|/gs;
$str=~s/;SPMquot;\@/\@/gs;
$str=~s/;SPMquot;!/!/gs;
$anchor = &make_glossary_entry($br_id,$str,$anchor_invisible_mark,$type);
join('', $anchor, $_);
}
sub make_glossary_entry { &make_real_glossary_entry(@_) }
sub make_real_glossary_entry {
local($br_id,$str,$text,$type) = @_;
local($this_file) = $CURRENT_FILE;
$TITLE = $saved_title if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title)));
#extract name, sort, description and format data from $str
local($name,$sort,$description,$format);
unless (($str=~/name\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($name=$2)) ||
($str=~/name\s*=\s*([^,]+)\s*,?/s && ($name=$1)))
{
&write_warnings("can't determine name key from $str");
}
unless (($str=~/sort\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($sort=$2)) ||
($str=~/sort\s*=\s*([^,]+)\s*,?/s && ($sort=$1)))
{
$sort = $name;
}
unless (($str=~/description\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($description=$2)) ||
($str=~/description\s*=\s*([^,]+)\s*,?/s && ($description=$1)))
{
&write_warnings("can't determine description key from $str");
}
unless (($str=~/format\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($format=$2)) ||
($str=~/format\s*=\s*([^,]+)\s*,?/s && ($format=$1)))
{
$format = "glsnumformat[$type]";
}
# Save the reference
$str = "$sort$description###" . ++$global{'max_id'}; # Make unique
# concatenate multiple spaces into a single space
# otherwise keys won't sort properly
$str=~s/\s+/ /gs;
$glossary{$type}{$str} .= &make_half_href($this_file."#$br_id");
$glossary_name{$type}{$str} = $name;
$glossary_format{$type}{$str} = $format;
$glossary_desc{$type}{$str} = $description;
$glossary_linktext{$type}{$str} = $TITLE;
"<A HREF=$gls_file_mark{$type}#tex2html$href_name NAME=\"$br_id\">$text<\/A>";
}
sub do_cmd_xglossary{
local($_) = @_;
local($entry,$text);
local($type) = "glossary";
if (s/^$OP(\d+)${CP}type=(.+)$OP\1$CP//)
{
$type = $2;
}
$entry = &missing_braces unless
s/$next_pair_pr_rx/$entry=$2;''/eo;
$text = &missing_braces unless
s/$next_pair_pr_rx/$text=$2;''/eo;
$entry=~s/\"\"/\"/gs;
$entry=~s/\"\|/\|/gs;
$entry=~s/\"\@/\@/gs;
$entry=~s/\"!/!/gs;
$entry=~s/;SPMquot;;SPMquot;/;SPMquot;/gs;
$entry=~s/;SPMquot;\|/\|/gs;
$entry=~s/;SPMquot;\@/\@/gs;
$entry=~s/;SPMquot;!/!/gs;
$br_id = ++$global{'max_id'};
join('', &make_glossary_entry($br_id,$entry,$text,$type),
$_);
}
sub do_cmd_newglossarytype{
local($type,$out,$in);
$type = &missing_braces unless
($_[0]=~s/$next_pair_pr_rx//o&&($type=$2));
$out = &missing_braces unless
($_[0]=~s/$next_pair_pr_rx//o&&($out=$2));
$in = &missing_braces unless
($_[0]=~s/$next_pair_pr_rx//o&&($in=$2));
&make_newglossarytype($type);
$_[0];
}
sub make_newglossarytype{
local($type) = @_;
eval ("sub do_cmd_make$type\{\}");
$gls_mark{$type} = "<tex2html_${type}_mark>";
$gls_file_mark{$type} = "<tex2html_${type}_file_mark>";
$gls_title{$type} = "\\glossaryname";
local($tmp) = 'sub do_cmd_' . $type. '{';
$tmp .= 'local($id) = ++$global{\'max_id\'};';
$tmp .= '"\\\\glossary$OP$id${CP}type=' . $type . '$OP$id$CP".$_[0];';
$tmp .= '}';
eval($tmp);
$tmp = 'sub do_cmd_x' . $type. '{';
$tmp .= 'local($id) = ++$global{\'max_id\'};';
$tmp .= '"\\\\xglossary$OP$id${CP}type=' . $type . '$OP$id$CP".$_[0];';
$tmp .= '}';
eval($tmp);
$tmp = 'sub do_cmd_print' . $type. '{';
#$tmp .= 'local($id)=++$global{\'max_id\'};';
$tmp .= '"\\\\textohtmlglossary[' . $type
. ']" . $_[0]';
$tmp .= '}';
eval($tmp);
$delimN{$type} = ", ";
$glodelim{$type} = "";
$glsnumformat{$type} = "";
}
sub do_cmd_gloshort{
local($_) = @_;
join('', "<tex2html_GLOSHORT_mark>", $_);
}
sub do_cmd_glolong{
local($_) = @_;
join('', "<tex2html_GLOLONG_mark>", $_);
}
$acronymnamefmt = "<tex2html_GLOLONG_mark> (<tex2html_GLOSHORT_mark>)";
sub do_cmd_setacronymnamefmt{
local($_) = @_;
$acronymnamefmt = &missing_braces unless
s/$next_pair_pr_rx/$acronymnamefmt=$2;''/eo;
$_;
}
sub do_cmd_acronymfont{
local($_) = @_;
local($text) = &missing_braces unless
s/$next_pair_pr_rx/$text=$2;''/eo;
$text . $_;
}
%acronym = ();
sub do_cmd_newacronym{
local($_) = @_;
local($cmdname,$pat,$abbrv,$long,$glsentry,$name);
($cmdname,$pat) = &get_next_optional_argument;
$abbrv = &missing_braces unless
(s/$next_pair_pr_rx/$abbrv=$2;''/eo);
$long = &missing_braces unless
(s/$next_pair_pr_rx/$long=$2;''/eo);
$glsentry = &missing_braces unless
(s/$next_pair_pr_rx/$glsentry=$2;''/eo);
if ($cmdname eq '')
{
$cmdname = $abbrv;
}
local($id);
$id = ++$global{'max_id'};
local($fmtedabbrv) = &translate_commands("\\acronymfont$OP$id$CP$abbrv$OP$id$CP");
unless ($glsentry=~/name=/)
{
$name = $acronymnamefmt;
$name=~s/<tex2html_GLOSHORT_mark>/$fmtedabbrv/egs;
$name=~s/<tex2html_GLOLONG_mark>/$long/egs;
$id = ++$global{'max_id'};
$glsentry .= ",name=$OP$id$CP$name$OP$id$CP";
}
$global{"${cmdname}first"} = 1;
$acronym{$cmdname}{'abbrv'} = $abbrv;
$acronym{$cmdname}{'long'} = $long;
$acronym{$cmdname}{'entry'} = $glsentry;
local($tmp);
unless ($cmdname=~/[^a-zA-Z]/)
{
$tmp = 'sub do_cmd_' . $cmdname . '{';
$tmp .= 'local($_)=@_;';
$tmp .= 'local($id)=++$global{\'max_id\'};';
$tmp .= 'local($str);';
$tmp .= '$str="${OP}$id${CP}'
. $cmdname
. '${OP}$id${CP}";';
$tmp .= '&do_cmd_useacronym($str . $_[0])';
$tmp .= '}';
eval($tmp);
$tmp = 'sub do_cmd_' . $cmdname . 'star{';
$tmp .= 'local($_)=@_;';
$tmp .= 'local($id)=++$global{\'max_id\'};';
$tmp .= 'local($str);';
$tmp .= '$str="${OP}$id${CP}'
. $cmdname
. '${OP}$id${CP}";';
$tmp .= '&do_cmd_useacronymstar($str . $_[0])';
$tmp .= '}';
eval($tmp);
$tmp = 'sub do_cmd_' . $cmdname . 'long{';
$tmp .= 'local($_)=@_;';
$tmp .= 'join("", \'' . $long . '\', $_[0])';
$tmp .= '}';
eval($tmp);
$tmp = 'sub do_cmd_' . $cmdname . 'short{';
$tmp .= 'local($_)=@_;';
$tmp .= 'join("", \'' . $fmtedabbrv . '\', $_[0])';
$tmp .= '}';
eval($tmp);
}
$_;
}
sub do_cmd_acrsh{
local($_) = @_;
local($cmdname,$text,$id);
$cmdname = &missing_braces unless
(s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
$text = &translate_commands("\\${cmdname}short");
$text . $_;
}
sub do_cmd_acrshstar{
local($_) = @_;
local($cmdname,$text,$id);
$cmdname = &missing_braces unless
(s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
$text = &translate_commands("\\${cmdname}short");
$text=~s/(<.*>)?(\w)/\1\u\2/;
$text . $_;
}
sub do_cmd_acrln{
local($_) = @_;
local($cmdname,$text,$id);
$cmdname = &missing_braces unless
(s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
$text = &translate_commands("\\${cmdname}long");
$text . $_;
}
sub do_cmd_acrlnstar{
local($_) = @_;
local($cmdname,$text,$id);
$cmdname = &missing_braces unless
(s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
$text = &translate_commands("\\${cmdname}long");
$text=~s/(\w)/\u\1/;
$text . $_;
}
sub do_cmd_useacronym{
local($_)=@_;
local($str,$abbrv,$long,$entry,$id);
local($optarg,$pat)=&get_next_optional_argument;
$cmdname = &missing_braces unless
(s/$next_pair_pr_rx/$cmdname=$2;''/eo);
if (defined %{$acronym{$cmdname}})
{
$abbrv = $acronym{$cmdname}{'abbrv'};
$long = $acronym{$cmdname}{'long'};
$entry = $acronym{$cmdname}{'entry'};
$id = ++$global{'max_id'};
$abbrv = "\\acronymfont$OP$id$CP$abbrv$OP$id$CP";
$id = ++$global{'max_id'};
$str = "\\xglossary${OP}$id${CP}type="
. $acronymtype. "${OP}$id${CP}";
$id = ++$global{'max_id'};
$str .= "${OP}$id${CP}"
. $entry . "${OP}$id${CP}";
$id = ++$global{'max_id'};
$str .= "${OP}$id${CP}";
$str .= ($global{"${cmdname}first"} ? "$long$optarg ($abbrv)" : "$abbrv$optarg");
$str .= "${OP}$id${CP}";
$global{"${cmdname}first"} = 0;
}
else
{
&write_warnings("acronym '$cmdname' not defined");
}
$str . $_
}
sub do_cmd_useacronymstar{
local($_)=@_;
local($str,$abbrv,$long,$entry,$id);
local($optarg,$pat)=&get_next_optional_argument;
$cmdname = &missing_braces unless
(s/$next_pair_pr_rx/$cmdname=$2;''/eo);
if (defined %{$acronym{$cmdname}})
{
$abbrv = $acronym{$cmdname}{'abbrv'};
$long = $acronym{$cmdname}{'long'};
$entry = $acronym{$cmdname}{'entry'};
if ($global{"${cmdname}first"})
{
$long=~s/^([^a-zA-Z]*)([a-zA-Z])/\1\u\2/;
}
else
{
$abbrv=~s/^([^a-zA-Z]*)([a-zA-Z])/\1\u\2/;
}
$id = ++$global{'max_id'};
$abbrv = "\\acronymfont$OP$id$CP$abbrv$OP$id$CP";
$name = ($global{"${cmdname}first"} ? "$long$optarg ($abbrv)" : "$abbrv$optarg");
$id = ++$global{'max_id'};
$str = "\\xglossary${OP}$id${CP}type="
. $acronymtype . "${OP}$id${CP}";
$id = ++$global{'max_id'};
$str .= "${OP}$id${CP}"
. $entry . "${OP}$id${CP}";
$id = ++$global{'max_id'};
$str .= "${OP}$id${CP}";
$str .= $name;
$str .= "${OP}$id${CP}";
$global{"${cmdname}first"} = 0;
}
else
{
&write_warnings("acronym '$cmdname' not defined");
}
$str . $_
}
sub do_cmd_ifacronymfirstuse{
local($_) = @_;
local($acronym,$truebit,$falsebit,$str);
$acronym = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($acronym=$2));
$truebit = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($truebit=$2));
$falsebit = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($falsebit=$2));
$str = ($global{"${acronym}true"} ? $truebit : $falsebit);
$str . $_[0];
}
sub do_cmd_resetacronym{
local($_) = @_;
local($cmdname);
$cmdname = &missing_braces unless
(s/$next_pair_pr_rx/$cmdname=$2;''/eo);
if (defined %{$acronym{$cmdname}})
{
$global{"${cmdname}first"} = 1;
}
else
{
&write_warnings("acronym '$cmdname' not defined");
}
$_;
}
sub do_cmd_resetallacronyms{
local($_) = @_;
foreach $key (keys %acronym)
{
$global{"${key}first"} = 1;
}
$_;
}
%savedglosentry = ();
# This command is deprecated
sub do_cmd_saveglosentry{
local($_) = @_;
local($name,$desc,$type,$pat);
($type,$pat) = &get_next_optional_argument;
$name = &missing_braces unless
s/$next_pair_pr_rx/$name=$2;''/eo;
$desc = &missing_braces unless
s/$next_pair_pr_rx/$desc=$2;''/eo;
$savedglosentry{$name}{'entry'} = "name=$name,description=$desc";
$savedglosentry{$name}{'type'} = $type;
$_;
}
sub do_cmd_storeglosentry{
local($_) = @_;
local($type,$pat,$entry,$label);
($type,$pat) = &get_next_optional_argument;
if ($type eq '')
{
$type = 'glossary';
}
$label = &missing_braces unless
s/$next_pair_pr_rx/$label=$2;''/eo;
$entry = &missing_braces unless
s/$next_pair_pr_rx/$entry=$2;''/eo;
$savedglosentry{$label}{'entry'} = $entry;
$savedglosentry{$label}{'type'} = $type;
$_;
}
sub do_cmd_useglosentry{
local($_) = @_;
local($optarg,$pat,$name,$str,$id);
($optarg,$pat) = &get_next_optional_argument;
$name = &missing_braces unless
(s/$next_pair_pr_rx/$name=$2;''/eo);
if (defined $savedglosentry{$name}{type})
{
$id = ++$global{'max_id'};
$str = "\\$savedglosentry{$name}{type}${OP}$id${CP}$savedglosentry{$name}{entry}";
unless ($optarg eq "")
{
$str .= ",$optarg";
}
$str .= "${OP}$id${CP}";
}
else
{
&write_warnings("glossary entry '$name' undefined");
$str = '';
}
$str . $_;
}
sub do_cmd_useGlosentry{
local($_) = @_;
local($optarg,$pat,$name,$str,$id);
($optarg,$pat) = &get_next_optional_argument;
$name = &missing_braces unless
(s/$next_pair_pr_rx/$name=$2;''/eo);
if (defined $savedglosentry{$name}{type})
{
$id = ++$global{'max_id'};
$str = "\\x$savedglosentry{$name}{type}${OP}$id${CP}$savedglosentry{$name}{entry}";
unless ($optarg eq "")
{
$str .= ",$optarg";
}
$str .= "${OP}$id${CP}";
}
else
{
&write_warnings("glossary entry '$name' undefined");
$str = '';
}
$str . $_;
}
sub do_cmd_gls{
local($_) = @_;
local($optarg,$pat,$label,$str,$id,$name);
($optarg,$pat) = &get_next_optional_argument;
$label = &missing_braces unless
(s/$next_pair_pr_rx/$label=$2;''/eo);
if (defined $savedglosentry{$label}{type})
{
$str = $savedglosentry{$label}{'entry'};
if ($str=~/name=[ ]*${OP}(\d+)${CP}(.*)${OP}\1${CP}/s)
{
$name = $2;
}
elsif (($str=~/name=[ ]*([^,]+),/m)
|| ($str=~/name=[ ]*([^,]+)\Z(?!\n)/m))
{
$name = $1;
}
$id = ++$global{'max_id'};
$str = "\\x$savedglosentry{$label}{type}${OP}$id${CP}$savedglosentry{$label}{entry}";
unless ($optarg eq "")
{
$str .= ",$optarg";
}
$str .= "${OP}$id${CP}";
$id = ++$global{'max_id'};
$str .= "${OP}$id${CP}$name${OP}$id${CP}";
}
else
{
&write_warnings("glossary entry '$label' undefined");
$str = '';
}
$str . $_;
}
sub do_cmd_glossarypreamble{
local($_) = @_;
$_[0];
}
sub do_cmd_glossarypostamble{
local($_) = @_;
$_[0];
}
sub do_cmd_glsnumformat{
local($_) = @_;
local($type,$pat) = &get_next_optional_argument;
if ($type eq '')
{
$type = 'glossary';
}
local($cmd) = '';
unless ($glsnumformat{$type} eq '')
{
$cmd = "\\$glsnumformat{$type}";
}
$cmd . $_;
}
sub do_cmd_setglossary{
local($_) = @_;
local($str,$type,$format,$delimN,$glodelim);
$str = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($str=$2));
unless (($str=~/type=([^,]+),|$/&&($type=$1)) ||
($str=~/type=${OP}(\d+)${CP}(.*)${OP}\1${CP}/&&($type=$2)))
{
$type = 'glossary';
}
if ($str=~/glsnumformat=[ ]*${OP}(\d+)${CP}(.*)${OP}\1${CP}/s)
{
$format = $2;
}
elsif (($str=~/glsnumformat=[ ]*([^,]+),/m)
|| ($str=~/glsnumformat=[ ]*([^,]+)\Z(?!\n)/m))
{
$format = $1;
}
if ($format ne '')
{
$glsnumformat{$type} = $format;
if ($format eq 'ignore')
{
$delimN{$type} = '';
}
}
if (($str=~/delimN=([^,]+),|$/&&($delimN=$1)) ||
($str=~/delimN=${OP}(\d+)${CP}(.*)${OP}\1${CP}/&&($delimN=$2)))
{
$delimN{$type} = $delimN;
}
if (($str=~/glodelim=([^,]+),|$/&&($glodelim=$1)) ||
($str=~/glodelim=${OP}(\d+)${CP}(.*)${OP}\1${CP}/&&($glodelim=$2)))
{
$glodelim{$type} = $glodelim;
}
$_[0];
}
sub do_cmd_ignore{
local($_) = @_;
local($str);
$str = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($str=$2));
$_[0];
}
sub do_cmd_hyperit{
join('', "\\textit ", $_[0]);
}
sub do_cmd_hyperrm{
join('', "\\textrm ", $_[0]);
}
sub do_cmd_hypertt{
join('', "\\texttt ", $_[0]);
}
sub do_cmd_hypersf{
join('', "\\textsf ", $_[0]);
}
sub do_cmd_hyperbf{
join('', "\\textbf ", $_[0]);
}
&ignore_commands( <<_IGNORED_CMDS_ );
makeglossary
makeacronym
_IGNORED_CMDS_
1;
% \end{macrocode}
% \begin{macrocode}
%</glossary.perl>
% \end{macrocode}
% \begin{macrocode}
%<*sample.tex>
% \end{macrocode}
\documentclass[a4paper]{report}
\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage{glossary}
\makeglossary
\begin{document}
\title{Sample Document Using glossary Package}
\author{Nicola Talbot}
\pagenumbering{alph}% prevent duplicate page link names if using PDF
\maketitle
\pagenumbering{roman}
\tableofcontents
\chapter{Introduction}
\pagenumbering{arabic}
A \xglossary{name=glossary,description=1) list of technical
words}{glossary} is a very useful addition to any
technical document, although a \xglossary{name=glossary,
description=2) collection of glosses}{glossary} can
also simply be a collection of glosses, which is
another thing entirely.
Once you have run your document through \LaTeX, you
will then need to run the \texttt{.glo} file through
\texttt{makeindex}. You will need to set the output
file so that it creates a \texttt{.gls} file instead
of an \texttt{.ind} file, and change the name of
the log file so that it doesn't overwrite the index
log file (if you have an index for your document).
Rather than having to remember all the command line
switches, you can call the \xglossary{name=\texttt{Perl},
sort=Perl,description=A scripting language}{Perl} script
\texttt{makeglos.pl} which provides a convenient
wrapper.
If you have two terms with different meanings in your
\xglossary{name=glossary,description=1) list of technical
words}{glossary},
\texttt{makeindex} will of course treat them as two
separate entries, however, some people prefer to
merge them. This can be done using
\texttt{makeglos.pl}, and passing the option
\texttt{-m}.
\printglossary
\end{document}
% \begin{macrocode}
%</sample.tex>
% \end{macrocode}
% \begin{macrocode}
%<*sampleAcr.tex>
% \end{macrocode}
\documentclass[a4paper]{report}
\usepackage{xspace}
\usepackage[colorlinks,plainpages=false]{hyperref}
\usepackage[style=altlist,toc,number=none]{glossary}
\makeglossary
\renewcommand{\acronymfont}[1]{\textmd{\scshape #1}}
\setacronymnamefmt{\gloshort: \expandafter\MakeUppercase\glolong}
\newacronym{svm}{support vector machine}{description=Statistical pattern recognition technique~\cite{svm}}
\newacronym[ksvm]{k-svm}{kernel support vector machine}{description=Statistical pattern recognition technique using
the ``kernel trick'' (see also SVM)}
\begin{document}
\tableofcontents
\printglossary
\chapter{Support Vector Machines}
The \svm is used widely in the area of pattern recognition.
\useacronym*[s]{svm} are \ldots
This is the long version: \svmlong or alternatively:
\acrln*{svm}.
Abbreviation: \svmshort or \acrsh*{svm}.
\chapter{Kernel Support Vector Machines}
The \ksvm\ is \ifacronymfirstuse{svm}{a}{an} \svm\ that uses the so called ``kernel trick''.
%\resetacronym{ksvm}
\resetallacronyms
\useacronym*[s]{ksvm} \ldots
\svm.
\begin{thebibliography}{1}
\bibitem{svm} \ldots
\end{thebibliography}
\end{document}
% \begin{macrocode}
%</sampleAcr.tex>
% \end{macrocode}
% \begin{macrocode}
%<*sampleEq.tex>
% \end{macrocode}
\documentclass[a4paper,12pt]{report}
\usepackage{amsmath}
\usepackage[header,border=none,cols=3]{glossary}
\newcommand{\erf}{\operatorname{erf}}
\newcommand{\erfc}{\operatorname{erfc}}
\renewcommand{\theglossarynum}{\theequation}
\renewcommand{\pagecompositor}{.}
\renewcommand{\glossaryname}{Index of Special Functions and Notations}
\renewcommand{\glossaryheader}{\bfseries Notation &
\multicolumn{2}{c}{\bfseries
\begin{tabular}{c}Name of the Function and\\the number of
the formula\end{tabular}}\\}
\makeglossary
\begin{document}
\title{A Sample Document Using glossary.sty}
\author{Nicola Talbot}
\maketitle
\begin{abstract}
This is a sample document illustrating the use of the \textsf{glossary}
package. The functions here have been taken from ``Tables of
Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik.
The glossary is a list of special functions, so
the equation number has been used rather than the page number. This can be
done by defining \verb|\theglossarynum| to be \verb|\theequation|.
The equation numbers are a composite number made up of the chapter number
and number of equation within the chapter. The two parts of the page
number are separated by a fullstop. The default compositor is
a dash \verb|-|, so it needs to be set to a dot by redefining the command
\verb|\pagecompositor|. (This needs to be done \emph{before} the command
\verb|\makeglossary|.)
\end{abstract}
\printglossary
\chapter{Gamma Functions}
\begin{equation}
\Gamma(z) = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
\end{equation}
\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
\begin{equation}
\Gamma(x+1) = x\Gamma(x)
\end{equation}
\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
\begin{equation}
\gamma(\alpha, x) = \int_0^x e^{-t}t^{\alpha-1}\,dt
\end{equation}
\glossary{name={$\gamma(\alpha,x)$},description=Incomplete gamma function,sort=gamma}
\begin{equation}
\Gamma(\alpha, x) = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
\end{equation}
\glossary{name={$\Gamma(\alpha,x)$},description=Incomplete gamma function,sort=Gamma}
\newpage
\begin{equation}
\Gamma(\alpha) = \Gamma(\alpha, x) + \gamma(\alpha, x)
\end{equation}
\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
\begin{equation}
\psi(x) = \frac{d}{dx}\ln\Gamma(x)
\end{equation}
\glossary{name=$\psi(x)$,description=Psi function,sort=psi}
\chapter{Error Functions}
\begin{equation}
\erf(x) = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
\end{equation}
\glossary{name=$\erf(x)$,description=Error function,sort=erf}
\begin{equation}
\erfc(x) = 1 - \erf(x)
\end{equation}
\glossary{name=$\erfc(x)$,description=Complementary error function,sort=erfc}
\chapter{Beta Function}
\begin{equation}
B(x,y) = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
\end{equation}
\glossary{name={$B(x,y)$},description=Beta function,sort=B}
Alternatively:
\begin{equation}
B(x,y) = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
\end{equation}
\glossary{name={$B(x,y)$},description=Beta function,sort=B}
\begin{equation}
B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
\end{equation}
\glossary{name={$B(x,y)$},description=Beta function,sort=B}
\begin{equation}
B_x(p,q) = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
\end{equation}
\glossary{name={$B_x(p,q)$},description=Incomplete beta function,sort=Bx}
\chapter{Polynomials}
\section{Chebyshev's polynomials}
\begin{equation}
T_n(x) = \cos(n\arccos x)
\end{equation}
\glossary{name=$T_n(x)$,description=Chebyshev's polynomials of the first kind,sort=Tn}
\begin{equation}
U_n(x) = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
\end{equation}
\glossary{name=$U_n(x)$,description=Chebyshev's polynomials of the second kind,sort=Un}
\section{Hermite polynomials}
\begin{equation}
H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
\end{equation}
\glossary{name=$H_n(x)$,description=Hermite polynomials,sort=Hn}
\section{Laguerre polynomials}
\begin{equation}
L_n^{\alpha} (x) = \frac{1}{n!}e^x x^{-\alpha} \frac{d^n}{dx^n}(e^{-x}x^{n+\alpha})
\end{equation}
\glossary{name=$L_n^\alpha(x)$,description=Laguerre polynomials,sort=Lna}
\chapter{Bessel Functions}
Bessel functions $Z_\nu(z)$ are solutions of
\begin{equation}
\frac{d^2Z_\nu}{dz^2} + \frac{1}{z}\,\frac{dZ_\nu}{dz} +
\left(
1-\frac{\nu^2}{z^2}Z_\nu = 0
\right)
\end{equation}
\glossary{name=$Z_\nu(z)$,description=Bessel functions,sort=Z}
\chapter{Confluent hypergeometric function}
\begin{equation}
\Phi(\alpha,\gamma;z) = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!}
+ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!}
+\frac{\alpha(\alpha+1)(\alpha+2)}{\gamma(\gamma+1)(\gamma+2)}\,\frac{z^3}{3!}
+ \cdots
\end{equation}
\glossary{name={$\Phi(\alpha,\gamma;z)$},description=confluent hypergeometric function,sort=Pagz}
\begin{equation}
k_\nu(x) = \frac{2}{\pi}\int_0^{\pi/2}\cos(x \tan\theta - \nu\theta)\,d\theta
\end{equation}
\glossary{name=$k_\nu(x)$,description=Bateman's function,sort=kv}
\chapter{Parabolic cylinder functions}
\begin{equation}
D_p(z) = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}}
\left\{
\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)}
\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right)
-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)}
\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right)
\right\}
\end{equation}
\glossary{name=$D_p(z)$,description=Parabolic cylinder functions,sort=Dp}
\chapter{Elliptical Integral of the First Kind}
\begin{equation}
F(\phi, k) = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
\end{equation}
\glossary{name={$F(\phi,k)$},description=Elliptical integral of the first kind,sort=Fpk}
\chapter{Constants}
\begin{equation}
C = 0.577\,215\,664\,901\ldots
\end{equation}
\glossary{name=$C$,description=Euler's constant,sort=C}
\begin{equation}
G = 0.915\,965\,594\ldots
\end{equation}
\glossary{name=$G$,description=Catalan's constant,sort=G}
\end{document}
% \begin{macrocode}
%</sampleEq.tex>
% \end{macrocode}
% \begin{macrocode}
%<*sampleEqPg.tex>
% \end{macrocode}
\documentclass[a4paper,12pt]{report}
\usepackage{amsmath}
\usepackage[header,toc,border=none,cols=3]{glossary}
\newcommand{\erf}{\operatorname{erf}}
\newcommand{\erfc}{\operatorname{erfc}}
\renewcommand{\theglossarynum}{\theequation}
\renewcommand{\pagecompositor}{.}
\renewcommand{\glossaryname}{Index of Special Functions and Notations}
\renewcommand{\glossarypreamble}{Numbers in italic indicate the equation number,
numbers in bold indicate page numbers where the main definition occurs.\par}
\setglossary{glsnumformat=textit}
\renewcommand{\glossaryheader}{\bfseries Notation &
\multicolumn{2}{c}{\bfseries
\begin{tabular}{c}Name of the Function and\\the number of
the formula\end{tabular}}\\}
\renewcommand{\shortglossaryname}{Special Functions}
\makeglossary
\pagestyle{headings}
\begin{document}
\title{Sample Document Using Interchangable Numbering}
\author{Nicola Talbot}
\maketitle
\begin{abstract}
This is a sample document illustrating the use of the \textsf{glossary}
package. The functions here have been taken from ``Tables of
Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik.
The glossary lists both page number and equation numbers. Since the
equation numbers depend on chapter numbers, the page compositor needs
to be redefined. (Note that this example will only work where the
page number and equation number compositor is the same. So it won't work
if, say, the page numbers are of the form 2-4 and the equation numbers
are of the form 4.6) As most of the glossary entries should have an italic
format, it is easiest to set the default format to italic.
\end{abstract}
\tableofcontents
\printglossary
%It's a bit cumbersome having to keep redefining \theglossarynum. It
%would probably be easier to define a new command which sets \theglossarynum
%and then calls \glossary
%For example:
\newcommand{\myglossary}[2]{%
\renewcommand{\theglossarynum}{#1}\glossary{#2}}
%You can then do something like, say
%\myglossary{\thepage}{name=$\Gamma(z)$,description=Gamma function,sort=Gamma,format=textbf}
%or, alternatively, you could define
\newcommand{\glossarypage}[1]{%
\renewcommand{\theglossarynum}{\thepage}\glossary{#1,format=textbf}}
%and
\newcommand{\glossaryequation}[1]{%
\renewcommand{\theglossarynum}{\theequation}\glossary{#1}}
\chapter{Gamma Functions}
The gamma function is defined as
\renewcommand{\theglossarynum}{\thepage}
\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma,format=textbf}
\renewcommand{\theglossarynum}{\theequation}
\begin{equation}
\Gamma(z) = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
\end{equation}
\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
\begin{equation}
\Gamma(x+1) = x\Gamma(x)
\end{equation}
\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
\begin{equation}
\gamma(\alpha, x) = \int_0^x e^{-t}t^{\alpha-1}\,dt
\end{equation}
\glossary{name={$\gamma(\alpha,x)$},description=Incomplete gamma function,sort=gamma}
\begin{equation}
\Gamma(\alpha, x) = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
\end{equation}
\glossary{name={$\Gamma(\alpha,x)$},description=Incomplete gamma function,sort=Gamma}
\newpage
\begin{equation}
\Gamma(\alpha) = \Gamma(\alpha, x) + \gamma(\alpha, x)
\end{equation}
\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
\begin{equation}
\psi(x) = \frac{d}{dx}\ln\Gamma(x)
\end{equation}
\glossary{name=$\psi(x)$,description=Psi function,sort=psi}
\chapter{Error Functions}
The error function is defined as:
\renewcommand{\theglossarynum}{\thepage}
\glossary{name=$\erf(x)$,description=Error function,sort=erf,format=textbf}
\renewcommand{\theglossarynum}{\theequation}
\begin{equation}
\erf(x) = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
\end{equation}
\glossary{name=$\erf(x)$,description=Error function,sort=erf}
\begin{equation}
\erfc(x) = 1 - \erf(x)
\end{equation}
\glossary{name=$\erfc(x)$,description=Complementary error function,sort=erfc}
\chapter{Beta Function}
\begin{equation}
B(x,y) = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
\end{equation}
\glossary{name={$B(x,y)$},description=Beta function,sort=B}
Alternatively:
\begin{equation}
B(x,y) = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
\end{equation}
\glossary{name={$B(x,y)$},description=Beta function,sort=B}
\begin{equation}
B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
\end{equation}
\glossary{name={$B(x,y)$},description=Beta function,sort=B}
\begin{equation}
B_x(p,q) = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
\end{equation}
\glossary{name={$B_x(p,q)$},description=Incomplete beta function,sort=Bx}
\chapter{Chebyshev's polynomials}
\begin{equation}
T_n(x) = \cos(n\arccos x)
\end{equation}
\glossary{name=$T_n(x)$,description=Chebyshev's polynomials of the first kind,sort=Tn}
\begin{equation}
U_n(x) = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
\end{equation}
\glossary{name=$U_n(x)$,description=Chebyshev's polynomials of the second kind,sort=Un}
\chapter{Hermite polynomials}
\begin{equation}
H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
\end{equation}
\glossary{name=$H_n(x)$,description=Hermite polynomials,sort=Hn}
\chapter{Laguerre polynomials}
\begin{equation}
L_n^{\alpha} (x) = \frac{1}{n!}e^x x^{-\alpha} \frac{d^n}{dx^n}(e^{-x}x^{n+\alpha})
\end{equation}
\glossary{name=$L_n^\alpha(x)$,description=Laguerre polynomials,sort=Lna}
\chapter{Bessel Functions}
Bessel functions $Z_\nu(z)$ are solutions of
\begin{equation}
\frac{d^2Z_\nu}{dz^2} + \frac{1}{z}\,\frac{dZ_\nu}{dz} +
\left(
1-\frac{\nu^2}{z^2}Z_\nu = 0
\right)
\end{equation}
\glossary{name=$Z_\nu(z)$,description=Bessel functions,sort=Z}
\chapter{Confluent hypergeometric function}
\begin{equation}
\Phi(\alpha,\gamma;z) = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!}
+ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!}
+\frac{\alpha(\alpha+1)(\alpha+2)}{\gamma(\gamma+1)(\gamma+2)}\,\frac{z^3}{3!}
+ \cdots
\end{equation}
\glossary{name={$\Phi(\alpha,\gamma;z)$},description=confluent hypergeometric function,sort=Pagz}
\begin{equation}
k_\nu(x) = \frac{2}{\pi}\int_0^{\pi/2}\cos(x \tan\theta - \nu\theta)\,d\theta
\end{equation}
\glossary{name=$k_\nu(x)$,description=Bateman's function,sort=kv}
\chapter{Parabolic cylinder functions}
\begin{equation}
D_p(z) = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}}
\left\{
\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)}
\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right)
-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)}
\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right)
\right\}
\end{equation}
\glossary{name=$D_p(z)$,description=Parabolic cylinder functions,sort=Dp}
\chapter{Elliptical Integral of the First Kind}
\begin{equation}
F(\phi, k) = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
\end{equation}
\glossary{name={$F(\phi,k)$},description=Elliptical integral of the first kind,sort=Fpk}
\chapter{Constants}
\begin{equation}
C = 0.577\,215\,664\,901\ldots
\end{equation}
\glossary{name=$C$,description=Euler's constant,sort=C}
\begin{equation}
G = 0.915\,965\,594\ldots
\end{equation}
\glossary{name=$G$,description=Catalan's constant,sort=G}
\end{document}
% \begin{macrocode}
%</sampleEqPg.tex>
% \end{macrocode}
% \begin{macrocode}
%<*sampleNtn.tex>
% \end{macrocode}
\documentclass{report}
\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage{html}
\usepackage[toc]{glossary}
\makeglossary
\newglossarytype{notation}{not}{ntn}
% Set up notation style
\newcommand{\notationname}{Notation}
% Don't display numbers, remove commas and number hyphens
% for notation entries
\setglossary{type=notation,glsnumformat=ignore,%
glodelim={.}}
\makenotation
\begin{document}
\title{Sample Document using glossary Package}
\author{Nicola Talbot}
\pagenumbering{alph}
\maketitle
\begin{abstract}
\pagenumbering{Alph}%stop hyperref complaining about duplicate page identifiers
This is a sample document illustrating the use of the
\textsf{glossary} package. In this example, a new glossary type
called \texttt{notation} is defined, so that the document can have a
separate glossary of terms and index of notation. The index of notation
doesn't have associated numbers.
\end{abstract}
\pagenumbering{roman}
\tableofcontents
\printglossary
% Either of the following 2 commands will have
% the same effect with LaTeX. Effect slightly
% different with LaTeX2HTML.
%\printnotation
\printglossary[notation]
\chapter{Introduction}
\pagenumbering{arabic}
Sets\glossary{name=set,description=A collection of distinct objects}
are denoted by a caligraphic font
e.g.\ $\mathcal{S}$%
\notation{name=$\mathcal{S}$,description=A set,sort=S}.
Let $\mathcal{U}$ denote the universal set\notation{name=$\mathcal{U}$,description={The universal set},sort=U}.
The cardinality\glossary{name=cardinality,description=The number of elements in the specified set} of a set $\mathcal{S}$ is denoted
$|\mathcal{S}|$%
\notation{name=$\mid\mathcal{S}\mid$,description=cardinality of $\mathcal{S}$,sort=cardinality}
\chapter{Next}
Now for a hyperlink:
\xnotation{name=$\mathcal{U}$,description={The universal
set},sort=U}{$\mathcal{U}$}.
\end{document}
% \begin{macrocode}
%</sampleNtn.tex>
% \end{macrocode}
% \begin{macrocode}
%<*sampleNtn2.tex>
% \end{macrocode}
\documentclass{report}
\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage{html}
\usepackage[toc]{glossary}
\makeglossary
\newglossarytype{notation}{not}{ntn}
% Set up notation style
\newcommand{\notationname}{Notation}
% Don't display numbers, remove commas and number hyphens
% for notation entries
\setglossary{type=notation,glsnumformat=ignore,%
glodelim={.}}
\makenotation
\begin{document}
% Save details for later use (note the use of \protect):
\storeglosentry[notation]{not:set}{name={$\protect\mathcal{S}$},description=A set,sort=S}
\storeglosentry[notation]{not:U}{name=$\protect\mathcal{U}$,description={The universal set},sort=U}
\storeglosentry[notation]{not:card}{name=$\mid\protect\mathcal{S}\mid$,description=cardinality of $\protect\mathcal{S}$,sort=cardinality}
\storeglosentry{glos:set}{name=set,description=A collection of distinct objects}
\storeglosentry{glos:card}{name=cardinality,description=The number of elements in the specified set}
\title{Sample Document using glossary Package}
\author{Nicola Talbot}
\pagenumbering{alph}
\maketitle
\begin{abstract}
\pagenumbering{Alph}%stop hyperref complaining about duplicate page identifiers
This is a sample document illustrating the use of the
\textsf{glossary} package. In this example, a new glossary type
called \texttt{notation} is defined, so that the document can have a
separate glossary of terms and index of notation. The index of notation
doesn't have associated numbers.
\end{abstract}
\pagenumbering{roman}
\tableofcontents
\printglossary
% Either of the following 2 commands will have
% the same effect with LaTeX. Effect slightly
% different with LaTeX2HTML.
\printnotation
%\printglossary[notation]
\chapter{Introduction}
\pagenumbering{arabic}
Sets\useglosentry{glos:set}
are denoted by a caligraphic font
e.g.\ $\mathcal{S}$\useglosentry{not:set}.
Let \gls{not:U} denote the universal set.
The \gls{glos:card} of a set $\mathcal{S}$ is denoted
\gls{not:card}.
\end{document}
% \begin{macrocode}
%</sampleNtn2.tex>
% \end{macrocode}
% \begin{macrocode}
%<*sampleSec.tex>
% \end{macrocode}
\documentclass{report}
\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage[style=altlist,toc,number=section]{glossary}
\makeglossary
% This just saves a bit of typing
\storeglosentry{glos:I}{name=identity matrix,description=diagonal
matrix with 1s along the leading diagonal}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\printglossary
\chapter{Introduction}
\pagenumbering{arabic}
This is a sample document illustrating the use of the
\textsf{glossary} package.
\chapter{Diagonal matrices}
A diagonal matrix\glossary{name=diagonal matrix,
description=matrix whose only non-zero entries are along the leading diagonal,format=hyperit}
is a matrix where all elements not on the leading diagonal are zero. This is the
primary definition, so an italic font is used for the page number.
\newpage
\section{Identity matrix}
The identity matrix\glossary{name=identity matrix,
description=diagonal matrix with 1s along the leading diagonal}
\ldots
Here is another entry for a diagonal matrix\glossary{name=diagonal matrix,
description=matrix whose only non-zero entries are along the leading diagonal}
\chapter{Singular Matrices}
A singular matrix\glossary{name=singular matrix,
description=matrix with zero determinant}
\ldots
Another \useGlosentry{glos:I}{identity matrix} entry.
\end{document}
% \begin{macrocode}
%</sampleSec.tex>
% \end{macrocode}
%\Finale
\endinput
|