summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/glossaries/glossaries.dtx
blob: 8b476bdd5733473eef6d033ce23250a5ba8ae198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
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
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
%\iffalse
% glossaries.dtx generated using makedtx version 0.94b (c) Nicola Talbot
% Command line args:
%   -macrocode "glossaries\.perl"
%   -macrocode ".*\.tex"
%   -macrocode ".*\.xdy"
%   -src "glossaries.sty\Z=>glossaries.sty"
%   -src "mfirstuc.sty\Z=>mfirstuc.sty"
%   -src "(glossary-.+)\.(sty)\Z=>\1.\2"
%   -src "(glossaries-accsupp)\.(sty)\Z=>\1.\2"
%   -src "(glossaries-babel)\.(sty)\Z=>\1.\2"
%   -src "(glossaries-dictionary-.+)\.(dict)\Z=>\1.\2"
%   -src "(minimalgls\.tex)\Z=>\1"
%   -src "(sample.*\.tex)\Z=>\1"
%   -src "(samplexdy-mc\.xdy)\Z=>\1"
%   -src "(database.*\.tex)\Z=>\1"
%   -src "(glossaries\.perl)\Z=>\1"
%   -author "Nicola Talbot"
%   -dir "source"
%   -setambles "glossaries\.perl=>\nopreamble\nopostamble"
%   -setambles ".*\.tex=>\nopreamble\nopostamble"
%   -setambles ".*\.xdy=>\nopreamble\nopostamble"
%   -comment "glossaries\.perl"
%   -comment ".*\.tex"
%   -comment ".*\.xdy"
%   -doc "glossaries-manual.tex"
%   -codetitle "Documented Code"
%   glossaries
% Created on 2009/4/16 14:53
%\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) 2009 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
\documentclass[a4paper]{ltxdoc}
\usepackage{ifthen}
\usepackage{alltt}
\usepackage{pifont}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{cmap}
\usepackage[colorlinks,
            bookmarks,
            hyperindex=false,
            pdfauthor={Nicola L.C. Talbot},
            pdftitle={glossaries.sty: LaTeX2e Package to Assist Generating Glossaries},
            pdfkeywords={LaTeX,package,glossary,acronyms}]{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
\CheckSum{8209}
\CodelineNumbered
\newcommand*{\termdef}[1]{\emph{#1}\iterm{#1}}
\newcommand*{\term}[1]{#1\iterm{#1}}
\newcommand*{\iterm}[1]{\index{#1|main}}
\newcommand{\dq}[1]{``#1''}
\newcommand*{\tableref}[1]{\hyperref[#1]{table~\ref*{#1}}}
\newcommand*{\Tableref}[1]{\hyperref[#1]{Table~\ref*{#1}}}
\newlength\boxlength
\newsavebox\importantbox
\newenvironment{important}{%
\setlength{\fboxrule}{4pt}%
\setlength\boxlength{\linewidth}%
\addtolength\boxlength{-2\fboxsep}%
\addtolength\boxlength{-2\fboxrule}%
\begin{lrbox}{\importantbox}%
\begin{minipage}{\boxlength}%
}{\end{minipage}\end{lrbox}%
\par\vskip10pt\noindent
\fcolorbox{red}{white}{\usebox{\importantbox}}\par\vskip10pt}
\newcommand*{\tick}{\ding{51}}



\newcommand*{\ifirstuse}{\iterm{first use}}
\newcommand*{\firstuse}{first use\ifirstuse}
\newcommand*{\firstuseflag}{first use flag\ifirstuseflag}
\newcommand*{\firstusetext}{first use text\ifirstusetext}
\newcommand*{\ifirstuseflag}{\iterm{first use>flag}}
\newcommand*{\ifirstusetext}{\iterm{first use>text}}
\newcommand*{\istkey}[1]{\texttt{#1}\index{makeindex=\texttt{makeindex}>#1=\texttt{#1}|hyperpage}}
\newcommand*{\locfmt}[1]{\texttt{#1}\SpecialMainIndex{#1}}
\newcommand*{\ics}[1]{\texttt{\char`\\#1}\SpecialMainIndex{#1}}
\newcommand*{\appname}[1]{\texttt{#1}\index{#1=\texttt{#1}|hyperpage}}
\newcommand*{\mkidxspch}{\index{makeindex=\texttt{makeindex}>special characters|hyperpage}}
\newcommand*{\igloskey}[2][newglossaryentry]{\index{#1 options=\cs{#1} options>#2=\textsf{#2}|hyperpage}}
\newcommand*{\gloskey}[2][newglossaryentry]{\textsf{#2}\igloskey[#1]{#2}}
\newcommand*{\pkgoptni}[1]{\textsf{#1}}
\newcommand*{\ipkgopt}[2][]{%
\ifthenelse{\equal{#1}{}}{%
\index{package options>#2=\pkgoptni{#2}|hyperpage}}{%
\index{package options>#2=\pkgoptni{#2}>#1=\pkgoptni{#1}|hyperpage}}}
\newcommand*{\pkgopt}[2][]{%
\ifthenelse{\equal{#1}{}}{%
\pkgoptni{#2}\index{package options>#2=\pkgoptni{#2}|hyperpage}}{%
\pkgoptni{#2=#1}\index{package options>#2=\pkgoptni{#2}>#1=\pkgoptni{#1}|hyperpage}}}
\newcommand*{\pkgoptval}[2]{\pkgoptni{#1}\index{package options>#2=\pkgoptni{#2}>#1=\pkgoptni{#1}|hyperpage}}
\newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles>#1|hyperpage}}
\newcommand*{\filetype}[1]{\texttt{#1}\index{file types>#1|hyperpage}}
\newcommand*{\sty}[1]{\textsf{#1}}
\newcommand*{\isty}[1]{\sty{#1}\index{#1 package=\sty{#1} package|hyperpage}}
\newcommand*{\cls}[1]{\textsf{#1}}
\newcommand*{\icls}[1]{\cls{#1}\index{#1 class=\cls{#1} class|hyperpage}}
\newcommand*{\envname}[1]{\textsf{#1}}


\begin{document}\DocInput{glossaries.dtx}
\end{document}
%</driver>
%\fi
%\MakeShortVerb{"}
%\DeleteShortVerb{\|}
%
% \title{glossaries.sty v 1.2: \LaTeXe\ Package to Assist Generating Glossaries}
% \author{Nicola L.C. Talbot\\[10pt]
%School of Computing Sciences\\
%University of East Anglia\\
%Norwich. Norfolk\\
%NR4 7TJ. United Kingdom.\\
%\url{http://theoval.cmp.uea.ac.uk/~nlct/}}
%
% \date{16th April 2009}
% \maketitle
%\tableofcontents
%
% \section{Introduction}
%
% \changes{1.0}{2007 May 16}{Initial version}
%The \sty{glossaries} package is provided to assist generating
%glossaries.  It has a certain amount of flexibility, allowing the
%user to customize the format of the glossary and define multiple
%glossaries.  It also supports acronyms and glossary styles that
%include symbols (in addition to a name and description) for glossary
%entries. There is provision for loading a database of glossary terms.
%Only those terms used\footnote{that is, if the term has been
%referenced using any of the commands described in \autoref{sec:glslink}, 
%\autoref{sec:glsadd} or 
%via \ics{glssee} (or the \gloskey{see} key)} in the document will be 
%added to the glossary.
%
%\textbf{This package replaces the \isty{glossary} package which is
%now obsolete. Please see the file 
%\url{glossary2glossaries.pdf} for assistance in upgrading.} 
%
%\begin{important}
%The \sty{glossaries} package comes with a 
%\htmladdnormallink{Perl}{http://www.perl.org/about.html} script 
%called \appname{makeglossaries}. This provides a convenient interface
%to \appname{makeindex} or \appname{xindy}. It is strongly
%recommended that you use this script, but \emph{it is not
%essential}. If you are reluctant to install Perl, or for any
%other reason you don't want to use \appname{makeglossaries}, you
%can called \appname{makeindex} or \appname{xindy} explicitly.
%See \autoref{sec:makeglossaries} for 
%further details.
%\end{important}
%
%One of the strengths of this package is its flexibility, however
%the drawback of this is the necessity of having a large manual
%that can cover all the various settings. The documentation is
%therefore structured as follows:
%\begin{itemize}
%\item \autoref{sec:quick} is for people who want a few quick
%pointers of how to get started creating a basic glossary, without
%having to read through lengthy descriptions.
%
%\item \autoref{sec:overview} gives an overview of the main user commands and their syntax.
%
%\item \autoref{sec:mfirstuc} describes the associated \sty{mfirstuc} package.
%
%\item\autoref{sec:code} contains the documented source code for those who
%want to know more about how the package works.
%
%\item \autoref{sec:code:mfirstuc} contains the documented code for 
%the \sty{mfirstuc} package. 
%\end{itemize}
%
%\noindent The remainder of this introductory section covers the
%following:
%\begin{itemize}
%\item \autoref{sec:samples} lists the sample documents provided 
%with this package.
%
%\item \autoref{sec:languages} provides information for users who
%wish to write in a language other than English.
%
%\item \autoref{sec:makeglossaries} 
%describes how to use a post-processor to create the sorted glossaries
%for your document.
%
%\item \autoref{sec:trouble} provides some assistance in the event that you encounter a problem.
%\end{itemize}
%
%\subsection{Sample Documents}
%\label{sec:samples}
%
%The \sty{glossaries} package is provided with some sample
%documents that illustrate the various functions. These should
%be located in the \texttt{samples} subdirectory (folder) of the
%\sty{glossaries} documentation directory. This location varies
%according to your operating system and \TeX\ distribution. You
%can use \texttt{texdoc} to locate the main glossaries documentation.
%For example, in a terminal or command prompt, type:
%\begin{verbatim}
%texdoc -l glossaries
%\end{verbatim}
%This should display the full pathname of the file 
%\texttt{glossaries.pdf}. View the contents of that directory and
%see if it contains the \texttt{samples} subdirectory.
%
%If you can't find the sample files, they are available in the
%\texttt{doc/latex/glossaries/samples/} subdirectory of the
%\texttt{glossaries.tds.zip} archive which can be downloaded from
%CTAN.
%
%The sample documents are as follows:
%\begin{description}
%\item[minimalgls.tex]\label{ex:minimalgls} This document is a minimal working example.
%You can test your installation using this file. To create the
%complete document you will need to do the following steps:
%  \begin{enumerate}
%  \item Run \texttt{minimalgls.tex} through \LaTeX\ by either 
%  typing
%\begin{verbatim}
%latex minimalgls
%\end{verbatim}
%  in a terminal or by using the relevant button or menu item in
%  your text editor or front-end. This will create the required 
%  associated files but you will not see the glossary. If you use 
%  PDF\LaTeX\ you will also get warnings about non-existent 
%  references. These warnings may be ignored on the first run.
%
%  If you get a \verb"Missing \begin{document}" error, then 
%  it's most likely that your version of \isty{xkeyval} is 
%  out of date. Check the log file for a warning of that nature. 
%  If this is the case, you will need to update the \sty{xkeyval}
%  package.
%
%  \item Run \appname{makeglossaries} on the document. This can
%  be done on a terminal by either typing
%\begin{verbatim}
%makeglossaries minimalgls
%\end{verbatim}
%  or by typing
%\begin{verbatim}
%perl makeglossaries minimalgls
%\end{verbatim}
%  If your system doesn't recognise the command \texttt{perl} then
%  it's likely you don't have Perl installed. In which case you
%  will need to use \appname{makeindex} directly. You can do this
%  in a terminal by typing (all on one line):
%\begin{verbatim}
%makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls
%minimalgls.glo
%\end{verbatim}
%  (See
%\autoref{sec:makeindexapp}   for further details on using \appname{makeindex} explicitly.)
%
%  Note that if you need to specify the full path and the path
%  contains spaces, you will need to delimit the file names with
%  the double-quote character.
%
%  \item Run \texttt{minimalgls.tex} through \LaTeX\ again (as step~1)
%  \end{enumerate}
%You should now have a complete document. The number following
%each entry in the glossary is the location number. By default, this 
%is the page number where the entry was referenced.
%
%\item[sample4col.tex]\label{ex:sample4col} This document illustrates a four column
%glossary where the entries have a symbol in addition to the
%name and description. To create the complete document, you need
%to do:
%\begin{verbatim}
%latex sample4col
%makeglossaries sample4col
%latex sample4col
%\end{verbatim}
%As before, if you don't have Perl installed, you will need to 
%use \appname{makeindex} directly instead of using 
%\appname{makeglossaries}. The vertical gap between entries 
%is the gap created at the start of each group. This can be
%suppressed by redefining \ics{glsgroupskip} after the glossary
%style has been set:
%\begin{verbatim}
%\renewcommand*{\glsgroupskip}{}
%\end{verbatim}
%
%\item[sampleAcr.tex]\label{ex:sampleAcr} This document has some sample acronyms. It
%also adds the glossary to the table of contents, so an extra
%run through \LaTeX\ is required to ensure the document is up to date:
%\begin{verbatim}
%latex sampleAcr
%makeglossaries sampleAcr
%latex sampleAcr
%latex sampleAcr
%\end{verbatim}
%
%\item[sampleAcrDesc.tex]\label{ex:sampleAcrDesc} This is similar to the previous example,
%except that the acronyms have an associated description. As with
%the previous example, the glossary is added to the table of
%contents, so an extra run through \LaTeX\ is required:
%\begin{verbatim}
%latex sampleAcrDesc
%makeglossaries sampleAcrDesc
%latex sampleAcrDesc
%latex sampleAcrDesc
%\end{verbatim}
%
%\item[sampleDesc.tex]\label{ex:sampleDesc} This is similar to the previous example, 
%except that it defines the acronyms using \ics{newglossaryentry}
%instead of \ics{newacronym}. As with
%the previous example, the glossary is added to the table of
%contents, so an extra run through \LaTeX\ is required:
%\begin{verbatim}
%latex sampleDesc
%makeglossaries sampleDesc
%latex sampleDesc
%latex sampleDesc
%\end{verbatim}
%
%\item[sampleDB.tex]\label{ex:sampleDB} This document illustrates how to load 
%external files containing the glossary definitions. It also
%illustrates how to define a new glossary type. This document
%has the \term{number list} suppressed and uses \ics{glsaddall} to add
%all the entries to the glossaries without referencing each one
%explicitly. To create the document do:
%\begin{verbatim}
%latex sampleDB
%makeglossaries sampleDB
%latex sampleDB
%\end{verbatim}
%The glossary definitions are stored in the accompanying files 
%\texttt{database1.tex} and \texttt{database2.tex}. Note that if
%you don't have Perl installed, you will need to use
%\appname{makeindex} twice instead of a single call to 
%\appname{makeglossaries}:
%\begin{enumerate}
%\item Create the main glossary:
%\begin{verbatim}
%makeindex -s sampleDB.ist -t sampleDB.glg -o sampleDB.gls sampleDB.glo
%\end{verbatim}
%\item Create the secondary glossary:
%\begin{verbatim}
%makeindex -s sampleDB.ist -t sampleDB.nlg -o sampleDB.not sampleDB.ntn
%\end{verbatim}
%\end{enumerate}
%
%\item[sampleEq.tex]\label{ex:sampleEq} This document illustrates how to change the
%location to something other than the page number. In this case,
%the \texttt{equation} counter is used since all glossary entries
%appear inside an \envname{equation} environment. To create the
%document do:
%\begin{verbatim}
%latex sampleEq
%makeglossaries sampleEq
%latex sampleEq
%\end{verbatim}
%
%\item[sampleEqPg.tex]\label{ex:sampleEqPg} This is similar to the previous example,
%but the number lists\iterm{number list} are a mixture of page 
%numbers and equation numbers. This example adds the glossary to the 
%table of contents, so an extra \LaTeX\ run is required:
%\begin{verbatim}
%latex sampleEqPg
%makeglossaries sampleEqPg
%latex sampleEqPg
%latex sampleEqPg
%\end{verbatim}
%
%\item[sampleSec.tex]\label{ex:sampleSec} This document also illustrates how to change
%the location to something other than the page number. In this case,
%the \texttt{section} counter is used.  This example adds the 
%glossary to the table of contents, so an extra \LaTeX\ run is 
%required:
%\begin{verbatim}
%latex sampleSec
%makeglossaries sampleSec
%latex sampleSec
%latex sampleSec
%\end{verbatim}
%
%\item[sampleNtn.tex]\label{ex:sampleNtn} This document illustrates how to create
%an additional glossary type. This example adds the glossary to the 
%table of contents, so an extra \LaTeX\ run is required:
%\begin{verbatim}
%latex sampleNtn
%makeglossaries sampleNtn
%latex sampleNtn
%latex sampleNtn
%\end{verbatim}
%Note that if you don't have Perl installed, you will need to use
%\appname{makeindex} twice instead of a single call to 
%\appname{makeglossaries}:
%\begin{enumerate}
%\item Create the main glossary:
%\begin{verbatim}
%makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
%\end{verbatim}
%\item Create the secondary glossary:
%\begin{verbatim}
%makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.not sampleNtn.ntn
%\end{verbatim}
%\end{enumerate}
%
%\item[sample.tex]\label{ex:sample} This document illustrates some of the basics,
%including how to create child entries that use the same name as the 
%parent entry.  This example adds the glossary to the table of 
%contents, so an extra \LaTeX\ run is required:
%\begin{verbatim}
%latex sample
%makeglossaries sample
%latex sample
%latex sample
%\end{verbatim}
%You can see the difference between word and letter ordering
%if you substitute \pkgopt[word]{order} with
%\pkgopt[letter]{order}. (Note that this will only have an
%effect if you use \appname{makeglossaries}. If you use
%\appname{makeindex} explicitly, you will need to use the
%\texttt{-l} switch to indicate letter ordering.)
%
%\item[sampletree.tex]\label{ex:sampletree} This document illustrates a hierarchical
%glossary structure where child entries have different names
%to their corresponding parent entry. To create the document do:
%\begin{verbatim}
%latex sampletree
%makeglossaries sampletree
%latex sampletree
%\end{verbatim}
%
%\item[samplexdy.tex]\label{ex:samplexdy} This document illustrates how to use the
%\sty{glossaries} package with \appname{xindy} instead of
%\appname{makeindex}. The document uses UTF8 encoding (with the
%\isty{inputenc} package). The encoding is picked up by 
%\appname{makeglossaries}. By default, this document will create
%a \appname{xindy} style file called \texttt{samplexdy.xdy}, but
%if you uncomment the lines
%\begin{verbatim}
%\setStyleFile{samplexdy-mc}
%\noist
%\GlsSetXdyLanguage{}
%\end{verbatim}
%it will set the style file to \texttt{samplexdy-mc.xdy} instead.
%This provides an additional letter group for entries starting
%with \dq{Mc} or \dq{Mac}. If you use \appname{makeglossaries}, 
%you don't need to supply any additional information. If you
%don't use \appname{makeglossaries}, you will need to specify the
%required information. Note that if you set the style file to
%\texttt{samplexdy-mc.xdy} you must also specify \ics{noist}, 
%otherwise the \isty{glossaries} package will overwrite 
%\texttt{samplexdy-mc.xdy} and you will lose the \dq{Mc} letter group.
%
%To create the document do:
%\begin{verbatim}
%latex samplexdy
%makeglossaries samplexdy
%latex samplexdy
%\end{verbatim}
%If you don't have Perl installed, you will have to call 
%\appname{xindy} explicitly instead of using \appname{makeglossaries}.
%If you are using the default style file \texttt{samplexdy.xdy}, then
%do (no line breaks):
%\begin{verbatim}
%xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg
%-o samplexdy.gls samplexdy.glo
%\end{verbatim}
%otherwise, if you are using \texttt{samplexdy-mc.xdy}, then do
%(no line breaks):
%\begin{verbatim}
%xindy -I xindy -M samplexdy-mc -t samplexdy.glg -o samplexdy.gls
%samplexdy.glo
%\end{verbatim}
%
%\item[sampleutf8.tex]\label{ex:sampleutf8} This is another example that uses 
%\appname{xindy}. Unlike \appname{makeindex}, \appname{xindy} can
%cope with accented or non-Latin characters. This document uses
%UTF8 encoding. To create the document do:
%\begin{verbatim}
%latex sampleutf8
%makeglossaries sampleutf8
%latex sampleutf8
%\end{verbatim}
%If you don't have Perl installed, you will have to call 
%\appname{xindy} explicitly instead of using \appname{makeglossaries}
%(no line breaks):
%\begin{verbatim}
%xindy -L english -C utf8 -I xindy -M sampleutf8 -t sampleutf8.glg
%-o sampleutf8.gls sampleutf8.glo
%\end{verbatim}
%
%If you remove the \pkgopt{xindy} option from \texttt{sampleutf8.tex} 
%and do:
%\begin{verbatim}
%latex sampleutf8
%makeglossaries sampleutf8
%latex sampleutf8
%\end{verbatim}
%you will see that the entries that start with a non-Latin character
%now appear in the symbols group, and the word \dq{manœuvre} is now 
%after \dq{manor} instead of before it. If you are unable to use
%\appname{makeglossaries}, the call to \appname{makeindex} is as
%follows (no line breaks):
%\begin{verbatim}
%makeindex -s sampleutf8.ist -t sampleutf8.glg -o sampleutf8.gls
%sampleutf8.glo
%\end{verbatim}
%
%\item[sampleaccsupp.tex]\label{ex:sampleaccsupp} This document
%uses the experimental \isty{glossaries-accsupp} package. The
%symbol is set to the replacement text. Note that some PDF
%viewers don't use the accessibility support. Information 
%about the \sty{glossaries-accsupp} package can be found in
%\autoref{sec:accsupp}.
%
%\end{description}
%
%\subsection{Multi-Lingual Support}
%\label{sec:languages}
%
%As from version 1.17, the \sty{glossaries} package can now be
%used with \appname{xindy} as well as \appname{makeindex}. If you
%are writing in a language that uses accented characters or
%non-Latin characters it is recommended that you use \appname{xindy}
%as \appname{makeindex} is hard-coded for Latin languages. This
%means that you are not restricted to the A, \ldots, Z letter groups.
%If you want to use \appname{xindy}, remember to use the
%\pkgopt{xindy} package option. For example:
%\begin{verbatim}
%\documentclass[frenchb]{article}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
%\usepackage{babel}
%\usepackage[xindy]{glossaries}
%\end{verbatim}
%
%\begin{important}
%If you use an accented or non-Latin character at the start of
%an entry name, you must place it in a group, or it will cause
%a problem for commands that convert the first letter to uppercase
%(e.g.\ \ics{Gls}) due to expansion issues. For example:
%\begin{verbatim}
%\newglossaryentry{elite}{name={{é}lite},
%description={select group or class}}
%\end{verbatim}
%\end{important}
%
%If you use the \isty{inputenc} package, \appname{makeglossaries}
%will pick up the encoding from the auxiliary file. If you use
%\appname{xindy} explicitly instead of via \appname{makeglossaries},
%you may need to specify the encoding using the \texttt{-C} 
%option. Read the \appname{xindy} manual for further details.
%
%\subsubsection{Changing the Fixed Names}
%\label{sec:fixednames}
%
%As from version 1.08, the \sty{glossaries} package now has
%limited multi-lingual support, thanks to all the people who have sent
%me the relevant translations either via email or via 
%\texttt{comp.text.tex}.
%However you must load \isty{babel} \emph{before} 
%\sty{glossaries} to enable this. Note that if \isty{babel} is loaded 
%and the \isty{translator} package is detected on \TeX's path, then the
%\isty{translator} package will be loaded automatically, however,
%it may not pick up on the required languages, so if the predefined
%text is not translated, you may need to explicitly load the
%\isty{translator} package with the required languages. For example:
%\begin{verbatim}
%\usepackage[spanish]{babel}
%\usepackage[spanish]{translator}
%\usepackage{glossaries}
%\end{verbatim}
%Alternatively, specify the language as a class option rather
%than a package option. For example:
%\begin{verbatim}
%\documentclass[spanish]{report}
%
%\usepackage{babel}
%\usepackage{glossaries}
%\end{verbatim}
%
%If you want to use \isty{ngerman} or \isty{german} instead
%of \isty{babel}, you will need to include the \isty{translator} package 
%to provide the translations. For example:
%\begin{verbatim}
%\documentclass[ngerman]{article}
%\usepackage{ngerman}
%\usepackage{translator}
%\usepackage{glossaries}
%\end{verbatim}
%
%The following languages are currently supported by the
%\isty{glossaries} package:
%\begin{center}
%\begin{tabular}{lc}
%\bfseries Language & \bfseries As from version\\
%Brazilian Portuguese & 1.17\\
%Danish & 1.08\\
%Dutch & 1.08\\
%English & 1.08\\
%French & 1.08\\
%German & 1.08\\
%Irish & 1.08\\
%Italian & 1.08\\
%Hungarian & 1.08\\
%Polish & 1.13\\
%Spanish & 1.08
%\end{tabular}
%\end{center}
%The language dependent commands and \isty{translator} keys used by the 
%glossaries package are listed in \tableref{tab:predefinednames}.
%
%\begin{table}[htbp]
%\caption{Customised Text}
%\label{tab:predefinednames}
%\begin{center}
%\begin{tabular}{@{}llp{0.4\linewidth}@{}}
%\bfseries Command Name & \bfseries Translator Key Word &
%\bfseries Purpose\\
%\ics{glossaryname} & \texttt{Glossary} & Title of the main glossary.\\
%\ics{acronymname} & \texttt{Acronyms} & Title of the list of acronyms
%(when used with package option \pkgopt{acronym}).\\
%\ics{entryname} & \texttt{Notation (glossaries)} & 
%Header for first column in the glossary (for 2, 3 or 4 column glossaries 
%that support headers).\\
%\ics{descriptionname} & \texttt{Description (glossaries)} &
%Header for second column in the glossary (for 2, 3 or 4 column glossaries
%that support headers).\\
%\ics{symbolname} & \texttt{Symbol (glossaries)} & Header for symbol
%column in the glossary for glossary styles that support this option.\\
%\ics{pagelistname} & \texttt{Page List (glossaries)} & 
%Header for page list column in the glossary for glossaries that support 
%this option.\\
%\ics{glssymbolsgroupname} & \texttt{Symbols (glossaries)} & 
%Header for symbols section of the glossary for glossary styles that 
%support this option.\\
%\ics{glsnumbersgroupname} & \texttt{Numbers (glossaries)} & Header for
%numbers section of the glossary for glossary styles that support
%this option.
%\end{tabular}
%\end{center}
%\end{table}
%
%Due to the varied nature of glossaries, it's likely that the
%predefined translations may not be appropriate. If you are using
%the \isty{babel} package and do not have the \isty{translator} package
%installed, you need to be familiar with the 
% advice given in \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=latexwords}. 
%
%If you have the \isty{translator} package installed, then it becomes
%much easier to change the default translations. For example, if you
%are writing in Irish and you want \cs{symbolname} to produce
%\dq{Siombail} instead of \dq{Comhartha}, then you can put the following
%in your document preamble:
%\begin{verbatim}
%\deftranslation[to=Irish]{Symbol (glossaries)}{Siombail}
%\end{verbatim}
%
%Note that \appname{xindy} provides much better multi-lingual
%support than \appname{makeindex}, so it's recommended that you
%use \appname{xindy} if you have glossary entries that contain
%accented characters or non-Roman letters. See
%\autoref{sec:xindy} for further details.
%\subsection{Generating the Associated Glossary Files}
%\label{sec:makeglossaries}
%
%In order to generate a sorted glossary with compact location lists,
%it is necessary to use an external indexing application as an
%intermediate step. It is this application that creates the file
%containing the code that typesets the glossary. If this step
%is omitted, the glossaries will not appear in your document. The
%two indexing applications that are most commonly used with
%\LaTeX\ are \appname{makeindex} and \appname{xindy}. As
%from version 1.17, the \sty{glossaries} package can be used
%with either of these applications. Previous versions were designed
%to be used with \appname{makeindex} only. Note that 
%\appname{xindy} has much better multi-lingual support than
%\appname{makeindex}, so \appname{xindy} is recommended if you're 
%not writing in English. Commands that only have an
%effect when \appname{xindy} is used are described
%in \autoref{sec:xindy}.
%
%The \sty{glossaries} package comes with the Perl script
%\appname{makeglossaries} which will run \appname{makeindex} or
%\appname{xindy} on all the glossary files using a customized style
%file (which is created by \ics{makeglossaries}). See
%\autoref{sec:makeglossariesapp} for further
%details. Perl is stable, cross-platform, open source software that
%is used by a number of \TeX-related applications. Further
%information is available at \url{http://www.perl.org/about.html}.  
%However, whilst it is strongly recommended that you use the
%\appname{makeglossaries} script, it is possible to use the
%\sty{glossaries} package without having Perl installed.  In which
%case, if you have used the \pkgopt{xindy} package option, you will
%need to use \appname{xindy} (see
%\autoref{sec:xindyapp}), otherwise you will need to use 
%\appname{makeindex} (see
%\autoref{sec:makeindexapp}). Note that some commands and
%package options have no effect if you don't use
%\appname{makeglossaries}. These are listed in 
%\tableref{tab:makeglossariesCmds}.
%
%Note that if any of your entries use an entry
%that is not referenced outside the glossary, you will need to
%do an additional \appname{makeglossaries}, \appname{makeindex}
%or \appname{xindy} run, as appropriate. For example,
%suppose you have defined the following entries:
%\begin{verbatim}
%\newglossaryentry{citrusfruit}{name={citrus fruit},
%description={fruit of any citrus tree. (See also 
%\gls{orange})}}
%
%\newglossaryentry{orange}{name={orange},
%description={an orange coloured fruit.}}
%\end{verbatim}
%and suppose you have \verb|\gls{citrusfruit}| in your document
%but don't reference the \texttt{orange} entry, then the
%\texttt{orange} entry won't appear in your glossary until
%you first create the glossary and then do another run
%of \appname{makeglossaries}, \appname{makeindex} or \appname{xindy}.
%For example, if the document is called \texttt{myDoc.tex}, then
%you must do:
%\begin{verbatim}
%latex myDoc
%makeglossaries myDoc
%latex myDoc
%makeglossaries myDoc
%latex myDoc
%\end{verbatim}
%
%Likewise, an additional \appname{makeglossaries} and \LaTeX\ run
%may be required if the document pages shift with re-runs. For
%example, if the page numbering is not reset after the table of
%contents, the insertion of the table of contents on the second
%\LaTeX\ run may push glossary entries across page boundaries, which
%means that the number lists\iterm{number list} in the glossary may 
%need updating.
%
%The examples in this document assume that you are accessing
%\appname{makeglossaries}, \appname{xindy} or \appname{makeindex} via
%a terminal. Windows users can use the MSDOS Prompt which
%is usually accessed via the 
%\textsf{Start}$\to$\textsf{All Programs} menu or 
%\textsf{Start}$\to$\textsf{All Programs}%$\to$\textsf{Accessories} menu. Alternatively, your text editor may have the
%facility to create a function that will call the 
%required application. See your editor's user manual for further
%details.
%
%If any problems occur, remember to check the transcript files 
%(e.g.\ \filetype{.glg} or \filetype{.alg}) for messages.
%
%\begin{table}[htbp]
%\caption{Commands and package options that have no effect when
%using \texttt{xindy} or \texttt{makeindex} explicity}
%\label{tab:makeglossariesCmds}
%\vskip\baselineskip
%\begin{tabular}{@{}lll@{}}
%\bfseries Command or Package Option & \appname{makeindex} & 
%\appname{xindy}\\
%\pkgopt[letter]{order} & use \texttt{-l} &
% use \texttt{-M ord/letorder}\\
%\pkgopt[word]{order} & default & default\\
%\pkgopt{xindy}=\{\pkgoptni{language=}\meta{lang}\pkgoptni{,codename=}\meta{code}\} &
%N/A & use \texttt{-L} \meta{lang} \texttt{-C} \meta{code}\\
%\ics{GlsSetXdyLanguage}\marg{lang} & N/A &
%use \texttt{-L} \meta{lang}\\
%\ics{GlsSetXdyCodePage}\marg{code} & N/A &
%use \texttt{-C} \meta{code}
%\end{tabular}
%\par
%\end{table}
%
%\subsubsection{Using the makeglossaries Perl Script}
%\label{sec:makeglossariesapp}
%
%The \appname{makeglossaries} script picks up the relevant 
%information from the auxiliary (\filetype{.aux}) file and
%will either call \appname{xindy} or \appname{makeindex}, 
%depending on whether the indexing style file ends with
%\filetype{.xdy} or \filetype{.ist}. Therefore, you only need to
%pass the document's name without the extension to
%\appname{makeglossaries}.
%For example, if your document is called \texttt{myDoc.tex}, 
%type the following in your terminal:
%\begin{verbatim}
%latex myDoc
%makeglossaries myDoc
%latex myDoc
%\end{verbatim}
%You may need to explicitly load \appname{makeglossaries} into
%Perl:
%\begin{verbatim}
%perl makeglossaries myDoc
%\end{verbatim}
%There is a batch file called \texttt{makeglossaries.bat} which
%does this for Windows users, but you must have Perl installed to
%be able to use it.
%
%\subsubsection{Using xindy explicitly}
%\label{sec:xindyapp}
%
%If you want to use \appname{xindy} to process the glossary
%files, you must make sure you have used the 
%\pkgopt{xindy} package option:
%\begin{verbatim}
%\usepackage[xindy]{glossaries}
%\end{verbatim}
%This is required regardless of whether you use \appname{xindy}
%explicitly or whether it's called implicitly via 
%\appname{makeglossaries}. This causes the glossary 
%entries to be written in raw \appname{xindy} format, so you need to
%use \texttt{-I xindy} \emph{not} \texttt{-I tex}.
%
%To run \appname{xindy} type the following in your terminal 
%(all on one line):\\[10pt]
%\begin{ttfamily}
%xindy -L \textrm{\meta{language}} -C \textrm{\meta{encoding}} -I xindy 
%-M \textrm{\meta{style}} -t \textrm{\meta{base}}.glg\newline
%-o \textrm{\meta{base}}.gls \textrm{\meta{base}}.glo
%\end{ttfamily}
%\\[10pt]
%where \meta{language} is the required language name, \meta{encoding}
%is the encoding, \meta{base} is the name of the document without the
%\filetype{.tex} extension and \meta{style} is the name of the
%\appname{xindy} style file without the \filetype{.xdy} extension.
%The default name for this style file is \meta{base}\filetype{.xdy}
%but can be changed via \ics{setStyleFile}\marg{style}. You may need
%to specify the full path name depending on the current working
%directory. If any of the file names contain spaces, you must delimit
%them using double-quotes.
%
%For example, if your document is called \texttt{myDoc.tex} and
%you are using UTF8 encoding in English, then type the
%following in your terminal:
%\begin{verbatim}
%xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo
%\end{verbatim}
%
%Note that this just creates the main glossary. You need to do
%the same for each of the other glossaries (including the
%list of acronyms if you have used the \pkgopt{acronym}
%package option), substituting \filetype{.glg}, \filetype{.gls}
%and \filetype{.glo} with the relevant extensions. For example,
%if you have used the \pkgopt{acronym} package option, then 
%you would need to do:
%\begin{verbatim}
%xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn
%\end{verbatim}
%For additional glossaries, the extensions are those supplied
%when you created the glossary with \ics{newglossary}.
%
%Note that if you use \appname{makeglossaries} instead, you can
%replace all those calls to \appname{xindy} with just one call
%to \appname{makeglossaries}:
%\begin{verbatim}
%makeglossaries myDoc
%\end{verbatim}
%Note also that some commands and package options have no effect if 
%you use \appname{xindy} explicitly instead of using 
%\appname{makeglossaries}. These are listed in 
%\tableref{tab:makeglossariesCmds}.
%
%\subsubsection{Using makeindex explicitly}
%\label{sec:makeindexapp}
%
%If you want to use \appname{makeindex} explicitly, you must
%make sure that you haven't used the \pkgopt{xindy} package
%option or the glossary entries will be written in the wrong
%format. To run \appname{makeindex}, type the following in
%your terminal:\\[10pt]
%\begin{ttfamily}
%makeindex -s \textrm{\meta{style}}.ist -t \textrm{\meta{base}}.glg 
%-o \textrm{\meta{base}}.gls \textrm{\meta{base}}.glo
%\end{ttfamily}\\[10pt]
%where \meta{base} is the name of your document without the
%\filetype{.tex} extension and \meta{style}\filetype{.ist} is the 
%name of the \appname{makeindex} style file. By default, this is
%\meta{base}\filetype{.ist}, but may be changed via
%\ics{setStyleFile}\marg{style}. Note that there are other options, 
%such as \texttt{-l} (letter ordering). See the \appname{makeindex}
%manual for further details.
%
%For example, if your document is called \texttt{myDoc.tex}, then
%type the following at the terminal:
%\begin{verbatim}
%makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo
%\end{verbatim}
%Note that this only creates the main glossary. If you have
%additional glossaries (for example, if you have used the
%\pkgopt{acronym} package option) then you must call 
%\appname{makeindex} for each glossary, substituting 
%\filetype{.glg}, \filetype{.gls} and \filetype{.glo} with the
%relevant extensions. For example, if you have used the
%\pkgopt{acronym} package option, then you need to type the
%following in your terminal:
%\begin{verbatim}
%makeindex -s myDoc.ist -t myDoc.alg -o myDoc.acr myDoc.acn
%\end{verbatim}
%For additional glossaries, the extensions are those supplied
%when you created the glossary with \ics{newglossary}.
%
%Note that if you use \appname{makeglossaries} instead, you can
%replace all those calls to \appname{makeindex} with just one call
%to \appname{makeglossaries}:
%\begin{verbatim}
%makeglossaries myDoc
%\end{verbatim}
%Note also that some commands and package options have no effect if 
%you use \appname{makeindex} explicitly instead of using 
%\appname{makeglossaries}. These are listed in 
%\tableref{tab:makeglossariesCmds}.
%
%\subsection{Troubleshooting}
%\label{sec:trouble}
%
%The \sty{glossaries} package comes with a minimal file called 
%\texttt{minimalgls.tex} which can be used for testing. This
%should be located in the \texttt{samples} subdirectory (folder)
%of the \sty{glossaries} documentation directory. The location
%varies according to your operating system and \TeX\ installation.
%For example, on my Linux partition it can be found in
%\texttt{/usr/local/texlive/2008/texmf-dist/doc/latex/glossaries/}. 
%Further information on debugging \LaTeX\ code is available at
%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/}.
%
%Below is a list of the most frequently asked questions. For
%other queries, consult the \sty{glossaries} FAQ at
%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/glossariesfaq.html}. 
%
%\begin{enumerate}
%\item \textbf{Q.} I get the error message:
%\begin{verbatim}
%Missing \begin{document}
%\end{verbatim}
%
%\textbf{A.} Check you are using an up to date version of the \isty{xkeyval}
%package.
%
%\item \textbf{Q.} I've used the \pkgopt{smallcaps} option, but the acronyms
%are displayed in normal sized upper case letters.
%
%\textbf{A.} The \pkgopt{smallcaps} package option uses \cs{textsc} to typeset
%the acronyms. This command converts lower case letters to small 
%capitals, while upper case letters remain their usual size. Therefore
%you need to specify the acronym in lower case letters.
%
%\item \textbf{Q.} How do I change the font that the acronyms are displayed in?
%
%\textbf{A.} The easiest way to do this is to specify the \pkgopt{smaller} package
%option and redefine \cs{acronymfont} to use the required typesetting
%command.  For example, suppose you would like the acronyms displayed in 
%a sans-serif font, then you can do:
%\begin{verbatim}
%\usepackage[smaller]{glossaries}
%\renewcommand*{\acronymfont}[1]{\textsf{#1}}
%\end{verbatim}
%
%\item \textbf{Q.} How do I change the font that the acronyms are displayed in
%on \firstuse?
%
%\textbf{A.} The easiest way to do this is to specify the \pkgopt{smaller} package
%option and redefine \cs{firstacronymfont} to use the required 
%command. Note that if you don't want the acronym on subsequent use
%to use \cs{textsmaller}, you will also need to redefine \cs{acronymfont},
%as above. For example to make the acronym emphasized on 
%\firstuse, but use the surrounding font for subsequent use, you can do:
%\begin{verbatim}
%\usepackage[smaller]{glossaries}
%\renewcommand*{\firstacronymfont}[1]{\emph{#1}}
%\renewcommand*{\acronymfont}[1]{#1}
%\end{verbatim}
%
%\item \textbf{Q.} I don't have Perl installed, do I have to use 
%\appname{makeglossaries}?
%
%\textbf{A.} Although it is strongly recommended that you use 
%\appname{makeglossaries}, you don't have to use it.
%For further details, read 
%\autoref{sec:xindyapp} or 
%\autoref{sec:makeindexapp}, depending on
%whether you want to use \appname{xindy} or \appname{makeindex}.
%
%
%\item \textbf{Q.} I'm used to using the \sty{glossary} package: are there any
%instructions on migrating from the \isty{glossary} package to the
%\sty{glossaries} package?
%
%\textbf{A.} Read the file \texttt{glossary2glossaries.pdf} which should be available from the 
%same location as this document.
%
%\item \textbf{Q.} I'm using \isty{babel} but the fixed names haven't been 
%translated.
%
%\textbf{A.} The \sty{glossaries} package currently only supports the following
%languages: Brazilian Portuguese, Danish, Dutch, English, French,
%German, Irish, Italian, Hungarian, Polish and Spanish. If you want
%to add another language, send me the translations, and I'll add them
%to the next version.
%
%If you are using one of the above languages, but the text hasn't been
%translated, try adding the \isty{translator} package with the
%required languages explicitly (before you load the \sty{glossaries}
%package). For example:
%\begin{verbatim}
%\usepackage[ngerman]{babel}
%\usepackage[ngerman]{translator}
%\usepackage{glossaries}
%\end{verbatim}
%Alternatively, you can add the language as a global option
%to the class file. Check the \sty{translator} package documentation 
%for further details.
%
%\item \textbf{Q.} My acronyms contain strange characters when I use commands
%like \ics{acrlong}.
%
%\textbf{A.} Switch off the sanitization:
%\begin{verbatim}
%\usepackage[sanitize=none]{glossaries}
%\end{verbatim}
%and protect fragile commands.
%
%\item \textbf{Q.} My glossaries haven't appeared.
%
%\textbf{A.} Remember to do the following:
%\begin{itemize}
%\item Add \ics{makeglossaries} to the document preamble.
%
%\item Use either \ics{printglossary} for each glossary that has
%been defined or \ics{printglossaries}.
%
%\item Use the commands listed in 
%\autoref{sec:glslink}, 
%\autoref{sec:glsadd} or 
%\autoref{sec:crossref} for each entry 
%that you want to appear in the glossary.
%
%\item Run \LaTeX\ on your document, then run \appname{makeglossaries},
%then run \LaTeX\ on your document again. If you want the glossaries
%to appear in the table of contents, you will need an extra \LaTeX\
%run. If any of your entries cross-reference an entry that's not
%referenced in the main body of the document, you will need to
%run \appname{makeglossaries} after the second \LaTeX\ run, followed
%by another \LaTeX\ run.
%\end{itemize}
%
%Check the log files (\filetype{.log}, \filetype{.glg} etc) for any 
%warnings.
%
%\item \textbf{Q.} It is possible to change the rules used to sort
%the glossary entries?
%
%\item \textbf{A.} If it's for an individual entry, then you can
%use the entry's \gloskey{sort} key to sort it according to a
%different term. If it's for the entire alphabet, then you will need
%to use \appname{xindy} (instead of \appname{makeindex}) and use an 
%appropriate \appname{xindy} language module. Writing \appname{xindy}
%modules or styles is beyond the scope of this manual. Further
%information about \appname{xindy} can be found at the
%\href{http://xindy.sourceforge.net/}{Xindy Web Site}.\footnote{\texttt{http://xindy.sourceforge.net/}}  
%There is also a link to the \appname{xindy} mailing list from that 
%site.
%
%\end{enumerate}
%
%\section{A Quick Guide For The Impatient}
%\label{sec:quick}
%
%This section is for people who want a few quick pointers
%of how to get started. However it is recommended that you read 
%\autoref{sec:overview} for additional commands and advice not listed here. There are
%also some sample files to help you get started, listed in
%\autoref{sec:samples}. The following is a minimal example:
%\begin{verbatim}
% \documentclass{article}
%
% % Load hyperref before glossaries
% \usepackage[colorlinks]{hyperref}
% \usepackage[acronym, % make a separate list of acronyms
%            toc % put the glossaries into the table of contents
%            ]{glossaries}
%
% % Write glossary entries to external file so that they
% % can be sorted and collated by another application.
% \makeglossaries
%
% % Define an entry whose label is `xample':
% \newglossaryentry{xample}% unique label identifying this entry
%  {% Define the attributes for this entry:
%    name=sample,% the name or term begin defined
%    description={a sample entry}% a description of this entry
%  }
%
% % Define an acronym whose label is `ca':
% \newacronym{ca}% label
%  {CA}% acronym
%  {Contrived Acronym}% expanded form
%
% \begin{document}
% \tableofcontents
%
% A \gls{xample} entry and a \gls{ca}.
%
% \printglossaries
% \end{document}
%\end{verbatim}
%
%\subsection{Package Order}
%Load \sty{glossaries} \emph{after} \isty{hyperref}:
%\begin{verbatim}
%\usepackage{hyperref}
%\usepackage{glossaries}
%\end{verbatim}
%Similarly for the \isty{html} package:
%\begin{verbatim}
%\usepackage{html}
%\usepackage{glossaries}
%\end{verbatim}
%Likewise for \isty{babel} and \isty{translator}.
%
%Note that if you are using the \isty{hyperref} package and the
%glossaries are in chapters, you may need to redefine
%\ics{glsclearpage} to do \ics{clearpage} instead of
%\cs{cleardoublepage} to prevent an unwanted blank page appearing
%before the glossary:
%\begin{verbatim}
%\renewcommand*{\glsclearpage}{\clearpage}
%\end{verbatim}
%
%\subsection{Displaying Glossaries}
%
%Always use \ics{makeglossaries} if you want the glossary
%entries to be written to the glossary file:
%\begin{verbatim}
%\usepackage{glossaries}
%\makeglossaries
%\end{verbatim}
%If you don't use \ics{makeglossaries}, your glossaries will
%not appear in the document!
%
%Use \ics{printglossaries} to make your glossaries appear 
%in the document at that point. For example:
%\begin{verbatim}
%\maketitle
%\printglossaries
%\section{Introduction}
%\end{verbatim}
%Note that only the glossary entries that have been used in the
%document text will appear in the glossary.
%See \autoref{sec:printglossary} for further details.
%
%To add the glossaries to the table of contents use the
%\pkgopt{toc} package option:
%\begin{verbatim}
%\usepackage[toc]{glossaries}
%\end{verbatim}
%This will require an extra \LaTeX\ run. Note that if the table
%of contents affects the subsequent page numbering (i.e.\ the
%page numbers are not reset after the table of contents) then you
%may need to rerun \appname{makeglossaries} and \LaTeX.
%
%The font used to display the entry name in the glossary
%is governed by \ics{glsnamefont}. This can be redefined
%as required. For example, to make the entry names appear
%in a medium sans-serif font do:
%\begin{verbatim}
%\renewcommand{\glsnamefont}[1]{\textsf{\mdseries #1}}
%\end{verbatim}
%Note that the list-like glossary styles place the entry name in
%the optional argument to \ics{item}, so they will
%appear in bold, unless you redefine \ics{glsnamefont} to counteract 
%the bold font. Similarly, the tree-like styles display the
%entry name in bold.
%
%Glossary styles can be set using the \pkgopt{style} 
%package option. For example:
%\begin{verbatim}
%\usepackage[style=long3col]{glossaries}
%\end{verbatim}
%or using \ics{glossarystyle}\marg{style}. For example:
%\begin{verbatim}
%\glossarystyle{altlist}
%\end{verbatim}
%The predefined glossary styles provided by the \sty{glossaries}
%bundle are listed in \autoref{sec:styles}.
%
%Each entry in the glossary has an associated list of numbers
%indicating whereabouts in the document that entry has been used.
%The number lists can be suppressed using package option 
%\pkgopt{nonumberlist}:
%\begin{verbatim}
%\usepackage[nonumberlist]{glossaries}
%\end{verbatim}
%See \autoref{sec:numberlists} for further details about number lists.
%
%If your pages have a hyphen compositor (i.e.\ your page
%numbers appear in the form 2-1), use \ics{glsSetCompositor}
%\emph{before} \ics{makeglossaries}:
%\begin{verbatim}
%\documentclass{article}
%\usepackage{glossaries}
%\glsSetCompositor{-}
%\makeglossaries
%\end{verbatim}
%
%By default, the glossary will appear in an unnumbered 
%chapter if chapters are defined, otherwise in an unnumbered
%section. This can be changed using the \pkgopt{section} package
%option. For example, to make the glossaries appear in an unnumbered
%section, even if chapters are defined, do:
%\begin{verbatim}
%\usepackage[section]{glossaries}
%\end{verbatim}
%Other sectional units can also be specified as 
%\pkgopt{section}=\meta{value}. For example, to make the glossaries
%appear in unnumbered subsections:
%\begin{verbatim}
%\usepackage[section=subsection]{glossaries}
%\end{verbatim}
%
%When you have created your document, run \LaTeX\ on it,
%then the Perl script \appname{makeglossaries}, then run \LaTeX\
%on it again:
%\begin{verbatim}
%latex myfile
%makeglossaries myfile
%latex myfile
%\end{verbatim}
%(You need to run \LaTeX\ again if you have used the \pkgopt{toc}
%package option. You may also need an extra \appname{makeglossaries} 
%run and another \LaTeX\ run if an entry is only referenced in the
%glossary, or if including the glossary has caused the 
%number lists\iterm{number list} to change.)
%
%If you use Windows, there is a batch file called 
%\texttt{makeglossaries.bat} which you can use, but you will
%still need Perl installed. Alternatively, you can call
%\appname{makeindex} directly. See
%\autoref{sec:makeglossaries} for 
%further details.
%
%If you want to use \appname{xindy} instead of
%\appname{makeindex}, you must specify it in the package option:
%\begin{verbatim}
%\usepackage[xindy]{glossaries}
%\end{verbatim}
%See
%\autoref{sec:makeglossaries} for 
%further details.
%
%\subsection{Defining Additional Glossaries}
%
%New glossaries can be defined using:\par
%\ics{newglossary}\oarg{log-ext}%
%\marg{label}\marg{in-ext}\marg{out-ext}%
%\marg{title}\par where \meta{label} is an identifying label,
%\meta{in-ext} is the extension of the file to be created
%by \appname{makeindex} or \appname{xindy} (called by 
%\appname{makeglossaries}),
%\meta{out-ext} is the extension of the file to be read by
%\appname{makeindex} or \appname{xindy} and \meta{title} is the title for this
%new glossary. The first optional argument \meta{log-ext} specifies
%the extension of the \appname{makeindex} or \appname{xindy} 
%transcript file. Example:
%\begin{verbatim}
%\newglossary[nlg]{notation}{not}{ntn}{Notation}
%\end{verbatim}
%This glossary's label is \texttt{notation} and its title
%will be Notation. If you use \appname{makeglossaries}, the 
%\appname{makeindex} or \appname{xindy} transcript will be written to a file with the
%extension \filetype{.nlg}. If \meta{log-ext} is omitted, the extension
%\filetype{.glg} will be used.
%
%Any new glossaries must be defined before 
%\ics{makeglossaries}:
%\begin{verbatim}
%\usepackage{glossaries}
%\newglossary{notation}{not}{ntn}{Notation}
%\makeglossaries
%\end{verbatim}
%
%If you use the \pkgopt{acronym} package option, the 
%\sty{glossaries} package
%will automatically create a new glossary type labelled
%\texttt{acronym}:
%\begin{verbatim}
%\usepackage[acronym]{glossaries}
%\end{verbatim}
%
%\subsection{Defining New Entries}
%
%A glossary term is defined using:\par
%\ics{newglossaryentry}\marg{label}\marg{key-val list}\par
%The \meta{key-val list} must at least contain a \gloskey{name}
%key and a \gloskey{description} key.
%For example:
%\begin{verbatim}
%\newglossaryentry{perl}{name=Perl,
%description=A scripting language}
%\end{verbatim}
%In this example, I have given the entry the label \texttt{perl}.
%Whenever I want to use this entry, that is the label I need
%to use to identify it.
%
%Only those terms that have actually been used in the
%document will be placed in the glossary. If you have defined
%a term that doesn't appear in the glossary, then it means
%you haven't used it in the text (either via \ics{glslink}
%or \ics{gls} and related commands or via \ics{glsadd}
%or \ics{glsaddall} or via \ics{glssee}).
%
%If you have multiple glossaries, use the \gloskey{type}
%key to specify in which glossary the entry belongs. For example:
%\begin{verbatim}
%\newglossary{languages}{lan}{lng}{Index of Languages}
%
%\makeglossaries
%
%\newglossaryentry{perl}{name=Perl,
%description=A scripting language,
%type=languages}
%\end{verbatim}
%If \gloskey{type} is omitted, the default glossary is used.
%
%Remember to group values that have a comma or equal sign.
%For example:
%\begin{verbatim}
%\newglossaryentry{pagelist}{name=page list,
%description={A list of individual pages or page ranges
%(e.g.\ 1,2,4,7--9)}}
%\end{verbatim}
%
%Associated symbols can also be specified, but whether the
%symbol appears in the glossary depends on the glossary style.
%For example:
%\begin{verbatim}
%\newglossaryentry{metre}{name={metre},
%description={A metric measurement of length},
%symbol={m}}
%\end{verbatim}
%See \autoref{sec:styles} for a list of predefined glossary 
%styles.
%
%See \autoref{sec:newglosentry} for further details.
%
%\subsection{Defining Sub-Entries}
%To define a sub-entry, use the \gloskey{parent} key. For
%example:
%\begin{verbatim}
%\newglossaryentry{fruit}{name={fruit}, % parent entry
%description={tree product that contains seeds}}
%
%\newglossaryentry{apple}{name={apple}, % sub-entry
%description={firm, round fruit},
%parent=fruit}
%\end{verbatim}
%
%Sub-entries may have the same name as the parent entry:
%\begin{verbatim}
%\newglossaryentry{glossary}{name=glossary, % parent entry
%description={\nopostdesc},
%plural={glossaries}}
%
%\newglossaryentry{glossarylist}{% first child entry 
%description={1) list of technical words},
%sort={1},
%parent={glossary}}
%
%\newglossaryentry{glossarycol}{% second child entry
%description={2) collection of glosses},
%sort={2},
%parent={glossary}}
%\end{verbatim}
%Note that in this instance the \gloskey{name} key is not 
%required for the child entries, but the \gloskey{sort} key is
%needed to sort the sub-entries. The parent entry has no 
%description, so the description terminator is suppressed using
%\ics{nopostdesc}.
%
%See \autoref{sec:subentries} for further details.
%
%\subsection{Changing the Sort Order}
%To change the sorting order, use the \gloskey{sort} key.
%For example:
%\begin{verbatim}
%\newglossaryentry{tex}{name={\TeX},
%description={A typesetting language},
%sort=tex}
%\end{verbatim}
%This will put the entry in the \dq{T} group (entries starting with
%the letter \dq{t} or \dq{T}) rather than the
%\dq{symbols} group (entries starting with a symbol).
%Similarly, the following example puts the entry in the \dq{U}
%group instead of the \dq{symbol} group.
%\begin{verbatim}
%\newglossaryentry{universal}{name={\ensuremath{\mathcal{U}}},
%description=The universal set,
%sort=U}
%\end{verbatim}
%
%Unlike the old \sty{glossary} package, you don't need to escape 
%\appname{makeindex}'s special characters:
%\begin{verbatim}
%\newglossaryentry{quote}{name={"},
%description={Double quote character}}
%
%\newglossaryentry{exclam}{name={!},
%description={Exclamation mark}}
%
%\newacronym{rna}{RNA}{ribonukleins\"aure}
%\end{verbatim}
%
%
%\subsection{Accented or Non-Latin Characters}
%If the entry name starts with an accented letter or 
%non-Latin character, you will need to group the first letter 
%(otherwise it will cause a problem for commands like \ics{Gls} and 
%\ics{Glspl}):
%\begin{verbatim}
%\newglossaryentry{elite}{name={{\'e}lite},
%sort=elite,
%description={select group or class}}
%\end{verbatim}
%Likewise with commands such as \cs{ae} and \cs{oe}:
%\begin{verbatim}
%\newglossaryentry{oesophagus}{%
%name={{\oe}sophagus},
%sort=oesophagus,
%description={canal from mouth to stomach}}
%\end{verbatim}
%
%If you use \appname{xindy}, you can specify the accented
%or non-Latin character directly (in combination with the 
%\isty{inputenc} and \isty{fontenc} packages) but you still 
%need to group the first letter (otherwise it will cause a
%problem for commands like \ics{Gls} and \ics{Glspl} due to
%expansion issues):
%\begin{verbatim}
%\newglossaryentry{elite}{name={{é}lite},
%description={select group or class}}
%\end{verbatim}
%Note that in this case the \gloskey{sort} key is not required
%as \appname{xindy} knows how to sort the letter \'e.
%
%\subsection{Cross-Referencing Entries}
%You can cross-reference an entry using the 
%\gloskey{see} key when you define it. For example, suppose
%you have defined an entry whose label is \texttt{taylorstheorem},
%then you can cross-reference it:
%\begin{verbatim}
%\newglossaryentry{maclaurinseries}{name={Maclaurin series},
%description={Series expansion},
%see={taylorstheorem}}
%\end{verbatim}
%Alternatively, you can use \ics{glssee} after you have defined
%the entry:
%\begin{verbatim}
%\glssee{maclaurinseries}{taylorstheorem}
%\end{verbatim}
%(The final argument may be a comma-separated list of labels.)
%The \dq{see} tag may be overridden for a given entry:
%\begin{verbatim}
%\glssee[see also]{maclaurinseries}{taylorstheorem}
%\end{verbatim}
%or it can be changed for all entries by redefining \ics{seename}.
%
%\subsection{Plurals}
%Plural forms are assumed to be the singular form with an
%\dq{s} appended, unless otherwise specified. To specify an
%irregular plural, use the \gloskey{plural} key. For example:
%\begin{verbatim}
%\newglossaryentry{matrix}{name=matrix,
%description=rectangular array of quantities,
%plural=matrices}
%\end{verbatim}
%
%The way the term appears in the main text can be different
%from the way the term appears in the glossary:
%\begin{verbatim}
%\newglossaryentry{matrix}{name=Matrix,
%description=rectangular array of quantities,
%text=matrix,
%plural=matrices}
%\end{verbatim}
%In this example, the entry name appears as \dq{Matrix} in the 
%glossary, and either \dq{matrix} or \dq{matrices} in the text.
%
%\subsection{Displaying Terms in the Document}
%In the document use \ics{gls}\marg{label}
%to use a term that has already been defined with
%\ics{newglossaryentry} (this will also enter the term into 
%the associated glossary output file). For example:
%\begin{verbatim}
%A \gls{singmtx} is a matrix with a zero determinant.
%\end{verbatim}
%
%Other variations:
%\begin{itemize}
%\item \ics{Gls}\marg{label} : like \cs{gls},
%but with first letter in upper case
%\item \ics{GLS}\marg{label} : like \cs{gls},
%but all upper case.
%\item \ics{glspl}\marg{label} : use plural
%\item \ics{Glspl}\marg{label} : use plural with
%first letter in upper case
%\item \ics{GLSpl}\marg{label} : use plural but
%all upper case
%\item \ics{glslink}\marg{label}\marg{link text} :
%use \meta{link text} to link to the given entry in the glossary.
%\end{itemize}
%For example, the following will produce the plural form with
%the first letter in uppercase:
%\begin{verbatim}
%\Glspl{singmtx} are matrices with a zero determinant.
%\end{verbatim}
%
%Additional text can be appended to the link using the
%end optional argument. For example, to form the possessive:
%\begin{verbatim}
%The \gls{singmtx}['s] dimensions \ldots
%\end{verbatim}
%See \autoref{sec:glslink} for further details.
%
%Entries can be added to the glossary without producing
%any text using \ics{glsadd}\marg{label} or
%\ics{glsaddall}. For example
%\begin{verbatim}
%\glsadd{singmtx}
%\end{verbatim}
%will add a line to the
%glossary file for the specified term, but will not produce
%any text where the command occurs.
%
%A number range can be entered using \verb|format=(| and
%\verb"format=)" to mark the beginning and ending of the
%range. For example:
%\begin{verbatim}
% \glsadd[format=(]{singmtx}
% This is a very long section all about \glspl{singmtx}.
%
% % lots of text omitted
%
% \glsadd[format=)]{singmtx}
%\end{verbatim}
%This is equivalent to \appname{makeindex}'s \verb"|(" and \verb"|)" 
%formats or \appname{xindy}'s \texttt{:open-range} and 
%\texttt{:close-range} tags.
%
%\subsection{Acronyms}
%The way the term appears on \firstuse\ can be different
%to the way it appears subsequently:
%\begin{verbatim}
%\newglossaryentry{singmtx}{name=Singular Matrix,
%description=A matrix with a zero determinant,
%first=singular matrix (SM),
%text=SM,
%firstplural=singular matrices (SMs)}
%\end{verbatim}
%In this example, the entry name appears as \dq{Singular Matrix} in
%the glossary, and in the text it appears as \dq{singular matrix (SM)}
%or \dq{singular matrices (SMs)} the first time the entry is used,
%and subsequently appears as \dq{SM} or \dq{SMs}.
%
%The quick and easy way to define an acronym is to use:\par
%\ics{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}%
%\marg{long}\par
%For example:
%\begin{verbatim}
%\newacronym{svm}{SVM}{support vector machine}
%\end{verbatim}
%This is equivalent to:
%\begin{verbatim}
%\newglossaryentry{svm}{type=\acronymtype,
%name={SVM},
%description={support vector machine},
%text={SVM},
%first={support vector machine (SVM)},
%plural={SVMs},
%firstplural={support vector machines (SVMs)}}
%\end{verbatim}
%(The value of \ics{acronymtype} varies depending on whether
%the \pkgopt{acronym} package option is used or not.
%The optional argument \meta{key-val list} can be used to
%override any of the \ics{newglossaryentry} keys; for
%example, if the acronym has an irregular plural.)
%
%You can reset an acronym with \ics{glsreset}\marg{label} so that the
%next occurrence displays the long form with the acronym in brackets
%as though it hadn't been used. To do this for all defined 
%terms, use \ics{glsresetall}. See
%\autoref{sec:glsunset} for further details.
%
%\section{Overview of User Commands}\label{sec:overview}
% \changes{1.02}{2007 May 25}{added overview section}
%
%\subsection{Package Options}
%\label{sec:pkgopts}
%
%The \sty{glossaries} package options are as follows:
%\begin{description}
%\item[\pkgopt{toc}] Add the glossaries to the table of contents.
%Note that an extra \LaTeX\ run is required with this option.
%
%\item[\pkgopt{numberline}] When used with \pkgopt{toc}, this will
%add \cs{numberline}\verb|{}| in the final argument of 
%\cs{addcontentsline}. This will align the table of contents entry 
%with the numbered section titles. Note that this option has no
%effect if the \pkgopt{toc} option is omitted. If \pkgopt{toc} is
%used without \pkgopt{numberline}, the title will be aligned with
%the section numbers rather than the section titles.
%
%\item[\pkgopt{acronym}] This creates a new glossary with the
%label \texttt{acronym}. This is equivalent to:
%\begin{verbatim}
%\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
%\end{verbatim}
%If the \pkgopt{acronym} package option is used, \ics{acronymtype}
%is set to \texttt{acronym} otherwise it is set to 
%\texttt{main}.\footnote{Actually it sets \ics{acronymtype} to
%\ics{glsdefaulttype} if the \pkgopt{acronym} package option is
%not used, but \ics{glsdefaulttype} usually has the value
%\texttt{main}.} 
%Entries that are defined using \ics{newacronym} are placed in
%the glossary whose label is given by \ics{acronymtype}, unless
%another glossary is explicitly specified.
%
%\item[\pkgopt{section}] This is a \meta{key}=\meta{value} option.  Its
%value should be the name of a sectional unit (e.g.\ chapter).
%This will make the glossaries appear in the named sectional unit,
%otherwise each glossary will appear in a chapter, if chapters
%exist, otherwise in a section. Unnumbered sectional units will be used
%by default. Example:
%\begin{verbatim}
%\usepackage[section=subsection]{glossaries}
%\end{verbatim}
%You can omit the value if you want to use sections, i.e.\
%\begin{verbatim}
%\usepackage[section]{glossaries}
%\end{verbatim}
%is equivalent to
%\begin{verbatim}
%\usepackage[section=section]{glossaries}
%\end{verbatim}
%You can change this value later in the document using\\[10pt]
%\DescribeMacro{\setglossarysection}\cs{setglossarysection}\marg{name}\\[10pt]
%where \meta{name} is the sectional unit.
%
%Note that if you are using the \isty{hyperref} package and the
%glossaries are put in chapters, you may need to redefine
%\ics{glsclearpage} to do \ics{clearpage} instead of
%\cs{cleardoublepage} to prevent an unwanted blank page appearing
%before the glossary:
%\begin{verbatim}
%\renewcommand*{\glsclearpage}{\clearpage}
%\end{verbatim}
%
%\item[\pkgopt{numberedsection}]
%The glossaries are placed in unnumbered sectional units by default,
%but this can be changed using \pkgopt{numberedsection}. This option can take
%three possible values: \pkgoptval{false}{numberedsection} (no
%number, i.e.\ use starred form), \pkgoptval{nolabel}{numberedsection}
%(numbered, i.e.\ unstarred form, but not labelled) and
%\pkgoptval{autolabel}{numberedsection} (numbered with automatic
%labelling). If \pkgopt[autolabel]{numberedsection} is used, each
%glossary is given a label that matches the glossary type, so the
%main (default) glossary is labelled \texttt{main}, the list of
%acronyms is labelled \texttt{acronym}\footnote{if the
%\pkgopt{acronym} option is used, otherwise the list of
%acronyms is the main glossary} and additional glossaries are labelled
%using the value specified in the first mandatory argument to 
%\cs{newglossary}. For example, if you load \sty{glossaries}
%using:
%\begin{verbatim}
%\usepackage[section,numberedsection=autolabel]{glossaries}
%\end{verbatim}
%then each glossary will appear in a numbered section, and can
%be referenced using something like:
%\begin{verbatim}
%The main glossary is in section~\ref{main} and the list of
%acronyms is in section~\ref{acronym}.
%\end{verbatim}
%If you can't decide whether to have the acronyms in the main
%glossary or a separate list of acronyms, you can use
%\ics{acronymtype} which is set to \texttt{main} if the
%\pkgopt{acronym} option is not used and is set to \texttt{acronym}
%if the \pkgopt{acronym} option is used. For example:
%\begin{verbatim}
%The list of acronyms is in section~\ref{\acronymtype}.
%\end{verbatim}
%
%As from version 1.14, you can add a prefix to the label by
%redefining \DescribeMacro{\glsautoprefix}\cs{glsautoprefix}.
%For example:
%\begin{verbatim}
%\renewcommand*{\glsautoprefix}{glo:}
%\end{verbatim}
%will add \texttt{glo:} to the automatically generated label, so
%you can then, for example, refer to the list of acronyms as follows:
%\begin{verbatim}
%The list of acronyms is in section~\ref{glo:\acronymtype}.
%\end{verbatim}
%Or, if you are undecided on a prefix:
%\begin{verbatim}
%The list of acronyms is in section~\ref{\glsautoprefix\acronymtype}.
%\end{verbatim}
%
%
%\item[\pkgopt{style}] This is a \meta{key}=\meta{value} option. Its 
%value should be the name of the glossary style to use. Predefined 
%glossary styles are listed in \autoref{sec:styles}.
%\item[\pkgopt{nolong}] This prevents the \sty{glossaries} package
%from automatically loading \isty{glossary-long} (which means that
%the \isty{longtable} package also won't be loaded). This reduces
%overhead by not defining unwanted styles and commands. Not that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \sty{glossary-long} package.
%
%\item[\pkgopt{nosuper}] This prevents the \sty{glossaries} package
%from automatically loading \isty{glossary-super} (which means that
%the \isty{supertabular} package also won't be loaded). This reduces
%overhead by not defining unwanted styles and commands. Not that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \sty{glossary-super} package.
%
%\item[\pkgopt{nolist}] This prevents the \sty{glossaries} package
%from automatically loading \isty{glossary-list}. This reduces
%overhead by not defining unwanted styles. Not that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \sty{glossary-list} package.
%Note that since the default style is \glostyle{list}, you will 
%also need to use the \pkgopt{style} option to set the style to
%something else.
%
%\item[\pkgopt{notree}] This prevents the \sty{glossaries} package
%from automatically loading \isty{glossary-tree}. This reduces
%overhead by not defining unwanted styles. Not that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \sty{glossary-tree} package.
%
%\item[\pkgopt{nostyles}] This prevents all the predefined styles
%from being loaded. This option is provided in the event that the
%user has custom styles that are not dependent on the styles
%provided by the \sty{glossaries} package. Note that if you use
%this option, you can't use the \pkgopt{style} package option. Instead
%you must either use \ics{glossarystyle}\marg{style} or
%the \gloskey[printglossary]{style} key in the
%optional argument to \ics{printglossary}.
%
%\item[\pkgopt{nonumberlist}] This option will suppress the 
%associated number lists\iterm{number list} in the glossaries (see also 
%\autoref{sec:numberlists}).
%\item[\pkgopt{counter}] This is a \meta{key}=\meta{value} option. The
%value should be the name of the default counter to use in the number
%lists\iterm{number list}.
%
%\hypertarget{sanitize}{}\relax\item[\pkgopt{sanitize}] This is a \meta{key}=\meta{value} option whose
%value is also a \meta{key}=\meta{value} list. By default, the
%\sty{glossaries} package sanitizes the values of the
%\gloskey{name}, \gloskey{description} and \gloskey{symbol} keys used
%when defining a new glossary entry. This may lead to unexpected results
%if you try to display these values within the document text. This
%sanitization can be switched off using the \pkgopt{sanitize} package
%option. (See \autoref{sec:pkgopt} and \autoref{sec:newentry} for further details.) For example, to switch off the sanitization for the
%\gloskey{description} and \gloskey{name} keys, but not for the
%\gloskey{symbol} key, do:
%\begin{verbatim}
%\usepackage[sanitize={name=false,description=false,%
%symbol=true}]{glossaries}
%\end{verbatim}
%
%\begin{important}%
%\textbf{Note}: this sanitization only applies to the \gloskey{name}, 
%\gloskey{description} and \gloskey{symbol} keys. It doesn't apply
%to any of the other keys (except the \gloskey{sort} key which is
%always sanitized) so fragile commands contained in the value of
%the other keys must always be protected using \cs{protect}.
%Since the value of the \gloskey{text} key is obtained from the
%\gloskey{name} key, you will still need to protect fragile commands
%in the \gloskey{name} key if you don't use the \gloskey{text} key. 
%\end{important}
%
%\item[\pkgopt{description}] This option changes the definition of
%\ics{newacronym} to allow a description. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{footnote}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{smallcaps}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{smaller}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{dua}] This option changes the definition of
%\ics{newacronym} so that acronyms are always expanded. 
%See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{shortcuts}] This option provides shortcut commands
%for acronyms.
%See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{makeindex}] (Default) The glossary information and
%indexing style file will be written in \appname{makeindex} format. If you use
%\appname{makeglossaries}, it will automatically detect that it needs
%to call \appname{makeindex}. If you don't use
%\appname{makeglossaries}, you need to remember to use
%\appname{makeindex} not \appname{xindy}. The indexing style file 
%will been given a \filetype{.ist} extension.
%
%\item[\pkgopt{xindy}] The glossary information and indexing style file will
%be written in \appname{xindy} format. If you use
%\appname{makeglossaries}, it will automatically detect that it needs
%to call \appname{xindy}. If you don't use \appname{makeglossaries},
%you need to remember to use \appname{xindy} not \appname{makeindex}.
%The indexing style file will been given a \filetype{.xdy} extension.
%
%The \pkgopt{xindy} package option may additionally have a 
%value that is a \meta{key}=\meta{value} comma-separated list to override 
%the language and codepage. For example:
%\begin{verbatim}
%\usepackage[xindy={language=english,codepage=utf8}]{glossaries}
%\end{verbatim}
%You can also specify whether you want a number group in 
%the glossary. This defaults to true, but can be suppressed. For
%example:
%\begin{verbatim}
%\usepackage[xindy={glsnumbers=false}]{glossaries}
%\end{verbatim}
%See \autoref{sec:xindy} for further details on using \appname{xindy} with the 
%\sty{glossaries} package.
%
%\item[\pkgopt{order}] This may take two values: 
%\pkgoptval{word}{order} or \pkgoptval{letter}{order}. The default
%is word ordering. Note that this option has no effect if you
%don't use \appname{makeglossaries}.
%
%\end{description}
%\subsection{Defining Glossary Entries}
%\label{sec:newglosentry}
%
%All glossary entries must be defined before they are used, so it
%is better to define them in the preamble to ensure this.\footnote{The
%only preamble restriction on \cs{newglossaryentry} and \cs{newacronym}
%was removed in version 1.13, but the restriction remains for
%\cs{loadglsentries}.} However
%only those entries that occur in the document
%(using any of the commands described in \autoref{sec:glslink}, \autoref{sec:glsadd} or \autoref{sec:crossref}) will appear in the glossary. Each time an entry 
%is used in this way, a line is added to an associated glossary file
%(\filetype{.glo}), which then needs to be converted into a
%corresponding \filetype{.gls} file which contains the typeset
%glossary which is input by \ics{printglossary} or
%\ics{printglossaries}.  The Perl script \appname{makeglossaries} can
%be used to call \appname{makeindex} or \appname{xindy}, using a
%customised indexing style file, for each of the glossaries that are
%defined in the document.  Note that there should be no need for you
%to explicitly edit or input any of these external files.  See
%\autoref{sec:makeglossaries} 
%for further details.
%
%\DescribeMacro{\makeglossaries}
%The command \cs{makeglossaries} must be placed in the preamble in
%order to create the customised \appname{makeindex} (\filetype{.ist})
%or \appname{xindy} (\filetype{.xdy})
%style file and to ensure that glossary entries are written to the
%appropriate output files. If you omit \cs{makeglossaries} none of the
%glossaries will be created.
%
%\begin{important}
%Note that some of the commands provided by the \sty{glossaries}
%package must be placed before \cs{makeglossaries} as they are
%required when creating the customised style file. If you attempt
%to use those commands after \cs{makeglossaries} you will generate
%an error.
%\end{important}
%
%\DescribeMacro{\noist}
%You can suppress the creation of the customised \appname{xindy}
%or \appname{makeindex} style file using \cs{noist}. Note that this
%command must be used before \cs{makeglossaries}.
%
%The default name for the customised style file is given by
%\ics{jobname}\filetype{.ist} (for \appname{makeindex}) or 
%\ics{jobname}\filetype{.xdy} (for \appname{xindy}). This name may be
%changed using:\\[10pt]
%\DescribeMacro{\setStyleFile}
%\cs{setStyleFile}\marg{name}\\[10pt]
%where \meta{name} is the name of the style file without the 
%extension. Note that this command must be used before
%\cs{makeglossaries}.
%
%Each glossary entry is assigned a \term{number list} that lists all 
%the locations in the document where that entry was used. By default,
%the location refers to the page number but this may be overridden
%using the \pkgopt{counter} package option. The default form of
%the location number assumes a full stop compositor (e.g.\ 1.2),
%but if your location numbers use a different compositor (e.g. 1-2)
%you need to set this using\\[10pt]
%\DescribeMacro{\glsSetCompositor}\cs{glsSetCompositor}\marg{symbol}\\[10pt]
%For example:
%\begin{verbatim}
%\glsSetCompositor{-}
%\end{verbatim}
%Note that this command must be used before \cs{makeglossaries}.
%
%If you use \appname{xindy}, you can have a different compositor
%for page numbers starting with an uppercase alphabetical 
%character using:\\[10pt]
%\DescribeMacro{\glsSetAlphaCompositor}\cs{glsSetAlphaCompositor}\marg{symbol}\\[10pt]
%Note that this command has no effect if you haven't used the
%\pkgopt{xindy} package option. For example, if you want 
%number lists\iterm{number list} containing a mixture of A-1 and 2.3 
%style formats, then do:
%\begin{verbatim}
%\glsSetCompositor{.}
%\glsSetAlphaCompositor{-}
%\end{verbatim}
%See \autoref{sec:numberlists} for 
%further information about number lists\iterm{number list}.
%
%\DescribeMacro{\newglossaryentry}
%New glossary entries are defined using the command:\\[10pt]
%\cs{newglossaryentry}\marg{label}\marg{key-val list}\\[10pt] The first
%argument, \meta{label}, must be a unique label with which to identify
%this entry. The second argument, \meta{key-val list}, is a
%\meta{key}=\meta{value} list that supplies the relevant information
%about this entry. There are two required fields: \gloskey{name} and
%\gloskey{description}, except for sub-entries where the
%\gloskey{name} field may be omitted. Available fields are listed 
%below:
%
%\begin{description}
%\item[{\gloskey{name}}] The name of the entry (as it will appear in 
%the glossary). If this key is omitted and the \gloskey{parent}
%key is supplied, this value will be the same as the parent's name.
%
%\item[{\gloskey{description}}] A brief description of this term (to
%appear in the glossary). Within this value, you can use 
%\DescribeMacro{\nopostdesc}\cs{nopostdesc} to suppress the
%description terminator for this entry. For example, if this
%entry is a parent entry that doesn't require a description, you
%can do \verb|description={\nopostdesc}|. If you want a paragraph
%break in the description use \DescribeMacro{\glspar}\cs{glspar}.
%However, note that not all glossary styles support multi-line
%descriptions. If you are using one of the tabular-like glossary
%styles that permit multi-line descriptions, use \ics{newline}
%not \verb"\\" if you want to force a line break.
%
%\item[{\gloskey{parent}}] The label of the parent entry. Note that
%the parent entry must be defined before its sub-entries.
%See \autoref{sec:subentries} for further details.
%
%\item[{\gloskey{descriptionplural}}] The plural form of the 
%description (as passed to \ics{glsdisplay} and \ics{glsdisplayfirst}
%by \ics{glspl}, \ics{Glspl} and \ics{GLSpl}). If omitted, the value
%is set to the same as the \gloskey{description} key.
%
%\item[{\gloskey{text}}] How this entry will appear in the document text
%when using \ics{gls} (or one of its uppercase variants). If this
%field is omitted, the value of the \gloskey{name} key is used.
%
%\item[{\gloskey{first}}] How the entry will appear in the document text
%the first time it is used with \ics{gls}\ifirstusetext\ (or one of its uppercase
%variants). If this field is omitted, the value of the \gloskey{text}
%key is used.
%
%\item[{\gloskey{plural}}] How the entry will appear in the document text
%when using \ics{glspl} (or one of its uppercase variants).
%If this field is omitted, the value is obtained by appending 
%\ics{glspluralsuffix} to the value of the \gloskey{text} field.
%The default value of \cs{glspluralsuffix} is the letter
%\dq{s}.
%
%\item[{\gloskey{firstplural}}] How the entry will appear in the
%document text the first time it is used with \ics{glspl}\ifirstusetext\ (or one of its
%uppercase variants). If this field is omitted, the value is obtained
%from the \gloskey{plural} key, if the \gloskey{first} key is omitted,
%or by appending \ics{glspluralsuffix} to the value of the
%\gloskey{first} field, if the \gloskey{first} field is present.
%
%\textbf{Note:} prior to version 1.13, the default value of 
%\gloskey{firstplural} was always taken by appending \dq{s} to the
%\gloskey{first} key, which meant that you had to specify both
%\gloskey{plural} and \gloskey{firstplural}, even if you hadn't
%used the \gloskey{first} key.
%
%\item[{\gloskey{symbol}}] This field is provided to allow the user to
%specify an associated symbol. If omitted, the value is set to 
%\cs{relax}. Note that not all glossary styles display the
%symbol.
%
%\item[{\gloskey{symbolplural}}] This is the plural form of the
%symbol (as passed to \ics{glsdisplay} and \ics{glsdisplayfirst}
%by \ics{glspl}, \ics{Glspl} and \ics{GLSpl}). If omitted, the value
%is set to the same as the \gloskey{symbol} key.
%
%\item[{\gloskey{sort}}] This value indicates how \appname{makeindex}
%or \appname{xindy} should sort this entry. If omitted, the value is 
%given by the \gloskey{name} field.
%
%\item[{\gloskey{type}}] This specifies the label of the glossary in 
%which this entry belongs. If omitted, the default glossary is 
%assumed.  The list of acronyms type is given by
%\ics{acronymtype} which will either be \texttt{main} or
%\texttt{acronym}, depending on whether the \pkgopt{acronym} package
%option was used.
%
%\item[{\gloskey{nonumberlist}}] Suppress the \term{number list} for
%this entry.
%
%\item[{\gloskey{see}}] Cross-reference another entry. Using the
%\gloskey{see} key will automatically add this entry to the
%glossary, but will not automatically add the cross-referenced entry.
%The referenced entry should be supplied as the value to this key.
%If you want to override the \dq{see} tag, you can supply the new
%tag in square brackets before the label. For example
%\verb|see=[see also]{anotherlabel}|. For further details,
%see \autoref{sec:crossref}.
%\end{description}
%Note that if the name starts with an accented letter or non-Latin
%character, you must group the accented letter, otherwise it will 
%cause a problem for commands like \cs{Gls} and \cs{Glspl}. 
%For example:
%\begin{verbatim}
%\newglossaryentry{elite}{name={{\'e}lite},
%description={select group or class}}
%\end{verbatim}
%Note that the same applies if you are using the \isty{inputenc}
%package:
%\begin{verbatim}
%\newglossaryentry{elite}{name={{é}lite},
%description={select group or class}}
%\end{verbatim}
%Note that in both of the above examples, you will also need to
%supply the \gloskey{sort} key if you are using \appname{makeindex}
%whereas \appname{xindy} is usually able to sort accented letters
%correctly.
%
%
%
%\subsubsection{Plurals}
%You may have noticed from above that you can specify the plural form
%when you define a term. If you omit this, the plural will be 
%obtained by appending 
%\DescribeMacro{\glspluralsuffix}\cs{glspluralsuffix} to 
%the singular form. This command defaults to the letter \dq{s}. 
%For example:
%\begin{verbatim}
%\newglossaryentry{cow}{name=cow,description={a fully grown
%female of any bovine animal}}
%\end{verbatim}
%defines a new entry whose singular form is \dq{cow} and plural form
%is \dq{cows}. However, if you are writing in archaic English, you
%may want to use \dq{kine} as the plural form, in which case you
%would have to do:
%\begin{verbatim}
%\newglossaryentry{cow}{name=cow,plural=kine,
%description={a fully grown female of any bovine animal}}
%\end{verbatim}
%
%If you are writing in a language that supports
%multiple plurals (for a given term) then use the \gloskey{plural} key
%for one of them (typically the one you are most likely to use) and
%for the others you will need to explicitly write the plural form using
%\ics{glslink} or \ics{glsdisp} rather than using \cs{glspl}. Returning to the cow 
%example above, suppose you will mostly be using \dq{cows} as the
%plural, but occasionally you want to use \dq{kine} as the plural,
%then define the term as
%\begin{verbatim}
%\newglossaryentry{cow}{name=cow,description={a fully grown
%female of any bovine animal (plural cows, archaic plural kine)}}
%\end{verbatim}
%and use \verb|\glspl{cow}| to produce \dq{cows} and use
%\verb|\glslink{cow}{kine}| to produce \dq{kine}.
%
%If you are using a language that usually forms plurals
%by appending a different letter, or sequence of letters, you can
%redefine \cs{glspluralsuffix} as required. However, this must be
%done \emph{before} the entries are defined. For languages that don't
%form plurals by simply appending a suffix, all the plural forms must be 
%specified using the \gloskey{plural} key (and the \gloskey{firstplural}
%key where necessary). 
%
%
%\subsubsection{Sub-Entries}
%\label{sec:subentries}
%
%As from version 1.17, it is possible to specify sub-entries. These
%may be used to order the glossary into categories, in which case
%the sub-entry will have a different name to its parent entry, or
%it may be used to distinguish different definitions for the same
%word, in which case the sub-entries will have the same name as
%the parent entry. Note that not all glossary styles support
%hierarchical entries and may display all the entries in a flat
%format. Of the styles that support sub-entries, some display the
%sub-entry's name whilst others don't. Therefore you need to
%ensure that you use a suitable style. See \autoref{sec:styles} for a list of predefined 
%styles.
%
%Note that the parent entry will automatically be added to the
%glossary if any of its child entries are used in the document.
%If the parent entry is not referenced in the document, it will not
%have a \term{number list}.
%
%\paragraph{Hierarchical Categories} To arrange a glossary
%with hierarchical categories, you need to first define the
%category and then define the sub-entries using the relevant 
%category entry as the value of the \gloskey{parent} key. For
%example, suppose I want a glossary of mathematical symbols that
%are divided into Greek letters and Roman letters. Then I can
%define the categories as follows:
%\begin{verbatim}
%\newglossaryentry{greekletter}{name={Greek letters},
%description={\nopostdesc}}
%
%\newglossaryentry{romanletter}{name={Roman letters},
%description={\nopostdesc}}
%\end{verbatim}
%
%Note that in this example, the category entries don't need a
%description so I have set the descriptions to \ics{nopostdesc}.
%This gives a blank description and suppresses the
%description terminator.
%
%I can now define my sub-entries as follows:
%\begin{verbatim}
%\newglossaryentry{pi}{name={pi},
%description={ratio of the circumference of a circle to the diameter},
%parent=greekletter}
%
%\newglossaryentry{C}{name=C,
%description={Euler's constant},
%parent=romanletter}
%\end{verbatim}
%
%\paragraph{Homographs} Sub-entries that have the same name as
%the parent entry, don't need to have the \gloskey{name} key.
%For example, the word \dq{glossary} can mean a list of technical
%words or a collection of glosses. In both cases the plural is
%\dq{glossaries}. So first define the parent entry:
%\begin{verbatim}
%\newglossaryentry{glossary}{name=glossary,
%description={\nopostdesc},
%plural={glossaries}}
%\end{verbatim}
%Again, the parent entry has no description, so the description
%terminator needs to be suppressed using \ics{nopostdesc}.
%
%Now define the two different meanings of the word:
%\begin{verbatim}
%\newglossaryentry{glossarylist}{
%description={1) list of technical words},
%sort={1},
%parent={glossary}}
%
%\newglossaryentry{glossarycol}{
%description={2) collection of glosses},
%sort={2},
%parent={glossary}}
%\end{verbatim}
%Note that if I reference the parent entry, the location will be
%added to the parent's \term{number list}, whereas if I reference 
%any of the child entries, the location will be added to the child
%entry's number list.  Note also that since the sub-entries have the
%same name, the \gloskey{sort} key is required.
%
%In the above example, the plural form for both of the child entries
%is the same as the parent entry, so the \gloskey{plural} key was
%not required for the child entries. However, if the sub-entries
%have different plurals, they will need to be specified. For example:
%\begin{verbatim}
%\newglossaryentry{bravo}{name={bravo},
%description={\nopostdesc}}
%
%\newglossaryentry{bravocry}{description={1) cry of approval
%(pl.\ bravos)},
%sort={1},
%plural={bravos},
%parent=bravo}
%
%\newglossaryentry{bravoruffian}{description={2) hired ruffian or
%killer (pl.\ bravoes)},
%sort={2},
%plural={bravoes},
%parent=bravo}
%\end{verbatim}
%
%\subsubsection{Loading Entries From a File}
%\label{sec:loadglsentries}
%
%\DescribeMacro{\loadglsentries}
%You can store all your glossary entry definitions in another
%file and use:\\[10pt]
%\cs{loadglsentries}\oarg{type}\marg{filename}\\[10pt]
%where \meta{filename} is the name of the file containing all the
%\cs{newglossaryentry} commands. The optional argument
%\meta{type} is the name of the glossary to which those entries
%should belong, for those entries where the \gloskey{type} key has 
%been omitted (or, more specifically, for those entries whose
%type has been specified by \cs{glsdefaulttype}, which is what
%\cs{newglossaryentry} uses by default). For example, suppose I have
%a file called \texttt{myentries.tex} which contains:
%\begin{verbatim}
%\newglossaryentry{perl}{type=main,
%name={Perl},
%description={A scripting language}}
%
%\newglossaryentry{tex}{name={\TeX},
%description={A typesetting language},sort={TeX}}
%
%\newglossaryentry{html}{type=\glsdefaulttype,
%name={html},
%description={A mark up language}}
%\end{verbatim}
%and suppose in my document preamble I use the command:
%\begin{verbatim}
%\loadglsentries[languages]{myentries}
%\end{verbatim}
%then this will add the entries \texttt{tex} and \texttt{html}
%to the glossary whose type is given by \texttt{languages}, but
%the entry \texttt{perl} will be added to the main glossary, since
%it explicitly sets the type to \texttt{main}.
%
%\textbf{Note:} if you
%use \cs{newacronym} (see \autoref{sec:acronyms}) the type is set as \verb|type=\acronymtype| 
%unless you explicitly override it. For example, if my file
%\texttt{myacronyms.tex} contains:
%\begin{verbatim}
%\newacronym{aca}{aca}{a contrived acronym}
%\end{verbatim}
%then (supposing I have defined a new glossary type called
%\texttt{altacronym})
%\begin{verbatim}
%\loadglsentries[altacronym]{myacronyms}
%\end{verbatim}
%will add \texttt{aca} to the glossary type \texttt{acronym}, if the
%package option \pkgopt{acronym} has been specified, or will add
%\texttt{aca} to the glossary type \texttt{altacronym}, if the
%package option \pkgopt{acronym} is not specified.\footnote{This
%is because \cs{acronymtype} is set to \cs{glsdefaulttype} if
%the \pkgopt{acronym} package option is not used.} In this instance,
%it is better to change \texttt{myacronyms.tex} to:
%\begin{verbatim}
%\newacronym[type=\glsdefaulttype]{aca}{aca}{a contrived acronym}
%\end{verbatim}
%and now
%\begin{verbatim}
%\loadglsentries[altacronym]{myacronyms}
%\end{verbatim}
%will add \texttt{aca} to the glossary type \texttt{altacronym},
%regardless of whether or not the package option \pkgopt{acronym} is
%used.
%
%Note that only those entries that have been used
%in the text will appear in the relevant glossaries.
%Note also that \cs{loadglsentries} may only be used in the 
%preamble.
%\subsection{Number lists}
%\label{sec:numberlists}
%
%Each entry in the glossary has an associated \termdef{number list}. 
%By default,
%these numbers refer to the pages on which that entry has been used
%(using any of the commands described in \autoref{sec:glslink} and \autoref{sec:glsadd}). The number list can be suppressed using the \pkgopt{nonumberlist} package option, or an alternative counter
%can be set as the default using the \pkgopt{counter} package option.
%The number list is also referred to as the location 
%list\index{location list|see{number list}}.
%
%Both \appname{makeindex} and \appname{xindy} concatenate a
%sequence of 3 or more consecutive pages into a range. With 
%\appname{xindy} you can vary the minimum sequence length using
%\ics{GlsSetXdyMinRangeLength}\marg{n} where \meta{n} is either
%an integer or the keyword \texttt{none} which indicates that there
%should be no range formation.
%
%\begin{important}
%Note that \cs{GlsSetXdyMinRangeLength} must be used before
%\ics{makeglossaries} and has no effect if \ics{noist} is used.
%\end{important}
%
%With both \appname{makeindex} and \appname{xindy}, you can replace
%the separator and the closing number in the range using:\\[10pt]
%\DescribeMacro{\glsSetSuffixF}\cs{glsSetSuffixF}\marg{suffix}\\
%\DescribeMacro{\glsSetSuffixFF}\cs{glsSetSuffixFF}\marg{suffix}\\[10pt]
%where the former command specifies the suffix to use for a 2 page
%list and the latter specifies the suffix to use for longer lists.
%For example:
%\begin{verbatim}
%\glsSetSuffixF{f.}
%\glsSetSuffixFF{ff.}
%\end{verbatim}
%Note that if you use \appname{xindy}, you will also need to
%set the minimum range length to 1 if you want to change these
%suffixes:
%\begin{verbatim}
%\GlsSetXdyMinRangeLength{1}
%\end{verbatim}
%Note that if you use the \isty{hyperref} package, you will need
%to use \ics{nohyperpage} in the suffix to ensure that the hyperlinks
%work correctly. For example:
%\begin{verbatim}
%\glsSetSuffixF{\nohyperpage{f.}}
%\glsSetSuffixFF{\nohyperpage{ff.}}
%\end{verbatim}
%
%\begin{important}
%Note that \cs{glsSetSuffixF} and \cs{glsSetSuffixFF} must be used 
%before \ics{makeglossaries} and have no effect if \ics{noist} is 
%used.
%\end{important}
%
%
%\subsection{Links to Glossary Entries}
%\label{sec:glslink}
%
%Once you have defined a glossary entry using 
%\ics{newglossaryentry}, you can refer to that entry in the
%document using one of the commands listed in this section. The
%text which appears at that point in the document when using 
%one of these commands is referred to as the 
%\termdef{link text} (even if there are no hyperlinks). The commands
%in this section also add a line to an external file that is used
%by \appname{makeindex} or \appname{xindy} to generate the relevant 
%entry in the glossary. This information includes an
%associated location that is added to the \term{number list} for that
%entry. By default, the location refers to the page number. For
%further information on number lists, see \autoref{sec:numberlists}.
%
%\begin{important}
%It is strongly recommended that you don't use the commands
%defined in this section in the arguments of sectioning or caption
%commands.
%\end{important}
%
%The above warning is particularly important if you are using the
%\sty{glossaries} package in conjunction with the \isty{hyperref} package.
%Instead, use one of the commands listed in 
%\autoref{sec:glsnolink} (such as \cs{glsentrytext}) or provide an alternative via
%the optional argument to the sectioning/caption command.
%Examples:
%\begin{verbatim}
%\section{An overview of \glsentrytext{perl}}
%\section[An overview of Perl]{An overview of \gls{perl}}
%\end{verbatim}
%
%The way the \term{link text} is displayed 
%depends on \DescribeMacro{\glstextformat}\cs{glstextformat}\marg{text}.
%For example, to make all \term{link text} appear in a sans-serif
%font, do:
%\begin{verbatim}
%\renewcommand*{\glstextformat}[1]{\textsf{#1}}
%\end{verbatim}
%
%Each entry has an associated conditional referred to as the
%\firstuseflag. This determines whether \ics{gls}, 
%\ics{glspl} (and their uppercase variants) should use the
%value of the \gloskey{first} or \gloskey{text} keys. Note that an 
%entry can be used without affecting the \firstuseflag\ (for example,
%when used with \cs{glslink}). See \autoref{sec:glsunset} for commands that unset or reset this conditional.
%
%\DescribeMacro{\glslink}
%The command:\\[10pt]
%\cs{glslink}\oarg{options}\marg{label}\marg{text}\\[10pt]
%will place \cs{glstextformat}\marg{text} in the document at that
%point and add a line into the associated glossary file for the
%glossary entry given by \meta{label}. If hyperlinks are supported,
%\meta{text} will be a hyperlink to the relevant line in the
%glossary. The optional argument \meta{options} must be a
%\meta{key}=\meta{value} list which can take any of the following
%keys:
%
%\begin{description}
%\item[{\gloskey[glslink]{format}}] This specifies how to format the
%associated location number for this entry in the glossary. This 
%value is equivalent to the \appname{makeindex} encap value, and (as
%with \cs{index}) the value needs to be the name of a command
%\emph{without} the initial backslash. As with \cs{index}, the
%characters \verb"(" and \verb")" can also be used to specify the
%beginning and ending of a number range.  Again as with \cs{index},
%the command should be the name of a command which takes an argument
%(which will be the associated location).  Be careful not to use a
%declaration (such as \texttt{bfseries}) instead of a text block command
%(such as \texttt{textbf}) as the effect is not guaranteed to be
%localised. If you want to apply more than one style to a given entry
%(e.g.\ \textbf{bold} and \emph{italic}) you will need to create a
%command that applies both formats, e.g.\ 
%\begin{verbatim}
%\newcommand*{\textbfem}[1]{\textbf{\emph{#1}}}
%\end{verbatim}
%and use that command.
%
%In this document, the standard formats refer to the standard text 
%block commands such as \ics{textbf} or \ics{emph} or any of the 
%commands listed in \tableref{tab:hyperxx}.
%
%\begin{important}
%If you use \appname{xindy} instead of \appname{makeindex}, you
%must specify any non-standard formats that you want to use
%with the \gloskey[glslink]{format} key using
%\ics{GlsAddXdyAttribute}\marg{name}. So if you use
%\appname{xindy} with the above example, you would need to add:
%\begin{verbatim}
%\GlsAddXdyAttribute{textbfem}
%\end{verbatim}
%\end{important}
%
%Note that unlike \cs{index}, you can't have
%anything following the command name, such as an asterisk or
%arguments. If you want to cross-reference another entry, either
%use the \gloskey{see} key when you define the entry or use
%\ics{glssee} (described in \autoref{sec:crossref}).
%
%If you are using hyperlinks and you want to change the font of the
%hyperlinked location, don't use \ics{hyperpage} (provided by the
%\isty{hyperref} package) as the locations may not refer to a page
%number.  Instead, the \sty{glossaries} package provides number
%formats listed in \tableref{tab:hyperxx}.
%
%\begin{table}[htbp]
%\caption{Predefined Hyperlinked Location Formats}
%\label{tab:hyperxx}
%\centering
%\vskip\baselineskip
%\begin{tabular}{ll}
%\locfmt{hyperrm} & serif hyperlink\\
%\locfmt{hypersf} & sans-serif hyperlink\\
%\locfmt{hypertt} & monospaced hyperlink\\
%\locfmt{hyperbf} & bold hyperlink\\
%\locfmt{hypermd} & medium weight hyperlink\\
%\locfmt{hyperit} & italic hyperlink\\
%\locfmt{hypersl} & slanted hyperlink\\
%\locfmt{hyperup} & upright hyperlink\\
%\locfmt{hypersc} & small caps hyperlink\\
%\locfmt{hyperemph} & emphasized hyperlink
%\end{tabular}
%\par
%\end{table}
%
%Note that if the \ics{hyperlink} command hasn't been defined,
%the \texttt{hyper}\meta{xx} formats are equivalent to the
%analogous \texttt{text}\meta{xx} font commands (and \texttt{hyperemph}
%is equivalent to \texttt{emph}). If you want to
%make a new format, you will need to define a command which takes
%one argument and use that; for example, if you want the location
%number to be in a bold sans-serif font, you can define a
%command called, say, \cs{hyperbsf}:
%\begin{verbatim}
%\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}}
%\end{verbatim}
%and then use \texttt{hyperbsf} as the value for the \gloskey{format}
%key.  (See also \autoref{sec:code:printglos}.) Remember that if you use \appname{xindy}, you will need to add
%this to the list of location attributes:
%\begin{verbatim}
%\GlsAddXdyAttribute{hyperbsf}
%\end{verbatim}
%
%\item[{\gloskey[glslink]{counter}}] This specifies which counter
%to use for this location. This overrides the default counter
%used by this entry. (See also
%\autoref{sec:numberlists}.)
%\item[{\gloskey[glslink]{hyper}}] This is a boolean key which can
%be used to enable/disable the hyperlink to the relevant entry
%in the glossary. (Note that setting \texttt{hyper=true} will have no
%effect if \cs{hyperlink} has not been defined.) The default
%value is \texttt{hyper=true}.
%
%\end{description}
%\DescribeMacro{\glslink*}
%There is also a starred version:\\[10pt]
%\cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt]
%which is equivalent to \cs{glslink}, except it sets
%\texttt{hyper=false}.
%
%\DescribeMacro{\gls}
%The command:\\[10pt]
%\cs{gls}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is the same as \cs{glslink}, except that the \term{link text}
%is determined from the values of the \gloskey{text} and 
%\gloskey{first} keys supplied when the entry was defined using
%\ics{newglossaryentry}. If the entry has been marked as having
%been used\ifirstuseflag, the value of the \gloskey{text} key will be used, otherwise
%the value of the \gloskey{first} key will be used. 
%On completion, \cs{gls} will mark the entry's first use flag\ifirstuseflag\ as
%used.
%
%There are two uppercase variants:\\[10pt]
%\DescribeMacro{\Gls}
%\cs{Gls}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%and\\[10pt]
%\DescribeMacro{\GLS}
%\cs{GLS}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%which make the first letter of the link text or all the link text
%uppercase, respectively.
%
%The final optional argument \meta{insert}, allows you to insert
%some additional text into the link text. By default, this will
%append \meta{insert} at the end of the link text, but this
%can be changed (see 
%\autoref{sec:glsdisplay}). 
%
%The first optional argument \meta{options} is the same as the optional
%argument to \ics{glslink}. As with \cs{glslink}, these commands also
%have a starred version that disable the hyperlink.
%
%There are also analogous plural forms:\\[10pt]
%\DescribeMacro{\glspl}
%\cs{glspl}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%\DescribeMacro{\Glspl}
%\cs{Glspl}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSpl}
%\cs{GLSpl}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%These determine the link text from the \gloskey{plural} and
%\gloskey{firstplural} keys supplied when the entry was first
%defined. As before, these commands also have
%a starred version that disable the hyperlink.
%
%Note that \cs{glslink} doesn't use or affect the \firstuseflag,
%nor does it use \ics{glsdisplay} or \ics{glsdisplayfirst} (see 
%\autoref{sec:glsdisplay}). Instead, you can use:\\[10pt]
%\DescribeMacro{glsdisp}
%\cs{glsdisp}\oarg{options}\marg{label}\marg{link text}\\[10pt]
%This behaves in the same way as \cs{gls}, except that it uses
%\meta{link text} instead of the value of the \gloskey{first}
%or \gloskey{text} key. (Note that this command always sets
%\meta{insert} to nothing.)
%
%\DescribeMacro{\glstext}The command:\\[10pt]
%\cs{glstext}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{gls} except that it always uses the value
%of the \gloskey{text} key and does not affect the 
%\firstuseflag. 
%Unlike \cs{gls}, the inserted text \meta{insert} 
%is always appended to the link text since \cs{glstext} doesn't
%use \ics{glsdisplay} or \ics{glsdisplayfirst}. (The same is 
%true for all the following commands described in this section.)
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glstext}
%\cs{Glstext}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLStext}
%\cs{GLStext}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsfirst}The command:\\[10pt]
%\cs{glsfirst}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{first} key. Again, \meta{insert} is always appended
%to the end of the link text and does not affect the 
%\firstuseflag.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsfirst}
%\cs{Glsfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSfirst}
%\cs{GLSfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsplural}The command:\\[10pt]
%\cs{glsplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{plural} key. Again, \meta{insert} is always appended
%to the end of the link text and does not mark the entry as having
%been used.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsplural}
%\cs{Glsplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSplural}
%\cs{GLSplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsfirstplural}The command:\\[10pt]
%\cs{glsfirstplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{firstplural} key. Again, \meta{insert} is always 
%appended to the end of the link text and does not mark the entry as
%having been used.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsfirstplural}
%\cs{Glsfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSfirstplural}
%\cs{GLSfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsname}The command:\\[10pt]
%\cs{glsname}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value of the
%\gloskey{name} key. Again, \meta{insert} is always appended to the end
%of the link text and does not mark the entry as having
%been used.  Note: if you want to use this command and the
%\gloskey{name} key contains commands, you will have to disable the
%\hyperlink{sanitize}{sanitization} of the \gloskey{name} key and protect fragile commands.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsname}
%\cs{Glsname}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSname}
%\cs{GLSname}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glssymbol}The command:\\[10pt]
%\cs{glssymbol}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value of the
%\gloskey{symbol} key. Again, \meta{insert} is always appended to the
%end of the link text and does not mark the entry as having
%been used.  Note: if you want to use this command and the
%\gloskey{symbol} key contains commands, you will have to disable the
%\hyperlink{sanitize}{sanitization} of the \gloskey{symbol} key and protect fragile commands.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glssymbol}
%\cs{Glssymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSsymbol}
%\cs{GLSsymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsdesc}The command:\\[10pt]
%\cs{glsdesc}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{description} key. Again, \meta{insert} is always
%appended to the end of the link text and does not mark the entry as 
%having been used.  Note: if you want to use this
%command and the \gloskey{description} key contains commands, you will
%have to disable the
%\hyperlink{sanitize}{sanitization} of the \gloskey{description} key and protect fragile commands.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsdesc}
%\cs{Glsdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSdesc}
%\cs{GLSdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%
%\subsubsection{Changing the format of the link text}
%\label{sec:glsdisplay}
%
%The format of the \term{link text} for \ics{gls}, \ics{glspl}
%and their uppercase variants is governed by two commands:
%\DescribeMacro{\glsdisplayfirst}\cs{glsdisplayfirst}, which is used the
%first time a glossary entry is used\ifirstuse\ in the text and
%\DescribeMacro{\glsdisplay}\cs{glsdisplay}, which is used subsequently.
%Both commands take four arguments: the first is either the singular or
%plural form given by the \gloskey{text}, \gloskey{plural},
%\gloskey{first} or \gloskey{firstplural} keys (set when the term was
%defined) depending on context; the second argument is the term's
%description (as supplied by the \gloskey{description} or
%\gloskey{descriptionplural} keys); the third
%argument is the symbol associated with the term (as supplied by the
%\gloskey{symbol} or \gloskey{symbolplural} keys) and the fourth argument is the additional text
%supplied in the final optional argument to \cs{gls} or
%\cs{glspl} (or their uppercase variants). The default definitions
%of \cs{glsdisplay} and \cs{glsdisplayfirst} simply
%print the first argument immediately followed by the fourth argument.
%The remaining arguments are ignored.
%
%If required, you can access the label for the given entry via
%\DescribeMacro{\glslabel}\ics{glslabel}, so it is possible to use
%this label in the definition of \cs{glsdisplay} or
%\cs{glsdisplayfirst} to supply additional information using any of
%the commands described in
%\autoref{sec:glsnolink}, if required. 
%
%Note that \cs{glsdisplay} and \cs{glsdisplayfirst} are not used
%by \ics{glslink}. If you want to supply your own link text, you
%need to use \ics{glsdisp} instead.
%
%For example, suppose you want a glossary of measurements and
%units, you can use the \gloskey{symbol} key to store the unit:
%\begin{verbatim}
%\newglossaryentry{distance}{name=distance,
%description={The length between two points},
%symbol={km}}
%\end{verbatim}
%and now suppose you want \verb|\gls{distance}| to produce
%\dq{distance (km)} on \firstuse, then you can redefine
%\cs{glsdisplayfirst} as follows:
%\begin{verbatim}
%\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)}
%\end{verbatim}
%Note that the additional text is placed after \verb|#1|, so
%\verb|\gls{distance}['s]| will produce \dq{distance's (km)}
%rather than \dq{distance (km)'s} which looks a bit odd (even though
%it may be in the context of \dq{the distance (km) is measured between
%the two points} --- but in this instance it would be better not to
%use a contraction).
%
%Note also that all of the \term{link text} will be formatted according
%to \ics{glstextformat} (described earlier). So if you do, say:
%\begin{verbatim}
%\renewcommand{\glstextformat}[1]{\textbf{#1}}
%\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)}
%\end{verbatim}
%then \verb|\gls{distance}| will produce \dq{\textbf{distance (km)}}.
%
%If you have multiple glossaries, changing \cs{glsdisplayfirst} and
%\cs{glsdisplay} will change the way entries for all of the
%glossaries appear when using the commands \cs{gls}, \cs{glspl} and their
%uppercase variants.  If you only
%want the change to affect entries for a given glossary, then you need
%to use\\[10pt]
%\DescribeMacro{\defglsdisplay}\cs{defglsdisplay}\oarg{type}\marg{definition}\\[10pt]
%and\\[10pt]
%\DescribeMacro{\defglsdisplayfirst}\cs{defglsdisplayfirst}\oarg{type}\marg{definition}\\[10pt]
%instead of redefining \cs{glsdisplay} and \cs{glsdisplayfirst}.
%
%Both \cs{defglsdisplay} and \cs{defglsdisplayfirst} take two arguments:
%the first (which is optional) is the glossary's label\footnote{\texttt{main} for the main
%(default) glossary, \cs{acronymtype} for the list of acronyms, or the
%name supplied in the first mandatory argument to \cs{newglossary} for
%additional glossaries.} and the second is how the term should be
%displayed when it is invoked using commands \cs{gls}, 
%\cs{glspl} and their uppercase variants. This is similar to the way \cs{glsdisplayfirst} was
%redefined above.
%
%For example, suppose you have created a new glossary called
%\texttt{notation} and you want to change the way the entry is
%displayed on \firstuse\ so that it includes the symbol, you can
%do:
%\begin{verbatim}
%\defglsdisplayfirst[notation]{#1#4 (denoted #3)}
%\end{verbatim}
%Now suppose you have defined an entry as follows:
%\begin{verbatim}
%\newglossaryentry{set}{type=notation,
%name=set,
%description={A collection of objects},
%symbol={$S$}
%}
%\end{verbatim}
%The first time you reference this entry using \cs{gls} it
%will be displayed as: \dq{set (denoted $S$)} (similarly for \cs{glspl} and the uppercase variants).
%
%Remember that if you use the \gloskey{symbol} key, you need to use a
%glossary style that displays the symbol, as many of the styles ignore
%it. In addition, if you want either the description or symbol to appear
%in the \term{link text}, you will have to disable the
%\hyperlink{sanitize}{sanitization} of these keys and protect fragile commands.
%\subsubsection{Enabling and disabling hyperlinks to glossary entries}
%
%If you load the \isty{hyperref} or \isty{html} packages prior to
%loading the \sty{glossaries} package, commands such as \ics{glslink}
%and \ics{gls}, described above, will automatically have hyperlinks
%to the relevant glossary entry, unless the \gloskey[glslink]{hyper}
%option has been set to \texttt{false}. You can disable or enable links using:\\[10pt]
%\DescribeMacro{\glsdisablehyper}\cs{glsdisablehyper}\\[10pt]
%and\\[10pt]
%\DescribeMacro{\glsenablehyper}\cs{glsenablehyper}\\[10pt]
%respectively. The effect can be localised by placing the commands
%within a group. Note that you should only use \cs{glsenablehyper}
%if the commands \ics{hyperlink} and \ics{hypertarget} have been
%defined (for example, by the \isty{hyperref} package).
%\subsection{Adding an Entry to the Glossary Without Generating Text}
%\label{sec:glsadd}
%
%\DescribeMacro{\glsadd}
%It is possible to add a line in the glossary file without
%generating any text at that point in the document using:\\[10pt]
%\cs{glsadd}\oarg{options}\marg{label}\\[10pt]
%This is similar to \ics{glslink}, only it doesn't produce
%any text (so therefore, there is no \gloskey[glslink]{hyper} key
%available in \meta{options} but all the other options that can
%be used with \cs{glslink} can be passed to \cs{glsadd}).
%For example, to add a page range to the glossary number list for the
%entry whose label is given by \texttt{set}:
%\begin{verbatim}
%\glsadd[format=(]{set}
%Lots of text about sets spanning many pages.
%\glsadd[format=)]{set}
%\end{verbatim}
%
%\DescribeMacro{\glsaddall}
%To add all entries that have been defined, use:\\[10pt]
%\cs{glsaddall}\oarg{options}\\[10pt]
%The optional argument is the same as for \cs{glsadd}, except
%there is also a key \gloskey[glsaddall]{types} which can be
%used to specify which glossaries to use. This should be a
%comma separated list. For example, if you only want to add
%all the entries belonging to the list of acronyms (specified by
%the glossary type \cs{acronymtype}) and a list of
%notation (specified by the glossary type \texttt{notation}) then you can
%do:
%\begin{verbatim}
%\glsaddall[types={\acronymtype,notation}]
%\end{verbatim}
%
%\subsection{Cross-Referencing Entries}
%\label{sec:crossref}
%
%There are several ways of cross-referencing entries in the 
%glossary: 
%
%\begin{enumerate}
%\item You can use commands such as \ics{gls} in the
%entries description. For example:
%\begin{verbatim}
%\newglossaryentry{apple}{name=apple,
%description={firm, round fruit. See also \gls{pear}}}
%\end{verbatim}
%Note that with this method, if you don't use the 
%cross-referenced term in the glossary, you will need two runs of
%\appname{makeglossaries}:
%\begin{verbatim}
%latex filename
%makeglossaries filename
%latex filename
%makeglossaries filename
%latex filename
%\end{verbatim}
%
%\item As described in \autoref{sec:newglosentry}, 
%you can use the \gloskey{see} key when you define the entry. For
%example:
%\begin{verbatim}
%\newglossaryentry{MaclaurinSeries}{name={Maclaurin series},
%description={Series expansion},
%see={TaylorsTheorem}}
%\end{verbatim}
%Note that in this case, the entry with the \gloskey{see} key will
%automatically be added to the glossary, but the cross-referenced
%entry won't. You therefore need to ensure that you use the
%cross-referenced term with the commands described in 
%\autoref{sec:glslink} or \autoref{sec:glsadd}.
%
%
%You can optionally override the \dq{see} tag using square brackets
%at the start of the \gloskey{see} value. For example:
%\begin{verbatim}
%\newglossaryentry{MaclaurinSeries}{name={Maclaurin series},
%description={Series expansion},
%see=[see also]{TaylorsTheorem}}
%\end{verbatim}
%
%\item After you have defined the entry, use\\[10pt]
%\DescribeMacro{\glssee}\cs{glssee}\oarg{tag}\marg{label}\marg{xr label list}\\[10pt]
%where \meta{xr label list} is a comma-separated list of entry 
%labels to be cross-referenced, \meta{label} is the label of the
%entry doing the cross-referencing and \meta{tag} is the \dq{see} tag.
%For example:
%\begin{verbatim}
%\glssee[see also]{series}{FourierSeries,TaylorsTheorem}
%\end{verbatim}
%Note that this automatically adds the entry given by \meta{label} to
%the glossary but doesn't add the cross-referenced entries (specified
%by \meta{xr label list}) to the glossary.
%\end{enumerate}
%
%In both cases~2 and 3 above, the cross-referenced information appears
%in the \term{number list}, whereas in case~1, the cross-referenced 
%information appears in the description. In cases~2 and~3, the
%default text for the \dq{see} tag is given by \ics{seename}.
%
%\subsection{Using Glossary Terms Without Links}
%\label{sec:glsnolink}
%
%The commands described in this section display entry details without
%adding any information to the glossary. They don't use 
%\cs{glstextformat}, they don't have any optional arguments,
%they don't affect the \firstuseflag\ and, apart from \ics{glshyperlink}, they don't produce 
%hyperlinks.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentryname}\cs{glsentryname}\marg{label}\\
%\DescribeMacro{\Glsentryname}\cs{Glsentryname}\marg{label}\par\vskip10pt\noindent
%These commands display the name of the glossary entry given by
%\meta{label}, as specified by the \gloskey{name} key. 
%\cs{Glsentryname} makes the first letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentrytext}\cs{glsentrytext}\marg{label}\\
%\DescribeMacro{\Glsentrytext}\cs{Glsentrytext}\marg{label}\par\vskip10pt\noindent
%These commands display the subsequent use text for the glossary entry 
%given by \meta{label}, as specified by the \gloskey{text} key. 
%\cs{Glsentrytext} makes the first letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentryplural}\cs{glsentryplural}\marg{label}\\
%\DescribeMacro{\Glsentryplural}\cs{Glsentryplural}\marg{label}\par\vskip10pt\noindent
%These commands display the subsequent use plural text for the glossary 
%entry given by \meta{label}, as specified by the \gloskey{plural} key. 
%\cs{Glsentryplural} makes the first letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentryfirst}\cs{glsentryfirst}\marg{label}\\
%\DescribeMacro{\Glsentryfirst}\cs{Glsentryfirst}\marg{label}\par\vskip10pt\noindent
%These commands display the \firstusetext\ for the glossary entry 
%given by \meta{label}, as specified by the \gloskey{first} key. 
%\cs{Glsentryfirst} makes the first letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentryfirstplural}\cs{glsentryfirstplural}\marg{label}\\
%\DescribeMacro{\Glsentryfirstplural}\cs{Glsentryfirstplural}\marg{label}\par\vskip10pt\noindent
%These commands display the plural form of the \firstusetext\ for the 
%glossary entry given by \meta{label}, as specified by the 
%\gloskey{firstplural} key.  \cs{Glsentryfirstplural} makes the first 
%letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentrydesc}\cs{glsentrydesc}\marg{label}\\
%\DescribeMacro{\Glsentrydesc}\cs{Glsentrydesc}\marg{label}\par\vskip10pt\noindent
%These commands display the description for the glossary entry given by
%\meta{label}. \cs{Glsentrydesc} makes the first letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentrydescplural}\cs{glsentrydescplural}\marg{label}\\
%\DescribeMacro{\Glsentrydescplural}\cs{Glsentrydescplural}\marg{label}\par\vskip10pt\noindent
%These commands display the plural description for the glossary entry 
%given by \meta{label}. \cs{Glsentrydescplural} makes the first letter 
%uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentrysymbol}\cs{glsentrysymbol}\marg{label}\\
%\DescribeMacro{\Glsentrysymbol}\cs{Glsentrysymbol}\marg{label}\par\vskip10pt\noindent
%These commands display the symbol for the glossary entry given by
%\meta{label}. \cs{Glsentrysymbol} makes the first letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glsentrysymbolplural}\cs{glsentrysymbolplural}\marg{label}\\
%\DescribeMacro{\Glsentrysymbolplural}\cs{Glsentrysymbolplural}\marg{label}\par\vskip10pt\noindent
%These commands display the plural symbol for the glossary entry given by
%\meta{label}. \cs{Glsentrysymbolplural} makes the first letter uppercase.
%\par\vskip10pt\noindent
%\DescribeMacro{\glshyperlink}\cs{glshyperlink}\oarg{link text}\marg{label}\par\vskip10pt\noindent
%This command provides a hyperlink to the glossary entry given by
%\meta{label} \textbf{but does not add any information to the
%glossary file}. The link text is given by
%\ics{glsentryname}\marg{label} by default, but can be overridden
%using the optional argument.
%\begin{important}
%If you use \cs{glshyperlink}, you need to ensure that the relevant
%entry has been added to the glossary using any of the 
%commands described in \autoref{sec:glslink} or \autoref{sec:glsadd} otherwise you will end up with a broken
%link.
%\end{important}
%
%For further information see \autoref{sec:code:glsnolink}.
%
%\subsection{Displaying a glossary}
%\label{sec:printglossary}
%
%\DescribeMacro{\printglossaries}
%The command \cs{printglossaries} will display all the
%glossaries in the order in which they were defined. 
%Note that no glossaries will appear until
%you have either used the Perl script \appname{makeglossaries}
%or have directly used \appname{makeindex} or \appname{xindy} (as
%described in
%\autoref{sec:makeglossaries}). If the glossary 
%still does not appear after you re-\LaTeX\ your document, check the
%\appname{makeindex}/\appname{xindy} log files to see if there is a
%problem.  Remember that you also need to use the command
%\ics{makeglossaries} in the preamble to enable the glossaries.
%
%\DescribeMacro{\printglossary}
%An individual glossary can be displayed using:\\[10pt]
%\cs{printglossary}\oarg{options}\\[10pt]
%where \meta{options} is a \meta{key}=\meta{value} list of options. 
%The following keys are available:
%\begin{description}
%\item[{\gloskey[printglossary]{type}}] The value of this key
%specifies which glossary to print. If omitted, the default
%glossary is assumed. For example, to print the list of acronyms:
%\begin{verbatim}
%\printglossary[type=\acronymtype]
%\end{verbatim}
%
%\item[{\gloskey[printglossary]{title}}] This is the glossary's
%title (overriding the title specified when the glossary was 
%defined).
%
%\item[{\gloskey[printglossary]{toctitle}}] This is the title
%to use for the table of contents (if the \pkgopt{toc} package
%option has been used). If omitted, the glossary title is used.
%
%\item[{\gloskey[printglossary]{style}}] This specifies which
%glossary style to use for this glossary, overriding the effect
%of the \pkgopt{style} package option or \ics{glossarystyle}.
%
%\item[{\gloskey[printglossary]{numberedsection}}] This specifies
%whether to use a numbered section for this glossary, overriding
%the effect of the \pkgopt{numberedsection} package option. This
%key has the same syntax as the \pkgopt{numberedsection} package
%option, described in \autoref{sec:pkgopts}.
%\item[{\gloskey[printglossary]{nonumberlist}}] Unlike the package option
%of the same name, this key is a boolean key. If true (\verb|nonumberlist=true|) the numberlist
%is suppressed for this glossary. If false (\verb|nonumberlist=false|) the numberlist is
%displayed for this glossary. If no value is supplied, true is 
%assumed.
%
%\end{description}
%
%\DescribeMacro{\glossarypreamble}
%Information can be added to the start of the glossary (after the
%title and before the main body of the glossary) by redefining
%\cs{glossarypreamble}. For example:
%\begin{verbatim}
%\renewcommand{\glossarypreamble}{Numbers in italic indicate
%primary definitions.}
%\end{verbatim}
%This needs to be done before the glossary is displayed using
%\cs{printglossaries} or \cs{printglossary}. Note that if you
%want a different preamble for each glossary, you will need to
%use a separate \cs{printglossary} for each glossary and change
%the definition of \cs{glossarypreamble} between each glossary.
%For example:
%\begin{verbatim}
%\renewcommand{\glossarypreamble}{Numbers in italic indicate
%primary definitions.}
%\printglossary
%\renewcommand{\glossarypreamble}{}
%\printglossary[type=acronym]
%\end{verbatim}
%Alternatively, you can do something like:
%\begin{verbatim}
%\renewcommand{\glossarypreamble}{Numbers in italic indicate
%primary definitions.\gdef\glossarypreamble{}}
%\printglossaries
%\end{verbatim}
%which will print the preamble text for the first glossary and 
%change the preamble to do nothing for subsequent glossaries.
%(Note that \cs{gdef} is required as the glossary is placed within
%a group.)
%
%\DescribeMacro{\glossarypostamble}There is an analogous command
%called \cs{glossarypostamble} which is placed at the end of each
%glossary.
%\subsubsection{Changing the way the entry name appears in the glossary}
%\label{sec:glsnamefont}
%
%\DescribeMacro{\glsnamefont}Within each glossary, each entry name is
%formatted according to \cs{glsnamefont} which takes one argument:
%the entry name. This command is always used regardless of the
%glossary style.  By default, \cs{glsnamefont} simply displays its
%argument in whatever the surrounding font happens to be. This means
%that in the list-like glossary styles (defined in the
%\isty{glossary-list} style file) the name will appear in bold, since
%the name is placed in the optional argument of \cs{item}, whereas in
%the tabular styles (defined in the \isty{glossary-long} and
%\isty{glossary-super} style files) the name will appear in the
%normal font. The hierarchical glossary styles (defined in the
%\isty{glossary-tree} style file) also set the name in bold.
%
%For example, suppose you want all the entry names to appear in 
%medium weight small caps, then you can do:
%\begin{verbatim}
%\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}}
%\end{verbatim}
%
%\subsubsection{Xindy}
%\label{sec:xindy}
%
%If you want to use \appname{xindy} to sort the glossary, you
%must use the package option \pkgopt{xindy}:
%\begin{verbatim}
%\usepackage[xindy]{glossaries}
%\end{verbatim}
%This ensures that the glossary information is written in 
%\appname{xindy} syntax.
%
%Section~\ref{sec:makeglossaries} covers how to use the external
%indexing application. This section covers the commands provided
%by the \sty{glossaries} package that allow you to adjust the
%\appname{xindy} style file (\filetype{.xdy}) and parameters.
%
%To assist writing information to the \appname{xindy} style
%file, the \sty{glossaries} package provides the following
%commands:\\[10pt]
%\DescribeMacro{\glsopenbrace}\cs{glsopenbrace}\\
%\DescribeMacro{\glsclosebrace}\cs{glsclosebrace}\\[10pt]
%which produce an open and closing brace. (This is needed because
%\verb|\{| and \verb|\}| don't expand to a simple brace character
%when written to a file.)
%
%In addition, if you are using a package that makes the double
%quote character active (e.g. \isty{ngerman}) you can use:\\[10pt]
%\DescribeMacro{\glsquote}\cs{glsquote}\marg{text}\\[10pt]
%which will produce \verb|"|\meta{text}\verb|"|. Alternatively,
%you can use \verb|\string"| to write the double-quote character. 
%This document assumes that the double quote character has not been
%made active, so the examples just use \verb|"| for clarity.
%
%If you want greater control over the \appname{xindy} style file than
%is available through the \LaTeX\ commands provided by the
%\sty{glossaries} package, you will need to edit the \appname{xindy} 
%style file. In
%which case, you must use \ics{noist} to prevent the style file from
%being overwritten by the \sty{glossaries} package. For additional
%information about \appname{xindy}, read the \appname{xindy}
%documentation.
%\paragraph{Language and Encodings}
%When you use \appname{xindy}, you need to specify the language
%and encoding used (unless you have written your own custom
%\appname{xindy} style file that defines the relevant alphabet
%and sort rules). If you use \appname{makeglossaries},
%this information is obtained from the document's auxiliary 
%(\filetype{.aux}) file.  The \sty{glossaries} package attempts to 
%find the root language, but in the event that it gets it wrong or if 
%\appname{xindy} doesn't support that language, then you can
%specify the language using:\\[10pt]
%\DescribeMacro{\GlsSetXdyLanguage}
%\cs{GlsSetXdyLanguage}\oarg{glossary type}\marg{language}\\[10pt]
%where \meta{language} is the name of the language. The
%optional argument can be used if you have multiple glossaries
%in different languages. If \meta{glossary type} is omitted, it
%will be applied to all glossaries, otherwise the language
%setting will only be applied to the glossary given by
%\meta{glossary type}.
%
%If the \isty{inputenc} package is used, the encoding will be
%obtained from the value of \ics{inputencodingname}. 
%Alternatively, you can specify the encoding using:\\[10pt]
%\DescribeMacro{\GlsSetXdyCodePage}
%\cs{GlsSetXdyCodePage}\marg{code}\\[10pt]
%where \meta{code} is the name of the encoding. For example:
%\begin{verbatim}
%\GlsSetXdyCodePage{utf8}
%\end{verbatim}
%
%Note that you can also specify the language and encoding using
%the package option 
%\verb|xindy={language=|\meta{lang}\verb|,codepage=|\meta{code}\verb|}|.
%For example:
%\begin{verbatim}
%\usepackage[xindy={language=english,codepage=utf8}]{glossaries}
%\end{verbatim}
%
%If you write your own custom \appname{xindy} style file that 
%includes the language settings, you need to set the language
%to nothing:
%\begin{verbatim}
%\GlsSetXdyLanguage{}
%\end{verbatim}
%(and remember to use \ics{noist} to prevent the style file from
%being overwritten).
%
%\begin{important}
%The commands \cs{GlsSetXdyLanguage} and \cs{GlsSetXdyCodePage}
%have no effect if you don't use \appname{makeglossaries}. If
%you call \appname{xindy} without \appname{makeglossaries} you
%need to remember to set the language and encoding using the
%\texttt{-L} and \texttt{-C} switches.
%\end{important}
%
%\paragraph{Locations and Number lists}
%
%The most likely attributes used in the \gloskey[glslink]{format} 
%key (\locfmt{textrm}, \locfmt{hyperrm} etc) are automatically added 
%to the \appname{xindy} style file, but if you want to use another 
%attribute, you need to add it using:\\[10pt]
%\DescribeMacro{\GlsAddXdyAttribute}
%\cs{GlsAddXdyAttribute}\marg{name}\\[10pt]
%where \meta{name} is the name of the attribute, as used in
%the \gloskey[glslink]{format} key. For example, suppose I want a
%bold, italic, hyperlinked location. I first need to define a
%command that will do this:
%\begin{verbatim}
%\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}}
%\end{verbatim}
%but with \appname{xindy}, I also need to add this as an allowed
%attribute:
%\begin{verbatim}
%\GlsAddXdyAttribute{hyperbfit}
%\end{verbatim}
%
%\begin{important}
%Note that \cs{GlsAddXdyAttribute} has no effect if \ics{noist} is
%used or if \ics{makeglossaries} is omitted.
%
%\cs{GlsAddXdyAttribute} must be used before \ics{makeglossaries}.
%\end{important}
%
%If the location numbers don't get expanded to a simple Arabic or 
%Roman number or a letter from a, \ldots, z or A, \ldots, Z, then
%you need to add a location style in the appropriate format.
%
%For example, suppose you want the page numbers written as words
%rather than digits and you use the \isty{fmtcount} package to
%do this. You can redefine \ics{thepage} as follows:
%\begin{verbatim}
%\renewcommand*{\thepage}{\Numberstring{page}}
%\end{verbatim}
%This gets expanded to \verb|\protect \Numberstringnum |\marg{n}
%where \meta{n} is the Arabic page number. This means that you need to
%define a new location that has that form:
%\begin{verbatim}
%\GlsAddXdyLocation{Numberstring}{:sep "\string\protect\space
%  \string\Numberstringnum\space\glsopenbrace"
%  "arabic-numbers" :sep "\glsclosebrace"}
%\end{verbatim}
%Note that it's necessary to use \cs{space} to indicate that 
%spaces also appear in the format, since, unlike \TeX,
%\appname{xindy} doesn't ignore spaces after control sequences.
%
%\begin{important}
%Note that \cs{GlsAddXdyLocation} has no effect if \ics{noist} is
%used or if \ics{makeglossaries} is omitted.
%
%\cs{GlsAddXdyLocation} must be used before \ics{makeglossaries}.
%\end{important}
%
%In the \term{number list}, the locations are sorted according to 
%type. The default ordering is: 
%\texttt{roman-page-numbers} (e.g.\ i),
%\texttt{arabic-page-numbers} (e.g.\ 1),
%\texttt{arabic-section-numbers} (e.g.\ 1.1 if the compositor
%is a full stop or 1-1 if the compositor is a hyphen\footnote{see
%\ics{setCompositor} described in 
%\autoref{sec:newglosentry}}), 
%\texttt{alpha-page-numbers} (e.g.\ a),
%\texttt{Roman-page-numbers} (e.g.\ I),
%\texttt{Alpha-page-numbers} (e.g.\ A),
%\texttt{Appendix-page-numbers} (e.g.\ A.1 if the Alpha compositor
%is a full stop or A-1 if the Alpha compositor is a 
%hyphen\footnote{see \ics{setAlphaCompositor} described in 
%\autoref{sec:newglosentry}}),
%user defined location names (as specified by
%\ics{GlsAddXdyLocation} in the order in which they were defined),
%\texttt{see} (cross-referenced entries).
%This ordering can be changed using:\\[10pt]
%\DescribeMacro{\GlsSetXdyLocationClassOrder}
%\cs{GlsSetXdyLocationClassOrder}\marg{location names}\\[10pt]
%where each location name is delimited by double quote marks and
%separated by white space.
%For example:
%\begin{verbatim}
%\GlsSetXdyLocationClassOrder{
%  "arabic-page-numbers"
%  "arabic-section-numbers"
%  "roman-page-numbers"
%  "Roman-page-numbers"
%  "alpha-page-numbers"
%  "Alpha-page-numbers"
%  "Appendix-page-numbers"
%  "see"
%}
%\end{verbatim}
%
%\begin{important}
%Note that \cs{GlsSetXdyLocationClassOrder} has no effect if 
%\ics{noist} is used or if \ics{makeglossaries} is omitted.
%
%\cs{GlsSetXdyLocationClassOrder} must be used before 
%\ics{makeglossaries}.
%\end{important}
%
%If a \term{number list} consists of a sequence of consecutive 
%numbers, the range will be concatenated. The 
%number of consecutive locations that causes a range formation 
%defaults to 2, but can be changed using:\\[10pt]
%\DescribeMacro{\GlsSetXdyMinRangeLength}
%\cs{GlsSetXdyMinRangeLength}\marg{n}\\[10pt]
%For example:
%\begin{verbatim}
%\GlsSetXdyMinRangeLength{3}
%\end{verbatim}
%The argument may also be the keyword \texttt{none}, to indicate that
%there should be no range formations. See the \appname{xindy}
%manual for further details on range formations.
%
%\begin{important}
%Note that \cs{GlsSetXdyMinRangeLength} has no effect if \ics{noist}
%is used or if \ics{makeglossaries} is omitted.
%
%\cs{GlsSetXdyMinRangeLength} must be used before 
%\ics{makeglossaries}.
%\end{important}
%
%See \autoref{sec:numberlists} for further details.
%
%\paragraph{Glossary Groups}
%The glossary is divided into groups according to the first
%letter of the sort key. The \sty{glossaries} package also adds
%a number group by default, unless you suppress it in the
%\pkgopt{xindy} package option. For example:
%\begin{verbatim}
%\usepackage[xindy={glsnumbers=false}]{glossaries}
%\end{verbatim}
%Any entry that doesn't go in one of the letter groups or the
%number group is placed in the default group.
%
%If you have a number group, the default behaviour is to locate
%it before the \dq{A} letter group. If you are not using a
%Roman alphabet, you can change this using\\[10pt]
%\cs{GlsSetXdyFirstLetterAfterDigits}\marg{letter}
%
%\begin{important}
%Note that \cs{GlsSetXdyFirstLetterAfterDigits} has no effect if 
%\ics{noist} is used or if \ics{makeglossaries} is omitted.
%
%\cs{GlsSetXdyFirstLetterAfterDigits} must be used before 
%\ics{makeglossaries}.
%\end{important}
%
%\subsection{Defining New Glossaries}
%\label{sec:newglossary}
%
%\DescribeMacro{\newglossary}
%A new glossary can be defined using:\\[10pt]
%\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}\marg{title}\oarg{counter}\\[10pt]
%where \meta{name} is the label to assign to this glossary. The arguments
%\meta{in-ext} and \meta{out-ext} specify the extensions to give to the
%input and output files for that glossary, \meta{title} is the default
%title for this new glossary and the final optional argument
%\meta{counter} specifies which counter to use for the associated number
%lists\iterm{number list} (see also \autoref{sec:numberlists}). The first optional argument specifies the extension for the
%\appname{makeindex} or \appname{xindy} transcript file (this 
%information is only used by \appname{makeglossaries} which picks up 
%the information from the auxiliary file).
%
%Note that the main (default) glossary is automatically created as:
%\begin{verbatim}
%\newglossary{main}{gls}{glo}{\glossaryname}
%\end{verbatim}
%so it can be identified by the label \texttt{main}. Using the
%\pkgopt{acronym} package option is equivalent to:
%\begin{verbatim}
%\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
%\end{verbatim}
%so it can be identified by the label \texttt{acronym}. If you are
%not sure whether the \pkgopt{acronym} option has been used, you
%can identify the list of acronyms by the command 
%\DescribeMacro{\acronymtype}\cs{acronymtype} which is set to
%\texttt{acronym}, if the \pkgopt{acronym} option has been used,
%otherwise it is set to \texttt{main}.
%
%\begin{important}
%All glossaries must be defined before \ics{makeglossaries} to 
%ensure that the relevant output files are opened.
%\end{important}
%
%\subsection{Acronyms}
%\label{sec:acronyms}
%
%\DescribeMacro{\newacronym}
%You may have noticed in \autoref{sec:newglosentry} that when you specify a new entry, you can specify alternate text to use when
%the term is first used\ifirstuse\ in the document. This provides a useful
%means to define acronyms. For convenience, the \sty{glossaries} package
%defines the command:\\[10pt]
%\cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrv}\marg{long}\\[10pt]
%By default, this is equivalent to:\vskip5pt
%\begin{ttfamily}\par\noindent
%\cs{newglossaryentry}\textrm{\marg{label}}\{type=\ics{acronymtype},\\
%name=\textrm{\marg{abbrv}},\\
%description=\textrm{\marg{long}},\\
%text=\textrm{\marg{abbrv}},\\
%first=\{\textrm{\meta{long}} (\textrm{\meta{abbrv}})\},\\
%plural=\{\textrm{\meta{abbrv}}\cs{glspluralsuffix}\},\\
%firstplural=\{\textrm{\meta{long}}\cs{glspluralsuffix}\cs{space}
%(\textrm{\meta{abbrv}}\cs{glspluralsuffix})\},\\
%\textrm{\meta{key-val list}}\}\par
%\end{ttfamily}
%\vskip5pt
%As mentioned in the previous section, the command \ics{acronymtype}
%is the name of the glossary in which the acronyms should appear. If
%the \pkgopt{acronym} package option has been used, this will be
%\texttt{acronym}, otherwise it will be \texttt{main}. The acronyms
%can then be used in exactly the same way as any other glossary
%entry.
%
%\begin{important}%
%\textbf{Note:} since \cs{newacronym} sets \verb|type=\acronymtype|,
%if you want to load a file containing acronym definitions using
%\cs{loadglsentries}\oarg{type}\marg{filename}, the optional argument 
%\meta{type} will not have an effect unless you explicitly set the
%type as \verb|type=\glsdefaulttype| in the optional argument to
%\ics{newacronym}. See \autoref{sec:loadglsentries}.\end{important}
%
%For example, the following defines the acronym IDN:
%\begin{verbatim}
%\newacronym{idn}{IDN}{identification number}
%\end{verbatim}
%This is equivalent to:
%\begin{verbatim}
%\newglossaryentry{idn}{type=\acronymtype,
%name={IDN},
%description={identification number},
%text={IDN},
%first={identification number (IDN)},
%plural={IDNs},
%firstplural={identification numbers (IDNs)}}
%\end{verbatim}
%so \verb|\gls{idn}| will produce \dq{identification number (IDN)} on
%\firstuse\ and \dq{IDN} on subsequent uses.
%
%This section describes acronyms that have been defined using
%\cs{newacronym}. If you prefer to define all your acronyms using
%\cs{newglossaryentry} explicitly, then you should skip this section
%and ignore the package options: \pkgopt{smallcaps}, \pkgopt{smaller},
%\pkgopt{description}, \pkgopt{dua} and \pkgopt{footnote}, as these 
%options change the definition of \ics{newacronym} for common acronym 
%formats as well as the way that the link text is displayed (see
%\autoref{sec:glsdisplay}). Likewise you should ignore the package option \pkgopt{shortcuts}
%and the new commands described in this section,
%such as \cs{acrshort}, as they vary according to the definition of
%\ics{newacronym}.
%
%If you use any of the package options \pkgopt{smallcaps}, 
%\pkgopt{smaller}, \pkgopt{description} or 
%\pkgopt{footnote}, the acronyms will be displayed in the document
%using:\\[10pt]
%\DescribeMacro{\acronymfont}\cs{acronymfont}\marg{text}\\[10pt]
%and\\[10pt]
%\DescribeMacro{\firstacronymfont}\cs{firstacronymfont}\marg{text}\\[10pt]
%where \cs{firstacronymfont} is applied on \firstuse\ and
%\cs{acronymfont} is applied on subsequent use. Note that if you
%don't use any of the above package options, changing the definition
%of \cs{acronymfont} or \cs{firstacronymfont} will have no effect. In
%this case, the recommended route is to use either the
%\pkgopt{smaller} or the \pkgopt{smallcaps} package option and
%redefine \cs{acronymfont} and \cs{firstacronymfont} as required.
%(The \pkgopt{smallcaps} option sets the default plural suffix in an
%upright font to cancel the effect of \cs{textsc}, whereas
%\pkgopt{smaller} sets the suffix in the surrounding font.)
%For example, if you want acronyms in a normal font on first use and
%emphasized on subsequent use, do:
%\begin{verbatim}
%\usepackage[smaller]{glossaries}
%\renewcommand*{\firstacronymfont}[1]{#1}
%\renewcommand*{\acronymfont}[1]{\emph{#1}}
%\end{verbatim}
%(Note that it is for this reason that the \isty{relsize} package
%is not automatically loaded when selecting the
%\pkgopt{smaller} package option.)
%
%\Tableref{tab:acronymsettings} lists the package options that govern
%the acronym styles and how the \ics{newglossaryentry} keys are used
%to store \meta{long} (the long form) and \meta{abbrv} (the short
%form). Note that the \pkgopt{smallcaps} option redefines
%\cs{acronymfont} so that it sets its argument using \cs{textsc} (so
%you should use lower case characters in \meta{abbrv}) and the
%\pkgopt{smaller} option redefines \cs{acronymfont} to use
%\cs{textsmaller},\footnote{you will need to load a package, such as
%\sty{relsize}, that defines \cs{textsmaller} if you use this
%option.}\ otherwise \cs{acronymfont} simply displays its argument in
%the surrounding font.
%
%\begin{table}[htbp]
%\caption{Package options governing \cs{newacronym} and how the 
%information is stored in the keys for \cs{newglossaryentry}}
%\label{tab:acronymsettings}
%\begin{center}
%\begin{tabular}{lllll}
%\bfseries Package Option &
%\gloskey{first} key &
%\gloskey{text} key &
%\gloskey{description} key &
%\gloskey{symbol} key\\
%\pkgopt{description},\pkgopt{footnote} &
%\meta{abbrv} &
%\meta{abbrv} &
%user supplied &
%\meta{long}\\
%\pkgopt{description},\pkgopt{dua} &
%\meta{long} &
%\meta{long} &
%user supplied &
%\meta{abbrv}\\
%\pkgopt{description} &
%\meta{long} &
%\meta{abbrv} &
%user supplied &
%\meta{abbrv}\\
%\pkgopt{footnote} &
%\meta{abbrv} &
%\meta{abbrv} &
%\meta{long} &
% \\
%\pkgopt{smallcaps} &
%\meta{long} &
%\meta{abbrv} &
%\meta{long} &
%\meta{abbrv}\\
%\pkgopt{smaller} &
%\meta{long} &
%\meta{abbrv} &
%\meta{long} &
%\meta{abbrv}\\
%\pkgopt{dua} &
%\meta{long} &
%\meta{long} &
%\meta{long} &
%\meta{abbrv}\\
%None of the above&
%\meta{long} (\meta{abbrv}) &
%\meta{abbrv} &
%\meta{long} &
%\end{tabular}
%\end{center}
%\end{table}
%
%In case you can't remember which key stores the long or short forms
%(or their plurals) the \sty{glossaries} package provides the 
%commands:
%\begin{itemize}
%\item\DescribeMacro{\glsshortkey}\cs{glsshortkey}
%The key used to store the short form.
%\item\DescribeMacro{\glsshortpluralkey}\cs{glsshortpluralkey}
%The key used to store the plural version of the short form.
%\item\DescribeMacro{\glslongkey}\cs{glslongkey}
%The key used to store the long form.
%\item\DescribeMacro{\glslongpluralkey}\cs{glslongpluralkey}
%The key used to store the plural version of the long form.
%\end{itemize}
%These can be used in the optional argument of \cs{newacronym}
%to override the defaults. For example:
%\begin{verbatim}
%\newacronym[\glslongpluralkey={diagonal matrices}]{dm}{DM}{diagonal 
%matrix}
%\end{verbatim}
%If the \firstuse\ uses the plural form, \verb|\glspl{dm}| will
%display: diagonal matrices (DMs).
%
%Each of the package options \pkgopt{smallcaps}, \pkgopt{smaller}, 
%\pkgopt{footnote}, \pkgopt{dua}
%and \pkgopt{description} use \ics{defglsdisplay} and 
%\ics{defglsdisplayfirst} (described in \autoref{sec:glsdisplay}) 
%to change the way the link text is displayed. This means that these
%package options only work for the glossary type given by
%\cs{acronymtype}. If you have multiple lists of acronyms, you
%will need to make the appropriate changes for each additional
%glossary type.
%
%\begin{description}
%\item[\pkgopt{description},\pkgopt{footnote}]\mbox{}\par When these two package options are used together, the \firstuse\ displays
%the entry as:\\[10pt]
%\cs{firstacronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long} 
%\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%where \meta{insert} indicates the text supplied in the final
%optional argument to \cs{gls}, \cs{glspl} or their uppercase 
%variants.
%
%In this case, the long form is stored in the \gloskey{symbol} key.
%This means that the long form will not be displayed in the list of
%acronyms unless you use a glossary style that displays the entry's
%symbol (for example, the \glostyle{index} style). Entries will 
%be sorted according to the short form.
%
%Note also that when these two package options are used (in the
%given order), the \sty{glossaries} package additionally implements the
%\pkgopt{sanitize} option using 
%\ipkgopt[description]{sanitize}\ipkgopt[symbol]{sanitize}\verb|sanitize={description=false,symbol=false}|, so 
%remember to protect fragile commands when defining acronyms.
%
%\item[\pkgopt{dua}]\mbox{}\par The \pkgopt{dua} package option always displays the expanded
%form and so may not be used with \pkgopt{footnote}, \pkgopt{smaller} or 
%\pkgopt{smallcaps}. Both \firstuse\ and subsequent use displays the
%entry in the form:\\[10pt]
%\meta{long}\meta{insert}\\[10pt]
%If the \pkgopt{description} package option is also used, the 
%\gloskey{name} key is set to the long form, otherwise the
%\gloskey{name} key is set to the short form and the
%\gloskey{description} key is set to the long form. In both
%cases the \gloskey{symbol} is set to the short form. Therefore,
%if you use the \pkgopt{description} package option and you want
%the short form to appear in the list of acronyms, you will need
%to use a glossary style that displays the entry's symbol (for 
%example, the \glostyle{index} style). Entries will be sorted
%according to the long form if the \pkgopt{description} option
%is used, otherwise they will be sorted according to the
%short form (unless overridden by the \gloskey{sort} key in 
%the optional argument of \ics{newacronym}).
%
%\item[\pkgopt{description}]\mbox{}\par This package option displays the entry on \firstuse\ as:\\[10pt]
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%Note that with this option, you need to specify the description
%using the \gloskey{description} key in the optional argument
%of \ics{newacronym}. When this option is used without 
%the \pkgopt{footnote} or \pkgopt{dua} options, the name field
%is specified as
%\DescribeMacro{\acrnameformat}\ics{acrnameformat}\marg{short}\marg{long}. This
%defaults to \ics{acronymfont}\marg{short}, which means that the
%long form will not appear in the list of acronyms by default.
%To change this, you need to redefine \ics{acrnameformat} as
%appropriate. For example, to display the long form followed
%by the short form in parentheses do:
%\begin{verbatim}
%\renewcommand*{\acrnameformat}[2]{#2 (\acronymfont{#1})}
%\end{verbatim}
%Note that even if you redefine \ics{acrnameformat}, the
%entries will be sorted according to the short form, unless you
%override this using the \gloskey{sort} key in the optional
%argument to \ics{newacronym}.
%
%\item[\pkgopt{footnote}]\mbox{}\par This package option displays the entry on \firstuse\ as:\\[10pt]
%\cs{firstacronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long}\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%Acronyms will be sorted according to the short form.
%
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[description]{sanitize}\verb|sanitize={description=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%Note that on \firstuse, it is the long form in the footnote that
%links to the relevant glossary entry (where hyperlinks are enabled),
%whereas on subsequent use, the acronym links to the relevant
%glossary entry. It is possible to change this to make the acronym
%on \firstuse\ have the hyperlink instead of the footnote, but 
%since the footnote marker will also be a hyperlink, you will
%have two hyperlinks in immediate succession. This can be
%ambiguous where the hyperlinks are coloured rather than boxed.
%The code required to change the \firstuse\ to make the
%acronym a hyperlink is as follows:
%\begin{verbatim}
% \defglsdisplayfirst[\acronymtype]{%
% \noexpand\protect\noexpand
%    \glslink[\@gls@link@opts]{\@gls@link@label}{\firstacronymfont{#1}#4}%
%    \noexpand\protect\noexpand\footnote{#2}}%
%\end{verbatim}
%\textbf{Note} that this involves using internal commands
%(i.e.\ commands whose name contains an \verb|@| character), so
%if this code is place in a \texttt{.tex} file it needs to be
%placed within a \cs{makeatletter} \ldots\ \cs{makeatother} pair.
%(See \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=atsigns} for further details.)
%
%\item[\pkgopt{smallcaps}]\mbox{}\par If neither the \pkgopt{footnote} nor \pkgopt{description} options
%have been set, this option displays the entry on \firstuse\ as:\\[10pt]
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%where \cs{acronymfont} is set to \verb|\textsc{#1}|.
%
%\begin{important}
%Note that since the acronym is displayed using \ics{textsc}, 
%the short form, \meta{abbrv}, should be specified in lower case.
%(Recall that "\textsc{abc}" produces \textsc{abc} whereas "\textsc{ABC}" produces \textsc{ABC}.)
%\end{important}
%
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%\item[\pkgopt{smaller}]\mbox{}\par If neither the \pkgopt{footnote} nor \pkgopt{description} options
%have been set, this option displays the entry on \firstuse\ as:\\[10pt]
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%where \cs{acronymfont} is set to 
%\verb|\textsmaller{#1}|.\footnote{not that this was change from 
%using \ics{smaller} to \ics{textsmaller} as declarations
%cause a problem for \ics{makefirstuc}.}
%The entries will be sorted according to the short form.
%
%\begin{important}
%Remember to load a package that defines \ics{textsmaller} (such as
%\isty{relsize}) if you want to use this option, unless you want
%to redefine \ics{acronymfont} to use some other formatting command.
%\end{important}
%
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%\item[None of the above]\mbox{}\par If none of the package options \pkgopt{smallcaps}, \pkgopt{smaller},
%\pkgopt{footnote}, \pkgopt{dua} or \pkgopt{description} are used, 
%then on \firstuse\ the entry is displayed as:\\[10pt]
%\meta{long} (\meta{abbrv})\meta{insert}\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\meta{abbrv}\meta{insert}\\[10pt]
%Entries will be sorted according to the short form.
%Note that if none of the acronym-related package options are used,
%the \pkgopt{sanitize} option will not be affected.
%\end{description}
%
%Recall from \autoref{sec:glslink} that you can access the values of individual keys using commands
%like \ics{glstext}, so it is possible to use these commands to
%print just the long form or just the abbreviation without affecting
%the flag that determines whether the entry has been used. However
%the keys that store the long and short form vary depending on
%the acronym style, so the \sty{glossaries} package provides
%commands that are set according to the package options. These are
%as follows:
%\vspace{10pt}\par\noindent
%\DescribeMacro{\acrshort}
%\cs{acrshort}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\Acrshort}
%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\ACRshort}
%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%Print the abbreviated version with (if required) a hyperlink to the
%relevant entry in the glossary. This is usually equivalent to
%\ics{glstext} (or its uppercase variants) but may additionally
%put the link text within the argument to \ics{acronymfont}.
%\vspace{10pt}\par\noindent
%\DescribeMacro{\acrlong}
%\cs{acrlong}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\Acrlong}
%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\ACRlong}
%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%Print the long version with (if required) a hyperlink to the
%relevant entry in the glossary. This is may be equivalent to
%\ics{glsdesc},  \ics{glssymbol} or \ics{glsfirst} (or their uppercase 
%variants), depending on package options.
%\vspace{10pt}\par\noindent
%\DescribeMacro{\acrfull}
%\cs{acrfull}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\Acrfull}
%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\ACRfull}
%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%Print the long version followed by the abbreviation in brackets 
%with (if required) a hyperlink to the
%relevant entry in the glossary.
%
%\begin{important}
%Note that if any of the above commands produce unexpected output
%and you haven't used any of the acronym-related package options,
%you will need to switch off the sanitization\ipkgopt{sanitize}. 
%For example:
%\begin{verbatim}
%\usepackage[sanitize=none]{glossaries}
%\end{verbatim}
%However, if you do this, you must remember to protect fragile
%commands when defining acronyms or glossary entries.
%\end{important}
%
%Note that if you change the definition of \ics{newacronym}, you
%may additionally need to change the above commands as well as
%changing the way the text is displayed using \ics{defglsdisplay}
%and \ics{defglsdisplayfirst}.
%
%The package option \pkgopt{shortcuts} provides the synonyms listed
%in \tableref{tab:shortcuts}. If any of those commands generate
%an \dq{undefined control sequence} error message, check that you
%have enabled the shortcuts using the \pkgopt{shortcuts} package 
%option. Note that there are no shortcuts for the commands that
%produce all upper case text.
%
%\begin{table}[htbp]
%\caption[Synonyms provided by the package option shortcuts]{Synonyms provided by the package option \pkgopt{shortcuts}}
%\label{tab:shortcuts}
%\begin{center}
%\begin{tabular}{ll}
%\bfseries Shortcut Command & \bfseries Equivalent Command\\
%\ics{acs} & \ics{acrshort}\\
%\ics{Acs} & \ics{Acrshort}\\
%\ics{acsp} & \ics{acrshortpl}\\
%\ics{Acsp} & \ics{Acrshortpl}\\
%\ics{acl} & \ics{acrlong}\\
%\ics{Acl} & \ics{Acrlong}\\
%\ics{aclp} & \ics{acrlongpl}\\
%\ics{Aclp} & \ics{Acrlongpl}\\
%\ics{acf} & \ics{acrfull}\\
%\ics{Acf} & \ics{Acrfull}\\
%\ics{acfp} & \ics{acrfullpl}\\
%\ics{Acfp} & \ics{Acrfullpl}\\
%\ics{ac} & \ics{gls}\\
%\ics{Ac} & \ics{Gls}\\
%\ics{acp} & \ics{glspl}\\
%\ics{Acp} & \ics{Glspl}
%\end{tabular}
%\end{center}
%\end{table}
%
%
%\subsubsection{Upgrading From the glossary Package}
%\label{sec:oldacronym}
%Users of the obsolete \isty{glossary} package may recall that
%the syntax used to define new acronyms has changed with the
%replacement \sty{glossaries} package. In addition, the old
%\isty{glossary} package created the command 
%\cs{}\meta{acr-name} when defining the acronym \meta{acr-name}.
%
%In order to facilitate migrating from the old package to the new
%one, the \isty{glossaries} package\footnote{as from version 1.18} 
%provides the command:\\[10pt]
%\DescribeMacro{\oldacronym}\cs{oldacronym}\oarg{label}\marg{abbrv}\marg{long}\marg{key-val list}\\[10pt]
%This uses the same syntax as the \isty{glossary} package's
%method of defining acronyms. It is equivalent to:\\[10pt]
%\ics{newacronym}\oarg{key-val list}\marg{label}\marg{abbrv}\marg{long}\\[10pt]
%In addition, \ics{oldacronym} also defines the commands
%\cs{}\meta{label}, which is equivalent to \ics{gls}\marg{label},
%and \cs{}\meta{label}\texttt{*}, which is equivalent to
%\ics{Gls}\marg{label}. If \meta{label} is omitted, \meta{abbrv}
%is used. Since commands names must consist only of alphabetical
%characters, \meta{label} must also only consist of alphabetical
%characters. Note that \cs{}\meta{label} doesn't allow you to use
%the first optional argument of \ics{gls} or \ics{Gls} --- you will
%need to explicitly use \ics{gls} or \ics{Gls} to change the
%settings.
%
%\begin{important}
%Recall that, in general, \LaTeX\ ignores spaces following command 
%names consisting of alphabetical characters. This is also true for 
%\cs{}\meta{label} unless you additionally load the
%\isty{xspace} package.
%\end{important}
%
%The \isty{glossaries} package doesn't load the \isty{xspace} package
%since there are both advantages and disadvantages to using
%\ics{xspace} in \cs{}\meta{label}. If you don't use the 
%\isty{xspace} package you need to explicitly force a space using
%\verb*"\ " (backslash space) however you can follow \cs{}\meta{label}
%with additional text in square brackets (the final optional
%argument to \ics{gls}). If you use the \isty{xspace} package
%you don't need to escape the spaces but you can't use
%the optional argument to insert text (you will have to explicitly
%use \ics{gls}).
%
%To illustrate this, suppose I define the acronym \dq{abc} as
%follows:
%\begin{verbatim}
%\oldacronym{abc}{example acronym}{}
%\end{verbatim}
%This will create the command \cs{abc} and its starred version
%\cs{abc*}. \Tableref{tab:xspace} illustrates the effect of
%\cs{abc} (on subsequent use) according to whether or not the
%\isty{xspace} package has been loaded. As can be seen from the
%final row in the table, the \isty{xspace} package prevents the
%optional argument from being recognised.
%
%\begin{table}[htbp]
%\caption[The effect of using xspace]{The effect of using 
%\sty{xspace} with \cs{oldacronym}}
%\label{tab:xspace}
%\vskip\baselineskip
%\centering
%\begin{tabular}{lll}
%\bfseries Code & \bfseries With \sty{xspace} &
%\bfseries Without \sty{xspace}\\
%\verb|\abc.| & abc. & abc.\\
%\verb|\abc xyz| & abc xyz & abcxyz\\
%\verb|\abc\ xyz| & abc xyz & abc xyz\\
%\verb|\abc* xyz| & Abc xyz & Abc xyz\\
%\verb|\abc['s] xyz| & abc ['s] xyz & abc's xyz
%\end{tabular}
%\par
%\end{table}
%
%
%\subsection{Unsetting and Resetting Entry Flags}
%\label{sec:glsunset}
%
%When using \ics{gls}, \ics{glspl} and their uppercase variants it is
%possible that you may want to use the value given by the
%\gloskey{first} key, even though you have already used the glossary
%entry\ifirstuse. Conversely, you may want to use the value given by the
%\gloskey{text} key, even though you haven't used the glossary entry.
%The former can be achieved by one of the following commands:\\[10pt]
%\DescribeMacro{\glsreset}\cs{glsreset}\marg{label}\\
%\DescribeMacro{\glslocalreset}\cs{glslocalreset}\marg{label}\\[10pt]
%while the latter can be achieved by one of the following commands:\\[10pt]
%\DescribeMacro{\glsunset}\cs{glsunset}\marg{label}\\
%\DescribeMacro{\glslocalunset}\cs{glslocalunset}\marg{label}
%\\[10pt]
%You can also reset or unset all entries for a given glossary or list of
%glossaries using:\\[10pt]
%\DescribeMacro{\glsresetall}\cs{glsresetall}\oarg{glossary list}\\
%\DescribeMacro{\glslocalresetall}\cs{glslocalresetall}\oarg{glossary list}\\
%\DescribeMacro{\glsunsetall}\cs{glsunsetall}\oarg{glossary list}\\
%\DescribeMacro{\glslocalunsetall}\cs{glslocalunsetall}\oarg{glossary list}\\[10pt]
%where \meta{glossary list} is a comma-separated list of 
%glossary labels. If omitted, all defined glossaries are assumed.
%For example, to reset all entries in the main glossary and the
%list of acronyms:
%\begin{verbatim}
%\glsresetall[main,acronym]
%\end{verbatim}
%
%You can determine whether an entry's first use flag is set using:\\[10pt]
%\DescribeMacro{\ifglsused}
%\cs{ifglsused}\marg{label}\marg{true part}\marg{false part}\\[10pt]
%where \meta{label} is the label of the required entry. If the
%entry has been used, \meta{true part} will be done, otherwise
%\meta{false part} will be done.
%
%\subsection{Glossary Styles}
%\label{sec:styles}
%The \sty{glossaries} package comes with some pre-defined
%glossary styles. Note that the styles are suited to different
%types of glossaries: some styles ignore the associated
%symbol; some styles are not designed for hierarchical entries,
%so they display sub-entries in the same way as they display top
%level entries; some styles are designed for homographs, so they 
%ignore the name for sub-entries. You should therefore pick a style 
%that suits your type of glossary. See \tableref{tab:styles} for
%a summary of the available styles.
%
%\begin{table}[htbp]
%\caption[Glossary Styles]{Glossary Styles. An asterisk in the style 
%name indicates anything that matches that doesn't match any
%previously listed style (e.g.\ \texttt{long3col*}
%matches \glostyle{long3col}, \glostyle{long3colheader}, 
%\glostyle{long3colborder} and \glostyle{long3colheaderborder}).
%A maximum level of 0 indicates a flat glossary (sub-entries
%are displayed in the same way as main entries). Where the maximum
%level is given as --- there is no limit, but note that 
%\appname{makeindex} imposes a limit of 2 sub-levels. If the
%homograph column is checked, then the name is not displayed for
%sub-entries. If the symbol column is checked, then the symbol will
%be displayed if it has been defined.}
%\label{tab:styles}
%\vskip\baselineskip
%\centering
%\begin{tabular}{lccc}
%\bfseries Style & \bfseries Maximum Level &
%\bfseries Homograph & \bfseries Symbol\\
%\ttfamily listdotted & 0 & & \\
%\ttfamily sublistdotted & 1 & & \\
%\ttfamily list* & 1 & \tick & \\
%\ttfamily altlist* & 1 & \tick & \\
%\ttfamily long3col* & 1 & \tick & \\
%\ttfamily long4col* & 1 & \tick & \tick \\
%\ttfamily altlong4col* & 1 & \tick & \tick \\
%\ttfamily long* & 1 & \tick & \\
%\ttfamily super3col* & 1 & \tick & \\
%\ttfamily super4col* & 1 & \tick & \tick \\
%\ttfamily altsuper4col* & 1 & \tick & \tick \\
%\ttfamily super* & 1 & \tick & \\
%\ttfamily index* & 2 & & \tick\\
%\ttfamily treenoname* & --- & \tick & \tick\\
%\ttfamily tree* & --- & & \tick\\
%\ttfamily alttree* & --- & & \tick
%\end{tabular}
%\par
%\end{table}
%
%The glossary style can be set using the \pkgopt{style} package option
%or using the \gloskey[printglossary]{style} key in the optional
%argument to \ics{printglossary} or using the command:\\[10pt]
%\DescribeMacro{\glossarystyle}\cs{glossarystyle}\marg{style-name}\\[10pt]
%The tabular-like styles that allow multi-line descriptions and page
%lists use the length \DescribeMacro{\glsdescwidth}\cs{glsdescwidth}
%to set the width of the description column and the length
%\DescribeMacro{\glspagelistwidth}\cs{glspagelistwidth} to set the
%width of the page list column.\footnote{these lengths will not be
%available if you use both the \pkgopt{nolong} and \pkgopt{nosuper}
%package options or if you use the \pkgopt{nostyles} package option.}
%These will need to be changed using \cs{setlength} if the glossary
%is too wide. Note that the \glostyle{long4col} and
%\glostyle{super4col} styles (and their header and border variations)
%don't use these lengths as they are designed for single line
%entries. Instead you should use the analogous \glostyle{altlong4col}
%and \glostyle{altsuper4col} styles.  If you want to
%explicitly create a line-break within a multi-line description in
%a tabular-like style you should use \ics{newline} instead of
%\verb|\\|.
%
%Note that if you use the \gloskey[printglossary]{style} key in the
%optional argument to \ics{printglossary}, it will override any 
%previous style settings for the given glossary, so if, for example,
%you do
%\begin{verbatim}
%\renewcommand*{\glsgroupskip}{}
%\printglossary[style=long]
%\end{verbatim}
%then the new definition of \ics{glsgroupskip} will not have an affect
%for this glossary, as \cs{glsgroupskip} is redefined by 
%\verb|style=long|. Likewise, \ics{glossarystyle} will also
%override any previous style definitions, so, again
%\begin{verbatim}
%\renewcommand*{\glsgroupskip}{}
%\glossarystyle{long}
%\end{verbatim}
%will reset \cs{glsgroupskip} back to its default definition for the
%named glossary style (\glostyle{long} in this case). If you want to 
%modify the styles, either use \ics{newglossarystyle} (described
%in the next section) or make the modifications after 
%\ics{glossarystyle}, e.g.:
%\begin{verbatim}
%\glossarystyle{long}
%\renewcommand*{\glsgroupskip}{}
%\end{verbatim}
%
% \changes{1.03}{2007 July 4}{'glspostdescription added}
%All the styles except for the three- and four-column styles and the
%\glostyle{listdotted} style use the command
%\DescribeMacro{\glspostdescription}\cs{glspostdescription} after the
%description. This simply displays a full stop by default.  To eliminate
%this full stop (or replace it with something else, say a comma) you
%will need to redefine \cs{glspostdescription} before the glossary is
%displayed. Alternatively, you can suppress it for a given entry
%by placing \ics{nopostdesc} in the entry's description.
%
%\subsubsection{List Styles}
%\label{sec:liststyles}
%
%The styles described in this section are all defined in the package
%\isty{glossary-list}. Since they all use the \envname{description}
%environment, they are governed by the same parameters as that
%environment. These styles all ignore the entry's symbol.  Note that
%these styles will not be available if you use either the
%\pkgopt{nolist} or \pkgopt{nostyles} package options.
%
%\begin{description}
%\item[list] The \glostyle{list} style uses the \envname{description}
%environment. The entry name is placed in the optional argument of
%the \cs{item} command (so it will appear in bold by default). The
%description follows, and then the associated \term{number list} for 
%that entry. The symbol is ignored.  If the entry has child entries,
%the description and number list follows (but not the name) for each
%child entry.  Groups are separated using \cs{indexspace}.
%
%\item[listgroup] The \glostyle{listgroup} style is like 
%\glostyle{list} but the glossary groups have headings.
%
%\item[listhypergroup] The \glostyle{listhypergroup} style is like 
%\glostyle{listgroup} but has a navigation line at the start of
%the glossary with links to each group that is present in the 
%glossary. This requires an additional run through \LaTeX\ to ensure 
%the group information is up to date.  In the navigation line, each 
%group is separated
%by \DescribeMacro{\glshypernavsep}\cs{glshypernavsep} which 
%defaults to a vertical bar with a space on either side. For example,
%to simply have a space separating each group, do:
%\begin{verbatim}
%\renewcommand*{\glshypernavsep}{\space}
%\end{verbatim}
%
%Note that the hyper-navigation line is now (as from version 1.14) 
%set inside the optional argument to \cs{item} instead of after it
%to prevent a spurious space at the start. This can be changed
%by redefining \ics{glossaryheader}, but note that this needs to
%be done \emph{after} the glossary style has been set.
%
%\item[altlist] The \glostyle{altlist} style is like \glostyle{list}
%but the description starts on the line following the name. (As
%with the \glostyle{list} style, the symbol is ignored.) Each child
%entry starts a new line, but as with the \glostyle{list} style,
%the name associated with each child entry is ignored.
%
%\item[altlistgroup] The \glostyle{altlistgroup} style is like 
%\glostyle{altlist} but the glossary groups have headings.
%
%\item[altlisthypergroup] The \glostyle{altlisthypergroup} style is like 
%\glostyle{altlistgroup} but has a set of links to the glossary 
%groups. The navigation line is the same as that for 
%\glostyle{listhypergroup}, described above.
%
%\item[listdotted] This style uses the \envname{description}
%environment.\footnote{This style was supplied by Axel~Menzel.}  Each
%entry starts with \verb|\item[]|, followed by the name followed by a
%dotted line, followed by the description. Note that this style
%ignores both the \term{number list} and the symbol. The length
%\DescribeMacro{\glslistdottedwidth}\cs{glslistdottedwidth} governs
%where the description should start. This is a flat style, so child
%entries are formatted in the same way as the parent entries.
%
%\item[sublistdotted] This is a variation on the \glostyle{listdotted}
%style designed for hierarchical glossaries. The main entries
%have just the name displayed. The sub entries are displayed in
%the same manner as \glostyle{listdotted}.
%\end{description}
%
%\subsubsection{Longtable Styles}
%\label{sec:longstyles}
%
%The styles described in this section are all defined in the package
%\isty{glossary-long}. Since they all use the \envname{longtable}
%environment, they are governed by the same parameters as that
%environment.  Note that these styles will not be available if you
%use either the \pkgopt{nolong} or \pkgopt{nostyles} package options.
%
%\begin{description}
%\item[long] The \glostyle{long} style uses the \envname{longtable}
%environment (defined by the \isty{longtable} package). It has two
%columns: the first column contains the entry's name and the second
%column contains the description followed by the \term{number list}.
%The entry's symbol is ignored.
%Sub groups are separated with a blank row. The width of the
%first column is governed by the widest entry in that column. The
%width of the second column is governed by the length
%\ics{glsdescwidth}. Child entries have a similar format to the
%parent entries except that their name is suppressed.
%
%\item[longborder] The \glostyle{longborder} style is like
%\glostyle{long} but has horizontal and vertical lines around it.
%
%\item[longheader] The \glostyle{longheader} style is like
%\glostyle{long} but has a header row.
%
%\item[longheaderborder] The \glostyle{longheaderborder} style is
%like \glostyle{longheader} but has horizontal and vertical lines
%around it.
%
%\item[long3col] The \glostyle{long3col} style is like
%\glostyle{long} but has three columns. The first column contains
%the entry's name, the second column contains the description
%and the third column contains the \term{number list}.
%The entry's symbol is ignored. The width of the
%first column is governed by the widest entry in that column, the
%width of the second column is governed by the length
%\ics{glsdescwidth}, and the width of the third column is governed by the
%length \ics{glspagelistwidth}.
%
%\item[long3colborder] The \glostyle{long3colborder} style is like
%the \glostyle{long3col} style but has horizontal and vertical
%lines around it.
%
%\item[long3colheader] The \glostyle{long3colheader} style is like
%\glostyle{long3col} but has a header row.
%
%\item[long3colheaderborder] The \glostyle{long3colheaderborder} style is
%like \glostyle{long3colheader} but has horizontal and vertical lines
%around it.
%
%\item[long4col] The \glostyle{long4col} style is like 
%\glostyle{long3col} but has an additional column in which the
%entry's associated symbol appears. This style is used for brief
%single line descriptions. The column widths are governed by the
%widest entry in the given column. Use \glostyle{altlong4col} for 
%multi-line descriptions.
%
%\item[long4colborder] The \glostyle{long4colborder} style is like
%the \glostyle{long4col} style but has horizontal and vertical
%lines around it.
%
%\item[long4colheader] The \glostyle{long4colheader} style is like
%\glostyle{long4col} but has a header row.
%
%\item[long4colheaderborder] The \glostyle{long4colheaderborder} style is
%like \glostyle{long4colheader} but has horizontal and vertical lines
%around it.
%
%\item[altlong4col] The \glostyle{altlong4col} style is like
%\glostyle{long4col} but allows multi-line descriptions and page
%lists.  The width of the description column is governed by the
%length \ics{glsdescwidth} and the width of the page list column is
%governed by the length \ics{glspagelistwidth}. The widths of the
%name and symbol columns are governed by the widest entry in the
%given column.
%
%\item[altlong4colborder] The \glostyle{altlong4colborder} style is like
%the \glostyle{long4colborder} but allows multi-line descriptions and
%page lists.
%
%\item[altlong4colheader] The \glostyle{altlong4colheader} style is like
%\glostyle{long4colheader} but allows multi-line descriptions and
%page lists.
%
%\item[altlong4colheaderborder] The \glostyle{altlong4colheaderborder} 
%style is like \glostyle{long4colheaderborder} but allows multi-line
%descriptions and page lists.
%\end{description}
%
%\subsubsection{Supertabular Styles}
%\label{sec:superstyles}
%
%The styles described in this section are all defined in the package
%\isty{glossary-super}. Since they all use the \envname{supertabular}
%environment, they are governed by the same parameters as that
%environment.  Note that these styles will not be available if you
%use either the \pkgopt{nosuper} or \pkgopt{nostyles} package options.
%In general, the \envname{longtable} environment is better, but there
%are some circumstances where it is better to use 
%\envname{supertabular}.\footnote{e.g.\ with the \isty{flowfram}
%package.}
%
%\begin{description}
%\item[super] The \glostyle{super} style uses the \envname{supertabular}
%environment (defined by the \isty{supertabular} package). It has two
%columns: the first column contains the entry's name and the second
%column contains the description followed by the \term{number list}.
%The entry's symbol is ignored.
%Sub groups are separated with a blank row. The width of the
%first column is governed by the widest entry in that column. The
%width of the second column is governed by the length
%\ics{glsdescwidth}. Child entries have a similar format to the
%parent entries except that their name is suppressed.
%
%\item[superborder] The \glostyle{superborder} style is like
%\glostyle{super} but has horizontal and vertical lines around it.
%
%\item[superheader] The \glostyle{superheader} style is like
%\glostyle{super} but has a header row.
%
%\item[superheaderborder] The \glostyle{superheaderborder} style is
%like \glostyle{superheader} but has horizontal and vertical lines
%around it.
%
%\item[super3col] The \glostyle{super3col} style is like
%\glostyle{super} but has three columns. The first column contains
%the entry's name, the second column contains the description
%and the third column contains the \term{number list}. The
%entry's symbol is ignored. The width of the
%first column is governed by the widest entry in that column. The
%width of the second column is governed by the length
%\ics{glsdescwidth}. The width of the third column is governed by the
%length \ics{glspagelistwidth}.
%
%\item[super3colborder] The \glostyle{super3colborder} style is like
%the \glostyle{super3col} style but has horizontal and vertical
%lines around it.
%
%\item[super3colheader] The \glostyle{super3colheader} style is like
%\glostyle{super3col} but has a header row.
%
%\item[super3colheaderborder] The \glostyle{super3colheaderborder} style
%is like \glostyle{super3colheader} but has horizontal and vertical
%lines around it.
%
%\item[super4col] The \glostyle{super4col} style is like 
%\glostyle{super3col} but has an additional column in which the
%entry's associated symbol appears. This style is designed for
%entries with brief single line descriptions. The column widths are governed by the
%widest entry in the given column. Use \glostyle{altsuper4col}
%for multi-line descriptions.
%
%\item[super4colborder] The \glostyle{super4colborder} style is like
%the \glostyle{super4col} style but has horizontal and vertical
%lines around it.
%
%\item[super4colheader] The \glostyle{super4colheader} style is like
%\glostyle{super4col} but has a header row.
%
%\item[super4colheaderborder] The \glostyle{super4colheaderborder} style
%is like \glostyle{super4colheader} but has horizontal and vertical
%lines around it.
%
%\item[altsuper4col] The \glostyle{altsuper4col} style is like 
%\glostyle{super4col} but allows multi-line descriptions and page
%lists.
%The width of the description column is governed by the length
%\ics{glsdescwidth} and the width of the page list column is
%governed by the length \ics{glspagelistwidth}. The width of the name 
%and symbol columns is governed by the widest entry in the 
%given column.
%
%\item[altsuper4colborder] The \glostyle{altsuper4colborder} style is like
%the \glostyle{super4colborder} style but allows multi-line descriptions
%and page lists.
%
%\item[altsuper4colheader] The \glostyle{altsuper4colheader} style is like
%\glostyle{super4colheader} but allows multi-line descriptions and
%page lists.
%
%\item[altsuper4colheaderborder] The \glostyle{altsuper4colheaderborder}
%style is like \glostyle{super4colheaderborder} but allows multi-line
%descriptions and page lists.
%\end{description}
%
%\subsubsection{Tree-Like Styles}
%\label{sec:treestyles}
%
%The styles described in this section are all defined in the package
%\isty{glossary-tree}. These styles are designed for hierarchical
%glossaries but can also be used with glossaries that don't have
%sub-entries. These styles will display the entry's symbol if it 
%exists. Note that these styles will not be available if you
%use either the \pkgopt{notree} or \pkgopt{nostyles} package options.
%
%\begin{description}
%\item[index] The \glostyle{index} style is similar to the way
%indices are usually formatted in that it has a hierarchical
%structure up to three levels (the main level plus two sub-levels).
%The name is typeset in bold, and if the symbol is present it is set
%in parentheses after the name and before the description.
%Sub-entries are indented and also include the name, the symbol
%in brackets (if present) and the description.  Groups are separated
%using \ics{indexspace}.
%
%\item[indexgroup] The \glostyle{indexgroup} style is similar to
%the \glostyle{index} style except that each group has a heading.
%
%\item[indexhypergroup] The \glostyle{indexhypergroup} style is like 
%\glostyle{indexgroup} but has a set of links to the glossary 
%groups. The navigation line is the same as that for 
%\glostyle{listhypergroup}, described above.
%
%\item[tree] The \glostyle{tree} style is similar to the
%\glostyle{index} style except that it can have arbitrary levels.
%(Note that \appname{makeindex} is limited to three levels, so
%you will need to use \appname{xindy} if you want more than 
%three levels.) Each sub-level is indented by 
%\DescribeMacro{\glstreeindent}\cs{glstreeindent}. Note that the
%name, symbol (if present) and description are placed in the
%same paragraph block. If you want the name to be apart from the
%description, use the \glostyle{alttree} style instead. (See below.)
%
%\item[treegroup] The \glostyle{treegroup} style is similar to
%the \glostyle{tree} style except that each group has a heading.
%
%\item[treehypergroup] The \glostyle{treehypergroup} style is like 
%\glostyle{treegroup} but has a set of links to the glossary 
%groups. The navigation line is the same as that for 
%\glostyle{listhypergroup}, described above.
%
%\item[treenoname] The \glostyle{treenoname} style is like
%the \glostyle{tree} style except that the name for each sub-entry
%is ignored.
%
%\item[treenonamegroup] The \glostyle{treenonamegroup} style is 
%similar to the \glostyle{treenoname} style except that each group 
%has a heading.
%
%\item[treenonamehypergroup] The \glostyle{treenonamehypergroup} 
%style is like \glostyle{treenonamegroup} but has a set of links to 
%the glossary groups. The navigation line is the same as that for 
%\glostyle{listhypergroup}, described above.
%
%\item[alttree] The \glostyle{alttree} style is similar to the
%\glostyle{tree} style except that the indentation for each level
%is determined by the width of the text specified by\\[10pt]
%\DescribeMacro{\glssetwidest}\cs{glssetwidest}\oarg{level}\marg{text}\\[10pt]
%The optional argument \meta{level} indicates the level, where
%0 indicates the top-most level, 1 indicates the first level 
%sub-entries, etc. If \cs{glssetwidest} hasn't been used for a 
%given sub-level, the level~0 widest text is used instead. If
%\meta{level} is omitted, 0 is assumed.
%
%For each level, the name is placed to the left of the paragraph
%block containing the symbol (optional) and the description. If the
%symbol is present, it is placed in parentheses before the
%description.
%
%\item[alttreegroup] The \glostyle{alttreegroup} is like the
%\glostyle{alttree} style except that each group has a heading.
%
%\item[alttreehypergroup] The \glostyle{alttreehypergroup} style is 
%like \glostyle{alttreegroup} but has a set of links to the glossary 
%groups. The navigation line is the same as that for 
%\glostyle{listhypergroup}, described above.
%
%\end{description}
%
%
%\subsection{Defining your own glossary style}
%\label{sec:newglossarystyle}
%
%If the predefined styles don't fit your requirements, you can
%define your own style using\DescribeMacro{\newglossarystyle}:\\[10pt]
%\cs{newglossarystyle}\marg{name}\marg{definitions}\\[10pt]
%where \meta{name} is the name of the new glossary style (to be
%used in \cs{glossarystyle}). The second argument \meta{definitions},
%needs to redefine all of the following:
%
%\begin{description}
%\item
%\DescribeEnv{theglossary}
%\envname{theglossary}\par\noindent
%This environment defines how the main body of the glossary should
%be typeset. Note that this does not include the section heading,
%the glossary preamble (defined by \cs{glossarypreamble}) or the
%glossary postamble (defined by \cs{glossarypostamble}). For example,
%the \glostyle{list} style uses the \envname{description} environment,
%so the \envname{theglossary} environment is simply redefined to begin
%and end the \envname{description} environment.
%
%\item
%\DescribeMacro{\glossaryheader}
%\cs{glossaryheader}\par\noindent
%This macro indicates what to do at the start of the main body
%of the glossary. Note that this is not the same as 
%\cs{glossarypreamble}, which should not be affected by changes in
%the glossary style. The \glostyle{list} glossary style redefines
%\cs{glossaryheader} to do nothing, whereas the \glostyle{longheader}
%glossary style redefines \cs{glossaryheader} to do a header row.
%
%\item
%\DescribeMacro{\glsgroupheading}
%\cs{glsgroupheading}\marg{label}\par\noindent This macro indicates
%what to do at the start of each logical block within the main body
%of the glossary. If you use \appname{makeindex} the glossary is
%sub-divided into a maximum of twenty-eight logical blocks that are
%determined by the first character of the \gloskey{sort} key (or
%\gloskey{name} key if the \gloskey{sort} key is omitted). The
%sub-divisions are in the following order: symbols, numbers, A,
%\ldots, Z\@. If you use \appname{xindy}, the sub-divisions depend on
%the language settings.
%
%Note that the argument to \cs{glsgroupheading}
%is a label \emph{not} the group title. The group title can be obtained
%via
%
%\DescribeMacro{\glsgetgrouptitle}\cs{glsgetgrouptitle}\marg{label}
%
%This obtains the title as follows: if 
%\cs{}\meta{label}\texttt{groupname} exists, this is taken to be the 
%title, otherwise the title is just \meta{label}.
%
%A navigation hypertarget can be created using
%
%\DescribeMacro{\glsnavhypertarget}\cs{glsnavhypertarget}\marg{label}\marg{text}
%
%For further details about \cs{glsnavhypertarget}, see 
%\autoref{sec:code:hypernav}.
%
%
%Most of the predefined glossary styles redefine \cs{glsgroupheading}
%to simply ignore its argument.  The \glostyle{listhypergroup} style
%redefines \cs{glsgroupheading} as follows:
%\begin{verbatim}
%\renewcommand*{\glsgroupheading}[1]{%
%\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}
%\end{verbatim}
%See also \cs{glsgroupskip} below. (Note that command definitions within 
%\cs{newglossarystyle} must use \verb|##1| instead of \verb|#1| etc.)
%
%\item
%\DescribeMacro{\glsgroupskip}
%\cs{glsgroupskip}\par\noindent
%This macro determines what to do after one logical group but before
%the header for the next logical group. The \glostyle{list} glossary
%style simply redefines \cs{glsgroupskip} to be \cs{indexspace},
%whereas the tabular-like styles redefine \cs{glsgroupskip} to
%produce a blank row.
%
%\item
%\DescribeMacro{\glossaryentryfield}
%\cs{glossaryentryfield}\marg{label}\marg{formatted
%name}\marg{description}\marg{symbol}
%\marg{number list}\par\noindent
%This macro indicates what to do for a given glossary entry.
%Note that \meta{formatted name} will always be in the form
%\cs{glsnamefont}\marg{name}. This allows the user to set a given
%font for the entry name, regardless of the glossary style used.
%Note that \meta{label} is the label used when the glossary entry
%was defined via either \cs{newglossaryentry} or \cs{newacronym}. 
%
%Each time you use a glossary entry it creates a hyperlink (if
%hyperlinks are enabled) to the relevant line in the glossary.
%Your new glossary style must therefore redefine
%\cs{glossaryentryfield} to set the appropriate target. This
%is done using
%
%\DescribeMacro{\glstarget}\cs{glstarget}\marg{label}\marg{text}
%
%where \meta{label} is the entry's label. Note that you
%don't need to worry about whether the \isty{hyperref} package has
%been loaded, as \cs{glstarget} won't create a target if
%\cs{hypertarget} hasn't been defined.
%
%For example, the 
%\glostyle{list} style defines \cs{glossaryentryfield} as follows:
%\begin{verbatim}
%\renewcommand*{\glossaryentryfield}[5]{%
%\item[\glstarget{##1}{##2}] ##3\glspostdescription\space ##5}
%\end{verbatim}
%
%Note also that \meta{number list} will always be of the form\\[10pt]
%\cs{glossaryentrynumbers}\{\cs{relax}\\
%\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}\}\\[10pt]
%where \meta{number(s)}
%may contain \cs{delimN} (to delimit individual numbers) and/or
%\cs{delimR} (to indicate a range of numbers). There may be 
%multiple occurrences of 
%\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}, but note
%that the entire number list is enclosed within the argument
%to \ics{glossaryentrynumbers}. The user can redefine this to change
%the way the entire number list is formatted, regardless of 
%the glossary style. However the most common use of
%\cs{glossaryentrynumbers} is to provide a means of suppressing the
%number list altogether. (In fact, the \pkgopt{nonumberlist} option 
%redefines \cs{glossaryentrynumbers} to ignore its argument.)
%Therefore, when you define a new glossary style, you don't need
%to worry about whether the user has specified the 
%\pkgopt{nonumberlist} package option.
%
%\item
%\DescribeMacro{\glossarysubentryfield}
%\cs{glossarysubentryfield}\marg{level}\marg{label}\marg{formatted
%name}\marg{description}\marg{symbol}
%\marg{number list}\par\noindent
%This is new to version 1.17, and is used to display sub-entries.
%The first argument, \meta{level}, indicates the sub-entry level.
%This must be an integer from 1 (first sub-level) onwards. The
%remaining arguments are analogous to those for
%\ics{glossaryentryfield} described above.
%\end{description}
%
%For further details of these commands, see
%\autoref{sec:code:printglos}.
%\subsubsection{Example: creating a completely new style}
%
%If you want a completely new style, you will need to redefine all
%of the commands and the environment listed above. 
%
%For example, suppose you want each entry to start with a bullet point.
%This means that the glossary should be placed in the \envname{itemize}
%environment, so \envname{theglossary} should start and end that
%environment. Let's also suppose that you don't want anything between
%the glossary groups (so \ics{glsgroupheading} and \ics{glsgroupskip}
%should do nothing) and suppose you don't want anything to appear
%immediately after \verb|\begin{theglossary}| (so \ics{glossaryheader}
%should do nothing). In addition, let's suppose the symbol should
%appear in brackets after the name, followed by the description and
%last of all the \term{number list} should appear within square brackets
%at the end. Then you can create this new glossary style, called, say,
%\texttt{mylist}, as follows:
%\begin{verbatim}
% \newglossarystyle{mylist}{%
% % put the glossary in the itemize environment:
% \renewenvironment{theglossary}{\begin{itemize}}{\end{itemize}}%
% % have nothing after \begin{theglossary}:
% \renewcommand*{\glossaryheader}{}%
% % have nothing between glossary groups:
% \renewcommand*{\glsgroupheading}[1]{}%
% \renewcommand*{\glsgroupskip}{}%
% % set how each entry should appear:
% \renewcommand*{\glossaryentryfield}[5]{%
% \item % bullet point
% \glstarget{##1}{##2}% the entry name
% \space (##4)% the symbol in brackets
% \space ##3% the description
% \space [##5]% the number list in square brackets
% }%
% % set how sub-entries appear:
% \renewcommand*{\glossarysubentryfield}[6]{%
%   \glossaryentryfield{##2}{##3}{##4}{##5}{##6}}%
% }
%\end{verbatim}
%Note that this style creates a flat glossary, where sub-entries
%are displayed in exactly the same way as the top level entries.
%
%\subsubsection{Example: creating a new glossary style based on an
%existing style}
%
%\changes{1.11}{2008 March 1}{Fixed error in manual (glossary style
%is set using 'glossarystyle not 'setglossarystyle)}%
%If you want to define a new style that is a slightly modified
%version of an existing style, you can use \cs{glossarystyle}
%within the second argument of \cs{newglossarystyle} followed by
%whatever alterations you require. For example, suppose you want 
%a style like the \glostyle{list} style but you don't want the extra
%vertical space created by \cs{indexspace} between groups, then you
%can create a new glossary style called, say, \texttt{mylist} as
%follows:
%\begin{verbatim}
%\newglossarystyle{mylist}{%
%\glossarystyle{list}% base this style on the list style
%\renewcommand{\glsgroupskip}{}% make nothing happen between groups
%}
%\end{verbatim} 
%
%\subsection{Accessibility Support}\label{sec:accsupp}
%Limited accessibility support is provided by the accompanying
%\isty{glossaries-accsupp} package, but note that this package is
%experimental and it requires the \isty{accsupp} package 
%which is also listed as experimental. The \gloskey{symbol} key
%is used to specify the replacement text. For example:
%\begin{verbatim}
%\newglossaryentry{tex}{name={\TeX},description={Document preparation
%language},symbol={TeX}}
%\end{verbatim}
%When you reference this entry using \ics{gls}, \ics{glspl} or
%their uppercase variants, the symbol is used as the replacement
%text. For example, \verb|\gls{tex}| would be equivalent to
%\begin{verbatim}
%\BeginAccSupp{ActualText=TeX}\TeX\EndAccSupp{}
%\end{verbatim}
%See \autoref{sec:code:accsupp} for further details. It is
%recommended that you also read the \isty{accsupp} documentation.
%
%\section{Mfirstuc Package}
%\label{sec:mfirstuc}
%
%The \sty{glossaries} bundle is supplied with the package 
%\isty{mfirstuc} which provides the command:\\[10pt]
%\DescribeMacro{\makefirstuc}
%\cs{makefirstuc}\marg{stuff}\\[10pt]
%which makes the first object of
%\meta{stuff} uppercase unless \meta{stuff} starts with a control
%sequence followed by a non-empty group, in which case the first
%object in the group is converted to uppercase. Examples:
%\begin{itemize}
%\item \verb|\makefirstuc{abc}| produces Abc
%
%\item \verb|\makefirstuc{\emph{abc}}| produces \emph{Abc} 
%(\ics{MakeUppercase} has been applied to the letter \dq{a} rather
%than \cs{emph}.) Note however that 
%\verb|\makefirstuc{{\em abc}}| produces \emph{ABC} and 
%\verb|{\makefirstuc{\em abc}}| produces abc.
%
%\item \verb|\makefirstuc{{\'a}bc}| produces \MakeUppercase{\'a}bc
%
%\item \verb|\makefirstuc{\ae bc}| produces \MakeUppercase\ae bc
%\item \verb|\makefirstuc{{\ae}bc}| produces \MakeUppercase{\ae}bc
%\item \verb|\makefirstuc{{ä}bc}| produces \MakeUppercase{ä}bc
%\end{itemize}
%Note that non-Latin or accented characters appearing at the
%start of the text must be placed in a group (even if you are
%using the \isty{inputenc} package) due to expansion issues.
%
%\begin{important}
%In version 1.02 of \sty{mfirstuc}, a bug fix resulted in a change
%in output if the first object is a control sequence followed by
%an empty group. Prior to version 1.02, \verb|\makefirstuc{\ae{}bc}|
%produced \ae Bc. However as from version 1.02, it now produces
%\AE bc.
%\end{important}
%
%Note also that
%\begin{verbatim}
%\newcommand{\abc}{abc}
%\makefirstuc{\abc}
%\end{verbatim}
%produces: ABC. This is because the first object in the argument of
%\cs{makefirstuc} is \cs{abc}, so it does \verb|\MakeUppercase\abc|.
%Whereas:
%\begin{verbatim}
%\newcommand{\abc}{abc}
%\expandafter\makefirstuc\expandafter{\abc}
%\end{verbatim}
%produces: Abc. There is a short cut command which will do this:\\[10pt]
%\DescribeMacro{\xmakefirstuc}
%\cs{xmakefirstuc}\marg{stuff}\\[10pt]
%This is equivalent to \cs{expandafter}\cs{makefirstuc}\cs{expandafter}\marg{stuff}. So
%\begin{verbatim}
%\newcommand{\abc}{abc}
%\xmakefirstuc{\abc}
%\end{verbatim}
%produces: Abc.
%
%If you want to use an alternative command to convert to uppercase,
%for example \cs{MakeTextUppercase},\footnote{defined in the 
%\sty{textcase} package} you can redefine the internal
%command \cs{@gls@makefirstuc}. For example:
%\begin{verbatim}
%\renewcommand{\@gls@makefirstuc}[1]{\MakeTextUppercase #1}
%\end{verbatim}
%(Remember that command names that contain the @ character must
%either be placed in packages or be placed between \cs{makeatletter} 
%and \cs{makeatother}.)
%
%
% \StopEventually{\clearpage\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex}
%
%
%
%
%\section{Documented Code}
%\iffalse
%    \begin{macrocode}
%<*glossaries.sty>
%    \end{macrocode}
%\fi
%\label{sec:code}
% \subsection{Package Definition}
% This package requires \LaTeXe.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glossaries}[2009/04/16 v2.0 (NLCT)]
%    \end{macrocode}
% Required packages:
%    \begin{macrocode}
\RequirePackage{ifthen}
\RequirePackage{xkeyval}[2006/11/18]
\RequirePackage{mfirstuc}
\RequirePackage{xfor}
%    \end{macrocode}
% If \isty{babel} package is loaded, check to see if \isty{translator} is installed.
%    \begin{macrocode}
\@ifpackageloaded{babel}{\IfFileExists{translator.sty}{%
  \RequirePackage{translator}}{}}{}
%    \end{macrocode}
%\changes{1.1}{2008 Feb 22}{amsgen now loaded (\cs{new@ifnextchar} needed)}
% Need to use \cs{new@ifnextchar} instead of \cs{@ifnextchar} in 
% commands that have a final optional argument (such as \ics{gls})
% so require \isty{amsgen}.
% Thanks to Morten~H\o gholm for suggesting this. (This has
% replaced using the \sty{xspace} package.)
%    \begin{macrocode}
\RequirePackage{amsgen}
%    \end{macrocode}
%
% \subsection{Package Options}\label{sec:pkgopt}
%\begin{macro}{toc}
% The \pkgopt{toc} package option will add the glossaries 
% to the table of contents. This is a boolean key, if the
% value is omitted it is taken to be true.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{toc}[true]{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{numberline}
%\changes{1.1}{2008 Feb 22}{numberline option added}
% The \pkgopt{numberline} package option adds \cs{numberline} to
% \cs{addcontentsline}. Note that this option only has an effect
% if used in with \pkgopt[true]{toc}.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{numberline}[true]{}
%    \end{macrocode}
%\end{macro}
%
% The sectional unit used to start the glossary is stored in
% \cs{@@glossarysec}. If chapters are defined, this
% is initialised to \texttt{chapter}, otherwise it is
% initialised to \texttt{section}.
%\begin{macro}{\@@glossarysec}
%    \begin{macrocode}
\@ifundefined{chapter}{\newcommand*{\@@glossarysec}{section}}{%
\newcommand*{\@@glossarysec}{chapter}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{section}
% The \pkgopt{section} key can be used to set the sectional unit.
% If no unit is specified, use \texttt{section} as the default.
% The starred form of the named sectional unit will be used.
% If you want some other way to start the glossary section (e.g.\ 
% a numbered section) you will have to redefined 
% \ics{glossarysection}.
%    \begin{macrocode}
\define@choicekey{glossaries.sty}{section}{part,chapter,section,%
subsection,subsubsection,paragraph,subparagraph}[section]{%
\renewcommand*{\@@glossarysec}{#1}}
%    \end{macrocode}
%\end{macro}
%
% Determine whether or not to use numbered sections.
%\begin{macro}{\@@glossarysecstar}
%    \begin{macrocode}
\newcommand*{\@@glossarysecstar}{*}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@@glossaryseclabel}
%    \begin{macrocode}
\newcommand*{\@@glossaryseclabel}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsautoprefix}
% Prefix to add before label if automatically generated:
%\changes{1.14}{2008 June 17}{new}
%    \begin{macrocode}
\newcommand*{\glsautoprefix}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{numberedsection}
%\changes{1.1}{2008 Feb 22}{numberedsection package option added}
%    \begin{macrocode}
\define@choicekey{glossaries.sty}{numberedsection}[\val\nr]{%
false,nolabel,autolabel}[nolabel]{%
\ifcase\nr\relax
  \renewcommand*{\@@glossarysecstar}{*}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}%
\fi}
%    \end{macrocode}
%\end{macro}
%
% The default glossary style is stored in 
% \cs{@glossary@default@style}. This is initialised to
% \texttt{list}. (The \glostyle{list} style is
% defined in the accompanying \isty{glossary-list} package
% described in \autoref{sec:code:styles}.)
%\begin{macro}{\@glossary@default@style}
%    \begin{macrocode}
\newcommand*{\@glossary@default@style}{list}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{style}
% The default glossary style can be changed using the \pkgopt{style}
% package option. The value can be the name of any
% defined glossary style. The glossary style is set at the beginning
% of the document, so you can still use the \pkgopt{style} key to
% set a style that is defined in another package. This package comes
% with some predefined styles that are defined in 
% \autoref{sec:code:styles}.
%    \begin{macrocode}
\define@key{glossaries.sty}{style}{%
\renewcommand*{\@glossary@default@style}{#1}}
%    \end{macrocode}
%\end{macro}
%
% Each entry within a given glossary will have an associated
% number list. By default, this refers to the page numbers on
% which that entry has been used, but it can also refer to any counter
% used in the document (such as the section or equation counters).
% The default number list format displays the number list ``as is'':
%\begin{macro}{\glossaryentrynumbers}
%    \begin{macrocode}
\newcommand*{\glossaryentrynumbers}[1]{#1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{nonumberlist}
% Note that the entire number list for a given entry will be
% passed to \cs{glossaryentrynumbers} so any font changes
% will also be applied to the delimiters.
% The \pkgopt{nonumberlist} package option suppresses the 
% number lists (this simply redefines 
% \cs{glossaryentrynumbers} to ignores its argument).
%    \begin{macrocode}
\DeclareOptionX{nonumberlist}{%
\renewcommand*{\glossaryentrynumbers}[1]{}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@loadlong}
%\changes{1.18}{2009 January 14}{new}
%    \begin{macrocode}
\newcommand*{\@gls@loadlong}{\RequirePackage{glossary-long}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{nolong}
%\changes{1.18}{2009 January 14}{new}
% This option prevents \isty{glossary-long} from being loaded.
% This means that the glossary styles that use the 
% \envname{longtable} environment will not be available. This option
% is provided to reduce overhead caused by loading unrequired
% packages.
%    \begin{macrocode}
\DeclareOptionX{nolong}{\renewcommand*{\@gls@loadlong}{}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@loadsuper}
%\changes{1.18}{2009 January 14}{new}
% The \isty{glossary-super} package isn't loaded if
% \isty{supertabular} isn't installed.
%    \begin{macrocode}
\IfFileExists{supertabular.sty}{%
  \newcommand*{\@gls@loadsuper}{\RequirePackage{glossary-super}}}{%
  \newcommand*{\@gls@loadsuper}{}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{nosuper}
%\changes{1.18}{2009 January 14}{new}
% This option prevents \isty{glossary-super} from being loaded.
% This means that the glossary styles that use the 
% \envname{supertabular} environment will not be available. This option
% is provided to reduce overhead caused by loading unrequired
% packages.
%    \begin{macrocode}
\DeclareOptionX{nosuper}{\renewcommand*{\@gls@loadsuper}{}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@loadlist}
%\changes{1.18}{2009 January 14}{new}
%    \begin{macrocode}
\newcommand*{\@gls@loadlist}{\RequirePackage{glossary-list}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{nolist}
%\changes{1.18}{2009 January 14}{new}
% This option prevents \isty{glossary-list} from being loaded
% (to reduce overheads if required). Naturally, the styles defined
% in \isty{glossary-list} will not be available if this option
% is used.
%    \begin{macrocode}
\DeclareOptionX{nolist}{\renewcommand*{\@gls@loadlist}{}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@loadtree}
%\changes{1.18}{2009 January 14}{new}
%    \begin{macrocode}
\newcommand*{\@gls@loadtree}{\RequirePackage{glossary-tree}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{notree}
%\changes{1.18}{2009 January 14}{new}
% This option prevents \isty{glossary-tree} from being loaded
% (to reduce overheads if required). Naturally, the styles defined
% in \isty{glossary-tree} will not be available if this option
% is used.
%    \begin{macrocode}
\DeclareOptionX{notree}{\renewcommand*{\@gls@loadtree}{}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{nostyles}
%\changes{1.18}{2009 January 14}{new}
% Provide an option to suppress all the predefined styles (in the
% event that the user has custom styles that are not dependent
% on the predefined styles).
%    \begin{macrocode}
\DeclareOptionX{nostyles}{%
  \renewcommand*{\@gls@loadlong}{}%
  \renewcommand*{\@gls@loadsuper}{}%
  \renewcommand*{\@gls@loadlist}{}%
  \renewcommand*{\@gls@loadtree}{}%
  \let\@glossary@default@style\relax
}
%    \end{macrocode}
%\end{macro}
%
% Keep track of the default glossary. This is initialised to
% the main glossary, but can be changed if for some reason
% you want to make a secondary glossary the main glossary. This
% affects any commands that can optionally take a glossary name
% as an argument (or as the value of the 
% \gloskey{type}\igloskey[printglossary]{type} key in 
%a key-value list). This was mainly done so that 
% \ics{loadglsentries} can temporarily change 
% \cs{glsdefaulttype} while it loads a file containing
% new glossary entries (see \autoref{sec:load}).
%\begin{macro}{\glsdefaulttype}
%    \begin{macrocode}
\newcommand{\glsdefaulttype}{main}
%    \end{macrocode}
%\end{macro}
% Keep track of which glossary the acronyms are in. This is 
% initialised to \cs{glsdefaulttype}, but is changed by
% the \pkgopt{acronym} package option.
%\begin{macro}{\acronymtype}
%    \begin{macrocode}
\newcommand{\acronymtype}{\glsdefaulttype}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{acronym}
% The \pkgopt{acronym} option sets an associated conditional 
% which is used in \autoref{sec:acronym} to determine whether
% or not to define a separate glossary for acronyms.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{acronym}[true]{}
%    \end{macrocode}
%\end{macro}
%
% The default counter associated with the numbers in the glossary
% is stored in \cs{glscounter}. This is initialised to the 
% page counter. This is used as the default counter when a
% new glossary is defined, unless a different counter is specified
% in the optional argument to \ics{newglossary} (see
% \autoref{sec:newglos}).
%\begin{macro}{\glscounter}
%    \begin{macrocode}
\newcommand{\glscounter}{page}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{counter}
% The \pkgopt{counter} option changes the default counter. (This
% just redefines \cs{glscounter}.)
%    \begin{macrocode}
\define@key{glossaries.sty}{counter}{%
\renewcommand*{\glscounter}{#1}}
%    \end{macrocode}
%\end{macro}
%
% The glossary keys whose values are written to another file (i.e.\
% \gloskey{sort}, \gloskey{name}, \gloskey{description} and
% \gloskey{symbol}) need to be sanitized, otherwise fragile
% commands would not be able to be used in 
% \ics{newglossaryentry}. However, strange results will occur
% if you then use those fields in the document. As these fields
% are not normally used in the document, but are by default only
% used in the glossary, the default is to sanitize them. If however
% you want to use these values in the document (either by redefining
% commands like \ics{glsdisplay} or by using commands like
% \ics{glsentrydesc}) you will have to switch off the 
% sanitization using the \pkgopt{sanitize} package option, but
% you will then have to use \ics{protect} to protect fragile 
% commands when defining new glossary entries. 
% The \pkgopt{sanitize} option
% takes a key-value list as its value, which can be used to 
% switch individual values on and off. For example:
%\begin{verbatim}
%\usepackage[sanitize={description,name,symbol=false}]{glossaries}
%\end{verbatim}
%will switch off the sanitization for the \gloskey{symbol} key, but
% switch it on for the \gloskey{description} and \gloskey{name} keys.
% This would mean that you can use fragile commands in the
%description and name when defining a new glossary entry, but not
% for the symbol.
%
% The default values are defined as:
%\begin{macro}{\@gls@sanitizedesc}
%    \begin{macrocode}
\newcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@sanitizename}
%    \begin{macrocode}
\newcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@sanitizesymbol}
%    \begin{macrocode}
\newcommand*{\@gls@sanitizesymbol}{\@onelevel@sanitize\@glo@symbol}
%    \end{macrocode}
%\end{macro}
% (There is no equivalent for the \gloskey{sort} key, since that
% is only provided for the benefit of \appname{makeindex} or
% \appname{xindy}, and so will always be sanitized.)
%
% Before defining the \pkgopt{sanitize} package option, The 
% key-value list for the \pkgopt{sanitize} value needs to be defined.
% These are all boolean keys. If they are not given a value, assume
% \texttt{true}.
%
% Firstly the \gloskey{description}. If set, it will redefine
% \cs{@gls@sanitizedesc} to use \cs{@onelevel@sanitize},
% otherwise \cs{@gls@sanitizedesc} will do nothing.
%    \begin{macrocode}
\define@boolkey[gls]{sanitize}{description}[true]{%
\ifgls@sanitize@description
  \renewcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}%
\else
  \renewcommand*{\@gls@sanitizedesc}{}%
\fi
}
%    \end{macrocode}
% Similarly for the \gloskey{name} key:
%    \begin{macrocode}
\define@boolkey[gls]{sanitize}{name}[true]{%
\ifgls@sanitize@name
  \renewcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}%
\else
  \renewcommand*{\@gls@sanitizename}{}%
\fi}
%    \end{macrocode}
% and for the \gloskey{symbol} key:
%    \begin{macrocode}
\define@boolkey[gls]{sanitize}{symbol}[true]{%
\ifgls@sanitize@symbol
  \renewcommand*{\@gls@sanitizesymbol}{%
\@onelevel@sanitize\@glo@symbol}%
\else
  \renewcommand*{\@gls@sanitizesymbol}{}%
\fi}
%    \end{macrocode}
%
%\begin{macro}{sanitize}
% Now define the \pkgopt{sanitize} option. It can either take
% a key-val list as its value, or it can take the keyword
% \texttt{none}, which is equivalent to \texttt{description=false,
% symbol=false, name=false}:
%    \begin{macrocode}
\define@key{glossaries.sty}{sanitize}[description=true,symbol=true,
name=true]{%
\ifthenelse{\equal{#1}{none}}{%
\renewcommand*{\@gls@sanitizedesc}{}%
\renewcommand*{\@gls@sanitizename}{}%
\renewcommand*{\@gls@sanitizesymbol}{}%
}{\setkeys[gls]{sanitize}{#1}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{translate}
%\changes{1.1}{2008 Feb 22}{translate option added}
% Define \pkgopt{translate} option. If false don't set up
% multi-lingual support.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{translate}[true]{}
%    \end{macrocode}
%\end{macro}
% Set the default value:
%    \begin{macrocode}
\glstranslatefalse
\@ifpackageloaded{translator}{\glstranslatetrue}{%
\@ifpackageloaded{babel}{\glstranslatetrue}{}}
%    \end{macrocode}
%
%\begin{macro}{footnote}
% Set the long form of the acronym in footnote on first use.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{%
\ifthenelse{\boolean{glsacrdescription}}{}%
{\renewcommand*{\@gls@sanitizedesc}{}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{description}
% Allow acronyms to have a description (needs to be set using
% the \gloskey{description} key in the optional argument of
% \ics{newacronym}).
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{description}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{smallcaps}
% Define \ics{newacronym} to set the short form in small capitals.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{smaller}
% Define \ics{newacronym} to set the short form using \cs{smaller}
% which obviously needs to be defined by loading the appropriate
% package.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{dua}
% Define \ics{newacronym} to always use the long forms 
% (i.e.\ don't use acronyms)
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{shotcuts}
% Define acronym shortcuts.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsorder}
% Stores the glossary ordering. This may either be \dq{word}
% or \dq{letter}. This passes the relevant information to
% \appname{makeglossaries}. The default is word ordering.
%    \begin{macrocode}
\newcommand*{\glsorder}{word}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@glsorder}
% The ordering information is written to the auxiliary file
% for \appname{makeglossaries}, so ignore the auxiliary 
% information.
%    \begin{macrocode}
\newcommand*{\@glsorder}[1]{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{order}
%\changes{1.17}{2008 December 26}{order package option added}
%    \begin{macrocode}
\define@choicekey{glossaries.sty}{order}{word,letter}{%
  \def\glsorder{#1}}
%    \end{macrocode}
%\end{macro}
%
%\changes{1.17}{2008 December 26}{added xindy support}
%\begin{macro}{\ifglsxindy}
%\changes{1.17}{2008 December 26}{new}
% Provide boolean to determine whether \appname{xindy} or
% \appname{makeindex} will be used to sort the glossaries.
%    \begin{macrocode}
\newif\ifglsxindy
%    \end{macrocode}
%\end{macro}
% The default is \appname{makeindex}:
%    \begin{macrocode}
\glsxindyfalse
%    \end{macrocode}
%
% Define package option to specify that \appname{makeindex} will 
% be used to sort the glossaries:
%    \begin{macrocode}
\DeclareOptionX{makeindex}{\glsxindyfalse}
%    \end{macrocode}
%
% The \pkgopt{xindy} package option may have a value which in
% turn can be a key=value list. First define the keys for this
% sub-list. The boolean "glsnumbers" determines whether to
% automatically add the \texttt{glsnumbers} letter group.
%    \begin{macrocode}
\define@boolkey[gls]{xindy}{glsnumbers}[true]{}
\gls@xindy@glsnumberstrue
%    \end{macrocode}
%
%\begin{macro}{\@xdy@main@language}
% Define what language to use for each glossary type (if a
% language is not defined for a particular glossary type
% the language specified for the main glossary is used.)
%    \begin{macrocode}
\def\@xdy@main@language{\rootlanguagename}%
%    \end{macrocode}
%\end{macro}
% Define key to set the language
%    \begin{macrocode}
\define@key[gls]{xindy}{language}{\def\@xdy@main@language{#1}}
%    \end{macrocode}
%
%\begin{macro}{\gls@codepage}
% Define the code page. If \ics{inputencodingname} is defined
% use that, otherwise have initialise with no codepage.
%    \begin{macrocode}
\@ifundefined{inputencodingname}{%
  \def\gls@codepage{}}{%
  \def\gls@codepage{\inputencodingname}
}
%    \end{macrocode}
% Define a key to set the code page.
%    \begin{macrocode}
\define@key[gls]{xindy}{codepage}{\def\gls@codepage{#1}}
%    \end{macrocode}
%\end{macro}
%
% Define package option to specify that \appname{xindy} will be 
% used to sort the glossaries:
%    \begin{macrocode}
\define@key{glossaries.sty}{xindy}[]{%
  \glsxindytrue
  \setkeys[gls]{xindy}{#1}%
}
%    \end{macrocode}
%
% Process package options:
%    \begin{macrocode}
\ProcessOptionsX
%    \end{macrocode}
%
% If chapters are defined and the user has requested the
% section counter as a package option, \cs{@chapter} will
% be modified so 
% that it adds a \texttt{section.}\meta{n}\texttt{.0} target, 
% otherwise entries placed before the first section of a chapter
% will have undefined links.
%
% The same problem will also occur if a lower sectional unit is
% used, but this is less likely to happen. If it does, or if
% you change \cs{glscounter} to "section" later, you
% will have to specify a different counter for the entries
% that give rise to a \texttt{name}"{"\meta{section-level}"."\meta{n}".0}"
% non-existent warning (e.g. "\gls[counter=chapter]{label}").
%    \begin{macrocode}
\ifthenelse{\equal{\glscounter}{section}}{%
\@ifundefined{chapter}{}{%
\let\@gls@old@chapter\@chapter
\def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}%
\@ifundefined{hyperdef}{}{\hyperdef{section}{\thesection}{}}}}}{}
%    \end{macrocode}
%
%\begin{macro}{\@gls@onlypremakeg}
% Some commands only have an effect when used before 
% \ics{makeglossaries}. So define a list of commands that
% should be disabled after \ics{makeglossaries}
%    \begin{macrocode}
\newcommand*{\@gls@onlypremakeg}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@onlypremakeg}
% Adds the specified control sequence to the list of commands that
% must be disabled after \ics{makeglossaries}.
%    \begin{macrocode}
\newcommand*{\@onlypremakeg}[1]{%
\ifx\@gls@onlypremakeg\@empty
   \def\@gls@onlypremakeg{#1}%
\else
   \expandafter\toks@\expandafter{\@gls@onlypremakeg}%
   \edef\@gls@onlypremakeg{\the\toks@,\noexpand#1}%
\fi}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@disable@onlypremakeg}
% Disable all commands listed in \cs{@gls@onlypremakeg}
%    \begin{macrocode}
\newcommand*{\@disable@onlypremakeg}{%
\@for\@thiscs:=\@gls@onlypremakeg\do{%
   \expandafter\@disable@premakecs\@thiscs%
}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@disable@premakecs}
% Disables the given command.
%    \begin{macrocode}
\newcommand*{\@disable@premakecs}[1]{%
  \def#1{\PackageError{glossaries}{\string#1\space may only be
  used before \string\makeglossaries}{You can't use
  \string#1\space after \string\makeglossaries}}%
}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Default values}\label{sec:predefinednames}
% This section sets up default values that are used by this
% package. Some of the names may already be defined (e.g.\ by
% \isty{babel}) so \cs{providecommand} is used.
%
% Main glossary title:
%\begin{macro}{\glossaryname}
%    \begin{macrocode}
\providecommand*{\glossaryname}{Glossary}
%    \end{macrocode}
%\end{macro}
% The title for the "acronym" glossary type (which is defined if 
% \pkgopt{acronym} package option is used) is given by
% \cs{acronymname}. If the \pkgopt{acronym}
% package option is not used, \cs{acronymname} won't be used.
%\begin{macro}{\acronymname}
%    \begin{macrocode}
\providecommand*{\acronymname}{Acronyms}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glssettoctitle}
% Sets the TOC title for the given glossary.
%\changes{1.15}{2008 August 15}{new}
%    \begin{macrocode}
\newcommand*{\glssettoctitle}[1]{%
\def\glossarytoctitle{\csname @glotype@#1@title\endcsname}}
%    \end{macrocode}
%\end{macro}
%
% The following commands provide text for the headers used by 
% some of the tabular-like glossary 
% styles. Whether or not they get used in the glossary depends on
% the glossary style.
%\begin{macro}{\entryname}
%    \begin{macrocode}
\providecommand*{\entryname}{Notation}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\descriptionname}
%    \begin{macrocode}
\providecommand*{\descriptionname}{Description}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\symbolname}
%    \begin{macrocode}
\providecommand*{\symbolname}{Symbol}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\pagelistname}
%    \begin{macrocode}
\providecommand*{\pagelistname}{Page List}
%    \end{macrocode}
%\end{macro}
% Labels for \appname{makeindex}'s symbol and number groups:
%\begin{macro}{\glssymbolsgroupname}
%    \begin{macrocode}
\providecommand*{\glssymbolsgroupname}{Symbols}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsnumbersgroupname}
%    \begin{macrocode}
\providecommand*{\glsnumbersgroupname}{Numbers}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glspluralsuffix}
% The default plural is formed by appending \cs{glspluralsuffix} to
% the singular form.
%    \begin{macrocode}
\newcommand*{\glspluralsuffix}{s}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\seename}
%    \begin{macrocode}
\providecommand*{\seename}{see}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\andname}
%    \begin{macrocode}
\providecommand*{\andname}{\&}
%    \end{macrocode}
%\end{macro}
% Add multi-lingual support\changes{1.08}{2007 Oct 13}{Added 
% babel support}. Thanks to everyone who contributed to the
% translations from both comp.text.tex and via email.
%    \begin{macrocode}
\ifglstranslate
%    \end{macrocode}
% If \isty{translator} is not install, used standard 
% \isty{babel} captions, otherwise load \isty{translator}
% dictionary.
%\changes{1.1}{2008 Feb 22}{Added support for translator package}
%\changes{1.15}{2008 August 15}{Added 'glssettoctitle}
%    \begin{macrocode}
  \@ifpackageloaded{translator}{\usedictionary{glossaries-dictionary}%
    \renewcommand*{\glssettoctitle}[1]{%
    \ifthenelse{\equal{#1}{main}}{%
      \translatelet{\glossarytoctitle}{Glossary}}{%
      \ifthenelse{\equal{#1}{acronym}}{%
        \translatelet{\glossarytoctitle}{Acronyms}}{%
        \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}}}}%
    \renewcommand*{\glossaryname}{\translate{Glossary}}%
    \renewcommand*{\acronymname}{\translate{Acronyms}}%
    \renewcommand*{\entryname}{\translate{Notation (glossaries)}}%
    \renewcommand*{\descriptionname}{%
      \translate{Description (glossaries)}}%
    \renewcommand*{\symbolname}{\translate{Symbol (glossaries)}}%
    \renewcommand*{\pagelistname}{%
      \translate{Page List (glossaries)}}%
    \renewcommand*{\glssymbolsgroupname}{%
      \translate{Symbols (glossaries)}}%
    \renewcommand*{\glsnumbersgroupname}{%
      \translate{Numbers (glossaries)}}%
  }{%
    \@ifpackageloaded{babel}{\RequirePackage{glossaries-babel}}{}}
\fi
%    \end{macrocode}
%\begin{macro}{\glspostdescription}
% The description terminator is given by \cs{glspostdescription}
% (except for the 3 and 4 column styles). This is a full stop
% by default:
%    \begin{macrocode}
\newcommand*{\glspostdescription}{.}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\nopostdesc}
% Provide a means to suppress description terminator for a given
% entry. (Useful for entries with no description.) Has no
% effect outside the glossaries.
%\changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\newcommand*{\nopostdesc}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@nopostdesc}
% Suppress next description terminator.
%    \begin{macrocode}
\newcommand*{\@nopostdesc}{%
  \let\org@glspostdescription\glspostdescription
  \def\glspostdescription{%
    \let\glspostdescription\org@glspostdescription}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glspar}
% Provide means of having a paragraph break in glossary entries
%    \begin{macrocode}
\newcommand{\glspar}{\par}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\setStyleFile}
% Sets the style file. The relevent extension is appended.
%    \begin{macrocode}
\ifglsxindy
  \newcommand{\setStyleFile}[1]{%
    \renewcommand{\istfilename}{#1.xdy}}
\else
  \newcommand{\setStyleFile}[1]{%
    \renewcommand{\istfilename}{#1.ist}}
\fi
%    \end{macrocode}
% This command only has an effect prior to using
% \ics{makeglossaries}.
%    \begin{macrocode}
\@onlypremakeg\setStyleFile
%    \end{macrocode}
%\end{macro}
%
% The name of the \appname{makeindex} or \appname{xindy} style file
% is given by \cs{istfilename}. This file is 
% created by \ics{writeist} (which is used by 
% \ics{makeglossaries}) so
% redefining this command will only have an effect if it is 
% done \emph{before} \cs{makeglossaries}. As from v1.17, use
% \ics{setStyleFile} instead of directly redefining \cs{istfilename}.
%\begin{macro}{\istfilename}
%\changes{1.17}{2008 December 26}{added xindy support}
%    \begin{macrocode}
\ifglsxindy
  \def\istfilename{\jobname.xdy}
\else
  \def\istfilename{\jobname.ist}
\fi
%    \end{macrocode}
%\end{macro}
% The \appname{makeglossaries} Perl script picks up this name
% from the auxiliary file. If the name ends with \filetype{.xdy}
% it calls \appname{xindy} otherwise it calls \appname{makeindex}.
% Since its not required by
% \LaTeX, \cs{@istfilename} ignores its argument.
%\begin{macro}{\@istfilename}
%    \begin{macrocode}
\newcommand*{\@istfilename}[1]{}
%    \end{macrocode}
%\end{macro}
%
% This command is the value of the \istkey{page\_compositor}
% \appname{makeindex} key. Again, any redefinition of this command 
% must take place \emph{before} \cs{writeist} otherwise it 
% will have no effect. As from 1.17, use \ics{glsSetCompositor}
% instead of directly redefining \cs{glscompositor}.
%\begin{macro}{\glscompositor}
%    \begin{macrocode}
\newcommand*{\glscompositor}{.}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsSetCompositor}
% Sets the compositor.
%    \begin{macrocode}
\newcommand*{\glsSetCompositor}[1]{%
  \renewcommand*{\glscompositor}{#1}}
%    \end{macrocode}
% Only use before \ics{makeglossaries}
%    \begin{macrocode}
\@onlypremakeg\glsSetCompositor
%    \end{macrocode}
%\end{macro}
%
% (The page compositor is usually defined as a dash when using
% \appname{makeindex}, but most of the standard counters used
% by \LaTeX\ use a full stop as the compositor, which is why I
% have used it as the default.) If \appname{xindy} is used 
% \cs{glscompositor} only affects the \texttt{arabic-page-numbers}
% location class.
%\begin{macro}{\@glsAlphacompositor}
% This is only used by \appname{xindy}. It specifies the
% compositor to use when location numbers are in the form
% \meta{letter}\meta{compositor}\meta{number}. For example,
% if \cs{@glsAlphacompositor} is set to ``.'' then it allows
% locations such as A.1 whereas if \cs{@glsAlphacompositor} is
% set to ``-'' then it allows locations such as A-1.
%    \begin{macrocode}
\newcommand*{\@glsAlphacompositor}{\glscompositor}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsSetAlphaCompositor}
% Sets the alpha compositor.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*\glsSetAlphaCompositor[1]{%
     \renewcommand*\@glsAlphacompositor{#1}}
\else
  \newcommand*\glsSetAlphaCompositor[1]{%
    \glsnoxindywarning\glsSetAlphaCompositor}
\fi
%    \end{macrocode}
% Can only be used before \ics{makeglossaries}
%    \begin{macrocode}
\@onlypremakeg\glsSetAlphaCompositor
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\gls@suffixF}
%\changes{1.17}{2008 December 26}{new}
% Suffix to use for a two page list. This overrides the separator
% and the closing page number if set to something other than
% an empty macro.
%    \begin{macrocode}
\newcommand*{\gls@suffixF}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsSetSuffixF}
%\changes{1.17}{2008 December 26}{new}
% Sets the suffix to use for a two page list.
%    \begin{macrocode}
\newcommand*{\glsSetSuffixF}[1]{%
  \renewcommand*{\gls@suffixF}{#1}}
%    \end{macrocode}
% Only has an effect when used before \ics{makeglossaries}
%    \begin{macrocode}
\@onlypremakeg\glsSetSuffixF
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\gls@suffixFF}
%\changes{1.17}{2008 December 26}{new}
% Suffix to use for a three page list. This overrides the separator
% and the closing page number if set to something other than
% an empty macro.
%    \begin{macrocode}
\newcommand*{\gls@suffixFF}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsSetSuffixFF}
%\changes{1.17}{2008 December 26}{new}
% Sets the suffix to use for a three page list.
%    \begin{macrocode}
\newcommand*{\glsSetSuffixFF}[1]{%
  \renewcommand*{\gls@suffixFF}{#1}}
%    \end{macrocode}
%\end{macro}
%
% The command \cs{glsnumberformat} indicates the default
% format for the page numbers in the glossary. (Note that this
% is not the same as \ics{glossaryentrynumbers}, but applies
% to individual numbers or groups of numbers within an entry's
% associated number list.) If hyperlinks are defined, it will use
% \ics{glshypernumber}, otherwise it will simply display its 
% argument ``as is''.
%\begin{macro}{\glsnumberformat}
%    \begin{macrocode}
\@ifundefined{hyperlink}{%
\newcommand*{\glsnumberformat}[1]{#1}}{%
\newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%
% Individual numbers in an entry's associated number list are
% delimited using \cs{delimN} (which corresponds to the 
% \istkey{delim\_n} \appname{makeindex} keyword). The default value
% is a comma followed by a space.
%\begin{macro}{\delimN}
%    \begin{macrocode}
\newcommand{\delimN}{, }
%    \end{macrocode}
%\end{macro}
% A range of numbers within an entry's associated number list is
% delimited using \cs{delimR} (which corresponds to the
% \istkey{delim\_r} \appname{makeindex} keyword). The default is
% an en-dash.
%\begin{macro}{\delimR}
%    \begin{macrocode}
\newcommand{\delimR}{--}
%    \end{macrocode}
%\end{macro}
%
% The glossary preamble is given by \cs{glossarypreamble}. This
% will appear after the glossary sectioning command, and before the
% \envname{theglossary} environment. It is designed to allow the
% user to add information pertaining to the glossary (e.g.\ ``page
% numbers in italic indicate the primary definition'') therefore 
% \cs{glossarypremable} shouldn't be affected by the glossary
% style. (So if you define your own glossary style, don't have it 
% change \cs{glossarypreamble}.) The preamble is empty by
% default. If you have multiple glossaries, and you want a 
% different preamble for each glossary, you will need to use
% \ics{printglossary} for each glossary type, instead of 
% \ics{printglossaries}, and redefine \cs{glossarypreamble}
% before each \ics{printglossary}.
%\begin{macro}{\glossarypreamble}
%    \begin{macrocode}
\newcommand*{\glossarypreamble}{}
%    \end{macrocode}
%\end{macro}
%
% The glossary postamble is given by \cs{glossarypostamble}.
% This is provided to allow the user to
% add something after the end of the \envname{theglossary}
% environment (again, this shouldn't be affected by the
% glossary style). It is, of course, possible to simply add the
% text after \ics{printglossary}, but if you only want the
% postamble to appear after the first glossary, but not after 
% subsequent glossaries, you can do something like:
%\begin{verbatim}
%\renewcommand{\glossarypostamble}{For a complete list of terms
%see \cite{blah}\gdef\glossarypreamble{}}
%\end{verbatim}
%\begin{macro}{\glossarypostamble}
%    \begin{macrocode}
\newcommand*{\glossarypostamble}{}
%    \end{macrocode}
%\end{macro}
%
% The sectioning command that starts a glossary is given by
% \cs{glossarysection}. (This does not form part of the
% glossary style, and so should not be changed by a glossary
% style.) If \ics{phantomsection}
% is defined, it uses \cs{\@p@glossarysection}, otherwise it
% uses \cs{@glossarysection}.
%\changes{1.05}{2007 Aug 10}{added '@mkboth to 'glossarysection}
%\begin{macro}{\glossarysection}
%    \begin{macrocode}
\newcommand*{\glossarysection}[2][\@gls@title]{%
\def\@gls@title{#2}%
\@ifundefined{phantomsection}{%
\@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}%
\@mkboth{\glossarytoctitle}{\glossarytoctitle}%
}
%    \end{macrocode}
%\end{macro}
%
% The required sectional unit is given by \cs{@@glossarysec}
% which was defined by the \pkgopt{section} package option. The
% starred form of the command is chosen. If you don't want any sectional
% command, you will need to redefine \cs{glossarysection}.
% The sectional unit can be changed, if different sectional units
% are required.
%\begin{macro}{\setglossarysection}
%\changes{1.1}{2008 Feb 22}{new}
%    \begin{macrocode}
\newcommand*{\setglossarysection}[1]{%
\setkeys{glossaries.sty}{section=#1}}
%    \end{macrocode}
%\end{macro}
%
%The command \cs{@glossarysection} indicates how to start
% the glossary section if \ics{phantomsection} is not defined.
%\begin{macro}{\@glossarysection}
%\changes{1.1}{2008 Feb 22}{numbered sections and auto label added}
%    \begin{macrocode}
\newcommand*{\@glossarysection}[2]{%
\ifx\@@glossarysecstar\@empty
  \csname\@@glossarysec\endcsname{#2}%
\else
  \csname\@@glossarysec\endcsname*{#2}%
  \@gls@toc{#1}{\@@glossarysec}%
\fi
\@@glossaryseclabel}
%    \end{macrocode}
%\end{macro}
%
% As \cs{@glossarysection}, but put in 
% \ics{phantomsection}, and swap where \cs{@gls@toc} goes. 
% If using chapters do a \cs{clearpage}. This ensures that
% the hyper link from the table of contents leads to the line above
% the heading, rather than the line below it.
%\begin{macro}{\@p@glossarysection}
%\changes{1.1}{2008 Feb 22}{numbered sections and auto label added}
%    \begin{macrocode}
\newcommand*{\@p@glossarysection}[2]{%
\glsclearpage
\phantomsection
\ifx\@@glossarysecstar\@empty
  \csname\@@glossarysec\endcsname{#2}%
\else
  \@gls@toc{#1}{\@@glossarysec}%
  \csname\@@glossarysec\endcsname*{#2}%
\fi
\@@glossaryseclabel}
%    \end{macrocode}
%\end{macro}
%
%The \cs{gls@doclearpage} command is used to issue a
% \cs{clearpage} (or \cs{cleardoublepage}) depending
% on whether the glossary sectional unit is a chapter. If the
% sectional unit is something else, do nothing.
%\begin{macro}{\gls@doclearpage}
%    \begin{macrocode}
\newcommand*{\gls@doclearpage}{%
\ifthenelse{\equal{\@@glossarysec}{chapter}}{%
\@ifundefined{cleardoublepage}{\clearpage}{\cleardoublepage}}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsclearpage}
% This just calls \cs{gls@doclearpage}, but it makes it easier to
% have a user command so that the user can override it.
%\changes{1.19}{2009 Mar 2}{new}
%    \begin{macrocode}
\newcommand*{\glsclearpage}{\gls@doclearpage}
%    \end{macrocode}
%\end{macro}
%
% The glossary is added to the table of contents if glstoc flag set.
% If it is set, \cs{@gls@toc} will add a line to the 
% \filetype{.toc} file, otherwise it will do nothing.
% (The first argument to \cs{@gls@toc} is the title for the
% table of contents, the second argument is the sectioning type.) 
%\begin{macro}{\@gls@toc}
%\changes{1.1}{2008 Feb 22}{numberline added}
%    \begin{macrocode}
\newcommand*{\@gls@toc}[2]{%
\ifglstoc
  \ifglsnumberline
    \addcontentsline{toc}{#2}{\numberline{}#1}%
  \else
    \addcontentsline{toc}{#2}{#1}%
  \fi
\fi}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Xindy}
% This section defines commands that only have an effect if
% \appname{xindy} is used to sort the glossaries.
%\begin{macro}{\glsnoxindywarning}
% Issues a warning if \appname{xindy} hasn't been specified.
% These warnings can be suppressed by redefining 
% \cs{glsnoxindywarning} to ignore its argument
%    \begin{macrocode}
\newcommand*{\glsnoxindywarning}[1]{%
  \PackageWarning{glossaries}{Not in xindy mode --- ignoring
  \string#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@xdyattributes}
% Define list of attributes (\cs{string} is used in case
% the double quote character has been made active)
%    \begin{macrocode}
\ifglsxindy
  \edef\@xdyattributes{\string"default\string"}%
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@xdylocref}
% Define list of markup location references.
%    \begin{macrocode}
\ifglsxindy
  \def\@xdylocref{}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\GlsAddXdyAttribute}
% Adds an attribute.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*\GlsAddXdyAttribute[1]{%
  \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string"}%
  \expandafter\toks@\expandafter{\@xdylocref}%
  \edef\@xdylocref{\the\toks@ ^^J%
  (markup-locref
  :open \string"\string~n\string\setentrycounter
    {\noexpand\glscounter}%
    \expandafter\string\csname#1\endcsname
    \expandafter\@gobble\string\{\string" ^^J
  :close \string"\expandafter\@gobble\string\}\string" ^^J
  :attr \string"#1\string")}}
%    \end{macrocode}
% Only has an effect before \ics{writeist}:
%    \begin{macrocode}
  \@onlypremakeg\GlsAddXdyAttribute
\else
  \newcommand*\GlsAddXdyAttribute[1]{%
    \glsnoxindywarning\GlsAddXdyAttribute}
\fi
%    \end{macrocode}
%\end{macro}
% Add known attributes:
%    \begin{macrocode}
\ifglsxindy
  \GlsAddXdyAttribute{glsnumberformat}
  \GlsAddXdyAttribute{textrm}
  \GlsAddXdyAttribute{textsf}
  \GlsAddXdyAttribute{texttt}
  \GlsAddXdyAttribute{textbf}
  \GlsAddXdyAttribute{textmd}
  \GlsAddXdyAttribute{textit}
  \GlsAddXdyAttribute{textup}
  \GlsAddXdyAttribute{textsl}
  \GlsAddXdyAttribute{textsc}
  \GlsAddXdyAttribute{emph}
  \GlsAddXdyAttribute{glshypernumber}
  \GlsAddXdyAttribute{hyperrm}
  \GlsAddXdyAttribute{hypersf}
  \GlsAddXdyAttribute{hypertt}
  \GlsAddXdyAttribute{hyperbf}
  \GlsAddXdyAttribute{hypermd}
  \GlsAddXdyAttribute{hyperit}
  \GlsAddXdyAttribute{hyperup}
  \GlsAddXdyAttribute{hypersl}
  \GlsAddXdyAttribute{hypersc}
  \GlsAddXdyAttribute{hyperemph}
\fi
%    \end{macrocode}
%
%\begin{macro}{\@xdyuseralphabets}
% List of additional alphabets
%    \begin{macrocode}
\def\@xdyuseralphabets{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlsAddXdyAlphabet}
% \cs{GlsAddXdyAlphabet}\marg{name}\marg{definition}
% adds a new alphabet called \meta{name}. The definition
% must use \appname{xindy} syntax.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*{\GlsAddXdyAlphabet}[2]{%
  \edef\@xdyuseralphabets{%
    \@xdyuseralphabets ^^J
    (define-alphabet "#1" (#2))}}
\else
  \newcommand*{\GlsAddXdyAlphabet}[2]{%
     \glsnoxindywarning\GlsAddXdyAlphabet}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@xdyuserlocationdefs}
% List of additional location definitions
% (separated by "^^J")
%    \begin{macrocode}
\def\@xdyuserlocationdefs{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@xdyuserlocationnames}
% List of additional user location names
%    \begin{macrocode}
\def\@xdyuserlocationnames{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\GlsAddXdyLocation}
% \cs{GlsAddXdyLocation}\marg{name}\marg{definition}
% Define a new location called \meta{name}. The definition
% must use \appname{xindy} syntax. (Note that this doesn't
% check to see if the location is already defined. That is left
% to \appname{xindy} to complain about.)
%    \begin{macrocode}
\ifglsxindy
   \newcommand*{\GlsAddXdyLocation}[2]{%
     \edef\@xdyuserlocationdefs{%
        \@xdyuserlocationdefs ^^J%
        (define-location-class \string"#1\string"^^J\space\space
        \space(#2))
     }%
     \edef\@xdyuserlocationnames{%
        \@xdyuserlocationnames^^J\space\space\space
        \string"#1\string"}%
   }
%    \end{macrocode}
% Only has an effect before \ics{writeist}:
%    \begin{macrocode}
  \@onlypremakeg\GlsAddXdyLocation
\else
   \newcommand*{\GlsAddXdyLocation}[2]{%
     \glsnoxindywarning\GlsAddXdyLocation}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@xdylocationclassorder}
% Define location class order
%    \begin{macrocode}
\ifglsxindy
  \edef\@xdylocationclassorder{^^J\space\space\space
    \string"roman-page-numbers\string"^^J\space\space\space
    \string"arabic-page-numbers\string"^^J\space\space\space
    \string"arabic-section-numbers\string"^^J\space\space\space
    \string"alpha-page-numbers\string"^^J\space\space\space 
    \string"Roman-page-numbers\string"^^J\space\space\space
    \string"Alpha-page-numbers\string"^^J\space\space\space
    \string"Appendix-page-numbers\string"
    \@xdyuserlocationnames^^J\space\space\space
    \string"see\string"
   }
\fi
%    \end{macrocode}
%\end{macro}
% Change the location order.
%\begin{macro}{\GlsSetXdyLocationClassOrder}
%    \begin{macrocode}
\ifglsxindy
  \newcommand*\GlsSetXdyLocationClassOrder[1]{%
    \def\@xdylocationclassorder{#1}}
\else
  \newcommand*\GlsSetXdyLocationClassOrder[1]{%
    \glsnoxindywarning\GlsSetXdyLocationClassOrder}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@xdysortrules}
% Define sort rules
%    \begin{macrocode}
\ifglsxindy
  \def\@xdysortrules{}
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlsAddSortRule}
% Add a sort rule
%    \begin{macrocode}
\ifglsxindy
  \newcommand*\GlsAddSortRule[2]{%
    \expandafter\toks@\expandafter{\@xdysortrules}%
    \protected@edef\@xdysortrules{\the\toks@ ^^J
     (sort-rule \string"#1\string" \string"#2\string")}%
  }
\else
  \newcommand*\GlsAddSortRule[2]{%
    \glsnoxindywarning\GlsAddSortRule}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@xdyrequiredstyles}
% Define list of required styles (this should be a comma-separated
% list of \appname{xindy} styles)
%    \begin{macrocode}
\ifglsxindy
  \def\@xdyrequiredstyles{tex}
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlsAddXdyStyle}
% Add a \appname{xindy} style to the list of required styles
%    \begin{macrocode}
\ifglsxindy
  \newcommand*\GlsAddXdyStyle[1]{%
    \edef\@xdyrequiredstyles{\@xdyrequiredstyles,#1}}%
\else
  \newcommand*\GlsAddXdyStyle[1]{%
    \glsnoxindywarning\GlsAddXdyStyle}
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlsSetXdyStyles}
% Reset the list of required styles
%    \begin{macrocode}
\ifglsxindy
  \newcommand*\GlsSetXdyStyles[1]{%
    \edef\@xdyrequiredstyles{#1}}
\else
  \newcommand*\GlsSetXdyStyles[1]{%
    \glsnoxindywarning\GlsSetXdyStyles}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\findrootlanguage}
% The root language name is required by \appname{xindy}. This
% information is for \appname{makeglossaries} to pass to
% \appname{xindy}. Since \ics{languagename} only stores the
% regional dialect rather than the root language name, some
% trickery is required to determine the root language.
%    \begin{macrocode}
\ifglsxindy
  \@ifpackageloaded{babel}{%
%    \end{macrocode}
% Need to parse \texttt{babel.sty} to determine the root language.
% This code was provided by Enrico~Gregorio.
%    \begin{macrocode}
  \def\findrootlanguage{\begingroup
    \escapechar=-1\relax
%    \end{macrocode}
% normalize \cs{languagename} to category 12 chars
%    \begin{macrocode}
    \edef\languagename{%
      \expandafter\string\csname\languagename\endcsname}%
%    \end{macrocode}
% disable \texttt{babel.sty} useless commands
%    \begin{macrocode}
    \def\NeedsTeXFormat##1[##2]{}%
    \def\ProvidesPackage##1[##2]{}%
    \let\LdfInit\relax
    \def\languageattribute##1##2{}%
%    \end{macrocode}
% change the meaning of \cs{DeclareOption}
%    \begin{macrocode}
    \def\DeclareOption##1##2{%
%    \end{macrocode}
% at \cs{DeclareOption*} we end
%    \begin{macrocode}
      \ifx##1*\expandafter\endinput\else
%    \end{macrocode}
% else we build a string with the first argument
%    \begin{macrocode}
      \edef\testlanguage{\expandafter\string\csname##1\endcsname}%
%    \end{macrocode}
% if \cs{testlanguage} and \cs{languagename} are the same
% we execute the second argument
%    \begin{macrocode}
      \ifx\testlanguage\languagename##2\fi
    \fi}
%    \end{macrocode}
% almost all options of babel are \cs{input}"{"\meta{name}".ldf}"
%    \begin{macrocode}
  \def\input##1{\stripldf##1}%
%    \end{macrocode}
% we put the root language name in \ics{rootlanguagename}
%    \begin{macrocode}
  \def\stripldf##1.ldf{\gdef\rootlanguagename{##1}}%
%    \end{macrocode}
% now input babel.sty, using the primitive \cs{input}
%    \begin{macrocode}
  \@@input babel.sty
  \endgroup}%
  }{%
%    \end{macrocode}
% \isty{babel} hasn't been loaded, so check if \isty{ngerman} has
% been loaded
%    \begin{macrocode}
    \@ifpackageloaded{ngerman}{%
       \def\findrootlanguage{%
         \def\rootlanguagename{german}}%
    }{%
%    \end{macrocode}
% Neither \sty{babel} nor \sty{ngerman} have been loaded, so
% assume the root language is English
%    \begin{macrocode}
       \def\findrootlanguage{%
         \def\rootlanguagename{english}}%
    }%
  }%
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\rootlanguagename}
% Set default root language to English.
%    \begin{macrocode}
\def\rootlanguagename{english}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@xdylanguage}
% The \appname{xindy} language setting is required by 
% \appname{makeglossaries}, so provide a command for 
% \appname{makeglossaries} to pick up the information
% from the auxiliary file.  This command is not needed by the 
% \sty{glossaries} package, so define it to ignore its arguments.
%    \begin{macrocode}
\def\@xdylanguage#1#2{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\GlsSetXdyLanguage}
% Define a command that allows the user to set the language
% for a given glossary type. The first argument indicates the
% glossary type. If omitted the main glossary is assumed.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*\GlsSetXdyLanguage[2][\glsdefaulttype]{%
  \ifglossaryexists{#1}{%
    \expandafter\def\csname @xdy@#1@language\endcsname{#2}%
  }{%
    \PackageError{glossaries}{Can't set language type for
    glossary type `#1' --- no such glossary}{%
    You have specified a glossary type that doesn't exist}}}
\else
  \newcommand*\GlsSetXdyLanguage[2][]{%
    \glsnoxindywarning\GlsSetXdyLanguage}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@codepage}
% The \appname{xindy} codepage setting is required by 
% \appname{makeglossaries}, so provide a command for 
% \appname{makeglossaries} to pick up the information
% from the auxiliary file.  This command is not needed by the 
% \sty{glossaries} package, so define it to ignore its arguments.
%    \begin{macrocode}
\def\@gls@codepage#1#2{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\GlsSetXdyCodePage}
% Define command to set the code page.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*{\GlsSetXdyCodePage}[1]{%
    \renewcommand*{\gls@codepage}{#1}%
  }
\else
  \newcommand*{\GlsSetXdyCodePage}[1]{%
    \glsnoxindywarning\GlsSetXdyCodePage}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@xdylettergroups}
% Store letter group definitions.
%    \begin{macrocode}
\ifglsxindy
  \ifgls@xindy@glsnumbers
    \def\@xdylettergroups{(define-letter-group
       \string"glsnumbers\string"^^J\space\space\space
       :prefixes (\string"0\string" \string"1\string"
       \string"2\string" \string"3\string" \string"4\string"
       \string"5\string" \string"6\string" \string"7\string"
       \string"8\string" \string"9\string")^^J\space\space\space
       :before \string"\@glsfirstletter\string")}
  \else
    \def\@xdylettergroups{}
  \fi
\fi
%   \end{macrocode}
%\end{macro}
%
%\begin{macro}{\GlsAddLetterGroup}
% Add a new letter group. The first argument is the name
% of the letter group. The second argument is the \appname{xindy}
% code specifying prefixes and ordering.
%    \begin{macrocode}
  \newcommand*\GlsAddLetterGroup[2]{%
    \expandafter\toks@\expandafter{\@xdylettergroups}%
    \protected@edef\@xdylettergroups{\the\toks@^^J%
    (define-letter-group \string"#1\string"^^J\space\space\space#2)}%
  }%
%    \end{macrocode}
%\end{macro}
%
%\subsection{Loops and conditionals}
% To iterate through all glossaries (or comma-separated list of
% glossary names given in optional argument) use:\\[10pt]
% \cs{forallglossaries}\oarg{glossary list}\marg{cmd}\marg{code}\\[10pt]
% where \meta{cmd} is
% a control sequence which will be set to the name of the
% glossary in the current iteration.
%\begin{macro}{\forallglossaries}
%    \begin{macrocode}
\newcommand*{\forallglossaries}[3][\@glo@types]{%
\@for#2:=#1\do{\ifthenelse{\equal{#2}{}}{}{#3}}}
%    \end{macrocode}
%\end{macro}
%
% To iterate through all entries in a given glossary use:\\[10pt]
%\cs{forglsentries}\oarg{type}\marg{cmd}\marg{code}\\[10pt]
%where \meta{type} is the glossary label and \meta{cmd} is a
% control sequence which will be set to the entry label in the
% current iteration.
%\begin{macro}{\forglsentries}
%    \begin{macrocode}
\newcommand*{\forglsentries}[3][\glsdefaulttype]{%
\edef\@@glo@list{\csname glolist@#1\endcsname}%
\@for#2:=\@@glo@list\do{%
\ifthenelse{\equal{#2}{}}{}{#3}}}
%    \end{macrocode}
%\end{macro}
%
% To iterate through all glossary entries over all glossaries listed
% in the optional argument (the default is all glossaries) use:\\[10pt] 
% \cs{forallglsentries}\oarg{glossary list}\marg{cmd}\marg{code}\\[10pt]
% Within \cs{forallglsentries}, the current glossary type
% is given by \cs{@@this@glo@}.
%\begin{macro}{\forallglsentries}
%    \begin{macrocode}
\newcommand*{\forallglsentries}[3][\@glo@types]{%
\expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}{%
\forglsentries[\@@this@glo@]{#2}{#3}}}
%    \end{macrocode}
%\end{macro}
%
% To check to see if a glossary exists use:\\[10pt]
%\cs{ifglossaryexists}\marg{type}\marg{true-text}\marg{false-text}\\[10pt]
%where \meta{type} is the glossary's label.
%\begin{macro}{\ifglossaryexists}
%    \begin{macrocode}
\newcommand{\ifglossaryexists}[3]{%
\@ifundefined{@glotype@#1@out}{#3}{#2}}
%    \end{macrocode}
%\end{macro}
%
% To check to see if a glossary entry has been defined use:\\[10pt]
% \cs{ifglsentryexists}\marg{label}\marg{true text}\marg{false text}\\[10pt]
%where \meta{label} is the entry's label.
%\begin{macro}{\ifglsentryexists}
%    \begin{macrocode}
\newcommand{\ifglsentryexists}[3]{%
\@ifundefined{glo@#1@name}{#3}{#2}}
%    \end{macrocode}
%\end{macro}
%
% To determine if given glossary entry has been 
% used in the document text yet use:\\[10pt]
% \cs{ifglsused}\marg{label}\marg{true text}\marg{false text}\\[10pt]
% where \meta{label} is the entry's label.
% If true it will do \meta{true text}
% otherwise it will do \meta{false text}.
%\begin{macro}{\ifglsused}
%    \begin{macrocode}
\newcommand*{\ifglsused}[3]{\ifthenelse{\boolean{glo@#1@flag}}{#2}{#3}}
%    \end{macrocode}
%\end{macro}
%The following two commands will cause an error if the given
% condition fails:
%
%\cs{glsdoifexists}\marg{label}\marg{code}\par
% Generate an error if entry specified by \meta{label} doesn't 
% exists, otherwise do \meta{code}.
%\begin{macro}{\glsdoifexists}
%    \begin{macrocode}
\newcommand{\glsdoifexists}[2]{\ifglsentryexists{#1}{#2}{%
\PackageError{glossaries}{Glossary entry `#1' has not been
defined.}{You need to define a glossary entry before you
can use it.}}}
%    \end{macrocode}
%\end{macro}
%
%\cs{glsdoifnoexists}\marg{label}\marg{code}\par
% The opposite: only do second argument if the entry doesn't
% exists. Generate an error message if it exists.
%\begin{macro}{\glsdoifnoexists}
%    \begin{macrocode}
\newcommand{\glsdoifnoexists}[2]{\ifglsentryexists{#1}{%
\PackageError{glossaries}{Glossary entry `#1' has already
been defined.}{}}{#2}}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Defining new glossaries}\label{sec:newglos}
% A comma-separated list of glossary names is stored
% in \cs{@glo@types}. When a new glossary type
% is created, its identifying name is added to this list.
% This is used by commands that iterate through all glossaries
% (such as \ics{makeglossaries} and \ics{printglossaries}).
%\begin{macro}{\@glo@types}
%    \begin{macrocode}
\newcommand*{\@glo@types}{,}
%    \end{macrocode}
%\end{macro}
%
% A new glossary type is defined using \cs{newglossary}.
% Syntax:\\[10pt]\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}%
%\marg{title}\oarg{counter}\\[10pt]%
% where \meta{log-ext} is the extension of the \appname{makeindex}
% transcript file, \meta{in-ext} is the extension of the glossary 
% input file (read in by \ics{printglossary} and created by
% \appname{makeindex}), \meta{out-ext} is the extension of the
% glossary output file which is read in by \appname{makeindex} 
% (lines are written to this file by the \ics{glossary} command),
% \meta{title} is the title of the glossary that is used in
% \ics{glossarysection} and
% \meta{counter} is the default counter to be used by entries
% belonging to this glossary. The \appname{makeglossaries} Perl
% script reads in the relevant extensions from the auxiliary file,
% and passes the appropriate file names and switches to 
% \appname{makeindex}.
%\begin{macro}{\newglossary}
%    \begin{macrocode}
\newcommand*{\newglossary}[5][glg]{%
\ifglossaryexists{#2}{%
\PackageError{glossaries}{Glossary type `#2' already exists}{%
You can't define a new glossary called `#2' because it already
exists}%
}{%
%    \end{macrocode}
% Add this to the list of glossary types:
%    \begin{macrocode}
\toks@{#2}\edef\@glo@types{\@glo@types\the\toks@,}%
%    \end{macrocode}
% Define a comma-separated list of labels for this glossary type, 
% so that all the entries for this glossary can be reset with a 
% single command. When a new entry is created, its label is added
% to this list.
%    \begin{macrocode}
\expandafter\gdef\csname glolist@#2\endcsname{,}%
%    \end{macrocode}
% Store details of this new glossary type:
%    \begin{macrocode}
\expandafter\def\csname @glotype@#2@in\endcsname{#3}%
\expandafter\def\csname @glotype@#2@out\endcsname{#4}%
\expandafter\def\csname @glotype@#2@title\endcsname{#5}%
\protected@write\@auxout{}{\string\@newglossary{#2}{#1}{#3}{#4}}%
%    \end{macrocode}
% How to display this entry in the document text (uses
% \cs{glsdisplay} and \cs{glsdisplayfirst} by
% default). These can be redefined by the user later if required
% (see \ics{defglsdisplay} and \ics{defglsdisplayfirst})
%    \begin{macrocode}
\expandafter\gdef\csname gls@#2@display\endcsname{%
\glsdisplay}%
\expandafter\gdef\csname gls@#2@displayfirst\endcsname{%
\glsdisplayfirst}%
%    \end{macrocode}
% Find out if the final optional argument has been specified, and
% use it to set the counter associated with this glossary. (Uses
% \ics{glscounter} if no optional argument is present.)
%    \begin{macrocode}
\@ifnextchar[{\@gls@setcounter{#2}}{\@gls@setcounter{#2}[\glscounter]}}}
%    \end{macrocode}
%\end{macro}
% Only define new glossaries in the preamble:
%    \begin{macrocode}
\@onlypreamble{\newglossary}
%    \end{macrocode}
% Only define new glossaries before \ics{makeglossaries}
%    \begin{macrocode}
\@onlypremakeg\newglossary
%    \end{macrocode}
%\cs{@newglossary} is used to specify the file extensions
% for the \appname{makeindex} input, output and transcript files.
% It is written to the auxiliary file by \ics{newglossary}.
% Since it is not used by \LaTeX, \cs{@newglossary} simply
% ignores its arguments.
%\begin{macro}{\@newglossary}
%    \begin{macrocode}
\newcommand*{\@newglossary}[4]{}
%    \end{macrocode}
%\end{macro}
% Store counter to be used for given glossary type (the first
% argument is the glossary label, the second argument is the name 
% of the counter):
%\begin{macro}{\@gls@setcounter}
%    \begin{macrocode}
\def\@gls@setcounter#1[#2]{%
\expandafter\def\csname @glotype@#1@counter\endcsname{#2}%
}
%    \end{macrocode}
%\end{macro}
% Get counter associated with given glossary (the argument is
% the glossary label):
%\begin{macro}{\@gls@getcounter}
%    \begin{macrocode}
\newcommand*{\@gls@getcounter}[1]{%
\csname @glotype@#1@counter\endcsname}
%    \end{macrocode}
%\end{macro}
%
% Define the main glossary. This will be the first glossary to
% be displayed when using \ics{printglossaries}.
%    \begin{macrocode}
\newglossary{main}{gls}{glo}{\glossaryname}
%    \end{macrocode}
%
%\subsection{Defining new entries}\label{sec:newentry}
% New glossary entries are defined using \cs{newglossaryentry}.
% This command requires a label and a key-value list that defines
% the relevant information for that entry. The definition for these
% keys follows. Note that the \gloskey{name},
% \gloskey{description} and \gloskey{symbol} keys will be
% sanitized later, depending on the value of the package option
% \pkgopt{sanitize} (this means that if some of the keys haven't
% been defined, they can be constructed from the \gloskey{name}
% and \gloskey{description} key before they are sanitized).
%
%
%\begin{macro}{name}
%The \gloskey{name} key indicates the name
% of the term being defined. This is how the term will appear in
% the glossary. The \gloskey{name} key is required when defining
% a new glossary entry.
%    \begin{macrocode}
\define@key{glossentry}{name}{%
\def\@glo@name{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{description}
% The \gloskey{description} key is usually only used in
% the glossary, but can be made to appear in the text by redefining
% \ics{glsdisplay} and \ics{glsdisplayfirst} (or
% using \ics{defglsdisplay} and \ics{defglsdisplayfirst}), however,
% you will have to disable the sanitize option (using the 
% \pkgopt{sanitize} package option, 
% "sanitize={description=false}", and protect fragile
% commands). The \gloskey{description} key is required when
% defining a new glossary entry. (Be careful not to make the
% description too long, because \appname{makeindex} has a limited
% buffer. \cs{@glo@desc} is defined to be a short command 
% to discourage lengthy descriptions
% for this reason. If you do have a very long description, or if
% you require paragraph breaks, define a separate command that 
% contains the description, and use it as the value to the 
% \gloskey{description} key.)
%    \begin{macrocode}
\define@key{glossentry}{description}{%
\def\@glo@desc{#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{descriptionplural}
% \changes{1.12}{2008 Mar 8}{new}
%    \begin{macrocode}
\define@key{glossentry}{descriptionplural}{%
\def\@glo@descplural{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{sort}
% The \gloskey{sort} key needs to be sanitized here 
% (the sort key is provided for \appname{makeindex}'s benefit, 
% not for use in the document). The \gloskey{sort} key is optional
% when defining a new glossary entry. If omitted, the value 
% is given by \meta{name} \meta{description}.
%\changes{1.18}{2009 January 14}{moved sanitization to 'newglossaryentry}
%    \begin{macrocode}
\define@key{glossentry}{sort}{%
\def\@glo@sort{#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{text}
% The \gloskey{text} key determines how the term should appear when
% used in the document (i.e.\ outside of the glossary). If omitted, 
% the value of the \gloskey{name} key is used instead.
%    \begin{macrocode}
\define@key{glossentry}{text}{%
\def\@glo@text{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{plural}
% The \gloskey{plural} key determines how the plural form of the term
% should be displayed in the document. If omitted, the plural is
% constructed by appending \ics{glspluralsuffix} to the value of the 
% \gloskey{text} key.
%    \begin{macrocode}
\define@key{glossentry}{plural}{%
\def\@glo@plural{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{first}
% The \gloskey{first} key determines how the entry should be displayed
% in the document when it is first used. If omitted, it is taken
% to be the same as the value of the \gloskey{text} key.
%    \begin{macrocode}
\define@key{glossentry}{first}{%
\def\@glo@first{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{firstplural}
% The \gloskey{firstplural} key is used to set the plural form for
% first use, in the event that the plural is required the first 
% time the term is used. If omitted, it is constructed by 
% appending \ics{glspluralsuffix} to the value of the \gloskey{first} key.
%    \begin{macrocode}
\define@key{glossentry}{firstplural}{%
\def\@glo@firstplural{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{symbol}
% The \gloskey{symbol} key is ignored by most of the predefined
% glossary styles, and defaults to \cs{relax} if omitted. 
% It is provided for glossary styles that require an associated 
% symbol, as well as a name and description. To make this value 
% appear in the glossary, you need to redefine 
% \ics{glossaryentryfield} so that it uses its fourth parameter.
% If you want this value to appear in the text when the term is used 
% by commands like \ics{gls}, you will need to change
% \ics{glsdisplay} and \ics{glsdisplayfirst} (either 
% explicitly for all glossaries or via \ics{defglsdisplay}
% and \ics{defglsdisplayfirst} for individual glossaries).
%    \begin{macrocode}
\define@key{glossentry}{symbol}{%
\def\@glo@symbol{#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{symbolplural}
% \changes{1.12}{2008 Mar 8}{new}
%    \begin{macrocode}
\define@key{glossentry}{symbolplural}{%
\def\@glo@symbolplural{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{type}
% The \gloskey{type} key specifies to which glossary this
% entry belongs. If omitted, the default glossary is used.
%    \begin{macrocode}
\define@key{glossentry}{type}{%
\def\@glo@type{#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{counter}
% The \gloskey{counter} key specifies the name of the counter 
% associated with this glossary entry:
%    \begin{macrocode}
\define@key{glossentry}{counter}{%
\@ifundefined{c@#1}{\PackageError{glossaries}{There is no counter
called `#1'}{The counter key should have the name of a valid 
counter as its value}}{%
\def\@glo@counter{#1}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{see}
% The \gloskey{see} key specifies a list of cross-references
% \changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\define@key{glossentry}{see}{%
\def\@glo@see{#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{parent}
% The \gloskey{parent} key specifies the parent entry, if
% required.
% \changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\define@key{glossentry}{parent}{%
\def\@glo@parent{#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{nonumberlist}
% The \gloskey{nonumberlist} key suppresses the number list
% for the given entry.
% \changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\define@key{glossentry}{nonumberlist}[none]{%
\def\@glo@prefix{\glsnonextpages}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glsnoname}
% \changes{1.17}{2008 December 26}{new}
% Define command to generate error if \gloskey{name} key is missing.
%    \begin{macrocode}
\newcommand*{\@glsnoname}{%
  \PackageError{glossaries}{name key required in 
  \string\newglossaryentry\space for entry `\@glo@label'}{You 
  haven't specified the entry name}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@glsdefaultplural}
% Define command to set default plural.
% \changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\newcommand*{\@glsdefaultplural}{\@glo@text\glspluralsuffix}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glsdefaultsort}
% Define command to set default sort.
% \changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\newcommand*{\@glsdefaultsort}{\@glo@name}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\gls@level}
% Register to increment entry levels.
%    \begin{macrocode}
\newcount\gls@level
%    \end{macrocode}
%\end{macro}
%
% Define \cs{newglossaryentry}%
% \marg{label} \marg{key-val list}. 
% There are two required fields in \meta{key-val list}: 
% \gloskey{name} and 
% \gloskey{description}. (See above.)
%\begin{macro}{\newglossaryentry}
%    \begin{macrocode}
\DeclareRobustCommand{\newglossaryentry}[2]{%
%    \end{macrocode}
% Check to see if this glossary entry has already been defined:
%    \begin{macrocode}
\glsdoifnoexists{#1}{%
%    \end{macrocode}
% Store label
%    \begin{macrocode}
\def\@glo@label{#1}%
%    \end{macrocode}
% Set up defaults. If the \gloskey{name} or \gloskey{description}
% keys are omitted, an error will be generated.
%    \begin{macrocode}
\let\@glo@name\@glsnoname
%    \end{macrocode}
%\changes{1.08}{2007 Oct 13}{Fixed error message to say ``description
%key'' rather than ``desc key''}
%    \begin{macrocode}
\def\@glo@desc{\PackageError{glossaries}{description key required in 
\string\newglossaryentry}{You haven't specified the entry description}}%
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{descriptionplural support added}
%    \begin{macrocode}
\def\@glo@descplural{\@glo@desc}%
%    \end{macrocode}
%    \begin{macrocode}
\def\@glo@type{\glsdefaulttype}%
\def\@glo@symbol{\relax}%
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{symbolplural support added}
%    \begin{macrocode}
\def\@glo@symbolplural{\@glo@symbol}%
%    \end{macrocode}
%    \begin{macrocode}
\def\@glo@text{\@glo@name}%
%    \end{macrocode}
%    \begin{macrocode}
\let\@glo@plural\@glsdefaultplural
%    \end{macrocode}
% \changes{1.13}{2008 May 10}{Changed default first value}
% Using \cs{let} instead of \cs{def} to make later comparison
% avoid expansion issues. (Thanks to Ulrich~Diez for suggesting
% this.)
% \changes{1.16}{2008 August 27}{Changed def to let}
%    \begin{macrocode}
\let\@glo@first\relax
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{Changed default first plural to be first
% key with s appended (was text key with s appended)}
% \changes{1.13}{2008 May 10}{Changed default firstplural value}
%    \begin{macrocode}
\let\@glo@firstplural\relax
%    \end{macrocode}
% Set the default sort:
%\changes{1.05}{2007 Aug 10}{Changed the default value of the sort
% key to just the value of the name key}%
%\changes{1.18}{2009 January 14}{Changed default value of sort
% to '@glsdefaultsort}
%    \begin{macrocode}
\let\@glo@sort\@glsdefaultsort
%    \end{macrocode}
% Set the default counter:
%    \begin{macrocode}
\def\@glo@counter{\@gls@getcounter{\@glo@type}}%
%    \end{macrocode}
%\changes{1.17}{2008 December 26}{added see key}
%    \begin{macrocode}
\def\@glo@see{}%
%    \end{macrocode}
%\changes{1.17}{2008 December 26}{added parent key}
%    \begin{macrocode}
\def\@glo@parent{}%
%    \end{macrocode}
%\changes{1.17}{2008 December 26}{added nonumberlist key}
%    \begin{macrocode}
\def\@glo@prefix{}%
%    \end{macrocode}
% Extract key-val information from third parameter:
%    \begin{macrocode}
\setkeys{glossentry}{#2}%
%    \end{macrocode}
% Check to see if this glossary type has been defined, if it has,
% add this label to the relevant list, otherwise generate an error.
%    \begin{macrocode}
\@ifundefined{glolist@\@glo@type}{\PackageError{glossaries}{%
Glossary type '\@glo@type' has not been defined}{%
You need to define a new glossary type, before making entries
in it}}{%
\protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}%
\expandafter\xdef\csname glolist@\@glo@type\endcsname{\@glolist@{#1},}%
}%
%    \end{macrocode}
% Initialise level to 0.
%    \begin{macrocode}
\gls@level=0\relax
%    \end{macrocode}
% Has this entry been assigned a parent?
%    \begin{macrocode}
\ifx\@glo@parent\@empty
%    \end{macrocode}
% Doesn't have a parent. Set \cs{glo@}\meta{label}"@parent" to
% empty.
%    \begin{macrocode}
  \expandafter\gdef\csname glo@#1@parent\endcsname{}%
\else
%    \end{macrocode}
% Has a parent. Check to ensure this entry isn't its own parent.
%    \begin{macrocode}
  \ifthenelse{\equal{#1}{\@glo@parent}}{%
    \PackageError{glossaries}{Entry `#1' can't be its own parent}{}%
    \def\@glo@parent{}%
    \expandafter\gdef\csname glo@#1@parent\endcsname{}%
  }{%
%    \end{macrocode}
% Check the parent exists:
%    \begin{macrocode}
    \ifglsentryexists{\@glo@parent}{%
%    \end{macrocode}
% Parent exists. Set \cs{glo@}\meta{label}"@parent".
%    \begin{macrocode}
      \expandafter\xdef\csname glo@#1@parent\endcsname{\@glo@parent}%
%    \end{macrocode}
% Determine level.
%    \begin{macrocode}
      \gls@level=\csname glo@\@glo@parent @level\endcsname\relax
      \advance\gls@level by 1\relax
%    \end{macrocode}
% If name hasn't been specified, use same as the parent name
%    \begin{macrocode}
      \ifx\@glo@name\@glsnoname
        \expandafter\let\expandafter\@glo@name
           \csname glo@\@glo@parent @name\endcsname
%    \end{macrocode}
% If name and plural haven't been specified, use same as the parent
%    \begin{macrocode}
        \ifx\@glo@plural\@glsdefaultplural
          \expandafter\let\expandafter\@glo@plural
             \csname glo@\@glo@parent @plural\endcsname
        \fi
      \fi
    }{%
%    \end{macrocode}
% Parent doesn't exist, so issue an error message and change this
% entry to have no parent
%    \begin{macrocode}
      \PackageError{glossaries}{Invalid parent `\@glo@parent'
      for entry `#1' - parent doesn't exist}{Parent entries
      must be defined before their children}%
      \def\@glo@parent{}%
      \expandafter\gdef\csname glo@#1@parent\endcsname{}%
     }%
  }%
\fi
%    \end{macrocode}
% Set the level for this entry
%    \begin{macrocode}
\expandafter\xdef\csname glo@#1@level\endcsname{\number\gls@level}%
%    \end{macrocode}
% Check if \gloskey{first} and \gloskey{firstplural} have been use.
% If \gloskey{firstplural} hasn't been specified, but \gloskey{first}
% has been specified, then form \gloskey{firstplural} by appending
% \cs{glspluralsuffix} to value of \gloskey{first} key, otherwise
% obtain the value from the \gloskey{plural} key.
% \changes{1.16}{2008 August 27}{Changed if to ifx}
% This now uses \cs{ifx} instead of \cs{if} to avoid expansion
% issues. (Thanks to Ulrich~Diez for suggesting this.)
%    \begin{macrocode}
\ifx\relax\@glo@firstplural
   \ifx\relax\@glo@first
      \def\@glo@firstplural{\@glo@plural}%
      \def\@glo@first{\@glo@text}%
   \else
      \def\@glo@firstplural{\@glo@first\glspluralsuffix}%
   \fi
\else
   \ifx\relax\@glo@first
      \def\@glo@first{\@glo@text}%
   \fi
\fi
%    \end{macrocode}
% Define commands associated with this entry:
%    \begin{macrocode}
\expandafter\protected@xdef\csname glo@#1@text\endcsname{\@glo@text}%
\expandafter\protected@xdef\csname glo@#1@plural\endcsname{\@glo@plural}%
\expandafter\protected@xdef\csname glo@#1@first\endcsname{\@glo@first}%
\expandafter\protected@xdef\csname glo@#1@firstpl\endcsname{\@glo@firstplural}%
\expandafter\protected@xdef\csname glo@#1@type\endcsname{\@glo@type}%
\expandafter\protected@xdef\csname glo@#1@counter\endcsname{\@glo@counter}%
\@gls@sanitizename
\expandafter\protected@xdef\csname glo@#1@name\endcsname{\@glo@name}%
%    \end{macrocode}
% The smaller and smallcaps options set the description to 
% \cs{@glo@first}. Need to check for this, otherwise it won't get
% expanded if the description gets sanitized.
%\changes{1.15}{2008 August 15}{check for '@glo@first in description}%
%    \begin{macrocode}
\def\@glo@@desc{\@glo@first}%
\ifx\@glo@desc\@glo@@desc
  \let\@glo@desc\@glo@first
\fi
\@gls@sanitizedesc
\expandafter\protected@xdef\csname glo@#1@desc\endcsname{\@glo@desc}%
\expandafter\protected@xdef\csname glo@#1@descplural\endcsname{\@glo@descplural}%
%    \end{macrocode}
% Sanitize sort value:
%\changes{1.18}{2009 January 14}{moved sort sanitization to
% 'newglossaryentry}
%    \begin{macrocode}
\ifx\@glo@sort\@glsdefaultsort
  \let\@glo@sort\@glo@name
\fi
\@onelevel@sanitize\@glo@sort
%    \end{macrocode}
% Set the sort key for this entry:
%    \begin{macrocode}
\expandafter\protected@xdef\csname glo@#1@sort\endcsname{\@glo@sort}%
%    \end{macrocode}
%\changes{1.15}{2008 August 15}{check for '@glo@text in symbol}%
%    \begin{macrocode}
\def\@glo@@symbol{\@glo@text}%
\ifx\@glo@symbol\@glo@@symbol
  \let\@glo@symbol\@glo@text
\fi
\@gls@sanitizesymbol
\expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}%
\expandafter\protected@xdef\csname glo@#1@symbolplural\endcsname{\@glo@symbolplural}%
%    \end{macrocode}
% Define an associated boolean variable to determine whether this
% entry has been used yet (needs to be defined globally):
%    \begin{macrocode}
\expandafter\gdef\csname glo@#1@flagfalse\endcsname{%
\expandafter\global\expandafter
\let\csname ifglo@#1@flag\endcsname\iffalse}%
\expandafter\gdef\csname glo@#1@flagtrue\endcsname{%
\expandafter\global\expandafter
\let\csname ifglo@#1@flag\endcsname\iftrue}%
\csname glo@#1@flagfalse\endcsname
%    \end{macrocode}
% Sort out any cross-referencing if required.
%    \begin{macrocode}
\ifx\@glo@see\@empty
\else
  \protected@edef\@do@glssee{%
    \noexpand\@gls@fixbraces\noexpand\@glo@list\@glo@see
      \noexpand\@nil
    \noexpand\expandafter\noexpand\@glssee\noexpand\@glo@list{#1}}%
  \@do@glssee
\fi
}%
%    \end{macrocode}
% Determine and store main part of the entry's index format.
%\changes{1.17}{2008 December 26}{Stored main part of entry 
% format when entry
% is defined}%
%    \begin{macrocode}
  \@glo@storeentry{#1}%
}
%    \end{macrocode}
%\changes{1.13}{2008 May 10}{Removed restriction on only using
% 'newglossaryentry in the preamble}
%\end{macro}
%
%\begin{macro}{\@glo@storeentry}
%\changes{1.17}{2008 December 26}{new}
% Determine the format to write the entry in the glossary 
% output (\filetype{.glo}) file.
% The argument is the entry's label.
% The result is stored in \cs{glo@}\meta{label}"@entry", where
% \meta{label} is the entry's label. (This doesn't include
% any formatting or location information.)
%    \begin{macrocode}
\newcommand{\@glo@storeentry}[1]{%
%    \end{macrocode}
% Get the sort string and escape any special characters
%    \begin{macrocode}
\protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}%
\@gls@checkmkidxchars\@glo@sort
%    \end{macrocode}
% Same again for the name string.
%    \begin{macrocode}
\protected@edef\@@glo@name{\csname glo@#1@name\endcsname}%
\@gls@checkmkidxchars\@@glo@name
%    \end{macrocode}
% Add the font command. (The backslash needs to be escaped for
% \appname{xindy}.)
%    \begin{macrocode}
\ifglsxindy
  \protected@edef\@glo@name{\string\\glsnamefont{\@@glo@name}}%
\else
  \protected@edef\@glo@name{\string\glsnamefont{\@@glo@name}}%
\fi
%    \end{macrocode}
% Get the description string and escape any special characters
%    \begin{macrocode}
\protected@edef\@glo@desc{\csname glo@#1@desc\endcsname}%
\@gls@checkmkidxchars\@glo@desc
%    \end{macrocode}
% Same again for the symbol
%    \begin{macrocode}
\protected@edef\@glo@symbol{\csname glo@#1@symbol\endcsname}%
\@gls@checkmkidxchars\@glo@symbol
%    \end{macrocode}
% Escape any special characters in the prefix
%    \begin{macrocode}
\@gls@checkmkidxchars\@glo@prefix
%    \end{macrocode}
% Get the parent, if one exists
%    \begin{macrocode}
\edef\@glo@parent{\csname glo@#1@parent\endcsname}%
%    \end{macrocode}
% Write the information to the glossary file.
%    \begin{macrocode}
\ifglsxindy
%    \end{macrocode}
% Store using \appname{xindy} syntax.
%    \begin{macrocode}
  \ifx\@glo@parent\@empty
%    \end{macrocode}
% Entry doesn't have a parent
%    \begin{macrocode}
    \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
     (\string"\@glo@sort\string" %
     \string"\@glo@prefix\string\\glossaryentryfield{#1}{\@glo@name
     }{\@glo@desc}{\@glo@symbol}\string") %
    }%
  \else
%    \end{macrocode}
% Entry has a parent
%    \begin{macrocode}
    \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
      \csname glo@\@glo@parent @index\endcsname
      (\string"\@glo@sort\string" %
      \string"\@glo@prefix\string\\glossarysubentryfield%
         {\csname glo@#1@level\endcsname}{#1}{\@glo@name
      }{\@glo@desc}{\@glo@symbol}\string") %
   }%
  \fi
\else
%    \end{macrocode}
% Store using \appname{makeindex} syntax.
%    \begin{macrocode}
  \ifx\@glo@parent\@empty
%    \end{macrocode}
% Sanitize \cs{@glo@prefix}
%    \begin{macrocode}
    \@onelevel@sanitize\@glo@prefix
%    \end{macrocode}
% Entry doesn't have a parent
%    \begin{macrocode}
    \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
      \@glo@sort\@gls@actualchar\@glo@prefix
      \string\glossaryentryfield{#1}{\@glo@name}{\@glo@desc
      }{\@glo@symbol}%
    }%
  \else
%    \end{macrocode}
% Entry has a parent
%    \begin{macrocode}
    \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
      \csname glo@\@glo@parent @index\endcsname\@gls@levelchar
      \@glo@sort\@gls@actualchar\@glo@prefix
      \string\glossarysubentryfield
        {\csname glo@#1@level\endcsname}{#1}{\@glo@name}{\@glo@desc
      }{\@glo@symbol}%
    }%
  \fi
\fi
}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Resetting and unsetting entry flags}
% Each glossary entry is assigned a conditional of the form
%\cs{ifglo@}\meta{label}\texttt{@flag} which determines
% whether or not the entry has been used (see also 
% \ics{ifglsused} defined below). These flags can
% be set and unset using the following macros:
%
% The command \cs{glsreset}\marg{label} can be used
% to set the entry flag to indicate that it hasn't been used yet. The
% required argument is the entry label.
%\begin{macro}{\glsreset}
%    \begin{macrocode}
\newcommand*{\glsreset}[1]{%
\glsdoifexists{#1}{%
\expandafter\global\csname glo@#1@flagfalse\endcsname}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalreset}
%    \begin{macrocode}
\newcommand*{\glslocalreset}[1]{%
\glsdoifexists{#1}{%
\expandafter\let\csname ifglo@#1@flag\endcsname\iffalse}}
%    \end{macrocode}
%\end{macro}
% The command \cs{glsunset}\marg{label} can be used to
% set the entry flag to indicate that it has been used. The required
% argument is the entry label.
%\begin{macro}{\glsunset}
%    \begin{macrocode}
\newcommand*{\glsunset}[1]{%
\glsdoifexists{#1}{%
\expandafter\global\csname glo@#1@flagtrue\endcsname}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalunset}
%    \begin{macrocode}
\newcommand*{\glslocalunset}[1]{%
\glsdoifexists{#1}{%
\expandafter\let\csname ifglo@#1@flag\endcsname\iftrue}}
%    \end{macrocode}
%\end{macro}
% Reset all entries for the named glossaries (supplied in a 
% comma-separated list). 
% Syntax: \cs{glsresetall}\oarg{glossary-list}
%\begin{macro}{\glsresetall}
%    \begin{macrocode}
\newcommand*{\glsresetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glsreset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalresetall}
%    \begin{macrocode}
\newcommand*{\glslocalresetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glslocalreset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
% Unset all entries for the named glossaries (supplied in a 
% comma-separated list). 
% Syntax: \cs{glsunsetall}\oarg{glossary-list}
%\begin{macro}{\glsunsetall}
%    \begin{macrocode}
\newcommand*{\glsunsetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glsunset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalunsetall}
%    \begin{macrocode}
\newcommand*{\glslocalunsetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glslocalunset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
%
% \subsection{Loading files containing glossary entries}
%\label{sec:load}
% Glossary entries can be defined in an external file.
% These external files can contain \ics{newglossaryentry}
% and \ics{newacronym} commands.\footnote{and any other valid 
%\LaTeX\ code that can be used in the preamble.}\\[10pt]
% \cs{loadglsentries}\oarg{type}\marg{filename}\\[10pt]
% This command will input the file using \cs{input}.
% The optional argument specifies to which glossary the
% entries should be assigned if they haven't used the \gloskey{type}
% key. If the optional argument is not specified, the default
% glossary is used. Only those entries used in the document (via
% \ics{glslink}, \ics{gls}, \ics{glspl} and uppercase
% variants or \ics{glsadd} and \ics{glsaddall} 
% will appear in the glossary). The mandatory argument is 
% the filename (with or without .tex extension).
%\begin{macro}{\loadglsentries}
%    \begin{macrocode}
\newcommand*{\loadglsentries}[2][\@gls@default]{%
\let\@gls@default\glsdefaulttype
\def\glsdefaulttype{#1}\input{#2}%
\let\glsdefaulttype\@gls@default}
%    \end{macrocode}
%\end{macro}
% \cs{loadglsentries} can only be used in the preamble:
%    \begin{macrocode}
\@onlypreamble{\loadglsentries}
%    \end{macrocode}
%
%\subsection{Using glossary entries in the text}
%\label{sec:code:glslink}
%
% Any term that has been defined using \ics{newglossaryentry}
% (or \ics{newacronym}) can be displayed in the text 
% (i.e.\ outside of the glossary) using
% one of the commands defined in this section. Unless you use
% \ics{glslink}, the way the term appears in the text is
% determined by \ics{glsdisplayfirst} (if it is the first
% time the term has been used) or \ics{glsdisplay} (for
% subsequent use). Any formatting commands (such as \cs{textbf}
% is governed by \ics{glstextformat}. By default this just 
% displays the \term{link text} ``as is''.
%\changes{1.04}{2007 Aug 3}{Added 'glstextformat}%
%\begin{macro}{\glstextformat}
%    \begin{macrocode}
\newcommand*{\glstextformat}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% The first time an entry is used, the way in which it is
% displayed is governed by \cs{glsdisplayfirst}. This
% takes four parameters: \verb|#1| will be the value
% of the entry's \gloskey{first} or \gloskey{firstplural} key, 
% \verb|#2| will be the value of the entry's \gloskey{description}
% key, \verb|#3| will be the value of the entry's \gloskey{symbol}
% key and \verb|#4| is additional text supplied by the final optional
% argument to commands like \ics{gls} and \ics{glspl}.
% The default is to display the first parameter followed by the
% additional text.
%\begin{macro}{\glsdisplayfirst}
%    \begin{macrocode}
\newcommand*{\glsdisplayfirst}[4]{#1#4}
%    \end{macrocode}
%\end{macro}
%
% After the first use, the entry is displayed according to
% the format of \cs{glsdisplay}. Again, it takes four
% parameters: \verb|#1| will be the value of the
% entry's \gloskey{text} or \gloskey{plural} key, 
% \verb|#2| will be the value of the entry's \gloskey{description} 
% key, \verb|#3| will be the value of the entry's \gloskey{symbol}
% key and \verb|#4| is additional text supplied by the final optional
% argument to commands like \ics{gls} and \ics{glspl}.
%\begin{macro}{\glsdisplay}
%    \begin{macrocode}
\newcommand*{\glsdisplay}[4]{#1#4}
%    \end{macrocode}
%\end{macro}
%
% When a new glossary is created it uses \cs{glsdisplayfirst}
% and \cs{glsdisplay} as the default way of displaying its
% entry in the text. This can be changed for the entries belonging 
% to an individual glossary using 
% \ics{defglsdisplay} and \ics{defglsdisplayfirst}.
%\\[10pt]
% \cs{defglsdisplay}\oarg{type}\marg{definition}\\[10pt]%
% The glossary type is given by \meta{type} (the default glossary
% if omitted) and
% \meta{definition} should have at most \verb|#1|, \verb|#2|,
% \verb|#3| and \verb|#4|. These represent the same arguments
% as those described for \ics{glsdisplay}.
%\begin{macro}{\defglsdisplay}
%    \begin{macrocode}
\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{%
\expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
% \cs{defglsdisplayfirst}\oarg{type}\marg{definition}\\[10pt]%
% The glossary type is given by \meta{type} (the default glossary
% if omitted) and
% \meta{definition} should have at most \verb|#1|, \verb|#2|,
% \verb|#3| and \verb|#4|. These represent the same arguments
% as those described for \ics{glsdisplayfirst}.
%\begin{macro}{\defglsdisplayfirst}
%    \begin{macrocode}
\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{%
\expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Links to glossary entries}
% The links to glossary entries all have a first optional 
% argument that can be used to change the format and counter
% of the associated entry number. Except for \cs{glslink},
% the commands like \cs{gls} have a final optional
% argument that can be used to insert additional text in the
% link (this will usually be appended, but can be redefined using
% \ics{defglsdisplay} and \ics{defglsdisplayfirst}). 
% It goes against the \LaTeX\ norm to have an optional
% argument after the mandatory arguments, but it makes more
% sense to write, say, \verb|\gls{label}['s]| rather than, say,
% \verb|\gls[append='s]{label}|. Since these control sequences
% are defined to include the final square bracket, spaces
% will be ignored after them. This is likely to lead to
% confusion as most users would not expect, say, "\gls{"\meta{label}"}"
% to ignore following spaces, so \cs{new@ifnextchar} from the 
% \isty{amsgen} package is required.
%
% The following keys can be used in the first optional 
% argument. The \gloskey[glslink]{counter} key checks that the 
% value is the name of a valid counter.
%    \begin{macrocode}
\define@key{glslink}{counter}{%
\@ifundefined{c@#1}{\PackageError{glossaries}{There is no counter
called `#1'}{The counter key should have the name of a valid 
counter as its value}}{%
\def\@gls@counter{#1}}}
%    \end{macrocode}
% The value of the \gloskey[glslink]{format} key should be the name of a 
% command (without the initial backslash) that has a single mandatory 
% argument which can be used to format the associated entry
% number.
%    \begin{macrocode}
\define@key{glslink}{format}{%
\def\@glsnumberformat{#1}}
%    \end{macrocode}
% The \gloskey[glslink]{hyper} key is a boolean key, it can either have the 
% value true or false, and indicates whether or not to make a 
% hyperlink to the relevant glossary entry. If hyper is false, an 
% entry will still be made in the glossary, but the given text 
% won't be a hyperlink.
%    \begin{macrocode}
\define@boolkey{glslink}{hyper}[true]{}
%    \end{macrocode}
%
%Syntax:\\[10pt]
% \cs{glslink}\oarg{options}\marg{label}\marg{text}
%\\[10pt]
% Display \meta{text} in the document, and add the entry information
% for \meta{label} into the relevant glossary. The optional
% argument should be a key value list using the \texttt{glslink}
% keys defined above.
%
% There is also a starred version:\\[10pt]
% \cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt]
% which is equivalent to 
% \cs{glslink}"[hyper=false,"\meta{options}"]"\marg{label}\marg{text}
%
% First determine whether or not we are using the starred version:
%\begin{macro}{\glslink}
%    \begin{macrocode}
\newcommand{\glslink}{%
\@ifstar\@sgls@link\@gls@link}
%    \end{macrocode}
%\end{macro}
% Define the starred version:
%\begin{macro}{\@sgls@link}
%    \begin{macrocode}
\newcommand*{\@sgls@link}[1][]{\@gls@link[hyper=false,#1]}
%    \end{macrocode}
%\end{macro}
% Define the un-starred version:
%\begin{macro}{\@gls@link}
%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon}
%\changes{1.15}{2008 August 15}{added 'glslabel}
%    \begin{macrocode}
\newcommand*{\@gls@link}[3][]{%
  \glsdoifexists{#2}%
  {%
    \def\glslabel{#2}%
    \def\@glsnumberformat{glsnumberformat}%
    \edef\@gls@counter{\csname glo@#2@counter\endcsname}%
    \KV@glslink@hypertrue
    \setkeys{glslink}{#1}%
    \edef\theglsentrycounter{\expandafter\noexpand
      \csname the\@gls@counter\endcsname}%
    \ifKV@glslink@hyper
      \@glslink{glo:#2}{\glstextformat{#3}}%
    \else
      \glstextformat{#3}\relax
    \fi
    \@do@wrglossary{#2}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\changes{1.01}{2007 May 17}{Added range facility in format key}%
% Set the formatting information in the format required by 
% \appname{makeindex}. The first argument is the format specified
% by the user (via the format key), the second argument is the
% name of the counter used to indicate the location and the third
% argument is a control sequence which stores the required format.
%\begin{macro}{\@set@glo@numformat}
%    \begin{macrocode}
\def\@set@glo@numformat#1#2#3{%
\expandafter\@glo@check@mkidxrangechar#3\@nil
\protected@edef#1{\@glo@prefix setentrycounter{#2}%
\expandafter\string\csname\@glo@suffix\endcsname}%
\@gls@checkmkidxchars#1}
%    \end{macrocode}
%\end{macro}
% Check to see if the given string starts with a ( or ). If it
% does set \cs{@glo@prefix} to the starting character,
% and \cs{@glo@suffix} to the rest (or "glsnumberformat"
% if there is nothing else),
% otherwise set \cs{@glo@prefix} to nothing and
% \cs{@glo@suffix} to all of it.
%    \begin{macrocode}
\def\@glo@check@mkidxrangechar#1#2\@nil{%
\if#1(\relax
  \def\@glo@prefix{(}%
  \if\relax#2\relax
    \def\@glo@suffix{glsnumberformat}%
  \else
    \def\@glo@suffix{#2}%
  \fi
\else
  \if#1)\relax
    \def\@glo@prefix{)}%
    \if\relax#2\relax
      \def\@glo@suffix{glsnumberformat}%
    \else
      \def\@glo@suffix{#2}%
  \fi
  \else
    \def\@glo@prefix{}\def\@glo@suffix{#1#2}%
  \fi
\fi}
%    \end{macrocode}
%
%\begin{macro}{\@gls@escbsdq}
% Escape backslashes and double quote marks. The argument must be
% a control sequence.
%    \begin{macrocode}
\newcommand*{\@gls@escbsdq}[1]{%
  \def\@gls@checkedmkidx{}%
  \let\gls@xdystring=#1\relax
  \@onelevel@sanitize\gls@xdystring
  \edef\do@gls@xdycheckbackslash{%
    \noexpand\@gls@xdycheckbackslash\gls@xdystring\noexpand\@nil
    \@backslashchar\@backslashchar\noexpand\null}%
  \do@gls@xdycheckbackslash
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}%
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@xdycheckquote\gls@xdystring\@nil""\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}%
  \let#1=\gls@xdystring
}
%    \end{macrocode}
%\end{macro}
% Catch special characters\mkidxspch (argument must be a
% control sequence):
%\begin{macro}{\@gls@checkmkidxchars}
%    \begin{macrocode}
\newcommand{\@gls@checkmkidxchars}[1]{%
\ifglsxindy
  \@gls@escbsdq{#1}%
\else
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@checkquote#1\@nil""\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@checkescquote#1\@nil\"\"\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@checkescactual#1\@nil\?\?\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@checkactual#1\@nil??\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@checkbar#1\@nil||\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@checkescbar#1\@nil\|\|\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
  \def\@gls@checkedmkidx{}%
  \expandafter\@gls@checklevel#1\@nil!!\null
  \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
\fi
}
%    \end{macrocode}
%\end{macro}
% Update the control sequence and strip trailing \cs{@nil}:
%\begin{macro}{\@gls@updatechecked}
%    \begin{macrocode}
\def\@gls@updatechecked#1\@nil#2{\def#2{#1}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@tmpb}
%\changes{1.1}{2008 Feb 22}{changed \cs{toksdef} to \cs{newtoks}}
% Define temporary token
%    \begin{macrocode}
\newtoks\@gls@tmpb
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkquote}
% Replace \verb|"| with \verb|""| since \verb|"| is a makeindex
% special character\mkidxspch.
%    \begin{macrocode}
\def\@gls@checkquote#1"#2"#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkquote{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}%
  \def\@@gls@checkquote{\@gls@checkquote#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@quotechar}%
 \ifx\null#3\null
   \def\@@gls@checkquote{\@gls@checkquote#2""\null}%
 \else
   \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}%
 \fi
\fi
\@@gls@checkquote}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkescquote}
% Do the same for \verb|\"|:
%    \begin{macrocode}
\def\@gls@checkescquote#1\"#2\"#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkescquote{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@quotechar
    \@gls@quotechar\string\"\@gls@quotechar}%
  \def\@@gls@checkescquote{\@gls@checkescquote#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@quotechar}%
 \ifx\null#3\null
   \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}%
 \else
   \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}%
 \fi
\fi
\@@gls@checkescquote}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkescactual}
% Similarly for \verb|\?| (which is replaces @ as 
% \appname{makeindex}'s special character):
%    \begin{macrocode}
\def\@gls@checkescactual#1\?#2\?#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkescactual{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@actualchar
    \@gls@quotechar\string\"\@gls@actualchar}%
  \def\@@gls@checkescactual{\@gls@checkescactual#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@actualchar}%
 \ifx\null#3\null
  \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}%
 \else
  \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}%
 \fi
\fi
\@@gls@checkescactual}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkescbar}
% Similarly for \verb"\|":
%    \begin{macrocode}
\def\@gls@checkescbar#1\|#2\|#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkescbar{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@encapchar
    \@gls@quotechar\string\"\@gls@encapchar}%
  \def\@@gls@checkescbar{\@gls@checkescbar#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@encapchar}%
 \ifx\null#3\null
  \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}%
 \else
  \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}%
 \fi
\fi
\@@gls@checkescbar}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkesclevel}
% Similarly for \verb"\!":
%    \begin{macrocode}
\def\@gls@checkesclevel#1\!#2\!#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkesclevel{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@levelchar
    \@gls@quotechar\string\"\@gls@levelchar}%
  \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@levelchar}%
 \ifx\null#3\null
  \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}%
 \else
  \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}%
 \fi
\fi
\@@gls@checkesclevel}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkbar}
% and for \verb"|":
%    \begin{macrocode}
\def\@gls@checkbar#1|#2|#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkbar{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}%
  \def\@@gls@checkbar{\@gls@checkbar#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@encapchar}%
 \ifx\null#3\null
   \def\@@gls@checkbar{\@gls@checkbar#2||\null}%
 \else
   \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}%
 \fi
\fi
\@@gls@checkbar}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checklevel}
% and for \verb"!":
%    \begin{macrocode}
\def\@gls@checklevel#1!#2!#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checklevel{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}%
  \def\@@gls@checklevel{\@gls@checklevel#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@levelchar}%
 \ifx\null#3\null
   \def\@@gls@checklevel{\@gls@checklevel#2!!\null}%
 \else
   \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}%
 \fi
\fi
\@@gls@checklevel}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkactual}
% and for \verb"?":
%    \begin{macrocode}
\def\@gls@checkactual#1?#2?#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkactual{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}%
  \def\@@gls@checkactual{\@gls@checkactual#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@actualchar}%
 \ifx\null#3\null
   \def\@@gls@checkactual{\@gls@checkactual#2??\null}%
 \else
   \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}%
 \fi
\fi
\@@gls@checkactual}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@xdycheckquote}
% As before but for use with \appname{xindy}
%    \begin{macrocode}
\def\@gls@xdycheckquote#1"#2"#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@xdycheckquote{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \string\"\string\"}%
  \def\@@gls@xdycheckquote{\@gls@xdycheckquote#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \string\"}%
 \ifx\null#3\null
   \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2""\null}%
 \else
   \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2"#3\null}%
 \fi
\fi
\@@gls@xdycheckquote
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@xdycheckbackslash}
% Need to escape all backslashes for \appname{xindy}.
% Define command that will define \cs{@gls@xdycheckbackslash}
%    \begin{macrocode}
\edef\def@gls@xdycheckbackslash{%
 \noexpand\def\noexpand\@gls@xdycheckbackslash##1\@backslashchar
   ##2\@backslashchar##3\noexpand\null{%
  \noexpand\@gls@tmpb=\noexpand\expandafter
    {\noexpand\@gls@checkedmkidx}%
  \noexpand\toks@={##1}%
  \noexpand\ifx\noexpand\null##2\noexpand\null
   \noexpand\ifx\noexpand\null##3\noexpand\null
    \noexpand\edef\noexpand\@gls@checkedmkidx{%
       \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}%
    \noexpand\def\noexpand\@@gls@xdycheckbackslash{\relax}%
   \noexpand\else
    \noexpand\edef\noexpand\@gls@checkedmkidx{%
      \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@
    \@backslashchar\@backslashchar\@backslashchar\@backslashchar}%
  \noexpand\def\noexpand\@@gls@xdycheckbackslash{%
     \noexpand\@gls@xdycheckbackslash##3\noexpand\null}%
   \noexpand\fi
  \noexpand\else
   \noexpand\edef\noexpand\@gls@checkedmkidx{%
     \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@
   \@backslashchar\@backslashchar}%
 \noexpand\ifx\noexpand\null##3\noexpand\null
   \noexpand\def\noexpand\@@gls@xdycheckbackslash{%
      \noexpand\@gls@xdycheckbackslash##2\@backslashchar
      \@backslashchar\noexpand\null}%
   \noexpand\else
     \noexpand\def\noexpand\@@gls@xdycheckbackslash{%
        \noexpand\@gls@xdycheckbackslash##2\@backslashchar
           ##3\noexpand\null}%
   \noexpand\fi
  \noexpand\fi
  \noexpand\@@gls@xdycheckbackslash
 }%
}
%    \end{macrocode}
% Now go ahead and define \cs{@gls@xdycheckbackslash}
%    \begin{macrocode}
\def@gls@xdycheckbackslash
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glslink}
% If \ics{hyperlink} is not defined \cs{@glslink} 
% ignores its first argument and just does the second argument,
% otherwise it is equivalent to \ics{hyperlink}.
%    \begin{macrocode}
\@ifundefined{hyperlink}{%
  \gdef\@glslink#1#2{#2}%
}{%
  \gdef\@glslink#1#2{\hyperlink{#1}{#2}}%
}
%    \end{macrocode}
%\end{macro}
%\changes{1.12}{2008 Mar 8}{added check for 'hypertarget separate
% to 'hyperlink (memoir defines 'hyperlink but not 'hypertarget)}
%\begin{macro}{\@glstarget}
% If \ics{hypertarget} is not defined, \cs{@glstarget}
% ignores its first argument and just does the second argument,
% otherwise it is equivalent to \ics{hypertarget}.
%\changes{1.16}{2008 August 27}{raised the hypertarget so the target text doesn't
% scroll off the top of the page}
%    \begin{macrocode}
\newlength\gls@tmplen
\@ifundefined{hypertarget}{%
  \gdef\@glstarget#1#2{#2}%
}{%
 \gdef\@glstarget#1#2{%
    \settoheight{\gls@tmplen}{#2}%
    \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2}%
}
%    \end{macrocode}
%\end{macro}
%
% Glossary hyperlinks can be disabled using \cs{glsdisablehyper}
% (effect can be localised):
%\begin{macro}{\glsdisablehyper}
%    \begin{macrocode}
\newcommand{\glsdisablehyper}{%
\renewcommand*\@glslink[2]{##2}%
\renewcommand*\@glstarget[2]{##2}}
%    \end{macrocode}
%\end{macro}
% Glossary hyperlinks can be enabled using \cs{glsenablehyper}
% (effect can be localised):
%\begin{macro}{\glsenablehyper}
%    \begin{macrocode}
\newcommand{\glsenablehyper}{%
\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}%
\renewcommand*\@glstarget[2]{%
  \settoheight{\gls@tmplen}{##2}%
  \raisebox{\gls@tmplen}{\hypertarget{##1}{}}##2}}
%    \end{macrocode}
%\end{macro}
%
%Syntax:\\[10pt]
% \cs{gls}\oarg{options}\marg{label}\oarg{insert text}\\[10pt]
% Link to glossary entry using singular form. The link text
% is taken from the value of the \gloskey{text} or \gloskey{first}
% keys used when the entry was defined.
%
%  The first optional argument is a key-value list, the same as
% \ics{glslink}\igloskey[glslink]{hyper}\igloskey[glslink]{format}\igloskey[glslink]{counter}, 
% the mandatory argument is the entry label. 
% After the mandatory argument, there is another optional argument 
% to insert extra text in the link text (the location of the inserted
% text is governed by \ics{glsdisplay} and 
% \ics{glsdisplayfirst}). As with \cs{glslink}
% there is a starred version which is the same as the unstarred 
% version but with the \gloskey[glslink]{hyper} key set to \texttt{false}.
% (Additional options can also be specified 
% in the first optional argument.)
%
% First determine if we are using the starred form:
%\begin{macro}{\gls}
%    \begin{macrocode}
\newcommand*{\gls}{\@ifstar\@sgls\@gls}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%\begin{macro}{\@sgls}
%    \begin{macrocode}
\newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]}
%    \end{macrocode}
%\end{macro}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%\begin{macro}{\@gls}
%    \begin{macrocode}
\newcommand*{\@gls}[2][]{%
\new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@gls@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}.
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\@glo@text}%
}{%
  \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
    \boolean{glsacrfootnote}}{%
    \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
  }{%
    \@gls@link[#1]{#2}{\@glo@text}%
  }%
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%\end{macro}
%
% \cs{Gls} behaves like \cs{gls}, but the first letter
% of the link text is converted to uppercase (note that if the
% first letter has an accent, the accented letter will need to
% be grouped when you define the entry). It is mainly intended
% for terms that start a sentence:
%\begin{macro}{\Gls}
%    \begin{macrocode}
\newcommand*{\Gls}{\@ifstar\@sGls\@Gls}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGls}[1][]{\@Gls[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Gls}[2][]{%
\new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}}
%    \end{macrocode}
%\begin{macro}{\@Gls@}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Gls@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
  \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
    \boolean{glsacrfootnote}}{%
    \@gls@link[#1,hyper=false]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}}%
  }{%
    \@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}}%
  }%
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%\end{macro}
%
% \cs{GLS} behaves like \ics{gls}, but the link
% text is converted to uppercase:
%\begin{macro}{\GLS}
%    \begin{macrocode}
\newcommand*{\GLS}{\@ifstar\@sGLS\@GLS}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLS}[1][]{\@GLS[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLS}[2][]{%
\new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}}
%    \end{macrocode}
%\begin{macro}{\@GLS@}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLS@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text}).
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
  \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
    \boolean{glsacrfootnote}}{%
    \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
  }{%
    \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
  }%
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%\end{macro}
%
% \cs{glspl} behaves in the same way as \ics{gls} except
% it uses the plural form.
%\begin{macro}{\glspl}
%    \begin{macrocode}
\newcommand*{\glspl}{\@ifstar\@sglspl\@glspl}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglspl}[1][]{\@glspl[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glspl}[2][]{%
\new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}}
%    \end{macrocode}
%\begin{macro}{\@glspl@}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glspl@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and
% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol}
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentryplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\@glo@text}%
}{%
  \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
    \boolean{glsacrfootnote}}{%
    \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
  }{%
    \@gls@link[#1]{#2}{\@glo@text}%
  }%
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%\end{macro}
%
% \cs{Glspl} behaves in the same way as \ics{glspl}, except
% that the first letter of the link text is converted to uppercase
% (as with \ics{Gls}, if the first letter has an accent, it
% will need to be grouped).
%\begin{macro}{\Glspl}
%    \begin{macrocode}
\newcommand*{\Glspl}{\@ifstar\@sGlspl\@Glspl}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlspl}[1][]{\@Glspl[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glspl}[2][]{%
\new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}}
%    \end{macrocode}
%\begin{macro}{\@Glspl@}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glspl@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text}). This needs to be expanded so that the
% \cs{@glo@text} can be passed to \cs{xmakefirstuc}.
%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and
% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol}
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentryplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{%
    \expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
  \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
    \boolean{glsacrfootnote}}{%
    \@gls@link[#1,hyper=false]{#2}{%
      \expandafter\makefirstuc\expandafter{\@glo@text}}%
  }{%
    \@gls@link[#1]{#2}{%
      \expandafter\makefirstuc\expandafter{\@glo@text}}%
  }%
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%\end{macro}
%
% \cs{GLSpl} behaves like \ics{glspl} except that all the
% link text is converted to uppercase.
%\begin{macro}{\GLSpl}
%    \begin{macrocode}
\newcommand*{\GLSpl}{\@ifstar\@sGLSpl\@GLSpl}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSpl}[1][]{\@GLSpl[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSpl}[2][]{%
\new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}}
%    \end{macrocode}
%\begin{macro}{\@GLSpl}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSpl@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and
% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol}
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentryplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
  \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
    \boolean{glsacrfootnote}}{%
    \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
  }{%
    \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
  }%
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsdisp}
%\changes{1.19}{2009 Mar 2}{new}
%\cs{glsdisp}\oarg{options}\marg{label}\marg{text}
% This is like \cs{gls} except that the link text is provided.
% This differs from \cs{glslink} in that it uses 
% \cs{glsdisplay} or \cs{glsdisplayfirst} and unsets the first use
% flag.
%
% First determine if we are using the starred form:
%    \begin{macrocode}
\newcommand*{\glsdisp}{\@ifstar\@sglsdisp\@glsdisp}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%\begin{macro}{\@sgls}
%    \begin{macrocode}
\newcommand*{\@sglsdisp}[1][]{\@glsdisp[hyper=false,#1]}
%    \end{macrocode}
%\end{macro}
% Defined the un-starred form.
%\begin{macro}{\@glsdisp}
%    \begin{macrocode}
\newcommand*{\@glsdisp}[3][]{%
  \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
  \def\@gls@link@opts{#1}%
  \def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
  \ifglsused{#2}%
  {%
    \def\@glo@text{%
      \csname gls@\@glo@type @display\endcsname
      {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
  }%
  {%
    \def\@glo@text{%
      \csname gls@\@glo@type @displayfirst\endcsname
      {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
  }%
%    \end{macrocode}
% Call \cs{@gls@link}.
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
  \ifglsused{#2}%
  {%
    \@gls@link[#1]{#2}{\@glo@text}%
  }%
  {%
    \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
      \boolean{glsacrfootnote}}%
    {%
      \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
    }%
    {%
      \@gls@link[#1]{#2}{\@glo@text}%
    }%
  }%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
  \glsunset{#2}}%
}
%    \end{macrocode}
%\end{macro}
%
% \cs{glstext} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{text} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glstext}
%    \begin{macrocode}
\newcommand*{\glstext}{\@ifstar\@sglstext\@glstext}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glstext}[2][]{%
\new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glstext@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glstext shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrytext{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLStext} behaves like \cs{glstext} except the text is converted
% to uppercase.
%\begin{macro}{\GLStext}
%    \begin{macrocode}
\newcommand*{\GLStext}{\@ifstar\@sGLStext\@GLStext}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLStext}[1][]{\@GLStext[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLStext}[2][]{%
\new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLStext@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLStext shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrytext{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{Glstext} behaves like \cs{glstext} except that the first letter
% of the text is converted to uppercase.
%\begin{macro}{\Glstext}
%    \begin{macrocode}
\newcommand*{\Glstext}{\@ifstar\@sGlstext\@Glstext}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlstext}[1][]{\@Glstext[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glstext}[2][]{%
\new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glstext@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glstext shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrytext{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{glsfirst} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{first} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsfirst}
%    \begin{macrocode}
\newcommand*{\glsfirst}{\@ifstar\@sglsfirst\@glsfirst}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsfirst}[1][]{\@glsfirst[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsfirst}[2][]{%
\new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsfirst@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsfirst shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirst{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsfirst} behaves like \ics{glsfirst} except it displays the 
% first letter in uppercase.
%\begin{macro}{\Glsfirst}
%    \begin{macrocode}
\newcommand*{\Glsfirst}{\@ifstar\@sGlsfirst\@Glsfirst}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsfirst}[1][]{\@Glsfirst[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsfirst}[2][]{%
\new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsfirst@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsfirst shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirst{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSfirst} behaves like \ics{Glsfirst} except it displays the 
% text in uppercase.
%\begin{macro}{\GLSfirst}
%    \begin{macrocode}
\newcommand*{\GLSfirst}{\@ifstar\@sGLSfirst\@GLSfirst}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSfirst}[1][]{\@GLSfirst[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSfirst}[2][]{%
\new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSfirst@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSfirst shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirst{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{plural} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsplural}
%    \begin{macrocode}
\newcommand*{\glsplural}{\@ifstar\@sglsplural\@glsplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsplural}[1][]{\@glsplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsplural}[2][]{%
\new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsplural} behaves like \ics{glsplural} except that the first
% letter is converted to uppercase.
%\begin{macro}{\Glsplural}
%    \begin{macrocode}
\newcommand*{\Glsplural}{\@ifstar\@sGlsplural\@Glsplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsplural}[1][]{\@Glsplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsplural}[2][]{%
\new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSplural} behaves like \ics{glsplural} except that the 
% text is converted to uppercase.
%\begin{macro}{\GLSplural}
%    \begin{macrocode}
\newcommand*{\GLSplural}{\@ifstar\@sGLSplural\@GLSplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSplural}[1][]{\@GLSplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSplural}[2][]{%
\new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsfirstplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{firstplural} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsfirstplural}
%    \begin{macrocode}
\newcommand*{\glsfirstplural}{\@ifstar\@sglsfirstplural\@glsfirstplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsfirstplural}[1][]{\@glsfirstplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsfirstplural}[2][]{%
\new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsfirstplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsfirstplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsfirstplural} behaves like \ics{glsfirstplural} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsfirstplural}
%    \begin{macrocode}
\newcommand*{\Glsfirstplural}{\@ifstar\@sGlsfirstplural\@Glsfirstplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsfirstplural}[1][]{\@Glsfirstplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsfirstplural}[2][]{%
\new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsfirstplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsfirstplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSfirstplural} behaves like \ics{glsfirstplural} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSfirstplural}
%    \begin{macrocode}
\newcommand*{\GLSfirstplural}{\@ifstar\@sGLSfirstplural\@GLSfirstplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSfirstplural}[1][]{\@GLSfirstplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSfirstplural}[2][]{%
\new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSfirstplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSfirstplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsname} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{name} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsname}
%    \begin{macrocode}
\newcommand*{\glsname}{\@ifstar\@sglsname\@glsname}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsname}[1][]{\@glsname[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsname}[2][]{%
\new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsname@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsname shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryname{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsname} behaves like \ics{glsname} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsname}
%    \begin{macrocode}
\newcommand*{\Glsname}{\@ifstar\@sGlsname\@Glsname}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsname}[1][]{\@Glsname[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsname}[2][]{%
\new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsname@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsname shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryname{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSname} behaves like \ics{glsname} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSname}
%    \begin{macrocode}
\newcommand*{\GLSname}{\@ifstar\@sGLSname\@GLSname}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSname}[1][]{\@GLSname[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSname}[2][]{%
\new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSname@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSname shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryname{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsdesc} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{description} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsdesc}
%    \begin{macrocode}
\newcommand*{\glsdesc}{\@ifstar\@sglsdesc\@glsdesc}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsdesc}[1][]{\@glsdesc[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsdesc}[2][]{%
\new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsdesc@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsdesc shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydesc{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsdesc} behaves like \ics{glsdesc} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsdesc}
%    \begin{macrocode}
\newcommand*{\Glsdesc}{\@ifstar\@sGlsdesc\@Glsdesc}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsdesc}[1][]{\@Glsdesc[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsdesc}[2][]{%
\new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsdesc@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsdesc shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydesc{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSdesc} behaves like \ics{glsdesc} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSdesc}
%    \begin{macrocode}
\newcommand*{\GLSdesc}{\@ifstar\@sGLSdesc\@GLSdesc}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSdesc}[1][]{\@GLSdesc[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSdesc}[2][]{%
\new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSdesc@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSdesc shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydesc{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsdescplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{descriptionplural} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsdescplural}
%    \begin{macrocode}
\newcommand*{\glsdescplural}{\@ifstar\@sglsdescplural\@glsdescplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsdescplural}[1][]{\@glsdescplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsdescplural}[2][]{%
\new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsdescplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydescplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsdescplural} behaves like \ics{glsdescplural} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsdescplural}
%    \begin{macrocode}
\newcommand*{\Glsdescplural}{\@ifstar\@sGlsdescplural\@Glsdescplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsdescplural}[1][]{\@Glsdescplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsdescplural}[2][]{%
\new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsdescplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydescplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSdescplural} behaves like \ics{glsdescplural} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSdescplural}
%    \begin{macrocode}
\newcommand*{\GLSdescplural}{\@ifstar\@sGLSdescplural\@GLSdescplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSdescplural}[1][]{\@GLSdescplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSdescplural}[2][]{%
\new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSdescplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydescplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glssymbol} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{symbol} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glssymbol}
%    \begin{macrocode}
\newcommand*{\glssymbol}{\@ifstar\@sglssymbol\@glssymbol}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglssymbol}[1][]{\@glssymbol[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glssymbol}[2][]{%
\new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glssymbol@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glssymbol shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbol{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glssymbol} behaves like \ics{glssymbol} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glssymbol}
%    \begin{macrocode}
\newcommand*{\Glssymbol}{\@ifstar\@sGlssymbol\@Glssymbol}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlssymbol}[1][]{\@Glssymbol[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glssymbol}[2][]{%
\new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glssymbol@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glssymbol shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbol{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSsymbol} behaves like \ics{glssymbol} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSsymbol}
%    \begin{macrocode}
\newcommand*{\GLSsymbol}{\@ifstar\@sGLSsymbol\@GLSsymbol}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSsymbol}[1][]{\@GLSsymbol[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSsymbol}[2][]{%
\new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSsymbol@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSsymbol shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbol{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glssymbolplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{symbolplural} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glssymbolplural}
%    \begin{macrocode}
\newcommand*{\glssymbolplural}{\@ifstar\@sglssymbolplural\@glssymbolplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglssymbolplural}[1][]{\@glssymbolplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glssymbolplural}[2][]{%
\new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glssymbolplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glssymbolplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glssymbolplural} behaves like \ics{glssymbolplural} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glssymbolplural}
%    \begin{macrocode}
\newcommand*{\Glssymbolplural}{\@ifstar\@sGlssymbolplural\@Glssymbolplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlssymbolplural}[1][]{\@Glssymbolplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glssymbolplural}[2][]{%
\new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glssymbolplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSsymbolplural} behaves like \ics{glssymbolplural} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSsymbolplural}
%    \begin{macrocode}
\newcommand*{\GLSsymbolplural}{\@ifstar\@sGLSsymbolplural\@GLSsymbolplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSsymbolplural}[1][]{\@GLSsymbolplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSsymbolplural}[2][]{%
\new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSsymbolplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \subsubsection{Displaying entry details without adding
% information to the glossary}
%\label{sec:code:glsnolink}
% 
% These commands merely display entry information without adding
% entries in the associated file or having hyperlinks.
%
% Get the entry name (as specified by the \gloskey{name} key
% when the entry was defined). The argument
% is the label associated with the entry. Note that unless you
% used \texttt{name=false} in the \pkgopt{sanitize} package option 
% you may get unexpected results if the \gloskey{name} key contains 
% any commands.
%\begin{macro}{\glsentryname}
%    \begin{macrocode}
\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryname}
%    \begin{macrocode}
\newcommand*{\Glsentryname}[1]{%
\protected@edef\@glo@text{\csname glo@#1@name\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the entry description (as specified by the 
% \gloskey{description} when the entry was defined). The argument
% is the label associated with the entry. Note that unless you
% used \texttt{description=false} in the \pkgopt{sanitize} package 
% option you may get unexpected results if the \gloskey{description} 
% key contained any commands.
%\begin{macro}{\glsentrydesc}
%    \begin{macrocode}
\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrydesc}
%    \begin{macrocode}
\newcommand*{\Glsentrydesc}[1]{%
\protected@edef\@glo@text{\csname glo@#1@desc\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
% Plural form:
%\begin{macro}{\glsentrydescplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\glsentrydescplural}[1]{%
\csname glo@#1@descplural\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrydescplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\Glsentrydescplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@descplural\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the entry text, as specified by the \gloskey{text} key when
% the entry was defined. The argument
% is the label associated with the entry:
%\begin{macro}{\glsentrytext}
%    \begin{macrocode}
\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrytext}
%    \begin{macrocode}
\newcommand*{\Glsentrytext}[1]{%
\protected@edef\@glo@text{\csname glo@#1@text\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the plural form:
%\begin{macro}{\glsentryplural}
%    \begin{macrocode}
\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryplural}
%    \begin{macrocode}
\newcommand*{\Glsentryplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@plural\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the symbol associated with this entry. The argument
% is the label associated with the entry. Note that unless you
% used \texttt{symbol=false} in the \pkgopt{sanitize} package 
% option you may get unexpected results if the \gloskey{symbol} 
% key contained any commands.
%\begin{macro}{\glsentrysymbol}
%    \begin{macrocode}
\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrysymbol}
%    \begin{macrocode}
\newcommand*{\Glsentrysymbol}[1]{%
\protected@edef\@glo@text{\csname glo@#1@symbol\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
% Plural form:
%\begin{macro}{\glsentrysymbolplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\glsentrysymbolplural}[1]{%
\csname glo@#1@symbolplural\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrysymbolplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\Glsentrysymbolplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@symbolplural\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the entry text to be used when the entry is first used in
% the document (as specified by the \gloskey{first} key when
% the entry was defined).
%\begin{macro}{\glsentryfirst}
%    \begin{macrocode}
\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryfirst}
%    \begin{macrocode}
\newcommand*{\Glsentryfirst}[1]{%
\protected@edef\@glo@text{\csname glo@#1@first\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the plural form (as specified by the \gloskey{firstplural}
% key when the entry was defined).
%\begin{macro}{\glsentryfirstplural}
%    \begin{macrocode}
\newcommand*{\glsentryfirstplural}[1]{%
\csname glo@#1@firstpl\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryfirstplural}
%    \begin{macrocode}
\newcommand*{\Glsentryfirstplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@firstpl\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Display the glossary type with which this entry is associated
% (as specified by the \gloskey{type} key used when the entry was 
% defined)
%\begin{macro}{\glsentrytype}
%    \begin{macrocode}
\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname}
%    \end{macrocode}
%\end{macro}
%
% Display the sort text used for this entry. Note that the 
% \gloskey{sort} key is sanitize, so unexpected results may 
% occur if the \gloskey{sort} key contained commands.
%\begin{macro}{\glsentrysort}
%    \begin{macrocode}
\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glshyperlink}
% Provide a hyperlink to a glossary entry without adding information
% to the glossary file. The entry needs to be added using a 
% command like \ics{glslink} or \ics{glsadd} to ensure that
% the target is defined. The first (optional) argument specifies
% the link text. The entry name is used by default. The second
% argument is the entry label.
%\changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\newcommand*{\glshyperlink}[2][\glsentryname{\@glo@label}]{%
\def\@glo@label{#2}%
\@glslink{glo:#2}{#1}}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Adding an entry to the glossary without generating
% text}
% The following keys are provided for \cs{glsadd} and 
% \cs{glsaddall}:
%    \begin{macrocode}
\define@key{glossadd}{counter}{\def\@glo@counter{#1}}
\define@key{glossadd}{format}{\def\@glo@format{#1}}
%    \end{macrocode}
% This key is only used by \cs{glsaddall}:
%    \begin{macrocode}
\define@key{glossadd}{types}{\def\@glo@type{#1}}
%    \end{macrocode}
%\vskip5pt
%\cs{glsadd}\oarg{options}\marg{label}\\[10pt]
% Add a term to the glossary without generating any link text. 
% The optional argument indicates which counter to use, 
% and how to format it (using a key-value list)
% the second argument is the entry label. Note that \meta{options}
% only has two keys: \gloskey[glsadd]{counter} and \gloskey[glsadd]{format} (the \gloskey[glsaddall]{types} key will be ignored).
%\begin{macro}{\glsadd}
%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon}
%    \begin{macrocode}
\newcommand*{\glsadd}[2][]{%
\glsdoifexists{#2}{%
\def\@glsnumberformat{glsnumberformat}%
\edef\@gls@counter{\csname glo@#2@counter\endcsname}%
\setkeys{glossadd}{#1}%
\edef\theglsentrycounter{\expandafter\noexpand
  \csname the\@gls@counter\endcsname}%
\@do@wrglossary{#2}%
}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
%\cs{glsaddall}\oarg{glossary list}\\[10pt]
% Add all terms defined for the listed glossaries (without displaying
% any text). If \gloskey[glsaddall]{types} key is omitted, apply to all
% glossary types.
%\begin{macro}{\glsaddall}
%    \begin{macrocode}
\newcommand*{\glsaddall}[1][]{%
\edef\@glo@type{\@glo@types}%
\setkeys{glossadd}{#1}%
\forallglsentries[\@glo@type]{\@glo@entry}{%
\glsadd[#1]{\@glo@entry}}%
}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Creating associated files}
% The \cs{writeist} command creates the associated 
% customized \filetype{.ist} \appname{makeindex} style file.
% While defining this command, some characters have their 
% catcodes temporarily changed to ensure they get written to 
% the \filetype{.ist} file correctly. The \appname{makeindex} 
% actual character (usually "@") is redefined to be a "?", to allow 
% internal commands to be written to the glossary file output file.
%
% The special characters\mkidxspch\ are stored in \cs{@gls@actualchar},
% \cs{@gls@encapchar}, \cs{@glsl@levelchar} and
% \cs{@gls@quotechar} to make them easier to use later,
% but don't change these values, because the characters are
% encoded in the command definitions that are used to escape
% the special characters (which means that the user no longer
% needs to worry about \appname{makeindex} special characters).
%
% The symbols and numbers label for group headings are hardwired into
% the \filetype{.ist} file as \texttt{glssymbols} and 
% \texttt{glsnumbers}, the group titles can be translated 
% (so that \ics{glssymbolsgroupname} replaces \texttt{glssymbols}
% and \ics{glsnumbersgroupname} replaces \texttt{glsnumbers})
% using the command \ics{glsgetgrouptitle} which is
% defined in \isty{glossary-hypernav}. This is done to prevent
% any problem characters in \ics{glssymbolsgroupname}
% and \ics{glsnumbersgroupname} from breaking hyperlinks.
%
%\begin{macro}{\glsopenbrace}
% Define \cs{glsopenbrace} to make it easier to write an opening 
% brace to a file.
%    \begin{macrocode}
\edef\glsopenbrace{\expandafter\@gobble\string\{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsclosebrace}
% Define \cs{glsclosebrace} to make it easier to write an opening 
% brace to a file.
%    \begin{macrocode}
\edef\glsclosebrace{\expandafter\@gobble\string\}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsquote}
% Define command that makes it easier to write quote marks to
% a file in the event that the double quote character has been
% made active.
%    \begin{macrocode}
\edef\glsquote#1{\string"#1\string"}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glsfirstletter}
% Define the first letter to come after the digits 0,\ldots,9.
% Only required for \appname{xindy}.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*{\@glsfirstletter}{A}
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlsSetXdyFirstLetterAfterDigits}
% Sets the first letter to come after the digits 0,\ldots,9.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{%
    \renewcommand*{\@glsfirstletter}{#1}}
\else
  \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{%
    \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glsminrange}
% Define the minimum number of successive location references
% to merge into a range.
%    \begin{macrocode}
\newcommand*{\@glsminrange}{2}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlsSetXdyMinRangeLength}
% Set the minimum range length. The value must either be "none"
% or a positive integer. The \sty{glossaries} package doesn't
% check if the argument is valid, that is left to \appname{xindy}.
%    \begin{macrocode}
\ifglsxindy
  \newcommand*{\GlsSetXdyMinRangeLength}[1]{%
    \renewcommand*{\@glsminrange}{#1}}
\else
  \newcommand*{\GlsSetXdyMinRangeLength}[1]{%
    \glsnoxindywarning\GlsSetXdyMinRangeLength}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\writeist}
%\changes{1.17}{2008 December 26}{added xindy support}
%\changes{1.01}{2007 May 17}{Added spaces after 'delimN and 'delimR in ist file}%
%    \begin{macrocode}
\newwrite\istfile
\ifglsxindy
%    \end{macrocode}
% Code to use if \appname{xindy} is required.
%    \begin{macrocode}
  \def\writeist{%
%    \end{macrocode}
% Open the style file
%    \begin{macrocode}
    \openout\istfile=\istfilename
%    \end{macrocode}
% Write header comment at the start of the file
%    \begin{macrocode}
    \write\istfile{;; xindy style file created by the glossaries
      package}%
    \write\istfile{;; for document '\jobname' on 
      \the\year-\the\month-\the\day}%
%    \end{macrocode}
% Specify the required styles
%    \begin{macrocode}
    \write\istfile{^^J; required styles^^J}
    \@for\@xdystyle:=\@xdyrequiredstyles\do{%
       \ifx\@xdystyle\@empty
       \else
         \protected@write\istfile{}{(require 
           \string"\@xdystyle.xdy\string")}%
       \fi
    }%
%    \end{macrocode}
% List the allowed attributes (possible values used by the
% \gloskey{format} key)
%    \begin{macrocode}
    \write\istfile{^^J%
       ; list of allowed attributes (number formats)^^J}%
    \write\istfile{(define-attributes ((\@xdyattributes)))}%
%    \end{macrocode}
% Define any additional alphabets
%    \begin{macrocode}
    \write\istfile{^^J; user defined alphabets^^J}%
    \write\istfile{\@xdyuseralphabets}%
%    \end{macrocode}
% Define location classes.
%    \begin{macrocode}
    \write\istfile{^^J; location class definitions^^J}%
%    \end{macrocode}
% Lower case Roman numerals (i, ii, \ldots). In the event that
% \ics{roman} has been redefined to produce a fancy form of
% roman numerals, attempt to work out how it will be written
% to the output file.
%    \begin{macrocode}
    \protected@edef\@gls@roman{\@roman{0\string" 
      \string"roman-numbers-lowercase\string" :sep \string"}}%
    \@onelevel@sanitize\@gls@roman
    \edef\@tmp{\string" \string"roman-numbers-lowercase\string"
       :sep \string"}%
    \@onelevel@sanitize\@tmp
    \ifx\@tmp\@gls@roman
       \write\istfile{(define-location-class
         \string"roman-page-numbers\string"^^J\space\space\space
         (\string"roman-numbers-lowercase\string")
         :min-range-length \@glsminrange)}%
    \else
       \write\istfile{(define-location-class
         \string"roman-page-numbers\string"^^J\space\space\space
         (:sep "\@gls@roman")
         :min-range-length \@glsminrange)}%
    \fi
%    \end{macrocode}
% Upper case Roman numerals (I, II, \ldots)
%    \begin{macrocode}
    \write\istfile{(define-location-class
      \string"Roman-page-numbers\string"^^J\space\space\space
      (\string"roman-numbers-uppercase\string")
         :min-range-length \@glsminrange)}%
%    \end{macrocode}
% Arabic numbers (1, 2, \ldots)
%    \begin{macrocode}
    \write\istfile{(define-location-class 
      \string"arabic-page-numbers\string"^^J\space\space\space
      (\string"arabic-numbers\string")
         :min-range-length \@glsminrange)}%
%    \end{macrocode}
% Lower case alphabetical locations (a, b, \ldots)
%    \begin{macrocode}
    \write\istfile{(define-location-class 
      \string"alpha-page-numbers\string"^^J\space\space\space
      (\string"alpha\string")
         :min-range-length \@glsminrange)}%
%    \end{macrocode}
% Upper case alphabetical locations (A, B, \ldots)
%    \begin{macrocode}
    \write\istfile{(define-location-class
      \string"Alpha-page-numbers\string"^^J\space\space\space
      (\string"ALPHA\string")
         :min-range-length \@glsminrange)}%
%    \end{macrocode}
% Appendix style locations (e.g.\ A-1, A-2, \ldots, B-1, B-2,
% \ldots). The separator is given by \ics{@glsAlphacompositor}.
%    \begin{macrocode}
    \write\istfile{(define-location-class
      \string"Appendix-page-numbers\string"^^J\space\space\space
      (\string"ALPHA\string"
       :sep \string"\@glsAlphacompositor\string"
       \string"arabic-numbers\string")
         :min-range-length \@glsminrange)}%
%    \end{macrocode}
% Section number style locations (e.g.\ 1.1, 1.2, \ldots). The
% compositor is given by \ics{glscompositor}.
%    \begin{macrocode}
    \write\istfile{(define-location-class
      \string"arabic-section-numbers\string"^^J\space\space\space
      (\string"arabic-numbers\string"
       :sep \string"\glscompositor\string"
       \string"arabic-numbers\string")
         :min-range-length \@glsminrange)}%
%    \end{macrocode}
% User defined location classes.
%    \begin{macrocode}
    \write\istfile{^^J; user defined location classes}%
    \write\istfile{\@xdyuserlocationdefs}%
%    \end{macrocode}
% Cross-reference class. (The unverified option is used as the
% cross-references are supplied using the list of labels along with
% the optional argument for \ics{glsseeformat} which
% \appname{xindy} won't recognise.)
%    \begin{macrocode}
    \write\istfile{^^J; define cross-reference class^^J}%
    \write\istfile{(define-crossref-class \string"see\string"
      :unverified )}%
%    \end{macrocode}
% Define how cross-references should be displayed. This adds an
% empty set of braces after the cross-referencing information 
% allowing for the final argument of \cs{glsseeformat} which
% gets ignored. (When using \appname{makeindex} this final argument
% contains the location information which is not required.)
%    \begin{macrocode}
    \write\istfile{(markup-crossref-list
       :class \string"see\string"^^J\space\space\space
       :open \string"\string\glsseeformat\string"
       :close \string"{}\string")}%
%    \end{macrocode}
% List the order to sort the classes.
%    \begin{macrocode}
    \write\istfile{^^J; define the order of the location classes}%
    \write\istfile{(define-location-class-order
       (\@xdylocationclassorder))}%
%    \end{macrocode}
% Specify what to write to the start and end of the glossary file.
%    \begin{macrocode}
    \write\istfile{^^J; define the glossary markup^^J}%
    \write\istfile{(markup-index^^J\space\space\space
      :open \string"\string
      \glossarysection[\string\glossarytoctitle]{\string
      \glossarytitle}\string\glossarypreamble\string~n\string\begin
      {theglossary}\string\glossaryheader\string~n\string" ^^J\space
      \space\space:close \string"\expandafter\@gobble
        \string\%\string~n\string
        \end{theglossary}\string\glossarypostamble
        \string~n\string" ^^J\space\space\space
      :tree)}%
%    \end{macrocode}
% Specify what to put between letter groups
%    \begin{macrocode}
    \write\istfile{(markup-letter-group-list
      :sep \string"\string\glsgroupskip\string~n\string")}%
%    \end{macrocode}
% Specify what to put between entries
%    \begin{macrocode}
    \write\istfile{(markup-indexentry
      :open \string"\string\relax \string\glsresetentrylist
         \string~n\string")}%
%    \end{macrocode}
% Specify how to format entries
%    \begin{macrocode}
    \write\istfile{(markup-locclass-list :open 
     \string"\glsopenbrace\string\glossaryentrynumbers
       \glsopenbrace\string\relax\space \string"^^J\space\space\space
     :sep \string", \string"
     :close \string"\glsclosebrace\glsclosebrace\string")}%
%    \end{macrocode}
% Specify how to separate location numbers
%    \begin{macrocode}
    \write\istfile{(markup-locref-list
     :sep \string"\string\delimN\space\string")}%
%    \end{macrocode}
% Specify how to indicate location ranges
%    \begin{macrocode}
    \write\istfile{(markup-range
     :sep \string"\string\delimR\space\string")}%
%    \end{macrocode}
% Specify 2-page and 3-page suffixes, if defined.
% First, the values must be sanitized to write them explicity.
%    \begin{macrocode}
    \@onelevel@sanitize\gls@suffixF
    \@onelevel@sanitize\gls@suffixFF
%    \end{macrocode}
%    \begin{macrocode}
    \ifx\gls@suffixF\@empty
    \else
      \write\istfile{(markup-range
      :close "\gls@suffixF" :length 1 :ignore-end)}%
    \fi
    \ifx\gls@suffixFF\@empty
    \else
      \write\istfile{(markup-range
      :close "\gls@suffixFF" :length 2 :ignore-end)}%
    \fi
%    \end{macrocode}
% Specify how to format locations.
%    \begin{macrocode}
    \write\istfile{^^J; define format to use for locations^^J}%
    \write\istfile{\@xdylocref}%
%    \end{macrocode}
% Specify how to separate letter groups.
%    \begin{macrocode}
    \write\istfile{^^J; define letter group list format^^J}%
    \write\istfile{(markup-letter-group-list
     :sep \string"\string\glsgroupskip\string~n\string")}%
%    \end{macrocode}
% Define letter group headings.
%    \begin{macrocode}
    \write\istfile{^^J; letter group headings^^J}%
    \write\istfile{(markup-letter-group 
      :open-head \string"\string\glsgroupheading
      \glsopenbrace\string"^^J\space\space\space
      :close-head \string"\glsclosebrace\string")}%
%    \end{macrocode}
% Define additional letter groups.
%    \begin{macrocode}
    \write\istfile{^^J; additional letter groups^^J}%
    \write\istfile{\@xdylettergroups}%
%    \end{macrocode}
% Define additional sort rules
%    \begin{macrocode}
    \write\istfile{^^J; additional sort rules^^J}
    \write\istfile{\@xdysortrules}%
  \noist}
\else
%    \end{macrocode}
% Code to use if \appname{makeindex} is required.
%    \begin{macrocode}
  \edef\@gls@actualchar{\string?}
  \edef\@gls@encapchar{\string|}
  \edef\@gls@levelchar{\string!}
  \edef\@gls@quotechar{\string"}
  \def\writeist{\relax
    \openout\istfile=\istfilename
    \write\istfile{\expandafter\@gobble\string\% makeindex style file
      created by the glossaries package}
    \write\istfile{\expandafter\@gobble\string\% for document
      '\jobname' on \the\year-\the\month-\the\day}
    \write\istfile{actual '\@gls@actualchar'}
    \write\istfile{encap '\@gls@encapchar'}
    \write\istfile{level '\@gls@levelchar'}
    \write\istfile{quote '\@gls@quotechar'}
    \write\istfile{keyword \string"\string\\glossaryentry\string"}
    \write\istfile{preamble \string"\string\\glossarysection[\string
      \\glossarytoctitle]{\string\\glossarytitle}\string
      \\glossarypreamble\string\n\string\\begin{theglossary}\string
      \\glossaryheader\string\n\string"}
    \write\istfile{postamble \string"\string\%\string\n\string
      \\end{theglossary}\string\\glossarypostamble\string\n
      \string"}
    \write\istfile{group_skip \string"\string\\glsgroupskip\string\n
      \string"}
    \write\istfile{item_0 \string"\string\%\string\n\string"}
    \write\istfile{item_1 \string"\string\%\string\n\string"}
    \write\istfile{item_2 \string"\string\%\string\n\string"}
    \write\istfile{item_01 \string"\string\%\string\n\string"}
    \write\istfile{item_x1
      \string"\string\\relax \string\\glsresetentrylist\string\n
      \string"}
    \write\istfile{item_02 \string"\string\%\string\n\string"}
    \write\istfile{item_12 \string"\string\%\string\n\string"}
    \write\istfile{item_x2
      \string"\string\\relax \string\\glsresetentrylist\string\n
      \string"}
    \write\istfile{delim_0 \string"\{\string
      \\glossaryentrynumbers\{\string\\relax \string"}
    \write\istfile{delim_1 \string"\{\string
      \\glossaryentrynumbers\{\string\\relax \string"}
    \write\istfile{delim_2 \string"\{\string
      \\glossaryentrynumbers\{\string\\relax \string"}
    \write\istfile{delim_t \string"\}\}\string"}
    \write\istfile{delim_n \string"\string\\delimN \string"}
    \write\istfile{delim_r \string"\string\\delimR \string"}
    \write\istfile{headings_flag 1}
    \write\istfile{heading_prefix 
       \string"\string\\glsgroupheading\{\string"}
    \write\istfile{heading_suffix
       \string"\}\string\\relax
       \string\\glsresetentrylist \string"}
    \write\istfile{symhead_positive \string"glssymbols\string"}
    \write\istfile{numhead_positive \string"glsnumbers\string"}
    \write\istfile{page_compositor \string"\glscompositor\string"}
    \@gls@escbsdq\gls@suffixF
    \@gls@escbsdq\gls@suffixFF
    \ifx\gls@suffixF\@empty
    \else
      \write\istfile{suffix_2p \string"\gls@suffixF\string"}
    \fi
    \ifx\gls@suffixFF\@empty
    \else
      \write\istfile{suffix_3p \string"\gls@suffixFF\string"}
    \fi
    \noist
  }
\fi
%    \end{macrocode}
%\end{macro}
%
%The command \cs{noist} will suppress the creation of
% the \filetype{.ist} file (it simply redefines 
% \cs{writeist} to do nothing). Obviously you need to use this
% command before \cs{writeist} to have any effect. Since
% the \filetype{.ist} file should only be created once, \cs{noist}
% is called at the end of \cs{writeist}.
%\begin{macro}{\noist}
%    \begin{macrocode}
\newcommand{\noist}{\let\writeist\relax}
%    \end{macrocode}
%\end{macro}
%
% \cs{@makeglossary} is an internal command that takes an 
% argument indicating the glossary type. This command will 
% create the glossary file required by \appname{makeindex} for the
% given glossary type, using the extension supplied by the
% \meta{out-ext} parameter used in \ics{newglossary} 
% (and it will also activate the \ics{glossary} command, 
% and create the customized \filetype{.ist} \appname{makeindex} 
% style file). 
%
% Note that you can't use \cs{@makeglossary} for only some of the
% defined glossaries. You either need to have a \cs{makeglossary}
% for all glossaries or none (otherwise you will end up with a
% situation where \TeX\ is trying to write to a non-existant
% file). The relevant glossary must be
% defined prior to using \cs{@makeglossary}.
%\begin{macro}{\@makeglossary}
%    \begin{macrocode}
\newcommand*{\@makeglossary}[1]{%
\ifglossaryexists{#1}{%
\edef\glo@out{\csname @glotype@#1@out\endcsname}%
\expandafter\newwrite\csname glo@#1@file\endcsname
\edef\@glo@file{\csname glo@#1@file\endcsname}%
\immediate\openout\@glo@file=\jobname.\glo@out
\@gls@renewglossary
\PackageInfo{glossaries}{Writing glossary file \jobname.\glo@out}
\writeist
}{\PackageError{glossaries}{%
Glossary type `#1' not defined}{New glossaries must be defined before
using \string\makeglossary}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\warn@nomakeglossaries}
% Issue warning that \cs{makeglossaries} hasn't been used.
%    \begin{macrocode}
\newcommand*{\warn@nomakeglossaries}{%
  \PackageWarningNoLine{glossaries}{\string\makeglossaries\space
  hasn't been used,^^Jthe glossaries will not be updated}%
}
%    \end{macrocode}
%\end{macro}
%
% \cs{makeglossaries} will use \cs{@makeglossary}
% for each glossary type that has been defined.  New glossaries
% need to be defined before using \cs{makeglossary}, so
% have \cs{makeglossaries} redefine \cs{newglossary}
% to prevent it being used afterwards.
%\begin{macro}{\makeglossaries}
%    \begin{macrocode}
\newcommand*{\makeglossaries}{%
% Write the name of the style file to the aux file 
% (needed by \appname{makeglossaries})
%    \begin{macrocode}
  \protected@write\@auxout{}{\string\@istfilename{\istfilename}}%
  \protected@write\@auxout{}{\string\@glsorder{\glsorder}}
%    \end{macrocode}
% Iterate through each glossary type and activate it.
%    \begin{macrocode}
  \@for\@glo@type:=\@glo@types\do{%
    \ifthenelse{\equal{\@glo@type}{}}{}{%
    \@makeglossary{\@glo@type}}%
  }%
%    \end{macrocode}
% New glossaries must be created before \cs{makeglossaries} 
% so disable \ics{newglossary}.
%    \begin{macrocode}
  \renewcommand*\newglossary[4][]{%
  \PackageError{glossaries}{New glossaries
  must be created before \string\makeglossaries}{You need
  to move \string\makeglossaries\space after all your 
  \string\newglossary\space commands}}%
%    \end{macrocode}
% Any subsequence instances of this command should have no effect
%    \begin{macrocode}
  \let\@makeglossary\relax
  \let\makeglossary\relax
  \let\makeglossaries\relax
%    \end{macrocode}
% Disable all commands that have no effect after \cs{makeglossaries}
%    \begin{macrocode}
  \@disable@onlypremakeg
%    \end{macrocode}
% Suppress warning about no \cs{makeglossaries}
%    \begin{macrocode}
  \let\warn@nomakeglossaries\relax
}
%    \end{macrocode}
%\end{macro}
%
% The \cs{makeglossary} command is redefined to be
% identical to \cs{makeglossaries}. (This is done to 
% reinforce the message that you must either use 
% \cs{@makeglossary} for all the glossaries or for none 
% of them.)
%\begin{macro}{\makeglossary}
%    \begin{macrocode}
\let\makeglossary\makeglossaries
%    \end{macrocode}
%\end{macro}
%
% If \ics{makeglossaries} hasn't been used, issue a warning.
% Also issue a warning if neither \ics{printglossaries} nor
% \ics{printglossary} have been used.
%    \begin{macrocode}
\AtEndDocument{%
  \warn@nomakeglossaries
  \warn@noprintglossary
}
%    \end{macrocode}
%
%\subsection{Writing information to associated files}
% The \cs{glossary} command is redefined so that it takes an 
% optional argument \meta{type} to specify the glossary type (use 
% \cs{glsdefaulttype} glossary by default). 
% This shouldn't be used at user level
% as \cs{glslink} sets the correct format. The associated 
% number should be stored in \cs{theglsentrycounter}
% before using \cs{glossary}.
%\begin{macro}{\glossary}
%    \begin{macrocode}
\renewcommand*{\glossary}[1][\glsdefaulttype]{%
\@glossary[#1]}
%    \end{macrocode}
%\end{macro}
%
% Define internal \cs{@glossary} to ignore its argument.
% This gets redefined in \cs{@makeglossary}. This is
% defined to just \cs{index} as \icls{memoir} changes the definition of
% \cs{@index}. (Thanks to Dan Luecking for pointing this out.)
%\begin{macro}{\@glossary}
%\changes{1.17}{2008 December 26}{changed definition to use 'index instead of '@index}
%    \begin{macrocode}
\def\@glossary[#1]{\index}
%    \end{macrocode}
%\end{macro}
% This is a convenience command to set \cs{@glossary}.
% It is used by \cs{@makeglossary} and then redefined to
% do nothing, as it only needs to be done once.
%\begin{macro}{@gls@renewglossary}
%    \begin{macrocode}
\newcommand{\@gls@renewglossary}{%
\gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}%
\let\@gls@renewglossary\@empty
}
%    \end{macrocode}
%\end{macro}
% The \cs{@wrglossary} command is redefined to have
% two arguments. The first argument is the glossary type, 
% the second argument is the glossary entry 
% (the format of which is set in \cs{glslink}).
%\begin{macro}{\@wrglossary}
%\changes{1.17}{2008 December 26}{modified to allow for xindy support}
%    \begin{macrocode}
\renewcommand*{\@wrglossary}[2]{%
  \expandafter\protected@write\csname glo@#1@file\endcsname{}{#2}%
  \endgroup\@esphack
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@do@wrglossary}
%\changes{1.17}{2008 December 26}{new}
% Write the glossary entry in the appropriate format.
% (Need to set \@glsnumberformat and \@gls@counter prior to use.)
% The argument is the entry's label.
%    \begin{macrocode}
\newcommand{\@do@wrglossary}[1]{%
%    \end{macrocode}
% Determine whether to use \appname{xindy} or \appname{makeindex}
% syntax
%    \begin{macrocode}
\ifglsxindy
%    \end{macrocode}
% Need to determine if the formatting information starts with
% a ( or ) indicating a range.
%    \begin{macrocode}
  \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil
  \def\@glo@range{}%
  \expandafter\if\@glo@prefix(\relax
    \def\@glo@range{:open-range}%
  \else
    \expandafter\if\@glo@prefix)\relax
      \def\@glo@range{:close-range}%
    \fi
  \fi
%    \end{macrocode}
% Get the location and escape any special characters
%    \begin{macrocode}
\protected@edef\@glslocref{\theglsentrycounter}%
\@gls@checkmkidxchars\@glslocref
%    \end{macrocode}
% Write to the glossary file using \appname{xindy} syntax.
%    \begin{macrocode}
  \glossary[\csname glo@#1@type\endcsname]{%
  (indexentry :tkey (\csname glo@#1@index\endcsname)
    :locref \string"\@glslocref\string" %
    :attr \string"\@glo@suffix\string" \@glo@range
  )
  }%
\else
%    \end{macrocode}
% Convert the format information into the format required for
% \appname{makeindex}
%    \begin{macrocode}
  \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat
%    \end{macrocode}
% Write to the glossary file using \appname{makeindex} syntax.
%    \begin{macrocode}
  \glossary[\csname glo@#1@type\endcsname]{%
  \string\glossaryentry{\csname glo@#1@index\endcsname
    \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}%
\fi
}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Glossary Entry Cross-References}
%\begin{macro}{\@do@seeglossary}
%\changes{1.17}{2008 December 26}{new}
% Write the glossary entry with a cross reference.
% The first argument is the entry's label, the second must be in
% the form \oarg{tag}\marg{list}, where \meta{tag} is a tag
% such as ``see'' and \meta{list} is a list of labels.
%    \begin{macrocode}
\newcommand{\@do@seeglossary}[2]{%
\ifglsxindy
  \glossary[\csname glo@#1@type\endcsname]{%
    (indexentry
      :tkey (\csname glo@#1@index\endcsname)
      :xref (\string"#2\string")
      :attr \string"see\string"
    )
  }%
\else
  \glossary[\csname glo@#1@type\endcsname]{%
  \string\glossaryentry{\csname glo@#1@index\endcsname
  \@gls@encapchar glsseeformat#2}{Z}}%
\fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@fixbraces}
% If no optional argument is specified, list needs to be enclosed
% in a set of braces.
%    \begin{macrocode}
\def\@gls@fixbraces#1#2#3\@nil{%
  \ifx#2[\relax
    \def#1{#2#3}%
  \else
    \def#1{{#2#3}}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glssee}
%\cs{glssee}\marg{label}\marg{cross-ref list}
%\changes{1.17}{2008 December 26}{new}
%     \begin{macrocode}
\newcommand*{\glssee}[3][\seename]{%
  \@do@seeglossary{#2}{[#1]{#3}}}
\newcommand*{\@glssee}[3][\seename]{%
  \glssee[#1]{#3}{#2}}
%     \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsseeformat}
%\changes{1.17}{2008 December 26}{new}
% The first argument specifies what tag to use (e.g.\ ``see''),
% the second argument is a comma-separated list of labels.
% The final argument (the location) is ignored.
%    \begin{macrocode}
\newcommand*{\glsseeformat}[3][\seename]{\emph{#1} \glsseelist{#2}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsseelist}
%\cs{glsseelist}\marg{list} formats list of entry labels.
%    \begin{macrocode}
\newcommand*{\glsseelist}[1]{%
%    \end{macrocode}
% If there is only one item in the list, set the last separator
% to do nothing.
%    \begin{macrocode}
  \let\@gls@dolast\relax
%    \end{macrocode}
% Don't display separator on the first iteration of the loop
%    \begin{macrocode}
  \let\@gls@donext\relax
%    \end{macrocode}
% Iterate through the labels
%    \begin{macrocode}
  \@for\@gls@thislabel:=#1\do{%
%    \end{macrocode}
% Check if on last iteration of loop
%    \begin{macrocode}
    \ifx\@xfor@nextelement\@nnil
      \@gls@dolast
    \else
      \@gls@donext
    \fi
%    \end{macrocode}
% display the entry for this label
%    \begin{macrocode}
    \glsseeitem{\@gls@thislabel}%
%    \end{macrocode}
% Update separators
%    \begin{macrocode}
    \let\@gls@dolast\glsseelastsep
    \let\@gls@donext\glsseesep
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsseelastsep}
% Separator to use between penultimate and ultimate entries in a
% cross-referencing list.
%    \begin{macrocode}
\newcommand*{\glsseelastsep}{\space\andname\space}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsseesep}
% Separator to use between entires in a cross-referencing list.
%    \begin{macrocode}
\newcommand*{\glsseesep}{, }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsseeitem}
%\cs{glsseeitem}\marg{label} formats individual entry in a 
% cross-referencing list.
%    \begin{macrocode}
\newcommand*{\glsseeitem}[1]{\glshyperlink{#1}}
%    \end{macrocode}
%\end{macro}
%
% \subsection{Displaying the glossary}\label{sec:code:printglos}
% An individual glossary is displayed in the text using
% \cs{printglossary}\oarg{key-val list}. If the 
% \gloskey[printglossary]{type} key is omitted, the default glossary is displayed.
% The optional argument can be used to specify an alternative
% glossary, and can also be used to set the style, title and
% entry in the table of contents. Available keys are defined below.
%
%\begin{macro}{\warn@noprintglossary}
% Warn the user if they have forgotten \ics{printglossaries}
% or \ics{printglossary}. (Will be suppressed if there is at
% least one occurance of \ics{printglossary}. There is no check
% to ensure that there is a \ics{printglossary} for each defined
% glossary.)
%    \begin{macrocode}
\def\warn@noprintglossary{\PackageWarningNoLine{glossaries}{No
  \string\printglossary\space or \string\printglossaries\space
  found.^^JThis document will not have a glossary.}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\printglossary}
%\changes{1.17}{2008 December 26}{added print language to aux file}
%\changes{1.15}{2008 August 15}{changed the way the TOC title is set}
%\changes{1.17}{2008 December 26}{added check to determine if 'printglossary is already
% defined}
% The TOC title needs to be processed in a different manner
% to the main title in case the \sty{translator} and \sty{hyperref} packages
% are both being used.
%    \begin{macrocode}
\@ifundefined{printglossary}{}{%
%    \end{macrocode}
% If \cs{printglossary} is already defined, issue a warning
% and undefine it.
%    \begin{macrocode}
\PackageWarning{glossaries}{Overriding \string\printglossary}%
\let\printglossary\undefined}
%    \end{macrocode}
% \cs{printglossary} has an optional argument. The default
% value is to set the glossary type to the main glossary.
%    \begin{macrocode}
\newcommand*{\printglossary}[1][type=\glsdefaulttype]{%
%    \end{macrocode}
% If \appname{xindy} is being used, need to find the root language
% for \appname{makeglossaries} to pass to \appname{xindy}.
%    \begin{macrocode}
  \ifglsxindy\findrootlanguage\fi
%    \end{macrocode}
% Set up defaults.
%    \begin{macrocode}
  \def\@glo@type{\glsdefaulttype}%
  \def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}%
  \def\@glossarystyle{}%
  \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}%
%    \end{macrocode}
% Store current value of \ics{glossaryentrynumbers}. (This may
% be changed via the optional argument)
%    \begin{macrocode}
  \let\@org@glossaryentrynumbers\glossaryentrynumbers
%    \end{macrocode}
% Localise the effects of the optional argument
%    \begin{macrocode}
  \bgroup
%    \end{macrocode}
% Determine settings specified in the optional argument.
%    \begin{macrocode}
    \setkeys{printgloss}{#1}%
%    \end{macrocode}
%Enable individual number lists to be suppressed.
%    \begin{macrocode}
    \let\org@glossaryentrynumbers\glossaryentrynumbers
    \let\glsnonextpages\@glsnonextpages
%    \end{macrocode}
% Enable suppression of description terminators.
%    \begin{macrocode}
    \let\nopostdesc\@nopostdesc
%    \end{macrocode}
% Set up the entry for the TOC
%    \begin{macrocode}
    \gls@dotoctitle
%    \end{macrocode}
% Set the glossary style
%    \begin{macrocode}
    \@glossarystyle
%    \end{macrocode}
% Some macros may end up being expanded into internals in the
% glossary, so need to make @ a letter.
%    \begin{macrocode}
    \makeatletter
%    \end{macrocode}
% Input the glossary file, if it exists.
%    \begin{macrocode}
    \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}%
%    \end{macrocode}
% If \appname{xindy} is being used, need to write the language
% dependent information to the \filetype{.aux} file for
% \appname{makeglossaries}.
%    \begin{macrocode}
    \ifglsxindy
      \@ifundefined{@xdy@\@glo@type @language}{%
        \protected@write\@auxout{}{%
        \string\@xdylanguage{\@glo@type}{\@xdy@main@language}}%
      }{%
        \protected@write\@auxout{}{%
          \string\@xdylanguage{\@glo@type}{\csname @xdy@\@glo@type 
            @language\endcsname}}%
      }%
      \protected@write\@auxout{}{%
        \string\@gls@codepage{\@glo@type}{\gls@codepage}}%
    \fi
  \egroup
%    \end{macrocode}
% Reset \ics{glossaryentrynumbers}
%    \begin{macrocode}
  \global\let\glossaryentrynumbers\@org@glossaryentrynumbers
%    \end{macrocode}
% Suppress warning about no \ics{printglossary}
%    \begin{macrocode}
\let\warn@noprintglossary\relax
}
%    \end{macrocode}
%\end{macro}
%
% The \cs{printglossaries} command will do \cs{printglossary}
% for each glossary type that has been defined. It is better
% to use \cs{printglossaries} rather than individual
% \cs{printglossary} commands to ensure that you don't forget
% any new glossaries you may have created. It also makes it easier to
% chop and change the value of the \pkgopt{acronym} package option.
% However, if you want to list the glossaries in a different order,
% or if you want to set the title or table of contents entry, or
% if you want to use different glossary styles for each glossary, you
% will need to use \cs{printglossary} explicitly for each
% glossary type.
%\begin{macro}{\printglossaries}
%    \begin{macrocode}
\newcommand*{\printglossaries}{%
\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}}
%    \end{macrocode}
%\end{macro}
% The keys that can be used in the optional argument to
% \ics{printglossary} are as follows:
% The \gloskey[printglossary]{type} key sets the glossary type.
%    \begin{macrocode}
\define@key{printgloss}{type}{\def\@glo@type{#1}}
%    \end{macrocode}
% The \gloskey[printglossary]{title} key sets the title used in the glossary section
% header. This overrides the title used in \ics{newglossary}.
%    \begin{macrocode}
\define@key{printgloss}{title}{\def\glossarytitle{#1}}
%    \end{macrocode}
% The \gloskey[printglossary]{toctitle} sets the text used for the relevant entry 
% in the table of contents.
%    \begin{macrocode}
\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}%
\let\gls@dotoctitle\relax
}
%    \end{macrocode}
% The \gloskey[printglossary]{style} key sets the glossary style (but only for
% the given glossary).
%    \begin{macrocode}
\define@key{printgloss}{style}{%
\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary 
style `#1' undefined}{}}{%
\def\@glossarystyle{\csname @glsstyle@#1\endcsname}}}
%    \end{macrocode}
% \changes{1.14}{2008 June 17}{added numberedsection key to 'printglossary}
% The \gloskey[printglossary]{numberedsection} key determines if this
% glossary should be in a numbered section.
%    \begin{macrocode}
\define@choicekey{printgloss}{numberedsection}[\val\nr]{%
false,nolabel,autolabel}[nolabel]{%
\ifcase\nr\relax
  \renewcommand*{\@@glossarysecstar}{*}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}%
\fi}
%    \end{macrocode}
% \changes{1.14}{2008 June 17}{added nonumberlist key to 'printglossary}
% The \gloskey[printglossary]{nonumberlist} key determines if this
% glossary should have a number list.
%    \begin{macrocode}
\define@boolkey{printgloss}[gls]{nonumberlist}[true]{%
\ifglsnonumberlist
   \def\glossaryentrynumbers##1{}%
\else
   \def\glossaryentrynumbers##1{##1}%
\fi}
%    \end{macrocode}
%
%\begin{macro}{\@glsnonextpages}
%\changes{1.17}{2008 December 26}{new}%
% Suppresses the next number list only. Global assignments required
% as it may not occur in the same level of grouping as the
% next numberlist. (For example, if \cs{glsnonextpages} is place
% in the entry's description and 3 column tabular style glossary
% is used.) \cs{org@glossaryentrynumbers} needs to be set at
% the start of each glossary, in the event that
% \ics{glossaryentrynumber} is redefined.
%    \begin{macrocode}
\newcommand*{\@glsnonextpages}{%
  \gdef\glossaryentrynumbers##1{%
     \glsresetentrylist}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsresetentrylist}
% Resets \cs{glossaryentrynumbers}
%    \begin{macrocode}
\newcommand*{\glsresetentrylist}{%
  \global\let\glossaryentrynumbers\org@glossaryentrynumbers}
%    \end{macrocode}
%\end{macro}
%
%
%\begin{macro}{\glsnonextpages}
% Outside of \cs{printglossary} this does nothing.
%    \begin{macrocode}
\newcommand*{\glsnonextpages}{}
%    \end{macrocode}
%\end{macro}
%
%\DescribeEnv{theglossary}
% If the \envname{theglossary} environment has 
% already been defined, a warning will be issued. 
% This environment should be redefined by glossary styles.
%    \begin{macrocode}
\@ifundefined{theglossary}{%
\newenvironment{theglossary}{}{}}{%
\PackageWarning{glossaries}{overriding `theglossary' environment}%
\renewenvironment{theglossary}{}{}}
%    \end{macrocode}
%
% The glossary header is given by \cs{glossaryheader}. 
% This forms part of the glossary style, and
% must indicate what should appear immediately after the start of the
% \envname{theglossary} environment. (For example, if the glossary
% uses a tabular-like environment, it may be used to set the
% header row.) Note that if you don't want a header row, the glossary
% style must redefine \cs{glossaryheader} to do nothing.
%\begin{macro}{\glossaryheader}
%    \begin{macrocode}
\newcommand*{\glossaryheader}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glstarget}
%\changes{1.18}{2009 January 14}{new}
%\cs{glstarget}\marg{label}\marg{name}\\[10pt]
% Provide user interface to \cs{@glstarget} to make it easier to
% modify the glossary style in the document.
%    \begin{macrocode}
\newcommand*{\glstarget}[2]{\@glstarget{glo:#1}{#2}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glossaryentryfield}
% \cs{glossaryentryfield}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt]
% This command governs how each entry row should be formatted 
% in the glossary. Glossary styles need to redefine this command.
% Most of the predefined styles ignore \meta{symbol}.
%    \begin{macrocode}
\newcommand*{\glossaryentryfield}[5]{%
\noindent\textbf{\glstarget{#1}{#2}} #4 #3. #5\par}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glossaryentryfield}
% \cs{glossarysubentryfield}\marg{level}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt]
% This command governs how each subentry should be formatted 
% in the glossary. Glossary styles need to redefine this command.
% Most of the predefined styles ignore \meta{symbol}. The first
% argument is a number indicating the level. (The level should
% be greater than or equal to 1.)
%    \begin{macrocode}
\newcommand*{\glossarysubentryfield}[6]{%
\glstarget{#2}{\strut}#4. #6\par}
%    \end{macrocode}
%\end{macro}
%
% Within each glossary, the entries form distinct groups
% which are determined by the first character of the \gloskey{sort} 
% key. When using \appname{makeindex}, there will be a maximum of 28 groups: symbols, numbers,
% and the 26 alphabetical groups A, \ldots, Z\@. If you use
% \appname{xindy} the groups will depend on whatever alphabet
% is used. This is determined by the language or custom
% alphabets can be created in the \appname{xindy} style file.
% The command \cs{glsgroupskip} 
% specifies what to do between glossary groups. Glossary styles
% must redefine this command. (Note that \cs{glsgroupskip}
% only occurs between groups, not at the start or end of the
% glossary.)
%\begin{macro}{\glsgroupskip}
%    \begin{macrocode}
\newcommand*{\glsgroupskip}{}
%    \end{macrocode}
%\end{macro}
%
% Each of the 28 glossary groups described above is preceded by a 
% group heading.
% This is formatted by the command \cs{glsgroupheading}
% which takes one argument which is the \emph{label} assigned to that
% group (not the title). The corresponding labels are: \texttt{glssymbols},
% \texttt{glsnumbers}, \texttt{A}, \ldots, \texttt{Z}. 
% Glossary styles must redefined this command. (In between groups,
% \cs{glsgroupheading} comes immediately after \cs{glsgroupskip}.)
%\begin{macro}{\glsgroupheading}
%    \begin{macrocode}
\newcommand*{\glsgroupheading}[1]{}
%    \end{macrocode}
%\end{macro}
% It is possible to ``trick'' \appname{makeindex} into
% treating entries as though they belong to the same group, 
% even if the terms don't start with the same letter, by
% modifying the \gloskey{sort} key. For example, all entries 
% belonging to one
% group could be defined so that the \gloskey{sort} key starts with an
% "a", while entries belonging to another group could be defined
% so that the \gloskey{sort} key starts with a "b", and so on. If
% you want each group to have a heading, you would then need to
% modify the translation control sequences \cs{glsgetgrouptitle}
% and \cs{glsgetgrouplabel} so that the label is translated
% into the required title (and vice-versa).
%\\[10pt]
%\cs{glsgetgrouptitle}\marg{label}\\[10pt]
% This command produces the title for the glossary group
% whose label is given by \meta{label}. By default, the group
% labelled \texttt{glssymbols} produces 
% \ics{glssymbolsgroupname}, the group labelled 
% \texttt{glsnumbers} produces \ics{glsnumbersgroupname}
% and all the other groups simply produce their label.
% As mentioned above, the group labels are: \texttt{glssymbols}, \texttt{glsnumbers},
% \texttt{A}, \ldots, \texttt{Z}\@. If you want to redefine
% the group titles, you will need to redefine this command.
%\begin{macro}{\glsgetgrouptitle}
%    \begin{macrocode}
\newcommand*{\glsgetgrouptitle}[1]{%
\@ifundefined{#1groupname}{#1}{\csname #1groupname\endcsname}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
%\cs{glsgetgrouplabel}\marg{title}\\[10pt]
%This command does the reverse to the previous command. The
% argument is the group title, and it produces the group label.
% Note that if you redefine \cs{glsgetgrouptitle}, you
% will also need to redefine \cs{glsgetgrouplabel}.
%\begin{macro}{\glsgetgrouplabel}
%    \begin{macrocode}
\newcommand*{\glsgetgrouplabel}[1]{%
\ifthenelse{\equals{#1}{\glssymbolsgroupname}}{glssymbols}{%
\ifthenelse{\equals{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}}
%    \end{macrocode}
%\end{macro}
%
% The command \cs{setentrycounter} sets the entry's 
% associated counter (required by 
% \cs{glshypernumber} etc.) \ics{glslink} and
% \ics{glsadd} encode the
% \ics{glossary} argument so that the relevant counter is
% set prior to the formatting command.
%\begin{macro}{\setentrycounter}
%    \begin{macrocode}
\newcommand*{\setentrycounter}[1]{\def\glsentrycounter{#1}}
%    \end{macrocode}
%\end{macro}
%
% The current glossary style can be set using
% \cs{glossarystyle}\marg{style}.
%\begin{macro}{\glossarystyle}
%    \begin{macrocode}
\newcommand*{\glossarystyle}[1]{%
\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary 
style `#1' undefined}{}}{%
\csname @glsstyle@#1\endcsname}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\newglossarystyle}
% New glossary styles can be defined using:\\[10pt]
% \cs{newglossarystyle}\marg{name}\marg{definition}\\[10pt]
% The \meta{definition} argument should redefine 
% \envname{theglossary}, \ics{glossaryheader}, 
% \ics{glsgroupheading}, \ics{glossaryentryfield} and
% \ics{glsgroupskip} (see \autoref{sec:code:styles} for the
% definitions of predefined styles). Glossary styles should not 
% redefine \ics{glossarypreamble} and 
% \ics{glossarypostamble}, as
% the user should be able to switch between styles without affecting
% the pre- and postambles.
%\changes{1.17}{2008 December 26}{made 'newglossarystyle long}
%    \begin{macrocode}
\newcommand{\newglossarystyle}[2]{%
\@ifundefined{@glsstyle@#1}{%
\expandafter\def\csname @glsstyle@#1\endcsname{#2}}{%
\PackageError{glossaries}{Glossary style `#1' is already defined}{}}}
%    \end{macrocode}
%\end{macro}
%
% Glossary entries are encoded so that the second argument
% to \ics{glossaryentryfield} is always specified as
% \cs{glsnamefont}\marg{name}. This allows the
% user to change the font used to display the name term
% without having to redefine \ics{glossaryentryfield}.
% The default uses the surrounding font, so in the list type
% styles (which place the name in the optional argument to
% \ics{item}) the name will appear in bold.
%\begin{macro}{\glsnamefont}
%    \begin{macrocode}
\newcommand*{\glsnamefont}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% Each glossary entry has an associated number list (usually page
% numbers) that indicate where in the document the entry has been
% used. The format for these number lists can be changed using the
% \gloskey[glslink]{format}\igloskey[glsadd]{format} key in commands like \ics{glslink}.
% The default format is given by \cs{glshypernumber}. This takes
% a single argument which may be a single number, a number range
% or a number list. The number ranges are delimited with 
% \ics{delimR}, the number lists are delimited with 
% \ics{delimN}.
%
% If the document doesn't have hyperlinks, the numbers can be
% displayed just as they are, but if the document supports 
% hyperlinks, the numbers should link to the relevant location.
% This means extracting the individual numbers from the list or
% ranges. The \isty{hyperref} package does this with the
% \ics{hyperpage} command, but this is encoded for comma and
% dash delimiters and only for the page counter, but this code needs
% to be more general. So I have adapted the code used in the
% \isty{hyperref} package.
%\begin{macro}{\glshypernumber}
%\changes{1.17}{2008 December 26}{modified to allow material 
% to be attached to location}
%    \begin{macrocode}
\@ifundefined{hyperlink}{%
\def\glshypernumber#1{#1}}{%
\def\glshypernumber#1{%
  \@glshypernumber#1\nohyperpage{}\@nil}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glshypernumber}
% This code was provided by Heiko~Oberdiek to allow material
% to be attached to the location.
%\changes{1.17}{2008 December 26}{new}
%    \begin{macrocode}
\def\@glshypernumber#1\nohyperpage#2#3\@nil{%
  \ifx\\#1\\%
  \else
    \@delimR#1\delimR\delimR\\%
  \fi
  \ifx\\#2\\%
  \else
    #2%
  \fi
  \ifx\\#3\\%
  \else
    \@glshypernumber#3\@nil
  \fi
}
%    \end{macrocode}
%\end{macro}
% \cs{@delimR} displays a range of numbers for the counter 
% whose name is given by 
% \cs{@gls@counter} (which must be set prior to using
% \cs{glshypernumber}).
%\begin{macro}{\@delimR}
%    \begin{macrocode}
\def\@delimR#1\delimR #2\delimR #3\\{%
\ifx\\#2\\%
  \@delimN{#1}%
\else
  \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}%
\fi}
%    \end{macrocode}
%\end{macro}
% \cs{@delimN} displays a list of individual numbers, 
% instead of a range:
%\begin{macro}{\@delimN}
%    \begin{macrocode}
\def\@delimN#1{\@@delimN#1\delimN \delimN\\}
\def\@@delimN#1\delimN #2\delimN#3\\{%
\ifx\\#3\\%
  \@gls@numberlink{#1}%
\else
  \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}%
\fi
}
%    \end{macrocode}
%\end{macro}
% The following code is modified from hyperref's 
% \cs{HyInd@pagelink} where
% the name of the counter being used is given by 
% \cs{@gls@counter}.
%    \begin{macrocode}
\def\@gls@numberlink#1{%
\begingroup
 \toks@={}%
 \@gls@removespaces#1 \@nil
\endgroup}
%    \end{macrocode}
%    \begin{macrocode}
\def\@gls@removespaces#1 #2\@nil{%
 \toks@=\expandafter{\the\toks@#1}%
 \ifx\\#2\\%
   \edef\x{\the\toks@}%
   \ifx\x\empty
   \else
     \hyperlink{\glsentrycounter.\the\toks@}{\the\toks@}%
   \fi
 \else
   \@gls@ReturnAfterFi{%
     \@gls@removespaces#2\@nil
   }%
 \fi
}
\long\def\@gls@ReturnAfterFi#1\fi{\fi#1}
%    \end{macrocode}
%
% The following commands will switch to the
% appropriate font, and create a hyperlink, if hyperlinks are
% supported. If hyperlinks are not supported, they will just
% display their argument in the appropriate font.
%\begin{macro}{\hyperrm}
%    \begin{macrocode}
\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypersf}
%    \begin{macrocode}
\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypertt}
%    \begin{macrocode}
\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperbf}
%    \begin{macrocode}
\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypermd}
%    \begin{macrocode}
\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperit}
%    \begin{macrocode}
\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypersl}
%    \begin{macrocode}
\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperup}
%    \begin{macrocode}
\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypersc}
%    \begin{macrocode}
\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperemph}
%    \begin{macrocode}
\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Acronyms}\label{sec:acronym}
%If the \pkgopt{acronym} package option is used, a 
% new glossary called "acronym" is created
%    \begin{macrocode}
\ifglsacronym
  \newglossary[alg]{acronym}{acr}{acn}{\acronymname}
%    \end{macrocode}
%and \ics{acronymtype} is set to the name of this new glossary.
%    \begin{macrocode}
  \renewcommand{\acronymtype}{acronym}
%    \end{macrocode}
% In the event that the user redefines \ics{glsdisplay}
% and \ics{glsdisplayfirst}, the relevant commands for
% the new acronym glossary are set to match the format
% given by \ics{newacronym}. If you redefine 
% \ics{newacronym} you may need to set these to something
% else.
%    \begin{macrocode}
  \defglsdisplay[acronym]{#1#4}
  \defglsdisplayfirst[acronym]{#1#4}
\fi
%    \end{macrocode}
%\vskip5pt
% \cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}\marg{long}\\[10pt]
% This is a quick way of defining acronyms, all it does
% is call \ics{newglossaryentry} with the appropriate
% values. It sets the
% glossary type to \ics{acronymtype} which will be
% "acronym" if the package option \pkgopt{acronym} has
% been used, otherwise it will be the default glossary.
% Since \cs{newacronym} merely calls \ics{newglossaryentry},
% the acronym is treated like any other glossary entry.
%
% If you prefer a different format, you
% can redefine \cs{newacronym} as required. The optional 
% argument can be used to override any of the settings.
%\begin{macro}{\newacronym}
%    \begin{macrocode}
\newcommand{\newacronym}[4][]{%
\newglossaryentry{#2}{type=\acronymtype,%
name={#3},description={#4},text={#3},%
descriptionplural={#4\acrpluralsuffix},%
first={#4 (#3)},plural={#3\acrpluralsuffix},%
firstplural={\@glo@descplural\space (\@glo@plural)},%
#1}}
%    \end{macrocode}
%\changes{1.13}{2008 May 10}{Removed restriction on only using
% 'newacronym in the preamble}
%\end{macro}
%
%\begin{macro}{\oldacronym}
%\cs{oldacronym}\oarg{label}\marg{abbrv}\marg{long}\marg{key-val list}\\[10pt]
% This emulates the way the old \isty{glossary} package defined
% acronyms. It is equivalent to \ics{newacronym}\oarg{key-val
% list}\marg{label}\marg{abbrv}\marg{long} and it additionally
% defines the command \cs{}\meta{label} which is equivalent to
% \cs{gls}\marg{label} (thus \meta{label} must only contain
% alphabetical characters). If \meta{label} is omitted, \meta{abbrv}
% is used. This only emulates the syntax of the old \isty{glossary} 
% package. The way the acronyms appear in the list of acronyms is 
% determined by the definition of \ics{newacronym} and the
% glossary style.
%
% Note that \cs{}\meta{label} can't have an optional
% argument if the \isty{xspace} package is loaded. If 
% \isty{xspace} hasn't been loaded then you can do
% \cs{}\meta{label}\oarg{insert} but you can't do 
% \cs{}\meta{label}\oarg{key-val list}. For example if you define the
% acronym svm, then you can do "\svm['s]" but you can't do
% "\svm[format=textbf]". If the \isty{xspace} package is loaded,
% "\svm['s]" will appear as "svm ['s]" which is unlikely to be
% the desired result. In this case, you will need to use 
% \cs{gls} explicitly, e.g.\ "\gls{svm}['s]". Note that it is
% up to the user to load \isty{xspace} if desired.
%\changes{1.18}{2009 January 14}{new}
%    \begin{macrocode}
\newcommand{\oldacronym}[4][\gls@label]{%
  \def\gls@label{#2}%
  \newacronym[#4]{#1}{#2}{#3}%
  \@ifundefined{xspace}{%
    \expandafter\edef\csname#1\endcsname{%
      \noexpand\@ifstar{\noexpand\Gls{#1}}{\noexpand\gls{#1}}}%
  }{%
    \expandafter\edef\csname#1\endcsname{%
      \noexpand\@ifstar{\noexpand\Gls{#1}\noexpand\xspace}{%
      \noexpand\gls{#1}\noexpand\xspace}}%
  }%
}
%    \end{macrocode}
%\end{macro}
%
% Set up some convenient short cuts. These need to be changed if
% \cs{newacronym} is changed (or if the \gloskey{description} key
% is changed).
%
%\begin{macro}{\acrpluralsuffix}
%\changes{1.13}{2008 May 10}{New}
% Plural suffix used by \cs{newacronym}. This just defaults to
% \cs{glspluralsuffix} but is changed to include \cs{textup} 
% if the smallcaps option is used, so that the suffix doesn't appear
% in small caps as it doesn't look right. For example, 
% \textsc{abcs} looks as though the ``s'' is part of the acronym, but
% \textsc{abc}s looks as though the ``s'' is a plural suffix. Since
% the entire text \texttt{abcs} is set in \cs{textsc}, \cs{textup}
% is need to cancel it out.
%    \begin{macrocode}
\newcommand*{\acrpluralsuffix}{\glspluralsuffix}
%    \end{macrocode}
%\end{macro}
%
% Make a note of the keys that are used to store the long and
% short forms:
%\begin{macro}{\glsshortkey}
%    \begin{macrocode}
\newcommand*{\glsshortkey}{text}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsshortpluralkey}
%    \begin{macrocode}
\newcommand*{\glsshortpluralkey}{plural}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslongkey}
%    \begin{macrocode}
\newcommand*{\glslongkey}{description}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslongpluralkey}
%    \begin{macrocode}
\newcommand*{\glslongpluralkey}{descriptionplural}
%    \end{macrocode}
%\end{macro}
%
% Using the default definitions, \ics{acrshort} is the same as
% \ics{glstext}, which means that it will print the abbreviation.
%\begin{macro}{\acrshort}
%    \begin{macrocode}
\newcommand*{\acrshort}[2][]{%
\new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}}
\def\@acrshort#1#2[#3]{\@glstext@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrshort}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\Acrshort}[2][]{%
\new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}}
\def\@Acrshort#1#2[#3]{\@Glstext@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRshort}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\ACRshort}[2][]{%
\new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}}
\def\@ACRshort#1#2[#3]{\@GLStext@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
% Plural:
%\begin{macro}{\acrshortpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\acrshortpl}[2][]{%
\new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}}
\def\@acrshortpl#1#2[#3]{\@glsplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrshortpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\Acrshortpl}[2][]{%
\new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}}
\def\@Acrshortpl#1#2[#3]{\@Glsplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRshortpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\ACRshortpl}[2][]{%
\new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}}
\def\@ACRshortpl#1#2[#3]{\@GLSplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%
% \ics{acrlong} is set to \ics{glsdesc}, so it will print the long 
% form, unless the description key has been set to something else.
%\begin{macro}{\acrlong}
%    \begin{macrocode}
\newcommand*{\acrlong}[2][]{%
\new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}}
\def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrlong}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\Acrlong}[2][]{%
\new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}}
\def\@Acrlong#1#2[#3]{\@Glsdesc@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRlong}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\ACRlong}[2][]{%
\new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}}
\def\@ACRlong#1#2[#3]{\@GLSdesc@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
% Plural:
%\begin{macro}{\acrlongpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\acrlongpl}[2][]{%
\new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}}
\def\@acrlongpl#1#2[#3]{\@glsdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrlongpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\Acrlongpl}[2][]{%
\new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}}
\def\@Acrlongpl#1#2[#3]{\@Glsdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRlongpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\ACRlongpl}[2][]{%
\new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}}
\def\@ACRlongpl#1#2[#3]{\@GLSdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%
%
% \ics{acrfull} is set to \ics{glsfirst}, so it should display the
% full form.
%\begin{macro}{\acrfull}
%    \begin{macrocode}
\newcommand*{\acrfull}[2][]{%
\new@ifnextchar[{\@acrfull{#1}{#2}}{\@acrfull{#1}{#2}[]}}
\def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrfull}
%    \begin{macrocode}
\newcommand*{\Acrfull}[2][]{%
\new@ifnextchar[{\@Acrfull{#1}{#2}}{\@Acrfull{#1}{#2}[]}}
\def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRfull}
%    \begin{macrocode}
\newcommand*{\ACRfull}[2][]{%
\new@ifnextchar[{\@ACRfull{#1}{#2}}{\@ACRfull{#1}{#2}[]}}
\def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
% Plural:
%\begin{macro}{\acrfullpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\acrfullpl}[2][]{%
\new@ifnextchar[{\@acrfullpl{#1}{#2}}{\@acrfullpl{#1}{#2}[]}}
\def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrfullpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\Acrfullpl}[2][]{%
\new@ifnextchar[{\@Acrfullpl{#1}{#2}}{\@Acrfullpl{#1}{#2}[]}}
\def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRfullpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\ACRfullpl}[2][]{%
\new@ifnextchar[{\@ACRfullpl{#1}{#2}}{\@ACRfullpl{#1}{#2}[]}}
\def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Additional predefined acronym styles}
%\begin{macro}{\acronymfont}
%This is only used with the additional acronym styles:
%    \begin{macrocode}
\newcommand{\acronymfont}[1]{#1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\firstacronymfont}
%This is only used with the additional acronym styles:
%\changes{1.14}{2008 June 17}{new}
%    \begin{macrocode}
\newcommand{\firstacronymfont}[1]{\acronymfont{#1}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\acrnameformat}
% The styles that allow an additional description use 
% \cs{acrnameformat}\marg{short}\marg{long} to determine what
% information is displayed in the name.
%    \begin{macrocode}
\newcommand*{\acrnameformat}[2]{\acronymfont{#1}}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\ifglsacrdescription
%    \end{macrocode}
%
% If a description and footnote are both required, store the long form 
% in the \gloskey{symbol} key. Store the short form in \gloskey{text}
% key. Note that since the long form is stored in the symbol key,
% if you want the long form to appear in the list of acronyms, you
% need to use a glossary style that displays the symbol key.
%    \begin{macrocode}
  \ifglsacrfootnote
    \renewcommand{\newacronym}[4][]{%
    \newglossaryentry{#2}{type=\acronymtype,%
    name={\acronymfont{#3}},%
    sort={#3},%
    text={#3},%
    plural={#3\acrpluralsuffix},%
    symbol={#4},%
    symbolplural={#4\acrpluralsuffix},%
    #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
   \def\glsshortkey{text}%
   \def\glsshortpluralkey{plural}%
   \def\glslongkey{symbol}%
   \def\glslongpluralkey{symbolplural}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
   \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
   \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
   \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural form:
%    \begin{macrocode}
   \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
   \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
   \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
   \def\@acrlong#1#2[#3]{\@glssymbol@{#1}{#2}[#3]}
   \def\@Acrlong#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]}
   \def\@ACRlong#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
   \def\@acrlongpl#1#2[#3]{\@glssymbolplural@{#1}{#2}[#3]}
   \def\@Acrlongpl#1#2[#3]{\@Glssymbolplural@{#1}{#2}[#3]}
   \def\@ACRlongpl#1#2[#3]{\@GLSsymbolplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
   \def\@acrfull#1#2[#3]{\@glssymbol@{#1}{#2}[#3] 
     (\acronymfont{\@glstext@{#1}{#2}[#3]})}
   \def\@Acrfull#1#2[#3]{\@Glssymbol@{#1}{#2}[#3] 
     (\acronymfont{\@glstext@{#1}{#2}[#3]})}
   \def\@ACRfull#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3] 
     (\acronymfont{\@GLStext@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
   \def\@acrfullpl#1#2[#3]{\@glssymbolplural@{#1}{#2}[#3] 
     (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
   \def\@Acrfullpl#1#2[#3]{\@Glssymbolplural@{#1}{#2}[#3] 
     (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
   \def\@ACRfullpl#1#2[#3]{\@GLSsymbolplural@{#1}{#2}[#3] 
     (\acronymfont{\@GLSplural@{#1}{#2}[#3]})}
%    \end{macrocode}
%
% If \pkgopt{footnote} package option is specified, set the first
% use to append the long form (stored in \gloskey{symbol}) as a 
% footnote.
%\changes{1.12}{2008 Mar 8}{Added 'protect before 'footnote
% and 'glslink}
%    \begin{macrocode}
   \defglsdisplayfirst[\acronymtype]{%
     \firstacronymfont{#1}#4\noexpand\protect\noexpand\footnote{%
     \noexpand\protect\noexpand\glslink
       [\@gls@link@opts]{\@gls@link@label}{#3}}}%
   \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}%
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead
%of 'smaller}
%    \begin{macrocode}
   \ifglsacrsmallcaps
      \renewcommand*{\acronymfont}[1]{\textsc{#1}}%
      \renewcommand*{\acrpluralsuffix}{%
         \textup{\glspluralsuffix}}%
   \else
      \ifglsacrsmaller
         \renewcommand*{\acronymfont}[1]{\textsmaller{#1}}%
      \fi
   \fi
%    \end{macrocode}
% Check for package option clash
%    \begin{macrocode}
    \ifglsacrdua
       \PackageError{glossaries}{Option clash: `footnote' and `dua'
        can't both be set}{}%
    \fi
  \else
%    \end{macrocode}
% Footnote not required. Should the acronym always be expanded?
% Note that the short form is stored in the \gloskey{symbol} key,
% so if the short form needs to be displayed in the glossary, 
% use a style the displays the symbol.
%    \begin{macrocode}
    \ifglsacrdua
      \ifglsacrsmallcaps
        \PackageError{glossaries}{Option clash: `smallcaps' and `dua'
         can't both be set}{}%
      \else
         \ifglsacrsmaller
            \PackageError{glossaries}{Option clash: `smaller' and `dua'
            can't both be set}{}%
         \fi
      \fi
      \renewcommand{\newacronym}[4][]{%
      \newglossaryentry{#2}{type=\acronymtype,%
      name={#4},%
      sort={#4},
      text={#4},%
      plural={#4\acrpluralsuffix},%
      symbol={#3},%
      symbolplural={#3\acrpluralsuffix},%
      #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
      \def\glsshortkey{symbol}%
      \def\glsshortpluralkey{symbolplural}%
      \def\glslongkey{first}%
      \def\glslongpluralkey{plural}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
      \def\@acrshort#1#2[#3]{\acronymfont{\@glssymbol@{#1}{#2}[#3]}}
      \def\@Acrshort#1#2[#3]{\acronymfont{\@Glssymbol@{#1}{#2}[#3]}}
      \def\@ACRshort#1#2[#3]{\acronymfont{\@GLSsymbol@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
      \def\@acrshortpl#1#2[#3]{%
        \acronymfont{\@glssymbolplural@{#1}{#2}[#3]}}
      \def\@Acrshortpl#1#2[#3]{%
        \acronymfont{\@Glssymbolplural@{#1}{#2}[#3]}}
      \def\@ACRshortpl#1#2[#3]{%
        \acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
      \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
      \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
      \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
      \def\@acrlongpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
      \def\@Acrlongpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
      \def\@ACRlongpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
      \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
      \def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]})}
%    \end{macrocode}
% Set display.
%    \begin{macrocode}
      \defglsdisplayfirst[\acronymtype]{#1#4}
      \defglsdisplay[\acronymtype]{#1#4}
    \else
%    \end{macrocode}
% Option \pkgopt{description} is used, but not \pkgopt{dua}
% or \pkgopt{footnote}.
% Store long form in \gloskey{first} key
% and short form in \gloskey{text} and \gloskey{symbol} key.
% The name is stored using \ics{acrnameformat} to allow the
% user to override the way the name is displayed in the
% list of acronyms.
%    \begin{macrocode}
      \renewcommand{\newacronym}[4][]{%
      \newglossaryentry{#2}{type=\acronymtype,%
      name={\acrnameformat{#3}{#4}},%
      sort={#3},%
      first={#4},%
      firstplural={#4\acrpluralsuffix},%
      text={#3},%
      plural={#3\acrpluralsuffix},%
      symbol={\@glo@text},%
      symbolplural={\@glo@plural},%
      #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
      \def\glsshortkey{text}%
      \def\glsshortpluralkey{plural}%
      \def\glslongkey{first}%
      \def\glslongpluralkey{firstplural}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
      \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
      \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
      \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
      \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
      \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
      \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
      \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
      \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
      \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
      \def\@acrlongpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
      \def\@Acrlongpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
      \def\@ACRlongpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
      \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
      \def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]})}
%    \end{macrocode}
% Set display.
%    \begin{macrocode}
      \defglsdisplayfirst[\acronymtype]{#1#4 (\firstacronymfont{#3})}
      \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead
%of 'smaller}
%    \begin{macrocode}
      \ifglsacrsmallcaps
         \renewcommand{\acronymfont}[1]{\textsc{#1}}
         \renewcommand*{\acrpluralsuffix}{%
            \textup{\glspluralsuffix}}%
      \else
         \ifglsacrsmaller
            \renewcommand*{\acronymfont}[1]{\textsmaller{#1}}%
         \fi
      \fi
    \fi
  \fi
\else
%    \end{macrocode}
% If here, acronyms do not require additional description.
%    \begin{macrocode}
  \ifglsacrfootnote
%    \end{macrocode}
%
% If \pkgopt{footnote} package option is specified, set the first
% use to append the long form (stored in \gloskey{description}) as a 
% footnote.
% Use the \gloskey{description} key to store the long form.
%    \begin{macrocode}
    \renewcommand{\newacronym}[4][]{%
    \newglossaryentry{#2}{type=\acronymtype,%
    name={\acronymfont{#3}},%
    sort={#3},%
    text={#3},%
    plural={#3\acrpluralsuffix},%
    description={#4},%
    descriptionplural={#4\acrpluralsuffix},%
    #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
\def\glsshortkey{text}%
\def\glsshortpluralkey{plural}%
\def\glslongkey{description}%
\def\glslongpluralkey{descriptionplural}%
%    \end{macrocode}
% Set display
%\changes{1.12}{2008 Mar 8}{Added 'protect before 'footnote and
% 'glslink}
%    \begin{macrocode}
    \defglsdisplayfirst[\acronymtype]{%
    \firstacronymfont{#1}#4\noexpand\protect\noexpand\footnote{%
       \noexpand\protect\noexpand\glslink
         [\@gls@link@opts]{\@gls@link@label}{#2}}}%
    \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
    \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
    \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
    \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
    \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
    \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
    \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
    \def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]}
    \def\@Acrlong#1#2[#3]{\@Glsdesc@{#1}{#2}[#3]}
    \def\@ACRlong#1#2[#3]{\@GLSdesc@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
    \def\@acrlongpl#1#2[#3]{\@glsdescplural@{#1}{#2}[#3]}
    \def\@Acrlongpl#1#2[#3]{\@Glsdescplural@{#1}{#2}[#3]}
    \def\@ACRlongpl#1#2[#3]{\@GLSdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
    \def\@acrfull#1#2[#3]{\@glsdesc@{#1}{#2}[#3] 
      (\@glstext@{#1}{#2}[#3])}
    \def\@Acrfull#1#2[#3]{\@Glsdesc@{#1}{#2}[#3] 
      (\@glstext@{#1}{#2}[#3])}
    \def\@ACRfull#1#2[#3]{\@GLSdesc@{#1}{#2}[#3] 
      (\@GLStext@{#1}{#2}[#3])}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
    \def\@acrfullpl#1#2[#3]{\@glsdescplural@{#1}{#2}[#3] 
      (\@glsplural@{#1}{#2}[#3])}
    \def\@Acrfullpl#1#2[#3]{\@Glsdesctext@{#1}{#2}[#3] 
      (\@glsplural@{#1}{#2}[#3])}
    \def\@ACRfullpl#1#2[#3]{\@GLSdesctext@{#1}{#2}[#3] 
      (\@GLSplural@{#1}{#2}[#3])}
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead
%of 'smaller}
%    \begin{macrocode}
    \ifglsacrsmallcaps
       \renewcommand*{\acronymfont}[1]{\textsc{#1}}%
       \renewcommand*{\acrpluralsuffix}{%
          \textup{\glspluralsuffix}}%
    \else
       \ifglsacrsmaller
          \renewcommand*{\acronymfont}[1]{\textsmaller{#1}}%
       \fi
    \fi
%    \end{macrocode}
% Check for option clash
%    \begin{macrocode}
    \ifglsacrdua
       \PackageError{glossaries}{Option clash: `footnote' and `dua'
       can't both be set}{}%
    \fi
  \else
%    \end{macrocode}
% No footnotes required.
%    \begin{macrocode}
    \ifthenelse{\boolean{glsacrsmallcaps}\or\boolean{glsacrsmaller}}{%
%    \end{macrocode}
%
% Neither footnote nor description required.
% Use the \gloskey{symbol} key to store the short form and
% \gloskey{first} to store the long form.
%    \begin{macrocode}
      \renewcommand{\newacronym}[4][]{%
      \newglossaryentry{#2}{type=\acronymtype,%
      name={\acronymfont{#3}},%
      sort={#3},%
      text={\@glo@symbol},%
      plural={\@glo@symbolplural},%
      first={#4},%
      firstplural={#4\acrpluralsuffix},%
      description={\@glo@first},%
      descriptionplural={\@glo@firstplural},%
      symbol={#3},%
      symbolplural={#3\acrpluralsuffix},%
      #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
      \def\glsshortkey{symbol}%
      \def\glsshortpluralkey{symbolplural}%
      \def\glslongkey{first}%
      \def\glslongpluralkey{firstplural}%
%    \end{macrocode}
% Change the display since \gloskey{first} only contains long form.
%    \begin{macrocode}
      \defglsdisplayfirst[\acronymtype]{#1#4 (\firstacronymfont{#3})}
      \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead
%of 'smaller}
%    \begin{macrocode}
      \ifglsacrsmallcaps
        \renewcommand*{\acronymfont}[1]{\textsc{#1}}
        \renewcommand*{\acrpluralsuffix}{%
           \textup{\glspluralsuffix}}%
      \else
        \renewcommand*{\acronymfont}[1]{\textsmaller{#1}}
      \fi
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
      \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
      \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
      \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
      \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
      \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
      \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
      \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
      \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
      \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
      \def\@acrlongpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
      \def\@Acrlongpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
      \def\@ACRlongpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
      \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glstext@{#1}{#2}[#3]})}
      \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glstext@{#1}{#2}[#3]})}
      \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] 
        (\acronymfont{\@GLStext@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
      \def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
      \def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
      \def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@GLSplural@{#1}{#2}[#3]})}
%    \end{macrocode}
% check for option clash
%    \begin{macrocode}
      \ifglsacrdua
        \ifglsacrsmallcaps
          \PackageError{glossaries}{Option clash: `smallcaps' and `dua'
          can't both be set}{}%
        \else
          \PackageError{glossaries}{Option clash: `smaller' and `dua'
          can't both be set}{}%
        \fi
      \fi
    }{%
%    \end{macrocode}
% Should acronyms always be expanded?
%    \begin{macrocode}
      \ifglsacrdua
        \renewcommand{\newacronym}[4][]{%
        \newglossaryentry{#2}{type=\acronymtype,%
        name={#3},%
        text={#4},%
        plural={#4\acrpluralsuffix},%
        description={#4},%
        symbol={#3},%
        symbolplural={#3\acrpluralsuffix},%
        #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
        \def\glsshortkey{symbol}%
        \def\glsshortpluralkey{symbolplural}%
        \def\glslongkey{text}%
        \def\glslongpluralkey{plural}%
%    \end{macrocode}
% Set the display
%    \begin{macrocode}
        \defglsdisplayfirst[\acronymtype]{#1#4}
        \defglsdisplay[\acronymtype]{#1#4}
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
        \def\@acrshort#1#2[#3]{\@glssymbol@{#1}{#2}[#3]}
        \def\@Acrshort#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]}
        \def\@ACRshort#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
        \def\@acrshortpl#1#2[#3]{\@glssymbolplural@{#1}{#2}[#3]}
        \def\@Acrshortpl#1#2[#3]{\@Glssymbolplural@{#1}{#2}[#3]}
        \def\@ACRshortpl#1#2[#3]{\@GLSsymbolplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
        \def\@acrlong#1#2[#3]{\@glstext@{#1}{#2}[#3]}
        \def\@Acrlong#1#2[#3]{\@Glstext@{#1}{#2}[#3]}
        \def\@ACRlong#1#2[#3]{\@GLStext@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
        \def\@acrlongpl#1#2[#3]{\@glsplural@{#1}{#2}[#3]}
        \def\@Acrlongpl#1#2[#3]{\@Glsplural@{#1}{#2}[#3]}
        \def\@ACRlongpl#1#2[#3]{\@GLSplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
        \def\@acrfull#1#2[#3]{\@glstext@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
        \def\@Acrfull#1#2[#3]{\@Glstext@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
        \def\@ACRfull#1#2[#3]{\@GLStext@{#1}{#2}[#3] 
          (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
        \def\@acrfullpl#1#2[#3]{\@glsplural@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
        \def\@Acrfullpl#1#2[#3]{\@Glsplural@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
        \def\@ACRfullpl#1#2[#3]{\@GLSplural@{#1}{#2}[#3] 
          (\acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]})}
      \fi
    }%
  \fi
\fi
%    \end{macrocode}
%
% Define synonyms if required
%    \begin{macrocode}
\ifglsacrshortcuts
%    \end{macrocode}
% Short form
%\begin{macro}{\acs}
%    \begin{macrocode}
  \let\acs\acrshort
%    \end{macrocode}
%\end{macro}
% First letter uppercase short form
%\begin{macro}{\Acs}
%    \begin{macrocode}
  \let\Acs\Acrshort
%    \end{macrocode}
%\end{macro}
% Plural short form
%\begin{macro}{\acsp}
%    \begin{macrocode}
  \let\acsp\acrshortpl
%    \end{macrocode}
%\end{macro}
% First letter uppercase plural short form
%\begin{macro}{\Acsp}
%    \begin{macrocode}
  \let\Acsp\Acrshortpl
%    \end{macrocode}
%\end{macro}
% Long form
%\begin{macro}{\acl}
%    \begin{macrocode}
  \let\acl\acrlong
%    \end{macrocode}
%\end{macro}
% Plural long form
%\begin{macro}{\aclp}
%    \begin{macrocode}
  \let\aclp\acrlongpl
%    \end{macrocode}
%\end{macro}
% First letter upper case long form
%\begin{macro}{\Acl}
%    \begin{macrocode}
  \let\Acl\Acrlong
%    \end{macrocode}
%\end{macro}
% First letter upper case plural long form
%\begin{macro}{\Aclp}
%    \begin{macrocode}
  \let\Aclp\Acrlongpl
%    \end{macrocode}
%\end{macro}
% Full form
%\begin{macro}{\acf}
%    \begin{macrocode}
  \let\acf\acrfull
%    \end{macrocode}
%\end{macro}
% Plural full form
%\begin{macro}{\acfp}
%    \begin{macrocode}
  \let\acfp\acrfullpl
%    \end{macrocode}
%\end{macro}
% First letter upper case full form
%\begin{macro}{\Acf}
%    \begin{macrocode}
  \let\Acf\Acrfull
%    \end{macrocode}
%\end{macro}
% First letter upper case plural full form
%\begin{macro}{\Acfp}
%    \begin{macrocode}
  \let\Acfp\Acrfullpl
%    \end{macrocode}
%\end{macro}
% Standard form
%\begin{macro}{\ac}
%    \begin{macrocode}
  \let\ac\gls
%    \end{macrocode}
%\end{macro}
% First upper case standard form
%\begin{macro}{\Ac}
%    \begin{macrocode}
  \let\Ac\Gls
%    \end{macrocode}
%\end{macro}
% Standard plural form
%\begin{macro}{\acp}
%    \begin{macrocode}
  \let\acp\glspl
%    \end{macrocode}
%\end{macro}
% Standard first letter upper case plural form
%\begin{macro}{\Acp}
%    \begin{macrocode}
  \let\Acp\Glspl
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \subsection{Predefined Glossary Styles}\label{sec:code:styles}
% The \sty{glossaries} bundle comes with some predefined glossary
% styles. These need to be loaded now for the \pkgopt{style} option
% to use them.
%
% First, the glossary hyper-navigation commands need to be loaded.
%    \begin{macrocode}
\RequirePackage{glossary-hypernav}
%    \end{macrocode}
% The styles that use list-like environments. These are not loaded
% if the \pkgopt{nolist} option is used:
%    \begin{macrocode}
\@gls@loadlist
%    \end{macrocode}
% The styles that use the \envname{longtable} environment. These are
% not loaded if the \pkgopt{nolong} package option is used.
%    \begin{macrocode}
\@gls@loadlong
%    \end{macrocode}
% The styles that use the \envname{supertabular} environment. These are
% not loaded if the \pkgopt{nosuper} package option is used or if
% the \isty{supertabular} package isn't installed.
%    \begin{macrocode}
\@gls@loadsuper
%    \end{macrocode}
% The tree-like styles. These are not loaded if the \pkgopt{notree}
% package option is used.
%    \begin{macrocode}
\@gls@loadtree
%    \end{macrocode}
% The default glossary style is set according to the \pkgopt{style} package
% option, but can be overridden by \ics{glossarystyle}. The
% style must be defined at this point.
%    \begin{macrocode}
\ifx\@glossary@default@style\relax
\else
  \glossarystyle{\@glossary@default@style}
\fi
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*mfirstuc.sty>
%    \end{macrocode}
%\fi
%\section{Mfirstuc Documented Code}
%\label{sec:code:mfirstuc}
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mfirstuc}[2008/12/22 v1.03 (NLCT)]
%    \end{macrocode}
%\begin{macro}{\makefirstuc}
% Syntax:\\
% \cs{makefirstuc}\marg{text}\\
% Makes the first letter uppercase, but will
% skip initial control sequences if they are followed by a group
% and make the first thing in the group uppercase, unless the group
% is empty.
% Thus \verb|\makefirstuc{abc}| will produce: Abc, 
% \verb|\makefirstuc{\ae bc}| will produce: \AE bc, but
% \verb|\makefirstuc{\emph{abc}}| will produce \emph{Abc}.
% This is required by \ics{Gls} and \ics{Glspl}.
%    \begin{macrocode}
\newif\if@glscs
\def\makefirstuc#1{%
\def\gls@argi{#1}%
\ifx\gls@argi\@empty
\else
%    \end{macrocode}
%\changes{1.03}{2008/12/22}{changed 'protected@edef to 'def}
%    \begin{macrocode}
  \def\@gls@tmp{\ #1}%
  \@onelevel@sanitize\@gls@tmp
  \expandafter\@gls@checkcs\@gls@tmp\relax\relax
  \if@glscs
    \@gls@getbody #1{}\@nil
    \ifx\@gls@rest\@empty
      \@gls@makefirstuc{#1}%
    \else
      \expandafter\@gls@split\@gls@rest\@nil
      \ifx\@gls@first\@empty
         \@gls@makefirstuc{#1}%
      \else
         \@gls@body{\expandafter\@gls@makefirstuc\@gls@first}\@gls@rest%
      \fi
    \fi
  \else
    \@gls@makefirstuc{#1}%
  \fi
\fi
}
%    \end{macrocode}
%\end{macro}
% Put first argument in \cs{@gls@first} and second argument in
% \cs{@gls@rest}:
%    \begin{macrocode}
\def\@gls@split#1#2\@nil{\def\@gls@first{#1}\def\@gls@rest{#2}}
%    \end{macrocode}
%    \begin{macrocode}
\def\@gls@checkcs#1 #2#3\relax{%
\def\@gls@argi{#1}\def\@gls@argii{#2}%
\ifx\@gls@argi\@gls@argii
  \@glscstrue
\else
  \@glscsfalse
\fi
}
%    \end{macrocode}
% Make first thing upper case:
%    \begin{macrocode}
\def\@gls@makefirstuc#1{\MakeUppercase #1}
%    \end{macrocode}
%
% Get the first grouped argument and stores in \cs{@gls@body}.
%    \begin{macrocode}
\def\@gls@getbody#1#{\def\@gls@body{#1}\@gls@gobbletonil}
%    \end{macrocode}
% Scoup up everything to \cs{@nil} and store in \cs{@gls@rest}:
%    \begin{macrocode}
\def\@gls@gobbletonil#1\@nil{\def\@gls@rest{#1}}
%    \end{macrocode}
%
%\begin{macro}{\xmakefirstuc}
% Expand argument once before applying \cs{makefirstuc}
% (added v1.01).
%    \begin{macrocode}
\newcommand*{\xmakefirstuc}[1]{%
\expandafter\makefirstuc\expandafter{#1}}
%    \end{macrocode}
%\end{macro}
%\section{Glossary Styles}
%\iffalse
%    \begin{macrocode}
%</mfirstuc.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-hypernav.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary hyper-navigation definitions (glossary-hypernav package)}
%\label{sec:code:hypernav}
% Package Definition:
%    \begin{macrocode}
\ProvidesPackage{glossary-hypernav}[2007/07/04 v1.01 (NLCT)]
%    \end{macrocode}
%
% The commands defined in this package are provided to 
% help navigate around the groups within a glossary 
% (see \autoref{sec:code:printglos}.)
% \ics{printglossary} (and \ics{printglossaries})
% set \cs{@glo@type} to the label of the current
% glossary. This is used to create a unique hypertarget in
% the event of multiple glossaries.
%\\[10pt]
% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text}\\[10pt]
% This command makes \meta{text} a hyperlink to the glossary group
% whose label is given by \meta{label} for the glossary given
% by \meta{type}.
%\begin{macro}{\glsnavhyperlink}
%\changes{1.14}{2008 June 17}{changed 'edef to 'protected@edef}
%\changes{1.17}{2008 December 26}{replaced 'hyperlink to '@glslink}
%    \begin{macrocode}
\newcommand*{\glsnavhyperlink}[3][\@glo@type]{%
  \edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}%
  \@glslink{glsn:#1@#2}{#3}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text}\\[10pt]
% This command makes \meta{text} a hypertarget for the glossary group
% whose label is given by \meta{label} in the glossary given
% by \meta{type}. If \meta{type} is omitted, \cs{@glo@type} is
% used which is set by \ics{printglossary} to the current
% glossary label.
%\begin{macro}{\glsnavhypertarget}
%\changes{1.14}{2008 June 17}{added write to aux file}
%\changes{1.15}{2008 August 15}{added check if rerun required}
%\changes{1.17}{2008 December 26}{replaced 'hypertarget to '@glstarget}
%    \begin{macrocode}
\newcommand*{\glsnavhypertarget}[3][\@glo@type]{%
%    \end{macrocode}
% Add this group to the aux file for re-run check.
%    \begin{macrocode}
  \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}%
%    \end{macrocode}
% Add the target.
%    \begin{macrocode}
  \@glstarget{glsn:#1@#2}{#3}%
%    \end{macrocode}
% Check list of know groups to determine if a re-run is required.
%    \begin{macrocode}
  \expandafter\let
     \expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname
%    \end{macrocode}
% Iterate through list and terminate loop if this group is found.
%    \begin{macrocode}
  \@for\@gls@elem:=\@gls@list\do{%
    \ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}%
%    \end{macrocode}
% Check if list terminated prematurely.
%    \begin{macrocode}
  \if@endfor
  \else
%    \end{macrocode}
% This group was not included in the list, so issue a warning.
%    \begin{macrocode}
    \PackageWarningNoLine{glossaries}{Navigation panel 
       for glossary type `#1'^^Jmissing group `#2'}%
    \gdef\gls@hypergrouprerun{%
      \PackageWarningNoLine{glossaries}{Navigation panel 
      has changed. Rerun LaTeX}}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\gls@hypergrouprerun}
% Give a warning at the end if re-run required
%\changes{1.15}{2008 August 15}{new}
%    \begin{macrocode}
\let\gls@hypergrouprerun\relax
\AtEndDocument{\gls@hypergrouprerun}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@hypergroup}
% This adds to (or creates) the command \cs{@gls@hypergrouplist@}\meta{glossary type} 
% which lists all groups for a given glossary, so that
% the navigation bar only contains those groups that are present.
% However it requires at least 2 runs to ensure the information is
% up-to-date.
%\changes{1.14}{2008 June 17}{new}
%    \begin{macrocode}
\newcommand*{\@gls@hypergroup}[2]{%
\@ifundefined{@gls@hypergrouplist@#1}{%
   \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}%
}{%
   \expandafter\let\expandafter\@gls@tmp
      \csname @gls@hypergrouplist@#1\endcsname
   \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{%
      \@gls@tmp,#2}%
}%
}
%    \end{macrocode}
%\end{macro}
%
% The \cs{glsnavigation} command displays a simple glossary 
% group navigation. 
% The symbol and number elements are defined separately, 
% so that they can be suppressed if need be. Note that this 
% command will produce a link to all 28 groups, but some groups
% may not be defined if there are groups that do not contain any
% terms, in which case you will get an undefined hyperlink warning.
% Now for the whole navigation bit:
%\begin{macro}{\glsnavigation}
% \changes{1.14}{2008 June 2008}{changed to only use labels for
% groups that are present}
%    \begin{macrocode}
\newcommand*{\glsnavigation}{%
\def\@gls@between{}%
\@ifundefined{@gls@hypergrouplist@\@glo@type}{%
   \def\@gls@list{}%
}{%
   \expandafter\let\expandafter\@gls@list
      \csname @gls@hypergrouplist@\@glo@type\endcsname
}%
\@for\@gls@tmp:=\@gls@list\do{%
   \@gls@between
   \glsnavhyperlink{\@gls@tmp}{\glsgetgrouptitle{\@gls@tmp}}%
   \let\@gls@between\glshypernavsep%
}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glshypernavsep}
% Separator for the hyper navigation bar.
%    \begin{macrocode}
\newcommand*{\glshypernavsep}{\space\textbar\space}
%    \end{macrocode}
%\end{macro}
% The \cs{glssymbolnav} produces a simple navigation set of
% links for just the symbol and number groups. This used to be used at
% the start of \cs{glsnavigation}. This command is no longer needed.
%\begin{macro}{\glssymbolnav}
%    \begin{macrocode}
\newcommand*{\glssymbolnav}{%
\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}}%
\glshypernavsep
\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}}%
\glshypernavsep
}
%    \end{macrocode}
%\end{macro}
%\iffalse
%    \begin{macrocode}
%</glossary-hypernav.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-list.sty>
%    \end{macrocode}
%\fi
% \subsection{List Style (glossary-list.sty)}
% The \isty{glossary-list} style file defines glossary styles
% that use the \envname{description} environment. Note that since
% the entry name is placed in the optional argument to the
% \ics{item} command, it will appear in a bold font by
% default.
%    \begin{macrocode}
\ProvidesPackage{glossary-list}[2009/01/14 v1.05 (NLCT)]
%    \end{macrocode}
%\begin{macro}{list}
% The \glostyle{list} glossary style 
% uses the \envname{description} environment. The group separator
% \ics{glsgroupskip} is redefined as \cs{indexspace}
% which produces a gap between groups. The glossary heading
% and the group headings do nothing. Sub-entries immediately
% follow the main entry without the sub-entry name. This style
% does not use the entry's symbol. This is used as the default
% style for the \sty{glossaries} package.
%    \begin{macrocode}
\newglossarystyle{list}{%
%    \end{macrocode}
% Use \envname{description} environment:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{description}}{\end{description}}%
%    \end{macrocode}
% No header at the start of the environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headings:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries start a new item in the list:
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \item[\glstarget{##1}{##2}] ##3\glspostdescription\space ##5}%
%    \end{macrocode}
% Sub-entries continue on the same line:
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
    \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}%
%   \end{macrocode}
% Add vertical space between groups:
%   \begin{macrocode}
  \renewcommand*{\glsgroupskip}{\indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{listgroup}
% The \glostyle{listgroup} style is like the \glostyle{list}
% style, but the glossary groups have headings.
%\changes{1.08}{2007 Oct 13}{changed listgroup style to use \cs{glsgetgrouptitle}}
%    \begin{macrocode}
\newglossarystyle{listgroup}{%
%    \end{macrocode}
% Base it on the \glostyle{list} style:
%    \begin{macrocode}
  \glossarystyle{list}%
%    \end{macrocode}
% Each group has a heading:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{listhypergroup}
% The \glostyle{listhypergroup} style is like the \glostyle{listgroup}
% style, but has a set of links to the groups at the
% start of the glossary.
%    \begin{macrocode}
\newglossarystyle{listhypergroup}{%
%    \end{macrocode}
% Base it on the \glostyle{list} style:
%    \begin{macrocode}
  \glossarystyle{list}%
%    \end{macrocode}
% Add navigation links at the start of the environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \item[\glsnavigation]}%
%    \end{macrocode}
% Each group has a heading with a hypertarget:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{%
    \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altlist}
% The \glostyle{altlist} glossary style is like the \glostyle{list}
% style, but places the description on a new line. Sub-entries
% follow in separate paragraphs without the sub-entry name. This
% style does not use the entry's symbol.
%    \begin{macrocode}
\newglossarystyle{altlist}{%
%    \end{macrocode}
% Base it on the \glostyle{list} style:
%    \begin{macrocode}
  \glossarystyle{list}%
%    \end{macrocode}
% Main (level 0) entries start a new item in the list with a
% line break after the entry name:
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \item[\glstarget{##1}{##2}]\mbox{}\newline 
      ##3\glspostdescription\space ##5}%
%    \end{macrocode}
% Sub-entries start a new paragraph:
%    \begin{macrocode}
  \renewcommand{\glossarysubentryfield}[6]{%
    \par\glstarget{##2}{\strut}##4\glspostdescription\space ##6}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{altlistgroup}
% The \glostyle{altlistgroup} glossary style is like the
% \glostyle{altlist} style, but the glossary groups have headings.
%\changes{1.08}{2007 Oct 13}{changed altlistgroup style to use \cs{glsgetgrouptitle}}
%    \begin{macrocode}
\newglossarystyle{altlistgroup}{%
%    \end{macrocode}
% Base it on the \glostyle{altlist} style:
%    \begin{macrocode}
  \glossarystyle{altlist}%
%    \end{macrocode}
% Each group has a heading:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altlisthypergroup}
% The \glostyle{altlisthypergroup} glossary style is like the
% \glostyle{altlistgroup} style, but has a 
% set of links to the groups at the start of the glossary.
%    \begin{macrocode}
\newglossarystyle{altlisthypergroup}{%
%    \end{macrocode}
% Base it on the \glostyle{altlist} style:
%    \begin{macrocode}
  \glossarystyle{altlist}%
%    \end{macrocode}
% Add navigation links at the start of the environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \item[\glsnavigation]}%
%    \end{macrocode}
% Each group has a heading with a hypertarget:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{%
    \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{listdotted}
% The \glostyle{listdotted} glossary style was supplied by 
% Axel~Menzel. I've modified it slightly so that the distance from
% the start of the name to the end of the dotted line is specified 
% by \cs{glslistdottedwidth}.
% Note that this style ignores the page numbers as well as the
% symbol. Sub-entries are displayed in the same way as top-level
% entries.
%    \begin{macrocode}
\newglossarystyle{listdotted}{%
%    \end{macrocode}
% Base it on the \glostyle{list} style:
%    \begin{macrocode}
  \glossarystyle{list}%
%    \end{macrocode}
% Each main (level 0) entry starts a new item:
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \item[]\makebox[\glslistdottedwidth][l]{\glstarget{##1}{##2}%
    \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}%
%    \end{macrocode}
% Sub entries have the same format as main entries:
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
    \item[]\makebox[\glslistdottedwidth][l]{\glstarget{##2}{##3}%
    \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslistdottedwidth}
%    \begin{macrocode}
\newlength\glslistdottedwidth
\setlength{\glslistdottedwidth}{.5\linewidth}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{sublistdotted}
% This style is similar to the glostyle{listdotted} style, except
% that the main entries just have the name displayed.
%    \begin{macrocode}
\newglossarystyle{sublistdotted}{%
%    \end{macrocode}
% Base it on the \glostyle{listdotted} style:
%    \begin{macrocode}
  \glossarystyle{listdotted}%
%    \end{macrocode}
% Main (level 0) entries just display the name:
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \item[\glstarget{##1}{##2}]}%
}
%    \end{macrocode}
%\end{macro}
%\iffalse
%    \begin{macrocode}
%</glossary-list.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-long.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary Styles using longtable (the glossary-long
% package)}
% The glossary styles defined in the \isty{glossary-long} package
% used the \envname{longtable} environment in the glossary.
%    \begin{macrocode}
\ProvidesPackage{glossary-long}[2009/01/14 v1.03 (NLCT)]
%    \end{macrocode}
% Requires the \isty{longtable} package:
%    \begin{macrocode}
\RequirePackage{longtable}
%    \end{macrocode}
%\begin{macro}{\glsdescwidth}
% This is a length that governs the width of the description column.
% (There's a chance that the user may specify \pkgopt{nolong}
% and then load \isty{glossary-long} later, in which case 
% \cs{glsdescwidth} may have already been defined by
% \isty{glossary-super}. The same goes for \cs{glspagelistwidth}.)
%    \begin{macrocode}
\@ifundefined{glsdescwidth}{%
  \newlength\glsdescwidth
  \setlength{\glsdescwidth}{0.6\linewidth}
}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glspagelistwidth}
% This is a length that governs the width of the page list column.
%    \begin{macrocode}
\@ifundefined{glspagelistwidth}{%
  \newlength\glspagelistwidth
  \setlength{\glspagelistwidth}{0.1\linewidth}
}{}
%    \end{macrocode}
%\end{macro}
% 
%\begin{macro}{long}
% The \glostyle{long} glossary style command which 
% uses the \envname{longtable} environment:
%    \begin{macrocode}
\newglossarystyle{long}{%
%    \end{macrocode}
% Use \envname{longtable} with two columns:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
     {\begin{longtable}{lp{\glsdescwidth}}}%
     {\end{longtable}}%
%    \end{macrocode}
% Do nothing at the start of the environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No heading between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries displayed in a row:
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}%
%    \end{macrocode}
% Sub entries displayed on the following row without the name:
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
     & \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & \\}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{longborder}
% The \glostyle{longborder} style is like the above, but with horizontal and
% vertical lines:
%    \begin{macrocode}
\newglossarystyle{longborder}{%
%    \end{macrocode}
% Base it on the glostyle{long} style:
%    \begin{macrocode}
  \glossarystyle{long}%
%    \end{macrocode}
% Use \envname{longtable} with two columns with vertical lines
% between each column:
%    \begin{macrocode}
  \renewenvironment{theglossary}{%
    \begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}%
%    \end{macrocode}
% Place horizontal lines at the head and foot of the table:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{longheader}
% The \glostyle{longheader} style is like the
% \glostyle{long} style but with a header:
%    \begin{macrocode}
\newglossarystyle{longheader}{%
%    \end{macrocode}
% Base it on the glostyle{long} style:
%    \begin{macrocode}
  \glossarystyle{long}%
%    \end{macrocode}
% Set the table's header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \bfseries \entryname & \bfseries \descriptionname\\\endhead}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{longheaderborder}
% The \glostyle{longheaderborder} style is
% like the \glostyle{long} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{longheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{longborder} style:
%    \begin{macrocode}
  \glossarystyle{longborder}%
%    \end{macrocode}
% Set the table's header and add horizontal line to table's foot:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \hline\bfseries \entryname & \bfseries \descriptionname\\\hline
    \endhead
    \hline\endfoot}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long3col}
% The \glostyle{long3col} style is like \glostyle{long} but with 3 columns
%    \begin{macrocode}
\newglossarystyle{long3col}{%
%    \end{macrocode}
% Use a \envname{longtable} with 3 columns:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}%
    {\end{longtable}}%
%    \end{macrocode}
% No table header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No headings between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries on a row (name in first column, 
% description in second column, page list in last column):
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \glstarget{##1}{##2} & ##3 & ##5\\}%
%    \end{macrocode}
% Sub-entries on a separate row (no name, description in
% second column, page list in third column):
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
     & \glstarget{##2}{\strut}##4 & ##6\\}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & &\\}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long3colborder}
% The \glostyle{long3colborder} style is like the
% \glostyle{long3col} style but with a border:
%    \begin{macrocode}
\newglossarystyle{long3colborder}{%
%    \end{macrocode}
% Base it on the glostyle{long3col} style:
%    \begin{macrocode}
  \glossarystyle{long3col}%
%    \end{macrocode}
% Use a \envname{longtable} with 3 columns with vertical lines
% around them:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}%
    {\end{longtable}}%
%    \end{macrocode}
% Place horizontal lines at the head and foot of the table:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long3colheader}
% The \glostyle{long3colheader} style is like \glostyle{long3col} but with a header row:
%    \begin{macrocode}
\newglossarystyle{long3colheader}{%
%    \end{macrocode}
% Base it on the glostyle{long3col} style:
%    \begin{macrocode}
  \glossarystyle{long3col}%
%    \end{macrocode}
% Set the table's header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \bfseries\entryname&\bfseries\descriptionname&
    \bfseries\pagelistname\\\endhead}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long3colheaderborder}
% The \glostyle{long3colheaderborder} style is like the above but with a border
%    \begin{macrocode}
\newglossarystyle{long3colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{long3colborder} style:
%    \begin{macrocode}
  \glossarystyle{long3colborder}%
%    \end{macrocode}
% Set the table's header and add horizontal line at table's foot:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \hline
    \bfseries\entryname&\bfseries\descriptionname&
    \bfseries\pagelistname\\\hline\endhead
    \hline\endfoot}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long4col}
% The \glostyle{long4col} style has four columns where the third 
% column contains the value of the associated \gloskey{symbol} key.
%    \begin{macrocode}
\newglossarystyle{long4col}{%
%    \end{macrocode}
% Use a \envname{longtable} with 4 columns:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{llll}}%
    {\end{longtable}}%
%    \end{macrocode}
% No table header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headings:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries on a single row (name in first column,
% description in second column, symbol in third column, page list
% in last column):
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \glstarget{##1}{##2} & ##3 & ##4 & ##5\\}%
%    \end{macrocode}
% Sub entries on a single row with no name (description in second
% column, symbol in third column, page list in last column):
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
     & \glstarget{##2}{\strut}##4 & ##5 & ##6\\}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & & &\\}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long4colheader}
% The \glostyle{long4colheader} style is like \glostyle{long4col} 
% but with a header row.
%    \begin{macrocode}
\newglossarystyle{long4colheader}{%
%    \end{macrocode}
% Base it on the glostyle{long4col} style:
%    \begin{macrocode}
  \glossarystyle{long4col}%
%    \end{macrocode}
% Table has a header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \bfseries\entryname&\bfseries\descriptionname&
    \bfseries \symbolname&
    \bfseries\pagelistname\\\endhead}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long4colborder}
% The \glostyle{long4colborder} style is like \glostyle{long4col} 
% but with a border.
%    \begin{macrocode}
\newglossarystyle{long4colborder}{%
%    \end{macrocode}
% Base it on the glostyle{long4col} style:
%    \begin{macrocode}
  \glossarystyle{long4col}%
%    \end{macrocode}
% Use a \envname{longtable} with 4 columns surrounded by vertical
% lines:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|l|l|l|}}%
    {\end{longtable}}%
%    \end{macrocode}
% Add horizontal lines to the head and foot of the table:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{long4colheaderborder}
% The \glostyle{long4colheaderborder} style is like the above but 
% with a border.
%    \begin{macrocode}
\newglossarystyle{long4colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{long4col} style:
%    \begin{macrocode}
  \glossarystyle{long4col}%
%    \end{macrocode}
% Use a \envname{longtable} with 4 columns surrounded by vertical
% lines:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|l|l|l|}}%
    {\end{longtable}}%
%    \end{macrocode}
% Add table header and horizontal line at the table's foot:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \hline\bfseries\entryname&\bfseries\descriptionname&
    \bfseries \symbolname&
    \bfseries\pagelistname\\\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altlong4col}
% The \glostyle{altlong4col} style is like the \glostyle{long4col}
% style but can have multiline descriptions and page lists.
%    \begin{macrocode}
\newglossarystyle{altlong4col}{%
%    \end{macrocode}
% Base it on the glostyle{long4col} style:
%    \begin{macrocode}
   \glossarystyle{long4col}%
%    \end{macrocode}
% Use a \envname{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
    {\end{longtable}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altlong4colheader}
% The \glostyle{altlong4colheader} style is like 
% \glostyle{altlong4col} but with a header row.
%    \begin{macrocode}
\newglossarystyle{altlong4colheader}{%
%    \end{macrocode}
% Base it on the glostyle{long4colheader} style:
%    \begin{macrocode}
  \glossarystyle{long4colheader}%
%    \end{macrocode}
% Use a \envname{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
    {\end{longtable}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altlong4colborder}
% The \glostyle{altlong4colborder} style is like
% \glostyle{altlong4col} but with a border.
%    \begin{macrocode}
\newglossarystyle{altlong4colborder}{%
%    \end{macrocode}
% Base it on the glostyle{long4colborder} style:
%    \begin{macrocode}
   \glossarystyle{long4colborder}%
%    \end{macrocode}
% Use a \envname{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
    {\end{longtable}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altlong4colheaderborder}
% The \glostyle{altlong4colheaderborder} style is like the above but
% with a header as well as a border.
%    \begin{macrocode}
\newglossarystyle{altlong4colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{long4colheaderborder} style:
%    \begin{macrocode}
  \glossarystyle{long4colheaderborder}%
%    \end{macrocode}
% Use a \envname{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
    {\end{longtable}}%
}
%    \end{macrocode}
%\end{macro}
%\iffalse
%    \begin{macrocode}
%</glossary-long.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-super.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary Styles using supertabular environment (glossary-super package)}
% The glossary styles defined in the \isty{glossary-super} package
% use the \envname{supertabular} environment.
%    \begin{macrocode}
\ProvidesPackage{glossary-super}[2009/01/14 v1.03 (NLCT)]
%    \end{macrocode}
% Requires the \isty{supertabular} package:
%    \begin{macrocode}
\RequirePackage{supertabular}
%    \end{macrocode}
%\begin{macro}{\glsdescwidth}
% This is a length that governs the width of the description column.
% This may already have been defined if \isty{glossary-long}
% has been loaded.
%    \begin{macrocode}
\@ifundefined{glsdescwidth}{%
  \newlength\glsdescwidth
  \setlength{\glsdescwidth}{0.6\linewidth}
}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glspagelistwidth}
% This is a length that governs the width of the page list column.
% This may already have been defined if \isty{glossary-long}
% has been loaded.
%    \begin{macrocode}
\@ifundefined{glspagelistwidth}{%
  \newlength\glspagelistwidth
  \setlength{\glspagelistwidth}{0.1\linewidth}
}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super}
% The \glostyle{super} glossary style uses the
% \envname{supertabular} environment
% (it uses lengths defined in the \isty{glossary-long} package.)
%    \begin{macrocode}
\newglossarystyle{super}{%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% two columns and no head or tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{lp{\glsdescwidth}}}%
    {\end{supertabular}}%
%    \end{macrocode}
% Do nothing at the start of the table:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headings:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries put in a row (name in first column,
% description and page list in second column):
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}%
%    \end{macrocode}
% Sub entries put in a row (no name, description and page list
% in second column):
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
     & \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & \\}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{superborder}
% The \glostyle{superborder} style is like the above, but with 
% horizontal and vertical lines:
%    \begin{macrocode}
\newglossarystyle{superborder}{%
%    \end{macrocode}
% Base it on the glostyle{super} style:
%    \begin{macrocode}
  \glossarystyle{super}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% two columns and a horizontal line in the head and tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline}\tabletail{\hline}%
     \begin{supertabular}{|l|p{\glsdescwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{superheader}
% The \glostyle{superheader} style is like the
% \glostyle{super} style, but with a header:
%    \begin{macrocode}
\newglossarystyle{superheader}{%
%    \end{macrocode}
% Base it on the glostyle{super} style:
%    \begin{macrocode}
  \glossarystyle{super}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% two columns, a header and no tail:
%    \begin{macrocode}
\renewenvironment{theglossary}%
  {\tablehead{\bfseries \entryname & \bfseries \descriptionname\\}%
   \tabletail{}%
   \begin{supertabular}{lp{\glsdescwidth}}}%
  {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{superheaderborder}
% The \glostyle{superheaderborder} style is like
% the \glostyle{super} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{superheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{super} style:
%    \begin{macrocode}
  \glossarystyle{super}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% two columns, a header and horizontal lines above and below the
% table:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline\bfseries \entryname &
       \bfseries \descriptionname\\\hline}%
     \tabletail{\hline}
     \begin{supertabular}{|l|p{\glsdescwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super3col}
% The \glostyle{super3col} style is like the \glostyle{super} 
% style, but with 3 columns:
%    \begin{macrocode}
\newglossarystyle{super3col}{%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% three columns and no head or tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}%
    {\end{supertabular}}%
%    \end{macrocode}
% Do nothing at the start of the table:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headings:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries on a row (name in first column, 
% description in second column, page list in last column):
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \glstarget{##1}{##2} & ##3 & ##5\\}%
%    \end{macrocode}
% Sub entries on a row (no name, description in second column,
% page list in last column):
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
     & \glstarget{##2}{\strut}##4 & ##6\\}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & &\\}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super3colborder}
% The \glostyle{super3colborder} style is like the
% \glostyle{super3col} style, but with a border:
%    \begin{macrocode}
\newglossarystyle{super3colborder}{%
%    \end{macrocode}
% Base it on the glostyle{super3col} style:
%    \begin{macrocode}
  \glossarystyle{super3col}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% three columns and a horizontal line in the head and tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline}\tabletail{\hline}%
     \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super3colheader}
% The \glostyle{super3colheader} style is like 
% the \glostyle{super3col} style but with a header row:
%    \begin{macrocode}
\newglossarystyle{super3colheader}{%
%    \end{macrocode}
% Base it on the glostyle{super3col} style:
%    \begin{macrocode}
  \glossarystyle{super3col}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% three columns, a header and no tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
       \bfseries\pagelistname\\}\tabletail{}%
     \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super3colheaderborder}
% The \glostyle{super3colheaderborder} style is like
% the \glostyle{super3col} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{super3colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{super3colborder} style:
%    \begin{macrocode}
  \glossarystyle{super3colborder}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% three columns, a header with horizontal lines and a horizontal
% line in the tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline
        \bfseries\entryname&\bfseries\descriptionname&
        \bfseries\pagelistname\\\hline}%
     \tabletail{\hline}%
     \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super4col}
% The \glostyle{super4col} glossary style has four columns,
% where the third column contains the value of the
% corresponding \gloskey{symbol} key used when that entry
% was defined.
%    \begin{macrocode}
\newglossarystyle{super4col}{%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns and no head or tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{llll}}{%
     \end{supertabular}}%
%    \end{macrocode}
% Do nothing at the start of the table:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headings:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries on a row with the name in the first
% column, description in second column, symbol in third column
% and page list in last column:
%    \begin{macrocode}
  \renewcommand*{\glossaryentryfield}[5]{%
    \glstarget{##1}{##2} & ##3 & ##4 & ##5\\}%
%    \end{macrocode}
% Sub entries on a row with no name, the description in the second
% column, symbol in third column and page list in last column:
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
     & \glstarget{##2}{\strut}##4 & ##5 & ##6\\}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & & &\\}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super4colheader}
% The \glostyle{super4colheader} style is like
% the \glostyle{super4col} but with a header row.
%    \begin{macrocode}
\newglossarystyle{super4colheader}{%
%    \end{macrocode}
% Base it on the glostyle{super4col} style:
%    \begin{macrocode}
  \glossarystyle{super4col}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns, a header and no tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
        \bfseries\symbolname &
        \bfseries\pagelistname\\}%
     \tabletail{}%
     \begin{supertabular}{llll}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super4colborder}
% The \glostyle{super4colborder} style is like
% the \glostyle{super4col} but with a border.
%    \begin{macrocode}
\newglossarystyle{super4colborder}{%
%    \end{macrocode}
% Base it on the glostyle{super4col} style:
%    \begin{macrocode}
  \glossarystyle{super4col}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns and a horizontal line in the head and tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline}\tabletail{\hline}%
     \begin{supertabular}{|l|l|l|l|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{super4colheaderborder}
% The \glostyle{super4colheaderborder} style is like
% the \glostyle{super4col} but with a header and border.
%    \begin{macrocode}
\newglossarystyle{super4colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{super4col} style:
%    \begin{macrocode}
  \glossarystyle{super4col}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns and a header bordered by horizontal lines and 
% a horizontal line in the tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname&
        \bfseries\symbolname &
        \bfseries\pagelistname\\\hline}\tabletail{\hline}%
     \begin{supertabular}{|l|l|l|l|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altsuper4col}
% The \glostyle{altsuper4col} glossary style is like 
% \glostyle{super4col} but has provision for multiline descriptions.
%    \begin{macrocode}
\newglossarystyle{altsuper4col}{%
%    \end{macrocode}
% Base it on the glostyle{super4col} style:
%    \begin{macrocode}
  \glossarystyle{super4col}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns and no head or tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altsuper4colheader}
% The \glostyle{altsuper4colheader} style is like
% the \glostyle{altsuper4col} but with a header row.
%    \begin{macrocode}
\newglossarystyle{altsuper4colheader}{%
%    \end{macrocode}
% Base it on the glostyle{super4colheader} style:
%    \begin{macrocode}
  \glossarystyle{super4colheader}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns, a header and no tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
      \bfseries\symbolname &
      \bfseries\pagelistname\\}\tabletail{}%
     \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altsuper4colborder}
% The \glostyle{altsuper4colborder} style is like
% the \glostyle{altsuper4col} but with a border.
%    \begin{macrocode}
\newglossarystyle{altsuper4colborder}{%
%    \end{macrocode}
% Base it on the glostyle{super4colborder} style:
%    \begin{macrocode}
  \glossarystyle{super4colborder}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns and a horizontal line in the head and tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline}\tabletail{\hline}%
     \begin{supertabular}%
       {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{altsuper4colheaderborder}
% The \glostyle{altsuper4colheaderborder} style is like
% the \glostyle{altsuper4col} but with a header and border.
%    \begin{macrocode}
\newglossarystyle{altsuper4colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{super4colheaderborder} style:
%    \begin{macrocode}
  \glossarystyle{super4colheaderborder}%
%    \end{macrocode}
% Put the glossary in a \envname{supertabular} environment with
% four columns and a header bordered by horizontal lines and 
% a horizontal line in the tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\hline
       \bfseries\entryname &
       \bfseries\descriptionname &
       \bfseries\symbolname &
       \bfseries\pagelistname\\\hline}%
     \tabletail{\hline}%
     \begin{supertabular}%
       {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{macro}
%\iffalse
%    \begin{macrocode}
%</glossary-super.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-tree.sty>
%    \end{macrocode}
%\fi
%\subsection{Tree Styles (glossary-tree.sty)}
% The \isty{glossary-tree} style file defines glossary styles
% that have a tree-like structure. These are designed for
% hierarchical glossaries.
%    \begin{macrocode}
\ProvidesPackage{glossary-tree}[2009/01/14 v1.01 (NLCT)]
%    \end{macrocode}
%
%\begin{macro}{index}
% The \glostyle{index} glossary style 
% is similar in style to the way indices are usually typeset
% using \cs{item}, \cs{subitem} and \cs{subsubitem}.
% The entry name is 
% set in bold. If an entry has a symbol, it is placed in 
% brackets after the name. Then the description is displayed,
% followed by the number list. This style allows up to three
% levels.
%    \begin{macrocode}
\newglossarystyle{index}{%
%    \end{macrocode}
% Set the paragraph indentation and skip and define \ics{item}
% to be the same as that used by \envname{theindex}:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\setlength{\parindent}{0pt}%
     \setlength{\parskip}{0pt plus 0.3pt}%
     \let\item\@idxitem}%
    {}%
%    \end{macrocode}
% Do nothing at the start of the environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headers:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entry starts a new item with the name in bold
% followed by the symbol in brackets (if it exists), the description
% and the page list.
%    \begin{macrocode}
\renewcommand*{\glossaryentryfield}[5]{%
\item\textbf{\glstarget{##1}{##2}}%
  \ifx\relax##4\relax
  \else
    \space(##4)%
  \fi
  \space ##3\glspostdescription \space ##5}%
%    \end{macrocode}
% Sub entries: level 1 entries use \ics{subitem}, levels greater 
% than~1 use \ics{subsubitem}. The level ("##1") shouldn't be 0,
% as that's catered by \cs{glossaryentryfield}, but for completeness,
% if the level is 0, \ics{item} is used. The name is put in bold,
% followed by the symbol in brackets (if it exists), the description
% and the page list.
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
    \ifcase##1\relax
      % level 0
      \item
    \or
      % level 1
      \subitem
    \else
      % all other levels
      \subsubitem
    \fi
    \textbf{\glstarget{##2}{##3}}%
    \ifx\relax##5\relax
    \else
      \space(##5)%
    \fi
    \space##4\glspostdescription\space ##6}%
%    \end{macrocode}
% Vertical gap between groups is the same as that used by indices:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{\indexspace}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{indexgroup}
% The \glostyle{indexgroup} style is like the \glostyle{index}
% style but has headings.
%    \begin{macrocode}
\newglossarystyle{indexgroup}{%
%    \end{macrocode}
% Base it on the glostyle{index} style:
%    \begin{macrocode}
  \glossarystyle{index}%
%    \end{macrocode}
% Add a heading for each group. This puts the group's title in
% bold followed by a vertical gap.
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{%
    \item\textbf{\glsgetgrouptitle{##1}}\indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{indexhypergroup}
% The \glostyle{indexhypergroup} style is like the
% \glostyle{indexgroup} style but has hyper navigation.
%    \begin{macrocode}
\newglossarystyle{indexhypergroup}{%
%    \end{macrocode}
% Base it on the glostyle{index} style:
%    \begin{macrocode}
  \glossarystyle{index}%
%    \end{macrocode}
% Put navigation links to the groups at the start of the glossary:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \item\textbf{\glsnavigation}\indexspace}%
%    \end{macrocode}
% Add a heading for each group (with a target). The group's title is
% in bold followed by a vertical gap.
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{%
    \item\textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}%
    \indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{tree}
% The \glostyle{tree} glossary style 
% is similar in style to the \glostyle{index} style, but
% can have arbitrary levels.
%    \begin{macrocode}
\newglossarystyle{tree}{%
%    \end{macrocode}
% Set the paragraph indentation and skip:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\setlength{\parindent}{0pt}%
     \setlength{\parskip}{0pt plus 0.3pt}}%
    {}%
%    \end{macrocode}
% Do nothing at the start of the \envname{theglossary} environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headings:
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries: name in bold, followed by symbol in
% brackets (if it exists), the description and the page list:
%    \begin{macrocode}
  \renewcommand{\glossaryentryfield}[5]{%
    \hangindent0pt\relax
    \parindent0pt\relax
    \textbf{\glstarget{##1}{##2}}%
    \ifx\relax##4\relax
    \else
      \space(##4)%
    \fi
    \space ##3\glspostdescription \space ##5\par}%
%    \end{macrocode}
% Sub entries: level \meta{n} is indented by \meta{n} times
% \ics{glstreeindent}. The name is in bold, followed by the
% symbol in brackets (if it exists), the description and the
% page list.
%    \begin{macrocode}
  \renewcommand{\glossarysubentryfield}[6]{%
    \hangindent##1\glstreeindent\relax
    \parindent##1\glstreeindent\relax
    \textbf{\glstarget{##2}{##3}}%
    \ifx\relax##5\relax
    \else
      \space(##5)%
    \fi
    \space##4\glspostdescription\space ##6\par}%
%    \end{macrocode}
% Vertical gap between groups is the same as that used by
% indices:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{\indexspace}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{treegroup}
% Like the \glostyle{tree} style but the glossary groups have
% headings.
%    \begin{macrocode}
\newglossarystyle{treegroup}{%
%    \end{macrocode}
% Base it on the glostyle{tree} style:
%    \begin{macrocode}
  \glossarystyle{tree}%
%    \end{macrocode}
% Each group has a heading (in bold) followed by a vertical gap):
%    \begin{macrocode}
  \renewcommand{\glsgroupheading}[1]{\par
    \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{treehypergroup}
% The \glostyle{treehypergroup} style is like the \glostyle{treegroup}
% style, but has a set of links to the groups at the
% start of the glossary.
%    \begin{macrocode}
\newglossarystyle{treehypergroup}{%
%    \end{macrocode}
% Base it on the glostyle{tree} style:
%    \begin{macrocode}
  \glossarystyle{tree}%
%    \end{macrocode}
% Put navigation links to the groups at the start of the
% \envname{theglossary} environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \par\noindent\textbf{\glsnavigation}\par\indexspace}%
%    \end{macrocode}
% Each group has a heading (in bold with a target) followed by a 
% vertical gap):
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{%
    \par\noindent
    \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par
    \indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glstreeindent}
% Length governing left indent for each level of the \glostyle{tree}
% style.
%    \begin{macrocode}
\newlength\glstreeindent
\setlength{\glstreeindent}{10pt}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{treenoname}
% The \glostyle{treenoname} glossary style 
% is like the \glostyle{tree} style, but
% doesn't print the name or symbol for sub-levels.
%    \begin{macrocode}
\newglossarystyle{treenoname}{%
%    \end{macrocode}
% Set the paragraph indentation and skip:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\setlength{\parindent}{0pt}%
     \setlength{\parskip}{0pt plus 0.3pt}}%
    {}%
%    \end{macrocode}
% No header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
%    \end{macrocode}
% No group headings:
%    \begin{macrocode}
\renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Main (level 0) entries: the name is in bold, followed by the
% symbol in brackets (if it exists), the description and the
% page list.
%    \begin{macrocode}
  \renewcommand{\glossaryentryfield}[5]{%
    \hangindent0pt\relax
    \parindent0pt\relax
    \textbf{\glstarget{##1}{##2}}%
    \ifx\relax##4\relax
    \else
      \space(##4)%
    \fi
    \space ##3\glspostdescription \space ##5\par}%
%    \end{macrocode}
% Sub entries: level \meta{n} is indented by \meta{n} times
% \ics{glstreeindent}. The name and symbol are omitted. The
% description followed by the page list are displayed.
%    \begin{macrocode}
  \renewcommand{\glossarysubentryfield}[6]{%
    \hangindent##1\glstreeindent\relax
    \parindent##1\glstreeindent\relax
    \glstarget{##2}{\strut}%
    ##4\glspostdescription\space ##6\par}%
%    \end{macrocode}
% Vertical gap between groups is the same as that used by indices:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{\indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{treenonamegroup}
% Like the \glostyle{treenoname} style but the glossary groups have
% headings.
%    \begin{macrocode}
\newglossarystyle{treenonamegroup}{%
%    \end{macrocode}
% Base it on the glostyle{treenoname} style:
%    \begin{macrocode}
  \glossarystyle{treenoname}%
%    \end{macrocode}
% Give each group a heading:
%    \begin{macrocode}
  \renewcommand{\glsgroupheading}[1]{\par
    \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{treenonamehypergroup}
% The \glostyle{treenonamehypergroup} style is like the \glostyle{treenonamegroup}
% style, but has a set of links to the groups at the
% start of the glossary.
%    \begin{macrocode}
\newglossarystyle{treenonamehypergroup}{%
%    \end{macrocode}
% Base it on the glostyle{treenoname} style:
%    \begin{macrocode}
  \glossarystyle{treenoname}%
%    \end{macrocode}
% Put navigation links to the groups at the start of the
% \envname{theglossary} environment:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \par\noindent\textbf{\glsnavigation}\par\indexspace}%
%    \end{macrocode}
% Each group has a heading (in bold with a target) followed by a 
% vertical gap):
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{%
    \par\noindent
    \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par
    \indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glssetwidest}
% \cs{glssetwidest}\oarg{level}\marg{text} sets the widest
% text for the given level. It is used by the
% \glostyle{alttree} glossary styles to determine the
% indentation of each level.
%    \begin{macrocode}
\newcommand*{\glssetwidest}[2][0]{%
  \expandafter\def\csname @glswidestname\romannumeral#1\endcsname{%
    #2}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@glswidestname}
% Initialise \cs{@glswidestname}.
%    \begin{macrocode}
\newcommand*{\@glswidestname}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{alttree}
% The \glostyle{alttree} glossary style 
% is similar in style to the \glostyle{tree} style, but
% the indentation is obtained from the width of 
% \cs{@glswidestname} which is set using \cs{glssetwidest}.
%    \begin{macrocode}
\newglossarystyle{alttree}{%
%    \end{macrocode}
% Redefine \envname{theglossary} environment.
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\def\@gls@prevlevel{-1}%
     \mbox{}\par}%
    {\par}%
%    \end{macrocode}
% Set the header and group headers to nothing.
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{}%
  \renewcommand*{\glsgroupheading}[1]{}%
%    \end{macrocode}
% Redefine the way that the level~0 entries are displayed.
%    \begin{macrocode}
  \renewcommand{\glossaryentryfield}[5]{%
%    \end{macrocode}
% If the level hasn't changed, keep the same settings, otherwise
% change \cs{glstreeindent} accordingly.
%    \begin{macrocode}
    \ifnum\@gls@prevlevel=0\relax
    \else
%    \end{macrocode}
% Find out how big the indentation should be by measuring the
% widest entry.
%    \begin{macrocode}
       \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}%
%    \end{macrocode}
% Set the hangindent and paragraph indent.
%    \begin{macrocode}
      \hangindent\glstreeindent
      \parindent\glstreeindent
    \fi
%    \end{macrocode}
% Put the name to the left of the paragraph block.
%    \begin{macrocode}
    \makebox[0pt][r]{\makebox[\glstreeindent][l]{%
       \textbf{\glstarget{##1}{##2}}}}%
%    \end{macrocode}
% If the symbol is missing, ignore it, otherwise put it in 
% brackets.
%    \begin{macrocode}
    \ifx\relax##4\relax
    \else
      (##4)\space
    \fi
%    \end{macrocode}
% Do the description followed by the description terminator and
% location list.
%    \begin{macrocode}
    ##3\glspostdescription \space ##5\par
%    \end{macrocode}
% Set the previous level to 0.
%    \begin{macrocode}
    \def\@gls@prevlevel{0}%
  }%
%    \end{macrocode}
% Redefine the way sub-entries are displayed.
%    \begin{macrocode}
  \renewcommand{\glossarysubentryfield}[6]{%
%    \end{macrocode}
% If the level hasn't changed, keep the same settings, otherwise
% adjust \cs{glstreeindent} accordingly.
%    \begin{macrocode}
    \ifnum\@gls@prevlevel=##1\relax
    \else
%    \end{macrocode}
% Compute the widest entry for this level, or for level~0 if not
% defined for this level. Store in \cs{gls@tmplen}
%    \begin{macrocode}
      \@ifundefined{@glswidestname\romannumeral##1}{%
        \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{%
        \settowidth{\gls@tmplen}{\textbf{%
           \csname @glswidestname\romannumeral##1\endcsname\space}}}%
%    \end{macrocode}
% Determine if going up or down a level
%    \begin{macrocode}
      \ifnum\@gls@prevlevel<##1\relax
%    \end{macrocode}
% Depth has increased, so add the width of the widest entry to
% \cs{glstreeindent}.
%    \begin{macrocode}
         \setlength\glstreeindent\gls@tmplen
         \addtolength\glstreeindent\parindent
         \parindent\glstreeindent
      \else
%    \end{macrocode}
% Depth has decreased, so subtract width of the widest entry 
% from the previous level to \cs{glstreeindent}. First 
% determine the width of the widest entry for the previous level
% and store in \cs{glstreeindent}.
%    \begin{macrocode}
         \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{%
           \settowidth{\glstreeindent}{\textbf{%
              \@glswidestname\space}}}{%
           \settowidth{\glstreeindent}{\textbf{%
              \csname @glswidestname\romannumeral\@gls@prevlevel
                 \endcsname\space}}}%
%    \end{macrocode}
% Subtract this length from the previous level's paragraph indent
% and set to \cs{glstreeindent}.
%    \begin{macrocode}
         \addtolength\parindent{-\glstreeindent}%
         \setlength\glstreeindent\parindent
      \fi
    \fi
%    \end{macrocode}
% Set the hanging indentation.
%    \begin{macrocode}
    \hangindent\glstreeindent
%    \end{macrocode}
% Put the name to the left of the paragraph block
%    \begin{macrocode}
    \makebox[0pt][r]{\makebox[\gls@tmplen][l]{%
      \textbf{\glstarget{##2}{##3}}}}%
%    \end{macrocode}
% If the symbol is missing, ignore it, otherwise put it in 
% brackets.
%    \begin{macrocode}
    \ifx##5\relax\relax
    \else
      (##5)\space
    \fi
%    \end{macrocode}
% Do the description followed by the description terminator and
% location list.
%    \begin{macrocode}
    ##4\glspostdescription\space ##6\par
%    \end{macrocode}
% Set the previous level macro to the current level.
%    \begin{macrocode}
    \def\@gls@prevlevel{##1}%
  }%
%    \end{macrocode}
% Vertical gap between groups is the same as that used by indices:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{\indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{alttreegroup}
% Like the \glostyle{alttree} style but the glossary groups have
% headings.
%    \begin{macrocode}
\newglossarystyle{alttreegroup}{%
%    \end{macrocode}
% Base it on the glostyle{alttree} style:
%    \begin{macrocode}
  \glossarystyle{alttree}%
%    \end{macrocode}
% Give each group a heading.
%    \begin{macrocode}
  \renewcommand{\glsgroupheading}[1]{\par
    \def\@gls@prevlevel{-1}%
    \hangindent0pt\relax
    \parindent0pt\relax
    \textbf{\glsgetgrouptitle{##1}}\par\indexspace}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{alttreehypergroup}
% The \glostyle{alttreehypergroup} style is like the 
% \glostyle{alttreegroup} style, but has a set of links to the 
% groups at the start of the glossary.
%    \begin{macrocode}
\newglossarystyle{alttreehypergroup}{%
%    \end{macrocode}
% Base it on the glostyle{alttree} style:
%    \begin{macrocode}
  \glossarystyle{alttree}%
%    \end{macrocode}
% Put the navigation links in the header
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \par
    \def\@gls@prevlevel{-1}%
    \hangindent0pt\relax
    \parindent0pt\relax
    \textbf{\glsnavigation}\par\indexspace}%
%    \end{macrocode}
% Put a hypertarget at the start of each group
%    \begin{macrocode}
  \renewcommand*{\glsgroupheading}[1]{%
    \par
    \def\@gls@prevlevel{-1}%
    \hangindent0pt\relax
    \parindent0pt\relax
    \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par
    \indexspace}}
%    \end{macrocode}
%\end{macro}
%
%\iffalse
%    \begin{macrocode}
%</glossary-tree.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-accsupp.sty>
%    \end{macrocode}
%\fi
%\section{Accessibilty Support (glossaries-accsupp Code)}
%\label{sec:code:accsupp}
% The \isty{glossaries-accsupp} package is experimental. It is
% intended to provide a means of using the PDF accessibilty support
% in glossary entries. See the \isty{accsupp} documentation for
% further details about accessibility support.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glossaries-accsupp}[2009/03/02 v0.1 (NLCT)]
%    \end{macrocode}
% Required packages:
%    \begin{macrocode}
\RequirePackage{glossaries}
\RequirePackage{accsupp}
%    \end{macrocode}
%
% Store the replacement text in the \gloskey{symbol} key when
% defining new glossary entries. For example:
%\begin{verbatim}
%\newglossaryentry{dr}{name=Dr,description={},symbol={Doctor}}
%\end{verbatim}
% The accessibility support is only provided via the commands
% \ics{gls}, \ics{glspl} and their uppercase variants, 
% e.g.\ \verb|\gls{dr}|.
%
%\begin{macro}{\glsaccsupp}
%\cs{glsaccsupp}\marg{replacement text}\marg{text}\\[10pt]
% This can be redefined to use "E" or "Alt" instead of
% "ActualText". (I don't have the software to test the "E" or
% "Alt" options.)
%    \begin{macrocode}
\newcommand*{\glsaccsupp}[2]{%
  \BeginAccSupp{ActualText=#1}#2\EndAccSupp{}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsdisplay}
% Redefine \cs{glsdisplay} to use symbol as replacement text
%    \begin{macrocode}
\renewcommand{\glsdisplay}[4]{%
  \protected@edef\@glo@symbol{#3}%
  \ifx\@glo@symbol\relax
    #1%
  \else
    \expandafter\glsaccsupp\expandafter{\@glo@symbol}{#1}%
  \fi
  #4%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsdisplayfirst}
% Redefine \cs{glsdisplayfirst} to use symbol as replacement text
% on first use.
%    \begin{macrocode}
\renewcommand{\glsdisplayfirst}[4]{%
  \protected@edef\@glo@symbol{#3}%
  \ifx\@glo@symbol\relax
    #1%
  \else
    \expandafter\glsaccsupp\expandafter{\@glo@symbol}{#1}%
  \fi
  #4%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@}
% Redefine \cs{@gls@} to change the way the link text is defined
%    \begin{macrocode}
\def\@gls@#1#2[#3]{%
  \glsdoifexists{#2}%
  {%
    \edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
    \def\@gls@link@opts{#1}%
    \def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text}). This is no longer expanded.
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \def\@glo@text{\csname gls@\@glo@type @display\endcsname
        {\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}%
        {#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}%
        {#3}}%
    }%
%    \end{macrocode}
% Call \cs{@gls@link}.
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \@gls@link[#1]{#2}{\@glo@text}%
    }%
    {%
      \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
        \boolean{glsacrfootnote}}%
      {%
        \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
      }%
      {%
        \@gls@link[#1]{#2}{\@glo@text}%
      }%
    }%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
    \glsunset{#2}%
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@Gls@}
%    \begin{macrocode}
\def\@Gls@#1#2[#3]{%
  \glsdoifexists{#2}%
  {%
    \edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
    \def\@gls@link@opts{#1}%
    \def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text}). The first character of the entry text is 
% converted to uppercase before passing to
% \cs{gls@}\meta{type}"@display" or 
% \cs{gls@}\meta{type}"@displayfirst"
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \def\@glo@text{\csname gls@\@glo@type @display\endcsname
        {\Glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}%
        {#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\Glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}%
        {#3}}%
    }%
%    \end{macrocode}
% Call \cs{@gls@link}.
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
  \ifglsused{#2}%
  {%
    \@gls@link[#1]{#2}{\@glo@text}%
  }%
  {%
    \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
      \boolean{glsacrfootnote}}%
    {%
      \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
    }%
    {%
    \@gls@link[#1]{#2}{\@glo@text}%
    }%
  }%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
    \glsunset{#2}%
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@GLS@}
%    \begin{macrocode}
\def\@GLS@#1#2[#3]{%
  \glsdoifexists{#2}{%
    \edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
    \def\@gls@link@opts{#1}%
    \def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text}).
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \def\@glo@text{\csname gls@\@glo@type @display\endcsname
        {\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}%
        {#3}}%
    }%
    {%
      \edef\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}%
        {#3}}%
    }%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
    }%
    {%
      \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
        \boolean{glsacrfootnote}}{%
        \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
      }%
      {%
        \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
      }%
    }%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
    \glsunset{#2}%
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@pl@}
%    \begin{macrocode}
\def\@glspl@#1#2[#3]{%
  \glsdoifexists{#2}%
  {%
    \edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
    \def\@gls@link@opts{#1}%
    \def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \def\@glo@text{\csname gls@\@glo@type @display\endcsname
        {\glsentryplural{#2}}{\glsentrydescplural{#2}}%
        {\glsentrysymbolplural{#2}}{#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}%
        {\glsentrysymbolplural{#2}}{#3}}%
    }%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \@gls@link[#1]{#2}{\@glo@text}%
    }%
    {%
      \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
        \boolean{glsacrfootnote}}%
      {%
        \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
      }%
      {%
        \@gls@link[#1]{#2}{\@glo@text}%
      }%
    }%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
    \glsunset{#2}%
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@Glspl@}
%    \begin{macrocode}
\def\@Glspl@#1#2[#3]{%
  \glsdoifexists{#2}%
  {%
    \edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
    \def\@gls@link@opts{#1}%
    \def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text}).
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \def\@glo@text{\csname gls@\@glo@type @display\endcsname
        {\Glsentryplural{#2}}{\glsentrydescplural{#2}}%
        {\glsentrysymbolplural{#2}}{#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\Glsentryfirstplural{#2}}{\glsentrydescplural{#2}}%
        {\glsentrysymbolplural{#2}}{#3}}%
    }%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \@gls@link[#1]{#2}{\@glo@text}%
    }%
    {%
      \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
        \boolean{glsacrfootnote}}%
      {%
        \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
      }%
      {%
        \@gls@link[#1]{#2}{\@glo@text}%
      }%
    }%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
    \glsunset{#2}%
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@GLSpl@}
%    \begin{macrocode}
\def\@GLSpl@#1#2[#3]{%
  \glsdoifexists{#2}%
  {%
    \edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
    \def\@gls@link@opts{#1}%
    \def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \def\@glo@text{\csname gls@\@glo@type @display\endcsname
        {\glsentryplural{#2}}{\glsentrydescplural{#2}}%
        {\glsentrysymbolplural{#2}}{#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
      {\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}%
      {\glsentrysymbolplural{#2}}{#3}}%
    }%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
    }%
    {%
      \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
        \boolean{glsacrfootnote}}%
      {%
        \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
      }%
      {%
        \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
      }%
    }%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
    \glsunset{#2}%
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\iffalse
%    \begin{macrocode}
%</glossaries-accsupp.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-babel.sty>
%    \end{macrocode}
%\fi
%\section{Multi-Lingual Support}
% Many thanks to everyone who contributed to the translations both
% via email and on comp.text.tex.
%\subsection{Babel Captions}
% Define \isty{babel} captions if multi-lingual
% support is required, but the \isty{translator} package is not loaded.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glossaries-babel}[2009/04/16 v1.2 (NLCT)]
%    \end{macrocode}
% English:
%    \begin{macrocode}
\@ifundefined{captionsenglish}{}{%
  \addto\captionsenglish{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
}
\@ifundefined{captionsamerican}{}{%
  \addto\captionsamerican{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
}
\@ifundefined{captionsaustralian}{}{%
  \addto\captionsaustralian{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
}
\@ifundefined{captionsbritish}{}{%
  \addto\captionsbritish{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}}%
\@ifundefined{captionscanadian}{}{%
  \addto\captionscanadian{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
}
\@ifundefined{captionsnewzealand}{}{%
  \addto\captionsnewzealand{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
}
\@ifundefined{captionsUKenglish}{}{%
  \addto\captionsUKenglish{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
}
\@ifundefined{captionsUSenglish}{}{%
  \addto\captionsUSenglish{%
    \renewcommand*{\glossaryname}{Glossary}%
    \renewcommand*{\acronymname}{Acronyms}%
    \renewcommand*{\entryname}{Notation}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Page List}%
    \renewcommand*{\glssymbolsgroupname}{Symbols}%
    \renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
}
%    \end{macrocode}
% German (quite a few variations were suggested for German; 
% I settled on the following):
%    \begin{macrocode}
\@ifundefined{captionsgerman}{}{%
  \addto\captionsgerman{% 
    \renewcommand*{\glossaryname}{Glossar}%
    \renewcommand*{\acronymname}{Akronyme}%
    \renewcommand*{\entryname}{Bezeichnung}%
    \renewcommand*{\descriptionname}{Beschreibung}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Seiten}%
    \renewcommand*{\glssymbolsgroupname}{Symbole}%
    \renewcommand*{\glsnumbersgroupname}{Zahlen}} 
}
%    \end{macrocode}
% ngerman is identical to German:
%\changes{1.2}{2009 April 16}{fixed bug in ngerman captions}
%    \begin{macrocode}
\@ifundefined{captionsngerman}{}{%
  \addto\captionsngerman{% 
    \renewcommand*{\glossaryname}{Glossar}%
    \renewcommand*{\acronymname}{Akronyme}%
    \renewcommand*{\entryname}{Bezeichnung}%
    \renewcommand*{\descriptionname}{Beschreibung}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Seiten}%
    \renewcommand*{\glssymbolsgroupname}{Symbole}%
    \renewcommand*{\glsnumbersgroupname}{Zahlen}} 
}
%    \end{macrocode}
% Italian:
%    \begin{macrocode}
\@ifundefined{captionsitalian}{}{%
  \addto\captionsitalian{%
    \renewcommand*{\glossaryname}{Glossario}%
    \renewcommand*{\acronymname}{Acronimi}%
    \renewcommand*{\entryname}{Nomenclatura}%
    \renewcommand*{\descriptionname}{Descrizione}%
    \renewcommand*{\symbolname}{Simbolo}%
    \renewcommand*{\pagelistname}{Elenco delle pagine}%
    \renewcommand*{\glssymbolsgroupname}{Simboli}%
    \renewcommand*{\glsnumbersgroupname}{Numeri}} 
}
%    \end{macrocode}
% Dutch:
%    \begin{macrocode}
\@ifundefined{captionsdutch}{}{%
  \addto\captionsdutch{%
    \renewcommand*{\glossaryname}{Woordenlijst}%
    \renewcommand*{\acronymname}{Acroniemen}%
    \renewcommand*{\entryname}{Benaming}%
    \renewcommand*{\descriptionname}{Beschrijving}%
    \renewcommand*{\symbolname}{Symbool}%
    \renewcommand*{\pagelistname}{Pagina's}%
    \renewcommand*{\glssymbolsgroupname}{Symbolen}%
    \renewcommand*{\glsnumbersgroupname}{Cijfers}} 
}
%    \end{macrocode}
% Spanish:
%    \begin{macrocode}
\@ifundefined{captionsspanish}{}{%
  \addto\captionsspanish{%
    \renewcommand*{\glossaryname}{Glosario}%
    \renewcommand*{\acronymname}{Siglas}%
    \renewcommand*{\entryname}{Entrada}%
    \renewcommand*{\descriptionname}{Descripci\'on}%
    \renewcommand*{\symbolname}{S\'{\i}mbolo}%
    \renewcommand*{\pagelistname}{Lista de p\'aginas}%
    \renewcommand*{\glssymbolsgroupname}{S\'{\i}mbolos}%
    \renewcommand*{\glsnumbersgroupname}{N\'umeros}} 
}
%    \end{macrocode}
% French:
%    \begin{macrocode}
\@ifundefined{captionsfrench}{}{%
  \addto\captionsfrench{%
    \renewcommand*{\glossaryname}{Glossaire}%
    \renewcommand*{\acronymname}{Acronymes}%
    \renewcommand*{\entryname}{Terme}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbole}%
    \renewcommand*{\pagelistname}{Pages}%
    \renewcommand*{\glssymbolsgroupname}{Symboles}%
    \renewcommand*{\glsnumbersgroupname}{Nombres}} 
}
\@ifundefined{captionsfrenchb}{}{%
  \addto\captionsfrenchb{%
    \renewcommand*{\glossaryname}{Glossaire}%
    \renewcommand*{\acronymname}{Acronymes}%
    \renewcommand*{\entryname}{Terme}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbole}%
    \renewcommand*{\pagelistname}{Pages}%
    \renewcommand*{\glssymbolsgroupname}{Symboles}%
    \renewcommand*{\glsnumbersgroupname}{Nombres}} 
}
\@ifundefined{captionsfrancais}{}{%
  \addto\captionsfrancais{%
    \renewcommand*{\glossaryname}{Glossaire}%
    \renewcommand*{\acronymname}{Acronymes}%
    \renewcommand*{\entryname}{Terme}%
    \renewcommand*{\descriptionname}{Description}%
    \renewcommand*{\symbolname}{Symbole}%
    \renewcommand*{\pagelistname}{Pages}%
    \renewcommand*{\glssymbolsgroupname}{Symboles}%
    \renewcommand*{\glsnumbersgroupname}{Nombres}} 
}
%    \end{macrocode}
% Danish:
%    \begin{macrocode}
\@ifundefined{captionsdanish}{}{%
  \addto\captionsdanish{%
    \renewcommand*{\glossaryname}{Ordliste}%
    \renewcommand*{\acronymname}{Akronymer}%
    \renewcommand*{\entryname}{Symbolforklaring}%
    \renewcommand*{\descriptionname}{Beskrivelse}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Side}%
    \renewcommand*{\glssymbolsgroupname}{Symboler}%
    \renewcommand*{\glsnumbersgroupname}{Tal}} 
}
%    \end{macrocode}
% Irish:
%    \begin{macrocode}
\@ifundefined{captionsirish}{}{%
  \addto\captionsirish{%
    \renewcommand*{\glossaryname}{Gluais}%
    \renewcommand*{\acronymname}{Acrainmneacha}%
%    \end{macrocode}
% wasn't sure whether to go for N\'ota (Note), Ciall (`Meaning',
% `sense') or Br\'{\i} (`Meaning'). In the end I chose Ciall.
%    \begin{macrocode}
    \renewcommand*{\entryname}{Ciall}%
    \renewcommand*{\descriptionname}{Tuairisc}%
%    \end{macrocode}
% Again, not sure whether to use Comhartha/Comhartha\'{\i} or
% Siombail/Siombaile, so have chosen the former.
%    \begin{macrocode}
    \renewcommand*{\symbolname}{Comhartha}%
    \renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}%
    \renewcommand*{\pagelistname}{Leathanaigh}%
    \renewcommand*{\glsnumbersgroupname}{Uimhreacha}} 
}
%    \end{macrocode}
% Hungarian:
%    \begin{macrocode}
\@ifundefined{captionsmagyar}{}{%
  \addto\captionsmagyar{%
    \renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}%
    \renewcommand*{\acronymname}{Bet\H uszavak}%
    \renewcommand*{\entryname}{Kifejez\'es}%
    \renewcommand*{\descriptionname}{Magyar\'azat}%
    \renewcommand*{\symbolname}{Jel\"ol\'es}%
    \renewcommand*{\pagelistname}{Oldalsz\'am}%
    \renewcommand*{\glssymbolsgroupname}{Jelek}%
    \renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}%
  }
}
\@ifundefined{captionshungarian}{}{%
  \addto\captionshungarian{%
    \renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}%
    \renewcommand*{\acronymname}{Bet\H uszavak}%
    \renewcommand*{\entryname}{Kifejez\'es}%
    \renewcommand*{\descriptionname}{Magyar\'azat}%
    \renewcommand*{\symbolname}{Jel\"ol\'es}%
    \renewcommand*{\pagelistname}{Oldalsz\'am}%
    \renewcommand*{\glssymbolsgroupname}{Jelek}%
    \renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}%
  }
}
%    \end{macrocode}
% Polish
% \changes{1.13}{2008 May 10}{Add Polish support}
%    \begin{macrocode}
\@ifundefined{captionspolish}{}{%
  \addto\captionspolish{%
    \renewcommand*{\glossaryname}{S{\l}ownik termin\'ow}%
    \renewcommand*{\acronymname}{Skr\'ot}%
    \renewcommand*{\entryname}{Termin}%
    \renewcommand*{\descriptionname}{Opis}%
    \renewcommand*{\symbolname}{Symbol}%
    \renewcommand*{\pagelistname}{Strony}%
    \renewcommand*{\glssymbolsgroupname}{Symbole}%
    \renewcommand*{\glsnumbersgroupname}{Liczby}}
}
%    \end{macrocode}
% Brazilian
%\changes{1.17}{2008 December 11}{Added Brazilian support}
%    \begin{macrocode}
\@ifundefined{captionsbrazil}{}{%
  \addto\captionsbrazil{%
    \renewcommand*{\glossaryname}{Gloss\'ario}%
    \renewcommand*{\acronymname}{Siglas}%
    \renewcommand*{\entryname}{Nota\c c\~ao}%
    \renewcommand*{\descriptionname}{Descri\c c\~ao}%
    \renewcommand*{\symbolname}{S\'imbolo}%
    \renewcommand*{\pagelistname}{Lista de P\'aginas}%
    \renewcommand*{\glssymbolsgroupname}{S\'imbolos}%
    \renewcommand*{\glsnumbersgroupname}{N\'umeros}%
  }%
}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-babel.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Brazil.dict>
%    \end{macrocode}
%\fi
%\subsection{Brazilian Dictionary}
% This is a dictionary file provided by Thiago de~Melo for
% use with the \isty{translator} package.
%\changes{1.17}{2008 November 17}{added Brazilian dictionary}
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Brazil}
%    \end{macrocode}
% Provide Brazilian translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Gloss\'ario}
\providetranslation{Acronyms}{Siglas}
\providetranslation{Notation (glossaries)}{Nota\c c\~ao}
\providetranslation{Description (glossaries)}{Descri\c c\~ao}
\providetranslation{Symbol (glossaries)}{S\'imbolo}
\providetranslation{Page List (glossaries)}{Lista de P\'aginas}
\providetranslation{Symbols (glossaries)}{S\'imbolos}
\providetranslation{Numbers (glossaries)}{N\'umeros}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Brazil.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Danish.dict>
%    \end{macrocode}
%\fi
%\subsection{Danish Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Danish}
%    \end{macrocode}
% Provide Danish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Ordliste}
\providetranslation{Acronyms}{Akronymer}
\providetranslation{Notation (glossaries)}{Symbolforklaring}
\providetranslation{Description (glossaries)}{Beskrivelse}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Side}
\providetranslation{Symbols (glossaries)}{Symboler}
\providetranslation{Numbers (glossaries)}{Tal}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Danish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Dutch.dict>
%    \end{macrocode}
%\fi
%\subsection{Dutch Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Dutch}
%    \end{macrocode}
% Provide Dutch translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Woordenlijst}
\providetranslation{Acronyms}{Acroniemen}
\providetranslation{Notation (glossaries)}{Benaming}
\providetranslation{Description (glossaries)}{Beschrijving}
\providetranslation{Symbol (glossaries)}{Symbool}
\providetranslation{Page List (glossaries)}{Pagina's}
\providetranslation{Symbols (glossaries)}{Symbolen}
\providetranslation{Numbers (glossaries)}{Cijfers}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Dutch.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-English.dict>
%    \end{macrocode}
%\fi
%\subsection{English Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{English}
%    \end{macrocode}
% Provide English translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glossary}
\providetranslation{Acronyms}{Acronyms}
\providetranslation{Notation (glossaries)}{Notation}
\providetranslation{Description (glossaries)}{Description}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Page List}
\providetranslation{Symbols (glossaries)}{Symbols}
\providetranslation{Numbers (glossaries)}{Numbers}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-English.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-French.dict>
%    \end{macrocode}
%\fi
%\subsection{French Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{French}
%    \end{macrocode}
% Provide French translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glossaire}
\providetranslation{Acronyms}{Acronymes}
\providetranslation{Notation (glossaries)}{Terme}
\providetranslation{Description (glossaries)}{Description}
\providetranslation{Symbol (glossaries)}{Symbole}
\providetranslation{Page List (glossaries)}{Pages}
\providetranslation{Symbols (glossaries)}{Symboles}
\providetranslation{Numbers (glossaries)}{Nombres}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-French.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-German.dict>
%    \end{macrocode}
%\fi
%\subsection{German Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{German}
%    \end{macrocode}
% Provide German translations (quite a few variations were suggested
% for German; I settled on the following):
%    \begin{macrocode}
\providetranslation{Glossary}{Glossar}
\providetranslation{Acronyms}{Akronyme}
\providetranslation{Notation (glossaries)}{Bezeichnung}
\providetranslation{Description (glossaries)}{Beschreibung}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Seiten}
\providetranslation{Symbols (glossaries)}{Symbole}
\providetranslation{Numbers (glossaries)}{Zahlen}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-German.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Irish.dict>
%    \end{macrocode}
%\fi
%\subsection{Irish Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Irish}
%    \end{macrocode}
% Provide Irish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Gluais}
\providetranslation{Acronyms}{Acrainmneacha}
\providetranslation{Notation (glossaries)}{Ciall}
\providetranslation{Description (glossaries)}{Tuairisc}
\providetranslation{Symbol (glossaries)}{Comhartha}
\providetranslation{Page List (glossaries)}{Leathanaigh}
\providetranslation{Symbols (glossaries)}{Comhartha\'{\i}}
\providetranslation{Numbers (glossaries)}{Uimhreacha}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Irish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Italian.dict>
%    \end{macrocode}
%\fi
%\subsection{Italian Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Italian}
%    \end{macrocode}
% Provide Italian translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glossario}
\providetranslation{Acronyms}{Acronimi}
\providetranslation{Notation (glossaries)}{Nomenclatura}
\providetranslation{Description (glossaries)}{Descrizione}
\providetranslation{Symbol (glossaries)}{Simbolo}
\providetranslation{Page List (glossaries)}{Elenco delle pagine}
\providetranslation{Symbols (glossaries)}{Simboli}
\providetranslation{Numbers (glossaries)}{Numeri}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Italian.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Magyar.dict>
%    \end{macrocode}
%\fi
%\subsection{Magyar Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Magyar}
%    \end{macrocode}
% Provide translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Sz\'ojegyz\'ek}
\providetranslation{Acronyms}{Bet\H uszavak}
\providetranslation{Notation (glossaries)}{Kifejez\'es}
\providetranslation{Description (glossaries)}{Magyar\'azat}
\providetranslation{Symbol (glossaries)}{Jel\"ol\'es}
\providetranslation{Page List (glossaries)}{Oldalsz\'am}
\providetranslation{Symbols (glossaries)}{Jelek}
\providetranslation{Numbers (glossaries)}{Sz\'amjegyek}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Magyar.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Polish.dict>
%    \end{macrocode}
%\fi
%\subsection{Polish Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Polish}
%    \end{macrocode}
% Provide Polish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{S{\l}ownik termin\'ow}
\providetranslation{Acronyms}{Skr\'ot}
\providetranslation{Notation (glossaries)}{Termin}
\providetranslation{Description (glossaries)}{Opis}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Strony}
\providetranslation{Symbols (glossaries)}{Symbole}
\providetranslation{Numbers (glossaries)}{Liczby}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Polish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Spanish.dict>
%    \end{macrocode}
%\fi
%\subsection{Spanish Dictionary}
% This is a dictionary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Spanish}
%    \end{macrocode}
% Provide Spanish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glosario}
\providetranslation{Acronyms}{Siglas}
\providetranslation{Notation (glossaries)}{Entrada}
\providetranslation{Description (glossaries)}{Descripci\'on}
\providetranslation{Symbol (glossaries)}{S\'{\i}mbolo}
\providetranslation{Page List (glossaries)}{Lista de p\'aginas}
\providetranslation{Symbols (glossaries)}{S\'{\i}mbolos}
\providetranslation{Numbers (glossaries)}{N\'umeros}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Spanish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*minimalgls.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % This is a minimal file for testing and debugging 
 % the glossaries package. Change the class file as 
 % desired, and add the relevant package options to
 % both the class file and the glossaries package.
 % Change the sample glossary entry and acronym if
 % required. If the problem occurs with an additional
 % glossary, add in the relevant \newglossary command
 % and a sample entry.
 %
 % Only add extra packages or commands if they 
 % contribute to whatever problem you are trying to
 % test.
 %
 % Remember that the document will not be complete
 % until you have successfully completed all of the
 % following steps:
 % 1. latex minimalgls
 % 2. makeglossaries minimalgls (note no extension)
 % 3. latex minimalgls
 % A further run through LaTeX will be required to ensure that
 % the table of contents is up to date if the toc option
 % is used.
\documentclass{article}
\listfiles

\usepackage[colorlinks]{hyperref}
 \usepackage{glossaries} % acronym will go in main glossary
 %\usepackage[acronym]{glossaries} % make a separate list of acronyms

\makeglossaries

\newglossaryentry{sample}{name={sample},
description={a sample entry}}

% This contrived acronym has non-standard plural forms.
% These are specified in the optional argument.
\newacronym[\glsshortpluralkey=cas,\glslongpluralkey=contrived 
acronyms]{aca}{aca}{a contrived acronym}

\begin{document}
A \gls{sample} entry and \gls{aca}. Second use: \gls{aca}.

Plurals: \glspl{sample}. Reset acronym\glsreset{aca}.
First use: \glspl{aca}. Second use: \glspl{aca}.

\printglossaries
\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</minimalgls.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sample.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{report}

\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage[toc,style=treenoname,order=word]{glossaries}

\makeglossaries

\newglossaryentry{glossary}{name=glossary,
description={\nopostdesc},
plural={glossaries}}

\newglossaryentry{glossarylist}{
description={1) list of technical words},
sort={1},
parent={glossary}}

\newglossaryentry{glossarycol}{
description={2) collection of glosses},
sort={2},
parent={glossary}}

\newglossaryentry{Perl}{name=\texttt{Perl},
sort=Perl, % need a sort key because name contains a command
description=A scripting language}

\newglossaryentry{pagelist}{name=page list,
 % description value has to be enclosed in braces
 % because it contains commas
description={a list of individual pages or page ranges 
(e.g.\ 1,2,4,7-9)}}

\newglossaryentry{mtrx}{name=matrix,
description={rectangular array of quantities},
 % plural is not simply obtained by appending an s, so specify
plural=matrices}

 % entry with a paragraph break in the description

\newglossaryentry{par}{name=paragraph,
description={distinct section of piece of 
writing.\glspar Beginning on new, usually indented, line}}

 % entry with two types of plural. Set the plural form to the 
 % form most likely to be used. If you want to use a different
 % plural, you will need to explicity specify it in \glslink
\newglossaryentry{cow}{name=cow,
 % this isn't necessary, as this form (appending an s) is
 % the default
plural=cows,
 % description:
description={(\emph{pl.}\ cows, \emph{archaic} kine) an adult
female of any bovine animal}}

\newglossaryentry{bravo}{name={bravo},
description={\nopostdesc}}

\newglossaryentry{bravo1}{description={1) cry of approval (pl.\ bravos)},
sort={1},
plural={bravos},
parent=bravo}

\newglossaryentry{bravo2}{description={2) hired ruffian or killer (pl.\ bravoes)},
sort={2},
plural={bravoes},
parent=bravo}

\newglossaryentry{seal}{name=seal,description={sea mammal with
flippers that eats fish}}

\newglossaryentry{sealion}{name={sea lion},
description={large seal}}

\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 \gls{glossarylist} is a very useful addition to any
technical document, although a \gls{glossarycol} can 
also simply be a collection of glosses, which is
another thing entirely. Some documents have
multiple \glspl{glossarylist}.

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 \gls{Perl} script
\texttt{makeglossaries} which provides a convenient
wrapper.

If a comma appears within the name or description, grouping
must be used, e.g.\ in the description of \gls{pagelist}.

\chapter{Plurals and Paragraphs}

Plurals are assumed to have the letter s appended, but if this is
not the case, as in \glspl{mtrx}, then you need to specify the
plural when you define the entry. If a term may have multiple
plurals (for example \glspl{cow}/\glslink{cow}{kine}) then 
define the entry with the plural form most likely to be used and
explicitly specify the alternative form using \verb|\glslink|.
\Glspl{seal} and \glspl{sealion} have regular plural forms.

\Gls{bravo} is a homograph, but the plural forms are spelt
differently. The plural of \gls{bravo1}, a cry of approval, 
is \glspl{bravo1}, whereas the plural of \gls{bravo2}, a hired
ruffian or killer, is \glspl{bravo2}.

\Glspl{par} can cause a problem in commands, so care is needed
when having a paragraph break in a \gls{glossarylist} entry.

\chapter{Ordering}

There are two types of ordering: word ordering (which places
``\gls{sealion}'' before ``\gls{seal}'') and letter ordering
(which places ``\gls{seal}'' before ``\gls{sealion}'').

\printglossaries

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sample.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sample4col.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{article}

\usepackage[style=long4colheaderborder]{glossaries}

\makeglossaries

\newglossaryentry{w}{name={$w$},
sort=w,
description={width},
symbol=m}

\newglossaryentry{M}{name={$M$},
sort=M,
description={mass},
symbol=kg}

\begin{document}

\printglossaries

The width, \gls{w}, is measured in meters. The mass, \gls{M} is
measured in kilograms.

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sample4col.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleaccsupp.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{article}

\usepackage{glossaries-accsupp}

 % Replacement text is stored in symbol
\newglossaryentry{dr}{name=Dr,description={},symbol={Doctor}}

\begin{document}
\gls{dr}~Jones.
\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleaccsupp.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleAcr.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{report}

\usepackage[colorlinks,plainpages=false]{hyperref}
\usepackage[style=long,toc]{glossaries}

\makeglossaries

\newacronym{svm}% label
{svm}% abbreviation
{support vector machine}% long form

\newacronym{ksvm}{ksvm}{kernel support vector machine}

\newacronym{rna}{rna}{ribonukleins\"aure}

\begin{document}
\tableofcontents

\chapter{Support Vector Machines}

\Glspl{svm} are used widely in the area of pattern recognition.

This is the text produced without a link: \glsentrytext{svm}.
This is the text produced on first use without a link:
\glsentryfirst{svm}. This is the entry's description without
a link: \glsentrydesc{svm}.

This is the entry in uppercase: \GLS{svm}.

\chapter{Kernel Support Vector Machines}

The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses
the so called ``kernel trick''. Plural: \glspl{ksvm}.

\glsresetall
Possessive: \gls{ksvm}['s].
Make the glossary entry number bold for this 
one \gls[format=hyperbf]{svm}.

\chapter{Another chapter}

You don't need to worry about makeindex's special characters:
\gls{rna}.

\printglossary[title={Acronyms}]

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleAcr.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleAcrDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{report}

\usepackage[colorlinks,plainpages=false]{hyperref}

\usepackage[style=altlist, % use altlist style
            toc, % add the glossary to the table of contents
            sanitize={description=false},% want to use description in main document
            description% acronyms have a user-supplied description
           ]{glossaries}

\makeglossaries

\newacronym[description={Statistical pattern recognition 
technique~\protect\cite{svm}}, % acronym's description
name={Support vector machine (svm)}% change the default way of displaying the entry name in the list of acronyms
]{svm}{svm}{support vector machine}

\newacronym[description={Statistical pattern recognition technique
using the ``kernel trick'' (see also \glshyperlink[SVM]{svm})},% acronym's description
name={Kernel support vector machine (ksvm)}% change the default way of displaying the entry name in the list of acronyms
]{ksvm}{ksvm}{kernel 
support vector machine}

\begin{document}
\tableofcontents

\chapter{Support Vector Machines}

The \gls{svm} is used widely in the area of pattern recognition.
 % plural form with initial letter in uppercase:
\Glspl{svm} are \ldots

This is the text produced without a link: \glsentrytext{svm}.
This is the text produced on first use without a link:
\glsentryfirst{svm}. This is the entry's description without
a link: \glsentrydesc{svm}.

This is the entry in uppercase: \GLS{svm}.

\chapter{Kernel Support Vector Machines}

The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses
the so called ``kernel trick''. This is the entry's description without
a link: \glsentrydesc{ksvm}.

\glsresetall
Possessive: \gls{ksvm}['s].
Make the glossary entry number bold for this 
one \gls[format=hyperbf]{svm}.

\begin{thebibliography}{1}
\bibitem{svm} \ldots
\end{thebibliography}

\printglossary

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleAcrDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleDB.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{article}

\usepackage[colorlinks,plainpages=false]{hyperref}
\usepackage[nonumberlist]{glossaries}

\newglossary[nlg]{symbols}{not}{ntn}{Symbols}

\makeglossaries

\loadglsentries{database1}
\loadglsentries[symbols]{database2}

\begin{document}

Adding all entries\glsaddall.

\printglossaries

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleDB.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
% See also sampleAcrDesc.tex
\documentclass[a4paper]{report}

\usepackage[colorlinks,plainpages=false]{hyperref}

\usepackage[style=altlist, % use altlist style
            toc, % add the glossary to the table of contents
            sanitize={description=false}% don't sanitize description
           ]{glossaries}

\makeglossaries

\newglossaryentry{svm}{
 % how the entry name should appear in the glossary
name={Support vector machine (SVM)},
 % how the description should appear in the glossary
 % since I have used sanitize={description=false}
 % I have to protect fragile commands
description={Statistical pattern recognition
technique~\protect\cite{svm}},
 % how the entry should appear in the document text
text={svm},
 % how the entry should appear the first time it is
 % used in the document text
first={support vector machine (svm)}}

\newglossaryentry{ksvm}{
name={Kernel support vector machine (KSVM)},
description={Statistical pattern recognition technique
using the ``kernel trick'' (see also SVM)},
text={ksvm},
first={kernel support vector machine}}

\begin{document}
\tableofcontents

\chapter{Support Vector Machines}

The \gls{svm} is used widely in the area of pattern recognition.
 % plural form with initial letter in uppercase:
\Glspl{svm} are \ldots

This is the text produced without a link: \glsentrytext{svm}.
This is the text produced on first use without a link:
\glsentryfirst{svm}. This is the entry's description without
a link: \glsentrydesc{svm}.

This is the entry in uppercase: \GLS{svm}.

\chapter{Kernel Support Vector Machines}

The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses
the so called ``kernel trick''.

\glsresetall
Possessive: \gls{ksvm}['s].
Make the glossary entry number bold for this 
one \gls[format=hyperbf]{svm}.

\begin{thebibliography}{1}
\bibitem{svm} \ldots
\end{thebibliography}

\printglossary[title={Acronyms}]

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleEq.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper,12pt]{report}

\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\usepackage[style=long3colheader,counter=equation]{glossaries}

\makeglossaries

\newcommand{\erf}{\operatorname{erf}}
\newcommand{\erfc}{\operatorname{erfc}}

 % redefine the way hyperref creates the target for equations
 % so that the glossary links to equation numbers work

\renewcommand*\theHequation{\thechapter.\arabic{equation}}

 % Change the glossary headings

\renewcommand{\entryname}{Notation}
\renewcommand{\descriptionname}{Function Name}
\renewcommand{\pagelistname}{Number of Formula}

 % define glossary entries

\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)},
description=Gamma function,
sort=Gamma}

\newglossaryentry{gamma}{name={\ensuremath{\gamma(\alpha,x)}},
description=Incomplete gamma function,
sort=gamma}

\newglossaryentry{iGamma}{name={\ensuremath{\Gamma(\alpha,x)}},
description=Incomplete gamma function,
sort=Gamma}

\newglossaryentry{psi}{name=\ensuremath{\psi(x)},
description=Psi function,sort=psi}

\newglossaryentry{erf}{name=\ensuremath{\erf(x)},
description=Error function,sort=erf}

\newglossaryentry{erfc}{name=\ensuremath{\erfc},
description=Complementary error function,sort=erfc}

\newglossaryentry{B}{name={\ensuremath{B(x,y)}},
description=Beta function,sort=B}

\newglossaryentry{Bx}{name={\ensuremath{B_x(p,q)}},
description=Incomplete beta function,sort=Bx}

\newglossaryentry{Tn}{name=\ensuremath{T_n(x)},
description=Chebyshev's polynomials of the first kind,sort=Tn}

\newglossaryentry{Un}{name=\ensuremath{U_n(x)},
description=Chebyshev's polynomials of the second kind,sort=Un}

\newglossaryentry{Hn}{name=\ensuremath{H_n(x)},
description=Hermite polynomials,sort=Hn}

\newglossaryentry{Ln}{name=\ensuremath{L_n^\alpha(x)},
description=Laguerre polynomials,sort=Lna}

\newglossaryentry{Znu}{name=\ensuremath{Z_\nu(z)},
description=Bessel functions,sort=Z}

\newglossaryentry{Phi}{name={\ensuremath{\Phi(\alpha,\gamma;z)}},
description=confluent hypergeometric function,sort=Pagz}

\newglossaryentry{knu}{name=\ensuremath{k_\nu(x)},
description=Bateman's function,sort=kv}

\newglossaryentry{Dp}{name=\ensuremath{D_p(z)},
description=Parabolic cylinder functions,sort=Dp}

\newglossaryentry{F}{name={\ensuremath{F(\phi,k)}},
description=Elliptical integral of the first kind,sort=Fpk}

\newglossaryentry{C}{name=\ensuremath{C},
description=Euler's constant,sort=C}

\newglossaryentry{G}{name=\ensuremath{G},
description=Catalan's constant,sort=G}

\begin{document}
\title{A Sample Document Using glossaries.sty}
\author{Nicola Talbot}
\maketitle

\begin{abstract}
This is a sample document illustrating the use of the \textsf{glossaries}
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 using the \texttt{counter=equation} package
option.
\end{abstract}

\printglossary[title={Index of Special Functions and Notations}]

\chapter{Gamma Functions}

\begin{equation}
\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
\end{equation}

\verb|\ensuremath| is only required here if using 
hyperlinks.
\begin{equation}
\glslink{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x)
\end{equation}

\begin{equation}
\gls{gamma} = \int_0^x e^{-t}t^{\alpha-1}\,dt
\end{equation}

\begin{equation}
\gls{iGamma} = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
\end{equation}

\newpage

\begin{equation}
\gls{Gamma} = \Gamma(\alpha, x) + \gamma(\alpha, x)
\end{equation}

\begin{equation}
\gls{psi} = \frac{d}{dx}\ln\Gamma(x)
\end{equation}

\chapter{Error Functions}

\begin{equation}
\gls{erf} = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
\end{equation}

\begin{equation}
\gls{erfc} = 1 - \erf(x)
\end{equation}

\chapter{Beta Function}

\begin{equation}
\gls{B} = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
\end{equation}
Alternatively:
\begin{equation}
\gls{B} = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
\end{equation}

\begin{equation}
\gls{B} = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
\end{equation}

\begin{equation}
\gls{Bx} = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
\end{equation}

\chapter{Polynomials}

\section{Chebyshev's polynomials}

\begin{equation}
\gls{Tn} = \cos(n\arccos x)
\end{equation}

\begin{equation}
\gls{Un} = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
\end{equation}

\section{Hermite polynomials}

\begin{equation}
\gls{Hn} = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
\end{equation}

\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}

\chapter{Bessel Functions}

Bessel functions $Z_\nu$ are solutions of
\begin{equation}
\frac{d^2\glslink{Znu}{Z_\nu}}{dz^2} 
+ \frac{1}{z}\,\frac{dZ_\nu}{dz} + 
\left( 1-\frac{\nu^2}{z^2}Z_\nu = 0 \right)
\end{equation}

\chapter{Confluent hypergeometric function}

\begin{equation}
\gls{Phi} = 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}

\begin{equation}
\gls{knu} = \frac{2}{\pi}\int_0^{\pi/2}
\cos(x \tan\theta - \nu\theta)\,d\theta
\end{equation}

\chapter{Parabolic cylinder functions}

\begin{equation}
\gls{Dp} = 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}

\chapter{Elliptical Integral of the First Kind}

\begin{equation}
\gls{F} = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
\end{equation}

\chapter{Constants}

\begin{equation}
\gls{C} = 0.577\,215\,664\,901\ldots
\end{equation}

\begin{equation}
\gls{G} = 0.915\,965\,594\ldots
\end{equation}

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleEq.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleEqPg.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % To ensure that the page numbers are up-to-date:
 %
 % latex sampleEqPg
 % makeglossaries sampleEqPg
 % latex sampleEqPg
 % makeglossaries sampleEqPg
 % latex sampleEqPg
 %
 % The extra makeglossaries run is required because adding the
 % glossary in the second LaTeX run shifts the page numbers on
 % which means that the glossary needs to be updated again.
 % (Note that this problem is avoided if the page numbering is
 % reset after the glossary. For example, if the glossary has
 % roman numbering and the subsequent pages have arabic numbering)
\documentclass[a4paper,12pt]{report}

\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\usepackage[style=long3colheader,toc,
            counter=equation]{glossaries}

\newcommand{\erf}{\operatorname{erf}}
\newcommand{\erfc}{\operatorname{erfc}}

 % redefine the way hyperref creates the target for equations
 % so that the glossary links to equation numbers work

\renewcommand*\theHequation{\thechapter.\arabic{equation}}

\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}

 % set the glossary number style to italic
 % hyperit is used instead of textit because
 % the hyperref package is being used.
\renewcommand{\glsnumberformat}[1]{\hyperit{#1}}

 % 1st column heading
\renewcommand{\entryname}{Notation}

 % 2nd column heading
\renewcommand{\descriptionname}{Function Name}

 % 3rd column heading
\renewcommand{\pagelistname}{}

 % Redefine header row so that it
 % adds a blank row after the title row
\renewcommand{\glossaryheader}{\bfseries\entryname &
\bfseries\descriptionname&\bfseries\pagelistname\\
& & \\\endhead}

 % Define glossary entries

\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)},
description=Gamma function,sort=Gamma}

\newglossaryentry{gamma}{name=\ensuremath{\gamma(\alpha,x)},
description=Incomplete gamma function,sort=gamma}

\newglossaryentry{iGamma}{name=\ensuremath{\Gamma(\alpha,x)},
description=Incomplete gamma function,sort=Gamma}

\newglossaryentry{psi}{name=\ensuremath{\psi(x)},
description=Psi function,sort=psi}

\newglossaryentry{erf}{name=\ensuremath{\erf(x)},
description=Error function,sort=erf}

\newglossaryentry{erfc}{name=\ensuremath{\erfc(x)},
description=Complementary error function,sort=erfc}

\newglossaryentry{beta}{name=\ensuremath{B(x,y)},
description=Beta function,sort=B}

\newglossaryentry{Bx}{name=\ensuremath{B_x(p,q)},
description=Incomplete beta function,sort=Bx}

\newglossaryentry{Tn}{name=\ensuremath{T_n(x)},
description=Chebyshev's polynomials of the first kind,
sort=Tn}

\newglossaryentry{Un}{name=\ensuremath{U_n(x)},
description=Chebyshev's polynomials of the second kind,
sort=Un}

\newglossaryentry{Hn}{name=\ensuremath{H_n(x)},
description=Hermite polynomials,sort=Hn}

\newglossaryentry{Lna}{name=\ensuremath{L_n^\alpha(x)},
description=Laguerre polynomials,sort=Lna}

\newglossaryentry{Znu}{name=\ensuremath{Z_\nu(z)},
description=Bessel functions,sort=Z}

\newglossaryentry{Pagz}{name=\ensuremath{\Phi(\alpha,\gamma;z)},
description=confluent hypergeometric function,sort=Pagz}

\newglossaryentry{kv}{name=\ensuremath{k_\nu(x)},
description=Bateman's function,sort=kv}

\newglossaryentry{Dp}{name=\ensuremath{D_p(z)},
description=Parabolic cylinder functions,sort=Dp}

\newglossaryentry{Fpk}{name=\ensuremath{F(\phi,k)},
description=Elliptical integral of the first kind,sort=Fpk}

\newglossaryentry{C}{name=\ensuremath{C},
description=Euler's constant,sort=C}

\newglossaryentry{G}{name=\ensuremath{G},
description=Catalan's constant,sort=G}

\makeglossaries

\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{glossaries}
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 numbers and equation numbers.  
Since the majority of the entries use the equation number,
\texttt{counter=equation} was used as a package option.
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[toctitle={Special Functions}]

\chapter{Gamma Functions}

The \glslink[format=hyperbf,counter=page]{Gamma}{gamma function} is 
defined as
\begin{equation}
\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
\end{equation}

\begin{equation}
\glslink{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x)
\end{equation}

\begin{equation}
\gls{gamma} = \int_0^x e^{-t}t^{\alpha-1}\,dt
\end{equation}

\begin{equation}
\gls{iGamma} = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
\end{equation}

\newpage

\begin{equation}
\glslink{Gamma}{\ensuremath{\Gamma(\alpha)}} = 
\Gamma(\alpha, x) + \gamma(\alpha, x)
\end{equation}

\begin{equation}
\gls{psi} = \frac{d}{dx}\ln\Gamma(x)
\end{equation}

\chapter{Error Functions}

The \glslink[format=hyperbf,counter=page]{erf}{error function} is defined as:
\begin{equation}
\gls{erf} = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
\end{equation}

\begin{equation}
\gls{erfc} = 1 - \erf(x)
\end{equation}

\chapter{Beta Function}

\begin{equation}
\gls{beta} = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
\end{equation}
Alternatively:
\begin{equation}
\gls{beta} = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
\end{equation}

\begin{equation}
\gls{beta} = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
\end{equation}

\begin{equation}
\gls{Bx} = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
\end{equation}

\chapter{Chebyshev's polynomials}

\begin{equation}
\gls{Tn} = \cos(n\arccos x)
\end{equation}

\begin{equation}
\gls{Un} = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
\end{equation}

\chapter{Hermite polynomials}

\begin{equation}
\gls{Hn} = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
\end{equation}

\chapter{Laguerre polynomials}

\begin{equation}
\gls{Lna} = \frac{1}{n!}e^x x^{-\alpha} 
\frac{d^n}{dx^n}(e^{-x}x^{n+\alpha})
\end{equation}

\chapter{Bessel Functions}

Bessel functions $Z_\nu(z)$ are solutions of
\begin{equation}
\frac{d^2\glslink{Znu}{Z_\nu}}{dz^2} + \frac{1}{z}\,\frac{dZ_\nu}{dz} + 
\left(
1-\frac{\nu^2}{z^2}Z_\nu = 0
\right)
\end{equation}

\chapter{Confluent hypergeometric function}

\begin{equation}
\gls{Pagz} = 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}

\begin{equation}
\gls{kv} = \frac{2}{\pi}\int_0^{\pi/2}
\cos(x \tan\theta - \nu\theta)\,d\theta
\end{equation}

\chapter{Parabolic cylinder functions}

\begin{equation}
\gls{Dp} = 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}

\chapter{Elliptical Integral of the First Kind}

\begin{equation}
\gls{Fpk} = \int_0^\phi 
\frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
\end{equation}

\chapter{Constants}

\begin{equation}
\gls{C} = 0.577\,215\,664\,901\ldots
\end{equation}

\begin{equation}
\gls{G} = 0.915\,965\,594\ldots
\end{equation}

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleEqPg.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleNtn.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{report}

\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage{html}
\usepackage[toc]{glossaries}

 % Define a new glossary type called notation
\newglossary[nlg]{notation}{not}{ntn}{Notation}

\makeglossaries

 % Notation definitions

\newglossaryentry{not:set}{type=notation, % glossary type
name={$\mathcal{S}$},
description={A set},
sort={S}}

\newglossaryentry{not:U}{type=notation,
name={$\mathcal{U}$},
description={The universal set},
sort=U}

\newglossaryentry{not:card}{type=notation,
name={$|\mathcal{S}|$},
description={cardinality of $\mathcal{S}$},
sort=cardinality}

\newglossaryentry{not:fact}{type=notation,
name={$!$},
description={factorial},
sort=factorial}

 % Main glossary definitions

\newglossaryentry{gls:set}{name=set,
description={A collection of distinct objects}}

\newglossaryentry{gls:card}{name=cardinality,
description={The number of elements in the specified set}}

\begin{document}
\title{Sample Document using the glossaries Package}
\author{Nicola Talbot}
\pagenumbering{alph}
\maketitle

\begin{abstract}
 %stop hyperref complaining about duplicate page identifiers:
\pagenumbering{Alph}
This is a sample document illustrating the use of the
\textsf{glossaries} 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

\printglossaries

\chapter{Introduction}
\pagenumbering{arabic}

\glslink{gls:set}{Sets} 
are denoted by a caligraphic font 
e.g.\ \gls{not:set}.

Let \gls[format=hyperit]{not:U} denote the universal set.

The \gls{gls:card} of a set $\mathcal{S}$ is denoted 
\gls{not:card}.

\chapter{Another Chapter}

Another mention of the universal set \gls{not:U}.

The factorial symbol: \gls{not:fact}.

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleNtn.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleSec.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{report}

\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage[style=altlist,toc,counter=section]{glossaries}

\makeglossaries

\newglossaryentry{ident}{name=identity matrix,
description=diagonal matrix with 1s along the leading diagonal,
plural=identity matrices}

\newglossaryentry{diag}{name=diagonal matrix,
description=matrix whose only non-zero entries are along
the leading diagonal,
plural=diagonal matrices}

\newglossaryentry{sing}{name=singular matrix,
description=matrix with zero determinant,
plural=singular matrices}

\begin{document}

\pagenumbering{roman}
\tableofcontents

\printglossaries

\chapter{Introduction}
\pagenumbering{arabic}
This is a sample document illustrating the use of the
\textsf{glossaries} package.

\chapter{Diagonal matrices}

A \gls[format=hyperit]{diag} 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 \gls[format=hyperit]{ident} is a \gls{diag} whose leading
diagonal elements are all equal to 1.

Here is another entry for a \gls{diag}. And this is the
plural: \glspl{ident}.

This adds an entry into the glossary with a bold number, but
it doesn't create a hyperlink: \gls*[format=hyperbf]{ident}.

\chapter{Singular Matrices}

A \gls{sing} is a matrix with zero determinant.
\Glspl{sing} are non-invertible. Possessive:
a \gls{sing}['s] dimensions are not necessarily equal.

Another \gls{ident} entry.

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleSec.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampletree.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[style=alttreehypergroup,nolong,nosuper]{glossaries}

 % The alttree type of glossary styles need to know the
 % widest entry name for each level
\glssetwidest{Roman letters} % level 0 widest name
\glssetwidest[1]{Sigma}      % level 1 widest name

\makeglossaries

\newglossaryentry{greekletter}{name={Greek letters},
text={Greek letter},
description={\nopostdesc}}

\newglossaryentry{sigma}{name={Sigma},
text={\ensuremath{\Sigma}},
first={\ensuremath{\Sigma} (uppercase sigma)},
symbol={\ensuremath{\Sigma}},
description={Used to indicate summation},
parent=greekletter}

\newglossaryentry{pi}{name={pi},
text={\ensuremath{\pi}},
first={\ensuremath{\pi} (lowercase pi)},
symbol={\ensuremath{\pi}},
description={Transcendental number},
parent=greekletter}

\newglossaryentry{romanletter}{name={Roman letters},
text={Roman letter},
description={\nopostdesc}}

\newglossaryentry{e}{name={e},
description={Unique real number such that the derivative of
the function $e^x$ is the function itself},
parent=romanletter}

\newglossaryentry{C}{name={C},
description={Euler's constant},
parent=romanletter}

\begin{document}
This is a sample document illustrating hierarchical glossary
entries.

\chapter{Greek Letters Used in Mathematics}

Some information about \glspl{greekletter}.
The letter \gls{pi} is used to represent the ratio of a circle's
circumference to its diameter.
The letter \gls{sigma} is used to represent summation.

\chapter{Roman Letters Used in Mathematics}

Some information about \glspl{romanletter}.
The letter \gls{e} is the unique real number such that
the derivative of the function $e^x$ is the function itself.
The letter \gls{C} represents Euler's constant.

\printglossaries

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampletree.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleutf8.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[xindy,nonumberlist,style=listgroup]{glossaries}

\makeglossaries

% Note that because the é is the first letter of the
% name, it needs to be grouped or it will cause a
% problem for \makefirstuc due to expansion issues.
\newglossaryentry{elite}{name={{é}lite},
description={select group or class}}

\newglossaryentry{elephant}{name=elephant,
description={large animal with trunk and tusks}}

\newglossaryentry{elk}{name=elk,
description=large deer}

\newglossaryentry{mannerly}{name=mannerly,
description=polite}

% The œ is not the first letter, so it doesn't need to
% be grouped.
\newglossaryentry{manoeuvre}{name={manœuvre},
description=planned and controlled movement}

\newglossaryentry{manor}{name=manor,
description=large landed estate or its house}

\newglossaryentry{odometer}{name=odometer,
description=instrument for measuring distance travelled by
a wheeled vehicle}

\newglossaryentry{oesophagus}{name={{œ}sophagus},
description={canal from mouth to stomach}}

\newglossaryentry{ogre}{name=ogre,
description=man-eating giant}

\begin{document}
\null % ensure that the first run produces some output
\glsaddall

\printglossaries

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleutf8.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*samplexdy.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % This is a sample document illustrating how to use the
 % glossaries package with xindy. To create the document:
 %
 %   latex samplexdy
 %   makeglossaries samplexdy
 %   latex samplexdy
 %
 % If you don't have Perl installed, then use one of the
 % following instead of makeglossaries:
 %
 % If you want to have a separate "Mc" letter group do:
 %
 %    xindy -I xindy -M samplexdy-mc -t samplexdy.glg -o samplexdy.gls samplexdy.glo
 %
 % Otherwise do:
 %
 %  xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg -o samplexdy.gls samplexdy.glo
 % 
\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fmtcount}

 % remove redefinition of \thepage below if you want to uncomment
 % the following line:
 % \usepackage[colorlinks]{hyperref}

\usepackage[xindy,style=altlistgroup]{glossaries}

 % Define a new command to do bold italic (it uses \hyperbf
 % rather than \textbf in case I later introduce hyperlinks
 % - although I would have to remove the fancy page numbering
 % if I wanted to do that):

\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}}

 % Need to add this to the list of attributes in order
 % to use it with xindy:
 % (This command will have no effect if \noist is used)

\GlsAddXdyAttribute{hyperbfit}

 % Redefine the page numbers so that they appear as a word:

 \renewcommand*{\thepage}{\Numberstring{page}}

 % Need to add this to the list of location styles.
 % \Numberstring{page} gets expanded to
 % \protect \Numberstringnum {<n>} (where <n> is the page number)
 % so need to define the location in that format:
 % (This command will have no effect if \noist is used)

\GlsAddXdyLocation{Numberstring}{:sep "\string\protect\space
  \string\Numberstringnum\space\glsopenbrace" 
  "arabic-numbers" :sep "\glsclosebrace"}

 % To have Mc as a separate group uncomment the following three
 % lines:

 %\setStyleFile{samplexdy-mc} % note no extension
 %\noist
 %\GlsSetXdyLanguage{}

 % The above three lines specify to use samplexdy-mc.xdy (supplied
 % with this file) and don't overwrite it. The language is
 % unset using \GlsSetXdyLanguage{} as all the language 
 % dependent information is contained in samplexdy-mc.xdy
 % Note that using \noist means that commands like
 % \GlsAddXdyAttribute and \GlsAddXdyLocation will no longer have
 % an effect.

 % Write the style file (if \noist isn't used)
 % and activate glossary entries

\makeglossaries

 % Define glossary entries
 % \glshyperlink is used instead of \gls to prevent the glossary
 % page numbers also appear in the locations, however I need
 % to ensure that the referenced entries are added to the 
 % glossary via commands that use \glslink, \glsadd or \glssee

\newglossaryentry{mcadam}{name={McAdam, John Loudon},
first={John Loudon McAdam},text={McAdam},
description={Scottish engineer}}

\newglossaryentry{maclaurin}{name={Maclaurin, Colin},
first={Colin Maclaurin},text={Maclaurin},
description={Scottish mathematician best known for the
\gls{maclaurinseries}}}

\newglossaryentry{maclaurinseries}{name={Maclaurin series},
description={Series expansion},see={taylorstheorem}}

\newglossaryentry{taylorstheorem}{name={Taylor's theorem},
description={Theorem expressing a function $f(x)$ as the sum of
a polynomial and a remainder:
\[f(x) = f(a)+f'(a)(x-a)+f''(a)(x-a^2)/2!+\cdots+R_n\]
If $n\to\infty$ the expansion is a \glshyperlink{taylorseries}
and if $a=0$, the series is called a 
\gls{maclaurinseries}}}

\newglossaryentry{taylorseries}{name={Taylor series},
description={Series expansion},see={taylorstheorem}}

\newglossaryentry{taylor}{name={Taylor, Brook},
first={Brook Taylor},text={Taylor},
description={English mathematician}}

\newglossaryentry{mcnemar}{name={McNemar, Quinn},
first={Quinn McNemar},text={McNemar},
description={Mathematician who introduced 
\gls{mcnemarstest}. This entry has the number list
suppressed},nonumberlist}

\newglossaryentry{mcnemarstest}{name={McNemar's test},
description={A nonparametric test introduced by
\gls{mcnemar} in 1947}}

\newglossaryentry{mach}{name={Mach, Ernst},
first={Ernst Mach},text={Mach},
 % if using samplexdy-mc.xdy, the following line is needed
 % to prevent this entry being put in the "Mc" group
sort={mach, Ernst},
description={Czech/Austrian physicist and philosopher}}

\newglossaryentry{machnumber}{name={Mach number},
 % if using samplexdy-mc.xdy, the following line is needed
 % to prevent this entry being put in the "Mc" group
sort={mach number},
description={Ratio of the speed of a body in a fluid to the
speed of sound in that fluid named after \gls{mach}}}

\newglossaryentry{malthus}{name={Malthus, Thomas Robert},
first={Thomas Robert Malthus},text={Malthus},
description={English mathematician, sociologist and classicist}}

\newglossaryentry{ampereandre}{name={Ampère, André-Marie},
first={André-Marie Ampère},text={Ampère},
description={French mathematician and physicist}}

\newglossaryentry{ampere}{name={ampere},
description={SI unit of electric current named after
\gls{ampereandre}}}

\newglossaryentry{archimedes}{name={Archimedes of Syracuse},
first={Archimedes of Syracuse},text={Archimedes},
description={Greek mathematician}}

\newglossaryentry{archimedesprinciple}{name={Archemedes' principle},
description={Principle that if a body is submerged in a fluid
it experiences upthrust equal to the weight of the displaced
fluid. Named after \gls{archimedes}}}

\newglossaryentry{galton}{name={Galton, Sir Francis},
first={Sir Francis Galton},text={Galton},
description={English anthropologist}}

\newglossaryentry{gauss}{name={Gauss, Karl Friedrich},
first={Karl Friedrich Gauss},text={Gauss},
description={German mathematician}}

\newglossaryentry{gaussianint}{name={Gaussian integer},
description={Complex number where both real and imaginary
parts are integers}}

\newglossaryentry{peano}{name={Peano, Giuseppe},
first={Giuseppe Peano},text={Peano},
description={Italian mathematician}}

\newglossaryentry{peanoscurve}{name={Peano's curve},
description={A space-filling curve discovered by 
\gls{peano}}}

\newglossaryentry{pearson}{name={Pearson, Karl},
first={Karl Pearson},text={Pearson},
description={English mathematician}}

\newglossaryentry{pearspmcc}{name={Pearson's product moment
correlation coefficient},description={Product moment correlation
coefficient named after \gls{pearson}}}

\begin{document}
\title{Sample Document Using the Glossaries Package With Xindy}
\author{Nicola Talbot}
\maketitle

\section{\glsentryfirst{gauss}}

This is a section on \gls[format=(]{gauss}. This section spans
several pages.

\newpage

This page talks about \glspl[format=hyperbfit]{gaussianint}. Since
it's the principle definition, the user-defined hyperbfit format is 
used.

\newpage

The section on \gls[format=)]{gauss} ends here.

\section{Series Expansions}

This section is about series expansions. It mentions
\gls{maclaurin} and \gls{taylor}. It also discusses 
\gls{taylorstheorem} which is related to the \gls{taylorseries}.
The \gls{maclaurinseries} is a special case of the
\gls{taylorseries}.

\section{\glsentryname{archimedesprinciple}}

This section discusses \gls{archimedesprinciple} which was
introduced by \gls{archimedes}.

\section{Another section}

This section covers \gls{mach} who introduced the \gls{machnumber}.
It also mentions \gls{ampereandre} after whom the
SI unit \gls{ampere} is named. It then discusses \gls{galton}
and \gls{malthus}. Finally it mentions \gls{mcadam}.

\newpage
This page discusses \gls{mcnemar} who introduced
\gls{mcnemarstest} and \gls{peano} who discovered \gls{peanoscurve}.

\printglossaries
\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</samplexdy.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*samplexdy-mc.xdy>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
;; xindy style file for samplexdy.tex that has Mc letter group

(define-letter-group "A" :prefixes ("€"))
(define-letter-group "B" :after "A" :prefixes ("„"))
(define-letter-group "C" :after "B" :prefixes ("†"))
(define-letter-group "D" :after "C" :prefixes (""))
(define-letter-group "E" :after "D" :prefixes ("—"))
(define-letter-group "F" :after "E" :prefixes ("œ"))
(define-letter-group "G" :after "F" :prefixes (""))
(define-letter-group "H" :after "G" :prefixes ("¤"))
(define-letter-group "I" :after "H" :prefixes ("¨"))
(define-letter-group "J" :after "I" :prefixes ("¬"))
(define-letter-group "K" :after "J" :prefixes ("®"))
(define-letter-group "L" :after "K" :prefixes ("´"))
(define-letter-group "Mc" :after "L" :prefixes ("Ƞ"))
(define-letter-group "M" :after "Mc" :prefixes ("»"))
(define-letter-group "N" :after "M" :prefixes ("¼"))
(define-letter-group "O" :after "N" :prefixes ("Ã"))
(define-letter-group "P" :after "O" :prefixes ("È"))
(define-letter-group "Q" :after "P" :prefixes ("Ê"))
(define-letter-group "R" :after "Q" :prefixes ("Ë"))
(define-letter-group "S" :after "R" :prefixes ("Ð"))
(define-letter-group "T" :after "S" :prefixes ("Ú"))
(define-letter-group "U" :after "T" :prefixes ("à"))
(define-letter-group "V" :after "U" :prefixes ("å"))
(define-letter-group "W" :after "V" :prefixes ("æ"))
(define-letter-group "X" :after "W" :prefixes ("ë"))
(define-letter-group "Y" :after "X" :prefixes ("í"))
(define-letter-group "Ȝ" :after "Y" :prefixes ("ï"))
(define-letter-group "Z" :after "Ȝ" :prefixes ("ð"))
(define-letter-group "Þ" :after "Z" :prefixes ("ö"))
(define-letter-group "Æ¿" :after "Þ" :prefixes ("÷"))

(define-rule-set "en-alphabetize"

  :rules  (("à" "€" :string)
           ("À" "€" :string)
           ("Æ" "€—" :string)
           ("æ" "€—" :string)
           ("Ç" "†" :string)
           ("ç" "†" :string)
           ("ð" "" :string)
           ("Ð" "" :string)
           ("É" "—" :string)
           ("Ê" "—" :string)
           ("È" "—" :string)
           ("Ë" "—" :string)
           ("è" "—" :string)
           ("ë" "—" :string)
           ("ê" "—" :string)
           ("é" "—" :string)
           ("Ï" "¨" :string)
           ("ï" "¨" :string)
           ("Ñ" "¼" :string)
           ("ñ" "¼" :string)
           ("Ö" "Ã" :string)
           ("Ô" "Ã" :string)
           ("ô" "Ã" :string)
           ("ö" "Ã" :string)
           ("œ" "×" :string)
           ("Œ" "×" :string)
           ("ȝ" "ï" :string)
           ("Ȝ" "ï" :string)
           ("þ" "ö" :string)
           ("Þ" "ö" :string)
           ("Ç·" "÷" :string)
           ("Æ¿" "÷" :string)
           ("a" "€" :string)
           ("A" "€" :string)
           ("b" "„" :string)
           ("B" "„" :string)
           ("C" "†" :string)
           ("c" "†" :string)
           ("d" "" :string)
           ("D" "" :string)
           ("E" "—" :string)
           ("e" "—" :string)
           ("F" "œ" :string)
           ("f" "œ" :string)
           ("g" "" :string)
           ("G" "" :string)
           ("H" "¤" :string)
           ("h" "¤" :string)
           ("I" "¨" :string)
           ("i" "¨" :string)
           ("J" "¬" :string)
           ("j" "¬" :string)
           ("K" "®" :string)
           ("k" "®" :string)
           ("L" "´" :string)
           ("l" "´" :string)
           ("Mc" "Ƞ" :string)
           ("Mac" "Ƞ" :string)
           ("M" "»" :string)
           ("m" "»" :string)
           ("N" "¼" :string)
           ("n" "¼" :string)
           ("O" "Ã" :string)
           ("o" "Ã" :string)
           ("P" "È" :string)
           ("p" "È" :string)
           ("q" "Ê" :string)
           ("Q" "Ê" :string)
           ("r" "Ë" :string)
           ("R" "Ë" :string)
           ("S" "Ð" :string)
           ("s" "Ð" :string)
           ("T" "Ú" :string)
           ("t" "Ú" :string)
           ("u" "à" :string)
           ("U" "à" :string)
           ("v" "å" :string)
           ("V" "å" :string)
           ("w" "æ" :string)
           ("W" "æ" :string)
           ("X" "ë" :string)
           ("x" "ë" :string)
           ("Y" "í" :string)
           ("y" "í" :string)
           ("z" "ð" :string)
           ("Z" "ð" :string)
           ))

(define-rule-set "en-resolve-diacritics"

  :rules  (("ȝ" "¢" :string)
           ("þ" "¢" :string)
           ("Ç·" "¢" :string)
           ("Þ" "¢" :string)
           ("Ȝ" "¢" :string)
           ("Æ¿" "¢" :string)
           ("Ö" "£" :string)
           ("Ñ" "£" :string)
           ("ð" "£" :string)
           ("Ç" "£" :string)
           ("É" "£" :string)
           ("Ï" "£" :string)
           ("ï" "£" :string)
           ("ö" "£" :string)
           ("ñ" "£" :string)
           ("ç" "£" :string)
           ("à" "£" :string)
           ("À" "£" :string)
           ("é" "£" :string)
           ("Ð" "£" :string)
           ("Ô" "¤" :string)
           ("ô" "¤" :string)
           ("È" "¤" :string)
           ("è" "¤" :string)
           ("Ë" "¥" :string)
           ("ë" "¥" :string)
           ("Ê" "¦" :string)
           ("ê" "¦" :string)
           ("œ" "ÿ" :string)
           ("Æ" "ÿ" :string)
           ("Œ" "ÿ" :string)
           ("æ" "ÿ" :string)
           ("S" "¢" :string)
           ("K" "¢" :string)
           ("d" "¢" :string)
           ("Y" "¢" :string)
           ("E" "¢" :string)
           ("y" "¢" :string)
           ("g" "¢" :string)
           ("e" "¢" :string)
           ("J" "¢" :string)
           ("q" "¢" :string)
           ("D" "¢" :string)
           ("b" "¢" :string)
           ("z" "¢" :string)
           ("w" "¢" :string)
           ("Q" "¢" :string)
           ("M" "¢" :string)
           ("C" "¢" :string)
           ("L" "¢" :string)
           ("X" "¢" :string)
           ("P" "¢" :string)
           ("T" "¢" :string)
           ("a" "¢" :string)
           ("N" "¢" :string)
           ("j" "¢" :string)
           ("Z" "¢" :string)
           ("u" "¢" :string)
           ("k" "¢" :string)
           ("t" "¢" :string)
           ("W" "¢" :string)
           ("v" "¢" :string)
           ("s" "¢" :string)
           ("B" "¢" :string)
           ("H" "¢" :string)
           ("c" "¢" :string)
           ("I" "¢" :string)
           ("G" "¢" :string)
           ("U" "¢" :string)
           ("F" "¢" :string)
           ("r" "¢" :string)
           ("x" "¢" :string)
           ("V" "¢" :string)
           ("h" "¢" :string)
           ("f" "¢" :string)
           ("i" "¢" :string)
           ("A" "¢" :string)
           ("O" "¢" :string)
           ("n" "¢" :string)
           ("m" "¢" :string)
           ("l" "¢" :string)
           ("p" "¢" :string)
           ("R" "¢" :string)
           ("o" "¢" :string)
           ))

(define-rule-set "en-resolve-case"

  :rules  (("Ö" "8" :string)
           ("Ñ" "8" :string)
           ("Ô" "8" :string)
           ("Ç" "8" :string)
           ("É" "8" :string)
           ("Ï" "8" :string)
           ("Ê" "8" :string)
           ("È" "8" :string)
           ("Ë" "8" :string)
           ("Ç·" "8" :string)
           ("À" "8" :string)
           ("Þ" "8" :string)
           ("Ȝ" "8" :string)
           ("Ð" "8" :string)
           ("Æ" "89" :string)
           ("Œ" "89" :string)
           ("ð" "9" :string)
           ("ô" "9" :string)
           ("ȝ" "9" :string)
           ("ï" "9" :string)
           ("ö" "9" :string)
           ("ñ" "9" :string)
           ("ç" "9" :string)
           ("à" "9" :string)
           ("þ" "9" :string)
           ("è" "9" :string)
           ("ë" "9" :string)
           ("ê" "9" :string)
           ("é" "9" :string)
           ("Æ¿" "9" :string)
           ("œ" "99" :string)
           ("æ" "99" :string)
           ("S" "8" :string)
           ("K" "8" :string)
           ("Y" "8" :string)
           ("E" "8" :string)
           ("J" "8" :string)
           ("D" "8" :string)
           ("Q" "8" :string)
           ("M" "8" :string)
           ("C" "8" :string)
           ("L" "8" :string)
           ("X" "8" :string)
           ("P" "8" :string)
           ("T" "8" :string)
           ("N" "8" :string)
           ("Z" "8" :string)
           ("W" "8" :string)
           ("B" "8" :string)
           ("H" "8" :string)
           ("I" "8" :string)
           ("G" "8" :string)
           ("U" "8" :string)
           ("F" "8" :string)
           ("V" "8" :string)
           ("A" "8" :string)
           ("O" "8" :string)
           ("R" "8" :string)
           ("d" "9" :string)
           ("y" "9" :string)
           ("g" "9" :string)
           ("e" "9" :string)
           ("q" "9" :string)
           ("b" "9" :string)
           ("z" "9" :string)
           ("w" "9" :string)
           ("a" "9" :string)
           ("j" "9" :string)
           ("u" "9" :string)
           ("k" "9" :string)
           ("t" "9" :string)
           ("v" "9" :string)
           ("s" "9" :string)
           ("c" "9" :string)
           ("r" "9" :string)
           ("x" "9" :string)
           ("h" "9" :string)
           ("f" "9" :string)
           ("i" "9" :string)
           ("n" "9" :string)
           ("m" "9" :string)
           ("l" "9" :string)
           ("p" "9" :string)
           ("o" "9" :string)
           ))

(define-rule-set "en-ignore-special"

  :rules  (("-" "" :string)
           ("!" "" :string)
           ("{" "" :string)
           ("'" "" :string)
           ("}" "" :string)
           ("?" "" :string)
           ("." "" :string)
           ))

(define-rule-set "en-resolve-special"

  :rules  (("Ö" "¤" :string)
           ("Ñ" "¤" :string)
           ("ð" "¤" :string)
           ("Ô" "¤" :string)
           ("Ç" "¤" :string)
           ("É" "¤" :string)
           ("ô" "¤" :string)
           ("Ï" "¤" :string)
           ("ȝ" "¤" :string)
           ("ï" "¤" :string)
           ("Ê" "¤" :string)
           ("ö" "¤" :string)
           ("ñ" "¤" :string)
           ("È" "¤" :string)
           ("ç" "¤" :string)
           ("Ë" "¤" :string)
           ("à" "¤" :string)
           ("þ" "¤" :string)
           ("Ç·" "¤" :string)
           ("è" "¤" :string)
           ("À" "¤" :string)
           ("ë" "¤" :string)
           ("Þ" "¤" :string)
           ("ê" "¤" :string)
           ("é" "¤" :string)
           ("Ȝ" "¤" :string)
           ("Æ¿" "¤" :string)
           ("Ð" "¤" :string)
           ("œ" "¤¤" :string)
           ("Æ" "¤¤" :string)
           ("Œ" "¤¤" :string)
           ("æ" "¤¤" :string)
           ("?" "¡" :string)
           ("!" "¢" :string)
           ("." "£" :string)
           ("S" "¤" :string)
           ("K" "¤" :string)
           ("d" "¤" :string)
           ("Y" "¤" :string)
           ("E" "¤" :string)
           ("y" "¤" :string)
           ("g" "¤" :string)
           ("e" "¤" :string)
           ("J" "¤" :string)
           ("q" "¤" :string)
           ("D" "¤" :string)
           ("b" "¤" :string)
           ("z" "¤" :string)
           ("w" "¤" :string)
           ("Q" "¤" :string)
           ("M" "¤" :string)
           ("C" "¤" :string)
           ("L" "¤" :string)
           ("X" "¤" :string)
           ("P" "¤" :string)
           ("T" "¤" :string)
           ("a" "¤" :string)
           ("N" "¤" :string)
           ("j" "¤" :string)
           ("Z" "¤" :string)
           ("u" "¤" :string)
           ("k" "¤" :string)
           ("t" "¤" :string)
           ("W" "¤" :string)
           ("v" "¤" :string)
           ("s" "¤" :string)
           ("B" "¤" :string)
           ("H" "¤" :string)
           ("c" "¤" :string)
           ("I" "¤" :string)
           ("G" "¤" :string)
           ("U" "¤" :string)
           ("F" "¤" :string)
           ("r" "¤" :string)
           ("x" "¤" :string)
           ("V" "¤" :string)
           ("h" "¤" :string)
           ("f" "¤" :string)
           ("i" "¤" :string)
           ("A" "¤" :string)
           ("O" "¤" :string)
           ("n" "¤" :string)
           ("m" "¤" :string)
           ("l" "¤" :string)
           ("p" "¤" :string)
           ("R" "¤" :string)
           ("o" "¤" :string)
           ("-" "¥" :string)
           ("'" "¦" :string)
           ("{" "§" :string)
           ("}" "¨" :string)
           ))

; The following section is customised for samplexdy.tex
; (copied from samplexdy.xdy automatically generated by
; samplexdy.tex)

; required styles

(require "tex.xdy")

; list of allowed attributes (number formats)

(define-attributes (("default"
 "glsnumberformat"
 "textrm"
 "textsf"
 "texttt"
 "textbf"
 "textmd"
 "textit"
 "textup"
 "textsl"
 "textsc"
 "emph"
 "glshypernumber"
 "hyperrm"
 "hypersf"
 "hypertt"
 "hyperbf"
 "hypermd"
 "hyperit"
 "hyperup"
 "hypersl"
 "hypersc"
 "hyperemph"
 "hyperbfit")))

; user defined alphabets



; location class definitions

(define-location-class "roman-page-numbers"
   ("roman-numbers-lowercase"))
(define-location-class "Roman-page-numbers"
   ("roman-numbers-uppercase"))
(define-location-class "arabic-page-numbers"
   ("arabic-numbers"))
(define-location-class "alpha-page-numbers"
   ("alpha"))
(define-location-class "Alpha-page-numbers"
   ("ALPHA"))
(define-location-class "Appendix-page-numbers"
   ("ALPHA" :sep "." "arabic-numbers"))
(define-location-class "arabic-section-numbers"
   ("arabic-numbers" :sep "." "arabic-numbers"))

; user defined location classes

(define-location-class "Numberstring"
   (:sep "\protect \Numberstringnum {" "arabic-numbers" :sep "}")) 

; define cross-reference class

(define-crossref-class "see" :unverified )
(markup-crossref-list :class "see"
   :open "\glsseeformat" :close "{}")

; define the order of the location classes
(define-location-class-order (
   "roman-page-numbers"
   "arabic-page-numbers"
   "arabic-section-numbers"
   "alpha-page-numbers"
   "Roman-page-numbers"
   "Alpha-page-numbers"
   "Appendix-page-numbers" 
   "see" ))

; define the glossary markup

(markup-index
   :open "\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble~n\begin{theglossary}\glossaryheader~n" 
   :close "~n\end{theglossary}~n\glossarypostamble~n" 
   :tree)
(markup-letter-group-list :sep "\glsgroupskip~n")
(markup-indexentry :open "~n" :depth 0)
(markup-locclass-list :open "{\glossaryentrynumbers{\relax "
   :sep ", " :close "}}")
(markup-locref-list :sep "\delimN ")
(markup-range :sep "\delimR ")

; define format to use for locations


(markup-locref :open "~n\setentrycounter{page}\glsnumberformat{" 
 :close "}" 
 :attr "glsnumberformat")
(markup-locref :open "~n\setentrycounter{page}\textrm{" 
 :close "}" 
 :attr "textrm")
(markup-locref :open "~n\setentrycounter{page}\textsf{" 
 :close "}" 
 :attr "textsf")
(markup-locref :open "~n\setentrycounter{page}\texttt{" 
 :close "}" 
 :attr "texttt")
(markup-locref :open "~n\setentrycounter{page}\textbf{" 
 :close "}" 
 :attr "textbf")
(markup-locref :open "~n\setentrycounter{page}\textmd{" 
 :close "}" 
 :attr "textmd")
(markup-locref :open "~n\setentrycounter{page}\textit{" 
 :close "}" 
 :attr "textit")
(markup-locref :open "~n\setentrycounter{page}\textup{" 
 :close "}" 
 :attr "textup")
(markup-locref :open "~n\setentrycounter{page}\textsl{" 
 :close "}" 
 :attr "textsl")
(markup-locref :open "~n\setentrycounter{page}\textsc{" 
 :close "}" 
 :attr "textsc")
(markup-locref :open "~n\setentrycounter{page}\emph{" 
 :close "}" 
 :attr "emph")
(markup-locref :open "~n\setentrycounter{page}\glshypernumber{" 
 :close "}" 
 :attr "glshypernumber")
(markup-locref :open "~n\setentrycounter{page}\hyperrm{" 
 :close "}" 
 :attr "hyperrm")
(markup-locref :open "~n\setentrycounter{page}\hypersf{" 
 :close "}" 
 :attr "hypersf")
(markup-locref :open "~n\setentrycounter{page}\hypertt{" 
 :close "}" 
 :attr "hypertt")
(markup-locref :open "~n\setentrycounter{page}\hyperbf{" 
 :close "}" 
 :attr "hyperbf")
(markup-locref :open "~n\setentrycounter{page}\hypermd{" 
 :close "}" 
 :attr "hypermd")
(markup-locref :open "~n\setentrycounter{page}\hyperit{" 
 :close "}" 
 :attr "hyperit")
(markup-locref :open "~n\setentrycounter{page}\hyperup{" 
 :close "}" 
 :attr "hyperup")
(markup-locref :open "~n\setentrycounter{page}\hypersl{" 
 :close "}" 
 :attr "hypersl")
(markup-locref :open "~n\setentrycounter{page}\hypersc{" 
 :close "}" 
 :attr "hypersc")
(markup-locref :open "~n\setentrycounter{page}\hyperemph{" 
 :close "}" 
 :attr "hyperemph")
(markup-locref :open "~n\setentrycounter{page}\hyperbfit{" 
 :close "}" 
 :attr "hyperbfit")

; define letter group list format

(markup-letter-group-list :sep "\glsgroupskip~n")

; letter group headings

(markup-letter-group :open-head "\glsgroupheading{"
   :close-head "}")

(define-letter-group "glsnumbers"
   :prefixes ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
   :before "A")

; The following is copied from xindy/lang/english/utf8-lang.xdy

(define-sort-rule-orientations (forward backward forward forward))
(use-rule-set :run 0
	      :rule-set ("en-alphabetize" "en-ignore-special"))
(use-rule-set :run 1
	      :rule-set ("en-resolve-diacritics" "en-ignore-special"))
(use-rule-set :run 2
	      :rule-set ("en-resolve-case" "en-ignore-special"))
(use-rule-set :run 3
	      :rule-set ("en-resolve-special"))

%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</samplexdy-mc.xdy>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*database1.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % This is a sample database of glossary entries
 % Only those entries used in the document with \glslink, \gls,
 % \glspl, and uppercase variants will have entries in the
 % glossary. Note that the type key is not used, as the
 % glossary type can be specified in \loadglsentries

\newglossaryentry{array}{name=array,
description={A list of values identified by a numeric value}}

\newglossaryentry{binary}{name=binary,
description={Pertaining to numbers represented in base 2}}

\newglossaryentry{comment}{name=comment,
description={A remark that doesn't affect the meaning of the 
code}}

\newglossaryentry{global}{name=global,
description={Something that maintains its state when it leaves
the current group}}

\newglossaryentry{local}{name=local,
description={Something that only maintains its state until
it leaves the group in which it was defined/changed}}

%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</database1.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*database2.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % This is a sample database of glossary entries
 % Only those entries used in the document with \glslink, \gls,
 % \glspl, and uppercase variants will have entries in the
 % glossary. Note that the type key is not used, as the
 % glossary type can be specified in \loadglsentries

 % Don't need to worry about makeindex special characters
\newglossaryentry{quote}{name={"},
description={the double quote symbol}}

\newglossaryentry{at}{name={@},
description={the ``at'' symbol}}

\newglossaryentry{excl}{name={!},
description={the exclamation mark symbol}}

\newglossaryentry{bar}{name={$|$},
description={the vertical bar symbol}}

\newglossaryentry{hash}{name={\#},
description={the hash symbol}}

%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</database2.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries.perl>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
# File          : glossaries.perl
# Author        : Nicola L.C. Talbot
# Date          : 14th June 2007
# Last Modified : 25th July 2008
# Version       : 1.04
# Description   : LaTeX2HTML (limited!) implementation of glossaries 
#                  package. Note that not all the glossaries.sty
#                  macros have been implemented.

# This is a LaTeX2HTML style implementing the glossaries package, and
# is distributed as part of that package.
# Copyright 2007 Nicola L.C. Talbot
# This work may be distributed and/or modified under the
# conditions of the LaTeX Project Public License, either version 1.3
# of this license of (at your option) any later version.
# The latest version of this license is in
#   http://www.latex-project.org/lppl.txt
# and version 1.3 or later is part of all distributions of LaTeX
# version 2005/12/01 or later.
#
# This work has the LPPL maintenance status `maintained'.
#
# The Current Maintainer of this work is Nicola Talbot.

# This work consists of the files glossaries.dtx and glossaries.ins 
# and the derived files glossaries.sty, glossary-hypernav.sty, 
# glossary-list.sty, glossary-long.sty, glossary-super.sty, 
# glossaries.perl. Also makeglossaries and makeglossaries.bat


package main;

# These are the only package options implemented.

sub do_glossaries_style_altlist{
}

sub do_glossaries_toc{
}

sub do_glossaries_toc_true{
}

$GLSCURRENTFORMAT="textrm" if (!defined($GLSCURRENTFORMAT));
$GLOSSARY_END_DESCRIPTION = '. ' if (!defined($GLOSSARY_END_DESCRIPTION));

sub do_cmd_glossaryname{
   "Glossary$_[0]"
}

$gls_mark{'main'} = "<tex2html_gls_main_mark>";
$gls_file_mark{'main'} = "<tex2html_gls_main_file_mark>";
$gls_title{'main'} = "\\glossaryname";
$delimN{'main'} = ", ";
$glsnumformat{'main'} = $GLSCURRENTFORMAT;
@{$gls_entries{'main'}} = ();
$gls_displayfirst{'main'} = "glsdisplayfirst";
$gls_display{'main'} = "glsdisplay";

 %glsentry = ();

$acronymtype = 'main';

sub do_glossaries_acronym{
   &do_glossaries_acronym_true
}

sub do_glossaries_acronym_true{
   &make_newglossarytype("acronym", "\\acronymname");
   $acronymtype = 'acronym';
}

sub do_glossary_acronym_false{
   $acronymtype = 'main';
}

sub do_cmd_acronymname{
   join('', 'Acronyms', $_[0]);
}

sub do_cmd_acronymtype{
   join('', $acronymtype, $_[0]);
}

# modify set_depth_levels so that glossary is added

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 glossary '$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);

      local($entry) = $glossary_entry{$type}{$key};

      $id = ++$global{'max_id'};
      local($name) = &translate_commands(
         "\\glsnamefont $OP$id$CP$glsentry{$entry}{name}$OP$id$CP");

      local($symbol) = ($glsentry{$entry}{'symbol'} ?
                     " $glsentry{$entry}{symbol}" : '');

      $glossary .=
      # If it's the same string don't start a new line
         (&index_key_eq($current, $previous) ?
               $delimN
               . $glossary{$type}{$key}
               . $linktext
               . "</A>"
            : "<DT>"
                   . "<A NAME=\"gls:$entry\">$name</A>"
                   . "<DD>"
                   . $glsentry{$entry}{'description'} 
                   . $symbol . $GLOSSARY_END_DESCRIPTION
                   . $glossary{$type}{$key}
         . $linktext. "</A>");
      $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
, 'textohtmlglossaries', $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);
}

sub add_gls_dummy_commands{
   s/[\\]printglossary/\\textohtmlglossary/sg;
   s/[\\]printglossaries/\\textohtmlglossaries/sg;
}

sub get_firstkeyval{
   local($key,$_) = @_;
   local($value);

   s/\b$key\s*=$OP(\d+)$CP(.*)$OP\1$CP\s*(,|$)/$value=$2;','/es;
   undef($value) if $`=~/\b$key\s*=/;

   unless (defined($value))
   {
      s/(^|,)\s*$key\s*=\s*([^,]*)\s*(,|$)/,/s;
      $value=$2;
   }

   ($value,$_);
}

# need to get the value of the last key of a given name
# in the event of multiple occurences.
sub get_keyval{
   local($key,$_) = @_;
   local($value);

   while (/\b$key\s*=/)
   {
      ($value,$_) = &get_firstkeyval($key, $_);
      last unless defined($value);
   }

   ($value,$_);
}

# This is modified from do_cmd_textohtmlindex

sub do_cmd_textohtmlglossary{
   local($_) = @_;

   local($keyval,$pat) = &get_next_optional_argument;

   local($type,$title,$toctitle,$style);

   ($type,$keyval) = &get_keyval('type', $keyval);
   ($title,$keyval) = &get_keyval('title', $keyval);
   ($toctitle,$keyval) = &get_keyval('toctitle', $keyval);
   ($style,$keyval) = &get_keyval('style', $keyval);

   &make_textohtmlglossary($type,$toctitle,$title,$style).$_;
}

sub make_textohtmlglossary{
   local($type,$toctitle,$title,$style) = @_;

   unless (defined($type)) {$type = 'main';}

   unless (defined $gls_mark{$type})
   {
      &write_warnings("glossary type '$type' not implemented");
   }

   unless (defined($title) and $title) {$title = $gls_title{$type};}
   unless (defined($toctitle) and $toctitle) {$toctitle = $title;}

   $toc_sec_title = $toctitle;
   $glsfile{$type} = $CURRENT_FILE;

   if (defined($frame_main_suffix))
   {
      $glsfile{$type}=~s/$frame_main_suffix/$frame_body_suffix/;
   }

   $TITLE=&translate_commands($toctitle);

   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);
}

sub do_cmd_textohtmlglossaries{
   local($_) = @_;

   foreach $type (keys %gls_mark)
   {
      $id = ++$global{'max_id'};
      $_ = &make_textohtmlglossary($type,$gls_title{'main'}).$_;
   }

   $_;
}

sub make_glossary_labels {
    local($key, @keys);
    @keys = keys %glossary_labels;
    foreach $key (@keys) {
        if (($ref_files{$key}) && !($ref_files{$key} eq "$glsfile{'main'}")) {
            local($tmp) = $ref_files{$key};
            &write_warnings("\nmultiple label $key , target in $glsfile{'main'} masks $tmp ");
        }
        $ref_files{$key} .= $glsfile{'main'};
    }
}

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($type) = "main";
   local($anchor,$entry);

   local($type,$pat) = &get_next_optional_argument;

   $entry = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($entry=$2));

   $anchor = &make_glossary_entry($entry,$anchor_invisible_mark,$type);

   join('', $anchor, $_);
}

sub make_glossary_entry { &make_real_glossary_entry(@_) }
sub make_real_glossary_entry {
    local($entry,$text,$type) = @_;
    local($this_file) = $CURRENT_FILE;

    $TITLE = $saved_title
       if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title)));

    local($sort) = $glsentry{$entry}{'sort'};

    # Save the reference
    local($str) = "$sort###" . ++$global{'max_id'}; # Make unique
    # concatenate multiple spaces into a single space
    # otherwise keys won't sort properly
    $str=~s/\s+/ /gs;

    local($id) = ++$glsentry{$entry}{'maxid'};
    local($glsanchor)="gls:$entry$id";

    local($target) = $frame_body_name;

    if (defined($frame_main_suffix))
    {
       $this_file=~s/$frame_main_suffix/$frame_body_suffix/;
    }

    $glossary{$type}{$str} .= &make_half_href($this_file."#$glsanchor");
    $glossary_format{$type}{$str} = $GLSCURRENTFORMAT;
    $glossary_entry{$type}{$str} = $entry;
    $glossary_linktext{$type}{$str} = $TITLE;

    if (defined($frame_foot_name))
    {
       "<A HREF=$gls_file_mark{$type}#gls:$entry NAME=\"$glsanchor\" TARGET=\"$frame_foot_name\">$text<\/A>";
    }
    else
    {
       "<A HREF=$gls_file_mark{$type}#gls:$entry NAME=\"$glsanchor\">$text<\/A>";
    }
}

sub do_cmd_newglossary{
   local($_) = @_;
   local($type,$out,$in,$opt,$pat,$title);

   ($opt,$pat) = &get_next_optional_argument;

   $type = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($type=$2));
   $in = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($in=$2));
   $out = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($out=$2));
   $title = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($title=$2));

   ($opt,$pat) = &get_next_optional_argument;

   &make_newglossarytype($type, $title);

   $_;
}

sub make_newglossarytype{
   local($type, $title) = @_;

   $gls_mark{$type} = "<tex2html_gls_${type}_mark>";
   $gls_file_mark{$type} = "<tex2html_gls_${type}_file_mark>";
   $gls_title{$type} = $title;
   $delimN{$type} = ", ";
   $glsnumformat{$type} = $GLSCURRENTFORMAT;
   @{$gls_entries{$type}} = ();
   $gls_displayfirst{$type} = "glsdisplayfirst";
   $gls_display{$type} = "glsdisplay";
}

sub do_cmd_glsdisplay{
   local($_) = @_;
   local($text,$description,$symbol,$insert);

   $text = &missing_braces unless
        (s/$next_pair_pr_rx/$text=$2;''/eo);

   $description = &missing_braces unless
        (s/$next_pair_pr_rx/$description=$2;''/eo);

   $symbol = &missing_braces unless
        (s/$next_pair_pr_rx/$symbol=$2;''/eo);

   $insert = &missing_braces unless
        (s/$next_pair_pr_rx/$insert=$2;''/eo);

   "$text$insert" . $_;
}

sub do_cmd_glsdisplayfirst{
   local($_) = @_;
   local($text,$description,$symbol,$insert);

   $text = &missing_braces unless
        (s/$next_pair_pr_rx/$text=$2;''/eo);

   $description = &missing_braces unless
        (s/$next_pair_pr_rx/$description=$2;''/eo);

   $symbol = &missing_braces unless
        (s/$next_pair_pr_rx/$symbol=$2;''/eo);

   $insert = &missing_braces unless
        (s/$next_pair_pr_rx/$insert=$2;''/eo);

   "$text$insert" . $_;
}

sub gls_get_displayfirst{
   local($type) = @_;
   local($display)= $gls_displayfirst{$type};

   if (not defined($display))
   {
      &write_warnings("Glossary '$type' is not defined");
      $display='';
   }
   elsif ($display eq '')
   {
      &write_warnings("glsdisplayfirst not set for glossary '$type'");
   }
   else
   {
      $display = "\\$display ";
   }

   $display;
}

sub gls_get_display{
   local($type) = @_;
   local($display)= $gls_display{$type};

   if (not defined($display))
   {
      &write_warnings("Glossary '$type' is not defined");
      $display = '';
   }
   elsif ($display eq '')
   {
      &write_warnings("glsdisplay not set for glossary '$type'");
   }
   else
   {
      $display = "\\$display ";
   }

   $display;
}

sub do_cmd_glsnamefont{
   local($_) = @_;
   local($text);

   $text = &missing_braces unless
        (s/$next_pair_pr_rx/$text=$2;''/eo);

   "<B>$text</B>$_";
}

sub do_cmd_newacronym{
   local($_) = @_;
   local($label,$abbrev,$long,$opt);

   ($opt,$pat) = &get_next_optional_argument;

   $label = &missing_braces unless
        (s/$next_pair_pr_rx/$label=$2;''/eo);
   $abbrv = &missing_braces unless
        (s/$next_pair_pr_rx/$abbrv=$2;''/eo);
   $long = &missing_braces unless
        (s/$next_pair_pr_rx/$long=$2;''/eo);

   local($cmd) = "\\newglossaryentry";
   local($id);
   $id = ++$global{'max_id'};
   $cmd .= "$OP$id$CP$label$OP$id$CP";
   $id = ++$global{'max_id'};
   local($entry) = "type=$OP$id$CP\\acronymtype$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "name=$OP$id$CP$abbrv$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "description=$OP$id$CP$long$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "text=$OP$id$CP$abbrv$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "first=$OP$id$CP$long ($abbrv)$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "plural=$OP$id$CP${abbrv}s$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "firstplural=$OP$id$CP${long}s (${abbrv}s)$OP$id$CP";

   $id = ++$global{'max_id'};
   $cmd .= "$OP$id$CP$entry,$opt$OP$id$CP";

   &translate_commands($cmd).$_;
}

sub gls_entry_init{
   local($label, $type, $name, $desc) = @_;

   %{$glsentry{$label}} = 
     ( type => $type,
       name => $name,
       'sort' => $name,
       description => $description,
       text => $name,
       first => $name,
       plural => "${name}s",
       firstplural => "${name}s",
       symbol => '',
       flag => 0,
       maxid=>0
     );
}

sub gls_get_type{
   local($label) = @_;
   local($type) = '';

   if (&gls_entry_defined($label))
   {
      $type = $glsentry{$label}{'type'};
   }
   else
   {
      &write_warnings("gls_get_type: glossary entry '$label' has not been defined");
   }

   $type;
}

sub gls_set_type{
   local($label, $type) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'type'} = $type;
   }
   else
   {
      &write_warnings("gls_set_type: glossary entry '$label' has not been defined");
   }
}

sub gls_get_name{
   local($label) = @_;
   local($name) = '';

   if (&gls_entry_defined($label))
   {
      $name = $glsentry{$label}{'name'};
   }
   else
   {
      &write_warnings("gls_get_name: glossary entry '$label' has not been defined");
   }

   $name;
}

sub gls_set_name{
   local($label, $name) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'name'} = $name;
   }
   else
   {
      &write_warnings("gls_set_name: glossary entry '$label' has not been defined");
   }
}

sub gls_get_description{
   local($label) = @_;
   local($description) = '';

   if (&gls_entry_defined($label))
   {
      $description = $glsentry{$label}{'description'};
   }
   else
   {
      &write_warnings("gls_get_description: glossary entry '$label' has not been defined");
   }

   $description;
}

sub gls_set_description{
   local($label, $description) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'description'} = $description;
   }
   else
   {
      &write_warnings("gls_set_description: glossary entry '$label' has not been defined");
   }
}

sub gls_get_symbol{
   local($label) = @_;
   local($symbol) = '';

   if (&gls_entry_defined($label))
   {
      $symbol = $glsentry{$label}{'symbol'};
   }
   else
   {
      &write_warnings("gls_get_symbol: glossary entry '$label' has not been defined");
   }

   $symbol;
}

sub gls_set_symbol{
   local($label, $symbol) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'symbol'} = $symbol;
   }
   else
   {
      &write_warnings("gls_set_symbol: glossary entry '$label' has not been defined");
   }
}

sub gls_get_sort{
   local($label) = @_;
   local($sort) = '';

   if (&gls_entry_defined($label))
   {
      $sort = $glsentry{$label}{'sort'};
   }
   else
   {
      &write_warnings("gls_get_sort: glossary entry '$label' has not been defined");
   }

   $sort;
}

sub gls_set_sort{
   local($label, $sort) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'sort'} = $sort;
   }
   else
   {
      &write_warnings("gls_set_sort: glossary entry '$label' has not been defined");
   }
}

sub gls_get_text{
   local($label) = @_;
   local($text) = '';

   if (&gls_entry_defined($label))
   {
      $text = $glsentry{$label}{'text'};
   }
   else
   {
      &write_warnings("gls_get_text: glossary entry '$label' has not been defined");
   }

   $text;
}

sub gls_set_text{
   local($label, $text) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'text'} = $text;
   }
   else
   {
      &write_warnings("gls_set_text: glossary entry '$label' has not been defined");
   }
}

sub gls_get_plural{
   local($label) = @_;
   local($plural) = '';

   if (&gls_entry_defined($label))
   {
      $plural = $glsentry{$label}{'plural'};
   }
   else
   {
      &write_warnings("gls_get_plural: glossary entry '$label' has not been defined");
   }

   $plural;
}

sub gls_set_plural{
   local($label, $plural) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'plural'} = $plural;
   }
   else
   {
      &write_warnings("gls_set_plural: glossary entry '$label' has not been defined");
   }
}

sub gls_get_firstplural{
   local($label) = @_;
   local($firstplural) = '';

   if (&gls_entry_defined($label))
   {
      $firstplural = $glsentry{$label}{'firstplural'};
   }
   else
   {
      &write_warnings("gls_get_firstplural: glossary entry '$label' has not been defined");
   }

   $firstplural;
}

sub gls_set_firstplural{
   local($label, $firstplural) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'firstplural'} = $firstplural;
   }
   else
   {
      &write_warnings("gls_set_firstplural: glossary entry '$label' has not been defined");
   }
}

sub gls_get_first{
   local($label) = @_;
   local($first) = '';

   if (&gls_entry_defined($label))
   {
      $first = $glsentry{$label}{'first'};
   }
   else
   {
      &write_warnings("gls_get_first: glossary entry '$label' has not been defined");
   }

   $first;
}

sub gls_set_first{
   local($label, $first) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'first'} = $first;
   }
   else
   {
      &write_warnings("gls_set_first: glossary entry '$label' has not been defined");
   }
}

sub gls_used{
   local($label) = @_;
   local($flag) = 0;

   if (&gls_entry_defined($label))
   {
      $flag = $glsentry{$label}{'flag'};
   }
   else
   {
      &write_warnings("gls_used: glossary entry '$label' has not been defined");
   }

   $flag;
}

sub gls_entry_defined{
   local($label) = @_;

   defined(%{$glsentry{$label}});
}

sub do_cmd_newglossaryentry{
   local($_) = @_;
   local($label,$name,$description,$symbol,$sort,$text,$first,
     $plural,$firstplural,$type,$keyval);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   $keyval = &missing_braces unless
              s/$next_pair_pr_rx/$keyval=$2;''/eo;

   ($name,$keyval) = &get_keyval('name', $keyval);
   ($description,$keyval) = &get_keyval('description', $keyval);
   ($symbol,$keyval) = &get_keyval('symbol', $keyval);
   ($sort,$keyval) = &get_keyval('sort', $keyval);
   ($text,$keyval) = &get_keyval('text', $keyval);
   ($first,$keyval) = &get_keyval('first', $keyval);
   ($firstplural,$keyval) = &get_keyval('firstplural', $keyval);
   ($plural,$keyval) = &get_keyval('plural', $keyval);
   ($type,$keyval) = &get_keyval('type', $keyval);

   if (defined($type))
   {
      $type = &translate_commands($type);
   }
   else
   {
      $type = 'main';
   }

   &gls_entry_init($label, $type, $name, $description);

   &gls_set_symbol($label, defined($symbol)?$symbol:'');

   $sort = "$name $description" unless (defined($sort) and $sort);

   &gls_set_sort($label, $sort);

   $text = $name unless (defined($text) and $text);

   &gls_set_text($label, $text);

   $first = $text unless (defined($first) and $first);

   &gls_set_first($label, $first);

   $plural = "${text}s" unless (defined($plural) and $plural);

   &gls_set_plural($label, $plural);

   $firstplural = "${first}s" unless (defined($firstplural) and $firstplural);

   &gls_set_firstplural($label, $firstplural);

   push @{$gls_entries{$type}}, $label;

   $_;
}

sub reset_entry{
   local($label) = @_;

   $glsentry{$label}{'flag'} = 0;
}

sub unset_entry{
   local($label) = @_;

   $glsentry{$label}{'flag'} = 1;
}

sub do_cmd_glsreset{
   local($_) = @_;
   local($label);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   &reset_entry($label);

   $_;
}

sub do_cmd_glsunset{
   local($_) = @_;
   local($label);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   &unset_entry($label);

   $_;
}

sub do_cmd_ifglsused{
   local($_) = @_;
   local($label,$true,$false);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   $true = &missing_braces unless
              s/$next_pair_pr_rx/$true=$2;''/eo;

   $false = &missing_braces unless
              s/$next_pair_pr_rx/$false=$2;''/eo;

   (&gls_used($label) ? $true : $false) . $_;
}

sub do_cmd_ifglsentryexists{
   local($_) = @_;
   local($label,$true,$false);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   $true = &missing_braces unless
              s/$next_pair_pr_rx/$true=$2;''/eo;

   $false = &missing_braces unless
              s/$next_pair_pr_rx/$false=$2;''/eo;

   (&gls_entry_defined($label) ? $true : $false) . $_;
}

sub gls_add_entry{
   local($type, $label, $format, $text) = @_;

   local($oldfmt) = $GLSCURRENTFORMAT;

   if (defined($format))
   {
      $format=~s/[\(\)]//;

      if ($format)
      {
         $GLSCURRENTFORMAT=$format;
      }
   }

   $id = ++$global{'max_id'};

   local($str) = &make_real_glossary_entry($label,$text,$type);
   $GLSCURRENTFORMAT = $oldfmt;

   $str;
}

sub do_cmd_glsadd{
   local($_) = @_;
   local($optarg,$pat,$label,$str,$id,$type,$format);
   ($optarg,$pat) = &get_next_optional_argument;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   $type = &gls_get_type($label);

   if (defined $type)
   {
      ($format,$optarg) = &get_keyval('format', $optarg);
      $format='' unless(defined($format));

      &gls_add_entry($type,$label,$format,"");
   }
   else
   {
      &write_warnings("gls_add: glossary entry '$label' undefined");
      $str = '';
   }

   $str . $_;
}

sub do_cmd_glsaddall{
   local($_) = @_;
   local($optarg,$pat) = &get_next_optional_argument;

   local($format,$types);

   ($type,$optarg) = &get_keyval('types', $optarg);

   ($format,$optarg) = &get_keyval('format', $optarg);
   $format='' unless(defined($format));

   local(@types) = keys(%gls_mark);

   if (defined($types))
   {
      @types = split /,/, $types;
   }

   foreach $type (@types)
   {
      # strip leasing and trailing spaces
      $type=~s/^\s*([^\s]+)\s*$/\1/;

      foreach $label (@{$gls_entries{$type}})
      {
         &gls_add_entry($type,$label,$format,"");
      }
   }

   $_;
}

sub do_cmd_glsresetall{
   local($_) = @_;
   local($types,$pat) = &get_next_optional_argument;

   local(@types) = keys(%gls_mark);

   if (defined($types) and $types)
   {
      @types = split /,/, $types;
   }

   foreach $type (@types)
   {
      # strip leasing and trailing spaces
      $type=~s/^\s*([^\s]+)\s*$/\1/;

      foreach $label (@{$gls_entries{$type}})
      {
         &reset_entry($label);
      }
   }

   $_;
}

sub do_cmd_glsunsetall{
   local($_) = @_;
   local($types,$pat) = &get_next_optional_argument;

   local(@types) = keys(%gls_mark);

   if (defined($types) and $types)
   {
      @types = split /,/, $types;
   }

   foreach $type (@types)
   {
      # strip leasing and trailing spaces
      $type=~s/^\s*([^\s]+)\s*$/\1/;

      foreach $label (@{$gls_entries{$type}})
      {
         &reset_entry($label);
      }
   }

   $_;
}

$glslabel = '';

sub do_cmd_glslabel{ $glslabel.$_[0] }

sub make_glslink{
   local($type,$label,$format,$text) = @_;
   local($str) = '';

   $glslabel = $label;

   if (defined $type)
   {
      $str = &gls_add_entry($type,$label,$format,$text);
   }
   else
   {
      &write_warnings("glossary '$type' undefined");
   }

   $str;
}

sub do_cmd_glslink{
   local($_) = @_;
   local($optarg,$pat,$label,$text,$type,$format,$str);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   $text = &missing_braces unless
             (s/$next_pair_pr_rx/$text=$2;''/eo);

   # v1.01 removed following lines (\glslink doesn't have
   # a final optional argument!
   #local ($space) = '';
   #if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}
   #($optarg,$pat) = &get_next_optional_argument;

   $type = &gls_get_type($label);

   #&make_glslink($type, $label, $format, $text).$space . $_;
   &make_glslink($type, $label, $format, $text) . $_;
}

sub do_cmd_glslinkstar{
   local($_) = @_;
   local($optarg,$pat,$label,$text,$type,$format,$str);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   $text = &missing_braces unless
             (s/$next_pair_pr_rx/$text=$2;''/eo);

   $type = &gls_get_type($label);

   $text . $_;
}

sub do_cmd_glsentrydesc{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_description($label).$_;
}

sub do_cmd_Glsentrydesc{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_description($label)).$_;
}

sub do_cmd_glsentrytext{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_text($label).$_;
}

sub do_cmd_Glsentrytext{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_text($label)).$_;
}

sub do_cmd_glsentryname{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_name($label).$_;
}

sub do_cmd_Glsentryname{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_name($label)).$_;
}

sub do_cmd_glsentryfirst{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_first($label).$_;
}

sub do_cmd_Glsentryfirst{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_first($label)).$_;
}

sub do_cmd_glsentryplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_plural($label).$_;
}

sub do_cmd_Glsentryplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_plural($label)).$_;
}

sub do_cmd_glsentryfirstplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local($text)=$glsentry{$label}{'firstplural'};

   unless (defined($text))
   {
      &write_warnings("glossary entry '$label' has not been defined");
      $text = '';
   }

   "$text$_";
   &gls_get_firstplural($label).$_;
}

sub do_cmd_Glsentryfirstplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_firstplural($label)).$_;
}

sub do_cmd_glsentrysymbol{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_symbol($label).$_;
}

sub do_cmd_Glsentrysymbol{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_symbol($label)).$_;
}

sub do_cmd_gls{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, $link_text) .$space . $_;
}

# added v1.04
sub do_cmd_glsstar{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   $link_text . $space . $_;
}

sub do_cmd_glspl{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, $link_text) . $space . $_;
}

# added v1.04
sub do_cmd_glsplstar{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   $link_text . $space . $_;
}

sub do_cmd_Gls{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_;
}

# added v1.04
sub do_cmd_Glsstar{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   ucfirst($link_text). $space . $_;
}

sub do_cmd_Glspl{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_;
}

# added v1.04
sub do_cmd_Glsplstar{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   ucfirst($link_text).$space . $_;
}

sub do_cmd_GLS{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, uc($link_text)).$space . $_;
}

# added v1.04
sub do_cmd_GLSstar{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   uc($link_text).$space . $_;
}

sub do_cmd_GLSpl{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, uc($link_text)).$space . $_;
}

# added v1.04
sub do_cmd_GLSplstar{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   uc($link_text).$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glstext{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_text($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glstext{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_text($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLStext{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_text($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsname{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_name($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsname{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_name($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSname{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_name($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsfirst{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_first($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsfirst{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_first($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSfirst{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_first($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsfirstplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_firstplural($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsfirstplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_firstplural($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSfirstplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_firstplural($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_plural($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_plural($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_plural($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsdesc{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_description($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsdesc{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_description($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSdesc{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_description($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glssymbol{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_symbol($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glssymbol{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_symbol($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSsymbol{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_symbol($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

sub do_cmd_acrshort{
  &do_cmd_glstext(@_)
}

sub do_cmd_Acrshort{
  &do_cmd_Glstext(@_)
}

sub do_cmd_ACRshort{
  &do_cmd_GLStext(@_)
}

sub do_cmd_acrlong{
  &do_cmd_glsdesc(@_)
}

sub do_cmd_Acrlong{
  &do_cmd_Glsdesc(@_)
}

sub do_cmd_ACRlong{
  &do_cmd_GLSdesc(@_)
}

sub do_cmd_acrfull{
  &do_cmd_glsfirst(@_)
}

sub do_cmd_Acrfull{
  &do_cmd_Glsfirst(@_)
}

sub do_cmd_ACRfull{
  &do_cmd_GLSfirst(@_)
}

sub do_cmd_glossarypreamble{
   local($_) = @_;
   $_[0];
}

sub do_cmd_glossarypostamble{
   local($_) = @_;
   $_[0];
}

sub do_cmd_glsnumformat{
   local($_) = @_;

   $_;
}

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
makeglossaries
glossarystyle {}
_IGNORED_CMDS_

1;
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</glossaries.perl>
%    \end{macrocode}
%\fi
%\Finale
\endinput