summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/glossaries/glossaries.dtx
blob: 43a001e0367d9ef5626b13f8db431867ec1bdebf (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
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
%\iffalse
% glossaries.dtx generated using makedtx version 0.94b (c) Nicola Talbot
% Command line args:
%   -macrocode "glossaries\.perl"
%   -macrocode ".*\.tex"
%   -macrocode ".*\.xdy"
%   -setambles "glossaries\.perl=>\nopreamble\nopostamble"
%   -setambles ".*\.tex=>\nopreamble\nopostamble"
%   -setambles ".*\.xdy=>\nopreamble\nopostamble"
%   -comment "glossaries\.perl"
%   -comment ".*\.tex"
%   -comment ".*\.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-polyglossia)\.(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"
%   -doc "glossaries-manual.tex"
%   -author "Nicola Talbot"
%   -codetitle "Glossaries Documented Code"
%   glossaries
% Created on 2010/7/10 12:21
%\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) 2010 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
\documentclass{nlctdoc}

\usepackage{alltt}
\usepackage{pifont}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\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}

\doxitem{Option}{option}{package options}
\doxitem{GlsKey}{key}{glossary keys}
\doxitem{Style}{style}{glossary styles}

\setcounter{IndexColumns}{2}

\CheckSum{11106}

\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]{\appfmt{#1}\index{makeindex=\appfmt{makeindex}>#1=\texttt{#1}|hyperpage}}
\newcommand*{\locfmt}[1]{\texttt{#1}\SpecialMainIndex{#1}}
\newcommand*{\mkidxspch}{\index{makeindex=\appfmt{makeindex}>special characters|hyperpage}}

\newcommand*{\igloskey}[2][newglossaryentry]{\icsopt{#1}{#2}}
\newcommand*{\gloskey}[2][newglossaryentry]{\csopt{#1}{#2}}

\newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles:>#1={\protect\ttfamily#1}|main}}


\begin{document}
\DocInput{glossaries.dtx}
\end{document}
%</driver>
%\fi
%\MakeShortVerb{"}
%\DeleteShortVerb{\|}
%
% \title{glossaries.sty v2.07: 
%   \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{2010-07-10}
% \maketitle
%
%This is the user manual for the \styfmt{glossaries} package. Other
%documents accompanying this manual:
%\begin{itemize}
%\item \qtdocref{The glossaries package: a guide for beginners}{glossariesbegin}
%\item \qtdocref{Upgrading from the glossary package to the
%glossaries package}{glossary2glossaries}
%\end{itemize}
%See the file \texttt{INSTALL} for installation instructions.
%Related web resources:
%\begin{itemize}
%\item
%\urlfootref{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/glossariesfaq.html}{The glossaries FAQ}
%
%\item
%\urlfootref{http://www.latex-community.org/index.php?option=com_content&view=article&id=263&Itemid=114}{Glossaries,
%Nomenclature, Lists of Symbols and Acronyms }
%\end{itemize}
%
%\clearpage
%\tableofcontents
%
% \section{Introduction}
%
% \changes{1.0}{2007 May 16}{Initial version}
%The \styfmt{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
%\sectionref{sec:glslink}, \sectionref{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 \sty{glossary} package which is
%now obsolete.} Please see the document \qtdocref{Upgrading from the
%glossary package to the glossaries package}{glossary2glossaries} for
%assistance in upgrading.
%
%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. If you are daunted by the
%size of the manual, try starting off with the much shorter
%\docref{guide for beginners}{glossariesbegin}.
%
%\begin{important}
%The \styfmt{glossaries} package comes with a
%\href{http://www.perl.org/about.html}{Perl} script called
%\app{makeglossaries}. This provides a convenient interface to
%\app{makeindex} or \app{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 \app{makeglossaries}, you can called \app{makeindex} or
%\app{xindy} explicitly. See \sectionref{sec:makeglossaries} for
%further details.
%\end{important}
%
%This manual is structured as follows:
%\begin{itemize}
%\item \sectionref{sec:overview} gives an overview of the main user
%commands and their syntax.
%
%\item \sectionref{sec:mfirstuc} describes the associated
%\styfmt{mfirstuc} package.
%
%\ifpdf
%  \item \sectionref{sec:code} contains the documented source code for 
%  those who want to know more about how the package works. This 
%  describes more advanced commands, such as determining if an entry or 
%  a glossary exists and commands that iterate through defined terms or
%  glossaries.
%
%  \item \sectionref{sec:code:mfirstuc} contains the documented code for 
%  the \styfmt{mfirstuc} package.
%\fi 
%\end{itemize}
%\ifpdf
%\else
%  The \href{glossaries.pdf}{PDF version} of this manual also describes 
%  more advanced commands in the documented code section (such as 
%  determining if an entry or a glossary exists and commands that 
%  iterate through defined terms or glossaries).
%\fi
%
%\noindent The remainder of this introductory section covers the
%following:
%\begin{itemize}
%\item \sectionref{sec:samples} lists the sample documents provided 
%with this package.
%
%\item \sectionref{sec:languages} provides information for users who
%wish to write in a language other than English.
%
%\item \sectionref{sec:makeglossaries} describes how to use a
%post-processor to create the sorted glossaries for your document.
%
%\item \sectionref{sec:trouble} provides some assistance in the event
%that you encounter a problem.
%\end{itemize}
%
%
%\subsection{Sample Documents}
%\label{sec:samples}
%
%The \styfmt{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
%\styfmt{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{prompt}
%texdoc -l glossaries
%\end{prompt}
%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
%subdirectory \texttt{doc/latex/glossaries/samples/} in the
%\texttt{glossaries.tds.zip} archive which can be downloaded from
%\href{http://tug.ctan.org/tex-archive/macros/latex/contrib/glossaries/}{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\ either by 
%  typing
%\begin{prompt}
%latex minimalgls
%\end{prompt}
%  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 \sty{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 \styfmt{xkeyval}
%  package.
%
%  \item Run \app{makeglossaries} on the document. This can
%  be done on a terminal either by typing
%\begin{prompt}
%makeglossaries minimalgls
%\end{prompt}
%  or by typing
%\begin{prompt}
%perl makeglossaries minimalgls
%\end{prompt}
%  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 \app{makeindex} directly. You can do this
%  in a terminal by typing (all on one line):
%\begin{prompt}
%makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo
%\end{prompt}
%  (See \sectionref{sec:makeindexapp} for further details on using 
%   \app{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{prompt}
%latex sample4col
%makeglossaries sample4col
%latex sample4col
%\end{prompt}
%As before, if you don't have Perl installed, you will need to use
%\app{makeindex} directly instead of using
%\app{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{prompt}
%latex sampleAcr
%makeglossaries sampleAcr
%latex sampleAcr
%latex sampleAcr
%\end{prompt}
%
%\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{prompt}
%latex sampleAcrDesc
%makeglossaries sampleAcrDesc
%latex sampleAcrDesc
%latex sampleAcrDesc
%\end{prompt}
%
%\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{prompt}
%latex sampleDesc
%makeglossaries sampleDesc
%latex sampleDesc
%latex sampleDesc
%\end{prompt}
%
%\item[sample-custom-acronym.tex]\label{ex:sample-custom-acronym}
%This document illustrates how to define your own acronym style if
%the predefined styles don't suit your requirements.
%\begin{prompt}
%latex sample-custom-acronym
%makeglossaries sample-custom-acronym
%latex sample-custom-acronym
%\end{prompt}
%
%\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{prompt}
%latex sampleDB
%makeglossaries sampleDB
%latex sampleDB
%\end{prompt}
%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 \app{makeindex}
%twice instead of a single call to \app{makeglossaries}:
%\begin{enumerate}
%\item Create the main glossary:
%\begin{prompt}
%makeindex -s sampleDB.ist -t sampleDB.glg -o sampleDB.gls sampleDB.glo
%\end{prompt}
%\item Create the secondary glossary:
%\begin{prompt}
%makeindex -s sampleDB.ist -t sampleDB.nlg -o sampleDB.not sampleDB.ntn
%\end{prompt}
%\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 \env{equation} environment. To create
%the document do:
%\begin{prompt}
%latex sampleEq
%makeglossaries sampleEq
%latex sampleEq
%\end{prompt}
%
%\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{prompt}
%latex sampleEqPg
%makeglossaries sampleEqPg
%latex sampleEqPg
%latex sampleEqPg
%\end{prompt}
%
%\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{prompt}
%latex sampleSec
%makeglossaries sampleSec
%latex sampleSec
%latex sampleSec
%\end{prompt}
%
%\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{prompt}
%latex sampleNtn
%makeglossaries sampleNtn
%latex sampleNtn
%latex sampleNtn
%\end{prompt}
%Note that if you don't have Perl installed, you will need to use
%\app{makeindex} twice instead of a single call to
%\app{makeglossaries}:
%\begin{enumerate}
%\item Create the main glossary:
%\begin{prompt}
%makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
%\end{prompt}
%\item Create the secondary glossary:
%\begin{prompt}
%makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.not sampleNtn.ntn
%\end{prompt}
%\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{prompt}
%latex sample
%makeglossaries sample
%latex sample
%latex sample
%\end{prompt}
%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
%\app{makeglossaries}. If you use \app{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{prompt}
%latex sampletree
%makeglossaries sampletree
%latex sampletree
%\end{prompt}
%
%\item[samplexdy.tex]\label{ex:samplexdy} This document illustrates
%how to use the \styfmt{glossaries} package with \app{xindy} instead
%of \app{makeindex}. The document uses UTF8 encoding (with the
%\sty{inputenc} package). The encoding is picked up by
%\app{makeglossaries}. By default, this document will create a
%\app{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
%\qt{Mc} or \qt{Mac}. If you use \app{makeglossaries}, you don't
%need to supply any additional information. If you don't use
%\app{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 \styfmt{glossaries} package will overwrite
%\texttt{samplexdy-mc.xdy} and you will lose the \qt{Mc} letter
%group.
%
%To create the document do:
%\begin{prompt}
%latex samplexdy
%makeglossaries samplexdy
%latex samplexdy
%\end{prompt}
%If you don't have Perl installed, you will have to call 
%\app{xindy} explicitly instead of using \app{makeglossaries}.
%If you are using the default style file \texttt{samplexdy.xdy}, then
%do (no line breaks):
%\begin{prompt}
%xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg -o samplexdy.gls samplexdy.glo
%\end{prompt}
%otherwise, if you are using \texttt{samplexdy-mc.xdy}, then do
%(no line breaks):
%\begin{prompt}
%xindy -I xindy -M samplexdy-mc -t samplexdy.glg -o samplexdy.gls samplexdy.glo
%\end{prompt}
%
%\item[sampleutf8.tex]\label{ex:sampleutf8} This is another example
%that uses \app{xindy}. Unlike \app{makeindex},
%\app{xindy} can cope with accented or non-Latin characters. This
%document uses UTF8 encoding. To create the document do:
%\begin{prompt}
%latex sampleutf8
%makeglossaries sampleutf8
%latex sampleutf8
%\end{prompt}
%If you don't have Perl installed, you will have to call
%\app{xindy} explicitly instead of using \app{makeglossaries}
%(no line breaks):
%\begin{prompt}
%xindy -L english -C utf8 -I xindy -M sampleutf8 -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
%\end{prompt}
%
%If you remove the \pkgopt{xindy} option from \texttt{sampleutf8.tex} 
%and do:
%\begin{prompt}
%latex sampleutf8
%makeglossaries sampleutf8
%latex sampleutf8
%\end{prompt}
%you will see that the entries that start with a non-Latin character
%now appear in the symbols group, and the word \qt{man\oe uvre} is now 
%after \qt{manor} instead of before it. If you are unable to use
%\app{makeglossaries}, the call to \app{makeindex} is as
%follows (no line breaks):
%\begin{prompt}
%makeindex -s sampleutf8.ist -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
%\end{prompt}
%
%\item[sampleaccsupp.tex]\label{ex:sampleaccsupp} This document
%uses the experimental \sty{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 \styfmt{glossaries-accsupp} package can be found in
%\sectionref{sec:accsupp}.
%
%\end{description}
%
%
%\subsection{Multi-Lingual Support}
%\label{sec:languages}
%
%As from version 1.17, the \styfmt{glossaries} package can now be
%used with \app{xindy} as well as \app{makeindex}. If you
%are writing in a language that uses accented characters or
%non-Latin characters it is recommended that you use \app{xindy}
%as \app{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 \app{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 other expandable 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 \sty{inputenc} package, \app{makeglossaries}
%will pick up the encoding from the auxiliary file. If you use
%\app{xindy} explicitly instead of via \app{makeglossaries},
%you may need to specify the encoding using the \texttt{-C} 
%option. Read the \app{xindy} manual for further details.
%
%\subsubsection{Changing the Fixed Names}
%\label{sec:fixednames}
%
%As from version 1.08, the \styfmt{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 \sty{babel} or \sty{polyglossia} \emph{before} 
%\styfmt{glossaries} to enable this. Note that if \sty{babel} is loaded 
%and the \sty{translator} package is detected on \TeX's path, then the
%\sty{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
%\sty{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 \sty{ngerman} or \sty{german} instead
%of \sty{babel}, you will need to include the \sty{translator} package 
%to provide the translations. For example:
%\begin{verbatim}
%\documentclass[ngerman]{article}
%\usepackage{ngerman}
%\usepackage{translator}
%\usepackage{glossaries}
%\end{verbatim}
%
%The languages are currently supported by the
%\styfmt{glossaries} package are listed in
%\tableref{tab:supportedlanguages}.
%
%\begin{table}[htbp]
%\caption{Supported Languages}
%\label{tab:supportedlanguages}
%\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\\
%Serbian & 2.06\\
%Spanish & 1.08
%\end{tabular}
%\end{center}
%\end{table}
%
%The language dependent commands and \sty{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
%\sty{babel} package and do not have the \sty{translator} package
%installed, you need to be familiar with the advice given in
%\urlref{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=latexwords}{changing
%the words babel uses}. If you have the \sty{translator} package
%installed, then you can provide your own dictionary with the
%necessary modifications (using \cs{deftranslation}) and load it
%using \cs{usedictionary}. Note that the dictionaries are loaded at
%the beginning of the document, so it won't have any effect if you
%put \cs{deftranslation} in the preamble. It should be put in your
%personal dictionary instead. See the \sty{translator} documentation
%for further details.
%
%If you are using \sty{babel} and don't want to use the
%\sty{translator} interface, you can suppress it using the package
%option \pkgopt[false]{translate}, and either load
%\sty{glossaries-babel} after \styfmt{glossaries} or specify you're own
%translations. For example:
%\begin{verbatim}
%\documentclass[british]{article}
%
%\usepackage{babel}
%\usepackage[translate=false]{glossaries}
%\usepackage{glossaries-babel}
%\end{verbatim}
%or:
%\begin{verbatim}
%\documentclass[british]{article}
%
%\usepackage{babel}
%\usepackage[translate=false]{glossaries}
%
%\addto\captionsbritish{%
%    \renewcommand*{\glossaryname}{List of Terms}%
%    \renewcommand*{\acronymname}{List of Acronyms}%
%    \renewcommand*{\entryname}{Notation}%
%    \renewcommand*{\descriptionname}{Description}%
%    \renewcommand*{\symbolname}{Symbol}%
%    \renewcommand*{\pagelistname}{Page List}%
%    \renewcommand*{\glssymbolsgroupname}{Symbols}%
%    \renewcommand*{\glsnumbersgroupname}{Numbers}%
%}
%\end{verbatim}
%
%If you are using \sty{polyglossia} instead of \sty{babel}, 
%\sty{glossaries-polyglossia} will automatically be loaded unless
%you specify the package option \pkgopt[false]{translate}.
%
%Note that \app{xindy} provides much better multi-lingual support
%than \app{makeindex}, so it's recommended that you use \app{xindy}
%if you have glossary entries that contain diacritics or
%non-Roman letters. See \sectionref{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
%\app{makeindex} and \app{xindy}. As from version 1.17, the
%\styfmt{glossaries} package can be used with either of these
%applications. Previous versions were designed to be used with
%\app{makeindex} only. Note that \app{xindy} has much better
%multi-lingual support than \app{makeindex}, so \app{xindy} is
%recommended if you're not writing in English. Commands that only
%have an effect when \app{xindy} is used are described in
%\sectionref{sec:xindy}.
%
%
%The \styfmt{glossaries} package comes with the Perl script
%\app{makeglossaries} which will run \app{makeindex} or \app{xindy}
%on all the glossary files using a customized style file (which is
%created by \ics{makeglossaries}). See
%\sectionref{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
%\app{makeglossaries} script, it is possible to use the
%\styfmt{glossaries} package without having Perl installed. In which
%case, if you have used the \pkgopt{xindy} package option, you will
%need to use \app{xindy} (see \sectionref{sec:xindyapp}), otherwise
%you will need to use \app{makeindex} (see
%\sectionref{sec:makeindexapp}). Note that some commands and package
%options have no effect if you don't use \app{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 \app{makeglossaries}, \app{makeindex}
%or \app{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 \app{makeglossaries}, \app{makeindex} or \app{xindy}.
%For example, if the document is called \texttt{myDoc.tex}, then
%you must do:
%\begin{prompt}
%latex myDoc
%makeglossaries myDoc
%latex myDoc
%makeglossaries myDoc
%latex myDoc
%\end{prompt}
%
%Likewise, an additional \app{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
%\app{makeglossaries}, \app{xindy} or \app{makeindex} via a terminal.
%Windows users can use the MSDOS Prompt which is usually accessed via
%the \menu{Start}\submenu{All Programs} menu or
%\menu{Start}\submenu{All Programs}\submenu{Accessories} menu.
%
%Alternatively, your text editor may have the facility to create a
%function that will call the required application. The article
%\href{http://www.latex-community.org/index.php?option=com_content&view=article\&id=263:glossaries-nomenclature-lists-of-symbols-and-acronyms&catid=55:latex-general&Itemid=114}{\qt{Glossaries, Nomenclature, List of Symbols and
%Acronyms}}
%in the \urlfootref{http://www.latex-community.org/}{\LaTeX\
%Community's} Know How section
%describes how to do this for TeXnicCenter, and the thread
%\href{http://groups.google.com/group/comp.text.tex/browse_thread/thread/edd83831b81b0759?hl=en}{\qt{Executing Glossaries' makeindex from a WinEdt
%macro}} on the \texttt{comp.text.tex} newsgroup
%describes how to do it for WinEdt. For other editors see the 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} explicitly}
%\label{tab:makeglossariesCmds}
%\vskip\baselineskip
%\begin{tabular}{@{}lll@{}}
%\bfseries Command or Package Option & \app{makeindex} & 
%\app{xindy}\\
%\pkgopt[letter]{order} & use \texttt{-l} &
% use \texttt{-M ord/letorder}\\
%\pkgopt[word]{order} & default & default\\
%\pkgopt{xindy}=\{\pkgoptfmt{language=}\meta{lang}\pkgoptfmt{,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 \app{makeglossaries} script picks up the relevant information
%from the auxiliary (\filetype{.aux}) file and will either call
%\app{xindy} or \app{makeindex}, depending on the supplied
%information. Therefore, you only need to pass the document's name
%without the extension to \app{makeglossaries}. For example, if your
%document is called \texttt{myDoc.tex}, type the following in your
%terminal:
%\begin{prompt}
%latex myDoc
%makeglossaries myDoc
%latex myDoc
%\end{prompt}
%You may need to explicitly load \app{makeglossaries} into Perl:
%\begin{prompt}
%perl makeglossaries myDoc
%\end{prompt}
%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.
%
%The \app{makeglossaries} script contains POD (Plain Old
%Documentation). If you want, you can create a man page for
%\app{makeglossaries} using \app{pod2man} and move the 
%resulting file onto the man path.
%
%
%\subsubsection{Using xindy explicitly}
%\label{sec:xindyapp}
%
%If you want to use \app{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 \app{xindy}
%explicitly or whether it's called implicitly via 
%\app{makeglossaries}. This causes the glossary 
%entries to be written in raw \app{xindy} format, so you need to
%use \texttt{-I xindy} \emph{not} \texttt{-I tex}.
%
%To run \app{xindy} type the following in your terminal 
%(all on one line):
%\begin{prompt}
%xindy -L \meta{language} -C \meta{encoding} -I xindy -M \meta{style} -t \meta{base}.glg -o \meta{base}.gls \meta{base}.glo
%\end{prompt}
%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
%\app{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{prompt}
%xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo
%\end{prompt}
%
%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{prompt}
%xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn
%\end{prompt}
%For additional glossaries, the extensions are those supplied
%when you created the glossary with \ics{newglossary}.
%
%Note that if you use \app{makeglossaries} instead, you can
%replace all those calls to \app{xindy} with just one call
%to \app{makeglossaries}:
%\begin{prompt}
%makeglossaries myDoc
%\end{prompt}
%Note also that some commands and package options have no effect if 
%you use \app{xindy} explicitly instead of using 
%\app{makeglossaries}. These are listed in 
%\tableref{tab:makeglossariesCmds}.
%
%
%\subsubsection{Using makeindex explicitly}
%\label{sec:makeindexapp}
%
%If you want to use \app{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 \app{makeindex}, type the following in
%your terminal:
%\begin{prompt}
%makeindex -s \meta{style}.ist -t \meta{base}.glg -o \meta{base}.gls \meta{base}.glo
%\end{prompt}
%where \meta{base} is the name of your document without the
%\filetype{.tex} extension and \meta{style}\filetype{.ist} is the 
%name of the \app{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 \app{makeindex}
%manual for further details.
%
%For example, if your document is called \texttt{myDoc.tex}, then
%type the following at the terminal:
%\begin{prompt}
%makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo
%\end{prompt}
%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 
%\app{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{prompt}
%makeindex -s myDoc.ist -t myDoc.alg -o myDoc.acr myDoc.acn
%\end{prompt}
%For additional glossaries, the extensions are those supplied
%when you created the glossary with \ics{newglossary}.
%
%Note that if you use \app{makeglossaries} instead, you can
%replace all those calls to \app{makeindex} with just one call
%to \app{makeglossaries}:
%\begin{prompt}
%makeglossaries myDoc
%\end{prompt}
%Note also that some commands and package options have no effect if 
%you use \app{makeindex} explicitly instead of using 
%\app{makeglossaries}. These are listed in 
%\tableref{tab:makeglossariesCmds}.
%
%
%\subsubsection{Note to Front-End and Script Developers}
%
%The information needed to determine whether to use \app{xindy}
%or \app{makeindex} and the information needed to call those
%applications is stored in the auxiliary file. This information can
%be gathered by a front-end, editor or script to make the glossaries
%where appropriate. This section describes how the information is
%stored in the auxiliary file.
%
%The file extensions used by each defined glossary are given by
%\begin{definition}[\DescribeMacro{\@newglossary}]
%\cs{@newglossary}\marg{label}\marg{log}\marg{out-ext}\marg{in-ext}
%\end{definition}
%where \meta{in-ext} is the extension of the \emph{indexing
%application's} input file (the output file from the \styfmt{glossaries}
%package's point of view), \meta{out-ext} is the extension of the
%\emph{indexing application's} output file (the input file from
%the \styfmt{glossaries} package's point of view) and \meta{log} is the
%extension of the indexing application's transcript file. The label
%for the glossary is also given for information purposes only, but
%is not required by the indexing applications. For example, the
%information for the main glossary is written as:
%\begin{verbatim}
%\@newglossary{main}{glg}{gls}{glo}
%\end{verbatim}
%
%The indexing application's style file is specified by
%\begin{definition}[\DescribeMacro{\@istfilename}]
%\cs{@istfilename}\marg{filename}
%\end{definition}
%The file extension indicates whether to use \app{makeindex}
%(\filetype{.ist}) or \app{xindy} (\filetype{.xdy}). Note that
%the glossary information is formatted differently depending on
%which indexing application is supposed to be used, so it's 
%important to call the correct one.
%
%Word or letter ordering is specified by:
%\begin{definition}[\DescribeMacro{\@glsorder}]
%\cs{@glsorder}\marg{order}
%\end{definition}
%where \meta{order} can be either \texttt{word} or \texttt{letter}.
%
%If \app{xindy} should be used, the language and code page
%for each glossary is specified by
%\begin{definition}[\DescribeMacro{\@xdylanguage}\DescribeMacro{\@gls@codepage}]
%\cs{@xdylanguage}\marg{label}\marg{language}\\
%\cs{@gls@codepage}\marg{label}\marg{code}
%\end{definition}
%where \meta{label} identifies the glossary, \meta{language} is
%the root language (e.g.\ \texttt{english}) and \meta{code}
%is the encoding (e.g.\ \texttt{utf8}). These commands are omitted
%if \app{makeindex} should be used.
%
%
%\subsection{Troubleshooting}
%\label{sec:trouble}
%
%The \styfmt{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 \styfmt{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 \styfmt{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 \sty{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.} My acronyms won't break across a line when they're
%expanded.
%
%\textbf{A.} PDF\LaTeX\ can break hyperlinks across a line, but
%\LaTeX\ can't. If you can't use PDF\LaTeX\ then disable the first use
%links using the package option \pkgopt[false]{hyperfirst}.
%
%\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 
%\app{makeglossaries}?
%
%\textbf{A.} Although it is strongly recommended that you use
%\app{makeglossaries}, you don't have to use it. For further details,
%read \sectionref{sec:xindyapp} or \sectionref{sec:makeindexapp},
%depending on whether you want to use \app{xindy} or \app{makeindex}.
%
%\item \textbf{Q.} I'm used to using the \styfmt{glossary} package: are there any
%instructions on migrating from the \sty{glossary} package to the
%\styfmt{glossaries} package?
%
%\textbf{A.} Read \qtdocref{Upgrading from the glossary package to
%the glossaries package}{glossary2glossaries} which should be
%available from the same location as this document.
%
%\item \textbf{Q.} I'm using \sty{babel} but the fixed names haven't
%been translated.
%
%\textbf{A.} The \styfmt{glossaries} package currently only supports
%the following languages: Brazilian Portuguese, Danish, Dutch,
%English, French, German, Irish, Italian, Hungarian, Polish, Serbian 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 \sty{translator} package with the
%required languages explicitly (before you load the \styfmt{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 \styfmt{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 \sectionref{sec:glslink},
%\sectionref{sec:glsadd} or \sectionref{sec:crossref} for each entry
%that you want to appear in the glossary.
%
%\item Run \LaTeX\ on your document, then run \app{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
%\app{makeglossaries} (see \sectionref{sec: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?
%
%\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
%\app{xindy} (instead of \app{makeindex}) and use an appropriate
%\app{xindy} language module. Writing \app{xindy} modules or styles
%is beyond the scope of this manual. Further information about
%\app{xindy} can be found at the
%\urlfootref{http://xindy.sourceforge.net/}{Xindy Web Site}. There is
%also a link to the \app{xindy} mailing list from that site.
%
%\end{enumerate}
%
%
%\section{Overview of Main User Commands}\label{sec:overview}
% \changes{1.02}{2007 May 25}{added overview section}
%
%This section is an overview of the main user commands and package
%options. If you find this too complicated, try starting out with the
%\docref{guide for beginners}{glossariesbegin}.
%
%\subsection{Package Options}
%\label{sec:pkgopts}
%
%The \styfmt{glossaries} package options are as follows:
%\begin{description}
%\item[\pkgopt{nowarn}] This suppresses all warnings generated by
%the \styfmt{glossaries} package.
%
%\item[\pkgopt{nomain}] This suppresses the creation of the main
%glossary. Note that if you use this option, you must create another
%glossary in which to put all your entries (either via the
%\pkgopt{acronym} package option described below or via
%\ics{newglossary} described in \sectionref{sec:newglossary}).
%
%\item[\pkgopt{toc}] Add the glossaries to the table of contents.
%Note that an extra \LaTeX\ run is required with this option.
%Alternatively, you can switch this function on and off using
%\begin{definition}[\DescribeMacro{\glstoctrue}]
%\cs{glstoctrue}
%\end{definition}
%and
%\begin{definition}[\DescribeMacro{\glstocfalse}]
%\cs{glstocfalse}
%\end{definition}
%
%\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{acronymlists}] By default, only the \texttt{acronym}
%glossary is considered to be a list of acronyms. If you have other
%lists of acronyms, you can specify them as a comma-separated list
%in the value of \pkgopt{acronymlists}. For example, if you want
%the \texttt{main} glossary to also contain a list of acronyms, you
%can do:
%\begin{verbatim}
%\usepackage[acronym,acronymlists={main}]{glossaries}
%\end{verbatim}
%No check is performed to determine if the listed glossaries exist,
%so you can add glossaries you haven't defined yet. For example:
%\begin{verbatim}
%\usepackage[acronym,acronymlists={main,acronym2}]{glossaries}
%\newglossary[alg2]{acronym2}{acr2}{acn2}{Statistical Acronyms}
%\end{verbatim}
%
%\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
%\begin{definition}[\DescribeMacro{\setglossarysection}]
%\cs{setglossarysection}\marg{name}
%\end{definition}
%where \meta{name} is the sectional unit.
%
%The start of each glossary adds information to the page header via
%\begin{definition}[\DescribeMacro{\glossarymark}]
%\cs{glossarymark}\marg{glossary title}
%\end{definition}
%This defaults to \cs{@mkboth}, but you may need to redefine it.
%For example, to only change the right header:
%\begin{verbatim}
%\renewcommand{\glossarymark}[1]{\markright{#1}}
%\end{verbatim}
%or to prevent it from changing the headers:
%\begin{verbatim}
%\renewcommand{\glossarymark}[1]{}
%\end{verbatim}
%
%Occasionally you may find that another package defines 
%\cs{cleardoublepage} when it is not required. This may cause an 
%unwanted blank page to appear before each glossary. This can
%be fixed by redefining \ics{glsclearpage}:
%\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 \styfmt{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 
%\begin{definition}[\DescribeMacro{\glsautoprefix}]
%\cs{glsautoprefix}
%\end{definition}
%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 \sectionref{sec:styles}.
%
%\item[\pkgopt{nolong}] This prevents the \styfmt{glossaries} package
%from automatically loading \sty{glossary-long} (which means that
%the \sty{longtable} package also won't be loaded). This reduces
%overhead by not defining unwanted styles and commands. Note that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \styfmt{glossary-long} package.
%
%\item[\pkgopt{nosuper}] This prevents the \styfmt{glossaries} package
%from automatically loading \sty{glossary-super} (which means that
%the \sty{supertabular} package also won't be loaded). This reduces
%overhead by not defining unwanted styles and commands. Note that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \styfmt{glossary-super} package.
%
%\item[\pkgopt{nolist}] This prevents the \styfmt{glossaries} package
%from automatically loading \sty{glossary-list}. This reduces
%overhead by not defining unwanted styles. Note that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \styfmt{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 \styfmt{glossaries} package
%from automatically loading \sty{glossary-tree}. This reduces
%overhead by not defining unwanted styles. Note that if
%you use this option, you won't be able to use any of the
%glossary styles defined in the \styfmt{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 \styfmt{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 
%\sectionref{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 \styfmt{glossaries}
%package sanitizes the values of the \gloskey{name},
%\gloskey{description} and \gloskey{symbol} keys used when defining a
%new glossary entry. This means that you can use fragile commands in
%those keys, but it 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. \ifpdf
%(See \sectionref{sec:pkgopt} and \sectionref{sec:newentry} for
%further details.) \fi 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}
%You can use \pkgopt[none]{sanitize} as a shortcut for\newline
%\pkgoptfmt{sanitize=\{name=false,description=false,symbol=false\}}.
%
%\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 \sectionref{sec:acronyms} 
%for further details.
%
%\item[\pkgopt{footnote}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See
%\sectionref{sec:acronyms} for further details.
%
%\item[\pkgopt{smallcaps}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See
%\sectionref{sec:acronyms} for further details.
%
%\item[\pkgopt{smaller}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed.
%If you use this option, you will need to include the \sty{relsize} 
%package or otherwise define \ics{textsmaller} or redefine
%\ics{acronymfont}. See \sectionref{sec:acronyms} for further details.
%
%\item[\pkgopt{dua}] This option changes the definition of
%\ics{newacronym} so that acronyms are always expanded. 
%See \sectionref{sec:acronyms} for further details.
%
%\item[\pkgopt{shortcuts}] This option provides shortcut commands
%for acronyms.  See \sectionref{sec:acronyms} for further details.
%
%\item[\pkgopt{makeindex}] (Default) The glossary information and
%indexing style file will be written in \app{makeindex} format. If
%you use \app{makeglossaries}, it will automatically detect that it
%needs to call \app{makeindex}. If you don't use
%\app{makeglossaries}, you need to remember to use \app{makeindex}
%not \app{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 \app{xindy} format. If you use
%\app{makeglossaries}, it will automatically detect that it needs to
%call \app{xindy}. If you don't use \app{makeglossaries}, you need to
%remember to use \app{xindy} not \app{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 \sectionref{sec:xindy} for further details on using \app{xindy}
%with the \styfmt{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 \app{makeglossaries}.
%
%\item[\pkgopt{translate}] This is a boolean option. The default is
%\pkgoptval{true}{translate} if \sty{babel}, \sty{polyglossia} or 
%\sty{translator} have been loaded, otherwise the default value is
%\pkgoptval{false}{translate}.
%
%  \begin{description}
%  \item[{\pkgopt[true]{translate}}] If \sty{babel} has been loaded
%  and the \sty{translator} package is installed, \sty{translator}
%  will be loaded and the translations will be provided by the
%  \sty{translator} package interface. You can modify the 
%  translations by providing your own dictionary. If the 
%  \sty{translator} package isn't installed and \sty{babel} is
%  loaded, the \sty{glossaries-babel} package will 
%  be loaded and the translations will be provided using \styfmt{babel}'s
%  \cs{addto}\cs{caption}\meta{language} mechanism. If 
%  \sty{polyglossia} has been loaded, \sty{glossaries-polyglossia}
%  will be loaded.
%
%  \item[{\pkgopt[false]{translate}}] Don't provide translations, even
%  if \sty{babel} or \sty{polyglossia} has been loaded. You can 
%  then provide you're own translations or explicitly load 
%  \sty{glossaries-babel} or \sty{glossaries-polyglossia}.
%  \end{description}
%
%See \sectionref{sec:fixednames} for further details.
%
%\item[\pkgopt{hyperfirst}] This is a boolean option that specifies
%whether each term has a hyperlink on \firstuse. The default is 
%\pkgopt[true]{hyperfirst} (terms on first use have a hyperlink, 
%unless explicitly suppressed using starred versions of commands
%such as \cs{gls*}).
%
%\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
%\sectionref{sec:glslink}, \sectionref{sec:glsadd} or
%\sectionref{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 \app{makeglossaries} can be
%used to call \app{makeindex} or \app{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
%\sectionref{sec:makeglossaries} for further details.
%
%The command
%\begin{definition}[\DescribeMacro{\makeglossaries}]
%\cs{makeglossaries}
%\end{definition}
%must be placed in the preamble in order to create the customised
%\app{makeindex} (\filetype{.ist}) or \app{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 \styfmt{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}
%
%You can suppress the creation of the customised \app{xindy}
%or \app{makeindex} style file using
%\begin{definition}[\DescribeMacro{\noist}]
%\cs{noist}
%\end{definition}
%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 \app{makeindex}) or 
%\ics{jobname}\filetype{.xdy} (for \app{xindy}). This name may be
%changed using:
%\begin{definition}[\DescribeMacro{\setStyleFile}]
%\cs{setStyleFile}\marg{name}
%\end{definition}
%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
%\begin{definition}[\DescribeMacro{\glsSetCompositor}]
%\cs{glsSetCompositor}\marg{symbol}
%\end{definition}
%For example:
%\begin{verbatim}
%\glsSetCompositor{-}
%\end{verbatim}
%Note that this command must be used before \cs{makeglossaries}.
%
%If you use \app{xindy}, you can have a different compositor for page
%numbers starting with an uppercase alphabetical character using:
%\begin{definition}[\DescribeMacro{\glsSetAlphaCompositor}]
%\cs{glsSetAlphaCompositor}\marg{symbol}
%\end{definition}
%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 \sectionref{sec:numberlists} for further information about
%number lists\iterm{number list}.
%
%New glossary entries are defined using the command:
%\begin{definition}[\DescribeMacro{\newglossaryentry}]
%\cs{newglossaryentry}\marg{label}\marg{key-val list}
%\end{definition}
%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{description} and either \gloskey{name} or \gloskey{parent}.
%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 
%\begin{definition}[\DescribeMacro{\nopostdesc}]
%\cs{nopostdesc}
%\end{definition}
%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
%\begin{definition}[\DescribeMacro{\glspar}]
%\cs{glspar}
%\end{definition}
%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 \sectionref{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
%\qt{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 \qt{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 \app{makeindex}
%or \app{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{user1}, \ldots, \gloskey{user6}}] Six additional
%keys provided for any additional information the user may want
%to specify.  (For example, an associated dimension or an alternative
%plural.)
%
%\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 \qt{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 \sectionref{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 \sty{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 \app{makeindex}
%whereas \app{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 
%\begin{definition}[\DescribeMacro{\glspluralsuffix}]
%\cs{glspluralsuffix}
%\end{definition}
%to the singular form. This command defaults to the letter \qt{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 \qt{cow} and plural form
%is \qt{cows}. However, if you are writing in archaic English, you
%may want to use \qt{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 and one of the user keys to specify the
%other plural form. For example:
%\begin{verbatim}
%\newglossaryentry{cow}{name=cow,description={a fully grown
%female of any bovine animal (plural cows, archaic plural kine)},
%user1={kine}}
%\end{verbatim}
%You can then use \verb|\glspl{cow}| to produce \qt{cows} and 
%\verb|\glsuseri{cow}| to produce \qt{kine}. You can, of course,
%define an easy to remember synonym. For example:
%\begin{verbatim}
%\let\glsaltpl\glsuseri
%\end{verbatim}
%Then you don't have to remember which key you used to store the
%alternative plural.
%
%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 \sectionref{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 \qt{glossary} can mean a list of technical
%words or a collection of glosses. In both cases the plural is
%\qt{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}
%
%You can store all your glossary entry definitions in another
%file and use:
%\begin{definition}[\DescribeMacro{\loadglsentries}]
%\cs{loadglsentries}\oarg{type}\marg{filename}
%\end{definition}
%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
%\sectionref{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 \sectionref{sec:glslink} 
%and \sectionref{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 \app{makeindex} and \app{xindy} concatenate a
%sequence of 3 or more consecutive pages into a range. With 
%\app{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 \app{makeindex} and \app{xindy}, you can replace
%the separator and the closing number in the range using:
%\begin{definition}[\DescribeMacro{\glsSetSuffixF}]
%\cs{glsSetSuffixF}\marg{suffix}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsSetSuffixFF}]
%\cs{glsSetSuffixFF}\marg{suffix}
%\end{definition}
%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 \app{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 \sty{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 \app{makeindex} or \app{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 \sectionref{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
%\styfmt{glossaries} package in conjunction with the \sty{hyperref}
%package. Instead, use one of the commands listed in
%\sectionref{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 
%\begin{definition}[\DescribeMacro{\glstextformat}]
%\cs{glstextformat}\marg{text}
%\end{definition}
%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 \sectionref{sec:glsunset} for 
%commands that unset or reset this conditional.
%
%The command:
%\begin{definition}[\DescribeMacro{\glslink}]
%\cs{glslink}\oarg{options}\marg{label}\marg{text}
%\end{definition}
%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. (Note that this command doesn't affect the \firstuseflag:
%use \ics{glsdisp} instead.) 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 \app{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 \app{xindy} instead of \app{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
%\app{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
%\sectionref{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
%\sty{hyperref} package) as the locations may not refer to a page
%number.  Instead, the \styfmt{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. \ifpdf (See also \sectionref{sec:code:printglos}.) \fi 
%Remember that if you use \app{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 \sectionref{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}
%There is also a starred version:
%\begin{definition}[\DescribeMacro{\glslink*}]
%\cs{glslink*}\oarg{options}\marg{label}\marg{text}
%\end{definition}
%which is equivalent to \cs{glslink}, except it sets
%\texttt{hyper=false}. Similarly, all the following commands 
%described in this section also have a starred version that disables
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\gls}]
%\cs{gls}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Gls}]
%\cs{Gls}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%and
%\begin{definition}[\DescribeMacro{\GLS}]
%\cs{GLS}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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 \sectionref{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:
%\begin{definition}[\DescribeMacro{\glspl}]
%\cs{glspl}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glspl}]
%\cs{Glspl}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSpl}]
%\cs{GLSpl}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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 
%\sectionref{sec:glsdisplay}). Instead, you can use:
%\begin{definition}[\DescribeMacro{\glsdisp}]
%\cs{glsdisp}\oarg{options}\marg{label}\marg{link text}
%\end{definition}
%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.) This command affects the \firstuseflag,
%and uses \ics{glsdisplay} or \ics{glsdisplayfirst}.
%
%The command:
%\begin{definition}[\DescribeMacro{\glstext}]
%\cs{glstext}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Glstext}]
%\cs{Glstext}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLStext}]
%\cs{GLStext}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\glsfirst}]
%\cs{glsfirst}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Glsfirst}]
%\cs{Glsfirst}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSfirst}]
%\cs{GLSfirst}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\glsplural}]
%\cs{glsplural}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Glsplural}]
%\cs{Glsplural}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSplural}]
%\cs{GLSplural}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\glsfirstplural}]
%\cs{glsfirstplural}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Glsfirstplural}]
%\cs{Glsfirstplural}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSfirstplural}]
%\cs{GLSfirstplural}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\glsname}]
%\cs{glsname}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Glsname}]
%\cs{Glsname}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSname}]
%\cs{GLSname}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\glssymbol}]
%\cs{glssymbol}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Glssymbol}]
%\cs{Glssymbol}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSsymbol}]
%\cs{GLSsymbol}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\glsdesc}]
%\cs{glsdesc}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\Glsdesc}]
%\cs{Glsdesc}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSdesc}]
%\cs{GLSdesc}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%The command:
%\begin{definition}[\DescribeMacro{\glsuseri}]
%\cs{glsuseri}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{user1} 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:
%\begin{definition}[\DescribeMacro{\Glsuseri}]
%\cs{Glsuseri}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSuseri}]
%\cs{GLSuseri}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%As before, these commands also have a starred version that disable
%the hyperlink. Similarly for the other user keys:
%\begin{definition}[\DescribeMacro{\glsuserii}]
%\cs{glsuserii}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsuserii}]
%\cs{Glsuserii}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSuserii}]
%\cs{GLSuserii}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsuseriii}]
%\cs{glsuseriii}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsuseriii}]
%\cs{Glsuseriii}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSuseriii}]
%\cs{GLSuseriii}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsuseriv}]
%\cs{glsuseriv}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsuseriv}]
%\cs{Glsuseriv}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSuseriv}]
%\cs{GLSuseriv}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsuserv}]
%\cs{glsuserv}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsuserv}]
%\cs{Glsuserv}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSuserv}]
%\cs{GLSuserv}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsuservi}]
%\cs{glsuservi}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsuservi}]
%\cs{Glsuservi}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\GLSuservi}]
%\cs{GLSuservi}\oarg{options}\marg{text}\oarg{insert}
%\end{definition}
%
%
%
%\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:
%\begin{definition}[\DescribeMacro{\glsdisplayfirst}]
%\cs{glsdisplayfirst}\marg{first/first plural}\marg{description}\marg{symbol}\marg{insert}
%\end{definition}
%which is used the
%first time a glossary entry is used\ifirstuse\ in the text and
%\begin{definition}[\DescribeMacro{\glsdisplay}]
%\cs{glsdisplay}\marg{text/plural}\marg{description}\marg{symbol}\marg{insert}
%\end{definition}
%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
%\begin{definition}[\DescribeMacro{\glslabel}]
%\cs{glslabel}
%\end{definition}
%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
%\sectionref{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
%\qt{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 \qt{distance's (km)}
%rather than \qt{distance (km)'s} which looks a bit odd (even though
%it may be in the context of \qt{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 \qt{\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 \ics{gls}, \ics{glspl}, their
%uppercase variants and \ics{glsdisp}.  If you only
%want the change to affect entries for a given glossary, then you need
%to use
%\begin{definition}[\DescribeMacro{\defglsdisplay}]
%\cs{defglsdisplay}\oarg{type}\marg{definition}
%\end{definition}
%and
%\begin{definition}[\DescribeMacro{\defglsdisplayfirst}]
%\cs{defglsdisplayfirst}\oarg{type}\marg{definition}
%\end{definition}
%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}, their uppercase variants and \cs{glsdisp}. 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 it will be displayed as:
%\qt{set (denoted $S$)} (assuming \ics{gls} was used).
%
%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 \sty{hyperref} or \sty{html} packages prior to
%loading the \styfmt{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:
%\begin{definition}[\DescribeMacro{\glsdisablehyper}]
%\cs{glsdisablehyper}
%\end{definition}
%and
%\begin{definition}[\DescribeMacro{\glsenablehyper}]
%\cs{glsenablehyper}
%\end{definition}
%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 \sty{hyperref} package).
%
%You can disable just the first use links using the package
%option \pkgopt[false]{hyperfirst}. Note that this option only
%affects commands that recognise the \firstuse\ flag, for example
%\ics{gls}, \ics{glspl} and \ics{glsdisp} but not \ics{glslink}.
%
%
%\subsection{Adding an Entry to the Glossary Without Generating Text}
%\label{sec:glsadd}
%
%It is possible to add a line in the glossary file without
%generating any text at that point in the document using:
%\begin{definition}[\DescribeMacro{\glsadd}]
%\cs{glsadd}\oarg{options}\marg{label}
%\end{definition}
%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}
%
%To add all entries that have been defined, use:
%\begin{definition}[\DescribeMacro{\glsaddall}]
%\cs{glsaddall}\oarg{options}
%\end{definition}
%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
%\app{makeglossaries}:
%\begin{prompt}
%latex filename
%makeglossaries filename
%latex filename
%makeglossaries filename
%latex filename
%\end{prompt}
%
%\item As described in \sectionref{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
%\sectionref{sec:glslink} or \sectionref{sec:glsadd}.
%
%You can optionally override the \qt{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
%\begin{definition}[\DescribeMacro{\glssee}]
%\cs{glssee}\oarg{tag}\marg{label}\marg{xr label list}
%\end{definition}
%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 \qt{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 \qt{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.
%\begin{definition}[\DescribeMacro{\glsentryname}]
%\cs{glsentryname}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryname}]
%\cs{Glsentryname}\marg{label}
%\end{definition}
%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.
%\begin{definition}[\DescribeMacro{\glsentrytext}]
%\cs{glsentrytext}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentrytext}]
%\cs{Glsentrytext}\marg{label}
%\end{definition}
%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.
%\begin{definition}[\DescribeMacro{\glsentryplural}]
%\cs{glsentryplural}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryplural}]
%\cs{Glsentryplural}\marg{label}
%\end{definition}
%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.
%\begin{definition}[\DescribeMacro{\glsentryfirst}]
%\cs{glsentryfirst}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryfirst}]
%\cs{Glsentryfirst}\marg{label}
%\end{definition}
%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.
%\begin{definition}[\DescribeMacro{\glsentryfirstplural}]
%\cs{glsentryfirstplural}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryfirstplural}]
%\cs{Glsentryfirstplural}\marg{label}
%\end{definition}
%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.
%\begin{definition}[\DescribeMacro{\glsentrydesc}]
%\cs{glsentrydesc}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentrydesc}]
%\cs{Glsentrydesc}\marg{label}
%\end{definition}
%These commands display the description for the glossary entry given
%by \meta{label}. \cs{Glsentrydesc} makes the first letter uppercase.
%\begin{definition}[\DescribeMacro{\glsentrydescplural}]
%\cs{glsentrydescplural}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentrydescplural}]
%\cs{Glsentrydescplural}\marg{label}
%\end{definition}
%These commands display the plural description for the glossary entry
%given by \meta{label}. \cs{Glsentrydescplural} makes the first
%letter uppercase.
%\begin{definition}[\DescribeMacro{\glsentrysymbol}]
%\cs{glsentrysymbol}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentrysymbol}]
%\cs{Glsentrysymbol}\marg{label}
%\end{definition}
%These commands display the symbol for the glossary entry given by
%\meta{label}. \cs{Glsentrysymbol} makes the first letter uppercase.
%\begin{definition}[\DescribeMacro{\glsentrysymbolplural}]
%\cs{glsentrysymbolplural}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentrysymbolplural}]
%\cs{Glsentrysymbolplural}\marg{label}
%\end{definition}
%These commands display the plural symbol for the glossary entry
%given by \meta{label}. \cs{Glsentrysymbolplural} makes the first
%letter uppercase.
%\begin{definition}[\DescribeMacro{\glsentryuseri}]
%\cs{glsentryuseri}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryuseri}]
%\cs{Glsentryuseri}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsentryuserii}]
%\cs{glsentryuserii}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryuserii}]
%\cs{Glsentryuserii}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsentryuseriii}]
%\cs{glsentryuseriii}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryuseriii}]
%\cs{Glsentryuseriii}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsentryuseriv}]
%\cs{glsentryuseriv}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryuseriv}]
%\cs{Glsentryuseriv}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsentryuserv}]
%\cs{glsentryuserv}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryuserv}]
%\cs{Glsentryuserv}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsentryuservi}]
%\cs{glsentryuservi}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Glsentryuservi}]
%\cs{Glsentryuservi}\marg{label}
%\end{definition}
%These commands display the value of the user keys for the glossary
%entry given by \meta{label}.
%\begin{definition}[\DescribeMacro{\glshyperlink}]
%\cs{glshyperlink}\oarg{link text}\marg{label}
%\end{definition}
%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 \sectionref{sec:glslink} or \sectionref{sec:glsadd}
%otherwise you will end up with a broken link.
%\end{important}
%
%For further information see \ifpdf
%\sectionref{sec:code:glsnolink}\else the section \qt{Displaying
%entry details without adding information to the glossary} in the
%document \url{glossaries.pdf}\fi.
%
%
%\subsection{Displaying a glossary}
%\label{sec:printglossary}
%
%The command
%\begin{definition}[\DescribeMacro{\printglossaries}]
%\cs{printglossaries}
%\end{definition}
%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 \app{makeglossaries} or have directly used
%\app{makeindex} or \app{xindy} (as described in
%\sectionref{sec:makeglossaries}). If the glossary 
%still does not appear after you re-\LaTeX\ your document, check the
%\app{makeindex}/\app{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.
%
%An individual glossary can be displayed using:
%\begin{definition}[\DescribeMacro{\printglossary}]
%\cs{printglossary}\oarg{options}
%\end{definition}
%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). It may also be used for the page header,
%depending on the page style. 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 \sectionref{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}
%
%By default, the glossary is started either by \cs{chapter*} or by
%\cs{section*}, depending on whether or not \cs{chapter} is defined.
%This can be overridden by the \pkgopt{section} package option or the
%\cs{setglossarysection} command. Numbered sectional units can be
%obtained using the \pkgopt{numberedsection} package option. Each
%glossary sets the page header via the command \ics{glossarymark}. If
%this mechanism is unsuitable for your chosen class file or page
%style package, you will need to redefine \ics{glossarymark}. Further
%information about these options and commands is given in
%\sectionref{sec:pkgopts}.
%
%Information can be added to the start of the glossary (after the
%title and before the main body of the glossary) by redefining
%\begin{definition}[\DescribeMacro{\glossarypreamble}]
%\cs{glossarypreamble}
%\end{definition}
%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.)
%
%There is an analogous command called
%\begin{definition}[\DescribeMacro{\glossarypostamble}]
%\cs{glossarypostamble}
%\end{definition}
%which is placed at the end of each glossary.
%
%\subsubsection{Changing the way the entry name appears in the glossary}
%\label{sec:glsnamefont}
%
%Within each glossary, each entry name is formatted according to
%\begin{definition}[\DescribeMacro{\glsnamefont}]
%\cs{glsnamefont}\marg{name}
%\end{definition}
%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 \sty{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
%\sty{glossary-long} and \sty{glossary-super} style files) the name
%will appear in the normal font. The hierarchical glossary styles
%(defined in the \sty{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 \app{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 
%\app{xindy} syntax.
%
%\sectionref{sec:makeglossaries} covers how to use the external
%indexing application. This section covers the commands provided
%by the \styfmt{glossaries} package that allow you to adjust the
%\app{xindy} style file (\filetype{.xdy}) and parameters.
%
%To assist writing information to the \app{xindy} style
%file, the \styfmt{glossaries} package provides the following
%commands:
%\begin{definition}[\DescribeMacro{\glsopenbrace}]
%\cs{glsopenbrace}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsclosebrace}]
%\cs{glsclosebrace}
%\end{definition}
%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. \sty{ngerman}) you can use:
%\begin{definition}[\DescribeMacro{\glsquote}]
%\cs{glsquote}\marg{text}
%\end{definition}
%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 \app{xindy} style file than is
%available through the \LaTeX\ commands provided by the
%\styfmt{glossaries} package, you will need to edit the \app{xindy}
%style file. In which case, you must use \ics{noist} to prevent the
%style file from being overwritten by the \styfmt{glossaries}
%package. For additional information about \app{xindy}, read the
%\app{xindy} documentation.
%
%\paragraph{Language and Encodings}
%When you use \app{xindy}, you need to specify the language
%and encoding used (unless you have written your own custom
%\app{xindy} style file that defines the relevant alphabet
%and sort rules). If you use \app{makeglossaries},
%this information is obtained from the document's auxiliary 
%(\filetype{.aux}) file.  The \styfmt{glossaries} package attempts to 
%find the root language, but in the event that it gets it wrong or if 
%\app{xindy} doesn't support that language, then you can
%specify the language using:
%\begin{definition}[\DescribeMacro{\GlsSetXdyLanguage}]
%\cs{GlsSetXdyLanguage}\oarg{glossary type}\marg{language}
%\end{definition}
%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 \sty{inputenc} package is used, the encoding will be
%obtained from the value of \ics{inputencodingname}. 
%Alternatively, you can specify the encoding using:
%\begin{definition}[\DescribeMacro{\GlsSetXdyCodePage}]
%\cs{GlsSetXdyCodePage}\marg{code}
%\end{definition}
%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 \app{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 \app{makeglossaries}. If
%you call \app{xindy} without \app{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 \app{xindy} style file, but if you want to use another 
%attribute, you need to add it using:
%\begin{definition}[\DescribeMacro{\GlsAddXdyAttribute}]
%\cs{GlsAddXdyAttribute}\marg{name}
%\end{definition}
%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 \app{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 \sty{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,
%\app{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 \sectionref{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
%\sectionref{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:
%\begin{definition}[\DescribeMacro{\GlsSetXdyLocationClassOrder}]
%\cs{GlsSetXdyLocationClassOrder}\marg{location names}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\GlsSetXdyMinRangeLength}]
%\cs{GlsSetXdyMinRangeLength}\marg{n}
%\end{definition}
%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 \app{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 \sectionref{sec:numberlists} for further details.
%
%
%\paragraph{Glossary Groups}
%The glossary is divided into groups according to the first
%letter of the sort key. The \styfmt{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 \qt{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}
%
%A new glossary can be defined using:
%\begin{definition}[\DescribeMacro{\newglossary}]
%\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}\marg{title}\oarg{counter}
%\end{definition}
%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
%\sectionref{sec:numberlists}). The first optional argument specifies
%the extension for the \app{makeindex} or \app{xindy} transcript file
%(this information is only used by \app{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} (unless the
%\pkgopt{nomain} package option is used). 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}. Note that if you are using
%the main glossary as your list of acronyms, you need to declare
%it as a list of acronyms using the package option 
%\pkgopt{acronymlists}.
%
%\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}
%
%You may have noticed in \sectionref{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
%\styfmt{glossaries} package defines the command:
%\begin{definition}[\DescribeMacro{\newacronym}]
%\cs{newacronym}\oarg{key-val
%list}\marg{label}\marg{abbrv}\marg{long}
%\end{definition}
%By default, this is equivalent to:
%\begin{display}\ttfamily
%\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}}\}
%\end{display}
%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. If you want more than one list of acronyms, you must
%identify the others using the package options \pkgopt{acronymlists}.
%This ensures that options such as \pkgopt{footnote} and
%\pkgopt{smallcaps} work for the additional lists of acronyms.
%
%\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 \sectionref{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 \qt{identification number (IDN)} on
%\firstuse\ and \qt{IDN} on subsequent uses.
%
%This section describes acronyms that have been defined using
%\ics{newacronym}. If you prefer to define your acronyms using
%\ics{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 \sectionref{sec:glsdisplay}).
%Likewise you should ignore the package option \pkgopt{shortcuts} and
%the new commands described in this section, such as \ics{acrshort},
%as they vary according to the definition of \ics{newacronym}.
%
%If you want to define your own custom acronym style, see
%\sectionref{sec:customacronym}.
%
%\begin{important}
%If you try using \ics{newglossaryentry} for entries in a designated
%list of acronyms in combination with any of the above named package 
%options you are likely to get unexpected results such as empty
%brackets or empty footnotes.
%\end{important}
%
%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:
%\begin{definition}[\DescribeMacro{\acronymfont}]
%\cs{acronymfont}\marg{text}
%\end{definition}
%and
%\begin{definition}[\DescribeMacro{\firstacronymfont}]
%\cs{firstacronymfont}\marg{text}
%\end{definition}
%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 \sty{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
%\styfmt{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 \styfmt{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
%\sectionref{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}]\ifpdf\mbox{}\par\fi
%When these two package options are used together, the \firstuse\ displays
%the entry as:
%\begin{display}
%\cs{firstacronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long} 
%\end{display}
%while subsequent use displays the entry as:
%\begin{display}
%\cs{acronymfont}\marg{abbrv}\meta{insert}
%\end{display}
%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 \styfmt{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}]\ifpdf\mbox{}\par\fi
%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:
%\begin{display}
%\meta{long}\meta{insert}
%\end{display}
%
%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}]\ifpdf\mbox{}\par\fi
%This package option displays the entry on \firstuse\ as:
%\begin{display}
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})
%\end{display}
%while subsequent use displays the entry as:
%\begin{display}
%\cs{acronymfont}\marg{abbrv}\meta{insert}
%\end{display}
%Note also that if this package option is used, the \styfmt{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
%\begin{definition}[\DescribeMacro{\acrnameformat}]
%\cs{acrnameformat}\marg{short}\marg{long}
%\end{definition}
%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}]\ifpdf\mbox{}\par\fi
%This package option displays the entry on \firstuse\ as:
%\begin{display}
%\cs{firstacronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long}
%\end{display}
%while subsequent use displays the entry as:
%\begin{display}
%\cs{acronymfont}\marg{abbrv}\meta{insert}
%\end{display}
%Acronyms will be sorted according to the short form.
%
%Note also that if this package option is used, the \styfmt{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
%\urlref{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=atsigns}{\cs{@}
%and \texttt{@} in macro names} for further details.)
%
%\item[\pkgopt{smallcaps}]\ifpdf\mbox{}\par\fi
%If neither the \pkgopt{footnote} nor \pkgopt{description} options
%have been set, this option displays the entry on \firstuse\ as:
%\begin{display}
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})
%\end{display}
%while subsequent use displays the entry as:
%\begin{display}
%\cs{acronymfont}\marg{abbrv}\meta{insert}
%\end{display}
%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.
%\ifpdf(Recall that "\textsc{abc}" produces \textsc{abc} whereas 
%"\textsc{ABC}" produces \textsc{ABC}.)\fi
%\end{important}
%
%Note also that if this package option is used, the \styfmt{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}]\ifpdf\mbox{}\par\fi
%If neither the \pkgopt{footnote} nor \pkgopt{description} options
%have been set, this option displays the entry on \firstuse\ as:
%\begin{display}
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})
%\end{display}
%while subsequent use displays the entry as:
%\begin{display}
%\cs{acronymfont}\marg{abbrv}\meta{insert}
%\end{display}
%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
%\sty{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 \styfmt{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]\ifpdf \mbox{}\par\fi
%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:
%\begin{display}
%\meta{long} (\meta{abbrv})\meta{insert}
%\end{display}
%while subsequent use displays the entry as:
%\begin{display}
%\meta{abbrv}\meta{insert}
%\end{display}
%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 \sectionref{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
%\styfmt{glossaries} package provides commands that are set according
%to the package options. These are as follows:
%\begin{definition}[\DescribeMacro{\acrshort}]
%\cs{acrshort}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Acrshort}]
%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\ACRshort}]
%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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}.
%\begin{definition}[\DescribeMacro{\acrlong}]
%\cs{acrlong}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Acrlong}]
%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\ACRlong}]
%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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.
%\begin{definition}[\DescribeMacro{\acrfull}]
%\cs{acrfull}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\Acrfull}]
%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%\begin{definition}[\DescribeMacro{\ACRfull}]
%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}
%\end{definition}
%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 \qt{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{Defining A Custom Acronym Style}
%\label{sec:customacronym}
%
%You may find that the predefined acronyms styles that come with the
%\styfmt{glossaries} package don't suit your requirements. In this
%case you can define your own style. This is done by redefining the
%following commands:
%\begin{definition}[\DescribeMacro{\CustomAcronymFields}]
%\cs{CustomAcronymFields}
%\end{definition}
%This command sets up the keys for \ics{newglossaryentry} when
%you define an acronym using \ics{newacronym}. Within the definition
%of \cs{CustomAcronymFields}, you may use \cs{the}\ics{glslongtok} to
%access the long form, \cs{the}\ics{glsshorttok} to access the short
%form and \cs{the}\ics{glslabeltok} to access the label. This command
%is typically used to set the \gloskey{name}, \gloskey{first},
%\gloskey{firstplural}, \gloskey{text} and \gloskey{plural} keys. It
%may also be used to set the \gloskey{symbol} or
%\gloskey{description} keys depending on your requirements.
%
%\begin{definition}[\DescribeMacro{\SetCustomDisplayStyle}]
%\cs{SetCustomDisplayStyle}\marg{type}
%\end{definition}
%This is used to set up the display style for the glossary given by
%\meta{type}. This should typically just use \ics{defglsdisplayfirst}
%and \ics{defglsdisplay}.
%
%Once you have redefined \cs{CustomAcronymFields} and
%\cs{SetCustomDisplayStyle}, you must then switch to this style using
%\begin{definition}[\DescribeMacro{\SetCustomStyle}]
%\cs{SetCustomStyle}
%\end{definition}
%Note that you may still use the \pkgopt{shortcuts} package option
%with your custom style.
%
%\begin{important}
%If you omit \cs{SetCustomStyle}, or use it before you redefine
%\cs{CustomAcronymFields} and \cs{SetCustomDisplayStyle}, your new
%style won't be correctly implemented. You must set up the custom style 
%before defining new acronyms. The acronyms must be defined using
%\ics{newacronym} not \ics{newglossaryentry}.
%\end{important}
%
%As an example, suppose I want my acronym on first use to have the
%short form in the text and the long form with the description in a
%footnote. Suppose also that I want the short form to be put in small
%caps in the main body of the document, but I want it in normal
%capitals in the list of acronyms. In my list of acronyms, I want the
%long form as the name with the short form in brackets followed by
%the description.
%
%First, I need to redefine \ics{CustomAcronymFields} so that
%\ics{newacronym} will correctly set the \gloskey{name}, 
%\gloskey{text} and \gloskey{plural} keys. I want the long form to be
%stored in the \gloskey{name} and the short form to be stored in
%\gloskey{text}. In addition, I'm going to set the \gloskey{symbol}
%to the short form in upper case so that it will appear in the list
%of acronyms.
%
%\begin{verbatim}
%\renewcommand*{\CustomAcronymFields}{%
%  name={\the\glslongtok},%
%  symbol={\MakeUppercase{\the\glsshorttok}},%
%  text={\textsc{\the\glsshorttok}},%
%  plural={\textsc{\the\glsshorttok}s}%
%}
%\end{verbatim}
%
%Note that in this case I haven't bothered with \ics{acrpluralsuffix}
%and have just inserted an \qt{s}.
%
%When I use the custom acronym style, the short form is stored in
%\gloskey{user1}, the plural short form is stored in \gloskey{user2},
%the long form is stored in \gloskey{user3} and the plural long form
%is stored in \gloskey{user4}. So when I use \ics{defglsdisplayfirst}
%and \ics{defglsdisplay}, I can use \ics{glsentryuseriii} to access
%the long form. Recall from \sectionref{sec:glsdisplay}, that the
%optional argument to \ics{defglsdisplayfirst} and \ics{defglsdisplay}
%indicates the glossary type. This is passed to
%\ics{SetCustomDisplayStyle}. The mandatory argument sets up the
%definition of \ics{glsdisplayfirst} and \ics{glsdisplay} for the
%given glossary, where the first argument corresponds to the
%\gloskey{first}, \gloskey{firstplural}, \gloskey{text} or 
%\gloskey{plural}, as appropriate, the second argument corresponds to
%the \gloskey{description}, the third corresponds to the
%\gloskey{symbol} and the fourth argument is the inserted text.
%
%\begin{verbatim}
%\renewcommand*{\SetCustomDisplayStyle}[1]{%
%  \defglsdisplayfirst[#1]{##1##4\protect\footnote{%
%    \glsentryuseriii{\glslabel}: ##2%
%  }}
%  \defglsdisplay[#1]{##1##4}%
%}
%\end{verbatim}
%
%Since we have a definition inside a definition, \verb|#1| refers to
%the argument of \ics{SetCustomDisplayStyle}, and \verb|##1|, \ldots,
%\verb|##4|, refer to the arguments of \ics{glsdisplayfirst} and
%\ics{glsdisplay}.
%
%Now that I've redefined \ics{CustomAcronymFields} and
%\ics{SetCustomDisplayStyle}, I can set this style using
%\begin{verbatim}
%\SetCustomStyle
%\end{verbatim}
%and now I can define my acronyms:
%\begin{verbatim}
%\newacronym[description={set of tags for use in developing hypertext
%documents}]{html}{html}{Hyper Text Markup Language}
%
%\newacronym[description={language used to describe the layout of a
%document written in a markup language}]{css}{css}{Cascading Style
%Sheet}
%\end{verbatim}
%
%Note that since I've used the description in the main body of the
%text, I need to switch off the sanitization otherwise any commands
%within the description won't get interpreted. Also I want to use the
%\sty{hyperref} package, but this will cause a problem on first use
%as I'll get nested hyperlinks, so I need to switch off the
%hyperlinks on first use. In addition, I want to use a glossary style
%that displays the symbol. Therefore, in my preamble I have:
%
%\begin{verbatim}
%\usepackage[colorlinks]{hyperref}
%\usepackage[acronym,         % create list of acronyms
%            nomain,          % don't need main glossary for this example
%            style=tree,      % need a style that displays the symbol
%            hyperfirst=false,% don't hyperlink first use
%            sanitize=none    % switch off sanitization as description 
%                             % will be used in the main text
%            ]{glossaries}
%\end{verbatim}
%
%Note that I haven't used the \pkgopt{description} or
%\pkgopt{footnote} package options.
%
%\subsubsection{Upgrading From the glossary Package}
%\label{sec:oldacronym}
%Users of the obsolete \sty{glossary} package may recall that
%the syntax used to define new acronyms has changed with the
%replacement \styfmt{glossaries} package. In addition, the old
%\sty{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 \styfmt{glossaries} package\footnote{as from version 1.18} 
%provides the command:
%\begin{definition}[\DescribeMacro{\oldacronym}]
%\cs{oldacronym}\oarg{label}\marg{abbrv}\marg{long}\marg{key-val list}
%\end{definition}
%This uses the same syntax as the \sty{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
%\sty{xspace} package.
%\end{important}
%
%The \styfmt{glossaries} package doesn't load the \sty{xspace} package
%since there are both advantages and disadvantages to using
%\ics{xspace} in \cs{}\meta{label}. If you don't use the 
%\sty{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 \sty{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 \qt{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
%\sty{xspace} package has been loaded. As can be seen from the
%final row in the table, the \sty{xspace} package prevents the
%optional argument from being recognised.
%
%\begin{table}[htbp]
%\caption[The effect of using xspace]{The effect of using 
%\styfmt{xspace} with \cs{oldacronym}}
%\label{tab:xspace}
%\vskip\baselineskip
%\centering
%\begin{tabular}{lll}
%\bfseries Code & \bfseries With \styfmt{xspace} &
%\bfseries Without \styfmt{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:
%\begin{definition}[\DescribeMacro{\glsreset}]
%\cs{glsreset}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glslocalreset}]
%\cs{glslocalreset}\marg{label}
%\end{definition}
%while the latter can be achieved by one of the following commands:
%\begin{definition}[\DescribeMacro{\glsunset}]
%\cs{glsunset}\marg{label}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glslocalunset}]
%\cs{glslocalunset}\marg{label}
%\end{definition}
%You can also reset or unset all entries for a given glossary or list of
%glossaries using:
%\begin{definition}[\DescribeMacro{\glsresetall}]
%\cs{glsresetall}\oarg{glossary list}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glslocalresetall}]
%\cs{glslocalresetall}\oarg{glossary list}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glsunsetall}]
%\cs{glsunsetall}\oarg{glossary list}
%\end{definition}
%\begin{definition}[\DescribeMacro{\glslocalunsetall}]
%\cs{glslocalunsetall}\oarg{glossary list}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\ifglsused}]
%\cs{ifglsused}\marg{label}\marg{true part}\marg{false part}
%\end{definition}
%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 \styfmt{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 
%\app{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 long*3col* & 1 & \tick & \\
%\ttfamily long4col* & 1 & \tick & \tick \\
%\ttfamily altlong*4col* & 1 & \tick & \tick \\
%\ttfamily long* & 1 & \tick & \\
%\ttfamily super*3col* & 1 & \tick & \\
%\ttfamily super4col* & 1 & \tick & \tick \\
%\ttfamily altsuper*4col* & 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 \gloskey[printglossary]{style} key in the optional
%argument to \ics{printglossary} or using the command:
%\begin{definition}[\DescribeMacro{\glossarystyle}]
%\cs{glossarystyle}\marg{style-name}
%\end{definition}
%Some of the glossary styles may also be set using the \pkgopt{style} 
%package option, it depends if the package in which they are defined
%is automatically loaded by the \styfmt{glossaries} package.
%
%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
%unless you explicitly load the relevant package.}
%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
%\begin{definition}[\DescribeMacro{\glspostdescription}]
%\cs{glspostdescription}
%\end{definition}
%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
%\sty{glossary-list}. Since they all use the \env{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 automatically be available unless you use the
%\pkgopt{nolist} or \pkgopt{nostyles} package options.
%
%\begin{description}
%\item[list] The \glostyle{list} style uses the \env{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
%\begin{definition}[\DescribeMacro{\glshypernavsep}]
%\cs{glshypernavsep}
%\end{definition}
%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 \env{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
%\begin{definition}[\DescribeMacro{\glslistdottedwidth}]
%\cs{glslistdottedwidth}
%\end{definition}
%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
%\sty{glossary-long}. Since they all use the \env{longtable}
%environment, they are governed by the same parameters as that
%environment.  Note that these styles will automatically be available
%unless you use the \pkgopt{nolong} or \pkgopt{nostyles} package
%options.  These styles fully justify the description and page list
%columns.  If you want ragged right formatting instead, use the
%analogous styles described in \sectionref{sec:longraggedstyles}.
%
%
%\begin{description}
%\item[long] The \glostyle{long} style uses the \env{longtable}
%environment (defined by the \sty{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{Longtable Styles (Ragged Right)}
%\label{sec:longraggedstyles}
%
%The styles described in this section are all defined in the package
%\sty{glossary-longragged}. These styles are analogous to those
%defined in \sty{glossary-long} but the multiline columns are left
%justified instead of fully justified. Since these styles all use the
%\env{longtable} environment, they are governed by the same
%parameters as that environment. The \sty{glossary-longragged}
%package additionally requires the \sty{array} package.  Note that
%these styles will only be available if you explicitly load
%\sty{glossary-longragged}:
%\begin{verbatim}
%\usepackage{glossaries}
%\usepackage{glossary-longragged}
%\end{verbatim}
%Note that you can't set these styles using the \pkgopt{style}
%package option since the styles aren't defined until after
%the \styfmt{glossaries} package has been loaded.
%
%\begin{description}
%\item[longragged] The \glostyle{longragged} style has two
%columns: the first column contains the entry's name and the second
%column contains the (left-justified) 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[longraggedborder] The \glostyle{longraggedborder} style is like
%\glostyle{longragged} but has horizontal and vertical lines around it.
%
%\item[longraggedheader] The \glostyle{longraggedheader} style is like
%\glostyle{longragged} but has a header row.
%
%\item[longraggedheaderborder] The \glostyle{longraggedheaderborder} 
%style is like \glostyle{longraggedheader} but has horizontal and 
%vertical lines around it.
%
%\item[longragged3col] The \glostyle{longragged3col} style is like
%\glostyle{longragged} but has three columns. The first column
%contains the entry's name, the second column contains the (left
%justified) description and the third column contains the (left
%justified) \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[longragged3colborder] The \glostyle{longragged3colborder}
%style is like the \glostyle{longragged3col} style but has horizontal
%and vertical lines around it.
%
%\item[longragged3colheader] The \glostyle{longragged3colheader} style is like
%\glostyle{longragged3col} but has a header row.
%
%\item[longragged3colheaderborder] The \glostyle{longragged3colheaderborder} style is
%like \glostyle{longragged3colheader} but has horizontal and vertical lines
%around it.
%
%\item[altlongragged4col] The \glostyle{altlongragged4col} style is
%like \glostyle{longragged3col} but has an additional column in which
%the entry's associated symbol appears. 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[altlongragged4colborder] The
%\glostyle{altlongragged4colborder} style is like the
%\glostyle{altlongragged4col} but has horizontal and vertical lines
%around it.
%
%\item[altlongragged4colheader] The
%\glostyle{altlongragged4colheader} style is like
%\glostyle{altlongragged4col} but has a header row.
%
%\item[altlongragged4colheaderborder] The
%\glostyle{altlongragged4colheaderborder} style is like
%\glostyle{altlongragged4colheader} but has horizontal and vertical
%lines around it.
%
%\end{description}
%
%
%\subsubsection{Supertabular Styles}
%\label{sec:superstyles}
%
%The styles described in this section are all defined in the package
%\sty{glossary-super}. Since they all use the \env{supertabular}
%environment, they are governed by the same parameters as that
%environment.  Note that these styles will automatically be available
%unless you use the \pkgopt{nosuper} or \pkgopt{nostyles} package
%options.  In general, the \env{longtable} environment is better,
%but there are some circumstances where it is better to use
%\env{supertabular}.\footnote{e.g.\ with the \sty{flowfram}
%package.} These styles fully justify the description and page list
%columns.  If you want ragged right formatting instead, use the
%analogous styles described in \sectionref{sec:superraggedstyles}.
%
%\begin{description}
%\item[super] The \glostyle{super} style uses the \env{supertabular}
%environment (defined by the \sty{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{Supertabular Styles (Ragged Right)}
%\label{sec:superraggedstyles}
%
%The styles described in this section are all defined in the package
%\sty{glossary-superragged}. These styles are analogous to those
%defined in \sty{glossary-super} but the multiline columns are left
%justified instead of fully justified. Since these styles all use the
%\env{supertabular} environment, they are governed by the same
%parameters as that environment. The \sty{glossary-superragged}
%package additionally requires the \sty{array} package.  Note that
%these styles will only be available if you explicitly load
%\sty{glossary-superragged}:
%\begin{verbatim}
%\usepackage{glossaries}
%\usepackage{glossary-superragged}
%\end{verbatim}
%Note that you can't set these styles using the \pkgopt{style}
%package option since the styles aren't defined until after
%the \styfmt{glossaries} package has been loaded.
%
%\begin{description}
%\item[superragged] The \glostyle{superragged} style uses the
%\env{supertabular} environment (defined by the
%\sty{supertabular} package). It has two columns: the first column
%contains the entry's name and the second column contains the (left
%justified) 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[superraggedborder] The \glostyle{superraggedborder} style is
%like \glostyle{superragged} but has horizontal and vertical lines
%around it.
%
%\item[superraggedheader] The \glostyle{superraggedheader} style is
%like \glostyle{superragged} but has a header row.
%
%\item[superraggedheaderborder] The
%\glostyle{superraggedheaderborder} style is like
%\glostyle{superraggedheader} but has horizontal and vertical lines
%around it.
%
%\item[superragged3col] The \glostyle{superragged3col} style is like
%\glostyle{superragged} but has three columns. The first column
%contains the entry's name, the second column contains the (left
%justified) description and the third column contains the (left
%justified) \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[superragged3colborder] The \glostyle{superragged3colborder}
%style is like the \glostyle{superragged3col} style but has
%horizontal and vertical lines around it.
%
%\item[superragged3colheader] The \glostyle{superragged3colheader}
%style is like \glostyle{superragged3col} but has a header row.
%
%\item[superragged3colheaderborder] The
%\glostyle{superragged3colheaderborder} style is like
%\glostyle{superragged3colheader} but has horizontal and vertical
%lines around it.
%
%\item[altsuperragged4col] The \glostyle{altsuperragged4col} style is
%like \glostyle{superragged3col} but has an additional column in
%which the entry's associated symbol appears. The column widths for
%the name and symbol column are governed by the widest entry in the
%given column.
%
%\item[altsuperragged4colborder] The
%\glostyle{altsuperragged4colborder} style is like the
%\glostyle{altsuperragged4col} style but has horizontal and vertical
%lines around it.
%
%\item[altsuperragged4colheader] The
%\glostyle{altsuperragged4colheader} style is like
%\glostyle{altsuperragged4col} but has a header row.
%
%\item[altsuperragged4colheaderborder] The
%\glostyle{altsuperragged4colheaderborder} style is like
%\glostyle{altsuperragged4colheader} but has horizontal and vertical
%lines around it.
%
%\end{description}
%
%
%\subsubsection{Tree-Like Styles}
%\label{sec:treestyles}
%
%The styles described in this section are all defined in the package
%\sty{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 automatically be available
%unless you use 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 \app{makeindex} is limited to three levels, so
%you will need to use \app{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
%\begin{definition}[\DescribeMacro{\glssetwidest}]
%\cs{glssetwidest}\oarg{level}\marg{text}
%\end{definition}
%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:
%\begin{definition}[\DescribeMacro{\newglossarystyle}]
%\cs{newglossarystyle}\marg{name}\marg{definitions}
%\end{definition}
%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{definition}[\DescribeEnv{theglossary}]
%\env{theglossary}
%\end{definition}
%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 \env{description} environment,
%so the \env{theglossary} environment is simply redefined to begin
%and end the \env{description} environment.
%
%\begin{definition}[\DescribeMacro{\glossaryheader}]
%\cs{glossaryheader}
%\end{definition}
%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.
%
%\begin{definition}[\DescribeMacro{\glsgroupheading}]
%\cs{glsgroupheading}\marg{label}
%\end{definition}
%This macro indicates
%what to do at the start of each logical block within the main body
%of the glossary. If you use \app{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 \app{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
%\begin{definition}[\DescribeMacro{\glsgetgrouptitle}]
%\cs{glsgetgrouptitle}\marg{label}
%\end{definition}
%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
%\begin{definition}[\DescribeMacro{\glsnavhypertarget}]
%\cs{glsnavhypertarget}\marg{label}\marg{text}
%\end{definition}
%For further details about \cs{glsnavhypertarget}, see
%\ifpdf\sectionref{sec:code:hypernav}\else the documented code of
%\sty{glossary-hypernav} in \texttt{glossaries.pdf}\fi.
%
%
%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.)
%
%\begin{definition}[\DescribeMacro{\glsgroupskip}]
%\cs{glsgroupskip}
%\end{definition}
%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.
%
%\begin{definition}[\DescribeMacro{\glossaryentryfield}]
%\cs{glossaryentryfield}\marg{label}\marg{formatted
%name}\marg{description}\marg{symbol}
%\marg{number list}
%\end{definition}
%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
%\begin{definition}[\DescribeMacro{\glstarget}]
%\cs{glstarget}\marg{label}\marg{text}
%\end{definition}
%where \meta{label} is the entry's label. Note that you
%don't need to worry about whether the \sty{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.
%
%\begin{definition}[\DescribeMacro{\glossarysubentryfield}]
%\cs{glossarysubentryfield}\marg{level}\marg{label}\marg{formatted
%name}\marg{description}\marg{symbol}
%\marg{number list}
%\end{definition}
%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.
%
%For further details of these commands, see
%\ifpdf\sectionref{sec:code:printglos}\else the documented code in
%\texttt{glossaries.pdf}\fi. 
%
%\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 \env{itemize}
%environment, so \env{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 \cs{glossarystyle} not \cs{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} 
%
%
%\subsubsection{Example: creating a glossary style that uses the
%\gloskey{user1}, \ldots, \gloskey{user6} keys}
%
%Since \ics{glossaryentryfield} and \ics{glossarysubentryfield}
%provide the label for the entry, it's also possible to access
%the values of the generic user keys, such as \gloskey{user1}. For
%example, suppose each entry not only has an associated symbol,
%but also units (stored in \gloskey{user1}) and dimension
%(stored in \gloskey{user2}). Then you can define a glossary style
%that displays each entry in a \env{longtable} as follows:
%\begin{verbatim}
%\newglossarystyle{long6col}{%
% % put the glossary in a longtable environment:
% \renewenvironment{theglossary}%
%  {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%
%  {\end{longtable}}%
% % Set the table's header:
% \renewcommand*{\glossaryheader}{%
%  \bfseries Term & \bfseries Description & \bfseries Symbol &
%  \bfseries Units & \bfseries Dimensions & \bfseries Page List
%  \\\endhead}%
% % No heading between groups:
%  \renewcommand*{\glsgroupheading}[1]{}%
% % Main (level 0) entries displayed in a row:
%  \renewcommand*{\glossaryentryfield}[5]{%
%    \glstarget{##1}{##2}% Name
%    & ##3% Description
%    & ##4% Symbol
%    & \glsentryuseri{##1}% Units
%    & \glsentryuserii{##1}% Dimensions
%    & ##5% Page list
%    \\% end of row
%  }%
% % Sub entries treated the same as level 0 entries:
% \renewcommand*{\glossarysubentryfield}[6]{%
%  \glossaryentryfield{##2}{##3}{##4}{##5}{##6}}%
% % Nothing between groups:
% \renewcommand*{\glsgroupskip}{}%
%}
%\end{verbatim}
%
%
%\subsection{Accessibility Support}\label{sec:accsupp}
%Limited accessibility support is provided by the accompanying
%\sty{glossaries-accsupp} package, but note that this package is
%experimental and it requires the \sty{accsupp} package 
%which is also listed as experimental. This package defines
%additional keys that may be used when defining glossary entries.
%The keys are as follows:
%\begin{description}
%\item[{\gloskey{access}}] The replacement text corresponding to
%the \gloskey{name} key.
%
%\item[{\gloskey{textaccess}}] The replacement text corresponding
%to the \gloskey{text} key.
%
%\item[{\gloskey{firstaccess}}] The replacement text corresponding
%to the \gloskey{first} key.
%
%\item[{\gloskey{pluralaccess}}] The replacement text corresponding
%to the \gloskey{plural} key.
%
%\item[{\gloskey{firstpluralaccess}}] The replacement text corresponding
%to the \gloskey{firstplural} key.
%
%\item[{\gloskey{symbolaccess}}] The replacement text corresponding
%to the \gloskey{symbol} key.
%
%\item[{\gloskey{symbolpluralaccess}}] The replacement text corresponding
%to the \gloskey{symbolplural} key.
%
%\item[{\gloskey{descriptionaccess}}] The replacement text corresponding
%to the \gloskey{description} key.
%
%\item[{\gloskey{descriptionpluralaccess}}] The replacement text corresponding
%to the \gloskey{descriptionplural} key.
%
%\end{description}
%
%For example:
%\begin{verbatim}
%\newglossaryentry{tex}{name={\TeX},description={Document preparation
%language},access={TeX}}
%\end{verbatim}
%Now \verb|\gls{tex}| will be equivalent to
%\begin{verbatim}
%\BeginAccSupp{ActualText=TeX}\TeX\EndAccSupp{}
%\end{verbatim}
%See \ifpdf \sectionref{sec:code:accsupp} \else the section
%\qt{glossaries-accsupp code} in the document \texttt{glossaries.pdf}
%\fi for further details. It is recommended that you also read the
%\sty{accsupp} documentation. 
%
%\section{Mfirstuc Package}
%\label{sec:mfirstuc}
%
%The \styfmt{glossaries} bundle is supplied with the package 
%\sty{mfirstuc} which provides the command:
%\begin{definition}[\DescribeMacro{\makefirstuc}]
%\cs{makefirstuc}\marg{stuff}
%\end{definition}
%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 \qt{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 \sty{inputenc} package) due to expansion issues.
%
%\begin{important}
%In version 1.02 of \styfmt{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]
%\begin{definition}[\DescribeMacro{\xmakefirstuc}]
%\cs{xmakefirstuc}\marg{stuff}
%\end{definition}
%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 
%\styfmt{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{Glossaries 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}[2010/07/10 v2.07 (NLCT)]
%    \end{macrocode}
% Required packages:
%    \begin{macrocode}
\RequirePackage{ifthen}
\RequirePackage{xkeyval}[2006/11/18]
\RequirePackage{mfirstuc}
\RequirePackage{xfor}
%    \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{option}{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{option}
%\begin{option}{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{option}
%
% 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{option}{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{option}
%
% 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{option}{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{option}
%
% 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{option}{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{option}
%
% 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{option}{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{option}
%
%\begin{macro}{\@gls@loadlong}
%\changes{1.18}{2009 January 14}{new}
%    \begin{macrocode}
\newcommand*{\@gls@loadlong}{\RequirePackage{glossary-long}}
%    \end{macrocode}
%\end{macro}
%\begin{option}{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 
% \env{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{option}
%
%\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{option}{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 
% \env{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{option}
%
%\begin{macro}{\@gls@loadlist}
%\changes{1.18}{2009 January 14}{new}
%    \begin{macrocode}
\newcommand*{\@gls@loadlist}{\RequirePackage{glossary-list}}
%    \end{macrocode}
%\end{macro}
%\begin{option}{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{option}
%
%\begin{macro}{\@gls@loadtree}
%\changes{1.18}{2009 January 14}{new}
%    \begin{macrocode}
\newcommand*{\@gls@loadtree}{\RequirePackage{glossary-tree}}
%    \end{macrocode}
%\end{macro}
%\begin{option}{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{option}
%
%\begin{option}{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{option}
%
%\begin{macro}{\glsdefmain}
%\changes{2.01}{2009 May 30}{new}
% Define the main glossary. This will be the first glossary to
% be displayed when using \ics{printglossaries}.
%    \begin{macrocode}
\newcommand*{\glsdefmain}{%
  \newglossary{main}{gls}{glo}{\glossaryname}%
}
%    \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}
%
%\changes{2.01}{2009 May 30}{added nomain package option}
% The \pkgopt{nomain} option suppress the creation of the main 
% glossary.
%    \begin{macrocode}
\DeclareOptionX{nomain}{%
   \let\glsdefaulttype\relax
   \renewcommand*{\glsdefmain}{}%
}
%    \end{macrocode}
%
%\begin{option}{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]{%
  \DeclareAcronymList{acronym}%
}
%    \end{macrocode}
%\end{option}
%\begin{macro}{\@glsacronymlists}
%\changes{2.04}{2009 November 10}{new}
% Comma-separated list of glossary labels indicating which 
% glossaries contain acronyms. Note that \ics{SetAcronymStyle}
% must be used after adding labels to this macro.
%    \begin{macrocode}
\newcommand*{\@glsacronymlists}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@addtoacronynlists}
%    \begin{macrocode}
\newcommand*{\@addtoacronymlists}[1]{%
  \ifx\@glsacronymlists\@empty
    \protected@xdef\@glsacronymlists{#1}%
  \else
    \protected@xdef\@glsacronymlists{\@glsacronymlists,#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DeclareAcronymList}
%\changes{2.04}{2009 November 10}{new}%
% Identifies the named glossary as a list of acronyms and adds
% to the list. (Doesn't check if the glossary exists, but checks
% if label already in list. Use \ics{SetAcronymStyle} after
% identifying all the acronym lists.)
%    \begin{macrocode}
\newcommand*{\DeclareAcronymList}[1]{%
  \glsIfListOfAcronyms{#1}{}{\@addtoacronymlists{#1}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsIfListOfAcronyms}
%\cs{glsIfListOfAcronyms}\marg{label}\marg{true part}\marg{false part}\\[10pt]
% Determines if the glossary with the given label has been identified
% as being a list of acronyms.
%    \begin{macrocode}
\newcommand{\glsIfListOfAcronyms}[1]{%
  \edef\@do@gls@islistofacronyms{%
    \noexpand\@gls@islistofacronyms{#1}{\@glsacronymlists}}%
  \@do@gls@islistofacronyms
}
%    \end{macrocode}
% Internal command requires label and list to be expanded:
%    \begin{macrocode}
\newcommand{\@gls@islistofacronyms}[4]{%
  \def\gls@islistofacronyms##1,#1,##2\end@gls@islistofacronyms{%
     \def\@before{##1}\def\@after{##2}}%
  \gls@islistofacronyms,#2,#1,\@nil\end@gls@islistofacronyms
  \ifx\@after\@nnil
%    \end{macrocode}
% Not found
%    \begin{macrocode}
    #4%
  \else
%    \end{macrocode}
% Found
%    \begin{macrocode}
    #3%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\if@glsisacronymlist}
% Convenient boolean.
%    \begin{macrocode}
\newif\if@glsisacronymlist
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\gls@checkisacronymlist}
% Sets the above boolean if argument is a label representing 
% a list of acronyms.
%    \begin{macrocode}
\newcommand*{\gls@checkisacronymlist}[1]{%
   \glsIfListOfAcronyms{#1}%
     {\@glsisacronymlisttrue}{\@glsisacronymlistfalse}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\SetAcronymLists}
%\changes{2.04}{2009 November 10}{new}%
% Sets the ``list of acronyms'' list. Argument must be a
% comma-separated list of glossary labels. (Doesn't check at this
% point if the glossaries exists.)
%    \begin{macrocode}
\newcommand*{\SetAcronymLists}[1]{%
  \renewcommand*{\@glsacronymlists}{#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{option}{acronymlists}
%\changes{2.04}{2009 November 10}{new}%
%    \begin{macrocode}
\define@key{glossaries.sty}{acronymlists}{%
  \@addtoacronymlists{#1}%
}
%    \end{macrocode}
%\end{option}
%
% 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{option}{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{option}
%
% 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 \app{makeindex} or
% \app{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{option}{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{option}
%\begin{option}{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{option}
% Set the default value:
%    \begin{macrocode}
\glstranslatefalse
\@ifpackageloaded{translator}{\glstranslatetrue}{%
\@ifpackageloaded{babel}{\glstranslatetrue}{%
\@ifpackageloaded{polyglossia}{\glstranslatetrue}{}}}
%    \end{macrocode}
%
%\begin{option}{hyperfirst}
%\changes{2.03}{2009 Sep 23}{new}
% Set whether or not terms should have a hyperlink on first use.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{hyperfirst}[true]{}
\glshyperfirsttrue
%    \end{macrocode}
%\end{option}
%
%\begin{option}{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{option}
%\begin{option}{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{option}
%\begin{option}{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{option}
%\begin{option}{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{option}
%\begin{option}{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{option}
%\begin{option}{shotcuts}
% Define acronym shortcuts.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{}
%    \end{macrocode}
%\end{option}
%
%\begin{macro}{\glsorder}
% Stores the glossary ordering. This may either be \qt{word}
% or \qt{letter}. This passes the relevant information to
% \app{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 \app{makeglossaries}, so ignore the auxiliary 
% information.
%    \begin{macrocode}
\newcommand*{\@glsorder}[1]{}
%    \end{macrocode}
%\end{macro}
%
%\begin{option}{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{option}
%
%\changes{1.17}{2008 December 26}{added xindy support}
%\begin{macro}{\ifglsxindy}
%\changes{1.17}{2008 December 26}{new}
% Provide boolean to determine whether \app{xindy} or
% \app{makeindex} will be used to sort the glossaries.
%    \begin{macrocode}
\newif\ifglsxindy
%    \end{macrocode}
%\end{macro}
% The default is \app{makeindex}:
%    \begin{macrocode}
\glsxindyfalse
%    \end{macrocode}
%
% Define package option to specify that \app{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 \app{xindy} will be 
% used to sort the glossaries:
%    \begin{macrocode}
\define@key{glossaries.sty}{xindy}[]{%
  \glsxindytrue
  \setkeys[gls]{xindy}{#1}%
}
%    \end{macrocode}
%
%\begin{macro}{\GlossariesWarning}
% Prints a warning message.
%    \begin{macrocode}
\newcommand*{\GlossariesWarning}[1]{%
  \PackageWarning{glossaries}{#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlossariesWarningNoLine}
% Prints a warning message without the line number.
%    \begin{macrocode}
\newcommand*{\GlossariesWarningNoLine}[1]{%
  \PackageWarningNoLine{glossaries}{#1}%
}
%    \end{macrocode}
%\end{macro}
% Define package option to suppress warnings
%    \begin{macrocode}
\DeclareOptionX{nowarn}{%
  \renewcommand*{\GlossariesWarning}[1]{}%
  \renewcommand*{\GlossariesWarningNoLine}[1]{}%
}
%    \end{macrocode}
%
% Process package options:
%    \begin{macrocode}
\ProcessOptionsX
%    \end{macrocode}
% If \isty{babel} package is loaded, check to see if 
% \isty{translator} is installed, but only if translation is
% required.
%\changes{2.02}{2009 July 13}{translate=false will prevent 
% automatic loading of translator package}
%    \begin{macrocode}
\ifglstranslate
  \@ifpackageloaded{babel}{\IfFileExists{translator.sty}{%
    \RequirePackage{translator}}{}}{}
\fi
%    \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 \app{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{macro}{\addglossarytocaptions}
% If using \isty{translator}, \ics{glossaryname} should be defined
% in terms of \ics{translate}, but if babel is also loaded, it will
% redefine \cs{glossaryname} whenever the language is set, so 
% override it. (Don't use \ics{addto} as \isty{polyglossia} doesn't
% define it.)
%    \begin{macrocode}
\newcommand*{\addglossarytocaptions}[1]{%
  \@ifundefined{captions#1}{}{%
    \expandafter\let\expandafter\@gls@tmp\csname captions#1\endcsname
    \expandafter\toks@\expandafter{\@gls@tmp
      \renewcommand*{\glossaryname}{\translate{Glossary}}%
    }%
    \expandafter\edef\csname captions#1\endcsname{\the\toks@}%
  }%
}
%    \end{macrocode}
%\end{macro}
%    \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}%
    \addglossarytocaptions{portuges}%
    \addglossarytocaptions{portuguese}%
    \addglossarytocaptions{brazil}%
    \addglossarytocaptions{brazilian}%
    \addglossarytocaptions{danish}%
    \addglossarytocaptions{dutch}%
    \addglossarytocaptions{afrikaans}%
    \addglossarytocaptions{english}%
    \addglossarytocaptions{UKenglish}%
    \addglossarytocaptions{USenglish}%
    \addglossarytocaptions{american}%
    \addglossarytocaptions{australian}%
    \addglossarytocaptions{british}%
    \addglossarytocaptions{canadian}%
    \addglossarytocaptions{newzealand}%
    \addglossarytocaptions{french}%
    \addglossarytocaptions{frenchb}%
    \addglossarytocaptions{francais}%
    \addglossarytocaptions{acadian}%
    \addglossarytocaptions{canadien}%
    \addglossarytocaptions{german}%
    \addglossarytocaptions{germanb}%
    \addglossarytocaptions{austrian}%
    \addglossarytocaptions{naustrian}%
    \addglossarytocaptions{ngerman}%
    \addglossarytocaptions{irish}%
    \addglossarytocaptions{italian}%
    \addglossarytocaptions{magyar}%
    \addglossarytocaptions{hungarian}%
    \addglossarytocaptions{polish}%
    \addglossarytocaptions{spanish}%
    \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}}%
    {%
      \@ifpackageloaded{polyglossia}{%
        \RequirePackage{glossaries-polyglossia}}{}%
    }}
\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 \app{makeindex} or \app{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 \app{makeglossaries} Perl script picks up this name
% from the auxiliary file. If the name ends with \filetype{.xdy}
% it calls \app{xindy} otherwise it calls \app{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}
% \app{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
% \app{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 \app{xindy} is used 
% \cs{glscompositor} only affects the \texttt{arabic-page-numbers}
% location class.
%\begin{macro}{\@glsAlphacompositor}
% This is only used by \app{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} \app{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} \app{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
% \env{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 \env{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}
%\changes{2.02}{2009 July 13}{changed '@mkboth to 'glossarymark}
%\begin{macro}{\glossarysection}
%    \begin{macrocode}
\newcommand*{\glossarysection}[2][\@gls@title]{%
  \def\@gls@title{#2}%
  \@ifundefined{phantomsection}{%
  \@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}%
  \glossarymark{\glossarytoctitle}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glossarymark}
%\changes{2.02}{2009 July 13}{New}
%\changes{2.03}{2009 Sep 23}{Added check to see if it's already 
%defined}
% Sets the header mark for the glossary. Takes the glossary short
% (TOC) title as the argument.
%    \begin{macrocode}
\@ifundefined{glossarymark}{%
  \newcommand{\glossarymark}[1]{\@mkboth{#1}{#1}}
}{%
  \GlossariesWarning{overriding \string\glossarymark}%
  \@ifclassloaded{memoir}%
  {
    \renewcommand{\glossarymark}[1]{%
      \markboth{\memUChead{#1}}{\memUChead{#1}}%
    }
  }
  {
    \renewcommand{\glossarymark}[1]{\@mkboth{#1}{#1}}
  }
}
%    \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
% \app{xindy} is used to sort the glossaries.
%\begin{macro}{\glsnoxindywarning}
% Issues a warning if \app{xindy} hasn't been specified.
% These warnings can be suppressed by redefining 
% \cs{glsnoxindywarning} to ignore its argument
%    \begin{macrocode}
\newcommand*{\glsnoxindywarning}[1]{%
  \GlossariesWarning{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 \app{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 \app{xindy} syntax. (Note that this doesn't
% check to see if the location is already defined. That is left
% to \app{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 \app{xindy} styles)
%    \begin{macrocode}
\ifglsxindy
  \def\@xdyrequiredstyles{tex}
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\GlsAddXdyStyle}
% Add a \app{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 \app{xindy}. This
% information is for \app{makeglossaries} to pass to
% \app{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 \app{xindy} language setting is required by 
% \app{makeglossaries}, so provide a command for 
% \app{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 \app{xindy} codepage setting is required by 
% \app{makeglossaries}, so provide a command for 
% \app{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 \app{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}
%\begin{macro}{\forallglossaries}
% 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.
%\changes{2.01}{2009 May 30}{replaced \cs{ifthenelse} with \cs{ifx}}
%    \begin{macrocode}
\newcommand*{\forallglossaries}[3][\@glo@types]{%
  \@for#2:=#1\do{\ifx#2\@empty\else#3\fi}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\forglsentries}
% 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.
%\changes{2.01}{2009 May 30}{replaced \cs{ifthenelse} with \cs{ifx}}
%    \begin{macrocode}
\newcommand*{\forglsentries}[3][\glsdefaulttype]{%
  \edef\@@glo@list{\csname glolist@#1\endcsname}%
  \@for#2:=\@@glo@list\do{\ifx#2\@empty\else#3\fi}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\forallglsentries}
% 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{macrocode}
\newcommand*{\forallglsentries}[3][\@glo@types]{%
\expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}{%
\forglsentries[\@@this@glo@]{#2}{#3}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\ifglossaryexists}
% 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{macrocode}
\newcommand{\ifglossaryexists}[3]{%
  \@ifundefined{@glotype@#1@out}{#3}{#2}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\ifglsentryexists}
% 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{macrocode}
\newcommand{\ifglsentryexists}[3]{%
\@ifundefined{glo@#1@name}{#3}{#2}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\ifglsused}
% 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{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:
%
%\begin{macro}{\glsdoifexists}
%\cs{glsdoifexists}\marg{label}\marg{code}\par
% Generate an error if entry specified by \meta{label} doesn't 
% exists, otherwise do \meta{code}.
%    \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}
%
%\begin{macro}{\glsdoifnoexists}
%\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{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 \app{makeindex}
% transcript file, \meta{in-ext} is the extension of the glossary 
% input file (read in by \ics{printglossary} and created by
% \app{makeindex}), \meta{out-ext} is the extension of the
% glossary output file which is read in by \app{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 \app{makeglossaries} Perl
% script reads in the relevant extensions from the auxiliary file,
% and passes the appropriate file names and switches to 
% \app{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}
% Check if default has been set
%    \begin{macrocode}
  \ifx\glsdefaulttype\relax
    \gdef\glsdefaulttype{#2}%
  \fi
%    \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}). These
% may already have been defined if this has been specified as 
% a list of acronyms.
%\changes{2.04}{2009 November 10}{added check to determine if 
% \cs{gls@\meta{type}@display} and \cs{gls@\meta{type}@displayfirst}
% have been defined.}
%    \begin{macrocode}
  \@ifundefined{gls@#2@display}{%
    \expandafter\gdef\csname gls@#2@display\endcsname{%
      \glsdisplay}}{}%
  \@ifundefined{gls@#2@displayfirst}{%
  \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}
%\begin{macro}{\altnewglossary}
%\changes{2.06}{2010 June 14}{new}
%    \begin{macrocode}
\newcommand*{\altnewglossary}[3]{%
  \newglossary[#2-glg]{#1}{#2-gls}{#2-glo}{#3}%
}
%    \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 \app{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}
\glsdefmain
%    \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{key}{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{key}
%
%\begin{key}{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 \app{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{key}
%\begin{key}{descriptionplural}
% \changes{1.12}{2008 Mar 8}{new}
%    \begin{macrocode}
\define@key{glossentry}{descriptionplural}{%
\def\@glo@descplural{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\begin{key}{sort}
% The \gloskey{sort} key needs to be sanitized here 
% (the sort key is provided for \app{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{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%\begin{key}{symbolplural}
% \changes{1.12}{2008 Mar 8}{new}
%    \begin{macrocode}
\define@key{glossentry}{symbolplural}{%
\def\@glo@symbolplural{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%
%\begin{key}{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{key}
%
% Define some generic user keys. (6 ought to be enough!)
%\begin{key}{user1}
%    \begin{macrocode}
\define@key{glossentry}{user1}{%
  \def\@glo@useri{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\begin{key}{user2}
%    \begin{macrocode}
\define@key{glossentry}{user2}{%
  \def\@glo@userii{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\begin{key}{user3}
%    \begin{macrocode}
\define@key{glossentry}{user3}{%
  \def\@glo@useriii{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\begin{key}{user4}
%    \begin{macrocode}
\define@key{glossentry}{user4}{%
  \def\@glo@useriv{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\begin{key}{user5}
%    \begin{macrocode}
\define@key{glossentry}{user5}{%
  \def\@glo@userv{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\begin{key}{user6}
%    \begin{macrocode}
\define@key{glossentry}{user6}{%
  \def\@glo@uservi{#1}%
}
%    \end{macrocode}
%\end{key}
%
%\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}
%
%\begin{macro}{\newglossaryentry}
% Define \cs{newglossaryentry}%
% \marg{label} \marg{key-val list}. 
% There are two required fields in \meta{key-val list}: 
% \gloskey{name} (or \gloskey{parent}) and 
% \gloskey{description}. (See above.)
%    \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\space for entry `\@glo@label'}{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}
%\changes{2.04}{2009 November 10}{added user1-6 keys}
%    \begin{macrocode}
\def\@glo@useri{}%
\def\@glo@userii{}%
\def\@glo@useriii{}%
\def\@glo@useriv{}%
\def\@glo@userv{}%
\def\@glo@uservi{}%
%    \end{macrocode}
% Add start hook in case another package wants to add extra keys.
%    \begin{macrocode}
  \@newglossaryentryprehook
%    \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}%
\expandafter
  \protected@xdef\csname glo@#1@useri\endcsname{\@glo@useri}%
\expandafter
  \protected@xdef\csname glo@#1@userii\endcsname{\@glo@userii}%
\expandafter
  \protected@xdef\csname glo@#1@useriii\endcsname{\@glo@useriii}%
\expandafter
  \protected@xdef\csname glo@#1@useriv\endcsname{\@glo@useriv}%
\expandafter
  \protected@xdef\csname glo@#1@userv\endcsname{\@glo@userv}%
\expandafter
  \protected@xdef\csname glo@#1@uservi\endcsname{\@glo@uservi}%
\@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}
% Add end hook in case another package wants to add extra keys.
%    \begin{macrocode}
  \@newglossaryentryposthook
}
%    \end{macrocode}
%\changes{1.13}{2008 May 10}{Removed restriction on only using
% 'newglossaryentry in the preamble}
%\end{macro}
%\begin{macro}{\@newglossaryentryprehook}
% Allow extra information to be added to glossary entries:
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\@newglossaryentryprehook}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@newglossaryentryposthook}
% Allow extra information to be added to glossary entries:
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\@newglossaryentryposthook}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@glossaryentryfield}
% Indicate what command should be used to display each entry in
% the glossary. (This enables the \sty{glossaries-accsupp} package
% to use \cs{accsuppglossaryentryfield} instead.)
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\ifglsxindy
  \newcommand*{\@glossaryentryfield}{\string\\glossaryentryfield}
\else
  \newcommand*{\@glossaryentryfield}{\string\glossaryentryfield}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glossarysubentryfield}
% Indicate what command should be used to display each subentry in
% the glossary. (This enables the \sty{glossaries-accsupp} package
% to use \cs{accsuppglossarysubentryfield} instead.)
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\ifglsxindy
  \newcommand*{\@glossarysubentryfield}{%
    \string\\glossarysubentryfield}
\else
  \newcommand*{\@glossarysubentryfield}{%
    \string\glossarysubentryfield}
\fi
%    \end{macrocode}
%\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
% \app{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 \app{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\@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\@glossarysubentryfield%
         {\csname glo@#1@level\endcsname}{#1}{\@glo@name
      }{\@glo@desc}{\@glo@symbol}\string") %
   }%
  \fi
\else
%    \end{macrocode}
% Store using \app{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
      \@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
      \@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}
%\begin{macro}{\@sgls@link}
% The starred version of \cs{glslink} calls the unstarred version
% with hyperlinks disabled.
%    \begin{macrocode}
\newcommand*{\@sgls@link}[1][]{\@gls@@link[hyper=false,#1]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@@link}
%\changes{2.03}{2009 Sep 23}{new}
% The unstarred version of \cs{glslink} checks for the existance
% of the term. The main part of the business is in \cs{@gls@link}
% which shouldn't check if the term is defined as it's called by
% \cs{gls} etc which also perform that check.
%    \begin{macrocode}
\newcommand*{\@gls@@link}[3][]{%
  \ifglsentryexists{#2}%
  {%
    \@gls@link[#1]{#2}{#3}%
  }{%
    \PackageError{glossaries}{Glossary entry `#2' has not been
    defined}{You need to define a glossary entry before you
    can use it.}%
%    \end{macrocode}
% Display the specified text. (The entry doesn't exist so
% there's nothing to link it to.)
%    \begin{macrocode}
    \glstextformat{#3}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\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}
\def\@gls@link[#1]#2#3{%
%    \end{macrocode}
%\changes{2.03}{2009 Sep 23}{Moved entry existance check to 
% avoid }
%\changes{2.03}{2009 Sep 23}{added \cs{leavevmode}}
% Inserting \cs{leavevmode} suggested by Donald~Arseneau (avoids
% problem with tabularx).
%    \begin{macrocode}
    \leavevmode
    \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}%
%    \end{macrocode}
%\changes{2.01}{2009 May 30}{moved \cs{@do@wrglossary} before term is displayed
% to prevent unwanted whatsit}
%    \begin{macrocode}
    \@do@wrglossary{#2}%
    \ifKV@glslink@hyper
      \@glslink{glo:#2}{\glstextformat{#3}}%
    \else
      \glstextformat{#3}\relax
    \fi
}
%    \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 
% \app{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 
% \app{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 \app{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 \app{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}%
{%
  \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 and the glossary
% type is \cs{acronymtype}, suppress 
% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst}
% package option is used.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst}
%\changes{2.04}{2009 November 10}{Changed test to check if glossary type
%has been identified as a list of acronyms}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\@glo@text}%
}{%
  \gls@checkisacronymlist\@glo@type
  \ifthenelse{\(\boolean{@glsisacronymlist}\AND
    \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
    \@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}%
\def\glslabel{#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 and the glossary
% type is \cs{acronymtype}, suppress 
% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst}
% package option is used.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst}
%\changes{2.04}{2009 November 10}{Changed test to check if glossary type
%has been identified as a list of acronyms}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
  \gls@checkisacronymlist\@glo@type
  \ifthenelse{\(\boolean{@glsisacronymlist}\AND
    \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
    \@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}{\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 and the glossary
% type is \cs{acronymtype}, suppress 
% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst}
% package option is used.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst}
%\changes{2.04}{2009 November 10}{Changed test to check if glossary type
%has been identified as a list of acronyms}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
  \gls@checkisacronymlist\@glo@type
  \ifthenelse{\(\boolean{@glsisacronymlist}\AND
    \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
    \@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}%
{%
  \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 and the glossary
% type is \cs{acronymtype}, suppress 
% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst}
% package option is used.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst}
%\changes{2.04}{2009 November 10}{Changed test to check if glossary type
%has been identified as a list of acronyms}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\@glo@text}%
}{%
  \gls@checkisacronymlist\@glo@type
  \ifthenelse{\(\boolean{@glsisacronymlist}\AND
    \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
    \@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}%
\def\glslabel{#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 and the glossary
% type is \cs{acronymtype}, suppress 
% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst}
% package option is used.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst}
%\changes{2.04}{2009 November 10}{Changed test to check if glossary type
%has been identified as a list of acronyms}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{%
    \expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
  \gls@checkisacronymlist\@glo@type
  \ifthenelse{\(\boolean{@glsisacronymlist}\AND
    \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
    \@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}{\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 and the glossary
% type is \cs{acronymtype}, suppress 
% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst}
% package option is used.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst}
%\changes{2.04}{2009 November 10}{Changed test to check if glossary type
%has been identified as a list of acronyms}
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
  \gls@checkisacronymlist\@glo@type
  \ifthenelse{\(\boolean{@glsisacronymlist}\AND
    \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
    \@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}{%
%    \end{macrocode}
%\changes{2.05}{2010 Feb 6}{Added closing brace. Patch provided by Sergiu Dotenco}
%    \begin{macrocode}
    \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 and the glossary
% type is \cs{acronymtype}, suppress 
% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst}
% package option is used.
%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to
%checking if footnote option has been used}
%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst}
%\changes{2.04}{2009 November 10}{Changed test to check if glossary type
%has been identified as a list of acronyms}
%    \begin{macrocode}
    \ifglsused{#2}%
    {%
      \@gls@link[#1]{#2}{\@glo@text}%
    }%
    {%
      \gls@checkisacronymlist\@glo@type
      \ifthenelse{\(\boolean{@glsisacronymlist}\AND
        \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}%
      {%
        \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
      }%
      {%
        \@gls@link[#1]{#2}{\@glo@text}%
      }%
    }%
%    \end{macrocode}
% Indicate that this entry has now been used
%\changes{2.05}{2010 Feb 6}{Removed spurious brace. Patch provided by Sergiu Dotenco}
%    \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}
%
% \cs{glsuseri} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{user1} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsuseri}
%    \begin{macrocode}
\newcommand*{\glsuseri}{\@ifstar\@sglsuseri\@glsuseri}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsuseri}[1][]{\@glsuseri[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsuseri}[2][]{%
\new@ifnextchar[{\@glsuseri@{#1}{#2}}{\@glsuseri@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsuseri@#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{\glsentryuseri{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsuseri} behaves like \ics{glsuseri} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsuseri}
%    \begin{macrocode}
\newcommand*{\Glsuseri}{\@ifstar\@sGlsuseri\@Glsuseri}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsuseri}[1][]{\@Glsuseri[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsuseri}[2][]{%
\new@ifnextchar[{\@Glsuseri@{#1}{#2}}{\@Glsuseri@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsuseri@#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{\glsentryuseri{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSuseri} behaves like \ics{glsuseri} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSuseri}
%    \begin{macrocode}
\newcommand*{\GLSuseri}{\@ifstar\@sGLSuseri\@GLSuseri}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSuseri}[1][]{\@GLSuseri[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSuseri}[2][]{%
\new@ifnextchar[{\@GLSuseri@{#1}{#2}}{\@GLSuseri@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSuseri@#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{\glsentryuseri{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsuserii} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{user2} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsuserii}
%    \begin{macrocode}
\newcommand*{\glsuserii}{\@ifstar\@sglsuserii\@glsuserii}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsuserii}[1][]{\@glsuserii[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsuserii}[2][]{%
\new@ifnextchar[{\@glsuserii@{#1}{#2}}{\@glsuserii@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsuserii@#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{\glsentryuserii{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsuserii} behaves like \ics{glsuserii} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsuserii}
%    \begin{macrocode}
\newcommand*{\Glsuserii}{\@ifstar\@sGlsuserii\@Glsuserii}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsuserii}[1][]{\@Glsuserii[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsuserii}[2][]{%
\new@ifnextchar[{\@Glsuserii@{#1}{#2}}{\@Glsuserii@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsuserii@#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{\glsentryuserii{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSuserii} behaves like \ics{glsuserii} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSuserii}
%    \begin{macrocode}
\newcommand*{\GLSuserii}{\@ifstar\@sGLSuserii\@GLSuserii}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSuserii}[1][]{\@GLSuserii[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSuserii}[2][]{%
\new@ifnextchar[{\@GLSuserii@{#1}{#2}}{\@GLSuserii@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSuserii@#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{\glsentryuserii{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsuseriii} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{user3} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsuseriii}
%    \begin{macrocode}
\newcommand*{\glsuseriii}{\@ifstar\@sglsuseriii\@glsuseriii}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsuseriii}[1][]{\@glsuseriii[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsuseriii}[2][]{%
\new@ifnextchar[{\@glsuseriii@{#1}{#2}}{\@glsuseriii@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsuseriii@#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{\glsentryuseriii{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsuseriii} behaves like \ics{glsuseriii} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsuseriii}
%    \begin{macrocode}
\newcommand*{\Glsuseriii}{\@ifstar\@sGlsuseriii\@Glsuseriii}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsuseriii}[1][]{\@Glsuseriii[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsuseriii}[2][]{%
\new@ifnextchar[{\@Glsuseriii@{#1}{#2}}{\@Glsuseriii@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsuseriii@#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{\glsentryuseriii{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSuseriii} behaves like \ics{glsuseriii} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSuseriii}
%    \begin{macrocode}
\newcommand*{\GLSuseriii}{\@ifstar\@sGLSuseriii\@GLSuseriii}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSuseriii}[1][]{\@GLSuseriii[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSuseriii}[2][]{%
\new@ifnextchar[{\@GLSuseriii@{#1}{#2}}{\@GLSuseriii@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSuseriii@#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{\glsentryuseriii{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsuseriv} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{user4} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsuseriv}
%    \begin{macrocode}
\newcommand*{\glsuseriv}{\@ifstar\@sglsuseriv\@glsuseriv}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsuseriv}[1][]{\@glsuseriv[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsuseriv}[2][]{%
\new@ifnextchar[{\@glsuseriv@{#1}{#2}}{\@glsuseriv@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsuseriv@#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{\glsentryuseriv{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsuseriv} behaves like \ics{glsuseriv} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsuseriv}
%    \begin{macrocode}
\newcommand*{\Glsuseriv}{\@ifstar\@sGlsuseriv\@Glsuseriv}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsuseriv}[1][]{\@Glsuseriv[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsuseriv}[2][]{%
\new@ifnextchar[{\@Glsuseriv@{#1}{#2}}{\@Glsuseriv@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsuseriv@#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{\glsentryuseriv{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSuseriv} behaves like \ics{glsuseriv} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSuseriv}
%    \begin{macrocode}
\newcommand*{\GLSuseriv}{\@ifstar\@sGLSuseriv\@GLSuseriv}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSuseriv}[1][]{\@GLSuseriv[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSuseriv}[2][]{%
\new@ifnextchar[{\@GLSuseriv@{#1}{#2}}{\@GLSuseriv@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSuseriv@#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{\glsentryuseriv{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsuserv} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{user5} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsuserv}
%    \begin{macrocode}
\newcommand*{\glsuserv}{\@ifstar\@sglsuserv\@glsuserv}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsuserv}[1][]{\@glsuserv[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsuserv}[2][]{%
\new@ifnextchar[{\@glsuserv@{#1}{#2}}{\@glsuserv@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsuserv@#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{\glsentryuserv{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsuserv} behaves like \ics{glsuserv} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsuserv}
%    \begin{macrocode}
\newcommand*{\Glsuserv}{\@ifstar\@sGlsuserv\@Glsuserv}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsuserv}[1][]{\@Glsuserv[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsuserv}[2][]{%
\new@ifnextchar[{\@Glsuserv@{#1}{#2}}{\@Glsuserv@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsuserv@#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{\glsentryuserv{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSuserv} behaves like \ics{glsuserv} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSuserv}
%    \begin{macrocode}
\newcommand*{\GLSuserv}{\@ifstar\@sGLSuserv\@GLSuserv}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSuserv}[1][]{\@GLSuserv[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSuserv}[2][]{%
\new@ifnextchar[{\@GLSuserv@{#1}{#2}}{\@GLSuserv@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSuserv@#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{\glsentryuserv{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsuservi} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{user6} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsuservi}
%    \begin{macrocode}
\newcommand*{\glsuservi}{\@ifstar\@sglsuservi\@glsuservi}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsuservi}[1][]{\@glsuservi[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsuservi}[2][]{%
\new@ifnextchar[{\@glsuservi@{#1}{#2}}{\@glsuservi@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsuservi@#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{\glsentryuservi{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsuservi} behaves like \ics{glsuservi} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsuservi}
%    \begin{macrocode}
\newcommand*{\Glsuservi}{\@ifstar\@sGlsuservi\@Glsuservi}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsuservi}[1][]{\@Glsuservi[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsuservi}[2][]{%
\new@ifnextchar[{\@Glsuservi@{#1}{#2}}{\@Glsuservi@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsuservi@#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{\glsentryuservi{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSuservi} behaves like \ics{glsuservi} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSuservi}
%    \begin{macrocode}
\newcommand*{\GLSuservi}{\@ifstar\@sGLSuservi\@GLSuservi}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSuservi}[1][]{\@GLSuservi[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSuservi}[2][]{%
\new@ifnextchar[{\@GLSuservi@{#1}{#2}}{\@GLSuservi@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSuservi@#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{\glsentryuservi{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
%    \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}{\glsentryuseri}
% Get the first user key (as specified by the 
% \gloskey{user1} when the entry was defined). The argument
% is the label associated with the entry.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\glsentryuseri}[1]{\csname glo@#1@useri\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryuseri}
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\Glsentryuseri}[1]{%
\protected@edef\@glo@text{\csname glo@#1@useri\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsentryuserii}
% Get the second user key (as specified by the 
% \gloskey{user2} when the entry was defined). The argument
% is the label associated with the entry.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\glsentryuserii}[1]{\csname glo@#1@userii\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryuserii}
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\Glsentryuserii}[1]{%
\protected@edef\@glo@text{\csname glo@#1@userii\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsentryuseriii}
% Get the third user key (as specified by the 
% \gloskey{user3} when the entry was defined). The argument
% is the label associated with the entry.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\glsentryuseriii}[1]{\csname glo@#1@useriii\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryuseriii}
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\Glsentryuseriii}[1]{%
\protected@edef\@glo@text{\csname glo@#1@useriii\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsentryuseriv}
% Get the fourth user key (as specified by the 
% \gloskey{user4} when the entry was defined). The argument
% is the label associated with the entry.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\glsentryuseriv}[1]{\csname glo@#1@useriv\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryuseriv}
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\Glsentryuseriv}[1]{%
\protected@edef\@glo@text{\csname glo@#1@useriv\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsentryuserv}
% Get the fifth user key (as specified by the 
% \gloskey{user5} when the entry was defined). The argument
% is the label associated with the entry.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\glsentryuserv}[1]{\csname glo@#1@userv\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryuserv}
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\Glsentryuserv}[1]{%
\protected@edef\@glo@text{\csname glo@#1@userv\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsentryuservi}
% Get the sixth user key (as specified by the 
% \gloskey{user6} when the entry was defined). The argument
% is the label associated with the entry.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\glsentryuservi}[1]{\csname glo@#1@uservi\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryuservi}
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\Glsentryuservi}[1]{%
\protected@edef\@glo@text{\csname glo@#1@uservi\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \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\@gls@counter{#1}}
%    \end{macrocode}
%\changes{2.07}{2010 Jul 10}{glssadd format key stored in \cs{@glsnumberformat}
%(was mistakenly stored in \cs{@glo@format})}
%    \begin{macrocode}
\define@key{glossadd}{format}{\def\@glsnumberformat{#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}
%\changes{2.04}{2009 November 10}{fixed bug that ignored counter}
%    \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} \app{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 \app{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 \app{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 \app{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 \app{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 \app{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
% \app{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 \app{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 \app{makeindex} is required.
%\changes{2.01}{2009 May 30}{removed item\_02 - no such makeindex key}
%    \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_12 \string"\string\%\string\n\string"}
    \write\istfile{item_x2
      \string"\string\\relax \string\\glsresetentrylist\string\n
      \string"}
%    \end{macrocode}
%\changes{2.05}{2010 Feb 6}{Added \cs{string} before opening 
% and closing braces. Patch provided by Segiu Dotenco}
%    \begin{macrocode}
    \write\istfile{delim_0 \string"\string\{\string
      \\glossaryentrynumbers\string\{\string\\relax \string"}
    \write\istfile{delim_1 \string"\string\{\string
      \\glossaryentrynumbers\string\{\string\\relax \string"}
    \write\istfile{delim_2 \string"\string\{\string
      \\glossaryentrynumbers\string\{\string\\relax \string"}
    \write\istfile{delim_t \string"\string\}\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\{\string"}
    \write\istfile{heading_suffix
       \string"\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 \app{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} \app{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}{%
  \GlossariesWarningNoLine{\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 \app{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 \cls{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
%\cs{index} instead of \cs{@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 \app{xindy} or \app{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 \app{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
% \app{makeindex}
%    \begin{macrocode}
  \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat
%    \end{macrocode}
% Write to the glossary file using \app{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{\GlossariesWarningNoLine{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}
  \GlossariesWarning{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 \app{xindy} is being used, need to find the root language
% for \app{makeglossaries} to pass to \app{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 the glossary file doesn't exist, do \cs{null}. (This ensures
% that the page is shipped out and all write commands are done.)
% This might produce an empty page, but at this point the document
% isn't complete, so it shouldn't matter.
%    \begin{macrocode}
\IfFileExists{\jobname.\csname @glotype@\@glo@type @in\endcsname}{}%
{\null}%
%    \end{macrocode}
% If \app{xindy} is being used, need to write the language
% dependent information to the \filetype{.aux} file for
% \app{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}
%\changes{2.02}{2007 July 13}{suppressed warning globally rather than locally}
%    \begin{macrocode}
  \global\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 \env{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}{}{}%
}{%
  \GlossariesWarning{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
% \env{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 \app{makeindex}, there will be a maximum of 28 groups: symbols, numbers,
% and the 26 alphabetical groups A, \ldots, Z\@. If you use
% \app{xindy} the groups will depend on whatever alphabet
% is used. This is determined by the language or custom
% alphabets can be created in the \app{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'' \app{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 
% \env{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}
\fi
%    \end{macrocode}
%\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}
%\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.
%
% This is just a stub. It's redefined by commands like
% \cs{SetDefaultAcronymStyle}.
%\begin{macro}{\newacronym}
%    \begin{macrocode}
  \newcommand{\newacronym}[4][]{}
%    \end{macrocode}
%\changes{1.13}{2008 May 10}{Removed restriction on only using
% 'newacronym in the preamble}
%\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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrfull}
%    \begin{macrocode}
\newcommand*{\Acrfull}[2][]{%
  \new@ifnextchar[{\@Acrfull{#1}{#2}}{\@Acrfull{#1}{#2}[]}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRfull}
%    \begin{macrocode}
\newcommand*{\ACRfull}[2][]{%
  \new@ifnextchar[{\@ACRfull{#1}{#2}}{\@ACRfull{#1}{#2}[]}}
%    \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}[]}}
%    \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}[]}}
%    \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}[]}}
%    \end{macrocode}
%\end{macro}
%
%\subsection{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}
%
% Define some tokens used by \cs{newacronym}:
%\begin{macro}{\glskeylisttok}
%    \begin{macrocode}
\newtoks\glskeylisttok
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslabeltok}
%    \begin{macrocode}
\newtoks\glslabeltok
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsshorttok}
%    \begin{macrocode}
\newtoks\glsshorttok
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslongtok}
%    \begin{macrocode}
\newtoks\glslongtok
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\newacronymhook}
% Provide a hook for \cs{newacronym}:
%    \begin{macrocode}
\newcommand*{\newacronymhook}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetDefaultAcronymDisplayStyle}
% Sets the default acronym display style for given glossary.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\SetDefaultAcronymDisplayStyle}[1]{%
  \defglsdisplay[#1]{##1##4}%
  \defglsdisplayfirst[#1]{##1##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DefaultNewAcronymDef}
% Sets up the acronym definition for the default style.
% The information is provided by the tokens \cs{glslabeltok},
% \cs{glsshorttok}, \cs{glslongtok} and \cs{glskeylisttok}.
%    \begin{macrocode}
\newcommand*{\DefaultNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\the\glsshorttok},%
      description={\the\glslongtok},%
      text={\the\glsshorttok},%
      sort={\the\glsshorttok},%
      descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      first={\the\glslongtok\space(\the\glsshorttok)},%
      plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      firstplural={\noexpand\@glo@descplural\space
        (\noexpand\@glo@plural)},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetDefaultAcronymStyle}
%\changes{2.04}{2009 November 10}{new}
% Set up the default acronym style:
%    \begin{macrocode}
\newcommand*{\SetDefaultAcronymStyle}{%
%    \end{macrocode}
% Set the display style:
%    \begin{macrocode}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetDefaultAcronymDisplayStyle{\@gls@type}%
  }%
%    \end{macrocode}
% Set up the definition of \cs{newacronym}:
%    \begin{macrocode}
  \renewcommand{\newacronym}[4][]{%
%    \end{macrocode}
% If user is just using the main glossary and hasn't identified it
% as a list of acronyms, then update. (This is done to ensure 
% backwards compatibility with versions prior to 2.04).
%    \begin{macrocode}
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetDefaultAcronymDisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \DefaultNewAcronymDef
  }%
%    \end{macrocode}
% Define short cuts.
%    \begin{macrocode}
  \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}%
  \renewcommand*{\glsshortkey}{text}%
  \renewcommand*{\glsshortpluralkey}{plural}%
  \renewcommand*{\glslongkey}{description}%
  \renewcommand*{\glslongpluralkey}{descriptionplural}%
  \def\@acrshort##1##2[##3]{\@glstext@{##1}{##2}[##3]}%
  \def\@Acrshort##1##2[##3]{\@Glstext@{##1}{##2}[##3]}%
  \def\@ACRshort##1##2[##3]{\@GLStext@{##1}{##2}[##3]}%
  \def\@acrshortpl##1##2[##3]{\@glsplural@{##1}{##2}[##3]}%
  \def\@Acrshortpl##1##2[##3]{\@Glsplural@{##1}{##2}[##3]}%
  \def\@ACRshortpl##1##2[##3]{\@GLSplural@{##1}{##2}[##3]}%
  \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]}%
  \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]}%
  \def\@acrfull##1##2[##3]{\@glsfirst@{##1}{##2}[##3]}%
  \def\@Acrfull##1##2[##3]{\@Glsfirst@{##1}{##2}[##3]}%
  \def\@ACRfull##1##2[##3]{\@GLSfirst@{##1}{##2}[##3]}%
  \def\@acrfullpl##1##2[##3]{\@glsfirstplural@{##1}{##2}[##3]}%
  \def\@Acrfullpl##1##2[##3]{\@Glsfirstplural@{##1}{##2}[##3]}%
  \def\@ACRfullpl##1##2[##3]{\@GLSfirstplural@{##1}{##2}[##3]}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\SetDescriptionFootnoteAcronymDisplayStyle}
% Sets the acronym display style for given glossary for the
% description and footnote combination.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\SetDescriptionFootnoteAcronymDisplayStyle}[1]{%
  \defglsdisplayfirst[#1]{%
    \firstacronymfont{##1}##4%
      \protect\footnote{%
        \glslink[\@gls@link@opts]{\@gls@link@label}{##3}}}%
  \defglsdisplay[#1]{\acronymfont{##1}##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DescriptionFootnoteNewAcronymDef}
%    \begin{macrocode}
\newcommand*{\DescriptionFootnoteNewAcronymDef}{%
    \edef\@do@newglossaryentry{%
      \noexpand\newglossaryentry{\the\glslabeltok}%
      {%
        type=\acronymtype,%
        name={\noexpand\acronymfont{\the\glsshorttok}},%
        sort={\the\glsshorttok},%
        text={\the\glsshorttok},%
        plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
        symbol={\the\glslongtok},%
        symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},%
        \the\glskeylisttok
      }%
    }%
    \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetDescriptionFootnoteAcronymStyle}
% 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}
\newcommand*{\SetDescriptionFootnoteAcronymStyle}{%
  \renewcommand{\newacronym}[4][]{%
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetDescriptionFootnoteAcronymDisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \DescriptionFootnoteNewAcronymDef
  }%
%    \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}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetDescriptionFootnoteAcronymDisplayStyle{\@gls@type}%
  }%
%    \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
}%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\SetDescriptionDUAAcronymDisplayStyle}
% Sets the acronym display style for given glossary with 
% description and dua combination.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\SetDescriptionDUAAcronymDisplayStyle}[1]{%
  \defglsdisplay[#1]{##1##4}%
  \defglsdisplayfirst[#1]{##1##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DescriptionDUANewAcronymDef}
%    \begin{macrocode}
\newcommand*{\DescriptionDUANewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\the\glslongtok},%
      sort={\the\glslongtok},
      text={\the\glslongtok},%
      plural={\the\glslongtok\noexpand\acrpluralsuffix},%
      symbol={\the\glsshorttok},%
      symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetDescriptionDUAAcronymStyle}
% Description, don't use acronym and no footnote. 
% 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}
\newcommand*{\SetDescriptionDUAAcronymStyle}{%
  \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][]{%
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetDescriptionDUAAcronymDisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \DescriptionDUANewAcronymDef
  }%
%    \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}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetDescriptionDUAAcronymDisplayStyle{\@gls@type}%
  }%
}%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\SetDescriptionAcronymDisplayStyle}
% Sets the acronym display style for given glossary using
% the description setting (but not footnote or dua).
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\SetDescriptionAcronymDisplayStyle}[1]{%
  \defglsdisplayfirst[#1]{%
    ##1##4 (\firstacronymfont{##3})}%
  \defglsdisplay[#1]{\acronymfont{##1}##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DescriptionNewAcronymDef}
%    \begin{macrocode}
\newcommand*{\DescriptionNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\noexpand
        \acrnameformat{\the\glsshorttok}{\the\glslongtok}},%
      sort={\the\glsshorttok},%
      first={\the\glslongtok},%
      firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      text={\the\glsshorttok},%
      plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      symbol={\noexpand\@glo@text},%
      symbolplural={\noexpand\@glo@plural},%
      \the\glskeylisttok}%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetDescriptionAcronymStyle}
% 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}
\newcommand*{\SetDescriptionAcronymStyle}{%
  \renewcommand{\newacronym}[4][]{%
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetDescriptionAcronymDisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \DescriptionNewAcronymDef
  }%
%    \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}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetDescriptionAcronymDisplayStyle{\@gls@type}%
  }%
%    \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}
%\end{macro}
%
%\begin{macro}{\SetFootnoteAcronymDisplayStyle}
% Sets the acronym display style for given glossary with
% footnote setting (but not description or dua).
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\SetFootnoteAcronymDisplayStyle}[1]{%
  \defglsdisplayfirst[#1]{%
    \firstacronymfont{##1}##4\protect\footnote{%
       \protect\glslink
         [\@gls@link@opts]{\@gls@link@label}{##2}}}%
  \defglsdisplay[#1]{\acronymfont{##1}##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\FootnoteNewAcronymDef}
%    \begin{macrocode}
\newcommand*{\FootnoteNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\noexpand\acronymfont{\the\glsshorttok}},%
      sort={\the\glsshorttok},%
      text={\the\glsshorttok},%
      plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      description={\the\glslongtok},%
      descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetFootnoteAcronymStyle}
% 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}
\newcommand*{\SetFootnoteAcronymStyle}{%
  \renewcommand{\newacronym}[4][]{%
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetFootnoteAcronymDisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \FootnoteNewAcronymDef
  }%
%    \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}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetFootnoteAcronymDisplayStyle{\@gls@type}%
  }%
%    \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
}%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\SetSmallAcronymDisplayStyle}
% Sets the acronym display style for given glossary where neither
% footnote nor description is required, but smallcaps or smaller
% specified.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\SetSmallAcronymDisplayStyle}[1]{%
  \defglsdisplayfirst[#1]{##1##4 (\firstacronymfont{##3})}
  \defglsdisplay[#1]{\acronymfont{##1}##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SmallNewAcronymDef}
%    \begin{macrocode}
\newcommand*{\SmallNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\noexpand\acronymfont{\the\glsshorttok}},%
      sort={\the\glsshorttok},%
      text={\noexpand\@glo@symbol},%
      plural={\noexpand\@glo@symbolplural},%
      first={\the\glslongtok},%
      firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      description={\noexpand\@glo@first},%
      descriptionplural={\noexpand\@glo@firstplural},%
      symbol={\the\glsshorttok},%
      symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetSmallAcronymStyle}
% Neither footnote nor description required, but smallcaps or
% smaller specified.
% Use the \gloskey{symbol} key to store the short form and
% \gloskey{first} to store the long form.
%    \begin{macrocode}
\newcommand*{\SetSmallAcronymStyle}{%
  \renewcommand{\newacronym}[4][]{%
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetSmallAcronymDisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \SmallNewAcronymDef
  }%
%    \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}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetSmallAcronymDisplayStyle{\@gls@type}%
  }%
%    \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}
%\end{macro}
%
%\begin{macro}{\SetDUADisplayStyle}
% Sets the acronym display style for given glossary with dua
% setting.
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\SetDUADisplayStyle}[1]{%
  \defglsdisplay[#1]{##1##4}%
  \defglsdisplayfirst[#1]{##1##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DUANewAcronymDef}
%    \begin{macrocode}
\newcommand*{\DUANewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\the\glsshorttok},%
      text={\the\glslongtok},%
      plural={\the\glslongtok\noexpand\acrpluralsuffix},%
      description={\the\glslongtok},%
      symbol={\the\glsshorttok},%
      symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetDUAStyle}
% Always expand acronyms.
%    \begin{macrocode}
\newcommand*{\SetDUAStyle}{%
  \renewcommand{\newacronym}[4][]{%
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetDUADisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \DUANewAcronymDef
  }%
%    \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}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetDUADisplayStyle{\@gls@type}%
  }%
%    \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]})}%
}%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\SetAcronymStyle}
%    \begin{macrocode}
\newcommand*{\SetAcronymStyle}{%
  \SetDefaultAcronymStyle
  \ifglsacrdescription
    \ifglsacrfootnote
      \SetDescriptionFootnoteAcronymStyle
    \else
      \ifglsacrdua
        \SetDescriptionDUAAcronymStyle
      \else
        \SetDescriptionAcronymStyle
      \fi
    \fi
  \else
    \ifglsacrfootnote
      \SetFootnoteAcronymStyle
    \else
      \ifthenelse{\boolean{glsacrsmallcaps}\OR
        \boolean{glsacrsmaller}}%
      {%
        \SetSmallAcronymStyle
      }%
      {%
        \ifglsacrdua
          \SetDUAStyle
        \fi
      }%
    \fi
  \fi
}
%    \end{macrocode}
% Set the acronym style according to the package options
%    \begin{macrocode}
\SetAcronymStyle
%    \end{macrocode}
%\end{macro}
%
% Allow user to define their own custom acronyms. The short form is
% stored in the user1 key, the plural short form is stored in the
% user2 key, the long form is stored in the user3 key and the
% plural long form is stored in the user4 key. Defaults to
% displaying only the acronym with the long form as the description.
%\begin{macro}{\SetCustomDisplayStyle}
% Sets the acronym display style.
%\changes{2.06}{2010 June 14}{new}
%    \begin{macrocode}
\newcommand*{\SetCustomDisplayStyle}[1]{%
  \defglsdisplay[#1]{##1##4}%
  \defglsdisplayfirst[#1]{##1##4}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\CustomAcronymFields}
%\changes{2.06}{2010 June 14}{new}
%    \begin{macrocode}
\newcommand*{\CustomAcronymFields}{%
  name={\the\glsshorttok},%
  description={\the\glslongtok},%
  first={\the\glslongtok\space(\the\glsshorttok)},%
  firstplural={\the\glslongtok\noexpand\acrpluralsuffix\space
    (\the\glsshorttok)}%
  text={\the\glsshorttok},%
  plural={\the\glsshorttok\noexpand\acrpluralsuffix}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\CustomNewAcronymDef}
%\changes{2.06}{2010 June 14}{new}
%    \begin{macrocode}
\newcommand*{\CustomNewAcronymDef}{%
  \protected@edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      user1={\the\glsshorttok},%
      user2={\the\glsshorttok\noexpand\acrpluralsuffix},%
      user3={\the\glslongtok},%
      user4={\the\glslongtok\noexpand\acrpluralsuffix},%
      \CustomAcronymFields,%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetCustomStyle}
%\changes{2.06}{2010 June 14}{new}
%    \begin{macrocode}
\newcommand*{\SetCustomStyle}{%
  \renewcommand{\newacronym}[4][]{%
    \ifx\@glsacronymlists\@empty
      \def\@glo@type{\acronymtype}%
      \setkeys{glossentry}{##1}%
      \DeclareAcronymList{\@glo@type}%
      \SetCustomDisplayStyle{\@glo@type}%
    \fi
    \glskeylisttok{##1}%
    \glslabeltok{##2}%
    \glsshorttok{##3}%
    \glslongtok{##4}%
    \newacronymhook
    \CustomNewAcronymDef
  }%
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
  \def\glsshortkey{user1}%
  \def\glsshortpluralkey{user2}%
  \def\glslongkey{user3}%
  \def\glslongpluralkey{user4}%
%    \end{macrocode}
% Set the display
%    \begin{macrocode}
  \@for\@gls@type:=\@glsacronymlists\do{%
    \SetCustomDisplayStyle{\@gls@type}%
  }%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
  \def\@acrshort##1##2[##3]{\@glsuseri@{##1}{##2}[##3]}%
  \def\@Acrshort##1##2[##3]{\@Glsuseri@{##1}{##2}[##3]}%
  \def\@ACRshort##1##2[##3]{\@GLSuseri@{##1}{##2}[##3]}%
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
  \def\@acrshortpl##1##2[##3]{\@glsuserii@{##1}{##2}[##3]}%
  \def\@Acrshortpl##1##2[##3]{\@Glsuserii@{##1}{##2}[##3]}%
  \def\@ACRshortpl##1##2[##3]{\@GLSuserii@{##1}{##2}[##3]}%
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
  \def\@acrlong##1##2[##3]{\@glsuseriii@{##1}{##2}[##3]}%
  \def\@Acrlong##1##2[##3]{\@Glsuseriii@{##1}{##2}[##3]}%
  \def\@ACRlong##1##2[##3]{\@GLSuseriii@{##1}{##2}[##3]}%
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
  \def\@acrlongpl##1##2[##3]{\@glsuseriv@{##1}{##2}[##3]}%
  \def\@Acrlongpl##1##2[##3]{\@Glsuseriv@{##1}{##2}[##3]}%
  \def\@ACRlongpl##1##2[##3]{\@GLSuseriv@{##1}{##2}[##3]}%
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
  \def\@acrfull##1##2[##3]{\@glsuseriii@{##1}{##2}[##3] 
    (\acronymfont{\@glsuseri@{##1}{##2}[##3]})}%
  \def\@Acrfull##1##2[##3]{\@Glsuseriii@{##1}{##2}[##3] 
    (\acronymfont{\@glsuseri@{##1}{##2}[##3]})}%
  \def\@ACRfull##1##2[##3]{\@GLSuseriii@{##1}{##2}[##3] 
    (\acronymfont{\@GLSuseri@{##1}{##2}[##3]})}%
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
  \def\@acrfullpl##1##2[##3]{\@glsuseriv@{##1}{##2}[##3] 
    (\acronymfont{\@glsuserii@{##1}{##2}[##3]})}%
  \def\@Acrfullpl##1##2[##3]{\@Glsuseriv@{##1}{##2}[##3] 
    (\acronymfont{\@glsuserii@{##1}{##2}[##3]})}%
  \def\@ACRfullpl##1##2[##3]{\@GLSuseriv@{##1}{##2}[##3] 
    (\acronymfont{\@GLSuserii@{##1}{##2}[##3]})}%
}%
%    \end{macrocode}
%\end{macro}
%
%
%\begin{macro}{\DefineAcronymSynonyms}
%\changes{2.04}{2009 November 10}{new}
%    \begin{macrocode}
\newcommand*{\DefineAcronymSynonyms}{%
%    \end{macrocode}
%\end{macro}
% 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}
}
%    \end{macrocode}
% Define synonyms if required
%    \begin{macrocode}
\ifglsacrshortcuts
  \DefineAcronymSynonyms
\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 \env{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 \env{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
% required 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}[2009/11/03 v1.04 (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
\newtoks\@glsmfirst
\newtoks\@glsmrest
\def\makefirstuc#1{%
  \def\gls@argi{#1}%
  \ifx\gls@argi\@empty
%    \end{macrocode}
% If the argument is empty, do nothing.
%    \begin{macrocode}
  \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
           \expandafter\@glsmfirst\expandafter{\@gls@first}%
           \expandafter\@glsmrest\expandafter{\@gls@rest}%
           \edef\@gls@domfirstuc{\noexpand\@gls@body
             {\noexpand\@gls@makefirstuc\the\@glsmfirst}%
             \the\@glsmrest}%
           \@gls@domfirstuc
        \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}
    \GlossariesWarningNoLine{Navigation panel 
       for glossary type `#1'^^Jmissing group `#2'}%
    \gdef\gls@hypergrouprerun{%
      \GlossariesWarningNoLine{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 \env{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/05/30 v2.01 (NLCT)]
%    \end{macrocode}
%\begin{style}{list}
% The \glostyle{list} glossary style 
% uses the \env{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 \env{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%\begin{macro}{\glslistdottedwidth}
%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}}
%    \begin{macrocode}
\newlength\glslistdottedwidth
\setlength{\glslistdottedwidth}{.5\hsize}
%    \end{macrocode}
%\end{macro}
%
%\begin{style}{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{style}
%\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 \env{longtable} environment in the glossary.
%    \begin{macrocode}
\ProvidesPackage{glossary-long}[2009/05/30 v2.01 (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}.)
%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}}
%    \begin{macrocode}
\@ifundefined{glsdescwidth}{%
  \newlength\glsdescwidth
  \setlength{\glsdescwidth}{0.6\hsize}
}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glspagelistwidth}
% This is a length that governs the width of the page list column.
%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}}
%    \begin{macrocode}
\@ifundefined{glspagelistwidth}{%
  \newlength\glspagelistwidth
  \setlength{\glspagelistwidth}{0.1\hsize}
}{}
%    \end{macrocode}
%\end{macro}
% 
%\begin{style}{long}
% The \glostyle{long} glossary style command which 
% uses the \env{longtable} environment:
%    \begin{macrocode}
\newglossarystyle{long}{%
%    \end{macrocode}
% Use \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{long3col}
% The \glostyle{long3col} style is like \glostyle{long} but with 3 columns
%    \begin{macrocode}
\newglossarystyle{long3col}{%
%    \end{macrocode}
% Use a \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%\iffalse
%    \begin{macrocode}
%</glossary-long.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-longragged.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary Styles using longtable (the glossary-longragged
% package)}
% The glossary styles defined in the \isty{glossary-longragged} package
% used the \env{longtable} environment in the glossary and use
% ragged right formatting for the multiline columns.
%    \begin{macrocode}
\ProvidesPackage{glossary-longragged}[2009/05/30 v2.01 (NLCT)]
%    \end{macrocode}
% Requires the \isty{array} package:
%    \begin{macrocode}
\RequirePackage{array}
%    \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.
% This may have already been defined.
%    \begin{macrocode}
\@ifundefined{glsdescwidth}{%
  \newlength\glsdescwidth
  \setlength{\glsdescwidth}{0.6\hsize}
}{}
%    \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.
%    \begin{macrocode}
\@ifundefined{glspagelistwidth}{%
  \newlength\glspagelistwidth
  \setlength{\glspagelistwidth}{0.1\hsize}
}{}
%    \end{macrocode}
%\end{macro}
% 
%\begin{style}{longragged}
% The \glostyle{longragged} glossary style is like the
% \glostyle{long} but uses ragged right formatting for the
% description column.
%    \begin{macrocode}
\newglossarystyle{longragged}{%
%    \end{macrocode}
% Use \env{longtable} with two columns:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
     {\begin{longtable}{l>{\raggedright}p{\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%
    \tabularnewline}%
%    \end{macrocode}
% Sub entries displayed on the following row without the name:
%    \begin{macrocode}
  \renewcommand*{\glossarysubentryfield}[6]{%
     & \glstarget{##2}{\strut}##4\glspostdescription\space ##6%
    \tabularnewline}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & \tabularnewline}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{longraggedborder}
% The \glostyle{longraggedborder} style is like the above, but with horizontal and
% vertical lines:
%    \begin{macrocode}
\newglossarystyle{longraggedborder}{%
%    \end{macrocode}
% Base it on the glostyle{longragged} style:
%    \begin{macrocode}
  \glossarystyle{longragged}%
%    \end{macrocode}
% Use \env{longtable} with two columns with vertical lines
% between each column:
%    \begin{macrocode}
  \renewenvironment{theglossary}{%
    \begin{longtable}{|l|>{\raggedright}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{style}
%
%\begin{style}{longraggedheader}
% The \glostyle{longraggedheader} style is like the
% \glostyle{longragged} style but with a header:
%    \begin{macrocode}
\newglossarystyle{longraggedheader}{%
%    \end{macrocode}
% Base it on the glostyle{longragged} style:
%    \begin{macrocode}
  \glossarystyle{longragged}%
%    \end{macrocode}
% Set the table's header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \bfseries \entryname & \bfseries \descriptionname
    \tabularnewline\endhead}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{longraggedheaderborder}
% The \glostyle{longraggedheaderborder} style is
% like the \glostyle{longragged} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{longraggedheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{longraggedborder} style:
%    \begin{macrocode}
  \glossarystyle{longraggedborder}%
%    \end{macrocode}
% Set the table's header and add horizontal line to table's foot:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \hline\bfseries \entryname & \bfseries \descriptionname
    \tabularnewline\hline
    \endhead
    \hline\endfoot}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{longragged3col}
% The \glostyle{longragged3col} style is like \glostyle{longragged} but with 3 columns
%    \begin{macrocode}
\newglossarystyle{longragged3col}{%
%    \end{macrocode}
% Use a \env{longtable} with 3 columns:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}%
       >{\raggedright}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\tabularnewline}%
%    \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\tabularnewline}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & &\tabularnewline}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{longragged3colborder}
% The \glostyle{longragged3colborder} style is like the
% \glostyle{longragged3col} style but with a border:
%    \begin{macrocode}
\newglossarystyle{longragged3colborder}{%
%    \end{macrocode}
% Base it on the glostyle{longragged3col} style:
%    \begin{macrocode}
  \glossarystyle{longragged3col}%
%    \end{macrocode}
% Use a \env{longtable} with 3 columns with vertical lines
% around them:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|%
      >{\raggedright}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{style}
%
%\begin{style}{longragged3colheader}
% The \glostyle{longragged3colheader} style is like \glostyle{longragged3col} but with a header row:
%    \begin{macrocode}
\newglossarystyle{longragged3colheader}{%
%    \end{macrocode}
% Base it on the glostyle{longragged3col} style:
%    \begin{macrocode}
  \glossarystyle{longragged3col}%
%    \end{macrocode}
% Set the table's header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \bfseries\entryname&\bfseries\descriptionname&
    \bfseries\pagelistname\tabularnewline\endhead}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{longragged3colheaderborder}
% The \glostyle{longragged3colheaderborder} style is like the above but with a border
%    \begin{macrocode}
\newglossarystyle{longragged3colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{longragged3colborder} style:
%    \begin{macrocode}
  \glossarystyle{longragged3colborder}%
%    \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\tabularnewline\hline\endhead
    \hline\endfoot}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{altlongragged4col}
% The \glostyle{altlongragged4col} style is like the \glostyle{altlong4col}
% style defined in the \isty{glossary-long} package, except that
% ragged right formatting is used for the description and page list
% columns.
%    \begin{macrocode}
\newglossarystyle{altlongragged4col}{%
%    \end{macrocode}
% Use a \env{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l%
       >{\raggedright}p{\glspagelistwidth}}}%
    {\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\tabularnewline}%
%    \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\tabularnewline}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & & &\tabularnewline}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{altlongragged4colheader}
% The \glostyle{altlongragged4colheader} style is like 
% \glostyle{altlongragged4col} but with a header row.
%    \begin{macrocode}
\newglossarystyle{altlongragged4colheader}{%
%    \end{macrocode}
% Base it on the glostyle{altlongragged4col} style:
%    \begin{macrocode}
  \glossarystyle{altlongragged4col}%
%    \end{macrocode}
% Use a \env{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l%
      >{\raggedright}p{\glspagelistwidth}}}%
    {\end{longtable}}%
%    \end{macrocode}
% Table has a header:
%    \begin{macrocode}
  \renewcommand*{\glossaryheader}{%
    \bfseries\entryname&\bfseries\descriptionname&
    \bfseries \symbolname&
    \bfseries\pagelistname\tabularnewline\endhead}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{altlongragged4colborder}
% The \glostyle{altlongragged4colborder} style is like
% \glostyle{altlongragged4col} but with a border.
%    \begin{macrocode}
\newglossarystyle{altlongragged4colborder}{%
%    \end{macrocode}
% Base it on the glostyle{altlongragged4col} style:
%    \begin{macrocode}
   \glossarystyle{altlongragged4col}%
%    \end{macrocode}
% Use a \env{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|%
      >{\raggedright}p{\glspagelistwidth}|}}%
    {\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{style}
%
%\begin{style}{altlongragged4colheaderborder}
% The \glostyle{altlongragged4colheaderborder} style is like the above but
% with a header as well as a border.
%    \begin{macrocode}
\newglossarystyle{altlongragged4colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{altlongragged4col} style:
%    \begin{macrocode}
  \glossarystyle{altlongragged4col}%
%    \end{macrocode}
% Use a \env{longtable} with 4 columns where the second and
% last columns may have multiple lines in each row:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|%
       >{\raggedright}p{\glspagelistwidth}|}}%
    {\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\tabularnewline\hline\endhead
      \hline\endfoot}%
}
%    \end{macrocode}
%\end{style}
%\iffalse
%    \begin{macrocode}
%</glossary-longragged.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 \env{supertabular} environment.
%    \begin{macrocode}
\ProvidesPackage{glossary-super}[2009/05/30 v2.01 (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.\changes{2.01}{2009 May 30}{changed \cs{linewidth}
% to \cs{hsize}}
%    \begin{macrocode}
\@ifundefined{glsdescwidth}{%
  \newlength\glsdescwidth
  \setlength{\glsdescwidth}{0.6\hsize}
}{}
%    \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.\changes{2.01}{2009 May 30}{changed \cs{linewidth}
% to \cs{hsize}}
%    \begin{macrocode}
\@ifundefined{glspagelistwidth}{%
  \newlength\glspagelistwidth
  \setlength{\glspagelistwidth}{0.1\hsize}
}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{style}{super}
% The \glostyle{super} glossary style uses the
% \env{supertabular} environment
% (it uses lengths defined in the \isty{glossary-long} package.)
%    \begin{macrocode}
\newglossarystyle{super}{%
%    \end{macrocode}
% Put the glossary in a \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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 \env{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{style}
%\iffalse
%    \begin{macrocode}
%</glossary-super.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-superragged.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary Styles using supertabular environment (glossary-superragged package)}
% The glossary styles defined in the \isty{glossary-superragged}
% package use the \env{supertabular} environment. These styles 
% are like those provided by the \isty{glossary-super} package, 
% except that the multiline columns have ragged right justification.
%    \begin{macrocode}
\ProvidesPackage{glossary-superragged}[2009/05/30 v2.01 (NLCT)]
%    \end{macrocode}
% Requires the \isty{array} package:
%    \begin{macrocode}
\RequirePackage{array}
%    \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.
%    \begin{macrocode}
\@ifundefined{glsdescwidth}{%
  \newlength\glsdescwidth
  \setlength{\glsdescwidth}{0.6\hsize}
}{}
%    \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.
%    \begin{macrocode}
\@ifundefined{glspagelistwidth}{%
  \newlength\glspagelistwidth
  \setlength{\glspagelistwidth}{0.1\hsize}
}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{style}{superragged}
% The \glostyle{superragged} glossary style uses the
% \env{supertabular} environment.
%    \begin{macrocode}
\newglossarystyle{superragged}{%
%    \end{macrocode}
% Put the glossary in a \env{supertabular} environment with
% two columns and no head or tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{l>{\raggedright}p{\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%
      \tabularnewline}%
%    \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%
     \tabularnewline}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & \tabularnewline}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{superraggedborder}
% The \glostyle{superraggedborder} style is like the above, but with 
% horizontal and vertical lines:
%    \begin{macrocode}
\newglossarystyle{superraggedborder}{%
%    \end{macrocode}
% Base it on the glostyle{superragged} style:
%    \begin{macrocode}
  \glossarystyle{superragged}%
%    \end{macrocode}
% Put the glossary in a \env{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|>{\raggedright}p{\glsdescwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{superraggedheader}
% The \glostyle{superraggedheader} style is like the
% \glostyle{super} style, but with a header:
%    \begin{macrocode}
\newglossarystyle{superraggedheader}{%
%    \end{macrocode}
% Base it on the glostyle{superragged} style:
%    \begin{macrocode}
  \glossarystyle{superragged}%
%    \end{macrocode}
% Put the glossary in a \env{supertabular} environment with
% two columns, a header and no tail:
%    \begin{macrocode}
\renewenvironment{theglossary}%
  {\tablehead{\bfseries \entryname & \bfseries \descriptionname
     \tabularnewline}%
   \tabletail{}%
   \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}%
  {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{superraggedheaderborder}
% The \glostyle{superraggedheaderborder} style is like
% the \glostyle{superragged} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{superraggedheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{super} style:
%    \begin{macrocode}
  \glossarystyle{superragged}%
%    \end{macrocode}
% Put the glossary in a \env{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\tabularnewline\hline}%
     \tabletail{\hline}
     \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{superragged3col}
% The \glostyle{superragged3col} style is like the \glostyle{superragged} 
% style, but with 3 columns:
%    \begin{macrocode}
\newglossarystyle{superragged3col}{%
%    \end{macrocode}
% Put the glossary in a \env{supertabular} environment with
% three columns and no head or tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}%
        >{\raggedright}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\tabularnewline}%
%    \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\tabularnewline}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & &\tabularnewline}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{superragged3colborder}
% The \glostyle{superragged3colborder} style is like the
% \glostyle{superragged3col} style, but with a border:
%    \begin{macrocode}
\newglossarystyle{superragged3colborder}{%
%    \end{macrocode}
% Base it on the glostyle{superragged3col} style:
%    \begin{macrocode}
  \glossarystyle{superragged3col}%
%    \end{macrocode}
% Put the glossary in a \env{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|>{\raggedright}p{\glsdescwidth}|%
       >{\raggedright}p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{superragged3colheader}
% The \glostyle{superragged3colheader} style is like 
% the \glostyle{superragged3col} style but with a header row:
%    \begin{macrocode}
\newglossarystyle{superragged3colheader}{%
%    \end{macrocode}
% Base it on the glostyle{superragged3col} style:
%    \begin{macrocode}
  \glossarystyle{superragged3col}%
%    \end{macrocode}
% Put the glossary in a \env{supertabular} environment with
% three columns, a header and no tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
       \bfseries\pagelistname\tabularnewline}\tabletail{}%
     \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}%
       >{\raggedright}p{\glspagelistwidth}}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{superraggedright3colheaderborder}
% The \glostyle{superragged3colheaderborder} style is like
% the \glostyle{superragged3col} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{superragged3colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{superragged3colborder} style:
%    \begin{macrocode}
  \glossarystyle{superragged3colborder}%
%    \end{macrocode}
% Put the glossary in a \env{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\tabularnewline\hline}%
     \tabletail{\hline}%
     \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|%
       >{\raggedright}p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{altsuperragged4col}
% The \glostyle{altsuperragged4col} glossary style is like 
% \glostyle{altsuper4col} style in the \isty{glossary-super}
% package but uses ragged right formatting in the description 
% and page list columns.
%    \begin{macrocode}
\newglossarystyle{altsuperragged4col}{%
%    \end{macrocode}
% Put the glossary in a \env{supertabular} environment with
% four columns and no head or tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l%
       >{\raggedright}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 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\tabularnewline}%
%    \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\tabularnewline}%
%    \end{macrocode}
% Blank row between groups:
%    \begin{macrocode}
  \renewcommand*{\glsgroupskip}{ & & &\tabularnewline}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{altsuperragged4colheader}
% The \glostyle{altsuperragged4colheader} style is like
% the \glostyle{altsuperragged4col} style but with a header row.
%    \begin{macrocode}
\newglossarystyle{altsuperragged4colheader}{%
%    \end{macrocode}
% Base it on the glostyle{altsuperragged4col} style:
%    \begin{macrocode}
  \glossarystyle{altsuperragged4col}%
%    \end{macrocode}
% Put the glossary in a \env{supertabular} environment with
% four columns, a header and no tail:
%    \begin{macrocode}
  \renewenvironment{theglossary}%
    {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
      \bfseries\symbolname &
      \bfseries\pagelistname\tabularnewline}\tabletail{}%
     \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l%
       >{\raggedright}p{\glspagelistwidth}}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{altsuperragged4colborder}
% The \glostyle{altsuperragged4colborder} style is like
% the \glostyle{altsuperragged4col} style but with a border.
%    \begin{macrocode}
\newglossarystyle{altsuperragged4colborder}{%
%    \end{macrocode}
% Base it on the glostyle{altsuperragged4col} style:
%    \begin{macrocode}
  \glossarystyle{altsuper4col}%
%    \end{macrocode}
% Put the glossary in a \env{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|>{\raggedright}p{\glsdescwidth}|l|%
         >{\raggedright}p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%
%\begin{style}{altsuperragged4colheaderborder}
% The \glostyle{altsuperragged4colheaderborder} style is like
% the \glostyle{altsuperragged4col} style but with a header and border.
%    \begin{macrocode}
\newglossarystyle{altsuperragged4colheaderborder}{%
%    \end{macrocode}
% Base it on the glostyle{altsuperragged4col} style:
%    \begin{macrocode}
  \glossarystyle{altsuperragged4col}%
%    \end{macrocode}
% Put the glossary in a \env{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\tabularnewline\hline}%
     \tabletail{\hline}%
     \begin{supertabular}%
       {|l|>{\raggedright}p{\glsdescwidth}|l|%
          >{\raggedright}p{\glspagelistwidth}|}}%
    {\end{supertabular}}%
}
%    \end{macrocode}
%\end{style}
%\iffalse
%    \begin{macrocode}
%</glossary-superragged.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{style}{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 \env{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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 \env{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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
% \env{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{style}
%
%\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{style}{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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
% \env{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{style}
%
%\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{style}{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 \env{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{style}
%
%\begin{style}{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{style}
%
%\begin{style}{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{style}
%
%\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/11/02 v0.2 (NLCT)]
%    \end{macrocode}
% Pass all options to \sty{glossaries}:
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}}
%    \end{macrocode}
% Process options:
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}
% Required packages:
%    \begin{macrocode}
\RequirePackage{glossaries}
\RequirePackage{accsupp}
%    \end{macrocode}
% 
%\subsection{Defining Replacement Text}
% The version 0.1 stored the replacement text in the
% \gloskey{symbol} key. This has been changed to use the
% new keys defined here. Example of use:
%\begin{verbatim}
%\newglossaryentry{dr}{name=Dr,description={},access={Doctor}}
%\end{verbatim}
%\begin{key}{access}
% The replacement text corresponding to the \gloskey{name} key:
%    \begin{macrocode}
\define@key{glossentry}{access}{%
  \def\@glo@access{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{textaccess}
% The replacement text corresponding to the \gloskey{text} key:
%    \begin{macrocode}
\define@key{glossentry}{textaccess}{%
  \def\@glo@textaccess{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{firstaccess}
% The replacement text corresponding to the \gloskey{first} key:
%    \begin{macrocode}
\define@key{glossentry}{firstaccess}{%
  \def\@glo@firstaccess{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{pluralaccess}
% The replacement text corresponding to the \gloskey{plural} key:
%    \begin{macrocode}
\define@key{glossentry}{pluralaccess}{%
  \def\@glo@pluralaccess{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{firstpluralaccess}
% The replacement text corresponding to the \gloskey{firstplural} key:
%    \begin{macrocode}
\define@key{glossentry}{firstpluralaccess}{%
  \def\@glo@firstpluralaccess{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{symbolaccess}
% The replacement text corresponding to the \gloskey{symbol} key:
%    \begin{macrocode}
\define@key{glossentry}{symbolaccess}{%
  \def\@glo@symbolaccess{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{symbolpluralaccess}
% The replacement text corresponding to the \gloskey{symbolplural} key:
%    \begin{macrocode}
\define@key{glossentry}{symbolpluralaccess}{%
  \def\@glo@symbolpluralaccess{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{descriptionaccess}
% The replacement text corresponding to the \gloskey{description} key:
%    \begin{macrocode}
\define@key{glossentry}{descriptionaccess}{%
  \def\@glo@descaccess{#1}%
}
%    \end{macrocode}
%\end{key}
%\begin{key}{descriptionpluralaccess}
% The replacement text corresponding to the \gloskey{descriptionplural} key:
%    \begin{macrocode}
\define@key{glossentry}{descriptionpluralaccess}{%
  \def\@glo@descpluralaccess{#1}%
}
%    \end{macrocode}
%\end{key}
% There are no equivalent keys for the \gloskey{user1}\ldots
%\gloskey{user6} keys. The replacement text would have to be
% explicitly put in the value, e.g.,
% "user1={\glsaccsupp{inches}{in}}".
%
%\begin{macro}{\@gls@noaccess}
% Indicates that no replacement text has been provided.
%    \begin{macrocode}
\def\@gls@noaccess{\relax}
%    \end{macrocode}
%\end{macro}
%
% Add to the start hook (the \gloskey{access} key is initialised to
% the value of the \gloskey{symbol} key at the start for backwards 
% compatibility):
%    \begin{macrocode}
\let\@gls@oldnewglossaryentryprehook\@newglossaryentryprehook
\renewcommand*{\@newglossaryentryprehook}{%
  \@gls@oldnewglossaryentryprehook
  \def\@glo@access{\@glo@symbol}%
%    \end{macrocode}
% Initialise the other keys:
%    \begin{macrocode}
  \def\@glo@textaccess{\@glo@access}%
  \def\@glo@firstaccess{\@glo@access}%
  \def\@glo@pluralaccess{\@glo@textaccess}%
  \def\@glo@firstpluralaccess{\@glo@pluralaccess}%
  \def\@glo@symbolaccess{\relax}%
  \def\@glo@symbolpluralaccess{\@glo@symbolaccess}%
  \def\@glo@descaccess{\relax}%
  \def\@glo@descpluralaccess{\@glo@descaccess}%
}
%    \end{macrocode}
% Add to the end hook:
%    \begin{macrocode}
\let\@gls@oldnewglossaryentryposthook\@newglossaryentryposthook
\renewcommand*{\@newglossaryentryposthook}{%
  \@gls@oldnewglossaryentryposthook
%    \end{macrocode}
% Store the access information:
%    \begin{macrocode}
  \expandafter
    \protected@xdef\csname glo@\@glo@label @access\endcsname{%
      \@glo@access}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @textaccess\endcsname{%
      \@glo@textaccess}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @firstaccess\endcsname{%
      \@glo@firstaccess}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @pluralaccess\endcsname{%
      \@glo@pluralaccess}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @firstpluralaccess\endcsname{%
      \@glo@firstpluralaccess}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @symbolaccess\endcsname{%
      \@glo@symbolaccess}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @symbolpluralaccess\endcsname{%
      \@glo@symbolpluralaccess}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @descaccess\endcsname{%
      \@glo@descaccess}%
  \expandafter
    \protected@xdef\csname glo@\@glo@label @descpluralaccess\endcsname{%
      \@glo@descpluralaccess}%
}
%    \end{macrocode}
%
%\subsection{Accessing Replacement Text}
%\begin{macro}{\glsentryaccess}
% Get the value of the \gloskey{access} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentryaccess}[1]{%
  \csname glo@#1@access\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentrytextaccess}
% Get the value of the \gloskey{textaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentrytextaccess}[1]{%
  \csname glo@#1@textaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentryfirstaccess}
% Get the value of the \gloskey{firstaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentryfirstaccess}[1]{%
  \csname glo@#1@firstaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentrypluralaccess}
% Get the value of the \gloskey{pluralaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentrypluralaccess}[1]{%
  \csname glo@#1@pluralaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentryfirstpluralaccess}
% Get the value of the \gloskey{firstpluralaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentryfirstpluralaccess}[1]{%
  \csname glo@#1@firstpluralaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentrysymbolaccess}
% Get the value of the \gloskey{symbolaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentrysymbolaccess}[1]{%
  \csname glo@#1@symbolaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentrysymbolpluralaccess}
% Get the value of the \gloskey{symbolpluralaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentrysymbolpluralaccess}[1]{%
  \csname glo@#1@symbolpluralaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentrydescaccess}
% Get the value of the \gloskey{descriptionaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentrydescaccess}[1]{%
  \csname glo@#1@descaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsentrydescpluralaccess}
% Get the value of the \gloskey{descriptionpluralaccess} key for the entry with
% the given label:
%    \begin{macrocode}
\newcommand*{\glsentrydescpluralaccess}[1]{%
  \csname glo@#1@descaccess\endcsname
}
%    \end{macrocode}
%\end{macro}
%
%\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}{\xglsaccsupp}
% Fully expands replacement text before calling \cs{glsaccsupp}
%    \begin{macrocode}
\newcommand*{\xglsaccsupp}[2]{%
   \protected@edef\@gls@replacementtext{#1}%
   \expandafter\glsaccsupp\expandafter{\@gls@replacementtext}{#2}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glsnameaccessdisplay}
% Displays the first argument with the accessibility text for
% the entry with the label given by the second argument (if set).
%    \begin{macrocode}
\DeclareRobustCommand*{\glsnameaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentryaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glstextaccessdisplay}
% As above but for the \gloskey{textaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glstextaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentrytextaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glspluralaccessdisplay}
% As above but for the \gloskey{pluralaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glspluralaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentrypluralaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsfirstaccessdisplay}
% As above but for the \gloskey{firstaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glsfirstaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentryfirstaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsfirstpluralaccessdisplay}
% As above but for the \gloskey{firstpluralaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glsfirstpluralaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentryfirstpluralaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glssymbolaccessdisplay}
% As above but for the \gloskey{symbolaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glssymbolaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentrysymbolaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glssymbolpluralaccessdisplay}
% As above but for the \gloskey{symbolpluralaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glssymbolpluralaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentrysymbolpluralaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsdescriptionaccessdisplay}
% As above but for the \gloskey{descriptionaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glsdescriptionaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentrydescaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsdescriptionpluralaccessdisplay}
% As above but for the \gloskey{descriptionpluralaccess} replacement text.
%    \begin{macrocode}
\DeclareRobustCommand*{\glsdescriptionpluralaccessdisplay}[2]{%
  \protected@edef\@glo@access{\glsentrydescpluralaccess{#2}}%
  \ifx\@glo@access\@gls@noaccess
    #1%
  \else
    \xglsaccsupp{\@glo@access}{#1}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsaccessdisplay}
% Gets the replacement text corresponding to the named key given
% by the first argument and calls the appropriate command 
% defined above.
%    \begin{macrocode}
\DeclareRobustCommand*{\glsaccessdisplay}[3]{%
  \@ifundefined{gls#1accessdisplay}%
  {%
    \PackageError{glossaries-accsupp}{No accessibility support
     for key `#1'}{}%
  }%
  {%
    \csname gls#1accessdisplay\endcsname{#2}{#3}%
  }%
}
%    \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
        {\glstextaccessdisplay{\glsentrytext{#2}}{#2}}%
        {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
        {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
        {#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}}%
        {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
        {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#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}%
    }%
    {%
      \gls@checkisacronymlist\@glo@type
      \ifthenelse{\(\boolean{@glsisacronymlist}\AND
        \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}%
      {%
        \@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
        {\glstextaccessdisplay{\Glsentrytext{#2}}{#2}}%
        {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
        {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
        {#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsfirstaccessdisplay{\Glsentryfirst{#2}}{#2}}%
        {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
        {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#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}%
  }%
  {%
    \gls@checkisacronymlist\@glo@type
    \ifthenelse{\(\boolean{@glsisacronymlist}\AND
      \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}%
    {%
      \@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
        {\glstextaccessdisplay{\glsentrytext{#2}}{#2}}%
        {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
        {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
        {#3}}%
    }%
    {%
      \edef\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}}%
        {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
        {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#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}}%
    }%
    {%
      \gls@checkisacronymlist\@glo@type
      \ifthenelse{\(\boolean{@glsisacronymlist}\AND
        \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}{%
        \@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
        {\glspluralaccessdisplay{\glsentryplural{#2}}{#2}}%
        {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
        {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
        {#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}}%
        {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
        {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#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}%
    }%
    {%
      \gls@checkisacronymlist\@glo@type
      \ifthenelse{\(\boolean{@glsisacronymlist}\AND
        \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}%
      {%
        \@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
        {\glspluralaccessdisplay{\Glsentryplural{#2}}{#2}}%
        {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
        {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
        {#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
        {\glsfirstpluralaccessdisplay{\Glsentryfirstplural{#2}}{#2}}%
        {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
        {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#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
        {\glspluralaccessdisplay{\glsentryplural{#2}}{#2}}%
        {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
        {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
        {#3}}%
    }%
    {%
      \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
      {\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}}%
      {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
      {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#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}}%
    }%
    {%
      \gls@checkisacronymlist\@glo@type
      \ifthenelse{\(\boolean{@glsisacronymlist}\AND
        \boolean{glsacrfootnote}\)\OR\NOT\boolean{glshyperfirst}}%
      {%
        \@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}
%
%\subsection{Displaying the Glossary}
% Entries within the glossary or list of acronyms are now formatted
% via \cs{accsuppglossaryentryfield} and
% \cs{accsuppglossarysubentryfield}.
%\begin{macro}{\@glossaryentryfield}
%    \begin{macrocode}
\ifglsxindy
  \renewcommand*{\@glossaryentryfield}{%
     \string\\accsuppglossaryentryfield}
\else
  \renewcommand*{\@glossaryentryfield}{%
     \string\accsuppglossaryentryfield}
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@glossarysubentryfield}
%    \begin{macrocode}
\ifglsxindy
  \renewcommand*{\@glossarysubentryfield}{%
    \string\\accsuppglossarysubentryfield}
\else
  \renewcommand*{\@glossarysubentryfield}{%
    \string\accsuppglossarysubentryfield}
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\accsuppglossaryentryfield}
%    \begin{macrocode}
\newcommand*{\accsuppglossaryentryfield}[5]{%
  \glossaryentryfield{#1}%
  {\glsnameaccessdisplay{#2}{#1}}%
  {\glsdescriptionaccessdisplay{#3}{#1}}%
  {\glssymbolaccessdisplay{#4}{#1}}{#5}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\accsuppglossarysubentryfield}
%    \begin{macrocode}
\newcommand*{\accsuppglossarysubentryfield}[6]{%
  \glossaryentryfield{#1}{#2}%
  {\glsnameaccessdisplay{#3}{#2}}%
  {\glsdescriptionaccessdisplay{#4}{#2}}%
  {\glssymbolaccessdisplay{#5}{#2}}{#6}%
}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Acronyms}
% Use \cs{newacronymhook} to modify the key list to set
% the access text to the long version by default.
%    \begin{macrocode}
\renewcommand*{\newacronymhook}{%
  \edef\@gls@keylist{\glsshortkey access=\the\glslongtok,%
     \the\glskeylisttok}%
  \expandafter\glskeylisttok\expandafter{\@gls@keylist}%
}
%    \end{macrocode}
%\begin{macro}{\DefaultNewAcronymDef}
% Modify default style to use access text:
%    \begin{macrocode}
\renewcommand*{\DefaultNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\the\glsshorttok},%
      description={\the\glslongtok},%
      descriptionaccess=\relax,
      text={\the\glsshorttok},%
      textaccess={\the\glslongtok},%
      access={\noexpand\@glo@textaccess},%
      sort={\the\glsshorttok},%
      descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      firstaccess=\relax,
      first={\noexpand\glsdescriptionaccessdisplay
        {\the\glslongtok}{\the\glslabeltok}\space
        (\noexpand\glstextaccessdisplay
          {\the\glsshorttok}{\the\glslabeltok})},%
      plural={\the\glsshorttok\acrpluralsuffix},%
      firstplural={\noexpand\glsdescriptionpluralaccessdisplay
        {\noexpand\@glo@descplural}{\the\glslabeltok}\space
        (\noexpand\glspluralaccessdisplay
          {\noexpand\@glo@plural}{\the\glslabeltok})},%
      firstpluralaccess=\relax,
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DescriptionFootnoteNewAcronymDef}
%    \begin{macrocode}
\renewcommand*{\DescriptionFootnoteNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\noexpand\acronymfont{\the\glsshorttok}},%
      sort={\the\glsshorttok},%
      text={\the\glsshorttok},%
      textaccess={\the\glslongtok},%
      access={\noexpand\@glo@textaccess},%
      plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      symbol={\the\glslongtok},%
      symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DescriptionNewAcronymDef}
%    \begin{macrocode}
\renewcommand*{\DescriptionNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\noexpand
        \acrnameformat{\the\glsshorttok}{\the\glslongtok}},%
      access={\noexpand\@glo@textaccess},%
      sort={\the\glsshorttok},%
      first={\the\glslongtok},%
      firstaccess=\relax,
      firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      text={\the\glsshorttok},%
      textaccess={\the\glslongtok},%
      plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      symbol={\noexpand\@glo@text},%
      symbolaccess={\noexpand\@glo@textaccess},%
      symbolplural={\noexpand\@glo@plural},%
      \the\glskeylisttok}%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\FootnoteNewAcronymDef}
%    \begin{macrocode}
\renewcommand*{\FootnoteNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\noexpand\acronymfont{\the\glsshorttok}},%
      access={\noexpand\@glo@textaccess},%
      sort={\the\glsshorttok},%
      text={\the\glsshorttok},%
      textaccess={\the\glslongtok},%
      plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      description={\the\glslongtok},%
      descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SmallNewAcronymDef}
%    \begin{macrocode}
\renewcommand*{\SmallNewAcronymDef}{%
  \edef\@do@newglossaryentry{%
    \noexpand\newglossaryentry{\the\glslabeltok}%
    {%
      type=\acronymtype,%
      name={\noexpand\acronymfont{\the\glsshorttok}},%
      access={\noexpand\@glo@symbolaccess},%
      sort={\the\glsshorttok},%
      text={\noexpand\@glo@symbol},%
      textaccess={\noexpand\@glo@symbolaccess},%
      plural={\noexpand\@glo@symbolplural},%
      first={\the\glslongtok},%
      firstaccess=\relax,
      firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
      description={\noexpand\@glo@first},%
      descriptionplural={\noexpand\@glo@firstplural},%
      symbol={\the\glsshorttok},%
      symbolaccess={\the\glslongtok},%
      symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
      \the\glskeylisttok
    }%
  }%
  \@do@newglossaryentry
}
%    \end{macrocode}
%\end{macro}
% Add means of referencing accessibility support for acronyms:
%\begin{macro}{\glsshortaccesskey}
%    \begin{macrocode}
  \newcommand*{\glsshortaccesskey}{\glsshortkey access}%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsshortpluralaccesskey}
%    \begin{macrocode}
  \newcommand*{\glsshortpluralaccesskey}{\glsshortpluralkey access}%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslongaccesskey}
%    \begin{macrocode}
  \newcommand*{\glslongaccesskey}{\glslongkey access}%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslongpluralaccesskey}
%    \begin{macrocode}
  \newcommand*{\glslongpluralaccesskey}{\glslongpluralkey access}%
%    \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-polyglossia.sty>
%    \end{macrocode}
%\fi
%\subsection{Polyglossia Captions}
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glossaries-polyglossia}[2009/11/09 v1.0 (NLCT)]
%    \end{macrocode}
% English:
%    \begin{macrocode}
\@ifundefined{captionsenglish}{}{%
  \expandafter\toks@\expandafter{\captionsenglish
    \renewcommand*{\glossaryname}{\textenglish{Glossary}}%
    \renewcommand*{\acronymname}{\textenglish{Acronyms}}%
    \renewcommand*{\entryname}{\textenglish{Notation}}%
    \renewcommand*{\descriptionname}{\textenglish{Description}}%
    \renewcommand*{\symbolname}{\textenglish{Symbol}}%
    \renewcommand*{\pagelistname}{\textenglish{Page List}}%
    \renewcommand*{\glssymbolsgroupname}{\textenglish{Symbols}}%
    \renewcommand*{\glsnumbersgroupname}{\textenglish{Numbers}}%
  }%
  \edef\captionsenglish{\the\toks@}%
}
%    \end{macrocode}
% German:
%    \begin{macrocode}
\@ifundefined{captionsgerman}{}{%
  \expandafter\toks@\expandafter{\captionsgerman
    \renewcommand*{\glossaryname}{\textgerman{Glossar}}%
    \renewcommand*{\acronymname}{\textgerman{Akronyme}}%
    \renewcommand*{\entryname}{\textgerman{Bezeichnung}}%
    \renewcommand*{\descriptionname}{\textgerman{Beschreibung}}%
    \renewcommand*{\symbolname}{\textgerman{Symbol}}%
    \renewcommand*{\pagelistname}{\textgerman{Seiten}}%
    \renewcommand*{\glssymbolsgroupname}{\textgerman{Symbole}}%
    \renewcommand*{\glsnumbersgroupname}{\textgerman{Zahlen}}%
  }% 
  \edef\captionsgerman{\the\toks@}%
}
%    \end{macrocode}
% Italian:
%    \begin{macrocode}
\@ifundefined{captionsitalian}{}{%
  \expandafter\toks@\expandafter{\captionsitalian
    \renewcommand*{\glossaryname}{\textitalian{Glossario}}%
    \renewcommand*{\acronymname}{\textitalian{Acronimi}}%
    \renewcommand*{\entryname}{\textitalian{Nomenclatura}}%
    \renewcommand*{\descriptionname}{\textitalian{Descrizione}}%
    \renewcommand*{\symbolname}{\textitalian{Simbolo}}%
    \renewcommand*{\pagelistname}{\textitalian{Elenco delle pagine}}%
    \renewcommand*{\glssymbolsgroupname}{\textitalian{Simboli}}%
    \renewcommand*{\glsnumbersgroupname}{\textitalian{Numeri}}%
  }%
  \edef\captionsitalian{\the\toks@}% 
}
%    \end{macrocode}
% Dutch:
%    \begin{macrocode}
\@ifundefined{captionsdutch}{}{%
  \expandafter\toks@\expandafter{\captionsdutch
    \renewcommand*{\glossaryname}{\textdutch{Woordenlijst}}%
    \renewcommand*{\acronymname}{\textdutch{Acroniemen}}%
    \renewcommand*{\entryname}{\textdutch{Benaming}}%
    \renewcommand*{\descriptionname}{\textdutch{Beschrijving}}%
    \renewcommand*{\symbolname}{\textdutch{Symbool}}%
    \renewcommand*{\pagelistname}{\textdutch{Pagina's}}%
    \renewcommand*{\glssymbolsgroupname}{\textdutch{Symbolen}}%
    \renewcommand*{\glsnumbersgroupname}{\textdutch{Cijfers}}%
  }%
  \edef\captionsdutch{\the\toks@}%
}
%    \end{macrocode}
% Spanish:
%    \begin{macrocode}
\@ifundefined{captionsspanish}{}{%
  \expandafter\toks@\expandafter{\captionsspanish
    \renewcommand*{\glossaryname}{\textspanish{Glosario}}%
    \renewcommand*{\acronymname}{\textspanish{Siglas}}%
    \renewcommand*{\entryname}{\textspanish{Entrada}}%
    \renewcommand*{\descriptionname}{\textspanish{Descripci\'on}}%
    \renewcommand*{\symbolname}{\textspanish{S\'{\i}mbolo}}%
    \renewcommand*{\pagelistname}{\textspanish{Lista de p\'aginas}}%
    \renewcommand*{\glssymbolsgroupname}{\textspanish{S\'{\i}mbolos}}%
    \renewcommand*{\glsnumbersgroupname}{\textspanish{N\'umeros}}%
  }%
  \edef\captionsspanish{\the\toks@}%
}
%    \end{macrocode}
% French:
%    \begin{macrocode}
\@ifundefined{captionsfrench}{}{%
  \expandafter\toks@\expandafter{\captionsfrench
    \renewcommand*{\glossaryname}{\textfrench{Glossaire}}%
    \renewcommand*{\acronymname}{\textfrench{Acronymes}}%
    \renewcommand*{\entryname}{\textfrench{Terme}}%
    \renewcommand*{\descriptionname}{\textfrench{Description}}%
    \renewcommand*{\symbolname}{\textfrench{Symbole}}%
    \renewcommand*{\pagelistname}{\textfrench{Pages}}%
    \renewcommand*{\glssymbolsgroupname}{\textfrench{Symboles}}%
    \renewcommand*{\glsnumbersgroupname}{\textfrench{Nombres}}%
  }%
  \edef\captionsfrench{\the\toks@}% 
}
%    \end{macrocode}
% Danish:
%    \begin{macrocode}
\@ifundefined{captionsdanish}{}{%
  \expandafter\toks@\expandafter{\captionsdanish
    \renewcommand*{\glossaryname}{\textdanish{Ordliste}}%
    \renewcommand*{\acronymname}{\textdanish{Akronymer}}%
    \renewcommand*{\entryname}{\textdanish{Symbolforklaring}}%
    \renewcommand*{\descriptionname}{\textdanish{Beskrivelse}}%
    \renewcommand*{\symbolname}{\textdanish{Symbol}}%
    \renewcommand*{\pagelistname}{\textdanish{Side}}%
    \renewcommand*{\glssymbolsgroupname}{\textdanish{Symboler}}%
    \renewcommand*{\glsnumbersgroupname}{\textdanish{Tal}}%
  }%
  \edef\captionsdanish{\the\toks@}%
}
%    \end{macrocode}
% Irish:
%    \begin{macrocode}
\@ifundefined{captionsirish}{}{%
  \expandafter\toks@\expandafter{\captionsirish
    \renewcommand*{\glossaryname}{\textirish{Gluais}}%
    \renewcommand*{\acronymname}{\textirish{Acrainmneacha}}%
    \renewcommand*{\entryname}{\textirish{Ciall}}%
    \renewcommand*{\descriptionname}{\textirish{Tuairisc}}%
    \renewcommand*{\symbolname}{\textirish{Comhartha}}%
    \renewcommand*{\glssymbolsgroupname}{\textirish{Comhartha\'{\i}}}%
    \renewcommand*{\pagelistname}{\textirish{Leathanaigh}}%
    \renewcommand*{\glsnumbersgroupname}{\textirish{Uimhreacha}}%
  }%
  \edef\captionsirish{\the\toks@}%
}
%    \end{macrocode}
% Hungarian:
%    \begin{macrocode}
\@ifundefined{captionsmagyar}{}{%
  \expandafter\toks@\expandafter{\captionsmagyar
    \renewcommand*{\glossaryname}{\textmagyar{Sz\'ojegyz\'ek}}%
    \renewcommand*{\acronymname}{\textmagyar{Bet\H uszavak}}%
    \renewcommand*{\entryname}{\textmagyar{Kifejez\'es}}%
    \renewcommand*{\descriptionname}{\textmagyar{Magyar\'azat}}%
    \renewcommand*{\symbolname}{\textmagyar{Jel\"ol\'es}}%
    \renewcommand*{\pagelistname}{\textmagyar{Oldalsz\'am}}%
    \renewcommand*{\glssymbolsgroupname}{\textmagyar{Jelek}}%
    \renewcommand*{\glsnumbersgroupname}{\textmagyar{Sz\'amjegyek}}%
  }%
  \edef\captionsmagyar{\the\toks@}%
}
%    \end{macrocode}
% Polish
% \changes{1.13}{2008 May 10}{Add Polish support}
%    \begin{macrocode}
\@ifundefined{captionspolish}{}{%
  \expandafter\toks@\expandafter{\captionspolish
    \renewcommand*{\glossaryname}{\textpolish{S{\l}ownik termin\'ow}}%
    \renewcommand*{\acronymname}{\textpolish{Skr\'ot}}%
    \renewcommand*{\entryname}{\textpolish{Termin}}%
    \renewcommand*{\descriptionname}{\textpolish{Opis}}%
    \renewcommand*{\symbolname}{\textpolish{Symbol}}%
    \renewcommand*{\pagelistname}{\textpolish{Strony}}%
    \renewcommand*{\glssymbolsgroupname}{\textpolish{Symbole}}%
    \renewcommand*{\glsnumbersgroupname}{\textpolish{Liczby}}%
  }%
  \edef\captionspolish{\the\toks@}%
}
%    \end{macrocode}
% Portugues
%    \begin{macrocode}
\@ifundefined{captionsportuges}{}{%
  \expandafter\toks@\expandafter{\captionsportuges
    \renewcommand*{\glossaryname}{\textportuges{Gloss\'ario}}%
    \renewcommand*{\acronymname}{\textportuges{Siglas}}%
    \renewcommand*{\entryname}{\textportuges{Nota\c c\~ao}}%
    \renewcommand*{\descriptionname}{\textportuges{Descri\c c\~ao}}%
    \renewcommand*{\symbolname}{\textportuges{S\'imbolo}}%
    \renewcommand*{\pagelistname}{\textportuges{Lista de P\'aginas}}%
    \renewcommand*{\glssymbolsgroupname}{\textportuges{S\'imbolos}}%
    \renewcommand*{\glsnumbersgroupname}{\textportuges{N\'umeros}}%
  }%
  \edef\captionsportuges{\the\toks@}%
}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-polyglossia.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Brazilian.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}
%\changes{2.02}{2009 July 13}{Changed Brazil to Brazilian}
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Brazilian}
%    \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-Brazilian.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-Serbian.dict>
%    \end{macrocode}
%\fi
%\subsection{Serbian Dictionary}
% This dictionary was provided by Zoran Filipovic.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Serbian}
\providetranslation{Glossary}{Mali re\v cnik}
\providetranslation{Acronyms}{Skra\' cenice}
\providetranslation{Notation (glossaries)}{Oznaka}
\providetranslation{Description (glossaries)}{Opis}
\providetranslation{Symbol (glossaries)}{Simbol}
\providetranslation{Page List (glossaries)}{Stranica}
\providetranslation{Symbols (glossaries)}{Simboli}
\providetranslation{Numbers (glossaries)}{Brojevi}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Serbian.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-custom-acronym.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[acronym,         % create list of acronyms
            nomain,          % don't need main glossary for this example
            style=tree,      % need a style that displays the symbol
            hyperfirst=false,% don't hyperlink first use
            sanitize=none    % switch off sanitization as description 
                             % will be used in the main text
            ]{glossaries}

\makeglossaries

  % This is a sample file to illustrate how to define a custom
  % acronym. This example defines the acronym so that on first use
  % it displays the short form in the text and places the long form
  % and its description in a footnote. In the main body of the
  % document the short form will be displayed in small caps, but in
  % the list of acronyms the short form is displayed in normal
  % capitals. To ensure this, the short form should be written in
  % lower case when the acronym is defined, and \MakeUppercase is
  % used when it's displayed in the list of acronyms.

  % In the list of acronyms, the long form is used as the name, the
  % short form is used as the symbol and the user supplies the
  % description when defining the acronym.

\renewcommand*{\CustomAcronymFields}{%
  name={\the\glslongtok},%
  symbol={\MakeUppercase{\the\glsshorttok}},%
  text={\textsc{\the\glsshorttok}},%
  plural={\textsc{\the\glsshorttok}\noexpand\acrpluralsuffix}%
}

\renewcommand*{\SetCustomDisplayStyle}[1]{%
  % ##1 corresponds to the 'first' key
  % ##2 corresponds to the 'description' key
  % ##3 corresponds to the 'symbol' key
  % ##4 is the inserted text given by the final optional argument to
  % commands like \gls
  % The short form can be obtained via \glsentryuseri{\glslabel}
  % The plural short form can be obtained via
  % \glsentryuserii{\glslabel}
  % The long form can be obtained via \glsentryuseriii{\glslabel}
  % The plural long form can be obtained via
  % \glsentryuseriv{\glslabel}
  \defglsdisplayfirst[#1]{##1##4\protect\footnote{%
    \glsentryuseriii{\glslabel}: ##2}}%
  % ##1 corresponds to the 'text' key
  % the rest as above
  \defglsdisplay[#1]{##1##4}%
}

 % Now set the custom acronym style (to override the default style)
\SetCustomStyle

 % Now define the acronyms (must be done after setting the custom
 % style)

\newacronym[description={set of tags for use in developing hypertext
documents}]{html}{html}{Hyper Text Markup Language}

\newacronym[description={language used to describe the layout of a
document written in a markup language}]{css}{css}{Cascading Style
Sheet}

\begin{document}

\gls{css}. \gls{html}.

\gls{css}. \gls{html}.

\printglossaries
\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sample-custom-acronym.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,acronym]{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[acronym,smallcaps]{glossaries-accsupp}

\makeglossaries

\newglossaryentry{dr}{name=Dr,description={Doctor},access={Doctor}}

\newacronym[\glsshortaccesskey=S V M]{svm}{svm}{support vector machine}

\newacronym{eg}{e.g.}{for example}

\begin{document}
\gls{dr}~Jones.
\gls{dr}~Jones.

\Gls{eg}, \gls{eg}

\gls{svm}. \gls{svm}.

\printglossaries
\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}
%<*sampleacronyms.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{article}

\usepackage[acronym,footnote,acronymlists={main,acronym2}]{glossaries}

\newglossary[alg2]{acronym2}{acr2}{acn2}{Statistical Acronyms}

\makeglossaries

% Main glossary is a list of calculus acronyms

\renewcommand{\glossaryname}{Calculus Acronyms}

\newacronym[type=main]{vc}{VC}{Vector Calculus}
\newacronym[type=main]{ftoc}{FTOC}{Fundamental Theorem of Calculus}

% "acronym" glossary is a list of computer related acronyms

\renewcommand{\acronymname}{Computer Acronyms}

\newacronym{kb}{kb}{KiloBit}
\newacronym{kB}{kB}{KiloByte}

% "acronym2" glossary is a list of statistical acronyms

\newacronym[type=acronym2]{svm}{SVM}{Support Vector Machine}

\begin{document}
\section{Sample Section}
\gls{kb}. \gls{kB}. \gls{vc}. \gls{ftoc}. \gls{svm}.

\gls{kb}. \gls{kB}. \gls{vc}. \gls{ftoc}. \gls{svm}.

\printglossaries
\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleacronyms.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}

\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