summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries/glossaries-user.tex
blob: b1cd27efc69bdbb0bfed524507c4fe1095b42acd (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
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
27482
27483
27484
27485
27486
27487
27488
27489
27490
27491
27492
27493
27494
27495
27496
27497
27498
27499
27500
27501
27502
27503
27504
27505
27506
27507
27508
27509
27510
27511
27512
27513
27514
27515
27516
27517
27518
27519
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552
27553
27554
27555
27556
27557
27558
27559
27560
27561
27562
27563
27564
27565
27566
27567
27568
27569
27570
27571
27572
27573
27574
27575
27576
27577
27578
27579
27580
27581
27582
27583
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
27620
27621
27622
27623
27624
27625
27626
27627
27628
27629
27630
27631
27632
27633
27634
27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
27656
27657
27658
27659
27660
27661
27662
27663
27664
27665
27666
27667
27668
27669
27670
27671
27672
27673
27674
27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
27685
27686
27687
27688
27689
27690
27691
27692
27693
27694
27695
27696
27697
27698
27699
27700
27701
27702
27703
27704
27705
27706
27707
27708
27709
27710
27711
27712
27713
27714
27715
27716
27717
27718
27719
27720
27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
27745
27746
27747
27748
27749
27750
27751
27752
27753
27754
27755
27756
27757
27758
27759
27760
27761
27762
27763
27764
27765
27766
27767
27768
27769
27770
27771
27772
27773
27774
27775
27776
27777
27778
27779
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789
27790
27791
27792
27793
27794
27795
27796
27797
27798
27799
27800
27801
27802
27803
27804
27805
27806
27807
27808
27809
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
27825
27826
27827
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
27843
27844
27845
27846
27847
27848
27849
27850
27851
27852
27853
27854
27855
27856
27857
27858
27859
27860
27861
27862
27863
27864
27865
27866
27867
27868
27869
27870
27871
27872
27873
27874
27875
27876
27877
27878
27879
27880
27881
27882
27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903
27904
27905
27906
27907
27908
27909
27910
27911
27912
27913
27914
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
27930
27931
27932
27933
27934
27935
27936
27937
27938
27939
27940
27941
27942
27943
27944
27945
27946
27947
27948
27949
27950
27951
27952
27953
27954
27955
27956
27957
27958
27959
27960
27961
27962
27963
27964
27965
27966
27967
27968
27969
27970
27971
27972
27973
27974
27975
27976
27977
27978
27979
27980
27981
27982
27983
27984
27985
27986
27987
27988
27989
27990
27991
27992
27993
27994
27995
27996
27997
27998
27999
28000
28001
28002
28003
28004
28005
28006
28007
28008
28009
28010
28011
28012
28013
28014
28015
28016
28017
28018
28019
28020
28021
28022
28023
28024
28025
28026
28027
28028
28029
28030
28031
28032
28033
28034
28035
28036
28037
28038
28039
28040
28041
28042
28043
28044
28045
28046
28047
28048
28049
28050
28051
28052
28053
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063
28064
28065
28066
28067
28068
28069
28070
28071
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
28090
28091
28092
28093
28094
28095
28096
28097
28098
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110
28111
28112
28113
28114
28115
28116
28117
28118
28119
28120
28121
28122
28123
28124
28125
28126
28127
28128
28129
28130
28131
28132
28133
28134
28135
28136
28137
28138
28139
28140
28141
28142
28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
28162
28163
28164
28165
28166
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
28189
28190
28191
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202
28203
28204
28205
28206
28207
28208
28209
28210
28211
28212
28213
28214
28215
28216
28217
28218
28219
28220
28221
28222
28223
28224
28225
28226
28227
28228
28229
28230
28231
28232
28233
28234
28235
28236
28237
28238
28239
28240
28241
28242
28243
28244
28245
28246
28247
28248
28249
28250
28251
28252
28253
28254
28255
28256
28257
28258
28259
28260
28261
28262
28263
28264
28265
28266
28267
28268
28269
28270
28271
28272
28273
28274
28275
28276
28277
28278
28279
28280
28281
28282
28283
28284
28285
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296
28297
28298
28299
28300
28301
28302
28303
28304
28305
28306
28307
28308
28309
28310
28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329
28330
28331
28332
28333
28334
28335
28336
28337
28338
28339
28340
28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351
28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
28378
28379
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390
28391
28392
28393
28394
28395
28396
28397
28398
28399
28400
28401
28402
28403
28404
28405
28406
28407
28408
28409
28410
28411
28412
28413
28414
28415
28416
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
28432
28433
28434
28435
28436
28437
28438
28439
28440
28441
28442
28443
28444
28445
28446
28447
28448
28449
28450
28451
28452
28453
28454
28455
28456
28457
28458
28459
28460
28461
28462
28463
28464
28465
28466
28467
28468
28469
28470
28471
28472
28473
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484
28485
28486
28487
28488
28489
28490
28491
28492
28493
28494
28495
28496
28497
28498
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
28514
28515
28516
28517
28518
28519
28520
28521
28522
28523
28524
28525
28526
28527
28528
28529
28530
28531
28532
28533
28534
28535
28536
28537
28538
28539
28540
28541
28542
28543
28544
28545
28546
28547
28548
28549
28550
28551
28552
28553
28554
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
28584
28585
28586
28587
28588
28589
28590
28591
28592
28593
28594
28595
28596
28597
28598
28599
28600
28601
28602
28603
28604
28605
28606
28607
28608
28609
28610
28611
28612
28613
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
28629
28630
28631
28632
28633
28634
28635
28636
28637
28638
28639
28640
28641
28642
28643
28644
28645
28646
28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
28659
28660
28661
28662
28663
28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
28675
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
28705
28706
28707
28708
28709
28710
28711
28712
28713
28714
28715
28716
28717
28718
28719
28720
28721
28722
28723
28724
28725
28726
28727
28728
28729
28730
28731
28732
28733
28734
28735
28736
28737
28738
28739
28740
28741
28742
28743
28744
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
28774
28775
28776
28777
28778
28779
28780
28781
28782
28783
28784
28785
28786
28787
28788
28789
28790
28791
28792
28793
28794
28795
28796
28797
28798
28799
28800
28801
28802
28803
28804
28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
28825
28826
28827
28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
28847
28848
28849
28850
28851
28852
28853
28854
28855
28856
28857
28858
28859
28860
28861
28862
28863
28864
28865
28866
28867
28868
28869
28870
28871
28872
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
28918
28919
28920
28921
28922
28923
28924
28925
28926
28927
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939
28940
28941
28942
28943
28944
28945
28946
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
28964
28965
28966
28967
28968
28969
28970
28971
28972
28973
28974
28975
28976
28977
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
29011
29012
29013
29014
29015
29016
29017
29018
29019
29020
29021
29022
29023
29024
29025
29026
29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
29037
29038
29039
29040
29041
29042
29043
29044
29045
29046
29047
29048
29049
29050
29051
29052
29053
29054
29055
29056
29057
29058
29059
29060
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
29071
29072
29073
29074
29075
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085
29086
29087
29088
29089
29090
29091
29092
29093
29094
29095
29096
29097
29098
29099
29100
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
29138
29139
29140
29141
29142
29143
29144
29145
29146
29147
29148
29149
29150
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
29166
29167
29168
29169
29170
29171
29172
29173
29174
29175
29176
29177
29178
29179
29180
29181
29182
29183
29184
29185
29186
29187
29188
29189
29190
29191
29192
29193
29194
29195
29196
29197
29198
29199
29200
29201
29202
29203
29204
29205
29206
29207
29208
29209
29210
29211
29212
29213
29214
29215
29216
29217
29218
29219
29220
29221
29222
29223
29224
29225
29226
29227
29228
29229
29230
29231
29232
29233
29234
29235
29236
29237
29238
29239
29240
29241
29242
29243
29244
29245
29246
29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
29257
29258
29259
29260
29261
29262
29263
29264
29265
29266
29267
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
29286
29287
29288
29289
29290
29291
29292
29293
29294
29295
29296
29297
29298
29299
29300
29301
29302
29303
29304
29305
29306
29307
29308
29309
29310
29311
29312
29313
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323
29324
29325
29326
29327
29328
29329
29330
29331
29332
29333
29334
29335
29336
29337
29338
29339
29340
29341
29342
29343
29344
29345
29346
29347
29348
29349
29350
29351
29352
29353
29354
29355
29356
29357
29358
29359
29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
29376
29377
29378
29379
29380
29381
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
29404
29405
29406
29407
29408
29409
29410
29411
29412
29413
29414
29415
29416
29417
29418
29419
29420
29421
29422
29423
29424
29425
29426
29427
29428
29429
29430
29431
29432
29433
29434
29435
29436
29437
29438
29439
29440
29441
29442
29443
29444
29445
29446
29447
29448
29449
29450
29451
29452
29453
29454
29455
29456
29457
29458
29459
29460
29461
29462
29463
29464
29465
29466
29467
29468
29469
29470
29471
29472
29473
29474
29475
29476
29477
29478
29479
29480
29481
29482
29483
29484
29485
29486
29487
29488
29489
29490
29491
29492
29493
29494
29495
29496
29497
29498
29499
29500
29501
29502
29503
29504
29505
29506
29507
29508
29509
29510
29511
29512
29513
29514
29515
29516
29517
29518
29519
29520
29521
29522
29523
29524
29525
29526
29527
29528
29529
29530
29531
29532
29533
29534
29535
29536
29537
29538
29539
29540
29541
29542
29543
29544
29545
29546
29547
29548
29549
29550
29551
29552
29553
29554
29555
29556
29557
29558
29559
29560
29561
29562
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
29584
29585
29586
29587
29588
29589
29590
29591
29592
29593
29594
29595
29596
29597
29598
29599
29600
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611
29612
29613
29614
29615
29616
29617
29618
29619
29620
29621
29622
29623
29624
29625
29626
29627
29628
29629
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639
29640
29641
29642
29643
29644
29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
29663
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691
29692
29693
29694
29695
29696
29697
29698
29699
29700
29701
29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
29713
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723
29724
29725
29726
29727
29728
29729
29730
29731
29732
29733
29734
29735
29736
29737
29738
29739
29740
29741
29742
29743
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753
29754
29755
29756
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768
29769
29770
29771
29772
29773
29774
29775
29776
29777
29778
29779
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
29795
29796
29797
29798
29799
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809
29810
29811
29812
29813
29814
29815
29816
29817
29818
29819
29820
29821
29822
29823
29824
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834
29835
29836
29837
29838
29839
29840
29841
29842
29843
29844
29845
29846
29847
29848
29849
29850
29851
29852
29853
29854
29855
29856
29857
29858
29859
29860
29861
29862
29863
29864
29865
29866
29867
29868
29869
29870
29871
29872
29873
29874
29875
29876
29877
29878
29879
29880
29881
29882
29883
29884
29885
29886
29887
29888
29889
29890
29891
29892
29893
29894
29895
29896
29897
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918
29919
29920
29921
29922
29923
29924
29925
29926
29927
29928
29929
29930
29931
29932
29933
29934
29935
29936
29937
29938
29939
29940
29941
29942
29943
29944
29945
29946
29947
29948
29949
29950
29951
29952
29953
29954
29955
29956
29957
29958
29959
29960
29961
29962
29963
29964
29965
29966
29967
29968
29969
29970
29971
29972
29973
29974
29975
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
30008
30009
30010
30011
30012
30013
30014
30015
30016
30017
30018
30019
30020
30021
30022
30023
30024
30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
30053
30054
30055
30056
30057
30058
30059
30060
30061
30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
30072
30073
30074
30075
30076
30077
30078
30079
30080
30081
30082
30083
30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
30096
30097
30098
30099
30100
30101
30102
30103
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
30154
30155
30156
30157
30158
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187
30188
30189
30190
30191
30192
30193
30194
30195
30196
30197
30198
30199
30200
30201
30202
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212
30213
30214
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225
30226
30227
30228
30229
30230
30231
30232
30233
30234
30235
30236
30237
30238
30239
30240
30241
30242
30243
30244
30245
30246
30247
30248
30249
30250
30251
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
30275
30276
30277
30278
30279
30280
30281
30282
30283
30284
30285
30286
30287
30288
30289
30290
30291
30292
30293
30294
30295
30296
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
30312
30313
30314
30315
30316
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335
30336
30337
30338
30339
30340
30341
30342
30343
30344
30345
30346
30347
30348
30349
30350
30351
30352
30353
30354
30355
30356
30357
30358
30359
30360
30361
30362
30363
30364
30365
30366
30367
30368
30369
30370
30371
30372
30373
30374
30375
30376
30377
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
30390
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405
30406
30407
30408
30409
30410
30411
30412
30413
30414
30415
30416
30417
30418
30419
30420
30421
30422
30423
30424
30425
30426
30427
30428
30429
30430
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
30446
30447
30448
30449
30450
30451
30452
30453
30454
30455
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480
30481
30482
30483
30484
30485
30486
30487
30488
30489
30490
30491
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
30514
30515
30516
30517
30518
30519
30520
30521
30522
30523
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534
30535
30536
30537
30538
30539
30540
30541
30542
30543
30544
30545
30546
30547
30548
30549
30550
30551
30552
30553
30554
30555
30556
30557
30558
30559
30560
30561
30562
30563
30564
30565
30566
30567
30568
30569
30570
30571
30572
30573
30574
30575
30576
30577
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
30607
30608
30609
30610
30611
30612
30613
30614
30615
30616
30617
30618
30619
30620
30621
30622
30623
30624
30625
30626
30627
30628
30629
30630
30631
30632
30633
30634
30635
30636
30637
30638
30639
30640
30641
30642
30643
30644
30645
30646
30647
30648
30649
30650
30651
30652
30653
30654
30655
30656
30657
30658
30659
30660
30661
30662
30663
30664
30665
30666
30667
30668
30669
30670
30671
30672
30673
30674
30675
30676
30677
30678
30679
30680
30681
30682
30683
30684
30685
30686
30687
30688
30689
30690
30691
30692
30693
30694
30695
30696
30697
30698
30699
30700
30701
30702
30703
30704
30705
30706
30707
30708
30709
30710
30711
30712
30713
30714
30715
30716
30717
30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
30729
30730
30731
30732
30733
30734
30735
30736
30737
30738
30739
30740
30741
30742
30743
30744
30745
30746
30747
30748
30749
30750
30751
30752
30753
30754
30755
30756
30757
30758
30759
30760
30761
30762
30763
30764
30765
30766
30767
30768
30769
30770
30771
30772
30773
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
30789
30790
30791
30792
30793
30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
30808
30809
30810
30811
30812
30813
30814
30815
30816
30817
30818
30819
30820
30821
30822
30823
30824
30825
30826
30827
30828
30829
30830
30831
30832
30833
30834
30835
30836
30837
30838
30839
30840
30841
30842
30843
30844
30845
30846
30847
30848
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
30864
30865
30866
30867
30868
30869
30870
30871
30872
30873
30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
30885
30886
30887
30888
30889
30890
30891
30892
30893
30894
30895
30896
30897
30898
30899
30900
30901
30902
30903
30904
30905
30906
30907
30908
30909
30910
30911
30912
30913
30914
30915
30916
30917
30918
30919
30920
30921
30922
30923
30924
30925
30926
30927
30928
30929
30930
30931
30932
30933
30934
30935
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945
30946
30947
30948
30949
30950
30951
30952
30953
30954
30955
30956
30957
30958
30959
30960
30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977
30978
30979
30980
30981
30982
30983
30984
30985
30986
30987
30988
30989
30990
30991
30992
30993
30994
30995
30996
30997
30998
30999
31000
31001
31002
31003
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
31019
31020
31021
31022
31023
31024
31025
31026
31027
31028
31029
31030
31031
31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
31047
31048
31049
31050
31051
31052
31053
31054
31055
31056
31057
31058
31059
31060
31061
31062
31063
31064
31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
31082
31083
31084
31085
31086
31087
31088
31089
31090
31091
31092
31093
31094
31095
31096
31097
31098
31099
31100
31101
31102
31103
31104
31105
31106
31107
31108
31109
31110
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
31127
31128
31129
31130
31131
31132
31133
31134
31135
31136
31137
31138
31139
31140
31141
31142
31143
31144
31145
31146
31147
31148
31149
31150
31151
31152
31153
31154
31155
31156
31157
31158
31159
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178
31179
31180
31181
31182
31183
31184
31185
31186
31187
31188
31189
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31211
31212
31213
31214
31215
31216
31217
31218
31219
31220
31221
31222
31223
31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
31234
31235
31236
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246
31247
31248
31249
31250
31251
31252
31253
31254
31255
31256
31257
31258
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
31279
31280
31281
31282
31283
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
31299
31300
31301
31302
31303
31304
31305
31306
31307
31308
31309
31310
31311
31312
31313
31314
31315
31316
31317
31318
31319
31320
31321
31322
31323
31324
31325
31326
31327
31328
31329
31330
31331
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31554
31555
31556
31557
31558
31559
31560
31561
31562
31563
31564
31565
31566
31567
31568
31569
31570
31571
31572
31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
31595
31596
31597
31598
31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
31610
31611
31612
31613
31614
31615
31616
31617
31618
31619
31620
31621
31622
31623
31624
31625
31626
31627
31628
31629
31630
31631
31632
31633
31634
31635
31636
31637
31638
31639
31640
31641
31642
31643
31644
31645
31646
31647
31648
31649
31650
31651
31652
31653
31654
31655
31656
31657
31658
31659
31660
31661
31662
31663
31664
31665
31666
31667
31668
31669
31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
31688
31689
31690
31691
31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
31706
31707
31708
31709
31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
31724
31725
31726
31727
31728
31729
31730
31731
31732
31733
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
31749
31750
31751
31752
31753
31754
31755
31756
31757
31758
31759
31760
31761
31762
31763
31764
31765
31766
31767
31768
31769
31770
31771
31772
31773
31774
31775
31776
31777
31778
31779
31780
31781
31782
31783
31784
31785
31786
31787
31788
31789
31790
31791
31792
31793
31794
31795
31796
31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
31808
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
31824
31825
31826
31827
31828
31829
31830
31831
31832
31833
31834
31835
31836
31837
31838
31839
31840
31841
31842
31843
31844
31845
31846
31847
31848
31849
31850
31851
31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
31862
31863
31864
31865
31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
31876
31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
31890
31891
31892
31893
31894
31895
31896
31897
31898
31899
31900
31901
31902
31903
31904
31905
31906
31907
31908
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
31924
31925
31926
31927
31928
31929
31930
31931
31932
31933
31934
31935
31936
31937
31938
31939
31940
31941
31942
31943
31944
31945
31946
31947
31948
31949
31950
31951
31952
31953
31954
31955
31956
31957
31958
31959
31960
31961
31962
31963
31964
31965
31966
31967
31968
31969
31970
31971
31972
31973
31974
31975
31976
31977
31978
31979
31980
31981
31982
31983
31984
31985
31986
31987
31988
31989
31990
31991
31992
31993
31994
31995
31996
31997
31998
31999
32000
32001
32002
32003
32004
32005
32006
32007
32008
32009
32010
32011
32012
32013
32014
32015
32016
32017
32018
32019
32020
32021
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
32037
32038
32039
32040
32041
32042
32043
32044
32045
32046
32047
32048
32049
32050
32051
32052
32053
32054
32055
32056
32057
32058
32059
32060
32061
32062
32063
32064
32065
32066
32067
32068
32069
32070
32071
32072
32073
32074
32075
32076
32077
32078
32079
32080
32081
32082
32083
32084
32085
32086
32087
32088
32089
32090
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
32114
32115
32116
32117
32118
32119
32120
32121
32122
32123
32124
32125
32126
32127
32128
32129
32130
32131
32132
32133
32134
32135
32136
32137
32138
32139
32140
32141
32142
32143
32144
32145
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
32161
32162
32163
32164
32165
32166
32167
32168
32169
32170
32171
32172
32173
32174
32175
32176
32177
32178
32179
32180
32181
32182
32183
32184
32185
32186
32187
32188
32189
32190
32191
32192
32193
32194
32195
32196
32197
32198
32199
32200
32201
32202
32203
32204
32205
32206
32207
32208
32209
32210
32211
32212
32213
32214
32215
32216
32217
32218
32219
32220
32221
32222
32223
32224
32225
32226
32227
32228
32229
32230
32231
32232
32233
32234
32235
32236
32237
32238
32239
32240
32241
32242
32243
32244
32245
32246
32247
32248
32249
32250
32251
32252
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
32268
32269
32270
32271
32272
32273
32274
32275
32276
32277
32278
32279
32280
32281
32282
32283
32284
32285
32286
32287
32288
32289
32290
32291
32292
32293
32294
32295
32296
32297
32298
32299
32300
32301
32302
32303
32304
32305
32306
32307
32308
32309
32310
32311
32312
32313
32314
32315
32316
32317
32318
32319
32320
32321
32322
32323
32324
32325
32326
32327
32328
32329
32330
32331
32332
32333
32334
32335
32336
32337
32338
32339
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355
32356
32357
32358
32359
32360
32361
32362
32363
32364
32365
32366
32367
32368
32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
32391
32392
32393
32394
32395
32396
32397
32398
32399
32400
32401
32402
32403
32404
32405
32406
32407
32408
32409
32410
32411
32412
32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
32424
32425
32426
32427
32428
32429
32430
32431
32432
32433
32434
32435
32436
32437
32438
32439
32440
32441
32442
32443
32444
32445
32446
32447
32448
32449
32450
32451
32452
32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
32465
32466
32467
32468
32469
32470
32471
32472
32473
32474
32475
32476
32477
32478
32479
32480
32481
32482
32483
32484
32485
32486
32487
32488
32489
32490
32491
32492
32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
32523
32524
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
32544
32545
32546
32547
32548
32549
32550
32551
32552
32553
32554
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571
32572
32573
32574
32575
32576
32577
32578
32579
32580
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
32621
32622
32623
32624
32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
32637
32638
32639
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
32653
32654
32655
32656
32657
32658
32659
32660
32661
32662
32663
32664
32665
32666
32667
32668
32669
32670
32671
32672
32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
32684
32685
32686
32687
32688
32689
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
32705
32706
32707
32708
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
32730
32731
32732
32733
32734
32735
32736
32737
32738
32739
32740
32741
32742
32743
32744
32745
32746
32747
32748
32749
32750
32751
32752
32753
32754
32755
32756
32757
32758
32759
32760
32761
32762
32763
32764
32765
32766
32767
32768
32769
32770
32771
32772
32773
32774
32775
32776
32777
32778
32779
32780
32781
32782
32783
32784
32785
32786
32787
32788
32789
32790
32791
32792
32793
32794
32795
32796
32797
32798
32799
32800
32801
32802
32803
32804
32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
32815
32816
32817
32818
32819
32820
32821
32822
32823
32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
32837
32838
32839
32840
32841
32842
32843
32844
32845
32846
32847
32848
32849
32850
32851
32852
32853
32854
32855
32856
32857
32858
32859
32860
32861
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881
32882
32883
32884
32885
32886
32887
32888
32889
32890
32891
32892
32893
32894
32895
32896
32897
32898
32899
32900
32901
32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
32917
32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
32930
32931
32932
32933
32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
32946
32947
32948
32949
32950
32951
32952
32953
32954
32955
32956
32957
32958
32959
32960
32961
32962
32963
32964
32965
32966
32967
32968
32969
32970
32971
32972
32973
32974
32975
32976
32977
32978
32979
32980
32981
32982
32983
32984
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
33011
33012
33013
33014
33015
33016
33017
33018
33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
33030
33031
33032
33033
33034
33035
33036
33037
33038
33039
33040
33041
33042
33043
33044
33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
33056
33057
33058
33059
33060
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
33076
33077
33078
33079
33080
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
33100
33101
33102
33103
33104
33105
33106
33107
33108
33109
33110
33111
33112
33113
33114
33115
33116
33117
33118
33119
33120
33121
33122
33123
33124
33125
33126
33127
33128
33129
33130
33131
33132
33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
33144
33145
33146
33147
33148
33149
33150
33151
33152
33153
33154
33155
33156
33157
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
33173
33174
33175
33176
33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
33188
33189
33190
33191
33192
33193
33194
33195
33196
33197
33198
33199
33200
33201
33202
33203
33204
33205
33206
33207
33208
33209
33210
33211
33212
33213
33214
33215
33216
33217
33218
33219
33220
33221
33222
33223
33224
33225
33226
33227
33228
33229
33230
33231
33232
33233
33234
33235
33236
33237
33238
33239
33240
33241
33242
33243
33244
33245
33246
33247
33248
33249
33250
33251
33252
33253
33254
33255
33256
33257
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
33275
33276
33277
33278
33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321
33322
33323
33324
33325
33326
33327
33328
33329
33330
33331
33332
33333
33334
33335
33336
33337
33338
33339
33340
33341
33342
33343
33344
33345
33346
33347
33348
33349
33350
33351
33352
33353
33354
33355
33356
33357
33358
33359
33360
33361
33362
33363
33364
33365
33366
33367
33368
33369
33370
33371
33372
33373
33374
33375
33376
33377
33378
33379
33380
33381
33382
33383
33384
33385
33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
33412
33413
33414
33415
33416
33417
33418
33419
33420
33421
33422
33423
33424
33425
33426
33427
33428
33429
33430
33431
33432
33433
33434
33435
33436
33437
33438
33439
33440
33441
33442
33443
33444
33445
33446
33447
33448
33449
33450
33451
33452
33453
33454
33455
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
33471
33472
33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
33484
33485
33486
33487
33488
33489
33490
33491
33492
33493
33494
33495
33496
33497
33498
33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
33510
33511
33512
33513
33514
33515
33516
33517
33518
33519
33520
33521
33522
33523
33524
33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
33536
33537
33538
33539
33540
33541
33542
33543
33544
33545
33546
33547
33548
33549
33550
33551
33552
33553
33554
33555
33556
33557
33558
33559
33560
33561
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
33580
33581
33582
33583
33584
33585
33586
33587
33588
33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629
33630
33631
33632
33633
33634
33635
33636
33637
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
33694
33695
33696
33697
33698
33699
33700
33701
33702
33703
33704
33705
33706
33707
33708
33709
33710
33711
33712
33713
33714
33715
33716
33717
33718
33719
33720
33721
33722
33723
33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
33736
33737
33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
33755
33756
33757
33758
33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
33776
33777
33778
33779
33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
33797
33798
33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
33826
33827
33828
33829
33830
33831
33832
33833
33834
33835
33836
33837
33838
33839
33840
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
33859
33860
33861
33862
33863
33864
33865
33866
33867
33868
33869
33870
33871
33872
33873
33874
33875
33876
33877
33878
33879
33880
33881
33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
33897
33898
33899
33900
33901
33902
33903
33904
33905
33906
33907
33908
33909
33910
33911
33912
33913
33914
33915
33916
33917
33918
33919
33920
33921
33922
33923
33924
33925
33926
33927
33928
33929
33930
33931
33932
33933
33934
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986
33987
33988
33989
33990
33991
33992
33993
33994
33995
33996
33997
33998
33999
34000
34001
34002
34003
34004
34005
34006
34007
34008
34009
34010
34011
34012
34013
34014
34015
34016
34017
34018
34019
34020
34021
34022
34023
34024
34025
34026
34027
34028
34029
34030
34031
34032
34033
34034
34035
34036
34037
34038
34039
34040
34041
34042
34043
34044
34045
34046
34047
34048
34049
34050
34051
34052
34053
34054
34055
34056
34057
34058
34059
34060
34061
34062
34063
34064
34065
34066
34067
34068
34069
34070
34071
34072
34073
34074
34075
34076
34077
34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
34098
34099
34100
34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
34120
34121
34122
34123
34124
34125
34126
34127
34128
34129
34130
34131
34132
34133
34134
34135
34136
34137
34138
34139
34140
34141
34142
34143
34144
34145
34146
34147
34148
34149
34150
34151
34152
34153
34154
34155
34156
34157
34158
34159
34160
34161
34162
34163
34164
34165
34166
34167
34168
34169
34170
34171
34172
34173
34174
34175
34176
34177
34178
34179
34180
34181
34182
34183
34184
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
34200
34201
34202
34203
34204
34205
34206
34207
34208
34209
34210
34211
34212
34213
34214
34215
34216
34217
34218
34219
34220
34221
34222
34223
34224
34225
34226
34227
34228
34229
34230
34231
34232
34233
34234
34235
34236
34237
34238
34239
34240
34241
34242
34243
34244
34245
34246
34247
34248
34249
34250
34251
34252
34253
34254
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
34270
34271
34272
34273
34274
34275
34276
34277
34278
34279
34280
34281
34282
34283
34284
34285
34286
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
34313
34314
34315
34316
34317
34318
34319
34320
34321
34322
34323
34324
34325
34326
34327
34328
34329
34330
34331
34332
34333
34334
34335
34336
34337
34338
34339
34340
34341
34342
34343
34344
34345
34346
34347
34348
34349
34350
34351
34352
34353
34354
34355
34356
34357
34358
34359
34360
34361
34362
34363
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
34379
34380
34381
34382
34383
34384
34385
34386
34387
34388
34389
34390
34391
34392
34393
34394
34395
34396
34397
34398
34399
34400
34401
34402
34403
34404
34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
34420
34421
34422
34423
34424
34425
34426
34427
34428
34429
34430
34431
34432
34433
34434
34435
34436
34437
34438
34439
34440
34441
34442
34443
34444
34445
34446
34447
34448
34449
34450
34451
34452
34453
34454
34455
34456
34457
34458
34459
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471
34472
34473
34474
34475
34476
34477
34478
34479
34480
34481
34482
34483
34484
34485
34486
34487
34488
34489
34490
34491
34492
34493
34494
34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
34506
34507
34508
% This document takes a while to compile from scratch. See
% notes below.
%
% arara: lualatex if missing("glstex")
% arara: bib2gls: { group: on, packages: [ mfirstuc-english ] } if missing("glstex")
% arara: lualatex: { shell: yes }
% arara: bib2gls: { group: on, packages: [ mfirstuc-english ] }
% arara: lualatex
% arara: lualatex if found("log", "Rerun to get")
%
% This manual creates example documents on the fly in the 
% directory created by the following line:
\directlua{os.execute("mkdir -p glossaries-user-examples")}
% If the above doesn't work, you'll have to create the directory
% manually.

% If the shell escape is enabled the example documents will be
% automatically built with arara. If you already have the example .tex and
% .pdf files in the above directory, the shell escape isn't
% required. You'll need to run pdfcrop on the example pdf files if
% you don't have the *-crop.pdf files. If you only have the .tex
% files in the examples directory, then you need to run arara on
% each .tex file (which will call pdfcrop where applicable).
%
% This document requires glossaries-extra v1.49+, bib2gls v3.0+
% and nlctuserguide.sty. Some of the example documents require
% glossaries v4.50+ and mfirstuc v2.08+.

\documentclass[titlepage=false,oneside,toc=listof,
 fontsize=12pt,captions=tableheading]{scrbook}

\usepackage{relsize}
\usepackage{mfirstuc-english}
\usepackage[
   deephierarchy,
   numberedsection,
   abbreviations,
   tikzsymbols,
   indexmarks,
   %debug=showwrgloss,
   %showtargets=annoteleft
 ]{nlctuserguide}

\hypersetup{pdfauthor={Nicola Talbot},
 pdftitle={glossaries manual},
 bookmarksdepth=5}

\GetTitleStringSetup{expand}

\RedeclareSectionCommand[tocnumwidth=35pt]{section}

\renewcommand*{\thispackagename}{glossaries}
\renewcommand{\cmdnotefmt}[1]{}

\appto\terminaldesc{. See also
\qt{\dickimawhref{latex/buildglossaries}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}}}

\renewcommand{\optionlistprefix}{idx.opt.}
\renewcommand{\glsxtrtaggedlistsep}{~}
\newcommand{\idxoptiondef}[1]{%
  \protect\glsxtrtitleorpdforheading
   {\texidxoptiondef{#1}}% document text
   {\glsentryname{idx.opt.#1}}% PDF bookmark
   {\glsentryname{idx.opt.#1}}% page header
} 
\newrobustcmd{\texidxoptiondef}[1]{%
  \glsentryname{idx.opt.#1}%
} 
\newcommand{\maintexidxoptiondef}[1]{%
 \inlineidxdef{opt.#1}%
} 
\newcommand{\toctexidxoptiondef}[1]{%
 \inlineidxdef{opt.#1}%
} 
\glsxtrnewgls{idx.opt.}{\optionnum}

\MFUblocker{\csfmt}

\newcommand{\combase}{\commentnl{\glslink{pkg.glossaries-extra}{glossaries.sty}}}
\newcommand{\comxr}{\commentnl{\glslink{pkg.glossaries-extra}{glossaries-extra.sty}}}
\newcommand{\comxronly}{\commentnl{\glslink{pkg.glossaries-extra}{glossaries-extra.sty} only}}
\newcommand{\comxrkey}{\commentnl{\glslink{pkg.glossaries-extra}{glossaries-extra.sty} key}}
\newcommand{\comxropt}[1]{\commentnl{requires \glslink{pkg.glossaries-extra}{glossaries-extra.sty} '\opt{#1}' option}}

\newcommand{\location}{\idxc{entrylocation}{location}}
\newcommand{\locations}{\idxc{entrylocation}{locations}}

\newcommand{\encap}[2][]{{\let\csfmt\csfmtcolourfont\gls[#1]{#2}}}
\newcommand{\inlineencapdef}[1]{{\let\csfmt\csfmtcolourfont\inlineglsdef[]{#1}}}

\newcommand{\indexed}{\idxc{indexing}{indexed}}
\newcommand{\recorded}{\idxc{indexing}{recorded}}
\newcommand{\record}{\idxc{indexing}{record}}
\newcommand{\records}{\idxc{indexing}{records}}
\newcommand{\sanitized}{\idxc{sanitize}{sanitized}}
\newcommand{\sanitization}{\idxc{sanitize}{sanitization}}
\newcommand{\casechanging}{\idxc{casechange}{case-changing}}
\newcommand{\atentry}[1]{\texorpdfstring{\code{@#1}}{@#1}}
\newcommand{\thecounter}[1]{\glslink{thecounter}{\csfmt{the\-#1}}}
\newcommand{\theHcounter}[1]{\glslink{theHcounter}{\csfmt{the\-H\-#1}}}
\newcommand{\thecountername}{\glslink{thecounter}{\csfmt{the\-\meta{counter-name}}}}
\newcommand{\theHcountername}{\glslink{theHcounter}{\csfmt{the\-\meta{counter-name}}}}
\newcommand{\recordcounterfield}[1]{%
 \glslink{opt.glosfield.recordcount.counter}{\csoptfmt{record\-count\dfullstop#1}}}
\newcommand{\recordcounterlocationfield}[2]{%
 \glslink{opt.glosfield.recordcount.counter.location}{\csoptfmt{record\-count\dfullstop#1\dfullstop#2}}}
\newcommand{\captionslanguage}[1]{\glslink{captionslanguage}{\csfmt{captions\-#1}}}
\newcommand{\glsxtrcounterlocfmt}[1]{\glslink{glsxtrcounterlocfmt}{\xtrcsfmt{gls\-xtr\-#1\-loc\-fmt}}}
\newcommand{\glsXcounterXformat}[2]{\glslink{glsXcounterXformat}{\csfmt{gls\-X\-#1\-X\-#2}}}
\newcommand{\glsfieldlabelaccsupp}[1]{\glslink{glsfield-labelaccsupp}{\csfmt{gls\-#1\-acc\-supp}}}
\newcommand{\glsxtrcategoryfieldaccsupp}[1]{\glslink{glsxtrcategoryfieldaccsupp}{\csfmt{glsxtr\-#1\-acc\-supp}}}
\newcommand{\glsxtrcategoryaccsupp}[1]{\glslink{glsxtrcategoryaccsupp}{\csfmt{glsxtr\-#1\-acc\-supp}}}

\MFUhyphentrue
\setabbreviationstyle[termacronym]{short-sm-desc}
\setabbreviationstyle[acronym]{short-sm-nolong}

\glsxtrnewgls{opt.printgloss.}{\printglossopt}
\newcommand{\printglossoptval}[2]{\optval{printgloss.#1}{#2}}
\newcommand{\printglossoptvalm}[2]{\optval{printgloss.#1}{\marg{#2}}}
\newcommand{\printglossopteqvalref}[2]{\opteqvalref{printgloss.#1}{#2}}

\newcommand{\styoptxdyval}[2]{\optval{xindy.#1}{#2}}
\newcommand{\styoptxdyvalm}[2]{\styoptxdyval{#1}{\marg{#2}}}

\glsxtrnewgls{opt.glsopt.}{\glsopt}
\newcommand{\glsoptval}[2]{\optval{glsopt.#1}{#2}}
\newcommand{\glsoptvalm}[2]{\optvalm{glsopt.#1}{#2}}

\glsxtrnewgls{opt.gloskey.}{\gloskey}
\newcommand{\gloskeyval}[2]{\optval{gloskey.#1}{\marg{#2}}}
\newcommand{\gloskeyfmttext}[1]{\glsfmttext{opt.gloskey.#1}}

\glsxtrnewgls{opt.glosfield.}{\glosfield}
\newcommand{\glosfielddisp}[3][]{\glsdisp[#1]{opt.glosfield.#2}{\csoptfmt{#3}}}

\newcommand{\glosfielddef}[1]{\inlineglsdef[optdef]{opt.glosfield.#1}}
\newcommand{\glostypedef}[1]{\inlineglsdef[optdef]{opt.glostype.#1}}
\newcommand{\glsoptdef}[1]{\inlineglsdef[optdef]{opt.glsopt.#1}}

\newcommand{\inlineglostyledef}[1]{\inlineglsdef[optdef]{opt.glostyle.#1}}
\newcommand{\glostyledef}[1]{\optiondef{glostyle.#1}}

\newcommand{\printglossoptdef}[1]{\optiondef{printgloss.#1}}

\defsemanticcmd[style2]{\glostypefmt}{\texttt}{}
\glsxtrnewgls{opt.glostype.}{\glostype}

\glsxtrnewgls{opt.cat.}{\cat}
\glsxtrnewgls{opt.catattr.}{\catattr}
\glsxtrnewgls{opt.resource.}{\resourceopt}
\newcommand{\resourceoptval}[2]{\optval{resource.#1}{#2}}
\newcommand{\resourceoptvalm}[2]{\optval{resource.#1}{\marg{#2}}}

\glsxtrnewgls{switch.mkidx.}{\mkidxopt}
\glsxtrnewgls{switch.xdy.}{\xdyopt}
\glsxtrnewgls{switch.mkgls.}{\mkglsopt}
\glsxtrnewgls{switch.mkglslite.}{\mkglsliteopt}
\glsxtrnewgls{switch.b2g.}{\bibglsopt}

\glsxtrnewgls{opt.glostyle.}{\glostyle}
\glsxtrnewgls{opt.abbrstyle.}{\abbrstyle}
\glsxtrnewgls{opt.acrstyle.}{\acrstyle}

\defsemanticcmd[style1]{\fieldfmt}{\texttt}{}
\defsemanticcmd[style6]{\entryfmt}{\texttt}{}
\newcommand*{\atentryfmt}[1]{\entryfmt{@#1}}

\newcommand*{\acrstyledef}[1]{\optiondef{acrstyle.#1}}
\defsemanticcmd[style3]{\acrstylefmt}{\textsf}{}
\defsemanticcmd{\glostylefmt}{\textsf}{}

\defsemanticcmd[style6]{\catfmt}{\textsf}{}
\defsemanticcmd[style6]{\catattrfmt}{\textsf}{}
\defsemanticcmd[style6]{\xtrfmt}{}{}
\defsemanticcmd[style6]{\xtrcsfmt}{\texttt}{\codebackslash}
\defsemanticcmd[style6]{\xtrcsoptfmt}{\optfmt}{}
\defsemanticcmd[style6]{\xtrstyoptfmt}{\optfmt}{}
\defsemanticcmd[style6]{\xtroptfmt}{\optfmt}{}
\defsemanticcmd[style6]{\xtrctrfmt}{\ctrfmt}{}
\defsemanticcmd[style6]{\abbrstylefmt}{\textsf}{}
\defsemanticcmd[style6]{\xtrglostylefmt}{\textsf}{}

\newcommand{\xtrcmd}[1]{\xtrfmt{\cmd{#1}}}

\newcommand{\hierarchical}{\glslink{hierarchicallevel}{hierarchical}}
\newcommand{\toplevel}{\glslink{hierarchicallevel}{top level (level~0)}}
\newcommand{\hierlevel}[1]{\glslink{hierarchicallevel}{level~#1}}

\newcommand{\samplefile}[1]{\file{sample#1.tex}}

\renewcommand{\nlctuserguidecustomentryaliases}{%
   glossarystyle=index,
   abbreviationstyle=index,
   acronymstyle=index,
}

\appto{\nlctexampledisablecmds}{%
 \letcs{\opt}{@firstofone}%
 \letcs{\glostype}{@firstofone}%
 \letcs{\cat}{@firstofone}%
 \letcs{\catattr}{@firstofone}%
 \letcs{\resourceopt}{@firstofone}%
 \letcs{\acrstyle}{@firstofone}%
 \letcs{\abbrstyle}{@firstofone}%
 \letcs{\glostyle}{@firstofone}%
 \letcs{\glsopt}{@firstofone}%
 \letcs{\mglsopt}{@firstofone}%
 \letcs{\gloskey}{@firstofone}%
 \letcs{\glosfield}{@firstofone}%
 \letcs{\printglossopt}{@firstofone}%
 \let\resourceoptval\keyeqvalue
 \let\resourceoptvalm\keyeqvaluem
 \let\optval\keyeqvalue
 \let\opteqvalref\keyeqvalue
 \let\gloskeyval\keyeqvaluem
 \let\glsoptval\keyeqvaluem
 \let\mglsoptval\keyeqvaluem
 \let\printglossoptval\keyeqvalue
 \let\printglossoptvalm\keyeqvaluem
}

\newcommand{\summaryentryglossarystyle}[1]{%
 {%
   \renewcommand*{\glostylefmt}[1]{\texttt{##1}}%
   \genericsummaryentryoption{#1}%
 }%
}

\newcommand{\summaryentryacronymstyle}[1]{%
 {%
   \renewcommand*{\acrstylefmt}[1]{\texttt{##1}}%
   \genericsummaryentryoption{#1}%
 }%
}

\renewcommand{\nlctuserguideletterrules}{%
 \glsxtrGeneralLatinAtoGrules
 \string<glo,Glo,GLO\string<gls,Gls,GLS\string<glsxtr,Glsxtr,GlsXtr,GLSxtr,GLSXTR
 \glsxtrGeneralLatinHtoMrules
 \glsxtrGeneralLatinNtoZrules
}

\nlctuserguidegls[selection=all,max-loc-diff=3]
{
  \def\gxtrcmd#1#2{\glsbibwriteentry{command}{#1}{\field{name}{\xtrcsfmt{#1}}#2}}%
  \def\gxtrcmds#1#2{\glsbibwriteentry{command}{#1}{\field{name}{\xtrcsfmt{#1}}\field{modifiers}{*}#2}}%
  \def\gxtrcmdsp#1#2{\glsbibwriteentry{command}{#1}{\field{name}{\xtrcsfmt{#1}}\field{modifiers}{*,+}#2}}%
  \def\gxtrcmdmeta#1#2#3#4{\glsbibwriteentry{command}{#1#2#3}{\field{name}{\xtrcsfmt{#1\meta{#2}#3}}#4}}%
  \def\gxtrcmdmetameta#1#2#3#4#5#6{\glsbibwriteentry{command}{#1#2#3#4#5}{\field{name}{\xtrcsfmt{#1\meta{#2}#3\meta{#4}#5}}#6}}%
  \def\gxtrstyopt#1#2{\glsbibwriteentry{packageoption}{opt.#1}{\field{name}{\xtrstyoptfmt{#1}}#2}}%
  \def\gxtroptval#1#2#3{\glsbibwriteentry{optionvalue}{optval.#1.#2}{\field{name}{\xtroptfmt{#2}}\field{parent}{opt.#1}#3}}%
  \def\gxtrctr#1#2{\glsbibwriteentry{counter}{ctr.#1}{\field{name}{\xtrctrfmt{#1}}#2}}%
  \def\gprintglossopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.printgloss.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.printglossopt}#2}}%
  \def\gxtrprintglossopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.printgloss.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.printglossopt}#2}}%
  \def\gglsopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.glsopt.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.glsopt}#2}}%
  \def\gxtrglsopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.glsopt.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.glsopt}#2}}%
  \def\ggloskey#1#2{%
   \glsbibwriteentry{commandoption}{opt.gloskey.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.gloskey}#2}}%
  \def\gxtrgloskey#1#2{%
   \glsbibwriteentry{commandoption}{opt.gloskey.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.gloskey}#2}}%
  \def\gglosfield#1#2{%
   \glsbibwriteentry{commandoption}{opt.glosfield.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.glosfield}#2}}%
  \def\gxtrglosfield#1#2{%
   \glsbibwriteentry{commandoption}{opt.glosfield.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.glosfield}#2}}%
  \def\gglostype#1#2{%
   \glsbibwriteentry{optionvalue}{opt.glostype.#1}{%
    \field{name}{\glostypefmt{#1}}\parent{glossary}#2}}%
  \def\gcat#1#2{%
   \glsbibwriteentry{optionvalue}{opt.cat.#1}{%
    \field{name}{\catfmt{#1}}\parent{idx.category}#2}}%
  \def\gcatattr#1#2{%
   \glsbibwriteentry{optionvalue}{opt.catattr.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.categoryattribute}#2}}%
  \def\gglosty#1#2{\glsbibwriteentry{glossarystyle}{opt.glostyle.#1}%
    {\field{name}{\glostylefmt{#1}}\parent{idx.glossarystyle}#2}}%
  \def\gxtrglosty#1#2{\glsbibwriteentry{glossarystyle}{opt.glostyle.#1}%
    {\field{name}{\xtrglostylefmt{#1}}\parent{idx.glossarystyle}#2}}%
  \def\gabbrsty#1#2{\glsbibwriteentry{abbreviationstyle}{opt.abbrstyle.#1}%
    {\field{name}{\abbrstylefmt{#1}}\parent{idx.abbrvstyle}#2}}%
  \def\gabbrstyalias#1#2{\gabbrsty{#1}{\field{alias}{opt.abbrstyle.#2}}}%
  \def\gdepabbrsty#1#2{\gabbrsty{#1}{\deprecated\field{alias}{opt.abbrstyle.#2}}}%
  \def\gacrsty#1#2{\glsbibwriteentry{acronymstyle}{opt.acrstyle.#1}%
    {\field{name}{\acrstylefmt{#1}}\parent{idx.acronymstyle}#2}}%
  \def\gresourceopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.resource.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.resourceopt}#2}}%
  \def\gbibglsswitch#1#2{\glsbibwriteentry{switch}{switch.b2g.#1}{\field{name}{\shortargfmt{#1}}\inapp{bib2gls}#2}}%
  \def\gmkidxswitch#1#2{\glsbibwriteentry{switch}{switch.mkidx.#1}{\field{name}{\shortargfmt{#1}}\inapp{makeindex}#2}}%
  \def\gxdyswitch#1#2{\glsbibwriteentry{switch}{switch.xdy.#1}{\field{name}{\shortargfmt{#1}}\inapp{xindy}#2}}%
  \def\gmkglsswitch#1#2{\glsbibwriteentry{switch}{switch.mkgls.#1}{\field{name}{\shortargfmt{#1}}\inapp{makeglossaries}#2}}%
  \def\gmkglsliteswitch#1#2{\glsbibwriteentry{switch}{switch.mkglslite.#1}{\field{name}{\shortargfmt{#1}}\inapp{makeglossaries-lite}#2}}%
  \gidxpl{glossarystyle}%
  {%
    \common
    \field{text}{glossary style}%
    \desc{the default style may be set with \gls{setglossarystyle}
or with the \opt{style} package option.
The default style can be overridden for individual \idxpl{glossary}
with the \printglossopt{style} option. For a summary of all
available styles, see \gallerypage{glossaries-styles}{Gallery:
Predefined Styles}}
  }
  \gidx{glossaryformat}%
  {%
    \name{glossary}
    \field{parent}{idx.format}
    \field{text}{glossary format}
    \field{alias}{idx.glossarystyle}
  }
  \gidx{acronymstyle}{\name{acronym style}
   \desc{the style should be set with \gls{setacronymstyle} before
    the first instance of \gls{newacronym}}}
  \gidx{format}{}
  \gidx{abbrvstyle}{\name{\xtrfmt{abbreviation} style (\styfmt{glossaries-extra})}
    \field{text}{\xtrfmt{abbreviation} style}
  }
  \gidx{abbrvformat}%
  {%
    \name{\xtrfmt{abbreviation}}
    \field{parent}{idx.format}
    \field{text}{\xtrfmt{abbreviation} format}
    \field{alias}{idx.abbrvstyle}
  }
  \gidxpl{category}{\field{text}{category}\field{plural}{categories}}
  \gidx{categoryattribute}{\name{category attributes}\field{text}{category attribute}}
  % FILES
  % sample files:
  \gidx{samplefile}{\name{sample files}\field{text}{sample file}}%
  \gfile{minimalgls.tex}{}% file: minimalgls.tex
  \gfile{mwe\dhyphen gls.tex}{}% file: mwe-gls.tex
  \gfile{mwe\dhyphen acr.tex}{}% file: mwe-acr.tex
  \gfile{mwe\dhyphen acr\dhyphen desc.tex}{}% file: mwe-acr-desc.tex
  \gfile{sample.tex}{}% file: sample.tex
  \gfile{sample4col.tex}{}% file: sample4col.tex
  \gfile{sampleaccsupp.tex}{}% file: sampleaccsupp.tex
  \gfile{sampleAcrDesc.tex}{}% file: sampleAcrDesc.tex
  \gfile{sampleacronyms.tex}{}% file: sampleacronyms.tex
  \gfile{sampleAcr.tex}{}% file: sampleAcr.tex
  \gfile{sample\dhyphen chap\dhyphen hyperfirst.tex}{}% file: sample-chap-hyperfirst.tex
  \gfile{sample\dhyphen crossref.tex}{}% file: sample-crossref.tex
  \gfile{sample\dhyphen custom\dhyphen acronym.tex}{}% file: sample-custom-acronym.tex
  \gfile{sampleCustomAcr.tex}{}% file: sampleCustomAcr.tex
  \gfile{sampleDB.tex}{}% file: sampleDB.tex
  \gfile{sampleDesc.tex}{}% file: sampleDesc.tex
  \gfile{sample\dhyphen dot\dhyphen abbr.tex}{}% file: sample-dot-abbr.tex
  \gfile{sample\dhyphen dual.tex}{}% file: sample-dual.tex
  \gfile{sample\dhyphen entrycount.tex}{}% file: sample-entrycount.tex
  \gfile{sample\dhyphen entryfmt.tex}{}% file: sample-entryfmt.tex
  \gfile{sampleEq.tex}{}% file: sampleEq.tex
  \gfile{sampleEqPg.tex}{}% file: sampleEqPg.tex
  \gfile{sampleFnAcrDesc.tex}{}% file: sampleFnAcrDesc.tex
  \gfile{sample\dhyphen FnDesc.tex}{}% file: sample-FnDesc.tex
  \gfile{sample\dhyphen font\dhyphen abbr.tex}{}% file: sample-font-abbr.tex
  \gfile{sample\dhyphen ignored.tex}{}% file: sample-ignored.tex
  \gfile{sample\dhyphen index.tex}{}% file: sample-index.tex
  \gfile{sample\dhyphen inline.tex}{}% file: sample-inline.tex
  \gfile{sample\dhyphen langdict.tex}{}% file: sample-langdict.tex
  \gfile{sample\dhyphen newkeys.tex}{}% file: sample-newkeys.tex
  \gfile{sample\dhyphen noidxapp.tex}{}% file: sample-noidxapp.tex
  \gfile{sample\dhyphen noidxapp\dhyphen utf8.tex}{}% file: sample-noidxapp-utf8.tex
  \gfile{sample\dhyphen nomathhyper.tex}{}% file: sample-nomathhyper.tex
  \gfile{sampleNtn.tex}{}% file: sampleNtn.tex
  \gfile{sample\dhyphen numberlist.tex}{}% file: sample-numberlist.tex
  \gfile{samplePeople.tex}{}% file: samplePeople.tex
  \gfile{sample\dhyphen prefix.tex}{}% file: sample-prefix.tex
  \gfile{sampleSec.tex}{}% file: sampleSec.tex
  \gfile{sample\dhyphen si.tex}{}% file: sample-si.tex
  \gfile{sampleSort.tex}{}% file: sampleSort.tex
  \gfile{sample\dhyphen storage\dhyphen abbr\dhyphen desc.tex}{}% file: sample-storage-abbr-desc.tex
  \gfile{sample\dhyphen storage\dhyphen abbr.tex}{}% file: sample-storage-abbr.tex
  \gfile{sampletree.tex}{}% file: sampletree.tex
  \gfile{sampleutf8.tex}{}% file: sampleutf8.tex
  \gfile{samplexdy2.tex}{}% file: samplexdy2.tex
  \gfile{samplexdy3.tex}{}% file: samplexdy3.tex
  \gfile{samplexdy.tex}{}% file: samplexdy.tex
  % test files:
  \gidx{testfile}{\name{test files}\field{text}{test file}}%
   % example-glossaries-acronym-desc.tex
  \gfile{example\dhyphen glossaries\dhyphen acronym\dhyphen desc.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
   % example-glossaries-longchild.tex
  \gfile{example\dhyphen glossaries\dhyphen longchild.tex}%
  {\providedby{\sty{glossaries} v4.47+}}%
   % example-glossaries-acronyms-lang.tex
  \gfile{example\dhyphen glossaries\dhyphen acronyms\dhyphen lang.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-long.tex
  \gfile{example\dhyphen glossaries\dhyphen long.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-acronym.tex
  \gfile{example\dhyphen glossaries\dhyphen acronym.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-multipar.tex
  \gfile{example\dhyphen glossaries\dhyphen multipar.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-brief.tex
  \gfile{example\dhyphen glossaries\dhyphen brief.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-utf8.tex
  \gfile{example\dhyphen glossaries\dhyphen utf8.tex}%
   {\providedby{\sty{glossaries} v4.53+}}%
  % example-glossaries-parent.tex
  \gfile{example\dhyphen glossaries\dhyphen parent.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-childmultipar.tex
  \gfile{example\dhyphen glossaries\dhyphen childmultipar.tex}%
   {\providedby{\sty{glossaries} v4.47+}}%
  % example-glossaries-symbolnames.tex
  \gfile{example\dhyphen glossaries\dhyphen symbolnames.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-childnoname.tex
  \gfile{example\dhyphen glossaries\dhyphen childnoname.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-symbols.tex
  \gfile{example\dhyphen glossaries\dhyphen symbols.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-cite.tex
  \gfile{example\dhyphen glossaries\dhyphen cite.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-url.tex
  \gfile{example\dhyphen glossaries\dhyphen url.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-images.tex
  \gfile{example\dhyphen glossaries\dhyphen images.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-user.tex
  \gfile{example\dhyphen glossaries\dhyphen user.tex}%
   {\providedby{\sty{glossaries} v4.51+}}%
  % example-glossaries-xr.tex
  \gfile{example\dhyphen glossaries\dhyphen xr.tex}%
   {\providedby{\sty{glossaries-extra} v1.16+}}%
  % glossaries-english.ldf
  \gfile{glossaries\dhyphen english.ldf}{}
  % glossaries-irish.ldf
  \gfile{glossaries\dhyphen irish.ldf}{}
  % glossaries-dictionary-English.dict
  \gfile{glossaries\dhyphen dictionary\dhyphen English.dict}{}
  % glossaries-<lang>.ldf
  \gfilemeta{glossaries\dhyphen}{lang}{.ldf}{}
  % glossaries-dictionary-<Lang>.dict
  \gfilemeta{glossaries\dhyphen dictionary\dhyphen }{Lang}{.dict}{}
  % glossaries-<iso-lang>-<iso-region>.ldf
  \gfilemetameta{glossaries\dhyphen}{iso-lang}{\dhyphen}{iso-region}{.ldf}{}
  % packages:
  \gpkg{glossaries}% glossaries.sty
  {%
    \common
    \syntax{\meta{options}}%
    \desc{base package. This package will be implicitly loaded by
      \sty{glossaries-prefix}, \sty{glossaries-accsupp} and
     \sty{glossaries-extra}}
  }
  \gpkg{glossaries\dhyphen extra}% glossaries-extra.sty
  {%
    \common
    \syntax{\meta{options}}%
    \desc{extension package that loads \sty{glossaries}, provides
      additional commands, and modifies some of the base
      \sty{glossaries} commands to integrate them with the new
      commands or to make them more flexible}
  }
  \gpkg{glossaries\dhyphen extra\dhyphen stylemods}% glossaries-extra-stylemods.sty
  {%
    \syntax{\meta{options}}%
    \note{or \code{\csfmt{usepackage}[\optval{stylemods}{\meta{options}}]\marg{glossaries-extra}}}
    \desc{modifies the \idxpl{glossarystyle} supplied with the base \sty{glossaries}
      package to make them more flexible and to integrate support
     for features provided by \sty{glossaries-extra} or \app{bib2gls}}
  }
  \gpkg{glossaries\dhyphen extra\dhyphen bib2gls}% glossaries-extra-bib2gls.sty
  {%
    \desc{automatically loaded with \optval{record}{only} and
     \optval{record}{nameref}}
  }
  % glossaries-babel.sty
  \gpkg{glossaries\dhyphen babel}
  {
    \syntax{\meta{options}}%
    \desc{interface package that provides \sty{babel} support for
    \sty{glossaries}. The actual language settings are in independently
    distributed packages}
  }
  % glossaries-polyglossia.sty
  \gpkg{glossaries\dhyphen polyglossia}
  {
    \syntax{\meta{options}}%
    \desc{interface package that provides \sty{polyglossia} support for
    \sty{glossaries}. The actual language settings are in independently
    distributed packages}
  }
  % glossaries-prefix.sty
  \gpkg{glossaries\dhyphen prefix}%
  {%
    \syntax{\meta{options}}%
    \note{automatically loaded with
    \code{\csfmt{usepackage}[\opt{prefix}]\marg{glossaries-extra}}}
    \desc{provides additional keys and commands to associated
    prefixes with \idx{glossary} entries. If loaded on its own, it will
    automatically load \sty{glossaries} with the given options}
  }
  % glossaries-accsupp.sty
  \gpkg{glossaries\dhyphen accsupp}%
  {%
    \syntax{\meta{options}}%
    \note{automatically loaded with
    \code{\csfmt{usepackage}[\opt{accsupp}]\marg{glossaries-extra}}}
    \desc{provides additional keys and commands to make it easier to
    integrate accessibility support into \idx{glossary} entry definitions.
    If loaded on its own, it will automatically load \sty{glossaries}
    with the given options}
  }
  % glossary-hypernav.sty
  \gpkg{glossary\dhyphen hypernav}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides support for \idxpl{glossarystyle}, such as \glostyle{listhypergroup}}
  }
  % glossary-list.sty
  \gpkg{glossary\dhyphen list}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides list-like \idxpl{glossarystyle}, such as
    \glostyle{list}. These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-tree.sty
  \gpkg{glossary\dhyphen tree}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides \hierarchical\ index or tree-like \idxpl{glossarystyle}, such as
    \glostyle{index} and \glostyle{tree}.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-mcols.sty
  \gpkg{glossary\dhyphen mcols}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\opt{stylemods}\dequals mcols]\marg{glossaries-extra}}}
    \desc{provides multicolumn \hierarchical\ index and tree-like
    \idxpl{glossarystyle},
    such as \glostyle{mcolindex} and \glostyle{mcoltree}. This package
    automatically loads \sty{glossary-tree} and \sty{multicol}.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-inline.sty
  \gpkg{glossary\dhyphen inline}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{inline}]\marg{glossaries-extra}}}
    \desc{provides the \glostyle{inline} \idx{glossarystyle}.
    This style is patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-long.sty
  \gpkg{glossary\dhyphen long}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{long} that use the \sty{longtable} package.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-longbooktabs.sty
  \gpkg{glossary\dhyphen long\-book\-tabs}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{longbooktabs}]\marg{glossaries-extra}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{long-booktabs} that use the \sty{longtable} package with
    the \sty{booktabs} package to provide horizontal rules.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-longragged.sty
  \gpkg{glossary\dhyphen long\-ragged}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{longragged}]\marg{glossaries-extra}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{longragged} that use the \sty{longtable} package with
    the \sty{array} package to left-justify the description column.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-super.sty
  \gpkg{glossary\dhyphen super}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{super} that use the \sty{supertabular} package.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-superragged.sty
  \gpkg{glossary\dhyphen super\-ragged}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{superragged}]\marg{glossaries-extra}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{superragged} that use the \sty{supertabular} package with
    the \sty{array} package to left-justify the description column.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-bookindex.sty
  \gpkg{glossary\dhyphen book\-index}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{bookindex}]\marg{glossaries-extra}}}
    \desc{provides the \glostyle{bookindex} \idx{glossarystyle}, which
     doesn't show descriptions. This package is distributed with
     \sty{glossaries-extra}}
  }
  % glossary-longextra.sty
  \gpkg{glossary\dhyphen long\-extra}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{longextra}]\marg{glossaries-extra}}}
    \desc{provides more flexible tabular-like \idxpl{glossarystyle}, such
     as \glostyle{long-name-desc}. This package is distributed with
     \sty{glossaries-extra} and automatically loads
     \sty{glossary-longbooktabs}}
  }
  % glossary-topic.sty
  \gpkg{glossary\dhyphen topic}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{topic}]\marg{glossaries-extra}}}
    \desc{provides the \hierarchical\ \glostyle{topic} and \glostyle{topicmcols}
     \idxpl{glossarystyle}. This package is distributed with
     \sty{glossaries-extra} and automatically loads \sty{multicol}}
  }
  % Language modules
  \gfile{glossaries\dhyphen german.ldf}{}% glossaries-german.ldf
  % OTHER PACKAGES:
  \gpkg{glossary}{}% glossary.sty
  \gpkg{long\-table}{}% longtable.sty
  \gpkg{super\-tabular}{}% supertabular.sty
  \gpkg{array}{}% array.sty
  \gpkg{book\-tabs}{}% booktabs.sty
  \gpkg{multi\-col}{}% multicol.sty
  \gpkg{babel}{}% babel.sty
  \gpkg{poly\-glossia}{}% polyglossia.sty
  \gpkg{translator}{}% translator.sty
  \gcls{memoir}{}% memoir.cls
  \gcls{report}{}% report.cls
  \gcls{book}{}% book.cls
  \gcls{beamer}{}% beamer.cls
  \gpkg{hyper\-ref}{}% hyperref.sty
  \gpkg{name\-ref}{}% nameref.sty
  \gpkg{get\-title\-string}{}% gettitlestring.sty
  \gpkg{ams\-math}{}% amsmath.sty
  \gpkg{ams\-gen}{}% amsgen.sty
  \gpkg{etool\-box}{}% etoolbox.sty
  \gpkg{input\-enc}{}% inputenc.sty
  \gpkg{font\-enc}{}% fontenc.sty
  \gpkg{font\-spec}{}% fontspec.sty
  \gpkg{rel\-size}{}% relsize.sty
  \gpkg{acc\-supp}{}% accsupp.sty
  \gpkg{accessibility}{}% accessibility.sty
  \gpkg{tag\-pdf}{}% tagpdf.sty
  \gpkg{xkey\-val}{}% xkeyval.sty
  \gpkg{text\-case}{}% textcase.sty
  \gpkg{siunitx}{}% siunitx.sty
  \gpkg{latex\-release}{}% latexrelease.sty
  \gpkg{mwe}{}% mwe.sty
  \gpkg{stix}{}% stix.sty
  \gpkg{fmt\-count}{}% fmtcount.sty
  \gpkg{classic\-thesis}{}% classicthesis.sty
  \gpkg{xtab}{}% xtab.sty
  \gpkg{doc}{}% doc.sty
  \gpkg{tabularx}{}% tabularx.sty
  \gpkg{xspace}{}% xspace.sty
  \gpkg{flow\-fram}{}% flowfram.sty
  \gpkg{shell\-esc}{}% shellesc.sty
  \gpkg{make\-idx}{}% makeidx.sty
  \gpkg{imake\-idx}{}% imakeidx.sty
  \gpkg{scr\-w\-file}{}% scrwfile.sty
  % mfirstuc package
  \gpkg{mfirst\-uc}{}% mfirstuc.sty
  % \makefirstuc
  \gcmd{make\-first\-uc}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc}}
    \desc{robust command that converts the first character of \meta{text} to
    \idx{uppercase} (\idx{sentencecase}) unless \meta{text}
    starts with a command, in which case it will attempt to apply
    the \idx{casechange} to the first character of the first
    argument following the command, if the command is followed by a
    group. As from \sty{mfirstuc} v2.08, this command internally
    uses \gls{MFUsentencecase} to perform the actual \idx{casechange}.
    See the \sty{mfirstuc} documentation for further details, either:
    \texdocref{mfirstuc} or visit \ctanpkg{mfirstuc}}
  }
  % \MFUsentencecase
  \gcmd{MFU\-sentence\-case}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v2.08+}
    \desc{fully expands \meta{text} and converts the first letter to
    \idx{uppercase}\glsadd{idx.sentencecase}. Unlike
    \gls{makefirstuc}, this command is expandable, but only
    recognises commands identified as exclusions. See the
    \sty{mfirstuc} documentation for further details. This command
    is provided by \sty{glossaries-extra} v1.49+ if an old version
    of \sty{mfirstuc} is detected}
  }
  % \MFUexcl
  \gcmd{MFU\-excl}
  {
    \providedby{\sty{mfirstuc} v2.08+}
    \syntax{\margm{cs}}%
    \desc{locally identifies \meta{cs} as an exclusion command,
     which will be recognised by both \gls{makefirstuc} and
    \gls{MFUsentencecase}}
    \field{seealso}{MFUblocker,MFUaddmap}
  }
  % \MFUblocker
  \gcmd{MFU\-blocker}
  {
    \providedby{\sty{mfirstuc} v2.08+}
    \syntax{\margm{cs}}%
    \desc{locally identifies \meta{cs} as a blocker command for
     \gls{makefirstuc} and an exclusion for \gls{MFUsentencecase}
     (which doesn't support blockers)}
    \field{seealso}{MFUexcl,MFUaddmap}
  }
  % \MFUaddmap
  \gcmd{MFU\-add\-map}
  {
    \providedby{\sty{mfirstuc} v2.08+}
    \syntax{\margm{cs1}\margm{cs2}}%
    \desc{identifies a mapping from the command \meta{cs1} to
    command \meta{cs2} for \gls{makefirstuc} and also identifies
    \meta{cs2} as a blocker. Mappings and blockers aren't supported
    by \gls{MFUsentencecase}, so both \meta{cs1} and \meta{cs2} are
    identified as exclusions for \gls{MFUsentencecase}}
    \field{seealso}{MFUexcl,MFUblocker}
  }
  % \glsmfuexcl
  \gcmd{gls\-mfu\-excl}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{cs}}%
    \desc{if \sty{mfirstuc} v2.08+ is installed, this will use
    \gls+{MFUexcl}, otherwise it will implement something similar}
  }
  % \glsmfublocker
  \gcmd{gls\-mfu\-block\-er}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{cs}}%
    \desc{if \sty{mfirstuc} v2.08+ is installed, this will use
    \gls+{MFUblocker}, otherwise it will use \gls{glsmfuexcl} instead.
    See \sectionref{sec:casechanging} for further details}
  }
  % \glsmfuaddmap
  \gcmd{gls\-mfu\-add\-map}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{cs1}\margm{cs2}}%
    \desc{if \sty{mfirstuc} v2.08+ is installed, this will use
    \gls+{MFUaddmap}, otherwise it will use \gls{glsmfuexcl} instead.
    See \sectionref{sec:casechanging} for further details}
  }
  % \capitalisewords
  \gcmd{capitalise\-words}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v1.06+}
    \desc{converts \meta{text} to \idx{titlecase}. Limitations
    apply, see the \sty{mfirstuc} documentation for further details, either:
    \texdocref{mfirstuc} or visit \ctanpkg{mfirstuc}}
  }
  % \capitalisefmtwords
  \gcmd{capitalise\-fmt\-words}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v2.03+}
    \desc{converts \meta{text} to \idx{titlecase}, where \meta{text}
    may contain text-block commands. The starred form only permits a
    text-block command at the start of the argument. Limitations
    apply, see the \sty{mfirstuc} documentation for further details, either:
    \texdocref{mfirstuc} or visit \ctanpkg{mfirstuc}}
  }
  % \xcapitalisefmtwords
  \gcmd{xcapitalise\-fmt\-words}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v2.03+}
    \desc{passes the argument to \gls{capitalisefmtwords} but with the
     first token in \meta{text} expanded. The starred version uses
     the starred version of \gls{capitalisefmtwords}}
  }
  % \mfirstucMakeUppercase
  \gcmd{mfirst\-uc\-Make\-Upper\-case}
  {
    \providedby{\sty{mfirstuc}}
    \syntax{\margm{text}}
    \desc{this command was used by \gls{makefirstuc} to convert its argument to
    \idx{allcaps} and was redefined by \sty{glossaries} to use
    \gls{MakeTextUppercase}, but with \sty{mfirstuc} v2.08+ and
     \sty{glossaries} v4.50+ this command is instead defined
     to use the \LaTeX3 \idx{allcaps} command, which is expandable.
     This command is no longer used by \gls{makefirstuc} (which instead uses
    \gls{MFUsentencecase}). The \sty{glossaries} (v4.50+) and
    \sty{glossaries-extra} (v1.49+) packages now use \gls{glsuppercase}
     for the \idx{allcaps} commands, such as \gls{Gls}}
  }
  % \glsmakefirstuc
  \gcmd{gls\-make\-first\-uc}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v1.05+}
    \desc{used by \gls{makefirstuc} to perform the actual
    case-change. As from \sty{mfirstuc} v2.08+ this just uses
    \gls{MFUsentencecase}. Despite the \qt{gls} prefix in the
    command name, this command is provided by \sty{mfirstuc}, but dates
    back to when \sty{mfirstuc} was part of the \sty{glossaries}
    package}
  }
  \gpkg{datatool}{}% datatool.sty
  \gpkg{datatool\dhyphen base}{}% datatool-base.sty
  % \DTLformatlist
  \gcmd{DTL\-format\-list}
  {
    \syntax{\margm{csv-list}}
    \providedby{\sty{datatool-base} v2.28+}
    \desc{formats the comma-separated list \meta{csv-list}.
     One-level expansion is performed on \meta{csv-list}. See the
    \sty{datatool} documentation for further details, either:
    \texdocref{datatool} or visit \ctanpkg{datatool}}
  }
  % \DTLifinlist
  \gcmd{DTL\-if\-in\-list}
  {
    \syntax{\margm{element}\margm{csv-list}\margm{true}\margm{false}}
    \providedby{\sty{datatool-base}}
    \desc{does \meta{true} if \meta{element} is contained in the comma-separated
     list \meta{csv-list}, otherwise does \meta{false}.
     One-level expansion is performed on \meta{csv-list}, but not on
     \meta{element}. See the \sty{datatool} documentation for further
     details, either:
    \texdocref{datatool} or visit \ctanpkg{datatool}}
  }
  % \dtlwordindexcompare
  \gcmd{dtl\-word\-index\-compare}{}
  % \dtlletterindexcompare
  \gcmd{dtl\-letter\-index\-compare}{}
  % \dtlicompare
  \gcmd{dtl\-i\-compare}{}
  % \dtlcompare
  \gcmd{dtlcompare}{}
  \gpkg{track\-lang}{}% tracklang.sty
  % \CurrentTrackedLanguage
  \gcmd{Current\-Tracked\-Language}
  {
    \providedby{\sty{tracklang}}
    \syntax{placeholder for use in \ext{ldf} files, expands to the
    current language label}
  }
  % \CurrentTrackedDialect
  \gcmd{Current\-Tracked\-Dialect}
  {
    \providedby{\sty{tracklang}}
    \syntax{placeholder for use in \ext{ldf} files, expands to the
     current dialect label}
  }
  % applications:
  \gapp{make\-index}% makeindex
  {%
    \common
    \syntax{\meta{options} \meta{\idx{indexingfile}}}%
    \desc{a general purpose \idx{indexingapp}. See \option{mkidx}}%
  }
  \gapp{xindy}%
  {%
    \common
    \syntax{\meta{options} \meta{\idx{indexingfile}}}%
    \desc{a flexible \idx{indexingapp} with multilingual support
    written in Perl. See \option{xdy}}
  }
  \gapp{texindy}%
  {%
    \syntax{\meta{options} \meta{\idx{indexingfile}}}%
    \desc{runs \app{xindy} with modules set up for input written in
     \app{makeindex}['s] syntax}
  }
  \gapp{make\-glos\-saries}% makeglossaries
  {%
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{a custom designed Perl script interface
    to \app+{xindy} and \app+{makeindex} provided with the \sty{glossaries}
    package}
  }
  \gapp{make\-glos\-saries\dhyphen lite}% makeglossaries-lite
  {%
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{a custom designed Lua script interface
    to \app+{xindy} and \app+{makeindex} provided with the \sty{glossaries}
    package. This is a cut-down alternative to the Perl
    \app{makeglossaries} script. If you have Perl installed, use the
    Perl script instead}
  }
  \gapp{make\-glos\-saries\-gui}% makeglossariesgui
  {%
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{a Java \gls{gui} alternative to \app{makeglossaries} that
    also provides diagnostic tools. Available separately on
    \CTANpkg{makeglossariesgui}}
  }
  \gapp{bib2gls}%
  {%
    \common
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{an \idx{indexingapp} that combines two functions in
    one: (1) fetches entry definition from a \ext+{bib} file
    based on information provided in the \ext+{aux} file (similar
    to \BibTeX); (2) hierarchically sorts and collates location
    lists (similar to \app{makeindex} and \app{xindy}).
    This application is designed for use with \sty{glossaries-extra}
    and can't be used with just the base \sty{glossaries} package.
    Available separately on \CTANpkg{bib2gls}. See \option{b2g}}
  }
  \gapp{con\-vert\-gls2bib}% convertgls2bib
  {%
    \desc{An application provided with \app{bib2gls} that
    converts \ext+{tex} files containing entry definitions to
    \ext{bib} files suitable for use with \app{bib2gls}.
    This application is designed for files that just contain entry
    definitions, but it can work on a complete document file.
    However, there will be a lot of \qt{undefined command} warnings as
    \app{convertgls2bib} only has a limited set of known commands. You
    can limit it so that it only parses the \idxf{documentpreamble} with the
    \switch{preamble-only} switch (requires at least \app{bib2gls} v2.0)}
  }
  \gapp{xindex}{}
  \gapp{arara}{}
  \gapp{latexmk}{}
  \gapp{atom}{}
  \gapp{texdoc}{}
  \gapp{pdflatex}{}
  \gapp{latex}{\name{\appfmt{latex} (DVI)}\field{text}{\appfmt{latex}}}
  % switches
  % bib2gls --group
  \glongswitch{group}{\inapp{bib2gls}}
  % bib2gls -g
  \gbibglsswitch{g}{\field{alias}{switch.group}}
  % bib2gls --no-group
  \glongswitch{no\dhyphen group}{\inapp{bib2gls}}
  % bib2gls --map-format
  \glongswitch{map\dhyphen format}{\inapp{bib2gls}}
  % bib2gls -m
  \gbibglsswitch{m}{\field{alias}{switch.map-format}}
  % convertgls2bib --preamble-only
  \glongswitch{preamble\dhyphen only}{\inapp{convertgls2bib}}
  % convertgls2bib --texenc
  \glongswitch{texenc}{\inapp{convertgls2bib}}
  % convertgls2bib --bibenc
  \glongswitch{bibenc}{\inapp{convertgls2bib}}
  % convertgls2bib --split-on-type
  \glongswitch{split\dhyphen on\dhyphen type}{\inapp{convertgls2bib}}
  % convertgls2bib -t
  \gshortswitch{t}{\inapp{convertgls2bib}\field{alias}{switch.split-on-type}}
  % convertgls2bib --ignore-type
  \glongswitch{ignore\dhyphen type}{\inapp{convertgls2bib}}
  % convertgls2bib --index-conversion
  \glongswitch{index\dhyphen conversion}{\inapp{convertgls2bib}}
  % convertgls2bib -i
  \gshortswitch{i}{\inapp{convertgls2bib}\field{alias}{switch.index-conversion}}
  % makeindex -g
  \gmkidxswitch{g}{}
  % makeindex -s
  \gmkidxswitch{s}{}
  % makeindex -o
  \gmkidxswitch{o}{}
  % makeindex -l
  \gmkidxswitch{l}{}
  % makeindex -p
  \gmkidxswitch{p}{}
  % makeindex -c
  \gmkidxswitch{c}{}
  % makeindex -r
  \gmkidxswitch{r}{}
  % makeindex -t
  \gmkidxswitch{t}{}
  % xindy -M
  \gxdyswitch{M}{}
  % xindy -L
  \gxdyswitch{L}{}
  % xindy -C
  \gxdyswitch{C}{}
  % xindy -I
  \gxdyswitch{I}{}
  % xindy -t
  \gxdyswitch{t}{}
  % xindy -o
  \gxdyswitch{o}{}
  % makeglossaries -Q
  \gmkglsswitch{Q}{\providedby{\appfmt{makeglossaries} v2.14+}}
  % makeglossaries -k
  \gmkglsswitch{k}{\providedby{\appfmt{makeglossaries} v2.14+}}
  % makeglossaries -q
  \gmkglsswitch{q}{}
  % makeglossaries -m
  \gmkglsswitch{m}{%
    \initval{makeindex}
    \providedby{\appfmt{makeglossaries} v2.08+}%
    \syntax{\meta{application}}
  }
  % makeglossaries -x
  \gmkglsswitch{x}{
    \initval{xindy}
    \providedby{\appfmt{makeglossaries} v2.08+}%
    \syntax{\meta{application}}
  }
  % makeglossaries -d
  \gmkglsswitch{d}{%
    \providedby{\appfmt{makeglossaries} v2.05+}
    \syntax{\meta{directory}}
  }
  % makeglossaries -e
  \gmkglsswitch{e}{\providedby{\appfmt{makeglossaries} v4.50+}}
  % makeglossaries -n
  \gmkglsswitch{n}{\providedby{\appfmt{makeglossaries} v1.5+}}
  % makeglossaries -l
  \gmkglsswitch{l}{\providedby{\appfmt{makeglossaries} v1.5+}}
  % makeglossaries -L
  \gmkglsswitch{L}{\syntax{\meta{language}}}
  % makeglossaries -r
  \gmkglsswitch{r}{}
  % makeglossaries -c
  \gmkglsswitch{c}{}
  % makeglossaries -g
  \gmkglsswitch{g}{}
  % makeglossaries -p
  \gmkglsswitch{p}{%
    \syntax{\meta{num}}
  }
  % makeglossaries -s
  \gmkglsswitch{s}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries -o
  \gmkglsswitch{o}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries -t
  \gmkglsswitch{t}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries --help
  \glongswitch{mkgls.help}{%
   \field{name}{\longargfmt{help}}%
   \inapp{makeglossaries}%
   \providedby{\appfmt{makeglossaries} v1.2+}
  }
  % makeglossaries --version
  \glongswitch{mkgls.version}{%
   \field{name}{\longargfmt{version}}%
   \inapp{makeglossaries}%
   \providedby{\appfmt{makeglossaries} v1.2+}
  }
  % makeglossaries-lite -q
  \gmkglsliteswitch{q}{}
  % makeglossaries-lite -l
  \gmkglsliteswitch{l}{}
  % makeglossaries-lite -n
  \gmkglsliteswitch{n}{}
  % makeglossaries-lite -s
  \gmkglsliteswitch{s}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries-lite -o
  \gmkglsliteswitch{o}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries-lite -t
  \gmkglsliteswitch{t}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries-lite -L
  \gmkglsliteswitch{L}{\syntax{\meta{language}}}
  % makeglossaries-lite -r
  \gmkglsliteswitch{r}{}
  % makeglossaries-lite -c
  \gmkglsliteswitch{c}{}
  % makeglossaries-lite -g
  \gmkglsliteswitch{g}{}
  % makeglossaries-lite -p
  \gmkglsliteswitch{p}{%
    \syntax{\meta{num}}
  }
  % makeglossaries-lite -m
  \gmkglsliteswitch{m}{%
    \initval{makeindex}
    \syntax{\meta{application}}
  }
  % makeglossaries-lite -x
  \gmkglsliteswitch{x}{
    \initval{xindy}
    \syntax{\meta{application}}
  }
  % makeglossaries-lite --help
  \glongswitch{mkglslite.help}{%
   \field{name}{\longargfmt{help}}%
   \inapp{makeglossaries-lite}%
  }
  % makeglossaries-lite --version
  \glongswitch{mkglslite.version}{%
   \field{name}{\longargfmt{version}}%
   \inapp{makeglossaries-lite}%
  }
  % COMMANDS: ENTRY DEFINITIONS
  % \loadglsentries
  \gcmd{load\-gls\-entries}
  {
    \providedby{\sty{glossaries}}%
     \syntax{\oargm{type}\margm{filename}}
     \desc{locally assigns \gls{glsdefaulttype} to \meta{type} and
      inputs \meta{filename}. If the optional argument is omitted,
      the default glossary is assumed. Note that if any entries with
      \meta{filename} have the \gloskey{type} key set (including
      implicitly in commands like \gls{newabbreviation}), then this will
      override the type given in the optional argument}
  }
  % \GlsXtrLoadResources
  \gxtrcmd{Gls\-Xtr\-Load\-Resources}%
  {%
    \providedby{\sty{glossaries-extra} v1.11+}
    \syntax{\oargm{options}}
    \desc{for use with \app{bib2gls}, this both sets up the resource options
     (which \app{bib2gls} can detect from the \ext{aux} file) and
     inputs the \ext{glstex} file created by \app{bib2gls}}
  } 
  % \newglossaryentry
  \gcmd{new\-glossary\-entry}%
  {% 
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}\marg{\keyvallist}}
    \desc{defines a new \idx{glossary} entry with the given label. The
    second argument is a comma-separated list of \idxpl{gloskey}}
  }  
  % \longnewglossaryentry
  \gcmd{long\-new\-glossary\-entry}%
  {%
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{entry-label}\margm{key=value list}\margm{description}}
    \desc{defines a new \idx{glossary} entry with the given label. The
    second argument is a comma-separated list of \idxpl{gloskey}.
    The third argument is the description, which may include
    paragraph breaks}
  }
  % \provideglossaryentry
  \gcmd{provide\-glossary\-entry}%
  {% 
    \providedby{\sty{glossaries} v3.14a}
    \syntax{\margm{entry-label}\marg{\keyvallist}}
    \desc{as \gls{newglossaryentry} but does nothing if the entry is
     already defined}
  }  
  % \longprovideglossaryentry
  \gcmd{long\-provide\-glossary\-entry}%
  {%
    \providedby{\sty{glossaries} v3.14a+}
    \syntax{\margm{entry-label}\margm{key=value list}\margm{description}}
    \desc{as \gls{longnewglossaryentry} but does nothing if the entry is
     already defined}
  }
  % \newterm
  \gcmd{new\-term}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\oargm{key=value list}\margm{entry-label}}
    \note{requires \opt{index} package option}
    \desc{defines a new \idx{glossary} entry with the given label,
    \gloskey{type} set to \code{index}, the \gloskey{name}
    set to \meta{entry-label} and the \gloskey{description}
    set to \gls{nopostdesc}. The
    optional argument is a comma-separated list of \idxpl{gloskey},
    which can be used to override the defaults}
  }
  % \glsxtrnewsymbol
  \gxtrcmd{gls\-xtr\-new\-symbol}%
  {%
    \syntax{\oargm{key=value list}\margm{entry-label}\margm{sym}}
    \providedby{\sty{glossaries-extra}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{symbols}}\marg{glossaries-extra}}}
    \desc{defines a new \idx{glossary} entry with the given label,
    \gloskey{type} set to \glostype{symbols}, the \gloskey{category} set
    to \code{symbol}, the \gloskey{name} set to \meta{sym} and the \gloskey{sort}
    set to \meta{entry-label}. The optional argument is a comma-separated list of \idxpl{gloskey},
    which can be used to override the defaults}
  }
  % \glsxtrnewnumber
  \gxtrcmd{gls\-xtr\-new\-number}%
  {%
    \syntax{\oargm{key=value list}\margm{entry-label}\margm{num}}
    \providedby{\sty{glossaries-extra}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{numbers}}\marg{glossaries-extra}}}
    \desc{defines a new \idx{glossary} entry with the given label,
    \gloskey{type} set to \code{numbers}, the \gloskey{category} set
    to \code{number}, the \gloskey{name} set to \meta{num} and the \gloskey{sort}
    set to \meta{entry-label}. The optional argument is a comma-separated list of \idxpl{gloskey},
    which can be used to override the defaults}
  }
  % \glsxtrnopostpunc
  \gxtrcmd{gls\-xtr\-no\-post\-punc}
  {%
    \providedby{\sty{glossaries-extra} v1.22+}
    \desc{when placed at the end of the \gloskey{description}, this
    switches off the post-description punctuation (inserted
    automatically via options such as \opt{postdot}) but doesn't
    suppress the \idx{postdeschook}. Does nothing outside of the
    \idx{glossary}}
    \field{seealso}{nopostdesc}
  }
  % \nopostdesc
  \gcmd{no\-post\-desc}
  {%
    \providedby{\sty{glossaries} v1.17+}
    \desc{when placed at the end of the \gloskey{description}, this
    switches off the \idx{postdeschook} (including the
    post-description punctuation). Does nothing outside of the
    \idx{glossary}}
    \field{seealso}{glsxtrnopostpunc}
  } 
  % \glspar
  \gcmd{gls\-par}
  {
    \providedby{\sty{glossaries}}
    \desc{paragraph break (for instances where \gls{par} can't be used directly)}   
  } 
  % \glsaddkey
  \gcmd{gls\-add\-key}
  {
     \providedby{\sty{glossaries} v3.12a+}
     \syntax{\margm{key}\margm{default value}\margm{no link cs}\margm{no link ucfirst
      cs}\margm{link cs}\margm{link ucfirst cs}\margm{link allcaps cs}}
     \desc{defines a new \idx{gloskey} with the given default value
     and commands that are analogous to \gls{glsentrytext} (\meta{no
     link cs}), \gls{Glsentrytext} (\meta{no link ucfirst cs}),
     \gls{glstext} (\meta{link cs}), \gls{Glstext} (\meta{link ucfirst cs}),
     \gls{GLStext} (\meta{link allcaps cs}). The starred version switches on field
     expansion for the given key}
     \field{seealso}{glsaddstoragekey}
  }
  % \glsaddstoragekey
  \gcmd{gls\-add\-storage\-key}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{key}\margm{default value}\margm{no link cs}}
    \desc{provides a new \idx{gloskey} with a default value and a
          command for simply accessing the value (without indexing
          or \idxpl{hyperlink}). The starred version switches on field
          expansion for the given key}
     \field{seealso}{glsaddkey}
  }
  % \glssetexpandfield
  \gcmd{gls\-set\-ex\-pand\-field}
  {
    \providedby{\sty{glossaries} v3.13a+}
    \syntax{\margm{field}}
    \desc{indicates that the given field should always have its
     value expanded when the entry is defined. This overrides
     \gls{glsnoexpandfields}}
  }
  % \glssetnoexpandfield
  \gcmd{gls\-set\-no\-ex\-pand\-field}
  {
    \providedby{\sty{glossaries} v3.13a+}
    \syntax{\margm{field}}
    \desc{indicates that the given field should always have its
     value expanded when the entry is defined. This overrides
     \gls{glsexpandfields}}
  }
  % \glsnoexpandfields
  \gcmd{gls\-no\-ex\-pand\-fields}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \desc{don't expand values when assigning fields during entry
    definition (except for specific fields that are overridden by
    \gls{glssetexpandfield})}
  }
  % \glsexpandfields
  \gcmd{gls\-ex\-pand\-fields}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \desc{expand values when assigning fields during entry
    definition (except for specific fields that are overridden by
    \gls{glssetnoexpandfield})}
  }
  % \glsmoveentry
  \gcmd{gls\-move\-entry}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{entry-label}\margm{target glossary label}}
    \desc{moves the entry identified by \meta{entry-label} to the
    \idx{glossary} identified by \meta{target glossary label}}
    \field{seealso}{glsxtrcopytoglossary}
  }
  % \glsxtrcopytoglossary
  \gcmds{gls\-xtr\-copy\-to\-glos\-sary}
  {
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\margm{entry-label}\margm{glossary-type}}
    \desc{copies the entry to the internal \idx{glossary} list for
    the given \idx{glossary}. The starred version performs a global
    change. The unstarred version can be localised. Only for use with
    the \idx{unsrtfam}}
    \field{seealso}{glsmoveentry}
  }
  % \glsdoifexistsordo
  \gcmd{gls\-do\-if\-exists\-or\-do}
  {
    \providedby{\sty{glossaries} v4.19+}
     \syntax{\margm{entry-label}\margm{true}\margm{false}}
     \desc{similar to \gls{ifglsentryexists}, this does \meta{true}
     if the \idx{entry} given by \meta{entry-label}
     exists. If the \idx{entry} doesn't it exist, this does \meta{false}
     and generates an error}
     \field{seealso}{ifglsentryexists,glsdoifexists,glsdoifnoexists}
  }
  % \glsdoifexistsorwarn
  \gcmd{gls\-do\-if\-exists\-or\-warn}
  {
    \providedby{\sty{glossaries} v4.03+}
     \syntax{\margm{entry-label}\margm{code}}
     \desc{like \gls{glsdoifexists}, but always warns (no error) if
     the \idx{entry} doesn't exist}
  }
  % \glsdoifnoexists
  \gcmd{gls\-do\-if\-no\-exists}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{entry-label}\margm{code}}
     \desc{does \meta{code} if the \idx{entry} given by \meta{entry-label}
     does not exist. If the entry does exist, this will generate an error}
     \field{seealso}{ifglsentryexists,glsdoifexistsordo,glsdoifexists}
  }
  % \glsdoifexists
  \gcmd{gls\-do\-if\-exists}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{entry-label}\margm{code}}
     \desc{does \meta{code} if the \idx{entry} given by \meta{entry-label}
     exists. If the entry doesn't exist, this will generate
     an error}
     \field{seealso}{ifglsentryexists,glsdoifexistsordo,glsdoifnoexists}
  }
  % \ifglsentryexists
  \gcmd{if\-gls\-entry\-exists}
  {
     \syntax{\margm{entry-label}\margm{true}\margm{false}}
     \desc{does \meta{true} if the entry given by \meta{entry-label}
     exists, otherwise does \meta{false}}
     \field{seealso}{glsdoifexistsordo,glsdoifexists,glsdoifnoexists}
  }
  % COMMANDS: FETCHING AND UPDATING FIELDS
  % \glsletentryfield
  \gcmd{gls\-let\-entry\-field}
  {
    \providedby{\sty{glossaries} v4.07+}
    \syntax{\margm{cs}\margm{entry-label}\margm{field-label}}
    \desc{fetches the value of the given field 
       (identified by its \idxc{internalfieldlabel}{internal label}
       \meta{field-label}) for the entry given by
       \meta{entry-label} and stores it in the command \meta{cs}}
  }
  % \glsfielddef
  \gcmd{gls\-field\-def}
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \desc{locally assigns the \meta{value} to the given field
    (identified by the \idx{internalfieldlabel} \meta{field}) for the entry identified by
    \meta{entry-label}. Produces an error (or warning with
    \opteqvalref{undefaction}{warn}) if the entry or field doesn't
    exist. Note that this doesn't update any associated fields}
  }
  % \glsfieldgdef
  \gcmd{gls\-field\-gdef}
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \desc{as \gls{glsfielddef} but does a global assignment}
  }
  % \glsfieldedef
  \gcmd{gls\-field\-edef}
  {
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \providedby{\sty{glossaries} v4.16+}
    \desc{locally assigns the full expansion of \meta{value} to the given field
    (identified by the \idx{internalfieldlabel} \meta{field}) for the entry identified by
    \meta{entry-label}. Produces an error (or warning with
    \opteqvalref{undefaction}{warn}) if the entry or field doesn't
    exist. Note that this doesn't update any associated fields}
  }
  % \glsfieldxdef
  \gcmd{gls\-field\-xdef} 
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \desc{as \gls{glsfieldedef} but does a global assignment}
  }
  % \glsfieldfetch
  \gcmd{gls\-field\-fetch}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{cs}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{fetches the value of the given field for the given entry and stores it in
     the command \meta{cs}.  Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \glsunexpandedfieldvalue
  \gcmd{gls\-un\-expanded\-field\-value}
  {
     \syntax{\margm{entry-label}\margm{field-label}}
     \providedby{\sty{glossaries} v4.48+}
     \desc{for use in expandable contexts where the field value is
     required but the contents should not be expanded. The field
     should be identified by its \idx{internalfieldlabel}. Expands
     to nothing with no error or warning if the entry or field aren't defined}
  }
  % \ifglsfieldeq
  \gcmd{if\-gls\-field\-eq}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{string}\margm{true}\margm{false}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{tests if the value of the given field is equal to the
     given string using \sty{etoolbox}['s] \csfmt{ifcsstring}.
     Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \ifglsfielddefeq
  \gcmd{if\-gls\-field\-def\-eq}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{cs}\margm{true}\margm{false}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{tests if the value of the given field is equal to the
     replacement text of the given command \meta{cs} using \sty{etoolbox}['s]
    \csfmt{ifdefstrequal}.
     Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \ifglsfieldcseq
  \gcmd{if\-gls\-field\-cs\-eq}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{cs-name}\margm{true}\margm{false}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{tests if the value of the given field is equal to the
     replacement text of the command given by the control sequence
     name \meta{cs-name} using \sty{etoolbox}['s] \csfmt{ifcsstrequal}.
     Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \glsxtrfieldformatlist
  \gxtrcmd{gls\-xtr\-field\-format\-list}
  {
     \providedby{\sty{glossaries-extra} v1.42+}
     \syntax{\margm{entry-label}\margm{field-label}}
     \desc{formats the value of the given field, which should be 
     an \sty{etoolbox} internal list, using the same list handler
     macro as \sty{datatool}['s] \gls{DTLformatlist}}
  }
  % \glsxtrusefield
  \gxtrcmd{gls\-xtr\-use\-field}
  {
     \providedby{\sty{glossaries-extra} v1.12+}
     \syntax{\margm{entry-label}\margm{field-label}}
     \desc{expands to the value of the given field
      (identified by its \idxc{internalfieldlabel}{internal label}
       \meta{field-label}) for the entry given by
       \meta{entry-label}. Expands to \gls{relax} if the entry or field are undefined}
  }
  % COMMANDS: FIRST USE FLAG
  % \glsunset
  \gcmd{gls\-un\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{globally unsets the \idx+{firstuseflag}}
    \field{seealso}{glslocalunset,glsunsetall,glsreset}
  }
  % \glslocalunset
  \gcmd{gls\-local\-un\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{locally unsets the \idx+{firstuseflag}}
    \field{seealso}{glsunset,glsunsetall,glsreset}
  }
  % \glsunsetall
  \gcmd{gls\-un\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{globally unsets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsunset,glslocalunset,glslocalunsetall,glsresetall}
  }
  % \glslocalunsetall
  \gcmd{gls\-local\-un\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{locally unsets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsunset,glslocalunset,glsunsetall,glslocalresetall}
  }
  % \glsreset
  \gcmd{gls\-re\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{globally resets the \idx+{firstuseflag}}
    \field{seealso}{glslocalreset,glsresetall,glsunset}
  }
  % \glslocalreset
  \gcmd{gls\-local\-re\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{locally resets the \idx+{firstuseflag}}
    \field{seealso}{glsreset,glsresetall,glsunset}
  }
  % \glsresetall
  \gcmd{gls\-re\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{globally resets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsreset,glslocalreset,glslocalresetall,glsunsetall}
  }
  % \glslocalresetall
  \gcmd{gls\-local\-re\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{locally resets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsreset,glslocalreset,glsresetall,glslocalunsetall}
  }
  % \ifglsused
  \gcmd{if\-gls\-used}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the \idx{entry} has been marked as
    \idxc{firstuseflag}{used}, does \meta{false} if the entry is
    marked as \idxc{firstuseflag}{unused}, and does neither if
    the entry hasn't been defined (but will generate an error)}
  }
  % \GlsXtrIfUnusedOrUndefined
  \gcmd{Gls\-Xtr\-If\-Unused\-Or\-Undefined}
  {
    \providedby{\sty{glossaries-extra} v1.34+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}} 
    \desc{does \meta{true} if the entry hasn't been defined or hasn't been marked as
    \idxc{firstuseflag}{used}, otherwise does \meta{true}. Note
    that this command will generate an error or warning (according to
    \opt{undefaction}) if the entry hasn't been defined, but will
    still do \meta{true}}
    \field{seealso}{ifglsused,glsxtrifwasfirstuse}
  }
  % \GlsXtrStartUnsetBuffering
  \gxtrcmds{Gls\-Xtr\-Start\-Unset\-Buffering}
  { 
     \providedby{\sty{glossaries-extra} v1.30+}
    \desc{enables unset buffering. The starred version doesn't check
    for duplicates}
    \field{seealso}{GlsXtrStopUnsetBuffering}
  }
  % \GlsXtrStopUnsetBuffering
  \gxtrcmds{Gls\-Xtr\-Stop\-Unset\-Buffering}
  {
     \providedby{\sty{glossaries-extra} v1.30+}
    \desc{stops buffering. The starred version performs a global unset}
    \field{seealso}{GlsXtrStartUnsetBuffering}
  }
  % \GlsXtrUnsetBufferEnableRepeatLocal
  \gcmd{Gls\-Xtr\-Unset\-Buffer\-Enable\-Repeat\-Local}
  {
     \providedby{\sty{glossaries-extra} v1.49+}
     \desc{allows repeat entries within the buffering code to be
     locally unset before the \idx{linktext}}
  }
  % \GlsXtrResetLocalBuffer
  \gcmd{Gls\-Xtr\-Reset\-Local\-Buffer}
  {
     \providedby{\sty{glossaries-extra} v1.49+}
     \desc{if local unset for repeat entries has been enabled with
      \gls{GlsXtrUnsetBufferEnableRepeatLocal}, this will locally
      reset all entries that are in the buffer that hadn't been
     marked as used before the function was enabled}
  }
  % COMMANDS: UTILITIES - CONDITIONALS
  % \ifignoredglossary
  \gcmds{if\-ignored\-glos\-sary}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{glossary-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the \idx{glossary} identified by
     \meta{glossary-label} has been defined as an
    \idx{ignoredglossary}, otherwise does \meta{false}}
  }
  % \ifglossaryexists
  \gcmds{if\-glos\-sary\-exists}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{glossary-type}\margm{true}\margm{false}}
    \desc{if the \idx{glossary} given by \meta{glossary-type} exists,
    this does \meta{true}, otherwise it does \meta{false}. The
    unstarred form treats \idxpl{ignoredglossary} as non-existent. The
    starred form (v4.46+) will do \meta{true} if \meta{glossary-type} matches
    an ignored glossary}
  }
  % \ifglsfieldvoid
  \gcmd{if\-gls\-field\-void}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
    \desc{an expandable test to determine if the entry is undefined
    or the field is undefined or empty. The \meta{field-label}
    must be the field's \idxc{internalfieldlabel}{internal label}. 
    Internally uses \sty{etoolbox}['s] \gls{ifcsvoid} command}
    \field{seealso}{GlsXtrIfFieldUndef}
  }%
  % \GlsXtrIfFieldUndef
  \gxtrcmd{Gls\-Xtr\-If\-Field\-Undef}
  {
    \providedby{\sty{glossaries-extra} v1.23+}
    \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
    \desc{expandable command that tests if the given field (identified by its
     \idxc{internalfieldlabel}{internal label}) is undefined for the
     entry given by \meta{entry-label}. Internally uses \sty{etoolbox}['s] 
     \gls{ifcsundef} command}
     \field{seealso}{ifglsfieldvoid}
  }
  % \glscurrentfieldvalue
  \gcmd{gls\-current\-field\-value}
  {
     \providedby{\sty{glossaries} v4.23+}
     \desc{conditional commands such as \gls{ifglshasfield} set this
      to the field's value for use within the \meta{true} code}
  }  
  % \ifglshasfield
  \gcmd{if\-gls\-has\-field}
  { 
    \providedby{\sty{glossaries} v4.03+}
    \syntax{\margm{field}\margm{entry-label}\margm{true}\margm{false}}
    \note{robust}
    \desc{if the field identified by either its key or its
    \idx{internalfieldlabel} \meta{field} for the entry identified by
    \meta{entry-label} is set and non-empty, this sets
    \gls{glscurrentfieldvalue} to the field value and does \meta{true}
     otherwise it does \meta{false}}
    \field{seealso}{ifglsfieldvoid}
  }
  % \ifglshasparent
  \gcmd{if\-gls\-has\-parent}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{parent} field is
    set otherwise does \meta{false}}
  }
  % \ifglshasdesc
  \gcmd{if\-gls\-has\-desc}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{description} field is
    set otherwise does \meta{false}}
  }
  % \ifglsdescsuppressed
  \gcmd{if\-gls\-desc\-suppressed}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{description} field is
    just \gls{nopostdesc} otherwise does \meta{false}}
  }
  % \ifglshassymbol
  \gcmd{if\-gls\-has\-symbol}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{symbol} field is
    set otherwise does \meta{false}}
  }
  % \ifglshaslong
  \gcmd{if\-gls\-has\-long}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{long} field is
    set otherwise does \meta{false}}
  }
  % \ifglshasshort
  \gcmd{if\-gls\-has\-short}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{short} field is
    set otherwise does \meta{false}}
  }
  % \ifglshaschildren
  \gcmd{if\-gls\-has\-children}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the given entry has child entries
    otherwise does \meta{false}. Note that this has to iterate over
    the set of defined entries for the entry's \idx{glossary} to
    find one that has the entry identified in its \gloskey{parent}
    field. A more efficient approach can be achieved with
    \app{bib2gls} and the \resourceopt{save-child-count} resource option}
  }
  % \GlsXtrIfHasNonZeroChildCount
  \gxtrcmds{Gls\-Xtr\-If\-Has\-Non\-Zero\-Child\-Count}
  { 
    \providedby{\sty{glossaries-extra-bib2gls} v1.47+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{tests if the value in the \glosfield{childcount} field is
    non-zero (using \gls{GlsXtrIfFieldNonZero}). This requires the
    \resourceopt{save-child-count} resource option}
  }
  % \glsxtrifhasfield
  \gxtrcmds{gls\-xtr\-if\-has\-field}
  {   
     \providedby{\sty{glossaries-extra} v1.19+}
    \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
    \desc{tests if the field identified by its
     \idxc{internalfieldlabel}{internal label} \meta{field-label} for the entry
     given by \meta{entry-label} is defined and is not empty. This is like
    \gls{ifglshasfield} but doesn't produce a warning if the entry or field
    doesn't exist.  This sets \gls{glscurrentfieldvalue} to the field value and
    does \meta{true} if its defined and not empty, otherwise it does
    \meta{false}. The unstarred version adds implicit grouping to
    make nesting easier. The starred version doesn't (to make
    assignments easier)}
  }
  % COMMANDS: UTILITIES - LOOPS
  % \forglsentries
  \gcmd{for\-gls\-entries}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{type}\margm{cs}\margm{body}}
    \desc{iterates over all entries in the given \idx{glossary} 
    and, at each iteration, defines the command \meta{cs}
    to the current entry label and does \meta{body}. The optional
    argument \meta{type} is the \idx{glossary}
    label and defaults to \gls{glsdefaulttype} if omitted.
    This command can't be used with \app{bib2gls} since there are no
    defined entries until \app{bib2gls} has selected them and added
    them to the \ext{glstex} file}
  }
  % \forallglsentries
  \gcmd{for\-all\-gls\-entries}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{types}\margm{cs}\margm{body}}
    \desc{does \gls{forglsentries} for each \idx{glossary}. The optional
    argument \meta{types} is a comma-separated list of \idx{glossary}
    labels. If omitted, all non-\idxpl{ignoredglossary} is assumed}
  }
  % \forallglossaries
  \gcmd{for\-all\-glossaries}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{types}\margm{cs}\margm{body}}
    \desc{iterates overall all the \idx{glossary} labels given in
    the \meta{types} argument, defines the command \meta{cs} to the
    current label and does \meta{body}. If the optional argument is
    omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
  }
  % \forallacronyms
  \gcmd{for\-all\-acronyms}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{cs}\margm{body}}
    \desc{iterates overall all \idxpl{glossary} that have been
    declared lists of \idxpl{acronym}, defines the command \meta{cs} to the
    current label and does \meta{body}}
    \note{don't use with \sty{glossaries-extra}}
  }
  % \forallabbreviationlists
  \gxtrcmd{forallabbreviationlists}
  {
    \providedby{\sty{glossaries-extra} v1.42+}
    \syntax{\margm{cs}\margm{body}}
    \desc{iterates overall all lists of abbreviations, defines the 
    command \meta{cs} to the current label and does \meta{body}}
  }
  % \glsxtrforcsvfield
  \gxtrcmds{gls\-xtr\-for\-csv\-field}
  {
     \providedby{\sty{glossaries-extra} v1.24+}
     \syntax{\margm{entry-label}\margm{field-label}\margm{handler cs}}
     \desc{iterates over the comma-separated list stored in the given field 
     (identified by its \idxc{internalfieldlabel}{internal label})
     for the entry identified by \meta{entry-label} and performs
     \code{\meta{handler cs}\margm{element}} for each element of the
     list}
  }
  % COMMANDS: UTILITIES - MEASURING
  % \glsmeasureheight
  \gcmd{gls\-measure\-height}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{length}\margm{text}}
     \desc{measures the height of \meta{text} using \gls{settoheight}
     but temporarily switches off indexing, unset/reset and
     labelling}
  }
  % \glsmeasuredepth
  \gcmd{gls\-measure\-depth}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{length}\margm{text}}
     \desc{measures the depth of \meta{text} using \gls{settodepth}
     but temporarily switches off indexing, unset/reset and
     labelling}
  }
  % \glsmeasurewidth
  \gcmd{gls\-measure\-width}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{length}\margm{text}}
     \desc{measures the width of \meta{text} using \gls{settowidth}
     but temporarily switches off indexing, unset/reset and
     labelling}
  }
  % \glsifmeasuring
  \gcmd{gls\-if\-measuring}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{true}\margm{false}}
     \desc{does \meta{true} it it occurs inside a measuring content
otherwise does \meta{false}}
  }
  % COMMANDS: ENTRY COUNTING
  % \glsenableentrycount
  \gcmd{gls\-enable\-entry\-count}
  {
    \providedby{\sty{glossaries} v4.14+}
    \desc{enables entry counting}
  }
  % \ifglsresetcurrcount
  \gcond{if\-gls\-reset\-curr\-count}
  { 
    \providedby{\sty{glossaries} v4.50+}
    \initval{\csfmt{iffalse}}
    \desc{conditional that determines whether or not the reset
     commands should reset the entry count stored in
     \glosfield{currcount} to zero}
    \field{seealso}{glsenableentrycount,glsreset,glslocalreset}
  }
  % \glsresetcurrcountfalse
  \gcmd{gls\-re\-set\-curr\-count\-false}
  {
    \providedby{\sty{glossaries} v4.50+}
    \desc{sets the \gls{ifglsresetcurrcount} conditional to \csfmt{iffalse}}
  }
  % \glsresetcurrcounttrue
  \gcmd{gls\-re\-set\-curr\-count\-true}
  {
    \providedby{\sty{glossaries} v4.50+}
    \desc{sets the \gls{ifglsresetcurrcount} conditional to \csfmt{iftrue}}
  }
  % \glsentrycurrcount
  \gcmd{gls\-entry\-curr\-count}
  {
    \syntax{\margm{entry-label}}
    \providedby{\sty{glossaries} v4.14+}
    \desc{expands to the current entry count running total or 0 if
     not available (needs to be enabled with
    \gls{glsenableentrycount})}
  }
  % \glsentryprevcount
  \gcmd{gls\-entry\-prev\-count}
  {
    \syntax{\margm{entry-label}}
    \providedby{\sty{glossaries} v4.14+}
    \desc{expands to the final entry count total from the previous
    \LaTeX\ run or if 0 if not available (needs to be enabled with
    \gls{glsenableentrycount})}
  }
  % \cgls
  \gcmdsp{cgls}
  { 
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{gls} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cglsformat}
  }
  % \cglspl
  \gcmdsp{cgls\-pl}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{glspl} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cglsplformat}
  }
  % \cGls
  \gcmdsp{cGls}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{Gls} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cGlsformat}
  }
  % \cGlspl
  \gcmdsp{cGls\-pl}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{Glspl} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cGlsplformat}
  }
  % \cglsformat
  \gcmd{cgls\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cgls} if the entry was only used once 
    on the previous run}
  }
  % \cglsplformat
  \gcmd{cgls\-pl\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cglspl} if the entry was only used once 
    on the previous run}
  }
  % \cGlsformat
  \gcmd{cGls\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cGls} if the entry was only used once 
    on the previous run}
  }
  % \cGlsplformat
  \gcmd{cGls\-pl\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cGlspl} if the entry was only used
    once on the previous run}
  }
  % COMMANDS: ACRONYMS AND ABBREVIATIONS
  % \newacronym
  \gcmd{new\-acronym}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oarg{\keyvallist}\margm{entry-label}\margm{short}\margm{long}}
    \desc{this command is provided by the base \sty{glossaries}
     package to define a new \idx+{acronym} but it's redefined by 
     \sty{glossaries-extra} to use
     \gls{newabbreviation} with the \gloskey{category} key set to
     \cat{acronym}. With just the base \sty{glossaries} package, use
     \gls{setacronymstyle} to set the style. With
     \sty{glossaries-extra}, use
     \code{\gls{setabbreviationstyle}\oarg{\cat{acronym}}\margm{style}} to
     set the style that governs \gls{newacronym}}
  }
  % \oldacronym
  \gcmd{old\-acronym}
  {
    \providedby{\sty{glossaries} v1.18+}
    \syntax{\oargm{label}\margm{short}\margm{long}\marg{\keyvallist}}
    \desc{defines an \idx{acronym} using the syntax of the old
     \sty{glossary} package}
  }
  % \setacronymstyle
  \gcmd{set\-acronym\-style}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{style-name}}
    \desc{sets the \idx{acronym} style. Don't use with \sty{glossaries-extra}}
  }
  % \newacronymstyle
  \gcmd{new\-acronym\-style}%
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{name}\margm{format def}\margm{style defs}}
    \desc{defines an \idx{acronymstyle} for use with the base
    \sty{glossaries} package's \idx{acronym} mechanism. These styles are not
    compatible with \sty{glossaries-extra}. The \meta{format def}
    part is the code used as the \idx{entryformat} definition within
    \gls{defglsentryfmt}. The \meta{style defs} is the code that
    redefines the \idx{acronym} formatting commands, such as
    \gls{genacrfullformat}, and the additional fields command
    \gls{GenericAcronymFields}}
  }
  % \renewacronymstyle
  \gcmd{re\-new\-acronym\-style}%
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{name}\margm{format def}\margm{display defs}}
    \desc{as \gls{newacronymstyle} but redefines an existing \idx{acronymstyle}}
  }
  \gxtrcmd{new\-abbreviation}
  {  
    \providedby{\sty{glossaries-extra}}
    \syntax{\oarg{\keyvallist}\margm{label}\margm{short}\margm{long}}
    \desc{defines a new entry that represents an \idx+{abbreviation}.
     This internally uses \gls{newglossaryentry} and any provided
     options (\idxpl{gloskey}) given in \keyvallist\ will be appended. The
     \gloskey{category} is set to \cat{abbreviation} by default, but
     may be overridden in \meta{options}. The
     appropriate style should be set before the abbreviation is
     defined with \gls{setabbreviationstyle}}
  } 
  % \setabbreviationstyle
  \gxtrcmd{set\-abbreviation\-style}
  {
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{category}\margm{style-name}}
     \desc{sets the current \idx{abbrvstyle} to \meta{style-name}
      for the category identified by \meta{category}. If the
      optional argument is omitted, \cat{abbreviation} is assumed}
  }
  % \newabbreviationstyle
  \gxtrcmd{new\-ab\-bre\-vi\-a\-tion\-style}%
  {% 
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{style-name}\margm{setup}\margm{display definitions}}
    \desc{defines an abbreviation style, which can be set with
    \gls{setabbreviationstyle}}
  }
  % \GlsXtrUseAbbrStyleSetup
  \gxtrcmd{Gls\-Xtr\-Use\-Abbr\-Style\-Set\-up}
  {
     \providedby{\sty{glossaries-extra}}
    \syntax{\margm{style-name}}
    \desc{implements the \meta{setup} code for the given
     abbreviation style}
  }  
  % \GlsXtrUseAbbrStyleFmts
  \gxtrcmd{Gls\-Xtr\-Use\-Abbr\-Style\-Fmts}
  {
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{style-name}}
    \desc{implements the \meta{display definitions} code for the given
     abbreviation style}
  }
  % \firstacronymfont
  \gcmd{first\-acronym\-font}
  {
    \providedby{\sty{glossaries} v1.14+}
     \syntax{\margm{text}}
     \desc{used to encapsulate the \idx{acronym} short form on \idx{firstuse}}
  }
  % \acronymfont
  \gcmd{acronym\-font}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{text}}
     \desc{used to encapsulate the \idx{acronym} short form on
     \idx{subsequentuse}}
  }
  % \acronymentry
  \gcmd{acronym\-entry}
  {
    \providedby{\sty{glossaries} v4.02+}
     \syntax{\margm{entry-label}}
     \desc{used by \idxpl{acronymstyle} to format the \idx{acronym} name}
  }
  % \acronymsort
  \gcmd{acronym\-sort}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{short}\margm{long}}
     \desc{used by \idxpl{acronymstyle} in the \idx{acronym} \gloskey{sort} key}
  }
  % \acronymtype
  \gcmd{acronym\-type}%
  {%
    \common
    \providedby{\sty{glossaries}}
    \initval{\gls{glsdefaulttype}}%
    \desc{expands to the label of the default \idx{acronym} \idx{glossary}. The
    \opt{acronym} or \opt{acronyms} package option will redefine
     this to \glostype{acronym}. The \sty{glossaries-extra} package's 
     \opt{abbreviations} option will redefine this to \gls{glsxtrabbrvtype} if
    \opt{acronyms}\slash\opt{acronym} isn't used}
  }%
  % \glsxtrabbrvtype
  \gxtrcmd{gls\-xtr\-abbrv\-type}%
  {%
    \initval{\gls{glsdefaulttype}}%
    \providedby{\sty{glossaries-extra}}
    \desc{expands to the label of the default \idx{abbreviation} \idx{glossary}. The
    \opt{abbreviations} package option will redefine
     this to \code{abbreviations}}
  }
  % \genacrfullformat
  \gcmd{gen\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{used by \gls{glsgenacfmt} to display the \idx{acronym} singular full
     form on \idx{firstuse}. Redefined by \idxpl{acronymstyle}}
  }
  % \Genacrfullformat
  \gcmd{Gen\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{as \gls{genacrfullformat} but \idx{sentencecase}}
  }
  % \genplacrfullformat
  \gcmd{gen\-pl\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{used by \gls{glsgenacfmt} to display the \idx{acronym} plural full
     form on \idx{firstuse}. Redefined by \idxpl{acronymstyle}}
  }
  % \Genplacrfullformat
  \gcmd{Gen\-pl\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{as \gls{genplacrfullformat} but \idx{sentencecase}}
  }
  % \acrfullfmt
  \gcmd{acr\-full\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{acrfull} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \Acrfullfmt
  \gcmd{Acr\-full\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{Acrfull} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \ACRfullfmt
  \gcmd{ACR\-full\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{ACRfull} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \acrfullplfmt
  \gcmd{acr\-full\-pl\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{acrfullpl} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \Acrfullplfmt
  \gcmd{Acr\-full\-pl\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{Acrfullpl} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \ACRfullplfmt
  \gcmd{ACR\-full\-pl\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{ACRfullpl} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \acrnameformat
  \gcmd{acr\-name\-format}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{short text}\margm{long text}}
    \desc{used by \idxpl{acronymstyle} that require an additional
    description to determine what information is displayed in the name}
  }
  % \glskeylisttok
  \gcmd{gls\-key\-list\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the \keyvallist\ supplied in the
     optional argument}
  }
  % \glslabeltok
  \gcmd{gls\-label\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the \idx{entry} label}
  }
  % \glsshorttok
  \gcmd{gls\-short\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the supplied short form}
  }
  % \glslongtok
  \gcmd{gls\-long\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the supplied long form}
  }
  % \newacronymhook
  \gcmd{new\-acronym\-hook}
  {
    \providedby{\sty{glossaries}}
    \desc{hook used by \gls{newacronym} just before the entry is
    defined by \gls{newglossaryentry}}
  }
  % \GlsUseAcrEntryDispStyle
  \gcmd{Gls\-Use\-Acr\-Entry\-Disp\-Style}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{style-name}}
    \desc{implements the \idx{entryformat} part of the given \idx{acronymstyle}
     (the code supplied in the \meta{format def} argument of
     \gls{newacronymstyle})}
  }
  % \GlsUseAcrStyleDefs
  \gcmd{Gls\-Use\-Acr\-Style\-Defs}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{style-name}}
    \desc{implements the style definitions part of the given \idx{acronymstyle}
      (the code supplied in the \meta{display defs} argument of
      \gls{newacronymstyle})}
  }
  % \GenericAcronymFields
  \gcmd{Generic\-Acronym\-Fields}
  {
    \providedby{\sty{glossaries}}
    \desc{expands to the additional keys that need to be provided to
     \gls{newglossaryentry} when called by \gls{newacronym}. For
     example, the \gloskey{description} key}
  }
  % \glsentryfull
  \gcmd{gls\-entry\-full}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{displays the singular full form of the \idx{acronym} identified by
    \meta{entry-label}, without \idxpl{hyperlink} or \idx{indexing}.
    This command is redefined by \idxpl{acronymstyle} to match the style format}
  }
  % \Glsentryfull
  \gcmd{Gls\-entry\-full}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfull} but \idx{sentencecase}}
  }
  % \GLSentryfull
  \gcmd{GLS\-entry\-full}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfull} but \idx{allcaps}}
  }
  % \glsentryfullpl
  \gcmd{gls\-entry\-full\-pl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{displays the plural full form of the \idx{acronym} identified by
    \meta{entry-label}, without \idxpl{hyperlink} or \idx{indexing}. 
    This command is redefined by \idxpl{acronymstyle} to match the style format}
  }
  % \Glsentryfullpl
  \gcmd{Gls\-entry\-full\-pl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfullpl} but \idx{sentencecase}}
  }
  % \GLSentryfullpl
  \gcmd{GLS\-entry\-full\-pl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfullpl} but \idx{allcaps}}
  }
  % \acrshort
  \gcmdsp{acr\-short}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{short} value, formatted
    according to the \idx{acronymstyle}.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrshort} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrshort
  \gcmdsp{Acr\-short}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshort} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRshort
  \gcmdsp{ACR\-short}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshort} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrshortpl
  \gcmdsp{acr\-short\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{shortplural} value, formatted
    according to the \idx{acronymstyle}.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrshortpl} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrshortpl
  \gcmdsp{Acr\-short\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshortpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRshortpl
  \gcmdsp{ACR\-short\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshortpl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrlong
  \gcmdsp{acr\-long}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{long} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrlong} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrlong
  \gcmdsp{Acr\-long}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlong} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRlong
  \gcmdsp{ACR\-long}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlong} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrlongpl
  \gcmdsp{acr\-long\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{longplural} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrlongpl} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrlongpl
  \gcmdsp{Acr\-long\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlongpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRlongpl
  \gcmdsp{ACR\-long\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlongpl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrfull
  \gcmdsp{acr\-full}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced shows the full form, formatted according to the \idx{acronymstyle}.
    With \sty{glossaries-extra}, use
    \gls{glsxtrfull} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrfull
  \gcmdsp{Acr\-full}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfull} but \idx{sentencecase}}
  }
  % \ACRfull
  \gcmdsp{ACR\-full}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfull} but \idx{allcaps}}
  }
  % \acrfullpl
  \gcmdsp{acr\-full\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfull} but shows the full plural
     form of an \idx{acronym}. With \sty{glossaries-extra}, use
    \gls{glsxtrfullpl} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrfullpl
  \gcmdsp{Acr\-full\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfullpl} but \idx{sentencecase}}
  }
  % \ACRfullpl
  \gcmdsp{ACR\-full\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfullpl} but \idx{allcaps}}
  }
  % \ac
  \gcmdsp{ac}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{gls} defined by the
     \opt{shortcuts} package option} 
  }  
  % \Ac
  \gcmdsp{Ac}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Gls} defined by the
     \opt{shortcuts} package option} 
  }  
  % \acp
  \gcmdsp{acp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{glspl} defined by the
     \opt{shortcuts} package option} 
  }  
  % \Acp
  \gcmdsp{Acp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Glspl} defined by the
     \opt{shortcuts} package option} 
  }  
  % \acs
  \gcmdsp{acs}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{acrshort} defined by the
     \opt{shortcuts} package option} 
  }  
  % \Acs
  \gcmdsp{Acs}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Acrshort} defined by the
     \opt{shortcuts} package option}
  } 
  % \acsp
  \gcmdsp{acsp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{acrshortpl} defined by the
     \opt{shortcuts} package option}
  }
  % \Acsp
  \gcmdsp{Acsp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Acrshortpl} defined by the
     \opt{shortcuts} package option}
  }
  % \acl
  \gcmdsp{acl}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{acrlong} defined by the
     \opt{shortcuts} package option}
  }
  % \aclp
  \gcmdsp{aclp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{acrlongpl} defined by the
     \opt{shortcuts} package option}
  }
  % \Acl
  \gcmdsp{Acl}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Acrlong} defined by the
     \opt{shortcuts} package option}
  }
  % \Aclp
  \gcmdsp{Aclp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Acrlongpl} defined by the
     \opt{shortcuts} package option}
  }
  % \acf
  \gcmdsp{acf}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{acrfull} defined by the
     \opt{shortcuts} package option}
  }
  % \acfp
  \gcmdsp{acfp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{acrfullpl} defined by the
     \opt{shortcuts} package option}
  }
  % \Acf
  \gcmdsp{Acf}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Acrfull} defined by the
     \opt{shortcuts} package option}
  }
  % \Acfp
  \gcmdsp{Acfp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{inset}}
    \desc{a synonym for \gls{Acrfullpl} defined by the
     \opt{shortcuts} package option}
  }
  % \glsxtrshort
  \gxtrcmdsp{gls\-xtr\-short}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{abbreviation} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{short} value, formatted
    according to the \idx{abbrvstyle} associated with the entry's \idx{category}.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glsxtrshort
  \gxtrcmdsp{Gls\-xtr\-short}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrshort
  \gxtrcmdsp{GLS\-xtr\-short}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsxtrshortpl
  \gxtrcmdsp{gls\-xtr\-shortpl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but the text produced is obtained
    from the \gloskey{shortplural} value}
  }
  % \Glsxtrshortpl
  \gxtrcmdsp{Gls\-xtr\-shortpl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshortpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \glsxtrlong
  \gxtrcmdsp{gls\-xtr\-long}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{abbreviation} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{long} value, formatted
    according to the \idx{abbrvstyle} associated with the entry's \idx{category}.    
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}}
  }
  % \Glsxtrlong
  \gxtrcmdsp{Gls\-xtr\-long}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlong} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrlong
  \gxtrcmdsp{GLS\-xtr\-long}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlong} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsxtrlongpl
  \gxtrcmdsp{gls\-xtr\-long\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlong} but the text produced is obtained
    from the \gloskey{longplural} value}
  }
  % \Glsxtrlongpl
  \gxtrcmdsp{Gls\-xtr\-long\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlongpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrlongpl
  \gxtrcmdsp{GLS\-xtr\-long\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlongpl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsxtrfull
  \gxtrcmdsp{gls\-xtr\-full}{% 
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{abbreviation} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{short} and \gloskey{long} values, formatted
    according to the \idx{abbrvstyle} associated with the entry's \idx{category}. 
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. The format produced by this command may not
    match the format produced by the \idx{firstuse} of
    \code{\gls{gls}\margm{entry-label}}, depending on the abbreviation
    style}
  }
  % \Glsxtrfull
  \gxtrcmdsp{Gls\-xtr\-full}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfull} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrfull
  \gxtrcmdsp{GLS\-xtr\-full}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfull} but converts the \idx{linktext} to
    \idx{allcaps}}
  }
  % \glsxtrfull
  \gxtrcmdsp{gls\-xtr\-full\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfull} but for the plural form}
  }
  % \Glsxtrfullpl
  \gxtrcmdsp{Gls\-xtr\-full\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfullpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrfullpl
  \gxtrcmdsp{GLS\-xtr\-full\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfullpl} but converts the \idx{linktext} to
    \idx{allcaps}}
  }
  % \glsacspace
  \gcmd{gls\-ac\-space}%
  {
     \providedby{\sty{glossaries} v4.16+}
     \syntax{\margm{label}}
     \desc{uses a non-breakable space if the short form is less than
      3em. This command is redefined by \sty{glossaries-extra} to use
       \gls{glsacspacemax} instead of the hard-coded 3em}
  }
  % \glsacspacemax
  \gxtrcmd{gls\-ac\-space\-max}
  {  
    \providedby{\sty{glossaries-extra}}
     \desc{expands to the maximum width used by \gls{glsacspace}.
     This is a macro not a register. The default is \code{3em}}
  }
  % \glstextup
  \gcmd{gls\-text\-up}
  {
     \providedby{\sty{glossaries} v3.09a+}
     \syntax{\margm{text}}
     \desc{if \gls+{textulc} is defined, this will use that command,
     otherwise it will use \gls+{textup} to cancel the effect of the
     \idx+{smallcaps} font command \gls+{textsc}}
  }
  % COMMANDS: OPTIONS
  % \setupglossaries
  \gcmd{set\-up\-glos\-saries}%
  {%
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{options}}
    \desc{change allowed options that are defined by the base
    \sty{glossaries} package. Note that some options can only be
    passed as package options. To change options defined or modified
    by the \sty{glossaries-extra} package, use
    \gls{glossariesextrasetup}}
  }
  % \glossariesextrasetup
  \gxtrcmd{glos\-saries\-extra\-setup}%
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{options}}
    \desc{change allowed options that are defined or modified by the
    \sty{glossaries-extra} package.  Note that some options can only be
    passed as package options}
  }
  % \ifglsnogroupskip
  \gcond{if\-gls\-no\-group\-skip}
  { 
    \providedby{\sty{glossaries} v3.03+}
    \initval{\csfmt{iffalse}}
    \desc{conditional set by the \opt{nogroupskip} option}
  }
  % \ifglsxindy
  \gcond{if\-gls\-xindy}
  {
    \providedby{\sty{glossaries} v1.17+}
    \initval{\csfmt{iffalse}}
    \desc{conditional that, if true, indicates that \app{xindy}
     should be used}
  }
  % \glsindexingsetting
  \gcmd{gls\-index\-ing\-setting}
  {
    \providedby{\sty{glossaries} v4.50+}
    \desc{indicates what \idx{indexing} option has been chosen}
  }
  % \ifglstoc
  \gcond{if\-gls\-toc}
  {
    \providedby{\sty{glossaries}}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{toc} option}
  }
  % \glstoctrue
  \gcmd{gls\-toc\-true}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglstoc} to true}
  }
  % \glstocfalse
  \gcmd{gls\-toc\-false}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglstoc} to false}
  }
  % \ifglshyperfirst
  \gcond{if\-gls\-hyper\-first}
  {
    \providedby{\sty{glossaries}}
    \initval{\csfmt{iftrue}}
    \desc{conditional corresponding to the \opt{hyperfirst} option}
  }
  % \glshyperfirsttrue
  \gcmd{gls\-hyper\-first\-true}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglshyperfirst} to true}
  }
  % \glshyperfirstfalse
  \gcmd{gls\-hyper\-first\-false}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglshyperfirst} to false}
  }
  % \setglossarysection
  \gcmd{set\-glossary\-section}
  {
    \providedby{\sty{glossaries} v1.1+}
    \syntax{\meta{name}}
    \desc{equivalent to the package option \optval{section}{\meta{name}}}
  }
  % \glossarytitle
  \gcmd{glossary\-title}
  {
    \desc{defined by \gls{print...glossary} to the current
      \idx{glossary}['s] title}
  }
  % \glossarytoctitle
  \gcmd{glossary\-toc\-title}
  {
    \desc{defined by \gls{print...glossary} to the current
      \idx{glossary}['s] title for the \idx{tableofcontents}
      (if \opt{toc}{true})}
  }
  % \glssettoctitle
  \gcmd{gls\-set\-toc\-title}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{glossary-type}}
    \desc{used by \gls{print...glossary} to set the table of contents title 
     for the given \idx{glossary} if a title hasn't been supplied
     with \printglossopt{toctitle} or \printglossopt{title}}
  }
  % \glsglossarymark
  \gcmd{gls\-glossary\-mark}
  {
    \providedby{\sty{glossaries} v2.02+}
    \syntax{\meta{glossary title}}
    \desc{sets the header mark for the \idx{glossary}}
  }
  % \glossarymark
  \gcmd{glossary\-mark}
  {
    \deprecated
    \providedby{\sty{glossaries} v1.0+}
    \syntax{\meta{glossary title}}
    \desc{only provided if it hasn't already been defined for
    backward-compatibility. Use \gls{glsglossarymark} instead}
  }
  % \glsclearpage
  \gcmd{gls\-clear\-page}
  {
    \providedby{\sty{glossaries} v1.19+}
    \desc{used to clear the page at the start of a \idx{glossary}}
  }
  % \ifglsucmark
  \gcond{if\-gls\-uc\-mark}
  {
    \providedby{\sty{glossaries} v3.02+}
    \initvalvaries
    \desc{conditional corresponding to the \opt{ucmark} option}
  }
  % \glsucmarktrue
  \gcmd{gls\-uc\-mark\-true}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsucmark} to true}
  }
  % \glsucmarkfalse
  \gcmd{gls\-uc\-mark\-false}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsucmark} to false}
  }
  % \glsautoprefix
  \gcmd{gls\-auto\-prefix}
  {
    \providedby{\sty{glossaries} v1.14+}
    \desc{expands to the prefix for the label used by
     \optval{numberedsection}{autolabel} and \optval{numberedsection}{nameref}}
  }
  % \ifglsentrycounter
  \gcond{if\-gls\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.0+}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{entrycounter} option}
  }
  % \glsentrycountertrue
  \gcmd{gls\-entry\-count\-er\-true}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglsentrycounter} to true}
  }
  % \glsentrycounterfalse
  \gcmd{gls\-entry\-count\-er\-false}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglsentrycounter} to false}
  }
  % \ifglssubentrycounter
  \gcond{if\-gls\-sub\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.0+}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{subentrycounter} option}
  }
  % \glssubentrycountertrue
  \gcmd{gls\-sub\-entry\-count\-er\-true}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglssubentrycounter} to true}
  }
  % \glssubentrycounterfalse
  \gcmd{gls\-sub\-entry\-count\-er\-false}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglssubentrycounter} to false}
  }
  % \glsrefentry
  \gcmd{gls\-ref\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{for use with \opt{entrycounter} and \opt{subentrycounter}, 
     this references the value of the \ctr{glossaryentry} or 
     \ctr{glossarysubentry} counter associated with the glossary entry 
     identified by \meta{label}. If \optval{entrycounter}{false}
     and \optval{subentrycounter}{false}, this simply uses \gls{gls}
     otherwise it uses \gls{ref}}
  }
  % \GlsEntryCounterLabelPrefix
  \gcmd{Gls\-Entry\-Count\-er\-Label\-Pre\-fix}
  {
    \providedby{\sty{glossaries} v4.38+}
    \initval{glsentry-}
    \desc{expands to the prefix used by \gls{glsrefentry}}
  }
  % \glsresetentrycounter
  \gcmd{gls\-reset\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{resets \ctr{glossaryentry} back to zero if
      \optval{entrycounter}{true}}
  }
  % \glsresetsubentrycounter
  \gcmd{gls\-reset\-sub\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{resets \ctr{glossarysubentry} back to zero if
      \optval{entrycounter}{true}}
  }
  % \glsstepentry
  \gcmd{gls\-step\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{increments \ctr{glossaryentry} with \gls{refstepcounter} if
      \optval{entrycounter}{true}}
  }
  % \glsstepsubentry
  \gcmd{gls\-step\-sub\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{increments \ctr{glossarysubentry} with \gls{refstepcounter} if
      \optval{subentrycounter}{true}}
  }
  % \theglossaryentry
  \gcmd{the\-glossary\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the value of the \ctr{glossaryentry} counter}
    \note{requires \optval{entrycounter}{true}}
  }
  % \glsentrycounterlabel
  \gcmd{gls\-entry\-count\-er\-label}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the formatted value of the \ctr{glossaryentry} counter
     or does nothing if \optval{entrycounter}{false}}
  }
  % \theglossarysubentry
  \gcmd{the\-glossary\-sub\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the value of the \ctr{glossarysubentry} counter}
    \note{requires \optval{subentrycounter}{true}}
  }
  % \glssubentrycounterlabel
  \gcmd{gls\-sub\-entry\-count\-er\-label}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the formatted value of the \ctr{glossarysubentry} counter
     or does nothing if \optval{subentrycounter}{false}}
  }
  % \glsentryitem
  \gcmd{gls\-entry\-item}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{used for \toplevel\ entries in \idxpl{glossarystyle} to
     increment and display the entry counter if \optval{entrycounter}{true}}
  }
  % \glssubentryitem
  \gcmd{gls\-sub\-entry\-item}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{used for \hierlevel{1} entries in 
    \idxpl{glossarystyle} to increment and display the sub-entry counter 
    if \optval{subentrycounter}{true}}
  }
  % \ifglsindexonlyfirst
  \gcond{if\-gls\-index\-only\-first}
  {
    \providedby{\sty{glossaries} v3.02+}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{indexonlyfirst} option}
  }
  % \glsindexonlyfirsttrue
  \gcmd{gls\-index\-only\-first\-true}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsindexonlyfirst} to true}
  }
  % \glsindexonlyfirstfalse
  \gcmd{gls\-index\-only\-first\-false}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsindexonlyfirst} to false}
  }
  % \GlsDeclareNoHyperList
  \gcmd{GlsDeclareNoHyperList}
  {
    \providedby{\sty{glossaries} v3.05+}
    \syntax{\margm{list}}
    \desc{identifies the list of \idxpl{glossary} that should have
     \idxpl{hyperlink} suppressed}
  }
  % \DeclareAcronymList
  \gcmd{Declare\-Acronym\-List}
  {
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{list}}
    \desc{identifies the list of \idxpl{glossary} as lists of acronyms}
  }
  % \glsIfListOfAcronyms
  \gcmd{glsIfListOfAcronyms}
  {
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{glossary-label}\margm{true}\margm{false}}
    \desc{does \meta{true}, if the \meta{glossary-label} has been
    identified as a list of acronyms}
  }
  % \SetAcronymLists
  \gcmd{Set\-Acronym\-Lists}
  {
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{list}}
    \desc{sets the list of \idx{acronym} lists (overriding any that have
     previously been identified)}
    \field{seealso}{DeclareAcronymList,opt.acronymlists}
  }
  % \DefineAcronymSynonyms
  \gcmd{Define\-Acronym\-Synonyms}
  {
    \providedby{\sty{glossaries} v2.04+}
    \desc{provides the shortcut commands for \idxpl{acronym}}
    \field{seealso}{opt.shortcuts}
  }
  % \glsdisablehyper
  \gcmd{gls\-disable\-hyper}
  {
    \providedby{\sty{glossaries}}
    \desc{disables \idxpl{hyperlink} (may be scoped to localise the effect)}
  }
  % \glsenablehyper
  \gcmd{gls\-enable\-hyper}
  {
    \providedby{\sty{glossaries}}
    \desc{enables \idxpl{hyperlink} (may be scoped to localise the effect)}
    \note{requires \sty{hyperref}}
  }
  % COMMANDS: REFERENCING ENTRIES
  % \gls
  \gcmdsp{gls}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced depends on whether or not this is the \idx{firstuse}.
    The \meta{insert} argument may be inserted at the end of the
    \idx{linktext} or may be inserted at a different point (for
    example, after the long form on \idx{firstuse} for some
    \idx{acronym} or \idx{abbreviation}
    styles. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Gls
  \gcmdsp{Gls}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{gls} but converts the \idx{linktext} to \idx{sentencecase}}
  }
  % \GLS
  \gcmdsp{GLS}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{gls} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glspl
  \gcmdsp{glspl}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{gls} but uses the relevant plural form}
  }
  % \Glspl
  \gcmdsp{Glspl}{%
    \common
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glspl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSpl
  \gcmdsp{GLSpl}{%
    \common
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glspl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsdisp
  \gcmdsp{gls\-disp}{%
    \providedby{\sty{glossaries} v1.19+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{references the entry identified by \meta{entry-label} with the
     given \meta{text} as the \idx{linktext}. This command unsets the
    \idx{firstuseflag} (use \gls{glslink} instead, if the
    \idx{firstuseflag} should not be altered).
    This command is considered a \gls{glslike} command.
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glsdisp
  \gcmdsp{Glsdisp}{%
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{as \gls{glsdisp} but converts \meta{text} to
    \idx{sentencecase}}
  }
  % \glslink
  \gcmdsp{gls\-link}{%
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{references the entry identified by \meta{entry-label} with the
     given \meta{text} as the \idx{linktext}. This command does not
     alter or depend on the \idx{firstuseflag} (use \gls{glsdisp} instead, if the
    \idx{firstuseflag} needs to be unset).
    This command is considered a \gls{glstextlike} command.
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glslink
  \gcmdsp{Glslink}{%
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{as \gls{glslink} but converts \meta{text} to
    \idx{sentencecase}}
  }
  % \glsname
  \gcmdsp{gls\-name}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{name} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see \idxpl{glsopt}.
    Use \gls{glossentryname} within custom glossary styles
    instead of this command}
  }
  % \Glsname
  \gcmdsp{Gls\-name}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsname} but converts the \idx{linktext} to 
    \idx{sentencecase}. Use \gls{Glossentryname} within custom glossary styles
    instead of this command}
  }
  % \GLSname
  \gcmdsp{GLS\-name}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsname} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsdesc
  \gcmdsp{gls\-desc}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{description} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}. Use \gls{glossentrydesc} within custom glossary styles
    instead of this command}
  }
  % \Glsdesc
  \gcmdsp{Gls\-desc}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdesc} but converts the 
    \idx{linktext} to \idx{sentencecase}. Use 
    \gls{Glossentrydesc} within custom glossary styles
    instead of this command}
  }
  % \GLSdesc
  \gcmdsp{GLS\-desc}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdesc} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsdescplural
  \gcmdsp{gls\-desc\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdesc} but for the \gloskey{descriptionplural} field}
  }
  % \Glsdescplural
  \gcmdsp{Gls\-desc\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdescplural} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSdescplural
  \gcmdsp{GLS\-desc\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdescplural} but converts the 
    \idx{linktext} to \idx{allcaps}}
  }
  % \glssymbol
  \gcmdsp{gls\-symbol}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{symbol} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}. Use \gls{glossentrysymbol} within custom glossary styles
    instead of this command}
  }
  % \Glssymbol
  \gcmdsp{Gls\-symbol}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbol} but converts the 
    \idx{linktext} to \idx{sentencecase}. Use 
    \gls{Glossentrysymbol} within custom glossary styles
    instead of this command}
  }
  % \GLSsymbol
  \gcmdsp{GLS\-symbol}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbol} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glssymbolplural
  \gcmdsp{gls\-symbol\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbol} but for the \gloskey{symbolplural} field}
  }
  % \Glssymbolplural
  \gcmdsp{Gls\-symbol\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbolplural} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSsymbolplural
  \gcmdsp{GLS\-symbol\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbolplural} but converts the 
    \idx{linktext} to \idx{allcaps}}
  }
  % \glstext
  \gcmdsp{gls\-text}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{text} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrshort} for the short form (or
    \gls{glsxtrshort} with \sty{glossaries-extra}).
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glstext
  \gcmdsp{Gls\-text}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glstext} but converts the first character of the
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLStext
  \gcmdsp{GLS\-text}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glstext} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsplural
  \gcmdsp{gls\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{plural} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrshortpl} (or \gls{glsxtrshortpl}
    with \sty{glossaries-extra}) instead}
  }
  % \Glsplural
  \gcmdsp{Gls\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsplural} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSplural
  \gcmdsp{GLS\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsplural} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsfirst
  \gcmdsp{gls\-first}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{first} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrfull} (or \gls{glsxtrfull} 
    with \sty{glossaries-extra})
    for the full form or \gls{acrlong} (or \gls{glsxtrlong} with
    \sty{glossaries-extra}) for the long form instead}
  }
  % \Glsfirst
  \gcmdsp{Gls\-first}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirst} but converts \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSfirst
  \gcmdsp{GLS\-first}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirst} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsfirstplural
  \gcmdsp{gls\-first\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{firstplural} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrfullpl} (or \gls{glsxtrfullpl} with
    \sty{glossaries-extra}) for the full form or \gls{acrlongpl} 
    (or \gls{glsxtrlongpl} with \sty{glossaries-extra}) for the long form instead.
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glsfirstplural
  \gcmdsp{Gls\-first\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirstplural} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSfirstplural
  \gcmdsp{GLS\-first\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirstplural} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsuseri
  \gcmdsp{gls\-useri}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user1} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuseri
  \gcmdsp{Gls\-useri}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseri} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuseri
  \gcmdsp{GLS\-useri}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseri} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuserii
  \gcmdsp{gls\-userii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user2} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuserii
  \gcmdsp{Gls\-userii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserii} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuserii
  \gcmdsp{GLS\-userii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserii} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuseriii
  \gcmdsp{gls\-useriii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user3} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuseriii
  \gcmdsp{Gls\-useriii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriii} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuseriii
  \gcmdsp{GLS\-useriii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriii} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuseriv
  \gcmdsp{gls\-useriv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user4} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuseriv
  \gcmdsp{Gls\-useriv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriv} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuseriv
  \gcmdsp{GLS\-useriv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriv} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuserv
  \gcmdsp{gls\-userv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user5} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuserv
  \gcmdsp{Gls\-userv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserv} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuserv
  \gcmdsp{GLS\-userv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserv} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuservi
  \gcmdsp{gls\-uservi}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user6} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuservi
  \gcmdsp{Gls\-uservi}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuservi} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuservi
  \gcmdsp{GLS\-uservi}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuservi} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glshyperlink
  \gcmd{gls\-hyper\-link}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\oargm{text}\margm{entry-label}}
     \desc{creates a hyperlink to the given entry with the hyperlink
      text provided in the optional argument. If omitted, the default is
      \code{\gls{glsentrytext}\margm{entry-label}}}
  } 
  % COMMANDS: INDEXING
  % \glsadd
  \gcmd{gls\-add}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}}
    \desc{indexes the entry identified by \meta{entry-label}}
  }
  % \glsaddall
  \gcmd{gls\-add\-all}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}}
    \desc{iterates over all non-\idxpl{ignoredglossary} (or all those
    listed in the \glsopt{types} option)
    and \idxc{indexing}{indexes} each entry in the \idx{glossary}. The optional
    argument \meta{options} are passed to \gls{glsadd}.
    This command can't be used with \app{bib2gls}. Use the
    \resourceoptval{selection}{all} \idx{resourceopt} instead}
  }
  % \glsaddallunused
  \gcmd{gls\-add\-all\-unused}
  {%
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\oargm{glossary types}}
    \desc{iterates over all \idxpl{glossary} listed in
     \meta{glossary types} (all all non-\idxpl{ignoredglossary} if
     omitted) and \idxc{indexing}{indexes} each entry
     (with \glsoptval{format}{\encap{glsignore}}) that hasn't been used.
    This command can't be used with \app{bib2gls}. Use the
    \resourceoptval{selection}{all} \idx{resourceopt} instead}
  }
  % \glsaddeach
  \gcmd{gls\-add\-each}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\oargm{options}\margm{entry label list}}
     \desc{does \code{\gls{glsadd}\oargm{options}\margm{entry-label}} for each label
       in the supplied comma-separated list}
  }
  % \glsstartrange
  \gcmd{gls\-start\-range}
  {
    \providedby{\sty{glossaries-extra} v1.50+}
    \syntax{\oargm{options}\margm{entry label list}}
    \desc{essentially does
\code{\gls{glsaddeach}\oarg{\meta{options},\glsoptval{format}{\sym{startrange}\meta{encap}}}\margm{entry label
list}}
where \meta{encap} can either be provided by the \glsopt{format} key
in \meta{options}}
  }
  % \glsendrange
  \gcmd{gls\-end\-range}
  {
    \providedby{\sty{glossaries-extra} v1.50+}
    \syntax{\oargm{options}\margm{entry label list}}
    \desc{as \gls{glsstartrange} but with the end range marker
    \sym{endrange}}
  }
  % \glssee
  \gcmd{gls\-see}
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\oargm{tag}\margm{entry-label}\margm{xr-list}}
    \desc{indexes the \idx{entry} identified by \meta{entry-label} as a
     general cross-reference to the \idxpl{entry} identified in the comma-separated
     list \meta{xr-list}. The optional argument is the textual tag
     that's inserted before the cross-reference list and defaults to
     \gls{seename}}
  }
  % \glsseeformat
  \gcmd{gls\-see\-format}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\oargm{tag}\margm{xr-list}\margm{location}}
    \desc{used to format the \gloskey{see} cross-reference in the
     \idx{locationlist}. This requires a \location\ argument for
      \app{makeindex} even though it isn't required. The default
      definition is \code{\csfmt{emph}\margm{tag} \gls{glsseelist}\margm{xr-list}}}
  }
  % \glsseelist
  \gcmd{gls\-see\-list}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{label-list}}
    \desc{iterates over a comma-separated list of entry labels
     \meta{label-list} and formats them. Each label in the list is
     encapsulated with \gls{glsseeitem}. The separators are
     \gls{glsseelastsep} (between the penultimate and last items)
     and \gls{glsseesep} (between all the other items)}
  }
  % \glsseeitem
  \gcmd{gls\-see\-item}
  {
    \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{entry-label}}
     \desc{used by \gls{glsseelist} to format each \idx{entry} item. 
     This adds a \idx{hyperlink}, if enabled, to the appropriate
     \idx{entryline} in the \idx{glossary} with the text obtained
     with \gls{glsseeitemformat}}
  }
  % \glsseeitemformat
  \gcmd{gls\-see\-item\-format}
  {
     \providedby{\sty{glossaries} v3.0+}
     \syntax{\margm{entry-label}}
     \desc{used by \gls{glsseeitem} to produce the \idx{hyperlink} text}
  }
  % \glsseesep
  \gcmd{gls\-see\-sep}
  {
    \providedby{\sty{glossaries} v1.17+}
    \initval{,\sym{vbsp}}
    \desc{used by \gls{glsseelist} as a separator between each \idx{entry}
     except the last pair}
  }
  % \glsseelastsep
  \gcmd{gls\-see\-last\-sep}
  {
    \providedby{\sty{glossaries} v1.17+}
    \initval{,\sym{vbsp}}
    \desc{used by \gls{glsseelist} as a separator between the final pair}
  }
  % COMMANDS: INDEXING INITIALISATION
  % \writeist
  \gcmd{write\-ist}
  {
    \providedby{\sty{glossaries}}
    \desc{writes the \app{makeindex}\slash\app{xindy} style file.
    This command is used by \gls{makeglossaries} and then disabled}
  }
  % \GlsSetWriteIstHook
  \gcmd{Gls\-Set\-Write\-Ist\-Hook}
  {
    \providedby{\sty{glossaries} v4.24+}
    \syntax{\margm{code}}
    \desc{adds \meta{code} to the \idx{indexing} style file}
  }
  % \glswrite
  \gcmd{gls\-write}
  {
     \desc{the write register used to create the \idx{indexing} style file}
  }
  % \setStyleFile
  \gcmd{set\-Style\-File}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{name}}
    \desc{sets the file name of the \app{makeindex} or \app{xindy}
    style file that's created by \gls{makeglossaries}}
  }
  % \glsSetCompositor
  \gcmd{gls\-Set\-Compositor}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{character}}
    \desc{sets the location \idx{compositor} for the \idx{indexing} style file created by
     \gls{makeglossaries}}
  }
  % \glsSetAlphaCompositor
  \gcmd{gls\-Set\-Alpha\-Compositor}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{character}}
    \desc{sets the \idx{compositor} for \locations\ that start with
     an \idx{uppercase} alphabetical character}
    \note{\app{xindy} only}
  }
  % \GlsSetQuote
  \gcmd{Gls\-Set\-Quote}
  {
    \providedby{\sty{glossaries} v4.24+}
    \syntax{\margm{character}}
    \desc{set \app{makeindex}['s] quote character (used for escaping
    special characters) to \meta{character}}
    \note{\app{makeindex} only}
  }
  % \glsprestandardsort
  \gcmd{gls\-pre\-standard\-sort}
  {
    \providedby{\sty{glossaries} v3.13a+}
    \syntax{\margm{sort cs}\margm{type}\margm{entry-label}}
    \desc{hook used with \opteqvalref{sort}{standard} to adjust the
     default sort value (with \gls{makeglossaries} or
     \gls{makenoidxglossaries} only)}
  }
  % \glsdosanitizesort
  \gcmd{gls\-do\-sanitize\-sort}
  {
    \desc{sanitizes the sort value if \optval{sanitizesort}{true}}
    \note{only available with \opteqvalref{sort}{standard}}
  }
  % \glssortnumberfmt
  \gcmd{gls\-sort\-number\-fmt}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{number}}
    \desc{expands to the given \meta{number} zero-padded to six digits}
  }
  % \noist
  \gcmd{no\-ist}
  {
    \providedby{\sty{glossaries}}
    \desc{prevents \gls{makeglossaries} from creating the default
    \idx{indexingapp} style file}
  }
  % \makeglossaries
  \gcmd{make\-glossaries}%
  {%
    \providedby{\sty{glossaries}}
    \desc{opens the associated \idxpl{indexingfile} that need to be
     processed by \app+{makeindex} or \app+{xindy}. This command has
     an optional argument with \sty{glossaries-extra}}
    \note{\options{mkidx,xdy} only}
  }
  % \makenoidxglossaries
  \gcmd{make\-noidx\-glossaries}%
  {%
    \providedby{\sty{glossaries} v4.04+}
    \desc{sets up all non-\idxpl{ignoredglossary} so that they can be displayed
    with \gls{printnoidxglossary}}
    \note{\option{noidx} only}
  } 
  % \GlsSetXdyLanguage
  \gcmd{Gls\-Set\-Xdy\-Language}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\oargm{glossary-type}\margm{language}}
     \desc{sets the \app{xindy} language for the given
     \idx{glossary}. This information is written to the \ext{aux} file
     for \app{makeglossaries} to pick up. It has no effect if \app{xindy}
     is called explicitly}
    \note{\app{xindy} \& \app{makeglossaries} only}
  }
  % \GlsSetXdyCodePage
  \gcmd{Gls\-Set\-Xdy\-Code\-Page}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{codepage}}
     \desc{sets the \app{xindy} \idx{codepage}. 
     This information is written to the \ext{aux} file
     for \app{makeglossaries} to pick up. It has no effect if \app{xindy}
     is called explicitly}
    \note{\app{xindy} \& \app{makeglossaries} only}
  }
  % \GlsAddLetterGroup
  \gcmd{Gls\-Add\-Letter\-Group}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{name}\margm{xindy code}}
     \desc{adds a new \app{xindy} letter \idx{group}, identified by
     \meta{name} and defined by \meta{xindy code}. This information
     is written to the \ext{xdy} file that's created by
     \gls{makeglossaries}}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyCounters
  \gcmd{Gls\-Add\-Xdy\-Counters}
  {
     \providedby{\sty{glossaries} v3.0+}
     \syntax{\margm{counter list}}
     \desc{identifies all the \idxpl{locationcounter} required in
     the document}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyAttribute
  \gcmd{Gls\-Add\-Xdy\-Attribute}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{name}}
    \desc{adds the \idxpl{xindyattr} associated with \meta{name} to the
    \ext{xdy} style file}
    \note{\app{xindy} only}
  }
  % \glsX<counter>X<format>
  \gcmdmetameta{glsX}{counter}{X}{format}{}%
  {%
     \syntax{\margm{H-prefix}\margm{location}}
     \desc{used with \app{xindy} for location formats}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyLocation
  \gcmd{Gls\-Add\-Xdy\-Location}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\oargm{H-prefix}\margm{name}\margm{definition}}
    \desc{adds the given location syntax to the \ext{xdy} style file}
    \note{\app{xindy} only}
  }
  % \GlsSetXdyLocationClassOrder
  \gcmd{Gls\-Set\-Xdy\-Location\-Class\-Order}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{location names}}
    \desc{may be used to change the ordering of location class names}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyStyle
  \gcmd{Gls\-Add\-Xdy\-Style}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{style-name}}
    \desc{adds a required \app{xindy} file to the \ext{xdy} style file}
    \note{\app{xindy} only}
    \field{seealso}{GlsSetXdyStyles}
  }
  % \GlsSetXdyStyles
  \gcmd{Gls\-Set\-Xdy\-Styles}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{style name list}}
    \desc{resets the list of required \app{xindy} files}
    \note{\app{xindy} only}
    \field{seealso}{GlsAddXdyStyle}
  }
  % \GlsSetXdyFirstLetterAfterDigits
  \gcmds{Gls\-Set\-Xdy\-First\-Letter\-After\-Digits}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{letter}}
    \desc{identifies the first letter \idx{group} to occur after the number group}
    \note{\app{xindy} only}
  }
  % \GlsSetXdyNumberGroupOrder
  \gcmds{Gls\-Set\-Xdy\-Number\-Group\-Order}
  {
    \providedby{\sty{glossaries} v4.33+}
    \syntax{\margm{relative location}}
    \desc{sets the relative location of the number \idx{group}}
    \note{\app{xindy} only}
  }
  % \glsopenbrace
  \gcmd{gls\-open\-brace}
  {
     \desc{expands to \sym+{bg} (a literal open brace)}
  }
  % \glsclosebrace
  \gcmd{gls\-close\-brace}
  {
     \desc{expands to \sym+{eg} (a literal closing brace)}
  }
  % \glsbackslash
  \gcmd{gls\-back\-slash}
  {
     \providedby{\sty{glossaries} v4.11+}
     \desc{expands to \sym+{bksl} (a literal backslash)}
  }
  % \glspercentchar
  \gcmd{gls\-per\-cent\-char}
  {
     \providedby{\sty{glossaries} v4.10+}
     \desc{expands to \sym+{pc} (a literal percent character)}
  }
  % \glstildechar
  \gcmd{gls\-tilde\-char}
  {
     \providedby{\sty{glossaries} v4.10+}
     \desc{expands to \sym+{tilde} (a literal tilde character)}
  }
  % \glsquote
  \gcmd{gls\-quote}
  {
     \providedby{\sty{glossaries}}
     \syntax{\margm{text}}
     \desc{expands to \sym{dblquote}\meta{text}\sym{dblquote}, where
     the \sym{dblquote} is a literal character}
  }
  % \GlsSetXdyMinRangeLength
  \gcmd{Gls\-Set\-Xdy\-Min\-Range\-Length}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{value}}
     \desc{sets the minimum number of consecutive \locations\ to
      form an implicit \idx{range}. The value may be \qt{none} to
      indicate no \idx{range} formation}
    \note{\app{xindy} only}
  }
  % \glsSetSuffixF
  \gcmd{gls\-Set\-SuffixF}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{suffix}}
     \desc{the suffix for two consecutive locations}
  }
  % \glsSetSuffixFF
  \gcmd{gls\-Set\-SuffixFF}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{suffix}}
     \desc{the suffix for three or more consecutive locations}
  }
  % \glslocationcstoencap
  \gcmd{gls\-location\-cs\-to\-encap}
  {
     \providedby{\sty{glossaries} v4.50+}
     \syntax{\margm{encap-csname}\margm{location-csname}}
     \desc{used by \app{makeglossaries} when repairing problematic
     locations with \app{makeindex}}
  }
  % \ifglswrallowprimitivemods
  \gcond{if\-gls\-wr\-allow\-primitive\-mods}
  {
    \providedby{\sty{glossaries} v4.22+}
    \initval{\csfmt{iffalse}}
    \desc{if \optval{esclocations}{true} and this conditional is
    true, then some primitives will be locally redefined while
    \idx{indexing} occurs in order to escape special characters in the
    location without prematurely expanding \gls{thepage}}
  }
  % \glswrallowprimitivemodstrue
  \gcmd{gls\-wr\-allow\-primitive\-mods\-true}
  {
    \desc{sets \gls{ifglswrallowprimitivemods} to true}
  }
  % \glswrallowprimitivemodsfalse
  \gcmd{gls\-wr\-allow\-primitive\-mods\-false}
  {
    \desc{sets \gls{ifglswrallowprimitivemods} to false}
  }
  % \glossaryentry
  \gcmd{glossary\-entry}
  {
    \syntax{\margm{data}\margm{location}}
    \desc{this isn't actually defined as a command but is used 
     as a keyword for \app{makeindex}}
  }
  % \glswrglossdisableanchorcmds
  \gcmd{gls\-wr\-gloss\-disable\-anchor\-cmds}
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{hook used to locally disable problematic commands whilst
     constructing the anchor for \gls{glshypernumber}}
  }
  % \glswrglosslocationtarget
  \gcmd{gls\-wr\-gloss\-location\-target}
  {
     \providedby{\sty{glossaries} v4.50+}
     \syntax{\margm{location}}
     \desc{must be expandable. May be used to alter the location
      suffix whilst constructing the anchor for \gls{glshypernumber}}
  }
  % \glswrglosslocationtextfmt
  \gcmd{gls\-wr\-gloss\-location\-text\-fmt}
  {
     \providedby{\sty{glossaries} v4.50+}
     \syntax{\margm{location}}
     \desc{used to encapsulate the location in the \idx{hyperlink}
      text for \gls{glshypernumber}}
  }
  % \glswrglossdisablelocationcmds
  \gcmd{gls\-wr\-gloss\-disable\-location\-cmds}
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{hook used to locally disable problematic commands whilst
     writing the location to the \idx{indexingfile} with
     \options{mkidx,xdy}}
  }
  % COMMANDS: FORMATTING
  % \glstextformat
  \gcmd{gls\-text\-format}
  {
    \providedby{\sty{glossaries} v1.04+}
    \syntax{\margm{text}}
    \desc{used by the \gls{glslike} and \gls{glstextlike} commands 
     to format the \idx{linktext}}
  }
  % \glsentryfmt
  \gcmd{gls\-entry\-fmt}
  {
    \providedby{\sty{glossaries} v3.11a+}
     \desc{the default display format used by the \gls{glslike}
      commands. This command is redefined by the
     \sty{glossaries-extra} package}
    \field{seealso}{glsgenentryfmt,defglsentryfmt}
  }
  % \defglsentryfmt
  \gcmd{def\-gls\-entry\-fmt}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\oargm{glossary-type}\margm{definition}}
    \desc{defines the display format used by the \gls{glslike}
      commands for entries assigned to the glossary identified by
      \meta{glossary-type} (\gls{glsdefaulttype} if omitted)}
  }
  % \glsgenentryfmt
  \gcmd{gls\-gen\-entry\-fmt}
  {
    \providedby{\sty{glossaries} v3.11a+}
     \desc{the generic display format used by the \gls{glslike}
      commands}
  }
  % \glsgenacfmt
  \gcmd{gls\-gen\-ac\-fmt}
  {
    \providedby{\sty{glossaries} v4.02a+}
     \desc{the generic \idx{acronym} display \idxc{acronymformat}{format} 
     used by the \gls{glslike} commands}
  }
  % \glslabel
  \gcmd{gls\-label}
  {
    \providedby{\sty{glossaries} v1.15+}
     \desc{placeholder command that expands to the entry label}
    \field{seealso}{glsentryfmt,glsifplural,glscapscase,glsinsert,glscustomtext,glstype}
  }
  % \glstype
  \gcmd{gls\-type}
  {
    \providedby{\sty{glossaries} v4.08+}
     \desc{placeholder command that expands to the entry's \idx{glossary} type}
    \field{seealso}{glslabel}
  }
  % \glscustomtext
  \gcmd{gls\-custom\-text}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \desc{placeholder command that expands to the text provided in \gls{glsdisp}}
    \field{seealso}{glsentryfmt,glslabel,glsifplural,glscapscase,glsinsert}
  }
  % \glsinsert
  \gcmd{gls\-insert}
  {
    \providedby{\sty{glossaries} v3.11a+}
     \desc{placeholder command that expands to the \meta{insert}
      final optional argument of the \gls{glslike} commands}
    \field{seealso}{glsentryfmt,glslabel,glsifplural,glscapscase,glscustomtext}
  }
  % \glsifplural
  \gcmd{gls\-if\-plural}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{true}\margm{false}}
    \desc{defined by the \gls{glslike} commands to expand to 
     \meta{true} if the calling command was a plural form (for
      example, \gls{glspl}) and to \meta{false} for the other
      commands}
    \field{seealso}{glsentryfmt,glslabel,glscapscase,glsinsert,glscustomtext}
  }
  % \glscapscase
  \gcmd{gls\-caps\-case}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{no change}\margm{sentence}\margm{all caps}}
    \desc{defined by the \gls{glslike} commands to expand to 
     \meta{no change} if the calling command wasn't a \casechanging\
     command (\gls{gls} or \gls{glspl}), to
      \meta{sentence} for \idx{sentencecase} commands (\gls{Gls} or
      \gls{Glspl}) or to \meta{all caps} for \idx{allcaps} commands
      (\idx{GLS} or \idx{GLSpl})}
    \field{seealso}{glsentryfmt,glslabel,glsifplural,glsinsert,glscustomtext}
  }
  % \glsifhyperon
  \gcmd{gls\-if\-hyper\-on}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{true}\margm{false}}
    \desc{defined by the \gls{glslike} commands to expand to 
     \meta{true} if the \idx{hyperlink} setting is on for the
     current reference. Otherwise it expands to \meta{false}}
    \field{seealso}{glsentryfmt,glslinkvar}
  }
  % \glslinkvar
  \gcmd{gls\-link\-var}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{unmodified}\margm{star case}\margm{plus case}}
    \desc{defined by the \gls{glslike} commands test if the
    unmodified, starred (\sym{starmod}) or plus (\sym{plusmod}) command
    was used}
    \field{seealso}{glsentryfmt,glslinkvar}
  }
  % \glsxtrifwasfirstuse
  \gxtrcmd{gls\-xtr\-if\-was\-first\-use}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{true}\margm{false}}
     \desc{initialised by the \gls{glslike}
     and \gls{glstextlike} commands, this expands to \meta{true} if
     the calling command was considered the \idx{firstuse},
     otherwise it expands to \meta{false}. This command may be used
     within the \idx{postlinkhook} (where it's too late to test the
     \idx{firstuseflag} with \gls{ifglsused})}
  }
  % COMMANDS: HOOKS
  % \glslinkcheckfirsthyperhook
  \gcmd{gls\-link\-check\-first\-hyper\-hook}
  {
    \providedby{\sty{glossaries} v4.08+}
    \desc{hook used when checking whether or not to switch off
    \idxpl{hyperlink} on \idx{firstuse}}
  }
  % \glswriteentry
  \gcmd{glswriteentry}
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{label}\margm{indexing code}}
    \desc{does \meta{indexing code} unless
    \optval{indexonlyfirst}{true} and the entry identified by
    \meta{label} has been marked as \glslink{firstuseflag}{used}}
  }
  % \glslinkpostsetkeys
  \gcmd{gls\-link\-post\-set\-keys}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \desc{hook implemented after setting the options passed to the
      \gls{glslike} and \gls{glstextlike} commands}
  }
  % \glslinkpresetkeys
  \gxtrcmd{gls\-link\-pre\-set\-keys}
  {%
    \providedby{\sty{glossaries-extra} v1.26+}
    \desc{hook implemented before setting the options passed to the
      \gls{glslike} and \gls{glstextlike} commands}
  }
  % \glspostlinkhook
  \gcmd{gls\-post\-link\-hook}{%
   \providedby{\sty{glossaries} v4.16}
    \desc{a \idx{postlinkhook} used after all the \gls{glslike} and
    \gls{glstextlike} commands. This is redefined by
    \sty{glossaries-extra} to use \gls{glsxtrpostlinkhook}}
  }   
  % \glsxtrpostlinkhook
  \gxtrcmd{gls\-xtr\-post\-link\-hook}{%
   \providedby{\sty{glossaries-extra} v1.0+}% 
   \desc{an additional \idx{postlinkhook} that supports categories}
  }
  % \glsxtrpostlinkAddSymbolOnFirstUse
  \gxtrcmd{gls\-xtr\-post\-link\-Add\-Symbol\-On\-First\-Use}{%
    \providedby{\sty{glossaries-extra}}%
    \desc{may be used within a \idx{postlinkhook} to display the
    symbol in parentheses on \idx{firstuse}}
  }
  % \glsdefpostlink
  \gcmd{gls\-def\-post\-link}{%
    \syntax{\margm{category}\margm{definition}}
    \providedby{\sty{glossaries-extra} v1.31+}%
    \desc{defines \idx{postlinkhook} associated with the category
    identified by the label \meta{category}}
  } 
  % \glswritedefhook
  \gcmd{gls\-write\-def\-hook}
  {
   \providedby{\sty{glossaries} v3.10a}
    \desc{hook used when writing entries to the \ext+{glsdefs} file
    after all the \keyval\ information has been written and before the
    end brace that closes the final argument of \gls{glsdefs@newdocentry}}
  }
  % COMMANDS: REFERENCING ENTRIES - extra
  % \GlsXtrSetAltModifier
  \gxtrcmd{Gls\-Xtr\-Set\-Alt\-Modifier}
  {
    \syntax{\margm{token}\margm{options}}
    \desc{sets \meta{token} as a modifier for the \gls{glslike} and
    \gls{glstextlike} commands that will automatically implement the
    given options}
  }
  % \GlsXtrSetStarModifier
  \gcmd{Gls\-Xtr\-Set\-Star\-Modifier}
  { 
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{options}}
    \desc{overrides the options that should be implemented by the
     star (\code{*}) modifier for \gls{glslike} and
    \gls{glstextlike} commands}
  }
  % \GlsXtrSetPlusModifier
  \gcmd{Gls\-Xtr\-Set\-Plus\-Modifier}
  {
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{options}}
    \desc{overrides the options that should be implemented by the
     plus (\code{+}) modifier for \gls{glslike} and
    \gls{glstextlike} commands}
  }
  % \glsxtrp
  \gxtrcmd{gls\-xtrp}%
  {%
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{field}\margm{entry-label}}
    \desc{for use in headings and captions (instead of the
     \gls{glslike} or \gls{glstextlike} commands). This command is
      designed to expand to the field value if used in a
      \idx{PDFbookmark} and can also expand to a more appropriate command if
      it ends up in the page header. Note that there's no option
      argument}
  }
  % \glsps
  \gxtrcmd{gls\-ps}
  { 
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{entry-label}}
    \desc{shortcut for \code{\gls{glsxtrp}\marg{short}\margm{entry-label}}}
  }
  % \glspt
  \gxtrcmd{gls\-pt}
  {%
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{entry-label}}
    \desc{shortcut for \code{\gls{glsxtrp}\marg{text}\margm{entry-label}}}
  }
  % \glsxtrfmt
  \gxtrcmd{gls\-xtr\-fmt}{%
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{behaves like
\code{\gls{glslink}\oargm{options}\margm{entry-label}\marg{\cmd{\meta{csname}}\margm{text}\meta{insert}}}
     where the control sequence name \meta{csname} is obtained from
     a designated field}
  }
  % \GlsXtrFmtField
  \gxtrcmd{Gls\-Xtr\-Fmt\-Field}{%
    \providedby{\sty{glossaries-extra} v1.12+}
    \initval{\code{useri}}
    \desc{expands to the name of the \idxc{internalfieldlabel} used by \gls{glsxtrfmt}}
  }
  % \glsxtrnewgls
  \gxtrcmd{gls\-xtr\-new\-gls}
  {
     \providedby{\sty{glossaries-extra} v1.21+}
     \syntax{\oargm{default-options}\margm{prefix}\margm{cs}}
     \desc{defines the command
\meta{cs}\oargm{options}\margm{entry-label} to behave like
      \code{\gls{gls}\oarg{\meta{default-options},\meta{options}}\marg{\meta{prefix}\meta{entry-label}}}}
  }
  % \glsxtrnewglslike
  \gxtrcmd{gls\-xtr\-new\-gls\-like}
  {
     \providedby{\sty{glossaries-extra} v1.21+}
     \syntax{\oargm{default-options}\margm{prefix}\margm{\gls{gls}-like
cs}\margm{\gls{glspl}-like cs}\margm{\gls{Gls}-like cs}\margm{\gls{Glspl}-like cs}}
     \desc{like \gls{glsxtrnewgls} but provides plural and
      \idx{sentencecase} commands as well}
  }
  % \dgls
  \gxtrcmdsp{dgls}{%
    \providedby{\sty{glossaries-extra-bib2gls} v1.37+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{does \code{\gls{gls}\oargm{options}\marg{\meta{prefix}\marg{entry-label}}\oargm{insert}}
     for the first prefix in the prefix list that matches a defined \idx{entry}}
  } 
  % \glsfmttext
  \gxtrcmd{gls\-fmt\-text}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \gloskey{text}}
  }
  % \glsfmtfirst
  \gcmd{gls\-fmt\-first}
  {
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \gloskey{first}}
  } 
  % \glsfmtname
  \gcmd{gls\-fmt\-name}
  {  
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \gloskey{name}}
  }
  % COMMANDS: REFERENCING ENTRIES - no indexing or hyperlinks
  % \glsentrytype
  \gcmd{gls\-entry\-type}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{type} key.
     Does nothing if the entry hasn't been defined}
  } 
  % \glsentrysort
  \gcmd{gls\-entry\-sort}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{sort} key.
     Does nothing if the entry hasn't been defined}
  } 
  % \glsentryname
  \gcmd{gls\-entry\-name}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{name} key.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{name} key doesn't
     contain any fragile commands}
  }
  % \Glsentryname
  \gcmd{Gls\-entry\-name}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{name} field with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryparent
  \gcmd{gls\-entry\-parent}
  {%
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{parent} field.
     Expands to nothing if the \gloskey{parent} field hasn't been set
     and expands to \gls{relax} if the entry hasn't been defined}
  }
  % \glsentrytext
  \gcmd{gls\-entry\-text}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{text} field.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{text} field doesn't
     contain any fragile commands}
  }
  % \Glsentrytext
  \gcmd{Gls\-entry\-text}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{text} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryplural
  \gcmd{gls\-entry\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{plural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{plural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryplural
  \gcmd{Gls\-entry\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{plural} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryfirst
  \gcmd{gls\-entry\-first}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{first} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{first} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryfirst
  \gcmd{Gls\-entry\-first}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{first} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryfirstplural
  \gcmd{gls\-entry\-first\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{firstplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{firstplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryfirstplural
  \gcmd{Gls\-entry\-first\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{firstplural} \idx{field} with \idx{sentencecase}
     applied. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentrydesc
  \gcmd{gls\-entry\-desc}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{description} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{description} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentrydesc
  \gcmd{Gls\-entry\-desc}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{description} \idx{field} with \idx{sentencecase}
     applied. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentrydescplural
  \gcmd{gls\-entry\-desc\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{descriptionplural}
    \idx{field}.  Does nothing if the entry hasn't been defined.
    May be used in expandable contexts provided that the
    \gloskey{descriptionplural} \idx{field} doesn't contain any fragile commands}
  }
  \gcmd{Gls\-entry\-desc\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{descriptionplural} \idx{field} with \idx{sentencecase}
     applied. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryshort
  \gcmd{gls\-entry\-short}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{short} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{short} \idx{field} doesn't
     contain any fragile commands}
  }
  % \glsentryshortpl
  \gcmd{gls\-entry\-short\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{shortplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{shortplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \glsentrylong
  \gcmd{gls\-entry\-long}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{long} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{long} \idx{field} doesn't
     contain any fragile commands}
  }
  % \glsentrylongpl
  \gcmd{gls\-entry\-long\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{longplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{longplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryshort
  \gcmd{Gls\-entry\-short}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{short} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \Glsentrylong
  \gcmd{Gls\-entry\-long}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{long} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \Glsentryshortpl
  \gcmd{Gls\-entry\-short\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{shortplural} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \Glsentrylong
  \gcmd{Gls\-entry\-long\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{longplural} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentrysymbol
  \gcmd{gls\-entry\-symbol}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{symbol} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{symbol} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentrysymbol
  \gcmd{Gls\-entry\-symbol}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{symbol} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentrysymbolplural
  \gcmd{gls\-entry\-symbol\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{symbolplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{symbolplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentrysymbolplural
  \gcmd{Gls\-entry\-symbol\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{symbolplural} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuseri
  \gcmd{gls\-entry\-useri}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user1} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user1} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuseri
  \gcmd{Gls\-entry\-useri}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user1} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuserii
  \gcmd{gls\-entry\-user\-ii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user2} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user2} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuserii
  \gcmd{Gls\-entry\-user\-ii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user2} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuseriii
  \gcmd{gls\-entry\-user\-iii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user3} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user3} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuseriii
  \gcmd{Gls\-entry\-user\-iii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user3} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuseriv
  \gcmd{gls\-entry\-user\-iv}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user4} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user4} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuseriv
  \gcmd{Gls\-entry\-user\-iv}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user4} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuserv
  \gcmd{gls\-entry\-user\-v}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user5} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user5} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuserv
  \gcmd{Gls\-entry\-user\-v}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user5} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuservi
  \gcmd{gls\-entry\-user\-vi}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user6} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user6} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuservi
  \gcmd{Gls\-entry\-user\-vi}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user6} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glossentryname
  \gcmd{gloss\-entry\-name}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{used within \idxpl{glossarystyle} to display the name
    encapsulated with \gls{glsnamefont}}
  }
  % \Glossentryname
  \gcmd{Gloss\-entry\-name}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glossentryname} but \idx{sentencecase}}
  }
  % \glossentrydesc
  \gcmd{gloss\-entry\-desc}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{used within \idxpl{glossarystyle} to display the description}
  }
  % \Glossentrydesc
  \gcmd{Gloss\-entry\-desc}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glossentrydesc} but \idx{sentencecase}}
  }
  % \glossentrysymbol
  \gcmd{gloss\-entry\-symbol}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{used within \idxpl{glossarystyle} to display the symbol}
  }
  % \Glossentrysymbol
  \gcmd{Gloss\-entry\-symbol}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glossentrysymbol} but \idx{sentencecase}}
  }
  % COMMANDS: AUX
  % \@newglossary
  \gcmd{@new\-glossary}
  {
    \syntax{\margm{glossary-label}\margm{log}\margm{out-ext}\margm{in-ext}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The arguments indicate the file extensions associated with the given
    glossary}
  }
  % \glsxtr@makeglossaries
  \gcmd{gls\-xtr\-@\-make\-glos\-saries}
  {
    \providedby{\sty{glossaries-extra} v1.09+}
    \syntax{\margm{label-list}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}}
  }
  % \@istfilename
  \gcmd{@ist\-file\-name}
  {
    \syntax{\margm{filename}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{filename} is the name of the style file}
  }
  % \@glsorder
  \gcmd{@gls\-order}
  {
    \syntax{\margm{order}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{order} should be either \code{letter} or \code{word}}
  }
  % \@xdylanguage
  \gcmd{@xdy\-language}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{glossary-label}\margm{language}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{language} is the language to pass to \app{xindy} for the
    given glossary}
  }
  % \@gls@codepage
  \gcmd{@gls\-@\-code\-page}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{code-page}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{code-page} indicates the \app{xindy} \idx{codepage}}
  }
  % \@gls@reference
  \gcmd{@gls@reference}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{type}\margm{label}\margm{location}}
    \desc{this command is written to the \ext{aux} file to provide
    the information for \gls{printnoidxglossary}}
  }
  % \glsxtr@resource
  \gcmd{glsxtr@resource}
  {
    \providedby{\sty{glossaries-extra} v1.08+}
    \syntax{\margm{options}\margm{basename}}
    \desc{this command is written to the \ext{aux} file to provide
    the resource options for \app{bib2gls}}
  }
  % \glsxtr@record
  \gcmd{glsxtr@record}
  {
    \providedby{\sty{glossaries-extra} v1.08+}
    \syntax{\margm{label}\margm{h-prefix}\margm{counter}\margm{format}\margm{loc}}
    \desc{this command is written to the \ext{aux} file to provide
    the indexing information for \app{bib2gls}}
  }
  % \glsxtr@record@nameref
  \gcmd{glsxtr@record@nameref}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{label}\margm{href prefix}\margm{counter}\margm{format}\margm{location}\margm{title}\margm{href anchor}\margm{href value}}
    \desc{this command is written to the \ext{aux} file to provide
    the indexing information for \app{bib2gls} when the
    \optval{record}{nameref} option is used}
  }
  % \glsxtr@recordsee
  \gcmd{glsxtr@recordsee}
  {
    \providedby{\sty{glossaries-extra} v1.14+}
    \syntax{\margm{label}\margm{xr list}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{glssee} information for \app{bib2gls}}
  }
  % \@glsxtr@newglslike
  \gcmd{@glsxtr@newglslike}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{label-prefix}\margm{cs}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{glsxtrnewglslike} information for \app{bib2gls}}
  }
  % \@glsxtr@altmodifier
  \gcmd{@glsxtr@altmodifier}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{character}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{GlsXtrSetAltModifier} information for \app{bib2gls}}
  }
  % \@glsxtr@prefixlabellist
  \gcmd{@glsxtr@prefixlabellist}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{list}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{dgls} information for \app{bib2gls}}
  }
  % \glsxtr@texencoding
  \gcmd{gls\-xtr\-@\-tex\-encoding}
  {
    \providedby{\sty{glossaries-extra} v1.11+}
    \syntax{\margm{encoding}}
    \desc{this command is written to the \ext{aux} file to provide
    the file \idx{encoding} information for \app{bib2gls}}
  }
  % \glsdefs@newdocentry (.glsdefs file)
  \gcmd{glsdefs@newdocentry}
  {
    \providedby{\sty{glossaries-extra} v4.47+}
    \syntax{\margm{entry-label}\marg{\keyvallist}}
    \desc{this command is written to the \ext+{glsdefs} file to
    define the given \idx{entry} using the definition provided in the
    \env+{document} environment on the previous \LaTeX\ run}
  }
  % COMMANDS: GLOSSARIES
  % \newglossary
  \gcmd{new\-glos\-sary}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{log-ext}\margm{glossary-label}\margm{in-ext}\margm{out-ext}\margm{title}\oargm{counter}}
    \desc{defines a \idx{glossary} identified by \meta{glossary-label} (which can    
    be referenced by the \gloskey{type} key when defining an entry).
    The \meta{title} will be used when displaying the \idx{glossary}
    (using commands like \gls{printglossary}), but this title can be
    overridden by the \printglossopt{title} option. The optional
    \meta{counter} indicates which \idxc{locationcounter}{counter} should be used by default
    for the \location\ when \idx{indexing} any entries that have been assigned to this
    \idx{glossary}. (This can be overridden by the \glsopt{counter}
    option.) The other arguments are file extensions for use with
    \app{makeindex} or \app{xindy}. These arguments aren't relevant
    for other \idx{indexing} options (in which case, you may prefer to use
    \gls{newglossary*})}
  }
  % \newglossary*
  \gcmd{new\-glos\-sary*}%
  {%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{glossary-label}\margm{title}\oargm{counter}}
    \desc{a shortcut that supplies file extensions based on the
    \idx{glossary} label:\begin{compactcodebox}%
\gls{newglossary}\oarg{\meta{glossary-label}-glg}\margm{glossary-label}\marg{\meta{glossary-label}-gls}\margm{\meta{glossary-label}-glo}\margm{title}\oargm{counter}%
\end{compactcodebox}\glsxtrnopostpunc
}
  }
  % \altnewglossary
  \gcmd{alt\-new\-glos\-sary}%
  {%
    \providedby{\sty{glossaries} v2.06+}
    \syntax{\margm{glossary-label}\margm{tag}\margm{title}\oargm{counter}}
    \desc{a shortcut that supplies file extensions based on the
    \meta{tag} argument:\begin{compactcodebox}%
\gls{newglossary}\oarg{\meta{tag}-glg}\margm{tag}\marg{\meta{tag}-gls}\margm{\meta{tag}-glo}\margm{title}\oargm{counter}%
\end{compactcodebox}\glsxtrnopostpunc
}
  }
  % \newignoredglossary
  \gcmd{new\-ignored\-glos\-sary}%
  {%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{glossary-label}}
    \desc{defines a \idx{glossary} that should be ignored by iterative
     commands, such as \gls{printglossaries}. This \idx{glossary} has no
     associated \idxpl{indexingfile} and has \idxpl{hyperlink} disabled. You can
     use an \idx+{ignoredglossary} for common terms or \idxpl{acronym} 
     or \idxpl{abbreviation} that don't need to be included in any listing 
     (but you may want these terms defined
     as entries to allow automated formatting with the \gls{glslike}
     commands). An \idx{ignoredglossary} can't be displayed with
     \gls{printglossary} but may be displayed with the \idx{unsrtfam}, such as
     \gls{printunsrtglossary}. The \sty{glossaries-extra} package
     provides a starred form of this command}
  }
  % \provideignoredglossary
  \gxtrcmds{provide\-ignored\-glos\-sary}
  {
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\margm{glossary-label}}
    \desc{as \gls{newignoredglossary} but does nothing if the
    \idx{glossary} has already been defined}
  }
  % \glossarypostamble
  \gcmd{glossary\-postamble}%
  {%
    \providedby{\sty{glossaries}}
    \desc{used at the end of the \idx{glossary}}
  }
  % \glossarypreamble
  \gcmd{glossary\-preamble}%
  {%
    \providedby{\sty{glossaries}}
    \desc{used at the start of the \idx{glossary}. This will be
    locally redefined to the \idx{glossarypreamble} associated with 
    the current glossary, if one has been set}
    \field{seealso}{setglossarypreamble}
  }
  % \setglossarypreamble
  \gcmd{set\-glossary\-preamble}%
  {%
    \providedby{\sty{glossaries} v3.07+}
    \syntax{\oargm{type}\margm{text}}
    \desc{globally sets the \idx{glossarypreamble} for the \idx{glossary} identified by
    \meta{type} to \meta{text}. If \meta{type} is omitted,
    \gls{glsdefaulttype} is assumed}
  }
  % \apptoglossarypreamble
  \gxtrcmd{app\-to\-glossary\-preamble}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\oargm{type}\margm{text}}
    \desc{locally appends \meta{text} to the \idx{glossarypreamble} for the 
     \idx{glossary} identified by \meta{type}. If \meta{type} is omitted, 
    \gls{glsdefaulttype} is assumed}
  }
  % \pretoglossarypreamble
  \gxtrcmd{pre\-to\-glossary\-preamble}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\oargm{type}\margm{text}}
    \desc{locally prepends \meta{text} to the \idx{glossarypreamble} 
    for the \idx{glossary} identified by \meta{type}. If \meta{type} is omitted,
    \gls{glsdefaulttype} is assumed}
  }
  % \print<...>glossary
  \gcmd{print...glossary}{
    \common
    \name{\csmetafmt{print}{\protect\ldots}{glossary}}
    \field{see}{printglossary,printnoidxglossary,printunsrtglossary,printunsrtinnerglossary}
  }
  % \printglossaries
  \gcmd{print\-glossaries}%
  {%
    \providedby{\sty{glossaries}}
    \desc{iterates over all non-\idxpl{ignoredglossary} and does
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\meta{type}}}}
     for each \idx{glossary}}
  }
  % \printnoidxglossaries
  \gcmd{print\-noidx\-glossaries}%
  {%
    \providedby{\sty{glossaries} v4.04+}
    \desc{iterates over all non-\idxpl{ignoredglossary} and does
     \code{\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\meta{type}}}}
     for each \idx{glossary}}
  }
  % \printunsrtglossaries
  \gxtrcmd{print\-unsrt\-glossaries}%
  {%
    \providedby{\sty{glossaries-extra} v1.08+}
    \desc{iterates over all non-\idxpl{ignoredglossary} and does
     \code{\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\meta{type}}}}
     for each \idx{glossary}}
  }
  % \printunsrtinnerglossary
  \gxtrcmd{print\-unsrt\-inner\-glossary}%
  {%
    \providedby{\sty{glossaries-extra} v1.44+}
    \syntax{\oargm{options}\margm{pre-code}\margm{post-code}}
    \desc{similar to \gls{printunsrtglossary} but doesn't contain
     the code that starts and ends the \idx{glossary} (such as
     beginning and ending the \env{theglossary} environment). See
   the \sty{glossaries-extra} manual for further details}
  }%
  % \printglossary
  \gcmd{print\-glossary}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}}
    \desc{displays the \idx{glossary} by inputting a file created by
     \app+{makeindex} or \app+{xindy}. Must be used with
     \gls{makeglossaries} and either \app{makeindex} or \app{xindy}}
  }%
  % \printacronyms
  \gcmd{print\-acronyms}%
  {%
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\oargm{options}}
    \note{requires the \opt{acronyms} package option}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}}}
  }%
  % \printsymbols
  \gcmd{print\-symbols}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\oargm{options}}
    \note{requires the \opt{symbols} package option}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{symbols}}}}}
  }%
  % \printnumbers
  \gcmd{print\-numbers}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\oargm{options}}
    \note{requires the \opt{numbers} package option}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{numbers}}}}
  }%
  % \printindex
  \gcmd{print\-index}%
  {%
    \syntax{\oargm{options} v4.02+}
    \note{requires  the \opt{index} package option}
    \desc{shortcut provided by the \opt{index} package option that simply does
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{index}}}}
  }%
  % \printnoidxglossary
  \gcmd{print\-noidx\-glossary}%
  {%
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\oargm{options}}
    \desc{displays the \idx{glossary} by obtaining the \idx{indexing} information from
     the \ext+{aux} file and using \TeX\ to sort and collate. Must be used with
     \gls{makenoidxglossaries} or with the \idxpl{glossary} not identified
     in the optional argument of \gls{makeglossaries} when using the
     hybrid method. This method can be very slow and has limitations}
  }%
  % \printunsrtglossary
  \gxtrcmd{print\-unsrt\-glossary}%
  {%
    \providedby{\sty{glossaries-extra} v1.08+}
    \syntax{\oargm{options}}
    \desc{displays the \idx{glossary} by iterating over all entries
     associated with the given \idx{glossary} (in the order in which they
     were added to the \idx{glossary}). \Idx{group} headers will only be
     inserted if the \gloskey{group} key has been defined and has
     been set (typically with the \opt{record} option and
     \app{bib2gls}). \Idxpl{locationlist} will only be shown if the
     \gloskey{location} or \glosfield{loclist} fields have been set
     (typically by \app{bib2gls})}
  }%
  % \printunsrtacronyms
  \gxtrcmd{print\-unsrt\-acronyms}%
  {%
    \providedby{\sty{glossaries-extra-bib2gls} v1.40+}
    \syntax{\oargm{options}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{acronyms},\opt{record}}\marg{glossaries-extra}}}
    \desc{shortcut for
     \code{\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}}}
  }%
  % \printabbreviations
  \gxtrcmd{print\-ab\-bre\-vi\-a\-tions}%
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{abbreviations}}\marg{glossaries-extra}}}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\gls{glsxtrabbrvtype}}}}}
  }%
  % \glossarysection
  \gcmd{glossary\-section}
  {
     \syntax{\oargm{toc title}\margm{title}}
     \desc{used to display the glossary heading}
  }
  % \currentglossary
  \gcmd{current\-glossary}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{defined by the \gls{print...glossary} commands to
      the current \idx{glossary} label}
  }
  % \glsdefaulttype
  \gcmd{gls\-default\-type}%
  {%
    \providedby{\sty{glossaries}}
    \initval{main}%
    \desc{expands to the label of the default \idx{glossary}, which is
    normally \code{main} but if \opt{nomain} is used, it will be the
    label of the first \idx{glossary} to be defined}
  }%
  % \glscurrententrylabel
  \gcmd{gls\-current\-entry\-label}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{assigned at the start of each \idx{entry} item within the
      \idx{glossary}. This command may be used by \idx{glossary} hooks, such
      as \gls{glspostdescription}, to reference the current entry}
  }
  % \glsnoidxprenumberlist
  \gcmd{gls\-no\-idx\-pre\-number\-list}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{entry-label}}
    \desc{used before the \idx{numberlist} for \option{noidx}.
     By default it expands to the value of the
     \glosfield{prenumberlist} internal field, if set}
  }
  % \glossaryentrynumbers
  \gcmd{glossary\-entry\-numbers}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{locations}}
    \desc{encapsulations the \idx{numberlist} in the \idx{glossary}
     and is also used to save the \idx{numberlist} with the
     \opt{savenumberlist} option.
     This command is redefined by options such as \opt{nonumberlist}
     or commands like \gls{glsnonextpages}}
  }
  % \glsresetentrylist
  \gcmd{gls\-re\-set\-entry\-list}
  {
    \providedby{\sty{glossaries}}
    \desc{resets \gls{glossaryentrynumbers}}
  }
  % \glsnonextpages
  \gcmd{gls\-no\-next\-pages}
  {
    \providedby{\sty{glossaries}}
    \desc{does nothing outside of \gls{print...glossary}. Within the
     \idx{glossary}, this redefines \gls{glossaryentrynumbers} to
     ignore its argument and then reset itself}
  }
  % \glsnextpages
  \gcmd{gls\-next\-pages}
  {
    \providedby{\sty{glossaries}}
    \desc{does nothing outside of \gls{print...glossary}. Within the
     \idx{glossary}, this redefines \gls{glossaryentrynumbers} to
     do its argument and then reset itself}
  }
  % COMMANDS: GLOSSARY STYLES
  % \setglossarystyle
  \gcmd{set\-glossary\-style}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{style-name}}
    \desc{sets the default \idx{glossarystyle} to \meta{style-name}}
  }
  % \glossarystyle
  \gcmd{glossary\-style}
  {
    \deprecated
    \providedby{\sty{glossaries} v1.0--v4.49}
    \syntax{\margm{style-name}}
    \desc{sets the default \idx{glossarystyle} to \meta{style-name}.
     Deprecated in v3.08a and removed in v4.50. Now only available with
     rollback. Use \gls{setglossarystyle} instead}
  }
  % \newglossarystyle
  \gcmd{new\-glossary\-style}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{style-name}\margm{definitions}}
    \desc{defines a new \idx{glossarystyle} called \meta{style-name}}
  }
  % \renewglossarystyle
  \gcmd{re\-new\-glossary\-style}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{style-name}\margm{definitions}}
    \desc{redefines the \idx{glossarystyle} called \meta{style-name}}
  }
  % \glossaryheader
  \gcmd{glossaryheader}
  {
    \providedby{\sty{glossaries}}
    \desc{does the header code after \code{\cbeg{\env{theglossary}}}}
    \note{\idx{glossarystyle} command}
  }
  % \glsgroupheading
  \gcmd{gls\-group\-heading}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{group-label}}
    \desc{redefined by \idxpl{glossarystyle} to show, if applicable, the title
    associated with the \idx{lettergroup} identified by \meta{group-label}}
    \note{\idx{glossarystyle} command}
  }
  % \glssubgroupheading
  \gxtrcmd{gls\-sub\-group\-head\-ing}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{previous level}\margm{level}\margm{parent-label}\margm{group-label}}
    \desc{used to format sub-\idx{group} headings}
    \note{\idx{glossarystyle} command}
  }
  % \glsgroupskip
  \gcmd{gls\-group\-skip}
  {
     \desc{redefined by \idxpl{glossarystyle} to produce a vertical
     gap between \idxpl{lettergroup}, if applicable}
    \note{\idx{glossarystyle} command}
  }
  % \glossentry
  \gcmd{gloss\-entry}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{number-list}}
    \desc{redefined by the \idxpl{glossarystyle} to display
    \toplevel\ entries}
    \note{\idx{glossarystyle} command}
  }
  % \subglossentry
  \gcmd{sub\-gloss\-entry}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{level}\margm{entry-label}\margm{number-list}}
    \desc{redefined by the \idxpl{glossarystyle} to display
    child entries}
    \note{\idx{glossarystyle} command}
  }
  % \glsnamefont
  \gcmd{gls\-name\-font}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{used by \gls{glossentryname} to apply a font change to the
    \gloskey{name}}
  }
  % \glspostdescription
  \gcmd{gls\-post\-de\-scrip\-tion}%
  {%
     \providedby{\sty{glossaries}}
     \desc{a hook that is usually placed after the description in
      \idxpl{glossarystyle}. Some of the styles provided with the
      \sty{glossaries} package don't use this hook. The
      \sty{glossaries-extra-stylemods} redefines those styles to
      include the hook. The default definition of this command
      tests for the \opt{nopostdot} option, but the \opt{postpunc}
      option redefines the command to implement the chosen punctuation}
  }
  % \glstarget
  \gcmd{gls\-target}% 
  {%
    \providedby{\sty{glossaries} v1.18+}
     \syntax{\margm{entry-label}\margm{text}}
     \desc{used by \idxpl{glossarystyle} to create a hypertarget (if enabled) for 
      the \idx{entry} (identified by \meta{entry-label}). The \meta{text} is usually
      \gls{glossentryname}\margm{entry-label}, but it can be something
      else}
  }
  % \glolinkprefix
  \gcmd{glolinkprefix}
  {
    \initval{glo:}
    \desc{expands to the prefix used for entry targets}
  }
  % \glsdescwidth
  \gcmd{gls\-desc\-width}
  {
    \providedby{\sty{glossary-long} \& \sty{glossary-super}}
    \desc{a length register used to set the width of the description
     column for \env{tabular}-like styles}
  }
  % \glspagelistwidth
  \gcmd{gls\-page\-list\-width}
  {
    \providedby{\sty{glossary-long} \& \sty{glossary-super}}
    \desc{a length register used to set the width of the
    \idx{locationlist} column for \env{tabular}-like styles}
  }
  % \glsgetgrouptitle
  \gcmd{gls\-get\-group\-title}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{group-label}}
    \desc{robust command that determines the title associated with \meta{group-label}
     and displays it}
    \field{seealso}{glsxtrsetgrouptitle}
  }
  % \glsxtrsetgrouptitle
  \gxtrcmd{gls\-xtr\-set\-group\-title}
  {
    \providedby{\sty{glossaries-extra} v1.14+}
    \syntax{\margm{group-label}\margm{group-title}}
    \desc{globally assigns the given title \meta{group-title} to the
    \idx{group} identified by \meta{group-label}}
  }
  % \glsxtrlocalsetgrouptitle
  \gxtrcmd{gls\-xtr\-local\-set\-group\-title}
  {
    \providedby{\sty{glossaries-extra} v1.24+}
    \syntax{\margm{group-label}\margm{group-title}}
    \desc{locally assigns the given title \meta{group-title} to the
    \idx{group} identified by \meta{group-label}}
  }
  % \glsxtrgetgrouptitle
  \gxtrcmd{gls\-xtr\-get\-group\-title}
  {
    \providedby{\sty{glossaries-extra} v1.14+}
    \syntax{\margm{group-label}\margm{cs}}
    \desc{obtains the title corresponding to the \idx{group}
    identified by \meta{group-label} and stores the result in the
    control sequence \meta{cs}} 
  }
  % \glsxtrhiername
  \gxtrcmd{gls\-xtr\-hier\-name}
  {
     \providedby{\sty{glossaries-extra} v1.37+}
     \syntax{\margm{entry-label}}
     \desc{displays the entry's hierarchical name}
  }
  % COMMANDS: hyperlinks
  % \glsdohypertarget
  \gcmd{gls\-do\-hyper\-target}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{target}\margm{text}}
    \desc{creates a hypertarget, and includes the debugging
     information if \opteqvalref{debug}{showtargets}. This uses \gls{hypertarget}
     but measures the height of \meta{text} so that the target can
     be placed at the top of \meta{text} instead of along the baseline}
     \field{seealso}{glsdohyperlink,glsdohypertargethook}
  }
  % \glsdohypertargethook
  \gcmd{gls\-do\-hyper\-target\-hook}
  {
    \providedby{\sty{glossaries} v4.54+}
    \syntax{\margm{target}\margm{text}}
    \desc{hook used by \gls{glsdohypertarget}. Does nothing by default}
  }
  % \glslabelhypertarget
  \gcmd{gls\-label\-hyper\-target}
  {
    \providedby{\sty{glossaries} v4.54+}
    \syntax{\margm{target}\margm{text}}
    \desc{may be used in the definition of \gls{glsdohypertargethook}
    to simulate a label corresponding to the target where the label is
    given by \code{\gls{glslabelhypertargetprefix}\meta{target}}}
  }
  % \glslabelhypertargetprefix
  \gcmd{gls\-label\-hyper\-target\-prefix}
  {
    \initvalempty
    \providedby{\sty{glossaries} v4.54+}
    \desc{expands to the prefix used for the label created by
     \gls{glslabelhypertarget}}
  }
  % \glslabelhypertargetdefs
  \gcmd{gls\-label\-hyper\-target\-defs}
  {
    \providedby{\sty{glossaries} v4.54+}
    \desc{hook used by \gls{glslabelhypertarget} to locally redefine
    problematic commands}
  }
  % \glslabelhypertargetvalue
  \gcmd{gls\-label\-hyper\-target\-value}
  {
    \providedby{\sty{glossaries} v4.54+}
    \desc{expands to the value part of the label created by
     \gls{glslabelhypertarget}}
  }
  % \glsdohyperlink
  \gcmd{gls\-do\-hyper\-link}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{target}\margm{text}}
    \desc{creates a hyperlink to the given target using
    \gls{hyperlink}, and includes the debugging
     information if \opteqvalref{debug}{showtargets}}
    \field{seealso}{glsdohypertarget,glsdonohyperlink,glsdohyperlinkhook}
  }
  % \glsdohyperlinkhook
  \gcmd{gls\-do\-hyper\-link\-hook}
  {
    \providedby{\sty{glossaries} v4.54+}
    \syntax{\margm{target}\margm{text}}
    \desc{hook used by \gls{glsdohyperlink}. Does nothing by default}
  }
  % \glsdonohyperlink
  \gcmd{gls\-do\-no\-hyper\-link}
  {
    \providedby{\sty{glossaries} v4.20+}
    \syntax{\margm{target}\margm{text}}
    \desc{used instead of \gls{glsdohyperlink} when
    \idxpl{hyperlink} are disabled. This simply expands to \meta{text}}
  }
  % \glstexorpdfstring
  \gcmd{gls\-tex\-or\-pdf\-string}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{\TeX}\margm{PDF}}
    \desc{if \sty{hyperref} has been loaded, this uses
    \gls{texorpdfstring} otherwise it just expands to \meta{\TeX}}
  }
  % COMMANDS: hypernav
  % \glsnavhyperlink
  \gcmd{gls\-nav\-hyper\-link}
  {
    \providedby{\sty{glossary-hypernav}}
    \syntax{\oargm{glossary-label}\margm{group-label}\margm{group-title}}
    \desc{creates a hyperlink to the given \idx{group}, where the
    target name is obtained from \gls{glsnavhyperlinkname}}
  }
  % \glsnavhyperlinkname
  \gcmd{gls\-nav\-hyper\-link\-name}
  {
    \providedby{\sty{glossary-hypernav} v4.29+}
    \syntax{\oargm{glossary-label}\margm{group-label}}
    \desc{expands to the anchor for the given \idx{group}}
  }
  % \glsnavhypertarget
  \gcmd{gls\-nav\-hyper\-target}
  {
    \providedby{\sty{glossary-hypernav}}
    \syntax{\oargm{glossary-label}\margm{group-label}\margm{group-title}}
    \desc{used to create a hyper target for a \idx{group} in order
    to support styles that have navigation links to glossary
    \idxpl{group}. Note that if you only want to change the way that
    the target is created, redefine \gls{glsnavhypergroupdotarget}
    instead}
  }
  % \glsnavhypergroupdotarget
  \gcmd{gls\-nav\-hyper\-group\-do\-target}
  {
    \providedby{\sty{glossary-hypernav} v4.53+}
    \syntax{\margm{glossary-label}\margm{group-label}\margm{group-title}}
    \desc{used by \gls{glsnavhypertarget} to create the hypertarget
for the given group}
  }
  % \glsnavigationitem
  \gcmd{gls\-navigation\-item}
  {
    \providedby{\sty{glossary-hypernav} v4.53+}
    \syntax{\margm{group-label}}
    \desc{used by \gls{glsnavigation} to create the hyperlink
for the given group (with the title corresponding to the group label)}
  }
  % \glsnavigation
  \gcmd{gls\-navigation}
  {
    \providedby{\sty{glossary-hypernav}}
    \desc{displays a simple glossary \idx{group} navigation line
      with the items separated by \gls{glshypernavsep}}
  }
  % \glshypernavsep
  \gcmd{gls\-hyper\-nav\-sep}
  {
    \providedby{\sty{glossary-hypernav}}
    \desc{used as a separator by \gls{glsnavigation}}
  }
  % \glssymbolnav
  \gcmd{gls\-symbol\-nav}
  {
    \providedby{\sty{glossary-hypernav}}
    \desc{produces a simple navigation set of links for just the 
     symbols and number groups separated by \gls{glshypernavsep}}
  }
  % COMMANDS: tree
  % \glstreepredesc
  \gcmd{gls\-tree\-pre\-desc}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{space inserted before top-level descriptions}
  }
  % \glstreechildpredesc
  \gcmd{gls\-tree\-child\-pre\-desc}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{space inserted before child descriptions}
  }
  % \glstreenamefmt
  \gcmd{gls\-tree\-name\-fmt}
  {
    \providedby{\sty{glossary-tree} v4.08+}
    \syntax{\margm{text}}
    \desc{used to format the name for the \glostyle{tree} and
     \glostyle{index} styles}
  }
  % \glstreegroupheaderfmt
  \gcmd{gls\-tree\-group\-header\-fmt}
  {
    \providedby{\sty{glossary-tree} v4.22+}
    \syntax{\margm{text}}
    \desc{used to format the \idx{group} title for the \glostyle{treegroup} and
     \glostyle{indexgroup} styles}
  }
  % \glstreenavigationfmt
  \gcmd{gls\-tree\-navigation\-fmt}
  {
    \providedby{\sty{glossary-tree} v4.22+}
    \syntax{\margm{text}}
    \desc{used to format the navigation element for styles like \glostyle{treehypergroup}}
  }
  % \glstreeitem
  \gcmd{gls\-tree\-item}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{used to indent the top-level entries for the \glostyle{index} styles}
  }
  % \glstreesubitem
  \gcmd{gls\-tree\-sub\-item}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{used to indent the level~1 entries for the \glostyle{index} styles}
  }
  % \glstreesubsubitem
  \gcmd{gls\-tree\-sub\-sub\-item}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{used to indent the level~2 entries for the \glostyle{index} styles}
  }
  % \glstreeindent
  \gcmd{gls\-tree\-indent}
  {
    \providedby{\sty{glossary-tree}}
    \initval{10pt}
    \desc{length register used by the \glostyle{tree} style}
  }
  % \glssetwidest
  \gcmd{gls\-set\-widest}
  {
    \providedby{\sty{glossary-tree}}
    \syntax{\oargm{level}\margm{name}}
    \desc{indicates that \meta{name} is the widest name for the
      given \idx{hierarchicallevel}}
  }
  % \glsfindwidesttoplevelname
  \gcmd{gls\-find\-widest\-top\-level\-name}
  {
    \providedby{\sty{glossary-tree} v4.22+}
    \syntax{\oargm{glossary labels}}
    \desc{finds and sets the widest name for all top-level entries
    in the given \idxpl{glossary}. If the optional argument is
    omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
  }
  % \glstreenamebox
  \gcmd{gls\-tree\-name\-box}
  {
    \providedby{\sty{glossary-tree} v4.19+}
    \syntax{\margm{width}\margm{text}}
    \desc{creates the box for the name with styles like
    \glostyle{alttree}}
  }
  % COMMANDS: mcols
  % \glsmcols
  \gcmd{gls\-m\-cols}
  {
    \providedby{\sty{glossary-mcols} v3.05+}
    \initval{2}
    \desc{expands to the number of columns for the \qt{mcol} styles}
  }
  % COMMANDS: list style
  % \indexspace
  \gcmd{index\-space}
  {
    \desc{provided by various packages, including \sty{glossary-list}
      and \sty{glossary-tree}, this creates a vertical space}
  }
  % \glslistdottedwidth
  \gcmd{gls\-list\-dotted\-width}
  {
    \providedby{\sty{glossary-list}}
    \desc{a length register used by \glostyle{listdotted}}
  }
  % \glslistinit
  \gcmd{gls\-list\-init}
  {%
    \providedby{\sty{glossary-list} v4.48+}
    \desc{used to disable problematic commands at the start the
    \glostyle{list} styles to provide better integration with
    \sty{gettitlestring}}
  }
  % \glslistexpandedname
  \gcmd{gls\-list\-expanded\-name}
  {%
    \providedby{\sty{glossary-list} v4.48+}
    \syntax{\margm{entry-label}}
    \desc{used by \gls{glslistinit} to provide better integration with
    \sty{gettitlestring}}
  }
  % \glslistnavigationitem
  \gcmd{gls\-list\-navigation\-item}
  {
    \providedby{\sty{glossary-list} v4.22+}
    \syntax{\margm{navigation items}}
    \desc{used in styles like \glostyle{listhypergroup} to display
     the navigation line}
  }
  % \glslistgroupheaderfmt
  \gcmd{gls\-list\-group\-header\-fmt}
  {
    \providedby{\sty{glossary-list} v4.22+}
    \syntax{\margm{title}}
    \desc{used to encapsulate the \idx{group} title}
  }
  % COMMANDS: longbooktabs style
  % \glspatchLToutput
  \gcmd{gls\-patch\-LT\-output}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{applies a patch to \env{longtable} to check for instances
    of the group skip occurring at a page break}
  }
  % \glsrestoreLToutput
  \gcmd{glsrestoreLToutput}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{reverses the effect of \gls{glspatchLToutput}}
  }
  % \glsLTpenaltycheck
  \gcmd{gls\-LT\-penalty\-check}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{penalty check used by \gls{glspatchLToutput}}
  }
  % \glspenaltygroupskip
  \gcmd{gls\-penalty\-group\-skip}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{the definition of \gls{glsgroupskip} with
     \optval{nogroupskip}{false} for the \sty{glossary-longbooktabs} 
     styles}
  }
  % COMMANDS: inline style
  % \glsinlinenameformat
  \gcmd{gls\-in\-line\-name\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{entry-label}\margm{name}}
    \desc{creates the target for \toplevel\ entries and may be 
     used to adjust the format of the name}
  }
  % \glsinlinesubnameformat
  \gcmd{gls\-in\-line\-sub\-name\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{entry-label}\margm{name}}
    \desc{creates the target for sub entries and may be used to adjust the format of
     the name}
  }
  % \glsinlinedescformat
  \gcmd{gls\-in\-line\-desc\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the description, symbol and \idx{locationlist} for
     top-level entries}
  }
  % \glsinlinesubdescformat
  \gcmd{gls\-in\-line\-sub\-desc\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the description, symbol and \idx{locationlist} for
     child entries}
  }
  % \glspostinline
  \gcmd{gls\-post\-in\-line}
  {%
    \providedby{\sty{glossary-inline} v3.03+}
    \desc{used at the end of the \env{theglossary} environment}
  }
  % \glspostinlinedescformat
  \gcmd{gls\-post\-in\-line\-desc\-format}
  {%
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the top-level entry's description, symbol and \idx{locationlist}}
  }
  % \glsinlineemptydescformat
  \gcmd{gls\-in\-line\-empty\-desc\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{symbol}\margm{location list}}
    \desc{used to format the symbol and \idx{locationlist} when the
    description is suppressed}
  }
  % \glspostinlinesubdescformat
  \gcmd{gls\-post\-in\-line\-sub\-desc\-format}
  {%
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the child entry's description, symbol and \idx{locationlist}}
  }
  % \glsinlinedopostchild
  \gcmd{gls\-in\-line\-do\-post\-child}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \desc{hook at the start of \gls{glossentry} that finishes off
     the previous child entry, if the current \toplevel\ entry
     follows a child entry. This command is redefined within
     \gls{glossentry} to use \gls{glsinlinepostchild} after a
     \toplevel\ entry if that entry has any children}
  }
  % \glsinlinepostchild
  \gcmd{gls\-in\-line\-post\-child}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \desc{hook used between a \toplevel\ entry and its first sub-entry}
  }
  % \glsinlineseparator
  \gcmd{gls\-in\-line\-separator}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \initval{;\gls{space}}
    \desc{separator used between \toplevel\ entries}
  }
  % \glsinlinesubseparator
  \gcmd{gls\-in\-line\-sub\-separator}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \initval{,\gls{space}}
    \desc{separator used between sub-entries}
  }
  % \glsinlineparentchildseparator
  \gcmd{gls\-in\-line\-parent\-child\-separator}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \initval{:\gls{space}}
    \desc{separator used between a \toplevel\ parent and its first child entry}
  }
  % \glsinlineifhaschildren
  \gcmd{gls\-in\-line\-if\-has\-child\-ren}
  {
    \providedby{\sty{glossary-inline} v4.50+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{used to test if the entry has any children}
  }
  % COMMANDS: LOCATIONS
  % \glsdisplaynumberlist
  \gcmd{gls\-display\-number\-list}
  {
     \providedby{\sty{glossaries} v3.02+}
     \syntax{\margm{entry-label}}
     \desc{formats the \idx{locationlist} for the given entry.
     Redefined by \sty{glossaries-extra-bib2gls} to obtain the
     \idx{locationlist} from the \gloskey{location} field}
  }
  % \glsentrynumberlist
  \gcmd{gls\-entry\-number\-list}
  {
     \providedby{\sty{glossaries} v3.02+}
     \syntax{\margm{entry-label}}
     \desc{displays the \idx{locationlist} for the given entry.
     Redefined by \sty{glossaries-extra-bib2gls} to obtain the
     \idx{locationlist} from the \gloskey{location} field}
  }
  % \glsnumlistsep
  \gcmd{gls\-num\-list\-sep}
  {
     \providedby{\sty{glossaries} v3.02+}
     \initval{,\sym{vbsp}}
     \desc{separator used by \gls{glsdisplaynumberlist} between all
     but the last two \locations}
  }
  % \glsnumlistlastsep
  \gcmd{gls\-num\-list\-last\-sep}
  {
     \providedby{\sty{glossaries} v3.02+}
     \initval{\sym{vbsp}\gls{cs.amp}\sym{vbsp}}
     \desc{separator used by \gls{glsdisplaynumberlist} between 
     the last two \locations}
  }
  % \glsnoidxdisplayloc
  \gcmd{gls\-no\-idx\-display\-loc}
  {
     \providedby{\sty{glossaries} v4.04+}
     \syntax{\margm{prefix}\margm{counter}\margm{format}\margm{location}}
     \desc{used to display an individual location within the
     \idx{numberlist} when \gls{printnoidxglossary} formats the
     \idx{numberlist}}
  }
  % \glsnoidxloclist
  \gcmd{gls\-no\-idx\-loc\-list}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{list cs}}
    \desc{displays the \idx{locationlist} by iterating over the
      \glosfield{loclist} field with the \gls{glsnoidxloclisthandler}
      handler}
    \note{\options{noidx,b2g}}
  }
  % \glsnoidxloclisthandler
  \gcmd{gls\-no\-idx\-loc\-list\-handler}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{location}}
    \desc{handler macro used by \gls{glsnoidxloclist}}
    \note{\option{noidx}}
  }
  % \glsnoidxdisplayloclisthandler
  \gcmd{gls\-no\-idx\-display\-loc\-list\-handler}
  {
     \providedby{\sty{glossaries} v4.04+}
     \syntax{\margm{location}}
     \desc{handler macro used by \gls{glsdisplaynumberlist} with
      \option{noidx}}
  }
  % \glsnoidxnumberlistloophandler
  \gcmd{gls\-no\-idx\-number\-list\-loop\-handler}
  {
     \providedby{\sty{glossaries} v4.04+}
     \syntax{\margm{location item}}
     \desc{list loop handler used by \gls{glsnumberlistloop}}
  }
  % \glsxtr<counter>locfmt
  \gxtrcmdmeta{gls\-xtr}{counter}{loc\-fmt}%
  {%
    \syntax{\margm{location}\margm{title}}
    \desc{if defined, used with \optval{record}{name} to format locations
     associated with \meta{counter}}
  }
  % \glsnumberformat
  \gcmd{gls\-number\-format}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{the default \idxc{locationencap}{format} for \idxpl{entrylocation}. If
     \idxpl{hyperlink} are defined, this will use \gls{glshypernumber}
     otherwise it will simply display its argument, which may be a
     single \location, or locations delimited by \gls{delimR} or
     \gls{delimN}}
  }
  % \delimR
  \gcmd{delimR}%
  {%
    \desc{used between the start and end of a \location\ \idx{range}}
  }
  % \delimN
  \gcmd{delimN}%
  {%
    \desc{used as a separator between \locations}
  }
  % \setentrycounter
  \gcmd{set\-entry\-counter}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{prefix}\margm{counter}}
    \desc{sets up the hypertarget prefix and \idx{locationcounter}
     for use with \gls{glshypernumber}}
  }
  % \glsentrycounter
  \gcmd{gls\-entry\-counter}
  {
    \providedby{\sty{glossaries}}
    \initval{\gls{glscounter}}
    \desc{defined by \gls{setentrycounter} to its \meta{counter}
      argument.}
  }
  % \glscounter
  \gcmd{gls\-counter}
  {
    \providedby{\sty{glossaries}}
    \initval{page}
    \desc{the default counter as specified by the \opt{counter} option}
  }
  % \glshypernumber
  \gcmd{gls\-hyper\-number}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{this will encapsulate each \location\ with a \idx{hyperlink}, if
    supported. This may be used as a \idx{locationencap}.
    The argument may be a single location or locations
    delimited by \gls{delimR} or \gls{delimN}. This command should
    not be used outside of \idxpl{locationlist} as it
    requires additional information in order to correctly form the
    \idxpl{hyperlink}}
  }
  % \glsignore
  \gcmd{gls\-ignore}
  {
    \providedby{\sty{glossaries} v4.12+}
    \syntax{\margm{text}}
    \desc{does nothing. When used as a \idx{locationencap}, this
    signifies to \app{bib2gls} that the entry is required but the
    \location\ shouldn't be added to the \idx{locationlist}. With
    other \idx{indexing} methods, this simply creates an invisible
    \location}
  }
  % \hyperrm
  \gcmd{hyper\-rm}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textrm}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textrm}\margm{location(s)}}}
  }
  % \hypersf
  \gcmd{hyper\-sf}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textsf}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textsf}\margm{location(s)}}}
  }
  % \hypertt
  \gcmd{hyper\-tt}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{texttt}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{texttt}\margm{location(s)}}}
  }
  % \hyperbf
  \gcmd{hyper\-bf}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textbf}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textbf}\margm{location(s)}}}
  }
  % \hypermd
  \gcmd{hyper\-md}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textmd}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textmd}\margm{location(s)}}}
  }
  % \hyperit
  \gcmd{hyper\-it}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textit}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textit}\margm{location(s)}}}
  }
  % \hypersl
  \gcmd{hyper\-sl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textsl}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textsl}\margm{location(s)}}}
  }
  % \hyperup
  \gcmd{hyper\-up}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textup}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textup}\margm{location(s)}}}
  }
  % \hypersc
  \gcmd{hyper\-sc}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textsc}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textsc}\margm{location(s)}}}
  }
  % \hyperemph
  \gcmd{hyper\-emph}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{emph}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{emph}\margm{location(s)}}}
  }
  % \glsnumberlistloop
  \gcmd{glsnumberlistloop}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{entry-label}\margm{handler}\margm{xr handler cs}}
    \desc{iterates over the \glosfield{loclist} internal field}
  }
  % COMMANDS: STANDALONE
  % \glsxtrglossentry
  \gcmd{gls\-xtr\-gloss\-entry}
  {
    \providedby{\sty{glossaries-extra} v1.21+}
    \syntax{\margm{entry-label}}
    \desc{used for standalone entries to display the name with
     \gls{glossentryname}, with appropriate hooks}
  } 
  % COMMANDS: LANGUAGE
  % \ProvidesGlossariesLang
  \gcmd{Provides\-Glos\-saries\-Lang}%
  {%
     \providedby{\sty{glossaries} v4.12+}
     \syntax{\margm{language}\oargm{version}}
     \desc{used at the start of a \sty{glossaries} language
     definition file (\ext+{ldf}) to declare the file and version
     details}
  }
  % \RequireGlossariesLang
  \gcmd{Require\-Glos\-saries\-Lang}%
  {%
    \providedby{\sty{glossaries} v4.12+}
    \syntax{\margm{language}}
    \desc{indicates that
    the language definition file (\ext{ldf}) corresponding to the given
    language should be loaded, if it hasn't already been loaded}
  }
  % \glsifusedtranslatordict
  \gcmd{gls\-if\-used\-trans\-lator\-dict}
  {
    \providedby{\sty{glossaries} v4.12+}
    \syntax{\margm{Lang}\margm{true}\margm{false}}
    \desc{does \meta{true} if \opteqvalref{translate}{true} and the
    \file{glossaries-dictionary-Lang.dict} file has been loaded,
    otherwise does \meta{false}}
  }
  % \addglossarytocaptions
  \gcmd{add\-glos\-sary\-to\-captions}%
  {%
    \providedby{\sty{glossaries}}
     \syntax{\margm{language}}
     \desc{adds the redefinition of \gls{glossaryname} to
     \gls{captionslanguage} if \sty{translator} has been loaded
      (does nothing if \sty{translator} hasn't been loaded)}
  }
  % \glossaryname
  \gcmd{glossary\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Glossary}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as the default title for \idxpl{glossary} without a
    specified title. May already be defined by a language package}
    \note{language-sensitive}
  }
  % \acronymname
  \gcmd{acronym\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Acronyms}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as the default title for the \idx{glossary} created by
    the \opt{acronyms} option}
    \note{language-sensitive}
  }
  % \entryname
  \gcmd{entry\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Notation}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as a column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \descriptionname
  \gcmd{description\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Description}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as a column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \symbolname
  \gcmd{symbol\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Symbol}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as a column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \pagelistname
  \gcmd{page\-list\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Page List}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as the \idx{pagelist} column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \glssymbolsgroupname
  \gcmd{gls\-symbols\-group\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Symbols}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. The title associated with the \code{glssymbols} 
    \idx{lettergroup}. Also used as the title for the \idx{glossary} created with
    the \opt{symbols} package option}
    \note{language-sensitive}
  }
  % \glsnumbersgroupname
  \gcmd{gls\-numbers\-group\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Numbers}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. The title associated with the \code{glsnumbers} 
    \idx{lettergroup}. Also used as the title for the \idx{glossary} created with
    the \opt{numbers} package option}
    \note{language-sensitive}
  }
  % \<group-label>groupname
  \gcmdmeta{}{group-label}{group\-name}{}
  % \abbreviationsname
  \gxtrcmd{abbre\-vi\-a\-tions\-name}%
  {% 
    \initval{Abbreviations}%
    \providedby{\sty{glossaries-extra}}
    \note{language-sensitive}
    \desc{expands to the title of the \glostype{abbreviations} \idx{glossary}.
     The default is \qt{Abbreviations} or \gls{acronymname} if \sty{babel} 
     has been detected}
  }%
  % \glspluralsuffix
  \gcmd{gls\-plural\-suffix}
  {
    \providedby{\sty{glossaries}}
    \initval{s}
    \desc{suffix used to obtain default plurals}
  }
  % \acrpluralsuffix
  \gcmd{acr\-plural\-suffix}
  {
    \providedby{\sty{glossaries} v4.12+}
    \initval{\gls{glsacrpluralsuffix}}
    \desc{suffix used in the default \gloskey{shortplural} value by \gls{newacronym}}
  }
  % \glsacrpluralsuffix
  \gcmd{gls\-acr\-plural\-suffix}
  {
    \providedby{\sty{glossaries} v4.12+}
    \initval{\gls{glspluralsuffix}}
    \desc{short plural suffix, this command is changed by \idxpl{acronymstyle}}
  }
  % \glsupacrpluralsuffix
  \gcmd{gls\-up\-acr\-plural\-suffix}
  {
    \providedby{\sty{glossaries} v4.12+}
    \desc{suffix used to obtain the default \gloskey{shortplural}
    value with the base \idx{smallcaps} \idxpl{acronymstyle}}
  }
  % \seename
  \gcmd{see\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{see}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. May already be defined by a language package}
    \note{language-sensitive}
  }
  % \seealsoname
  \gxtrcmd{see\-also\-name}%
  {%
    \providedby{\sty{glossaries-extra} v1.16+}
    \initval{see also}%
    \note{language-sensitive}
    \desc{used as a cross-reference tag. The default value is
    \gls{alsoname}, if that command has been defined, or \qt{see also}}
  }%  
  % \andname
  \gcmd{and\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{\gls{cs.amp}}
    \desc{provided by \sty{glossaries} if it hasn't already been defined}
  }
  % COMMANDS: PREFIXES (glossaries-prefix.sty)
  % \glsprefixsep
  \gcmd{gls\-pre\-fix\-sep}
  {
    \providedby{\sty{glossaries-prefix} v4.45}
    \initvalempty
    \desc{separator between the prefix and the term}
  }
  % \pgls
  \gcmdsp{pgls}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{similar to \gls{gls} but inserts the appropriate prefix,
     if provided}
  }
  % \Pgls
  \gcmdsp{Pgls}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{sentencecase}}
  }
  % \PGLS
  \gcmdsp{PGLS}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{allcaps}}
  }
  % \pglspl
  \gcmdsp{pgls\-pl}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{similar to \gls{glspl} but inserts the appropriate prefix,
     if provided}
  }
  % \Pglspl
  \gcmdsp{Pgls\-pl}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{sentencecase}}
  }
  % \PGLSpl
  \gcmdsp{PGLS\-pl}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{allcaps}}
  }
  % \ifglshasprefix
  \gcmd{if\-gls\-has\-prefix}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefix} field is
non-empty}
  }
  % \ifglshasprefixplural
  \gcmd{if\-gls\-has\-prefix\-plural}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefixplural} field is
non-empty}
  }
  % \ifglshasprefixfirst
  \gcmd{if\-gls\-has\-prefix\-first}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefixfirst} field is
non-empty}
  }
  % \ifglshasprefixfirstplural
  \gcmd{if\-gls\-has\-prefix\-first\-plural}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefixfirstplural} field is
non-empty}
  }
  % \glsentryprefix
  \gcmd{gls\-entry\-prefix}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefix} field}
  }
  % \glsentryprefixfirst
  \gcmd{gls\-entry\-prefix\-first}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefixfirst} field}
  }
  % \glsentryprefixplural
  \gcmd{gls\-entry\-prefix\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefixplural} field}
  }
  % \glsentryprefixfirstplural
  \gcmd{gls\-entry\-prefix\-first\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefixfirstplural} field}
  }
  % \Glsentryprefix
  \gcmd{Gls\-entry\-prefix}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefix} but \idx{sentencecase}}
  }
  % \Glsentryprefixplural
  \gcmd{Gls\-entry\-prefix\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefixplural} but \idx{sentencecase}}
  }
  % \Glsentryprefixfirst
  \gcmd{Gls\-entry\-prefix\-first}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefixfirst} but \idx{sentencecase}}
  }
  % \Glsentryprefixfirstplural
  \gcmd{Gls\-entry\-prefix\-first\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefixfirstplural} but \idx{sentencecase}}
  }
  % \pglsxtrshort
  \gxtrcmdsp{pgls\-xtr\-short}{%
    \providedby{\sty{glossaries-extra} v1.49+}
    \note{requires \sty{glossaries-prefix}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but inserts the \gloskey{prefix}
    field and separator in front if set}
  }
  % COMMANDS: ACCESSIBILITY (glossaries-accsupp.sty)
  % \gls<field-label>accsupp
  \gxtrcmdmeta{gls}{field-label}{acc\-supp}%
  {%
    \syntax{\margm{replacement}\margm{content}}
    \desc{if defined, used by \gls{glsfieldaccsupp} for the accessibility support
    for the \idx{internalfieldlabel} given by \meta{field-label}}
  }
  % \glsxtr<category><field>accsupp
  \gxtrcmdmetameta{gls\-xtr}{category}{}{field}{acc\-supp}%
  {%
    \syntax{\margm{replacement}\margm{content}}
    \desc{if defined, used by \gls{glsfieldaccsupp} for the accessibility support
    for the category identified by \meta{category} and the 
    \idx{internalfieldlabel} given by \meta{field}}
  }
  % \glsxtr<category>accsupp
  \gxtrcmdmeta{gls\-xtr}{category}{acc\-supp}%
  {%
    \syntax{\margm{replacement}\margm{content}}
    \desc{if defined, used by \gls{glsfieldaccsupp} for the accessibility support
    for the category identified by \meta{category}}
  }
  % \glsfieldaccsupp
  \gcmd{gls\-field\-acc\-supp}
  { 
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{replacement}\margm{content}\margm{field-label}\margm{entry-label}}
     \desc{if \sty{glossaries-extra} has been loaded, this command
     will first check for the existence of the command 
     \gls{glsxtrcategoryfieldaccsupp}. If that command doesn't
     exist or if \sty{glossaries-extra} hasn't been loaded, it then
     checks for the existence of \csfmt{gls\meta{field}accsupp} (for
     example, \gls{glsshortaccsupp}).
     Failing that it will use \gls{glsaccsupp}. Whichever command is
     found first, \code{\meta{cs}\margm{replacement}\margm{content}}
     is performed.}
  }
  % \glsaccsupp
  \gcmd{gls\-acc\-supp}
  {
     \providedby{\sty{glossaries-accsupp}}
     \syntax{\margm{replacement}\margm{content}}
     \desc{applies \meta{replacement} as the ActualText for
     \meta{content} using \gls{glsaccessibility}}
  }
  % \glsdefaultshortaccess
  \gcmd{gls\-default\-short\-access}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{long}\margm{short}}
     \desc{the default value for the \gloskey{shortaccess} key when
     defining \idxpl{acronym} with \gls{newacronym}}
  }
  % \glsshortaccsupp
  \gcmd{gls\-short\-acc\-supp}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{replacement}\margm{content}}
     \desc{applies \meta{replacement} as the expansion (E) 
     \idxc{accessattr}{attribute} for
     \meta{content} using \gls{glsaccessibility} for the \gloskey{short} field}
  }
  % \glsshortplaccsupp
  \gcmd{gls\-short\-pl\-acc\-supp}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{replacement}\margm{content}}
     \desc{applies \meta{replacement} as the expansion (E) 
      \idxc{accessattr}{attribute} for
     \meta{content} using \gls{glsaccessibility} for the \gloskey{shortplural} field}
  }
  % \glsaccessibility
  \gcmd{gls\-ac\-ces\-si\-bil\-ity}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\oargm{options}\margm{PDF element}\margm{value}\margm{content}}
     \desc{applies \meta{value} as the \idx{accessattr}
     \meta{PDF element} for the given \meta{content}. This
     internally uses the accessibility support provided by \sty{accsupp}}
  }
  % \gls@accsupp@engine
  \gcmd{gls\-@\-acc\-supp\-@\-engine}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \initval{accsupp}
    \desc{expands to the accessibility support engine. This command
    may be defined before \sty{glossaries-accsupp} is loaded}
  }
  % \gls@accessibility
  \gcmd{gls\-@\-ac\-ces\-si\-bil\-ity}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{options}\margm{PDF element}\margm{value}\margm{content}}
     \desc{used by \gls{glsaccessibility} to provide the
      accessibility support}
  }
  % \glsnameaccessdisplay
  \gcmd{gls\-name\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{access} replacement
     text (if set)}
  }
  % \glstextaccessdisplay
  \gcmd{gls\-text\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{textaccess} replacement
     text (if set)}
  }
  % \glspluralaccessdisplay
  \gcmd{gls\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{pluralaccess} replacement
     text (if set)}
  }
  % \glsfirstaccessdisplay
  \gcmd{gls\-first\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{firstaccess} replacement
     text (if set)}
  }
  % \glsfirstpluralaccessdisplay
  \gcmd{gls\-first\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{firstpluralaccess} replacement
     text (if set)}
  }
  % \glssymbolaccessdisplay
  \gcmd{gls\-symbol\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{symbolaccess} replacement
     text (if set)}
  }
  % \glssymbolpluralaccessdisplay
  \gcmd{gls\-symbol\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{symbolpluralaccess} replacement
     text (if set)}
  }
  % \glsdescriptionaccessdisplay
  \gcmd{gls\-description\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{descriptionaccess} replacement
     text (if set)}
  }
  % \glsdescriptionpluralaccessdisplay
  \gcmd{gls\-description\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{descriptionpluralaccess} replacement
     text (if set)}
  }
  % \glsshortaccessdisplay
  \gcmd{gls\-short\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{shortaccess} replacement
     text (if set)}
  }
  % \glsshortpluralaccessdisplay
  \gcmd{gls\-short\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{shortpluralaccess} replacement
     text (if set)}
  }
  % \glslongaccessdisplay
  \gcmd{gls\-long\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{longaccess} replacement
     text (if set)}
  }
  % \glslongpluralaccessdisplay
  \gcmd{gls\-long\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{longpluralaccess} replacement
     text (if set)}
  }
  % \glsuseriaccessdisplay
  \gcmd{gls\-user\-i\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user1access} replacement
     text (if set)}
  }
  % \glsuseriiaccessdisplay
  \gcmd{gls\-user\-ii\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user2access} replacement
     text (if set)}
  }
  % \glsuseriiiaccessdisplay
  \gcmd{gls\-user\-iii\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user3access} replacement
     text (if set)}
  }
  % \glsuserivaccessdisplay
  \gcmd{gls\-user\-iv\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user4access} replacement
     text (if set)}
  }
  % \glsuservaccessdisplay
  \gcmd{gls\-user\-v\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user5access} replacement
     text (if set)}
  }
  % \glsuserviaccessdisplay
  \gcmd{gls\-user\-vi\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user6access} replacement
     text (if set)}
  }
  % \glsentryaccess
  \gcmd{gls\-entry\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{access} field}
  }
  % \glsentrytextaccess
  \gcmd{gls\-entry\-text\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{textaccess} field}
  }
  % \glsentryfirstaccess
  \gcmd{gls\-entry\-first\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{firstaccess} field}
  }
  % \glsentrypluralaccess
  \gcmd{gls\-entry\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{pluralaccess} field}
  }
  % \glsentryfirstpluralaccess
  \gcmd{gls\-entry\-first\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{firstpluralaccess} field}
  }
  % \glsentrysymbolaccess
  \gcmd{gls\-entry\-symbol\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{symbolaccess} field}
  }
  % \glsentrysymbolpluralaccess
  \gcmd{gls\-entry\-symbol\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{symbolpluralaccess} field}
  }
  % \glsentrydescaccess
  \gcmd{gls\-entry\-desc\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \glosfield{descaccess} field}
  }
  % \glsentrydescpluralaccess
  \gcmd{gls\-entry\-desc\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \glosfield{descpluralaccess} field}
  }
  % \glsentryshortaccess
  \gcmd{gls\-entry\-short\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{shortaccess} field}
  }
  % \glsentryshortpluralaccess
  \gcmd{gls\-entry\-short\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{shortpluralaccess} field}
  }
  % \glsentrylongaccess
  \gcmd{gls\-entry\-long\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{longaccess} field}
  }
  % \glsentrylongpluralaccess
  \gcmd{gls\-entry\-long\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{longpluralaccess} field}
  }
  % \glsentryuseriaccess
  \gcmd{gls\-entry\-user\-i\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user1access} field}
  }
  % \glsentryuseriiaccess
  \gcmd{gls\-entry\-user\-ii\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user2access} field}
  }
  % \glsentryuseriiiaccess
  \gcmd{gls\-entry\-user\-iii\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user3access} field}
  }
  % \glsentryuserivaccess
  \gcmd{gls\-entry\-user\-iv\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user4access} field}
  }
  % \glsentryuservaccess
  \gcmd{gls\-entry\-user\-v\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user5access} field}
  }
  % \glsentryuserviaccess
  \gcmd{gls\-entry\-user\-vi\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user6access} field}
  }
  % COMMANDS: ACCESSIBILITY - extra
  % \glsaccessname
  \gxtrcmd{gls\-access\-name}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{name} key with the accessibility
     support enabled for that key (\gloskey{access}). If there is no accessibility
     support, this just uses \gls{glsentryname}}
  }
  % \glsaccesslong
  \gxtrcmd{gls\-access\-long}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{long} key with the accessibility
     support enabled for that key (\gloskey{longaccess}). If there is
     no accessibility support, this just uses \gls{glsentrylong}}
  }
  % \Glsaccesslong
  \gxtrcmd{Gls\-access\-long}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{the \idx{sentencecase} version of \gls{glsaccesslong}}
  }
  % \glsaccesslongpl 
  \gxtrcmd{gls\-access\-longpl}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{longplural} key with the accessibility
     support enabled for that key (\gloskey{longpluralaccess}). If there is
     no accessibility support, this just uses \gls{glsentrylongpl}}
  }
  % \Glsaccesslongpl
  \gxtrcmd{Gls\-access\-longpl}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{the \idx{sentencecase} version of \gls{glsaccesslongpl}}
  }
  % \glsaccessshort
  \gxtrcmd{gls\-access\-short}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{short} key with the accessibility
     support enabled for that key (\gloskey{shortaccess}). If there is
     no accessibility support, this just uses \gls{glsentryshort}}
  }
  % \glsaccessshortpl
  \gxtrcmd{gls\-access\-shortpl}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{shortplural} key with the accessibility
     support enabled for that key (\gloskey{shortpluralaccess}). If there is
     no accessibility support, this just uses \gls{glsentryshortpl}}
  }
  % COMMANDS: DEBUGGING
  % \glsshowtarget
  \gcmd{gls\-show\-target}%
  {
    \providedby{\sty{glossaries} v4.32+}
    \syntax{\margm{target name}}
    \desc{used with \opteqvalref{debug}{showtargets} to show the target}
  }
  % \glsshowtargetinner
  \gcmd{gls\-show\-target\-inner}%
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{target name}}
    \desc{used by \gls{glsshowtarget} in \idx{mathmode} and inner mode}
  }
  % \glsshowtargetfonttext
  \gcmd{gls\-show\-target\-font\-text}%
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{text}}
    \desc{used by \gls{glsshowtargetinner} to set the font}
  }
  % \glsshowtargetfont
  \gcmd{gls\-show\-target\-font}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \initval{\csfmt{ttfamily}\csfmt{footnotesize}}
    \desc{used by \gls{glsshowtargetfonttext} and 
    \gls{glsshowtargetouter} to set the font}
  }
  % \glsshowtargetouter
  \gcmd{gls\-show\-target\-outer}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{target name}}
    \desc{used by \gls{glsshowtarget} in outer mode}
  }
  % \glsshowtargetsymbol
  \gcmd{gls\-show\-target\-symbol}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{target name}}
    \desc{used by \gls{glsshowtargetouter} to mark the target}
  }
  % \glsshowaccsupp
  \gcmd{gls\-show\-acc\-supp}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{options}\margm{PDF element}\margm{value}}
    \desc{used by \gls{glsshowtarget} in outer mode}
  }
  % COMMANDS: OTHER
  % \glspatchtabularx
  \gcmd{gls\-patch\-tab\-u\-larx}%
  {%
    \providedby{\sty{glossaries} v4.28+}
    \desc{patches \sty{tabularx} (if it has been loaded) to prevent
    the \idx{firstuseflag} from being unset while \env{tabularx} is
    calculating the column widths}
  }
  % \GlsXtrSetField
  \gxtrcmd{Gls\-Xtr\-Set\-Field}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
     \syntax{\margm{entry-label}\margm{field-label}\margm{value}}
     \desc{assigns \meta{value} to the field identified by its
     \idxc{internalfieldlabel}{internal label} \meta{field-label}
     for the entry identified by \meta{entry-label}. An error (or
     warning with \optval{undefaction}{warn}) occurs
     if the entry hasn't been defined}
  }
  % \xGlsXtrSetField
  \gxtrcmd{xGls\-Xtr\-Set\-Field}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
     \syntax{\margm{entry-label}\margm{field-label}\margm{value}}
     \desc{as \gls{GlsXtrSetField} but expands the value and uses a
      global assignment}
  }
  % \glsFindWidestUsedTopLevelName
  \gxtrcmd{gls\-Find\-Widest\-Used\-Top\-Level\-Name}
  { 
    \providedby{\sty{glossaries-extra-stylemods} v1.05+}
    \syntax{\oargm{glossary labels}}
    \desc{finds and sets the widest name for all top-level entries
    that have been marked as \idxc{firstuseflag}{used} in the given \idxpl{glossary}}
  } 
  % \glsFindWidestUsedLevelTwo
  \gxtrcmd{gls\-Find\-Widest\-Used\-Level\-Two}
  {
    \providedby{\sty{glossaries-extra-stylemods} v1.05+}
    \syntax{\oargm{glossary labels}}
    \desc{finds and sets the widest name for all entries
    that have been marked as \idxc{firstuseflag}{used} with
    \idx{hierarchicallevel} less than or equal to 2 in the given \idxpl{glossary}}
  }
  % \glsdefpostdesc
  \gxtrcmd{gls\-def\-post\-desc}{%
    \providedby{\sty{glossaries-extra} v1.31+}
    \syntax{\margm{category}\margm{definition}}
    \desc{defines \idx{postdeschook} associated with the category
    identified by the label \meta{category}}
  }
  % \glsxtrbookindexname
  \gxtrcmd{gls\-xtr\-book\-index\-name}
  {
    \providedby{\sty{glossary-bookindex} v1.21+}
    \syntax{\margm{entry-label}}
    \desc{used by the \glostyle{bookindex} style to display a
     top-level entry's name}
  }
  % \glossentrynameother
  \gxtrcmd{gloss\-entry\-name\-other}
  {%
    \providedby{\sty{glossaries-extra} v1.22+}
    \syntax{\margm{entry-label}\margm{field-label}}
    \desc{behaves like \gls{glossentryname} but uses the given field
     (identified by its \idxc{internalfieldlabel}{internal label})
     instead of \gloskey{name}}
  }
  % \glslongfont
  \gxtrcmd{gls\-long\-font}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{text}}
     \desc{font formatting command for the long form, initialised by
      the abbreviation style}
  }
  % \glsxtrfullsep
  \gxtrcmd{gls\-xtr\-full\-sep}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{Separator used by the parenthetical inline full
      and also for some display full forms}
  }
  % \glsxtrparen
  \gxtrcmd{gls\-xtr\-paren}
  {
    \providedby{\sty{glossaries-extra} v1.17+}
     \syntax{\margm{text}}
     \desc{used to encapsulate \meta{text} in parentheses}
  }
  % \glsabbrvfont
  \gcmd{gls\-abbrv\-font}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{text}}
     \desc{font formatting command for the short form, initialised by
      the abbreviation style} 
  }  
  % \glsxtrfootnotedescsort
  \gxtrcmd{gls\-xtr\-foot\-note\-desc\-sort}
  {
    \providedby{\sty{glossaries-extra} v1.42+}
    \desc{expands to the sort value for footnote styles like
     \abbrstyle{short-footnote-desc}}
  } 
  % \glsxtrabbrvfootnote
  \gxtrcmd{gls\-xtr\-abbrv\-foot\-note}
  {
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{entry-label}\margm{text}}
    \desc{command that produces the footnote for the footnote
    abbreviation styles, such as \abbrstyle{footnote}
    and \abbrstyle{postfootnote}}
  }
  % \glsxtrfootnotedescname
  \gxtrcmd{gls\-xtr\-foot\-note\-desc\-name}
  {
    \providedby{\sty{glossaries-extra} v1.42+}
    \desc{expands to the name value for styles like
     \abbrstyle{short-footnote-desc}}
  }
  % \glsfirstabbrvscfont
  \gxtrcmd{gls\-first\-abbrv\-sc\-font}
  {
    \providedby{\sty{glossaries-extra} v1.17+}
     \syntax{\margm{text}}
     \desc{short form font used by the \idx{smallcaps} \qt{sc} abbreviation
     styles on \idx{firstuse}}
  }
  % \Glsfmtlong
  \gxtrcmd{Gls\-fmt\-long}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \idx{sentencecase} long form}
  } 
  % \glsfmtshort
  \gxtrcmd{gls\-fmt\-short}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted short form}
  } 
  % \glsxtrdopostpunc
  \gxtrcmd{gls\-xtr\-do\-post\-punc}{%
     \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{code}\meta{token}}
    \desc{if \meta{token} is a recognised punctuation character
     this does the punctuation character and then \meta{code}, 
     otherwise if does \meta{code} followed by \meta{token}}
  }
  % \glsxtrinlinefullformat
  \gxtrcmd{gls\-xtr\-in\-line\-full\-format}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{glsxtrfull} to display the inline full
     form (defined by the abbreviation style)}
  }
  % \glsxtrinlinefullplformat
  \gxtrcmd{gls\-xtr\-in\-line\-full\-pl\-format}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{glsxtrfullpl} to display the plural inline
full
     form (defined by the abbreviation style)}
  }
  % \Glsxtrinlinefullformat
  \gxtrcmd{Gls\-xtr\-in\-line\-full\-format}
  {
    %\providedby{\sty{glossaries-extra} v1.0+}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{Glsxtrfull} to display the
\idx{sentencecase} inline full
     form (defined by the abbreviation style)}
  }
  % \Glsxtrinlinefullplformat
  \gxtrcmd{Gls\-xtr\-in\-line\-full\-pl\-format}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{Glsxtrfullpl} to display the plural \idx{sentencecase} 
     inline full form (defined by the abbreviation style)}
  }
  % \glsfirstlongfootnotefont
  \gxtrcmd{gls\-first\-long\-foot\-note\-font}
  {
    \providedby{\sty{glossaries-extra} v1.05+}
    \syntax{\margm{text}}
    \desc{formatting command for the \idx{firstuse} long form 
     used by the footnote abbreviation styles}
  }
  % \ifglsxtrinsertinside
  \gxtrcmd{if\-gls\-xtr\-insert\-inside}
  {
    \providedby{\sty{glossaries-extra} v1.02}
    \initval{\csfmt{iffalse}}
    \syntax{\conditionsyntax}
    \desc{a conditional used by the predefined abbreviation styles to determine
     whether the \meta{insert} part should go inside or outside of the style's font 
     formatting commands}
  }
  % \glscategory
  \gxtrcmd{gls\-category}
  {
     \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{expands to the entry's category}
  } 
  % \glssetcategoryattribute
  \gxtrcmd{gls\-set\-category\-attribute}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{category}\margm{attribute}\margm{value}}
     \desc{locally sets the given \idxc{categoryattribute}{attribute}
      to \meta{value} for the given category}
  }
  % \bibglsdelimN
  \gxtrcmd{bib\-gls\-delimN}
  {
     \providedby{\app{bib2gls}}
     \initval{\gls{delimN}}
     \desc{delimiter used between \locations\ in the \idx{locationlist},
      except for the last pair}
  }
  % \bibglslastDelimN
  \gxtrcmd{bib\-gls\-last\-DelimN}
  {
     \providedby{\app{bib2gls}}
     \initval{\gls{delimN}}
     \desc{delimiter used between the last pair of \locations\ in the \idx{locationlist}}
  }
  % \glsxtrGeneralLatinAtoGrules
  \gxtrcmd{gls\-xtr\-General\-Latin\-A\-to\-G\-rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{expands to the A--G subset of General Latin I sort rules}
  }
  % \glsxtrGeneralLatinNtoZrules
  \gxtrcmd{gls\-xtr\-General\-Latin\-N\-to\-Z\-rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{expands to the N--Z subset of General Latin I sort rules}
  }
  % \glsxtrIgnorableRules
  \gxtrcmd{gls\-xtr\-Ignorable\-Rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{a shortcut that expands to the control rules, space rules
     and non-printable rules}
  }
  % \glsxtrGeneralInitRules
  \gxtrcmd{gls\-xtr\-General\-Init\-Rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{a shortcut that expands to the ignorable rules, 
     combining diacritic rules, hyphen rules, general punctuation 
    rules, digit rules, and fraction rules}
  }
  % \GlsXtrIfFieldEqNum
  \gxtrcmds{Gls\-Xtr\-If\-Field\-Eq\-Num}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{number}\margm{true}\margm{false}}
     \desc{compares the numeric value stored in the given field with
      \meta{number}}
  }
  % \GlsXtrIfFieldNonZero
  \gxtrcmds{Gls\-Xtr\-If\-Field\-Non\-Zero}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
     \desc{tests if the numeric value stored in the given field is non-zero}
  }
  % \GlsXtrIfFieldEqStr
  \gxtrcmds{Gls\-Xtr\-If\-Field\-Eq\-Str}
  {
     \providedby{\sty{glossaries-extra} v1.21+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{value}\margm{true}\margm{false}}
     \desc{tests if the entry given by \meta{entry-label} has the
    \idx{field} identified by its \idxc{internalfieldlabel}{internal label}
    \meta{field-label} set to \meta{value}}
  } 
  % \GlsXtrIfXpFieldEqXpStr
  \gxtrcmds{Gls\-Xtr\-If\-Xp\-Field\-Eq\-Xp\-Str}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{value}\margm{true}\margm{false}}
     \desc{like \gls{GlsXtrIfFieldEqStr} but first (protected) expands
      both the field value and the supplied \meta{value}}
  }
  % \glsxtrfieldforlistloop
  \gxtrcmd{gls\-xtr\-field\-for\-list\-loop}
  {
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\margm{entry-label}\margm{field}\margm{handler-cs}}
    \desc{iterates over the given field's value using
    \sty{etoolbox}['s] \gls{forlistcsloop}}
  }
  % \glssentencecase
  \gcmd{gls\-sentence\-case}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{text}}
    \desc{used by \idx{sentencecase} commands, such as \gls{Gls}, to
    perform the \idx{casechange}. This is simply defined to use
    \gls{makefirstuc}}
  }
  % \glscapitalisewords
  \gcmd{gls\-capitalise\-words}
  { 
    \providedby{\sty{glossaries} v4.48+}
    \syntax{\margm{content}}
    \desc{just does \gls{capitalisewords} but may be redefined to
    use \gls{capitalisefmtwords}, if required}
  }
  % \glsentrytitlecase
  \gcmd{gls\-entry\-title\-case}%
  {%
    \syntax{\margm{entry-label}\margm{field}}
    \providedby{\sty{glossaries} v4.22+}
    \desc{applies \idx+{titlecase} to the given field using
    \gls{glscapitalisewords} or \idx{sentencecase} in \idxpl{PDFbookmark}}
  }
  % \glslowercase
  \gcmd{gls\-lower\-case}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{text}}
    \desc{converts \meta{text} to \idx+{lowercase} using the modern \LaTeX3
    \casechanging\ command, which is expandable}
  }
  % \glsuppercase
  \gcmd{gls\-upper\-case}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{text}}
    \desc{converts \meta{text} to \idx+{uppercase} using the modern \LaTeX3
    \casechanging\ command, which is expandable}
  }
  % COMMANDS: DEPRECATED
  % \glsifhyper
  \gcmd{gls\-if\-hyper}
  {
    \deprecated
    \desc{this was originally used in \gls{glsgenentryfmt} to test
     if the \glsopt{hyper} option was set. Deprecated in v4.08 and
     removed in v4.50. Use \gls{glsifhyperon} instead}
  }
  % \glsdisplayfirst
  \gcmd{gls\-display\-first}
  {
    \deprecated
    \desc{this was originally used to format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{glsentryfmt}}
  }
  % \glsdisplay
  \gcmd{gls\-display}
  {
    \deprecated
    \desc{this was originally used to format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{glsentryfmt}}
  }
  % \defglsdisplay
  \gcmd{def\-gls\-display}
  {
    \deprecated
    \desc{this was originally used to define a format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{defglsentryfmt}}
  }
  % \defglsdisplayfirst
  \gcmd{def\-gls\-display\-first}
  {
    \deprecated
    \desc{this was originally used to define a format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{defglsentryfmt}}
  }
  % \SetAcronymStyle
  \gcmd{Set\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.04}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetCustomStyle
  \gcmd{Set\-Custom\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.06}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \SetDefaultAcronymStyle
  \gcmd{Set\-Default\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.04}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \code{\gls{setacronymstyle}\marg{\acrstyle{long-short}}}}
  }
  % \DefaultNewAcronymDef
  \gcmd{Default\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \CustomNewAcronymDef
  \gcmd{Custom\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.06}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \CustomAcronymFields
  \gcmd{Custom\-Acronym\-Fields}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.06}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \SetDUAStyle
  \gcmd{Set\-DUA\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \SetDescriptionFootnoteAcronymDisplayStyle
  \gcmd{Set\-Description\-Foot\-note\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DescriptionFootnoteNewAcronymDef
  \gcmd{Description\-Foot\-note\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionFootnoteAcronymStyle
  \gcmd{Set\-Description\-Footnote\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionDUAAcronymDisplayStyle
  \gcmd{Set\-Description\-DUA\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DescriptionDUANewAcronymDef
  \gcmd{Description\-DUA\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionDUAAcronymStyle
  \gcmd{Set\-Description\-DUA\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionAcronymDisplayStyle
  \gcmd{Set\-Description\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DescriptionNewAcronymDef
  \gcmd{Description\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionAcronymStyle
  \gcmd{Set\-Description\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetFootnoteAcronymDisplayStyle
  \gcmd{Set\-Footnote\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \FootnoteNewAcronymDef
  \gcmd{Foot\-note\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetFootnoteAcronymStyle
  \gcmd{Set\-Footnote\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetSmallAcronymDisplayStyle
  \gcmd{Set\-Small\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SmallNewAcronymDef
  \gcmd{Small\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetSmallAcronymStyle
  \gcmd{Set\-Small\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDUADisplayStyle
  \gcmd{Set\-DUA\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DUANewAcronymDef
  \gcmd{DUA\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \acrlinkfullformat
  \gcmd{acr\-link\-full\-format}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \syntax{\margm{internal long cs}\margm{internal short
      cs}\margm{options}\margm{entry-label}\margm{insert}}
    \desc{deprecated with the introduction of \gls{setacronymstyle} 
     but used in the initial definition of commands like
     \gls{acrfullfmt} before they are redefined by the
     \idx{acronymstyle}.  This may be removed in a future release}
  }
  % \acrfullformat
  \gcmd{acr\-full\-format}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \syntax{\margm{long text}\margm{short text}}
    \desc{deprecated with the introduction of \gls{setacronymstyle} 
     but used in the initial definition of commands like
     \gls{glsentryfmt} before they are redefined by the
     \idx{acronymstyle}.  This may be removed in a future release}
  }
  % OPTIONS
  % print*glossary options
  \gidxpl{printglossopt}{
    \field{text}{\NoCaseChange{\glsentrytext{print...glossary}} option}%
    \desc{most (but not all) of these options can be used in the optional argument
    of all the \gls+{print...glossary} commands}
  }
  % printgloss type
  \gprintglossopt{type}{%
    \syntax{\meta{glossary-label}}
    \defval{\gls{glsdefaulttype}}%
    \desc{identifies the \idx{glossary} to display}}
  % printgloss sort
  \gprintglossopt{sort}{%
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\meta{method}}
    \desc{only available with \gls{printnoidxglossary}, this
    indicates how the \idx{glossary} should be ordered}}
  % printgloss sort=word
  \goptval{printgloss.sort}{word}%
  {%
     \desc{word order}
  }
  % printgloss sort=letter
  \goptval{printgloss.sort}{letter}%
  {%
     \desc{letter order}
  }
  % printgloss sort=standard
  \goptval{printgloss.sort}{standard}%
  {%
     \desc{word or letter order according to the \opt{order} package option}
  }
  % printgloss sort=use
  \goptval{printgloss.sort}{use}%
  {%
     \desc{order of use}
  }
  % printgloss sort=def
  \goptval{printgloss.sort}{def}%
  {%
     \desc{order of definition}
  }
  % printgloss sort=case
  \goptval{printgloss.sort}{case}%
  {%
     \desc{case-sensitive sort}
  }
  % printgloss sort=nocase
  \goptval{printgloss.sort}{nocase}%
  {%
     \desc{case-insensitive sort}
  }
  % printgloss title
  \gprintglossopt{title}{%
    \syntax{\meta{text}}
    \desc{sets the glossary title (overriding the default)}}
  % printgloss toctitle
  \gprintglossopt{toc\-title}{%
    \providedby{\sty{glossaries} v3.03+}
    \syntax{\meta{text}}
    \desc{sets the glossary toc title (overriding the default)}}
  % printgloss style
  \gprintglossopt{style}{%
    \syntax{\meta{style-name}}
    \desc{use the \meta{style-name} \idx{glossarystyle}}
  }
  % printgloss numberedsection
  \gprintglossopt{numbered\-section}{%
    \providedby{\sty{glossaries} v1.14+}
    \syntax{\meta{value}}
    \initval{false}%
    \defval{nolabel}%
    \desc{indicates whether or not \idx{glossary} section headers will be numbered
     and also if they should automatically be labelled.
     The \opt{numberedsection} package option will change the default
     setting to match}
  }
  % printgloss nogroupskip
  \gprintglossopt{no\-group\-skip}{%
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, suppress the gap implemented by some \idxpl{glossarystyle}
     between \idxpl{group}}
  }
  % printgloss nopostdot
  \gprintglossopt{no\-post\-dot}{%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, suppress the post-description punctuation}
  }
  % printgloss entrycounter
  \gprintglossopt{entry\-counter}{%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, enable the entry counter}
  }
  % printgloss subentrycounter
  \gprintglossopt{sub\-entry\-counter}{%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, enable the sub-entry counter}
  }
  % printgloss nonumberlist
  \gprintglossopt{no\-number\-list}{%
    \providedby{\sty{glossaries} v1.14+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{suppress the \gls{locationlist}. Note that
     \printglossoptval{nonumberlist}{true}
     will have no effect with the \resourceopt{save-locations}{false}
     \idx{resourceopt} as there won't be any \glspl{locationlist} to
     display. Likewise if \gls{printunsrtglossary} is used without
    \app{bib2gls}}
  }
  % printgloss label
  \gxtrprintglossopt{label}{%
    \providedby{\sty{glossaries-extra} v1.39+}
    \syntax{\meta{label}}
    \desc{adds \code{\gls{label}\margm{label}} to the start of the
    \idx{glossary} (after the title)}
  }
  % printgloss target
  \gxtrprintglossopt{target}{%
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\meta{boolean}}
    \initval{true}% 
    \defval{true}%
    \desc{if true, each entry in the \idx{glossary} should have a
    hypertarget created, if supported by the \idx{glossarystyle} and if
    \idxpl{hyperlink} are enabled}
  } 
  % printgloss prefix
  \gxtrprintglossopt{prefix}{%
    \providedby{\sty{glossaries-extra} v1.31+}
    \syntax{\meta{prefix}}
    \desc{redefines \gls{glolinkprefix} to \meta{prefix}}
  }
  % printgloss targetnameprefix
  \gxtrprintglossopt{target\-name\-prefix}{%
    \providedby{\sty{glossaries-extra} v1.20+}
    \syntax{\meta{prefix}}
    \desc{inserts \meta{prefix} at the start of the hypertarget names}}
  % printgloss leveloffset
  \gxtrprintglossopt{level\-offset}{%
    \providedby{\sty{glossaries-extra} v1.44+}
    \syntax{\meta{offset}}
    \initval{0}%
    \desc{set or increment the \gls{hierarchicallevel} offset. If
    \meta{offset} starts with \code{++} then the current offset is
    incremented by the given amount otherwise the current offset is
    set to \meta{offset}. For example, an entry with a normal
    \gls{hierarchicallevel} of 1 will be treated as though it has
    \gls{hierarchicallevel} $1+\meta{offset}$. This option is only available for the
    \qt{unsrt} commands}%
  }
  % printgloss groups
  \gxtrprintglossopt{groups}{%
    \providedby{\sty{glossaries-extra} v1.44+}
    \syntax{\meta{boolean}}
    \initval{true}%
    \defval{true}%
    \desc{enables \idx{lettergroup} formation. This option is only available for the
    \qt{unsrt} commands. Note that no \idxpl{group} will be formed when
    invoking \app{bib2gls} with the default \switch{no-group}, regardless of
    this setting}
  }
  % printgloss flatten
  \gxtrprintglossopt{flatten}{%
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, treats all entries as though they have the same
      hierarchical level (the value of \printglossopt{leveloffset}).
      This option is only available for the \qt{unsrt} commands}
  }
  % COUNTERS
  % counter: glossaryentry
  \gctr{glossary\-entry}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \desc{defined if \optval{entrycounter}{true}}
  }
  % counter: glossarysubentry
  \gctr{glossary\-sub\-entry}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \desc{defined if \optval{subentrycounter}{true}}
  }
  % counter wrglossary
  \gxtrctr{wr\-glossary}
  {
    \providedby{\sty{glossaries-extra}}
    \desc{a counter that is incremented every time an entry is \indexed}
  }
  % ENVIRONMENTS
  % theglossary
  \genv{the\-glossary}
  {
    \providedby{\sty{glossaries}}
    \desc{redefined by the \idxpl{glossarystyle} to format the
    \idx{glossary} according to the style specifications. 
     The entire \idx{glossary} content (not including
     the section header, \idx{glossarypreamble} and \idx{postamble}) is contained
     within this environment}
    \note{\idx{glossarystyle} environment}
  }
  % PACKAGE OPTIONS
  % package option nolangwarn
  \gstyopt{no\-lang\-warn}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.33+}
    \desc{suppresses the warning if no language support is found}
  }
  % package option disablemakegloss
  \gstyopt{disable\-make\-gloss}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.45+}
    \desc{disables \gls{makeglossaries}}
  }
  % package option restoremakegloss
  \gstyopt{restore\-make\-gloss}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.45+}
    \desc{cancels the effect of \opt{disablemakegloss}}
  }
  % package option prefix
  \gxtrstyopt{prefix}
  {%
    \providedby{\sty{glossaries-extra} v1.42+}
    \inpackage{glossaries-extra}
    \desc{loads \sty{glossaries-prefix}}
  }
  % package option accsupp
  \gxtrstyopt{accsupp}
  {%
    \inpackage{glossaries-extra}
    \desc{loads \sty{glossaries-accsupp}}
  }
  % package option nomissingglstext
  \gxtrstyopt{no\-missing\-gls\-text}%
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{determines whether or not to display warning text if the
     external \idx{indexingfile} hasn't been generated due to an
     incomplete build}
  }
  % package option style
  \gstyopt{style}%
  {%
    \inpackage{glossaries}%
    \syntax{\meta{style-name}}
    \initvalvaries
    \desc{sets the default \idx{glossarystyle} to \meta{style-name}}%
  }
  % package option nostyles
  \gstyopt{nostyles}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load the default set of predefined styles. Note that
    if \sty{glossaries} is loaded before \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option nolist
  \gstyopt{nolist}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-list}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option nolong
  \gstyopt{nolong}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-long}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option nosuper
  \gstyopt{nosuper}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-super}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option notree
  \gstyopt{notree}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-tree}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option stylemods
  \gxtrstyopt{stylemods}
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{list}}
    \defval{default}
    \desc{loads \sty{glossaries-extra-stylemods} with the given
    options. If \optval{stylemods}{default} then no options are
    passed to \sty{glossaries-extra-stylemods}}
  }
  % package option section
  \gstyopt{section}
  {
    \inpackage{glossaries}%
    \syntax{\meta{name}}
    \defval{section}
    \desc{indicates which section heading command to use for the
    \idx{glossary}. The value may be one of the standard sectioning
    command's control sequence name (without the leading backslash),
    such as \code{chapter} or \code{section}}
  }
  % package option sort
  \gstyopt{sort}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}%
    \syntax{\meta{value}}
    \initval{standard}
    \desc{indicates how the \gloskey{sort} key should automatically
     be assigned if not explicitly provided (for \gls{makeglossaries}
     and \gls{makenoidxglossaries} only)}
  }
  \goptval{sort}{none}%
  {%
    \providedby{\sty{glossaries} v4.30+}
    \desc{don't process the \gloskey{sort} key. Use this option if no 
     \idx{indexing} is required for a slightly faster build}%
  }
  \goptval{sort}{clear}%
  {%
    \providedby{\sty{glossaries} v4.50+}
    \desc{sets the \gloskey{sort} key to an empty value. Use this option if no 
     \idx{indexing} is required for a slightly faster build}%
  }
  \goptval{sort}{standard}%
  {%
    \desc{use the value of the \gloskey{name} key as the default for the
     \gloskey{sort} key and implement the \gls{glsprestandardsort} hook}%
  }
  \goptval{sort}{def}%
  {%
    \desc{use the (zero-padded) order of definition as the default for the
     \gloskey{sort} key}%
  }
  \goptval{sort}{use}%
  {%
    \desc{use the (zero-padded) order of use as the default for the
     \gloskey{sort} key}%
  }
  % package option sanitizesort
  \gstyopt{sanitize\-sort}%
  {%
    \inpackage{glossaries}%
    \syntax{\meta{boolean}}
    \initvalvaries
    \defval{true}
    \desc{indicates whether the default sort value should be sanitized
      (only applicable with \opteqvalref{sort}{standard})}
  }
  % package option debug
  \gstyopt{debug}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \initval{false}%
    \syntax{\meta{value}}
    \inpackage{glossaries}
    \desc{adds markers to the document for debugging purposes}
  }
  % package option debug values
  \goptval{debug}{true}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \desc{writes \code{wrglossary(\meta{type})(\meta{\idx{indexing} info})}
    to the \ext+{log} file if there is an attempt to index an entry
    before the associated \idx{indexingfile} has been opened (\app{makeindex}
    and \app{xindy} only). With \sty{glossaries-extra}, this setting will
    also display the label of any undefined entries that are
    referenced in the document}
  }
  \goptval{debug}{false}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \desc{disable debugging actions}
  }
  \goptval{debug}{showtargets}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \desc{implements \optval{debug}{true} and also shows target
     markers in the document}%
  }
  \goptval{debug}{showaccsupp}%
  {%
    \providedby{\sty{glossaries} v4.45+}%
    \desc{implements \optval{debug}{true} and also shows accessibility information
    in the document}
  }
  % package option order
  \gstyopt{order}
  {
    \providedby{\sty{glossaries} v1.17+}%
    \inpackage{glossaries}
    \initval{word}
    \desc{indicates whether word or letter order should be used.
    With \options{mkidx,xdy}, this information is written to the
    \ext{aux} file, where it can be picked up by
    \app{makeglossaries}. This option will have no effect if you call
    \app{makeindex} or \app{xindy} explicitly}
  }
  \goptval{order}{word}%
  {%
    \desc{word order (\qt{sea lion} before \qt{seal})}
  }
  \goptval{order}{letter}%
  {%
    \desc{letter order (\qt{seal} before \qt{sea lion})}
  }
  % package option makeindex
  \gstyopt{makeindex}
  {
    \inpackage{glossaries}
    \desc{indicates that the \idx{indexing} should be performed by
     \app+{makeindex} (default)}
    \note{\option{mkidx}}
  }
  % package option xindy
  \gstyopt{xindy}
  {
    \syntax{\margm{options}}
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v1.17+}%
    \desc{indicates that the \idx{indexing} should be performed by \app+{xindy}}
    \note{\option{xdy}}
  }
  % package option xindy values
  \gopt{xindy.glsnumbers}%
  {%
    \parent{opt.xindy}
    \name{\optfmt{glsnumbers}}
    \syntax{\margm{boolean}}
    \initval{true}
    \defval{true}
    \desc{indicates whether or not to add the \code{glsnumbers} \idx{lettergroup}}
  }
  \gopt{xindy.language}%
  {%
    \parent{opt.xindy}
    \name{\optfmt{language}}
    \syntax{\margm{value}}
    \desc{sets the \app{xindy} language module. Only
     applicable if you use \app{makeglossaries} or \opt{automake}}
  }
  \gopt{xindy.codepage}%
  {%
    \parent{opt.xindy}
    \name{\optfmt{codepage}}
    \syntax{\margm{value}}
    \desc{sets the \app{xindy} \idx+{codepage}. Defaults to
     \code{utf8} if \gls{inputencodingname} isn't defined. Only
     applicable if you use \app{makeglossaries} or \opt{automake}}
  }
  % package option xindynoglsnumbers
  \gstyopt{xindy\-no\-gls\-numbers}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.02+}%
    \desc{equivalent to \optvalm{xindy}{\styoptxdyval{glsnumbers}{false}}}
    \note{\option{xdy}}
  }
  % package option xindygloss
  \gstyopt{xindy\-gloss}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v3.14a+}%
    \desc{equivalent to \opt{xindy} with no value}
    \note{\option{xdy}}
  }
  % package option indexonlyfirst
  \gstyopt{index\-only\-first}%
  {%
    \providedby{\sty{glossaries} v3.02+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{indicates whether or not to only \idxc{indexing}{index}
    the \idx{firstuse}}
  }
  % package option seenoindex
  \gstyopt{see\-no\-index}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \syntax{\meta{value}}
    \initval{error}
    \inpackage{glossaries}
    \desc{indicates what to do if the \gloskey{see} key is used
    before the associated \idxpl{indexingfile} have been opened by
     \gls{makeglossaries}}
  }
  \goptval{seenoindex}{error}%
  {%
    \desc{triggers an error if the \gloskey{see} key is used before
      \gls{makeglossaries}}
  }
  \goptval{seenoindex}{warn}%
  {%
    \desc{triggers a warning if the \gloskey{see} key is used before
      \gls{makeglossaries}}
  }
  \goptval{seenoindex}{ignore}%
  {%
    \desc{does nothing if the \gloskey{see} key is used before
      \gls{makeglossaries}}
  }
  % package option esclocations
  \gstyopt{esc\-locations}%
  {%
    \providedby{\sty{glossaries} v4.33+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, escapes \locations\ before \idx{indexing}}
  }
  % package option savenumberlist
  \gstyopt{save\-number\-list}%
  {%
    \providedby{\sty{glossaries} v3.02+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, save \idxpl{numberlist}. Only applicable with
     \options{mkidx,xdy} as \options{noidx,b2g} have the
     \idx{numberlist} stored in the \glosfield{loclist} field and
     \option{b2g} also has the formatted \idx{numberlist} in the
     \gloskey{location} field}
    \note{\options{mkidx,xdy} only}
  }
  % package option autoseeindex
  \gxtrstyopt{auto\-see\-index}%
  {%
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \inpackage{glossaries-extra}
    \desc{indicates whether or not to enable automatic \idx{indexing} of
    \gloskey{see} and \gloskey{seealso} fields}
  }
  % package option indexcrossrefs
  \gxtrstyopt{index\-cross\-refs}%
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{if true, automatically indexes cross references at the end
     of the document}
  }
  % package option record
  \gxtrstyopt{record}%
  {%   
    \syntax{\meta{value}}
    \initval{off}
    \defval{only}
    \inpackage{glossaries-extra}
    \desc{indicates whether or not \app{bib2gls} is being used (in
    which case entry \idx{indexing} is performed by adding \app{bib2gls}
    \records\ in the \ext{aux} file)}
  }
  % package option record=off
  \gxtroptval{record}{off}%
  {%
    \desc{entry \idx{indexing} is performed as per the base \sty{glossaries} package, using
       either \gls{makeglossaries} or \gls{makenoidxglossaries}}
  }
  % package option record=only
  \gxtroptval{record}{only}%
  {%
    \desc{entry \idx{indexing} is performed by adding \app{bib2gls}
     \records\ in the \ext{aux} file. Glossaries should be displayed with the \idx{unsrtfam}}
  }
  % package option record=nameref
  \gxtroptval{record}{name\-ref}%
  {%
    \desc{entry \idx{indexing} is performed by adding \app{bib2gls}
     nameref \records\ in the \ext{aux} file. Glossaries should be displayed with the \idx{unsrtfam}}
  }
  % package option record=hybrid
  \gxtroptval{record}{hybrid}%
  {%
    \desc{performs a mixture of \app{bib2gls} \records\ in the
     \ext{aux} file (to select entries from a \ext{bib} file)
     and \app{makeindex}\slash\app{xindy}
     \idx{indexing} in their associated files. This option is best
     avoided}
  }
  % package option equations
  \gxtrstyopt{equations}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries-extra}
    \desc{automatically switch the \idx{locationcounter} to
    \ctr{equation} when inside a numbered equation environment}
  }
  % package option floats
  \gxtrstyopt{floats}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries-extra}
    \desc{automatically switch the \idx{locationcounter} to
    the corresponding counter when inside a floating environment}
  }
  % package option indexcounter
  \gxtrstyopt{index\-counter}
  {
    \inpackage{glossaries-extra}
    \desc{defines the index counter \ctr{wrglossary} and implements
     \optval{counter}{wrglossary}}
  }
  % package option numberedsection
  \gstyopt{numbered\-section}
  {
    \providedby{\sty{glossaries} v1.1+}
    \syntax{\meta{value}}
    \initval{false}
    \defval{nolabel}
    \inpackage{glossaries}
    \desc{indicates whether or not \idx{glossary} section headers will be numbered
     and also if they should automatically be labelled}
  }
  \goptval{numberedsection}{false}%
  {
    \desc{use unnumbered sectional units for \idxpl{glossary}}
  }
  \goptval{numberedsection}{no\-label}% nolabel
  {
    \desc{use numbered sectional units for \idxpl{glossary} but no label}
  }
  \goptval{numberedsection}{auto\-label}% autolabel
  {
    \desc{use numbered sectional units for \idxpl{glossary} and
     automatically add a label based on the \idx{glossary} label}
  }
  \goptval{numberedsection}{nameref}% nameref
  {
    \desc{use unnumbered sectional units for \idxpl{glossary} and
     automatically add a label based on the \idx{glossary} label}
  }
  % package option savewrites
  \gstyopt{save\-writes}
  {
    \providedby{\sty{glossaries} v3.0+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, \idx{indexing} information is stored until the end of
    the document to reduce the number of write registers}
  }
  % package option counter
  \gstyopt{counter}%
  {%
    \inpackage{glossaries}%
    \syntax{\meta{counter-name}}
    \initval{page}
    \desc{sets the default \idx{locationcounter}}%
  }
  % package option nonumberlist
  \gstyopt{no\-number\-list}%
  {
    \inpackage{glossaries}
    \desc{set no \glspl{locationlist} as the default for all
     \idxpl{glossary}. May be overridden for individual \idxpl{glossary} with
     \printglossoptval{nonumberlist}{true}}
  }
  % package option seeautonumberlist
  \gstyopt{see\-auto\-number\-list}%
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v3.0+}
    \desc{automatically adds \gloskeyval{nonumberlist}{false} to 
    any \idxpl{entry} with the \gloskey{see} key set}
  }
  % package option entrycounter
  \gstyopt{entry\-counter}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{enables the entry counter for top-level entries}
  }
  % package option counterwithin
  \gstyopt{counter\-within}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}
    \syntax{\meta{parent-counter}}
    \desc{sets the parent counter for \ctr{glossaryentry}}
  }
  % package option subentrycounter
  \gstyopt{sub\-entry\-counter}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{enables the entry counter for level~1 entries}
  }
  % package option writeglslabels
  \gstyopt{write\-gls\-labels}%
  {
    \providedby{\sty{glossaries} v4.45+}%
    \inpackage{glossaries}
    \desc{creates a file called \code{\gls{jobname}.\ext+{glslabels}}
     that contains all defined entry labels (for the benefit of
     \idx{auto-completion} tools)}
  }
  % package option writeglslabelnames
  \gstyopt{write\-gls\-label\-names}%
  {
    \providedby{\sty{glossaries} v4.47+}%
    \inpackage{glossaries}
    \desc{creates a file called \code{\gls{jobname}.\ext+{glslabels}}
     that contains all defined entry labels and names (for the benefit of
     \idx{auto-completion} tools)}
  }
  % package option nomain
  \gstyopt{nomain}%
  {%
    \providedby{\sty{glossaries} v2.01+}%
    \inpackage{glossaries}%
    \desc{prevents the definition of the \glostype+{main} \idx{glossary}. You
    will need to define another \idx{glossary} to use instead. For
    example, with the \opt{acronyms} package option}%
  }
  % package option acronymlists
  \gstyopt{acronym\-lists}%
  {
    \providedby{\sty{glossaries} v2.04+}%
    \inpackage{glossaries}
    \syntax{\margm{label-list}}
    \desc{identifies the \idxpl{glossary} that contain \idxpl{acronym}
    (defined with the base \sty{glossaries} packages \idx{acronym} mechanism)}
  }
  % package option shortcuts
  \gstyopt{shortcuts}%
  {
    \inpackage{glossaries}
    \syntax{\margm{boolean}}
    \initval{false}
    \defval{false}
    \desc{defines various shortcut commands. Has additional values
with \sty{glossaries-extra}}
  }
  % package option acronyms
  \gstyopt{acronyms}%
  {
    \providedby{\sty{glossaries} v3.14a+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \glostype+{acronym},
     redefines \gls{acronymtype} to \code{acronym}, and provides
     \gls{printacronyms}}
  }
  % package option acronym
  \gstyopt{acronym}%
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, provides a new \idx{glossary} with the label
     \glostype+{acronym} and title given by \gls{acronymname},
     redefines \gls{acronymtype} to \code{acronym}, and provides
     \gls{printacronyms}}
  }
  % package option abbreviations
  \gxtrstyopt{abbreviations}%
  {
    \inpackage{glossaries-extra}
    \desc{provides a new \idx{glossary} with the label
     \glostype{abbreviations} and title given by \gls{abbreviationsname},
     redefines \gls{glsxtrabbrvtype} to \glostype{abbreviations},
     redefines \gls{acronymtype} to \gls{glsxtrabbrvtype} (unless
     the \opt{acronym} or \opt{acronyms} option has been used), and provides
     \gls{printabbreviations}}
  }
  % package option symbols
  \gstyopt{symbols}%
  {
    \providedby{\sty{glossaries} v3.11a+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \glostype{symbols} and
     the title \gls{glssymbolsgroupname}, and provides
     \gls{printsymbols}. With \sty{glossaries-extra}, this additionally
     defines \gls{glsxtrnewsymbol}}
  }
  % package option numbers
  \gstyopt{numbers}%
  {
    \providedby{\sty{glossaries} v3.11a+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \code{numbers} and
     the title \gls{glsnumbersgroupname}, and provides \gls{printnumbers}.
     With \sty{glossaries-extra}, this additionally
     defines \gls{glsxtrnewnumber}}
  }
  % package option index
  \gstyopt{index}%
  {
    \providedby{\sty{glossaries} v4.02+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \code{index} and
     the title \gls{indexname}, and provides \gls{printindex} and
     \gls{newterm}}
  }
  % package option noglossaryindex
  \gstyopt{no\-glossary\-index}%
  {
    \providedby{\sty{glossaries} v4.42+}%
    \inpackage{glossaries}
    \desc{counteracts the \opt{index} option}
  }
  % package option hyperfirst
  \gstyopt{hyper\-first}%
  {%
    \providedby{\sty{glossaries} v2.03+}%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{if false, this option will suppress \idxpl{hyperlink} on \idx{firstuse}
    for the \gls{glslike} commands}
  }
  % package option nohypertypes
  \gstyopt{no\-hyper\-types}%
  {%
    \providedby{\sty{glossaries} v3.05+}%
    \inpackage{glossaries}
    \syntax{\margm{list}}
    \desc{identifies the list of \idxpl{glossary} that should have
     \idxpl{hyperlink} suppressed}
  }
  % package option nopostdot
  \gstyopt{nopostdot}%
  {%
    \providedby{\sty{glossaries} v3.03+}%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{if true, suppresses the automatic insertion of a
    \idx{fullstop} after each entry's description in the \idx{glossary}
    (for styles that support this). The default is
    \optval{nopostdot}{true} for \sty{glossaries-extra} and
    \optval{nopostdot}{false} for just \sty{glossaries}}
    \field{seealso}{opt.postdot,opt.postpunc}
  }
  % package option postdot
  \gxtrstyopt{postdot}%
  {%
    \inpackage{glossaries-extra}
    \providedby{\sty{glossaries-extra} v1.12+}%
    \desc{a shortcut for \optval{nopostdot}{false}}
    \field{seealso}{opt.nopostdot,opt.postpunc}
  }
  % package option postpunc
  \gxtrstyopt{postpunc}%
  {%
    \inpackage{glossaries-extra}
    \providedby{\sty{glossaries-extra} v1.21+}%
    \syntax{\meta{value}}
    \desc{an alternative to \opt{postdot}, this can be used to
     insert a different punctuation character after the description}
  }
  % package option nowarn
  \gstyopt{no\-warn}%
  {%
    \inpackage{glossaries}
    \desc{suppresses warnings}
  }
  % package option noredefwarn
  \gstyopt{noredefwarn}%
  {%
    \inpackage{glossaries}
    \desc{suppresses a warning if \env{theglossary} or
    \gls{printglossary} have already been defined (which indicates
     that the document class or another package also provides a mechanism
     for creating a \idx{glossary} that could potentially conflict with
     \sty{glossaries}). This option is automatically implemented with
     \sty{glossaries-extra}}
  }
  % package option undefaction
  \gxtrstyopt{undef\-action}%
  {%
    \syntax{\meta{value}}
    \initval{error}
    \inpackage{glossaries-extra}
    \desc{indicates whether to trigger an error or warning if an
     unknown entry label is referenced}
  }
  \gxtroptval{undefaction}{error}%
  {%
    \desc{trigger an error if an unknown entry label is referenced}
  }
  \gxtroptval{undefaction}{warn}%
  {%
    \desc{trigger a warning if an unknown entry label is referenced}
  }
  % package option translate
  \gstyopt{translate}%
  {%
    \providedby{\sty{glossaries} v1.1+}%
    \inpackage{glossaries}
    \syntax{\meta{value}}
    \initvalvaries
    \defval{true}
    \desc{indicates how multilingual support should be provided, if
     applicable}
  }
  % package option translate values
  \goptval{translate}{babel}%
  {%
    \desc{uses \sty{babel}['s] language hooks to implement
      multilingual support (default for \sty{glossaries-extra} if
      \sty{babel} has been detected)}
  }
  \goptval{translate}{true}%
  {%
    \desc{uses \sty{translator}['s] language hooks to implement
      multilingual support (default for \sty{glossaries} if a
      language package has been detected)}
  }
  \goptval{translate}{false}%
  {%
    \desc{don't implement multilingual support (default if no
     language package has been detected)}
  }
  % package option notranslate
  \gstyopt{notranslate}%
  {%
    \providedby{\sty{glossaries} v3.14a+}%
    \inpackage{glossaries}
    \desc{equivalent to \optval{translate}{false}}
  }
  % package option languages
  \gstyopt{languages}%
  {%
    \providedby{\sty{glossaries} v4.50+}%
    \inpackage{glossaries}
    \desc{implements \optval{translate}{babel} and adds the supplied
     languages to \sty{tracklang}['s] list of tracked languages}
  }
  % package option nogroupskip
  \gstyopt{no\-group\-skip}%
  {%
    \providedby{\sty{glossaries} v3.03+}%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, suppress the gap between \idxpl{lettergroup} in the
     \idxpl{glossary} by default}
  }
  % numberline
  \gstyopt{number\-line}%
  {%
    \providedby{\sty{glossaries} v1.1+}
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true (and \optval{toc}{true}), includes \gls{numberline} when adding a
    \idx{glossary} to the table of contents}
  }
  % package option toc
  \gstyopt{toc}%
  {%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initvalvaries
    \defval{true}
    \desc{if true, each \idx{glossary} will be automatically added to the
    \idx{tableofcontents}. The default is \optval{toc}{false} with
     \sty{glossaries} and \optval{toc}{true} with \sty{glossaries-extra}}
  }
  % package option docdef
  \gxtrstyopt{docdef}%
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{value}}
    \initval{false}
    \defval{true}
    \desc{determines whether or not \gls{newglossaryentry} is
     permitted in the \env{document} environment}
  }
  \gxtroptval{docdef}{false}%
  {%
    \desc{don't allow \gls{newglossaryentry} in the \env{document}
     environment}
  }
  \gxtroptval{docdef}{true}%
  {%
    \desc{allow \gls{newglossaryentry} in the \env{document}
     environment if the base \sty{glossaries} package would allow it}
  }
  \gxtroptval{docdef}{restricted}%
  {%
    \desc{allow \gls{newglossaryentry} in the \env{document}
     environment, but only before any \idxpl{glossary}}
  }
  \gxtroptval{docdef}{atom}%
  {%
    \desc{as \optfmt{restricted} but creates the \ext{glsdefs} file
     for atom's autocomplete support}
  }
  % package option automake
  \gstyopt{automake}%
  {%
    \providedby{\sty{glossaries} v4.08+}%
    \inpackage{glossaries}
    \syntax{\meta{value}}
    \initval{false}
    \defval{immediate}
    \desc{indicates whether or not to attempt to use \TeX's
    \idx{shellescape} to run an \idx{indexingapp}}
  }
  \goptval{automake}{true}%
  {
     \deprecated
     \providedby{\sty{glossaries} v4.08+}
     \desc{deprecated synonym for \opteqvalref{automake}{delayed}}
     \field{alias}{optval.automake.delayed}
  }
  \goptval{automake}{delayed}%
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{use the \idx{shellescape} to run \app{makeindex} or
     \app{xindy} at the end of the document}
  }
  \goptval{automake}{false}%
  {
     \providedby{\sty{glossaries} v4.08+}
     \desc{don't use the \idx{shellescape}}
  }
  \goptval{automake}{immediate}%
  {
     \providedby{\sty{glossaries} v4.42+}
     \desc{use the \idx{shellescape} to run \app{makeindex} or
     \app{xindy} before \gls{makeglossaries} opens the associated
     \idxpl{indexingfile}}
  }
  \goptval{automake}{makegloss}%
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{use the \idx{shellescape} to run \app{makeglossaries} 
     before \gls{makeglossaries} opens the associated \idxpl{indexingfile}}
  }
  \goptval{automake}{lite}%
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{use the \idx{shellescape} to run \app{makeglossaries-lite} 
     before \gls{makeglossaries} opens the associated \idxpl{indexingfile}}
  }
  \gstyopt{automakegloss}%
  {
    \inpackage{glossaries}
     \providedby{\sty{glossaries} v4.50+}
     \desc{synonym for \opteqvalref{automake}{makegloss}}
     \field{alias}{optval.automake.makegloss}
  }
  \gstyopt{automakeglosslite}%
  {
    \inpackage{glossaries}
     \providedby{\sty{glossaries} v4.50+}
     \desc{synonym for \opteqvalref{automake}{lite}}
     \field{alias}{optval.automake.lite}
  }
  % package option ucmark
  \gstyopt{uc\-mark}%
  {%
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\meta{boolean}}
    \initvalvaries
    \defval{true}
    \inpackage{glossaries}
    \desc{indicates whether or not to use \idx{allcaps} in the
     \idx{glossary} header}
  }
  % package option kernelglossredefs
  \gstyopt{kernel\-gloss\-re\-defs}%
  {%
    \providedby{\sty{glossaries} v4.41+}
    \syntax{\meta{value}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{indicates whether or not to redefined the 
    kernel glossary commands \gls{cs.glossary} and \gls{makeglossary}}
  }
  \goptval{kernelglossredefs}{false}%
  {
     \desc{don't redefine \gls{cs.glossary} and \gls{makeglossary}}
  }
  \goptval{kernelglossredefs}{true}%
  {
     \desc{redefine \gls{cs.glossary} and \gls{makeglossary} but their
     use will trigger a warning}
  }
  \goptval{kernelglossredefs}{nowarn}%
  {
     \desc{redefine \gls{cs.glossary} and \gls{makeglossary} without
     any warnings}
  }
  % package option mfirstuc
  \gstyopt{mfirstuc}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\meta{value}}
    \initval{unexpanded}
    \inpackage{glossaries}
    \desc{the value may be either \optfmt{expanded} or
    \optfmt{unexpanded} and performs the same function as
    \sty{mfirstuc}['s] \optfmt{expanded} and \optfmt{unexpanded}
     package options. Note that there's no value corresponding to 
     \sty{mfirstuc}['s] other package option}
  }
  % DEPRECATED PACKAGE OPTIONS
  % package option compatible-2.07
  \gstyopt{compatible\dhyphen 2.07}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{option removed in version 4.50. Now only available with rollback}
  }
  % package option compatible-3.07
  \gstyopt{compatible\dhyphen 3.07}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{option removed in version 4.50. Now only available with rollback}
  }
  % package option description
  \gstyopt{description}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option footnote
  \gstyopt{footnote}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option smallcaps
  \gstyopt{smallcaps}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option smaller
  \gstyopt{smaller}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option dua
  \gstyopt{dua}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % OPTIONS: KEYS (glossentry)
  \gidxpl{gloskey}{%
    \common
    \field{text}{glossary entry key}
    \desc{these are options that can be passed to commands that
     define entries, such as \gls{newglossaryentry} or
     \gls{newacronym}}
  }
  % glossentry name
  \ggloskey{name}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's name, as displayed in the \idx{glossary}. This
     typically isn't used outside of the \idx{glossary} (the \gloskey{text} and
     \gloskey{plural} keys are used instead). However, if there is a
     need to specifically display the entry name,
     use \gls{glsname} (if \idx{indexing} and \idxpl{hyperlink}
     are required) or \gls{glsentryname}. \Idxpl{glossarystyle} should use
     \gls{glossentryname} rather than explicitly using \gls{glsentryname}}
  }
  % glossentry description
  \ggloskey{description}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's description, as displayed in the \idx{glossary}. If
     required in the text, use \gls{glsdesc} (if \idx{indexing} and \idxpl{hyperlink}
     are required) or \gls{glsentrydesc}. \Idxpl{glossarystyle} should use
     \gls{glossentrydesc} and \gls{glspostdescription} to
     incorporate the \idx{postdeschook}}
  }
  % glossentry descriptionplural
  \ggloskey{description\-plural}%
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{text}}
    \desc{the plural form of the entry's description, if applicable.
    If omitted, this is set to the same value as the
    \gloskey{description}, since descriptions tend not to be a singular
    entity}
  }
  % glossentry type
  \ggloskey{type}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{\idx{glossary}-label}}
    \initval{\gls{glsdefaulttype}}%
    \desc{assigns the entry to the \idx{glossary} identified by
      \meta{\idx{glossary}-label}}
  }
  % glossentry parent
  \ggloskey{parent}%
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\meta{parent-label}}
    \desc{the label of the entry's parent (from which the entry's
    \idx{hierarchicallevel} is obtained)}
  }
  % glossentry category
  \gxtrgloskey{category}%
  {%
    \syntax{\meta{category-label}}%
    \initval{general}%
    \providedby{\sty{glossaries-extra}}
    \desc{the entry's \idx{category} (must be a simple label)}
  }
  % glossentry sort
  \ggloskey{sort}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{value}}
    \initval{\meta{entry name}}
    \desc{specifies the value to use for sorting (overrides the
     default). This key is usually required for \app+{xindy} if the
      \gloskey{name} key only contains commands (for example, the
      entry is a symbol), but explicitly using this key in other
      contexts can break certain sort methods.
      \gallerypage{bib2gls-sorting}{Don't use the \gloskey{sort} field
      with \app{bib2gls}}}
  }
  % glossentry text
  \ggloskey{text}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's text, as displayed on \idx{subsequentuse} of
     \gls{glslike} commands. If omitted, this value is assumed to be
     the same as the \gloskey{name} key}
  }
  % glossentry plural
  \ggloskey{plural}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's plural form, as displayed on \idx{subsequentuse} of
     plural \gls{glslike} commands, such as \gls{glspl}. This should
     be the appropriate plural form of the value provided by the
    \gloskey{text} key. If omitted, this value is assumed to be the
    value of the \gloskey{text} key with \gls{glspluralsuffix}
    appended}
  }
  % glossentry symbol
  \ggloskey{symbol}%
  {%
    \providedby{\sty{glossaries}}
    \initval{\gls{relax}}
    \syntax{\margm{symbol}}
    \desc{the entry's associated symbol (optional), which can be
     displayed with \gls{glssymbol} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentrysymbol}}
  }
  % glossentry symbolplural
  \ggloskey{symbol\-plural}%
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{symbol plural}}
    \desc{The plural form of the \gloskey{symbol}, if applicable,
     which can be displayed with \gls{glssymbolplural} (if \idx{indexing}
     and \idxpl{hyperlink} are required) or with \gls{glsentrysymbolplural}.
     If omitted, this value is set to the same as the
     \gloskey{symbol} key (since symbols usually don't have a plural
     form)}
  }
  % glossentry first
  \ggloskey{first}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{first}}
    \desc{the entry's text, as displayed on \idx{firstuse} of
     \gls{glslike} commands. Note that using an \idx{acronymstyle}
     or \idxpl{postlinkhook} is a more flexible approach. If omitted,
     this value is assumed to be the same as the \gloskey{text} key}
  }
  % glossentry firstplural
  \ggloskey{first\-plural}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's plural form, as displayed on \idx{firstuse} of
     plural \gls{glslike} commands, such as \gls{glspl}. If this key
    is omitted, then the value will either be the same as the
    \gloskey{plural} field, if the \gloskey{first} key wasn't used, or
    the value will be taken from the \gloskey{first} key with
    \gls{glspluralsuffix} appended}
  }
  % glossentry short
  \ggloskey{short}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{short-form}}
    \desc{a \idx{field} that is set by \gls{newacronym}
     to the entry's short (abbreviated) form. It
     typically shouldn't be used explicitly with
     \gls{newglossaryentry} as \gls{newacronym} (and \gls{newabbreviation})
     makes other modifications to ensure that when the entry is
     referenced with the \gls{glslike} commands, it will obey the
     appropriate \idx{acronymstyle} (or \idx{abbrvstyle}). If you are using \app{bib2gls}
     then this field should be used in the \ext{bib} file when
     defining \idxpl{abbreviation}}
  }
  % glossentry shortplural
  \ggloskey{short\-plural}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{short-form}}
    \desc{as \gloskey{short} but the plural form. The default is
    obtained by appending the \idx{acronym} or \idx{abbreviation} plural suffix}
  }
  % glossentry long
  \ggloskey{long}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{long-form}}
    \desc{a \idx{field} that is set by \gls{newacronym} (and
     \gls{newabbreviation}) to the entry's long (unabbreviated) form. It
     typically shouldn't be used explicitly with
     \gls{newglossaryentry} as \gls{newacronym} (and \gls{newabbreviation})
     makes other modifications to ensure that when the entry is
     referenced with the \gls{glslike} commands, it will obey the
     appropriate \idx{acronymstyle} (or \idx{abbrvstyle}). If you are using \app{bib2gls}
     then this field should be used in the \ext{bib} file when
     defining \idxpl{abbreviation}}
  }
  % glossentry longplural
  \ggloskey{long\-plural}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{long-form}}
    \desc{as \gloskey{long} but the plural form}
  }
  % glossentry user1
  \ggloskey{user1}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \desc{a generic field, which can be
     displayed with \gls{glsuseri} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuseri}}
  }
  % glossentry user2
  \ggloskey{user2}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \desc{a generic field, which can be
     displayed with \gls{glsuserii} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuserii}}
  }
  % glossentry user3
  \ggloskey{user3}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \desc{a generic field, which can be
     displayed with \gls{glsuseriii} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuseriii}}
  }
  % glossentry user4
  \ggloskey{user4}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \desc{a generic field, which can be
     displayed with \gls{glsuseriv} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuseriv}}
  }
  % glossentry user5
  \ggloskey{user5}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \desc{a generic field, which can be
     displayed with \gls{glsuserv} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuserv}}
  }
  % glossentry user6
  \ggloskey{user6}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \desc{a generic field, which can be
     displayed with \gls{glsuservi} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuservi}}
  }
  % glossentry counter
  \ggloskey{counter}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{counter-name}}
    \desc{if set, the value indicates the \idx{locationcounter} to use
     by default when \idx{indexing} this entry (overrides the
     counter associated with the \idx{glossary} or the \opt{counter}
     package option)}
  }
  % glossentry nonumberlist
  \ggloskey{no\-number\-list}%
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{boolean}}
    \initval{false}
    \defval{true}
    \desc{if set, suppress the \idx{locationlist} for this entry.
      This is done by adding \gls{glsnonextpages} or
     \gls{glsnextpages} to the \idx{indexing} information for
     \options{mkidx,xdy} or to the \glosfield{prenumberlist} field
     for \option{noidx}}
  }
  % glossentry see
  \ggloskey{see}%
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\marg{\oargm{tag}\meta{xr-list}}}
    \desc{with the base \sty{glossaries} package this simply
    triggers an automatic cross-reference with \gls{glssee}. The
    \sty{glossaries-extra} package additionally saves the value.
    Use \optval{autoseeindex}{false} to prevent the automatic
    cross-reference. The \meta{tag} defaults to \gls{seename} and
    \meta{xr-list} should be a comma-separated list of entries that
    have already been defined}
  }
  % glossentry seealso
  \gxtrgloskey{see\-also}%
  {%
    \providedby{\sty{glossaries-extra} v1.16+}
    \syntax{\margm{xr-list}}
    \desc{behaves in a similar manner to
     \gloskeyval{see}{\oarg{\gls{seealsoname}}\meta{xr-list}}}
  }
  % glossentry alias
  \gxtrgloskey{alias}%
  {%
    \providedby{\sty{glossaries-extra} v1.12}
    \syntax{\margm{xr-label}}
    \desc{behaves in a similar manner to
     \gloskeyval{see}{\oarg{\gls{seealsoname}}\meta{xr-label}} but also
     sets up aliasing which makes the \idx{linktext} hyperlink to
     \meta{xr-label} instead}
  }
  % glossentry location
  \gxtrgloskey{location}%
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{location-list}}
    \desc{the formatted \idx{locationlist} used by the \idx{unsrtfam}. This key
    is only available with the \opt{record} option and is set by \app{bib2gls}
    unless \resourceopt{save-locations}{false} is set. Although it
    has an associated key, it's usually considered an internal field}
    \note{requires \opt{record}}
  } 
  % glossentry group
  \gxtrgloskey{group}%
  {%
    \providedby{\sty{glossaries-extra} v1.11+}
    \syntax{\margm{group-label}}
    \desc{the \idx{group} label that identifies which \idx{lettergroup} the
     entry belongs to. This key is only available with the 
     \opteqvalref{record}{only} and \opteqvalref{record}{nameref} options,
     and is set by \app{bib2gls}, if invoked with \switch{group} or \bibglsopt{g}.
     Although this has a key, this is considered an 
     \idxc{bib2glsinternalfield}{internal key} assigned by
     \app{bib2gls} as a by-product of sorting.
     Explicit use without reference to the order of entries can result in
     fragmented groups. The corresponding title can be set with
     \gls{glsxtrsetgrouptitle}, although this is more commonly done
     implicitly within the \ext{glstex} file. See also
     \gallerypage{logicaldivisions}{Gallery: Logical Glossary Divisions 
     (type vs group vs parent)}}
  }
  % OPTIONS: INTERNAL FIELDS
  \gidxpl{glosfield}{%
    \common
    \field{text}{glossary entry field}
    \desc{these are \idxpl{internalfield} that don't have a corresponding
     \idxc{gloskey}{key}}
  } 
  % internal field loclist
  \gglosfield{loc\-list}% 
  {%
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{\sty{etoolbox} list}}
    \desc{used by \gls{printnoidxglossary} to provide the locations.
    The value is an \sty{etoolbox} list of individual locations
    which are obtained from the \ext+{aux} file. This field will also
    be used by the \idx{unsrtfam} if \gloskey{location} isn't set}
  }
  % internal field currcount
  \gglosfield{curr\-count}
  {
    \providedby{\sty{glossaries} v4.14+}
    \desc{used by entry counting to store the current running total}
  }
  % internal field prevcount
  \gglosfield{prev\-count}
  {
    \providedby{\sty{glossaries} v4.14+}
    \desc{used by entry counting to store the total from the previous \LaTeX\ run}
  }
  % internal field desc
  \gglosfield{desc}
  {
    \desc{corresponds to \gloskey{description} key}
  }
  % internal field descplural
  \gglosfield{desc\-plural}
  {
    \desc{corresponds to \gloskey{descriptionplural} key}
  }
  % internal field descaccess
  \gglosfield{desc\-access}
  {
    \desc{corresponds to \gloskey{descriptionaccess} key}
  }
  % internal field descpluralaccess
  \gglosfield{desc\-plural\-access}
  {
    \desc{corresponds to \gloskey{descriptionpluralaccess} key}
  }
  \gglosfield{user\-i\-access}
  {
    \desc{corresponds to \gloskey{user1access} key}
  }
  \gglosfield{user\-ii\-access}
  {
    \desc{corresponds to \gloskey{user2access} key}
  }
  \gglosfield{user\-iii\-access}
  {
    \desc{corresponds to \gloskey{user3access} key}
  }
  \gglosfield{user\-iv\-access}
  {
    \desc{corresponds to \gloskey{user4access} key}
  }
  \gglosfield{user\-v\-access}
  {
    \desc{corresponds to \gloskey{user5access} key}
  }
  \gglosfield{user\-vi\-access}
  {
    \desc{corresponds to \gloskey{user6access} key}
  }
  % internal field firstpl
  \gglosfield{first\-pl}
  {
    \desc{corresponds to \gloskey{firstplural} key}
  }
  % internal field longpl
  \gglosfield{long\-pl}
  {
    \desc{corresponds to \gloskey{longplural} key}
  }
  % internal field shortpl
  \gglosfield{short\-pl}
  {
    \desc{corresponds to \gloskey{shortplural} key}
  }
  % internal field sortvalue
  \gglosfield{sort\-value}
  {
    \desc{corresponds to \gloskey{sort} key}
  }
  % internal field level
  \gglosfield{level}
  {
    \desc{the \idx{hierarchicallevel} is stored in this field. The
     value is calculated when the \idx{entry} is defined and should not be changed}
  }
  % internal field prenumberlist
  \gglosfield{pre\-number\-list}
  {
    \desc{set by the \gloskey{nonumberlist} key and used in
     \gls{glsnoidxprenumberlist} with \option{noidx}}
  }
  % internal field useri
  \gglosfield{useri}
  {
    \desc{corresponds to \gloskey{user1} key}
  }
  % internal field userii
  \gglosfield{userii}
  {
    \desc{corresponds to \gloskey{user2} key}
  }
  % internal field useriii
  \gglosfield{useriii}
  {
    \desc{corresponds to \gloskey{user3} key}
  }
  % internal field useriv
  \gglosfield{useriv}
  {
    \desc{corresponds to \gloskey{user4} key}
  }
  % internal field userv
  \gglosfield{userv}
  {
    \desc{corresponds to \gloskey{user5} key}
  }
  % internal field uservi
  \gglosfield{uservi}
  {
    \desc{corresponds to \gloskey{user6} key}
  }
  % internal field siblingcount
  \gxtrglosfield{sibling\-count}
  {
     \desc{used by \app{bib2gls} to store the number of (selected) siblings an entry has}
  }
  % internal field siblinglist
  \gxtrglosfield{sibling\-list}
  {
     \desc{used by \app{bib2gls} to store an entry's list of (selected) siblings}
  }
  % internal field childcount
  \gxtrglosfield{child\-count}%
  {%
    \desc{used with the \resourceopt{save-child-count} resource
     option to store the entry's child count}
  }
  % internal field childlist
  \gxtrglosfield{child\-list}
  {
     \desc{used by \app{bib2gls} to store an entry's list of (selected) child entries}
  }
  % ACCESSIBILITY KEYS
  % glossentry access
  \ggloskey{access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{name} field}
  }
  % glossentry textaccess
  \ggloskey{text\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{text} field}
  }
  % glossentry pluralaccess
  \ggloskey{plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{plural} field}
  }
  % glossentry firstaccess
  \ggloskey{first\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{first} field}
  }
  % glossentry firstpluralaccess
  \ggloskey{first\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{firstplural} field}
  }
  % glossentry shortaccess
  \ggloskey{short\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{short} field}
  }
  % glossentry shortpluralaccess
  \ggloskey{short\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{shortplural} field}
  }
  % glossentry longaccess
  \ggloskey{long\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{long} field}
  }
  % glossentry longpluralaccess
  \ggloskey{long\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{longplural} field}
  }
  % glossentry descriptionaccess
  \ggloskey{description\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{description} field}
  }
  % glossentry descriptionpluralaccess
  \ggloskey{description\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{descriptionplural} field}
  }
  % glossentry symbolaccess
  \ggloskey{symbol\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{symbol} field}
  }
  % glossentry symbolpluralaccess
  \ggloskey{symbol\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{symbolplural} field}
  }
  % glossentry user1access
  \ggloskey{user1\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user1} field}
  }
  % glossentry user2access
  \ggloskey{user2\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user2} field}
  }
  % glossentry user3access
  \ggloskey{user3\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user3} field}
  }
  % glossentry user4access
  \ggloskey{user4\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user4} field}
  }
  % glossentry user5access
  \ggloskey{user5\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user5} field}
  }
  % glossentry user6access
  \ggloskey{user6\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user6} field}
  }
  % PREFIX KEYS
  % glossentry prefix
  \ggloskey{prefix}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{subsequentuse} singular prefix}
  }
  % glossentry prefixplural
  \ggloskey{prefix\-plural}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{subsequentuse} plural prefix}
  }
  % glossentry prefixfirst
  \ggloskey{prefix\-first}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{firstuse} singular prefix}
  }
  % glossentry prefixfirstplural
  \ggloskey{prefix\-first\-plural}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{firstuse} plural prefix}
  }
  % GLS OPTIONS
  \gidx{glsopt}{\name{\csfmt{gls}-like and \csfmt{glstext}-like options}%
    \common
    \field{text}{\csfmt{glslink} option}%
    \desc{most (but not all) of these options can be used in the optional argument
    of all the \gls{glslike}, \gls{glstextlike} and \gls{glsadd} commands}
  }
  % format
  \gglsopt{format}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{cs-name}}
    \desc{the \idx{encap} or control sequence name (without the leading backslash)
    that should be used to \idxc{locationencap}{encapsulate} the \idx{entrylocation}}%
  }%
  % counter
  \gglsopt{counter}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{counter-name}}
    \desc{the \idx{locationcounter}}%
  }%
  % local
  \gglsopt{local}%
  {%
    \providedby{\sty{glossaries} v3.04+}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true use \gls{glslocalunset} to unset the
     \idx{firstuseflag}, otherwise use \gls{glsunset} (only applies
     to \gls{glslike} commands)}%
  }%
  % hyper
  \gglsopt{hyper}%
  {%
    \providedby{\sty{glossaries}}
    \initval{true}
    \defval{true}
    \syntax{\meta{boolean}}
    \desc{determines whether or not the \idx{linktext} should have a
     \idx{hyperlink} (provided \idxpl{hyperlink} are supported)}%
  }%
  % types
  \gglsopt{types}%
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{glossary list}}
     \desc{only available with \gls{glsaddall}, the value is the
     list of glossaries to iterate over}
  }
  % textformat
  \gxtrglsopt{text\-format}%
  {%
    \providedby{\sty{glossaries-extra} v1.30+}
    \syntax{\meta{csname}}
    \desc{the name of the control sequence to use instead of \gls{glstextformat}
to encapsulate the \idx{linktext}}%
  }%
  % hyperoutside
  \gxtrglsopt{hyper\-outside}%
  {%
    \providedby{\sty{glossaries-extra} v1.21+}
    \initval{true}
    \defval{true}
    \syntax{\meta{boolean}}
    \desc{determines whether the \idx{hyperlink} should be inside or outside of \gls{glstextformat}}%
  }%
  % wrgloss
  \gxtrglsopt{wr\-gloss}%
  {%
    \providedby{\sty{glossaries-extra} v1.14+}
    \initval{before}
    \syntax{\meta{position}}
    \desc{determines whether to do the \idx{indexing} before or after the
\idx{linktext}. Allowed values: \optfmt{before} and \optfmt{after}}%
  }%
  % noindex
  \gxtrglsopt{no\-index}%
  {%
    \providedby{\sty{glossaries-extra}}
    \initval{false}
    \defval{true}
    \syntax{\meta{boolean}}
    \desc{if \optfmt{true} this option will suppress \idx{indexing}.
    If you are using \app{bib2gls}, you may want to consider using
    \glsoptval{format}{\encap{glsignore}} to prevent a \location\ but
    ensure that the entry is selected}%
  }%
  % prefix
  \gxtrglsopt{prefix}%
  {%
    \providedby{\sty{glossaries-extra} v1.31+}
    \syntax{\meta{link-prefix}}
    \desc{the prefix to use for the entry's hyperlink target}%
  }%
  % thevalue
  \gxtrglsopt{the\-value}%
  {%
    \providedby{\sty{glossaries-extra} v1.19+}
    \syntax{\meta{location}}
    \desc{set the \location\ to this value instead of obtaining it from the
     \idx{locationcounter}}%
  }%
  % theHvalue
  \gxtrglsopt{the\-H\-value}%
  {%
    \providedby{\sty{glossaries-extra} v1.19+}
    \syntax{\meta{the-H-value}}
    \desc{set the hyper \location\ to this value instead of obtaining it
from \gls{theHcounter}}%
  }%
  % prereset
  \gxtrglsopt{pre\-reset}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \initval{none}
    \defval{local}
    \syntax{\meta{value}}
    \desc{determines whether or not to reset the entry before the
    \idx{linktext}. Allowed values: \optfmt{none} (no reset),
    \optfmt{local} (localise the reset) and \optfmt{global}}%
  }%
  % preunset
  \gxtrglsopt{pre\-unset}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \initval{none}
    \defval{local}
    \syntax{\meta{value}}
    \desc{determines whether or not to unset the entry before the
    \idx{linktext}. Allowed values: \optfmt{none} (no unset),
    \optfmt{local} (localise the unset) and \optfmt{global}}%
  }%
  % postunset
  \gxtrglsopt{post\-unset}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\meta{value}}
    \initval{global}
    \defval{global}
    \desc{determines whether or not to unset the \idx{firstuseflag}
     after the \idx{linktext}. The value may be one of:
     \code{global}, \code{local} or \code{none}
    (only applies to \gls{glslike} commands)}%
  }%
  % GLOSSARY STYLES
  % STYLES: glossary-list
  % list
  \gglosty{list}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment}
  }
  % listgroup
  \gglosty{list\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
   letter \idx{group} headings}
  }
  % listhypergroup
  \gglosty{list\-hyper\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
   letter \idx{group} headings and a navigation line}
  }
  % altlist
  \gglosty{alt\-list}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
the entry's description starting on a new line}
  }
  % altlistgroup
  \gglosty{alt\-list\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
the entry's description starting on a new line with
   letter \idx{group} headings}
  }
  % altlisthypergroup
  \gglosty{alt\-list\-hyper\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
the entry's description starting on a new line with
   letter \idx{group} headings and a navigation line}
  }
  % listdotted
  \gglosty{list\-dotted}{\providedby{\sty{glossary-list}}
    \desc{a list style with a dotted leader between the name and
description}
  }
  % sublistdotted
  \gglosty{sub\-list\-dotted}{\providedby{\sty{glossary-list}}
    \desc{a list style with just the name for top-level entries and
    a dotted leader between the name and description for sub-entries}
  }
  % STYLES: glossary-long
  % long
  \gglosty{long}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns}
  }
  % longborder
  \gglosty{long\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns and
border lines}
  }
  % longheader
  \gglosty{long\-header}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns and a
header row}
  }
  % longheaderborder
  \gglosty{long\-header\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns, a
header row and border lines}
  }
  % long3col
  \gglosty{long\-3\-col}{\providedby{\sty{glossary-long}}%
   \desc{a tabular style using \env{longtable} with 3 columns}
  }
  % long3colborder
  \gglosty{long\-3\-col\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 3 columns and
border lines}
  }
  % long3colheader
  \gglosty{long\-3\-col\-header}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 3 columns and a
header row}
  }
  % long3colheaderborder
  \gglosty{long\-3\-col\-header\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 3 columns, a
header row and border lines}
  }
  % long4col
  \gglosty{long\-4\-col}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns}
  }
  % long4colheader
  \gglosty{long\-4\-col\-header}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns and a
header row}
  }
  % long4colborder
  \gglosty{long\-4\-col\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns and
border lines}
  }
  % long4colheaderborder
  \gglosty{long\-4\-col\-header\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns, a
header row and border lines}
  }
  % altlong4col
  \gglosty{alt\-long\-4\-col}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description}
  }
  % altlong4colheader
  \gglosty{alt\-long\-4\-col\-header}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description with a header row}
  }
  % altlong4colborder
  \gglosty{alt\-long\-4\-col\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description with border lines}
  }
  % altlong4colheaderborder
  \gglosty{alt\-long\-4\-col\-header\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description with a header row and border lines}
  }
  % STYLES: glossary-longragged
  % longragged
  \gglosty{long\-ragged}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description}
  }
  % longraggedborder
  \gglosty{long\-ragged\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description and border lines}
  }
  % longraggedheader
  \gglosty{long\-ragged\-header}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description, and a
header row}
  }
  % longraggedheaderborder
  \gglosty{long\-ragged\-header\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description, border lines and a
header row}
  }
  % longragged3col
  \gglosty{long\-ragged\-3\-col}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description}
  }
  % longragged3colborder
  \gglosty{long\-ragged\-3\-col\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description and border lines}
  }
  % longragged3colheader
  \gglosty{long\-ragged\-3\-col\-header}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description, and a
header row}
  }
  % longragged3colheaderborder
  \gglosty{long\-ragged\-3\-col\-header\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description, border lines and a
header row}
  }
  % altlongragged4col
  \gglosty{alt\-long\-ragged\-4\-col}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description}
  }
  % altlongragged4colheader
  \gglosty{alt\-long\-ragged\-4\-col\-header}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description, and a
header row}
  }
  % altlongragged4colborder
  \gglosty{alt\-long\-ragged\-4\-col\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description and border lines}
  }
  % altlongragged4colheaderborder
  \gglosty{alt\-long\-ragged\-4\-col\-header\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description, border lines and a
header row}
  }
  % STYLES: glossary-longbooktabs
  % long-booktabs
  \gglosty{long\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 2 columns a
   header row and rules}
  }
  % long3col-booktabs
  \gglosty{long3col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 3 columns a
   header row and rules}
  }
  % long4col-booktabs
  \gglosty{long\-4\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 4 columns a
   header row and rules}
  }
  % altlong4col-booktabs
  \gglosty{alt\-long\-4\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 4 columns
   allowing for multi-lined descriptions, a header row and rules}
  }
  % longragged-booktabs
  \gglosty{long\-ragged\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 2 columns, a
   header row and rules, and ragged right formatting for the
description}
  }
  % longragged3col-booktabs
  \gglosty{long\-ragged\-3\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 3 columns, a
   header row and rules, and ragged right formatting for the
description}
  }
  % altlongragged4col-booktabs
  \gglosty{alt\-long\-ragged\-4\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 4 columns, a
   header row and rules, and ragged right formatting for the
description}
  }
  % STYLES: glossary-super
  % super
  \gglosty{super}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns}
  }
  % superborder
  \gglosty{super\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
border lines}
  }
  % superheader
  \gglosty{super\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
a header row}
  }
  % superheaderborder
  \gglosty{super\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns,
a header row and border lines}
  }
  % super3col
  \gglosty{super\-3\-col}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns}
  }
  % super3colborder
  \gglosty{super\-3\-col\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
border lines}
  }
  % super3colheader
  \gglosty{super\-3\-col\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns and a
header row}
  }
  % super3colheaderborder
  \gglosty{super\-3\-col\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns, a
header row and border lines}
  }
  % super4col
  \gglosty{super\-4\-col}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns}
  }
  % super4colheader
  \gglosty{super\-4\-col\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns and
a header row}
  }
  % super4colborder
  \gglosty{super\-4\-col\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns and border lines}
  }
  % super4colheaderborder
  \gglosty{super\-4\-col\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns,
a header row and border lines}
  }
  % altsuper4col
  \gglosty{alt\-super\-4\-col}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns
   allowing multiline descriptions}
  }
  % altsuper4colheader
  \gglosty{alt\-super\-4\-col\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns
   and a header row
   allowing multiline descriptions}
  }
  % altsuper4colborder
  \gglosty{alt\-super\-4\-col\-border}
  {\providedby{\sty{glossary-super}}}
  % altsuper4colheaderborder
  \gglosty{alt\-super\-4\-col\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns,
   a header row and border lines
   allowing multiline descriptions}
  }
  % STYLES: glossary-superragged
  % superragged
  \gglosty{super\-ragged}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
ragged right formatting for the description}
  }
  % superraggedborder
  \gglosty{super\-ragged\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
border lines, and
ragged right formatting for the description}
  }
  % superraggedheader
  \gglosty{super\-ragged\-header}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
a header row, and
ragged right formatting for the description}
  }
  % superraggedheaderborder
  \gglosty{super\-ragged\-header\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns,
a header row and border lines, and
ragged right formatting for the description}
  }
  % superragged3col
  \gglosty{super\-ragged\-3\-col}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
ragged right formatting for the description}
  }
  % superragged3colborder
  \gglosty{super\-ragged\-3\-col\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
border lines, and
ragged right formatting for the description}
  }
  % superragged3colheader
  \gglosty{super\-ragged\-3\-col\-header}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
a header row, and
ragged right formatting for the description}
  }
  % superragged3colheaderborder
  \gglosty{super\-ragged\-3\-col\-header\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns,
a header row and border lines, and
ragged right formatting for the description}
  }
  % altsuperragged4col
  \gglosty{alt\-super\-ragged\-4\-col}%
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns and
ragged right formatting for the description}
  }
  % altsuperragged4colheader
  \gglosty{alt\-super\-ragged\-4\-col\-header}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns and
a header row, and
ragged right formatting for the description}
  }
  % altsuperragged4colborder
  \gglosty{alt\-super\-ragged\-4\-col\-border}%
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns
and border lines, and
ragged right formatting for the description}
  }
  % altsuperragged4colheaderborder
  \gglosty{alt\-super\-ragged\-4\-col\-header\-border}%
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns,
a header row and border lines, and
ragged right formatting for the description}
  }
  % STYLES: glossary-tree
  % index
  \gglosty{index}{\providedby{\sty{glossary-tree}}
   \desc{a style similar to standard indexes but also shows the
description and, if set, the symbol}
  }
  % indexgroup
  \gglosty{index\-group}{\providedby{\sty{glossary-tree}}
   \desc{a style similar to standard indexes with letter \idx{group}
headings but also shows the
description and, if set, the symbol}
  }
  % indexhypergroup
  \gglosty{index\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a style similar to standard indexes with letter \idx{group}
headings and a navigation line but also shows the
description and, if set, the symbol}
  }
  % tree
  \gglosty{tree}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style that shows the name, description
and, if set, the symbol}
  }
  % treegroup
  \gglosty{tree\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings 
   that shows the name, description and, if set, the symbol}
  }
  % treehypergroup
  \gglosty{tree\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings 
   and navigation line
   that shows the name, description and, if set, the symbol}
  }
  % treenoname
  \gglosty{tree\-no\-name}{\providedby{\sty{glossary-tree}}
   \desc{a \idx{homograph} style that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % treenonamegroup
  \gglosty{tree\-no\-name\-group}{\providedby{\sty{glossary-tree}} 
   \desc{a \idx{homograph} style with letter \idx{group} headings that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % treenonamehypergroup
  \gglosty{tree\-no\-name\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \idx{homograph} style with letter \idx{group} headings
and navigation line that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % alttree
  \gglosty{alt\-tree}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % alttreegroup
  \gglosty{alt\-tree\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % alttreehypergroup
  \gglosty{alt\-tree\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings and
navigation line that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % STYLES: glossary-mcols
  % mcolindex
  \gglosty{mcol\-index}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn style similar to standard indexes but also shows the
description and, if set, the symbol}
  }
  % mcolindexgroup
  \gglosty{mcol\-index\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn style similar to standard indexes with letter \idx{group}
headings but also shows the
description and, if set, the symbol}
  }
  % mcolindexhypergroup
  \gglosty{mcol\-index\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn style similar to standard indexes with letter \idx{group}
headings and a navigation line at the start of the first column but also shows the
description and, if set, the symbol}
  }
  % mcolindexspannav
  \gglosty{mcol\-index\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a multicolumn style similar to standard indexes with letter \idx{group}
headings and a navigation line spanning all columns but also shows the
description and, if set, the symbol}
  }
  % mcoltree
  \gglosty{mcol\-tree}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style that shows the name, description
and, if set, the symbol}
  }
  % mcoltreegroup
  \gglosty{mcol\-tree\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings 
   that shows the name, description and, if set, the symbol}
  }
  % mcoltreehypergroup
  \gglosty{mcol\-tree\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings 
   and navigation line at the start of the first column
   that shows the name, description and, if set, the symbol}
  }
  % mcoltreespannav
  \gglosty{mcol\-tree\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings 
   and navigation line spanning all columns
   that shows the name, description and, if set, the symbol}
  }
  % mcoltreenoname
  \gglosty{mcol\-tree\-no\-name}{\providedby{\sty{glossary-mcols} v3.02+} 
   \desc{a multicolumn \idx{homograph} style that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcoltreenonamegroup
  \gglosty{mcol\-tree\-no\-name\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \idx{homograph} style with letter \idx{group} headings that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcoltreenonamehypergroup
  \gglosty{mcol\-tree\-no\-name\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \idx{homograph} style with letter \idx{group} headings
and navigation line at the start of the first column that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcoltreenonamespannav
  \gglosty{mcol\-tree\-no\-name\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a multicolumn \idx{homograph} style with letter \idx{group} headings
and navigation line spanning all columns that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcolalttree
  \gglosty{mcol\-alt\-tree}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % mcolalttreegroup
  \gglosty{mcol\-alt\-tree\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % mcolalttreehypergroup
  \gglosty{mcol\-alt\-tree\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a \hierarchical\ style with letter \idx{group} headings and
navigation line at the start of the first column that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % mcolalttreespannav
  \gglosty{mcol\-alt\-tree\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a \hierarchical\ style with letter \idx{group} headings and
navigation line spanning all columns that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
}
  % STYLES: glossaries-inline
  % inline
  \gglosty{in\-line}{\providedby{\sty{glossary-inline} v3.03+}
    \desc{an inline \idx{homograph} style}
  }
  % EXTRA STYLES
  % bookindex style
  \gxtrglosty{book\-index}{\providedby{\sty{glossary-bookindex} v1.21+}
   \desc{designed for indexes, the description isn't shown}
  }
  % long-name-desc-sym-loc
  \gxtrglosty{long\dhyphen name\dhyphen desc\dhyphen sym\dhyphen loc}%
   {\providedby{\sty{glossary-longextra} v1.21+}
   \desc{tabular style with 4 columns}
  }
  % long-name-desc
  \gxtrglosty{long\dhyphen name\dhyphen desc}%
   {\providedby{\sty{glossary-longextra} v1.37+}
   \desc{tabular style with 2 columns}
  }
  % topic
  \gxtrglosty{topic}
  {\providedby{\sty{glossary-topic} v1.40+}
   \desc{designed for paragraph length top-level descriptions}
  }
  % topicmcols
  \gxtrglosty{topic\-mcols}
  {\providedby{\sty{glossary-topic} v1.40+}
   \desc{designed for paragraph length top-level descriptions with
    sub-entries in multiple columns}
  }
  % ACRONYM STYLES
  % long-short
  \gacrsty{long\dhyphen short}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short})}
  }
  % short-long
  \gacrsty{short\dhyphen long}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long})}
  }
  % sc-short-long
  \gacrsty{sc\dhyphen short\dhyphen long}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with short form
    in smallcaps}
  }
  % sm-short-long
  \gacrsty{sm\dhyphen short\dhyphen long}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with short form
    in a smaller font}
  }
  % short-long-desc
  \gacrsty{short\dhyphen long\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) and a
description must be supplied}
  }
  % sc-short-long-desc
  \gacrsty{sc\dhyphen short\dhyphen long\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with the short
form in smallcaps and a
description must be supplied}
  }
  % sm-short-long-desc
  \gacrsty{sm\dhyphen short\dhyphen long\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with the short
form in a smaller font and a
description must be supplied}
  }
  % long-sp-short
  \gacrsty{long\dhyphen sp\dhyphen short}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \desc{first use shows \meta{long} (\meta{short}) where the space
may be converted to a non-breaking space}
  }
  % long-sc-short
  \gacrsty{long\dhyphen sc\dhyphen short}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in smallcaps}
  }
  % long-sm-short
  \gacrsty{long\dhyphen sm\dhyphen short}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in a smaller font}
  }
  % long-short-desc
  \gacrsty{long\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) where the
description must be supplied}
  }
  % long-sp-short-desc
  \gacrsty{long\dhyphen sp\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \desc{first use shows \meta{long} (\meta{short}) where the space
may be converted to a non-breaking space and the description must be
supplied}
  }
  % long-sc-short-desc
  \gacrsty{long\dhyphen sc\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in smallcaps and the description must be supplied}
  }
  % long-sm-short-desc
  \gacrsty{long\dhyphen sm\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in a smaller font and the description must be supplied}
  }
  % dua
  \gacrsty{dua}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{both the first use and subsequent use only show the long
form}
  }
  % dua-desc
  \gacrsty{dua\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{both the first use and subsequent use only show the long
form and the description must be supplied}
  }
  % footnote
  \gacrsty{footnote}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} followed by the long form in
a footnote}
  }
  % footnote-sc
  \gacrsty{footnote\dhyphen sc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in smallcaps followed by the long form in
a footnote}
  }
  % footnote-sm
  \gacrsty{footnote\dhyphen sm}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in a smaller font followed by the long form in
a footnote}
  }
  % footnote-desc
  \gacrsty{footnote\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} followed by the long form in
a footnote and the description must be supplied}
  }
  % footnote-sc-desc
  \gacrsty{footnote\dhyphen sc\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in smallcaps followed by the long form in
a footnote and the description must be supplied}
  }
  % footnote-sm-desc
  \gacrsty{footnote\dhyphen sm\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in a smaller font followed by the long form in
a footnote and the description must be supplied}
  }
  % ABBREVIATION STYLES
  % long-short
  \gabbrsty{long\dhyphen short}{}
  % short-long
  \gabbrsty{short\dhyphen long}{}
  % long-short-desc
  \gabbrsty{long\dhyphen short\dhyphen desc}{}
  % long-short-user
  \gabbrsty{long\dhyphen short\dhyphen user}{}
  % long-short-sc
  \gabbrsty{long\dhyphen short\dhyphen sc}{}
  % long-short-sc-desc
  \gabbrsty{long\dhyphen short\dhyphen sc\dhyphen desc}{}
  % long-em-short-em
  \gabbrsty{long\dhyphen em\dhyphen short\dhyphen em}{}
  % long-short-em
  \gabbrsty{long\dhyphen short\dhyphen em}{}
  % short-nolong
  \gabbrsty{short\dhyphen nolong}{}
  % short-nolong-noreg
  \gabbrsty{short\dhyphen nolong\dhyphen noreg}{}
  % long-noshort
  \gabbrsty{long\dhyphen noshort}{}
  % short-sc-footnote
  \gabbrsty{short\dhyphen sc\dhyphen footnote}{}
  % short-footnote-desc
  \gabbrsty{short\dhyphen footnote\dhyphen desc}{}
  % short-sc-footnote-desc
  \gabbrsty{short\dhyphen sc\dhyphen footnote\dhyphen desc}{}
  % short-sc-postfootnote-desc
  \gabbrsty{short\dhyphen sc\dhyphen postfootnote\dhyphen desc}{}
  % footnote
  \gabbrsty{footnote}{}
  % postfootnote
  \gabbrsty{postfootnote}{}
  % RESOURCE OPTIONS
  \gidx{resourceopt}{\name{resource options}%
    \field{text}{resource option}%
    \field{see}{GlsXtrLoadResources}
  } 
  % resource option src
  \gresourceopt{src}%
  {%
    \syntax{\meta{list}}
    \initval{\csfmt{jobname}}
    \desc{a comma-separated list of \ext+{bib} files that contain the
      entry data (the file extension may be omitted)}
  }
  % resource option selection
  \gresourceopt{selection}%
  {%
    \syntax{\meta{value}}
    \initval{recorded and deps and see}
    \desc{the selection criteria}
  }
  % resource option sort-field
  \gresourceopt{sort\dhyphen field}%
  {%
    \syntax{\meta{value}}
    \initval{sort}
    \desc{the field to use for sorting}
  }
  % resource option save-locations
  \gresourceopt{save\dhyphen locations}%
  {%
    \syntax{\meta{value}}
    \initval{true}
    \defval{true}
    \desc{determines whether or not to save the \idx{locationlist}.
     This was originally a boolean option but as from \app{bib2gls}
     v3.0 it takes additional values}
  }
  % resource option save-loclist
  \gresourceopt{save\dhyphen loclist}%
  {%
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{determines whether or not to save the \locations\
     in the \glosfield{loclist} field (as an \sty{etoolbox} list)}
  }
  % resource option sort
  \gresourceopt{sort}%
  {%
    \syntax{\meta{value}}
    \initval{doc}
    \desc{identifies the sort method. The default is to use the
    document's language or (if not set) the default locale}
  }
  % resource option dual-sort
  \gresourceopt{dual\dhyphen sort}%
  {%
    \syntax{\meta{value}}
    \initval{combine}
    \desc{identifies the sort method for dual entries}
  }
  % resource option sort-rule
  \gresourceopt{sort\dhyphen rule}%
  {%
    \syntax{\meta{value}}
    \desc{the sort rule to use with \resourceoptval{sort}{custom}}
  }
  % resource option type
  \gresourceopt{type}
  {
    \syntax{\meta{glossary-type}}
    \desc{indicates that primary entries should be
     assigned to the given \idx{glossary}}
  }
  % resource option dual-type
  \gresourceopt{dual\dhyphen type}
  {
    \syntax{\meta{glossary-type}}
    \desc{indicates that dual entries should be
     assigned to the given \idx{glossary}}
  }
  % resource option category
  \gresourceopt{category}
  {
    \syntax{\meta{category-label}}
    \desc{indicates that primary entries should be
     assigned to the given category}
  }
  % resource option dual-category
  \gresourceopt{dual\dhyphen category}
  {
    \syntax{\meta{category-label}}
    \desc{indicates that dual entries should be
     assigned to the given category}
  }
  % resource option group
  \gresourceopt{group}
  {
    \syntax{\meta{group-label}}
    \desc{indicates that primary entries should have the
     \gloskey{group} field set to the given value. See also
     \gallerypage{logicaldivisions}{Gallery: Logical Glossary Divisions 
     (type vs group vs parent)}}
  }
  % resource option replicate-fields
  \gresourceopt{replicate\dhyphen fields}
  {
    \syntax{\margm{assignments}}
    \desc{copies the values of fields into other fields}
  }
  % resource option name-case-change
  \gresourceopt{name\dhyphen case\dhyphen change}
  {
    \syntax{\margm{value}}
    \desc{applies a \idx{casechange} to the \gloskey{name} field}
  }
  % resource option label-prefix
  \gresourceopt{label\dhyphen prefix}
  {
    \syntax{\margm{prefix}}
    \desc{applies the given prefix to entry labels}
  }
  % resource option dual-prefix
  \gresourceopt{dual\dhyphen prefix}
  {
    \syntax{\margm{prefix}}
    \desc{applies the given prefix to dual entry labels}
  }
  % resource option ext-prefixes
  \gresourceopt{ext\dhyphen prefixes}
  {
    \syntax{\margm{prefix list}}
    \desc{supplies external prefix labels}
  }
  % resource option append-prefix-field
  \gresourceopt{append\dhyphen prefix\dhyphen field}
  {
    \syntax{\margm{value}}
    \desc{may be used to append a space to the prefix fields}
  }
  % resource option identical-sort-action
  \gresourceopt{identical\dhyphen sort\dhyphen action}
  {
    \syntax{\margm{value}}
    \desc{indicates what to do with entries that have identical sort values}
  }
  % resource option break-at
  \gresourceopt{break\dhyphen at}
  {
    \syntax{\margm{value}}
    \desc{indicates if the sort value should be broken into words (word order) or 
      no break (letter order)}
  }
  % resource option set-widest
  \gresourceopt{set\dhyphen widest}
  {
    \syntax{\margm{boolean}}
    \initval{false}
    \defval{true}
    \desc{instructs \app{bib2gls} to compute the widest names for 
    use with styles such as \glostyle{alttree}}
  }
  % resource option write-preamble
  \gresourceopt{write\dhyphen preamble}
  {
    \syntax{\margm{boolean}}
    \initval{true}
    \defval{true}
    \desc{instructs \app{bib2gls} to write the contents of the
     \idx+{bibpreamble} (\atentry{preamble}) to the \ext+{glstex}
     file}
  }
  % resource option field-aliases
  \gresourceopt{field\dhyphen alias}
  {
    \syntax{\margm{\keyvallist}}
    \desc{identifies field names that should be aliased}
  }
  % resource option entry-type-aliases
  \gresourceopt{entry\dhyphen type\dhyphen aliases}
  {
    \syntax{\margm{\keyvallist}}
    \desc{identifies entry types that should be aliased}
  }
  % resource option min-loc-range
  \gresourceopt{min\dhyphen loc\dhyphen range}
  {
    \syntax{\meta{value}}
    \desc{sets the minimum number of consecutive \locations\ to
    compact into a \idx{range}}
  }
  % resource option max-loc-diff
  \gresourceopt{max\dhyphen loc\dhyphen diff}
  {
    \syntax{\meta{value}}
    \desc{sets the maximum difference between two sequential \locations\ to 
     consider them for a merger into an implicit \idx{range}}
  }
  % resource option suffixF
  \gresourceopt{suffixF}
  {
    \syntax{\meta{value}}
    \desc{sets the suffix for two consecutive \locations}
  }
  % resource option suffixFF
  \gresourceopt{suffixFF}
  {
    \syntax{\meta{value}}
    \desc{sets the suffix for three or more consecutive \locations}
  }
  % resource option compact-ranges
  \gresourceopt{compact\dhyphen ranges}
  {
    \syntax{\meta{value}}
    \desc{compacts ranges (for example, \qt{184--189} will be
    shortened to \qt{184--9})}
  }
  % resource option save-child-count
  \gresourceopt{save\dhyphen child\dhyphen count}%
  {%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, each entry will have the total number of child
     entries stored in the \glosfield{childcount} field and the list of
     children will be stored in the \glosfield+{childlist} field}
  }
  % resource option save-sibling-count
  \gresourceopt{save\dhyphen sibling\dhyphen count}%
  {%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, each entry will have the total number of sibling
     entries stored in the \glosfield{siblingcount} field and the list of
     siblings will be stored in the \glosfield{siblinglist} field}
  }
  % resource option abbreviation-sort-fallback
  \gresourceopt{abbreviation\dhyphen sort\dhyphen fallback}
  {
    \syntax{\meta{field}}
    \initval{short}
    \desc{the fallback field to use for \atentry{abbreviation} if the 
    \gloskey{sort} field hasn't been supplied}
  }
  % resource option ignore-fields
  \gresourceopt{ignore\dhyphen fields}
  {
    \syntax{\meta{field list}}
    \desc{ignore the listed fields}
  }
  % resource option loc-counters
  \gresourceopt{loc\dhyphen counters}
  {
    \syntax{\meta{counter list}}
    \desc{group the \locations\ according the their 
     \idx{locationcounter} in the given order}
  }
  % resource option primary-location-formats
  \gresourceopt{primary\dhyphen location\dhyphen formats}
  {
    \syntax{\meta{list}}
    \desc{identifies \idxpl{encap} that should be considered primary
formats}
  }
  % resource option combine-dual-locations
  \gresourceopt{combine\dhyphen dual\dhyphen locations}
  {
    \syntax{\meta{value}}
    \desc{allows \idxpl{locationlist} for primary and dual entries to be merged}
  }
  % resource option field-aliases
  \gresourceopt{field\dhyphen aliases}
  {
    \syntax{\keyvallist}
    \desc{sets up field aliases}
  }
  % CATEGORIES
  \gcat{general}{}
  \gcat{abbreviation}{}
  \gcat{acronym}{}
  \gcat{symbol}{}
  \gcat{number}{}
  \gcat{index}{}
  % CATEGORy ATTRIBUTES
  \gcatattr{gloss\-name}{}% glossname
  \gcatattr{gloss\-name\-font}{}% glossnamefont
  \gcatattr{gloss\-desc}{}% glossdesc
  \gcatattr{gloss\-desc\-font}{}% glossdescfont
  \gcatattr{gloss\-symbol\-font}{}% glosssymbolfont
  \gcatattr{no\-hyper}{}% nohyper
  \gcatattr{no\-hyper\-first}{}% nohyperfirst
  \gcatattr{discard\-period}{}% discardperiod
  \gcatattr{insert\-dots}{}% insertdots
  \gcatattr{index\-only\-first}{}% indexonlyfirst
  \gcatattr{no\-short\-plural}{}% noshortplural
  \gcatattr{retain\-first\-use\-period}{}% retainfirstuseperiod
  \gcatattr{plural\-discard\-period}{}% pluraldiscardperiod
  % language files
  \gfilemeta{glossaries\dhyphen}{language}{}{}% glossaries-<language>
  \gfile{glossaries\dhyphen french}{}% glossaries-french
  \gfile{glossaries\dhyphen german}{}% glossaries-german
  % file extensions
  \gidxpl{fileextension}{%
    \field{text}{file extension}
    \field{seealso}{fileformat}
  }
  \gext{log}{}
  \gext{tex}{}
  \gext{bib}{}
  \gext{glo}{}
  \gext{gls}{}
  \gext{glg}{}
  \gext{glo2}{}
  \gext{gls2}{}
  \gext{glg2}{}
  \gext{ist}{}
  \gext{xdy}{}
  \gext{aux}{}
  \gext{glstex}{}
  \gext{glslabels}{}
  \gext{alg}{}
  \gext{acr}{}
  \gext{acn}{}
  \gext{slo}{}
  \gext{sls}{}
  \gext{slg}{}
  \gext{nlo}{}
  \gext{nls}{}
  \gext{nlg}{}
  \gext{ind}{}
  \gext{idx}{}
  \gext{ilg}{}
  \gext{glsdefs}{}
  \gext{ldf}{}
  \gext{toc}{}
  % GENERAL INDEX
  \gidxpl{acronym}{\common}
  \gidxpl{abbreviation}{%
    \common
    \field{text}{\xtrfmt{abbreviation}}
    \field{plural}{\xtrfmt{abbreviations}}
  }
  \gidxpl{glossaryentry}%
  {%
    \common
    \field{text}{glossary entry}%
    \field{plural}{glossary entries}%
  }
  \gidx{entry}{\common\field{plural}{entries}\field{alias}{idx.glossaryentry}}
  \gidx{entryformat}{\name{entry format}}
  \gidx{displaystyle}{\name{display style (or format)}
    \field{text}{display style}
    \field{alias}{idx.entryformat}}
  \gidx{formatentry}{\name{entry}\field{parent}{idx.format}\field{alias}{idx.entryformat}}
  \gidx{acronymformat}{\name{acronym format}
   \field{alias}{idx.acronymstyle}
  }
  \gidx{formatacronym}%
  {%
    \name{acronym}
    \field{parent}{idx.format}
    \field{text}{acronym format}
    \field{alias}{idx.acronymstyle}
  }
  \gidxpl{xindyattr}{\field{text}{xindy attribute}}
  \gidx{accessattr}{\name{accessibility attribute}}
  \gidx{attribute}{\field{see}{idx.accessattr,idx.categoryattribute,idx.xindyattr}}
  \gidx{preamble}{}
  \gidx{glossarypreamble}
  {
    \name{glossary}
    \field{first}{glossary preamble}
    \field{text}{preamble}
    \field{parent}{idx.preamble}
  }
  \gidx{documentpreamble}
  {
    \common
    \name{document}
    \field{first}{document preamble}
    \field{text}{preamble}
    \field{parent}{idx.preamble}
  }
  \gidx{bibpreamble}
  {
    \name{\filefmt{bib}}
    \field{text}{preamble}
    \field{parent}{idx.preamble}
  }
  \gidx{postamble}{}
  \gidx{compositor}{}
  \gidx{pageprecedence}{\name{page precedence}}
  \gidx{pagecompositor}{\name{page compositor}\field{alias}{idx.compositor}}
  \gidx{compositelocation}{\name{composite location}\field{alias}{idx.compositor}}
  \gidx{auto-completion}{}
  \gidxpl{PDFbookmark}{\field{text}{\glsxtrsmfont{PDF} bookmark}}
  \gidx{PDFelement}{\name{\glsxtrsmfont{PDF} element}}
  \gidx{hyperlink}{\common}
  \gidx{hypertarget}{}
  \gidx{tableofcontents}{\name{table of contents}\common}
  \gidx{uppercase}{\field{seealso}{idx.titlecase,idx.sentencecase,idx.allcaps}}
  \gidx{lowercase}{}
  \gidx{titlecase}{\name{title case}}
  \gidx{sentencecase}{\common\name{sentence case}}
  \gidx{allcaps}{\common\name{all caps}}
  \gidx{mathmode}{\name{math mode}}
  \gidx{encoding}{\field{seealso}{idx.codepage}}
  \gidx{codepage}{\field{seealso}{idx.encoding}}
  \gidx{range}{\name{ranges (locations)}
    \field{text}{range}
  }
  \gidx{locationrange}{\name{location range}}
  \gacr{PDF}{PDF}{Portable Document Format}{}
  \gacr{URL}{URL}{Uniform Resource Locator}{}
  \gacr{DVI}{DVI}{device independent file format}{}
  \gidx{interwordspace}{\name{inter-word space}}
  \gidx{intersentencespace}{\name{inter-sentence space}}
  \gidx{spacefactor}{\name{space factor}}
  % COMMANDS: GENERAL
  \gcmd{new\-dual\-entry}{}% \newdualentry
  \gcmd{cs.glossary}{\name{\csfmt{glossary}}}% \glossary
  \gcmd{make\-glossary}{}% \makeglossary
  \gcmd{Print\-Changes}{}% \PrintChanges
  \gcmd{pro\-vide\-com\-mand}{}% \providecommand
  \gcmd{job\-name}{}% \jobname
  \gcmd{new\-write}{}% \newwrite
  \gcmd{no\-files}{}% \nofiles
  \gcmd{write}{}% \write
  \gcmd{num\-ber\-line}{}% \numberline
  \gcmd{add\-contents\-line}{}% \addcontentsline
  \gcmd{en\-sure\-math}{}% \ensuremath
  \gcmd{set\-to\-width}{}% \settowidth
  \gcmd{set\-to\-height}{}% \settoheight
  \gcmd{set\-to\-depth}{}% \settodepth
  \gcmd{def}{}% \def
  \gcmd{gdef}{}% \gdef
  \gcmd{space}{\common}% \space
  \gcmd{protected\-@\-edef}{}% \protected@edef
  \gcmd{protected\-@\-write}{}% \protected@write
  \gcmd{protected\-@\-cs\-edef}{}% \protected@csedef
  \gcmd{protected\-@\-cs\-xdef}{}% \protected@csxdef
  \gcmd{@for}{}% \@for
  \gcmd{index\-entry}{}% \indexentry
  \gcmd{un\-skip}{}% \unskip
  \gcmd{relax}{}% \relax
  \gcmd{markboth}{}% \markboth
  \gcmd{markright}{}% \markright
  \gcmd{front\-matter}{}% \frontmatter
  \gcmd{main\-matter}{}% \mainmatter
  \gcmd{protect}{}% \protect
  \gcmd{string}{}% \string
  \gcmd{null}{}% \null
  \gcmd{makebox}{}% \makebox
  \gcmd{@gobble}{}% \@gobble
  \gcmd{@first\-of\-one}{}% \@firstofone
  \gcmd{index}{}% \index
  \gcmd{input}{}% \input
  \gcmd{include}{}% \include
  \gcmd{item}{}% \item
  \gcmd{sub\-item}{}% \subitem
  \gcmd{sub\-sub\-item}{}% \subsubitem
  \gcmd{par}{}% \par
  \gcmd{the}{}% \the
  \gcmd{foot\-note}{}% \footnote
  \gcmd{ref\-step\-counter}{}% \refstepcounter
  \gcmd{the\-page}{}% \thepage
  \gcmdmeta{the}{counter}{}{}% \the<counter>
  \gcmdmeta{theH}{counter}{}{}% \theH<counter>
  \gcmd{At\-Be\-gin\-Doc\-u\-ment}{}% \AtBeginDocument
  \gcmd{cite}{}% \cite
  \gcmd{ref}{}% \ref
  \gcmd{page\-ref}{}% \pageref
  \gcmd{label}{}% \label
  \gcmd{caption}{}% \caption
  \gcmd{section}{}% \section
  \gcmd{chapter}{}% \chapter
  \gcmd{part}{}% \part
  \gcond{if\-@\-open\-right}{}% \if@openright
  \gopt{open\-right}{}% openright class option
  \gcmd{two\-column}{}% \twocolumn
  \gcmd{one\-column}{}% \onecolumn
  \gcmd{index\-name}{}% \indexname
  \gcmd{S}{}% \S
  \gcmd{c}{}% \c
  \gcmd{text\-bar}{}% \textbar
  \gcmd{make\-at\-letter}{}% \makeatletter
  \gcmd{make\-at\-other}{}% \makeatother
  \gcmd{space\-factor}{}% \spacefactor
  \gcmd{alpha}{}% \alpha
  \gcmd{arabic}{}% \arabic
  \gcmd{@arabic}{}% \@arabic
  \gcmd{roman}{}% \roman
  \gcmd{@roman}{}% \@roman
  \gcmd{Roman}{}% \Roman
  \gcmd{alph}{}% \alph
  \gcmd{Alph}{}% \Alph
  \gcmd{tex\-or\-pdf\-string}{}% \texorpdfstring
  \gcmd{pdf\-string\-def\-Disable\-Commands}{}% \pdfstringdefDisableCommands
  \gcmd{pdf\-string\-def\-Pre\-Hook}{}% \pdfstringdefPreHook
  \gcmd{hyper\-page}{}% \hyperpage
  \gcmd{hyper\-link}{}% \hyperlink
  \gcmd{hyper\-target}{}% \hypertarget
  \gcmd{no\-hyper\-page}{}% \nohyperpage
  \gcmd{phantom\-section}{}% \phantomsection
  \gcmd{name\-ref}{}% \nameref
  \gcmd{text\-smaller}{}% \textsmaller
  \gcmd{text\-rm}{}% \textrm
  \gcmd{text\-sf}{}% \textsf
  \gcmd{text\-tt}{}% \texttt
  \gcmd{text\-bf}{}% \textbf
  \gcmd{text\-md}{}% \textmd
  \gcmd{text\-it}{}% \textit
  \gcmd{text\-sl}{}% \textsl
  \gcmd{text\-sc}{}% \textsc
  \gcmd{text\-up}{}% \textup
  \gcmd{text\-ulc}{}% \textulc
  \gcmd{emph}{}% \emph
  \gcmd{bfseries}{}% \bfseries
  \gcmd{lan\-guage\-name}{}% \languagename
  \gcmd{for\-eign\-lan\-guage}{}% \foreignlanguage
  \gcmd{babel\-pro\-vide}{}% \babelprovide
  \gcmd{es@scroman}{}% \es@scroman
  \gcmd{in\-put\-en\-cod\-ing\-name}{}% \inputencodingname
  \gcmdmeta{cap\-tions}{lan\-guage}{}{}% \captions<language>
  \gcmd{also\-name}{}% \alsoname
  \gcmd{set\-main\-language}{}% \setmainlanguage
  \gcmd{set\-other\-language}{}% \setotherlanguage
  \gcmd{list\-break}{}% \listbreak
  \gcmd{for\-list\-loop}{}% \forlistloop
  \gcmd{if\-cs\-un\-def}{}% \ifcsundef
  \gcmd{if\-cs\-void}{}% \ifcsvoid
  \gcmd{if\-cs\-str\-equal}{}% \ifcsstrequal
  \gcmd{if\-def\-str\-equal}{}% \ifdefstrequal
  \gcmd{if\-cs\-string}{}% \ifcsstring
  \gcmd{if\-def}{}% \ifdef
  \gcmd{if\-un\-def}{}% \ifundef
  \gcmd{cs\-let\-cs}{}% \csletcs
  \gcmd{app\-to}{}% \appto
  \gcmd{dicei}{}% \dicei
  \gcmd{diceii}{}% \diceii
  \gcmd{diceiii}{}% \diceiii
  \gcmd{diceiv}{}% \diceiv
  \gcmd{dicev}{}% \dicev
  \gcmd{dicevi}{}% \dicevi
  \gcmd{Num\-ber\-string}{}% \Numberstring
  \gcmd{Begin\-Acc\-Supp}{}% \BeginAccSupp
  \gcmd{End\-Acc\-Supp}{}% \EndAccSupp
  \gcmd{in\-clude\-graph\-ics}{}% \includegraphics
  \gcmd{@mk\-both}{}% \@mkboth
  \gcmd{mark-both}{}% \markboth
  \gcmd{mem\-UC\-head}{}% \memUChead
  \gcmd{clear\-double\-page}{}% \cleardoublepage
  \gcmd{clear\-page}{}% \clearpage
  \gcmd{Pass\-Op\-tions\-To\-Pack\-age}{}% \PassOptionsToPackage
  \gcmd{new\-line}{}% \newline
  \gcmd{Make\-Upper\-case}{}% \MakeUppercase
  \gcmd{Make\-Text\-Upper\-case}{}% \MakeTextUppercase
  \gcmd{Make\-Lower\-case}{}% \MakeLowercase
  \gcmd{xspace}{}% \xspace
  \gcmd{for\-list\-cs\-loop}{}% \forlistcsloop
  \gcmd{Get\-Title\-String\-Set\-up}{}% \GetTitleStringSetup
  \gcmd{No\-Case\-Change}{}% \NoCaseChange
  \gcmd{top\-rule}{}% \toprule
  \gcmd{mid\-rule}{}% \midrule
  \gcmd{bottom\-rule}{}% \bottomrule
  % COMMANDS: CONTROL SYMBOL
  \gpunccmd{cs.bsl}{\glsbackslash}{}% \\
  \gpunccmd{cs.amp}{\&}{}% \&
  \gpunccmd{cs.dollar}{\$}{}% \$
  \gpunccmd{cs.apos}{'}{}% \'
  \gpunccmd{cs.at}{@}{}% \@
  \gpunccmd{cs.hash}{\#}{}% \#
  \gpunccmd{cs.openbrace}{\glsopenbrace}{}% \{
  \gpunccmd{cs.closebrace}{\glsclosebrace}{}% \}
  \gpunccmd{cs.sp}{\textvisiblespace}% \<space>
  {%
    \field{text}{\csfmt{\space}}
  }
  % PUNCTUATION AND LITERAL CHARACTERS 
  \gpunc{sym.comma}{\name{\code{,} (comma)}\field{symbol}{\code{,}}}
  \gpunc{sym.equals}{\name{\code{=} (equals)}\field{symbol}{\code{=}}}
  \gpunc{sym.colon}{\name{\code{:} (colon)}\field{symbol}{\code{:}}}
  \gpunc{sym.dblquote}{\name{\code{"} (double-quote)}\field{symbol}{\code{"}}}
  \gpunc{sym.apos}{\name{\code{'} (apostrophe)}\field{symbol}{\code{'}}}
  \gpunc{sym.questionmark}{\name{\code{?} (question mark)}\field{symbol}{\code{?}}}
  \gpunc{sym.exclammark}{\name{\code{!} (exclamation mark)}\field{symbol}{\code{!}}}
  \gpunc{sym.pipe}{\name{\code{|} (pipe)}\field{symbol}{\code{|}}}
  \gpunc{sym.at}{\name{\code{@} (at)}\field{symbol}{\code{@}}}
  \gpunc{sym.bksl}{\name{\code{\glsbackslash} (literal backslash)}
    \field{symbol}{\code{\glsbackslash}}
  }
  \gpunc{sym.hash}{\name{\code{\#}}}% #
  \gpunc{sym.hashhash}{\name{\code{\#\#}}}% ##
  \gpunc{sym.dollar}{\name{\code{\$}}}% $
  \gpunc{sym.bg}{\name{\code{\glsopenbrace}}}% {
  \gpunc{sym.eg}{\name{\code{\glsclosebrace}}}% }
  \gpunc{sym.pc}{\name{\code{\glspercentchar}}}% %
  \gpunc{sym.tilden}{\name{\code{\glstildechar n}}}% ~n
  \gpunc{sym.sp}{\name{\code{\textasciicircum}}}% ^
  \gpunc{sym.sb}{\name{\code{\_}}} % _
  \gpunc{sym.amp}{\name{\code{\&}}} % &
  \gpunc{starmod}{\name{\code{*} (star modifier)}
   \field{text}{star}
   \field{symbol}{\code{*}}
  }
  \gpunc{plusmod}{\name{\code{+} (plus modifier)}
   \field{text}{plus}
   \field{symbol}{\code{+}}
  }
  \gpunc{sym.startrange}{\name{\code{\nlctopenparen} (range start)}
   \field{symbol}{\code{\nlctopenparen}}
   \field{seealso}{idx.range}
  }
  \gpunc{sym.endrange}{\name{\code{\nlctcloseparen} (range end)}
   \field{symbol}{\code{\nlctcloseparen}}
   \field{seealso}{idx.range}
  }
  \gpunc{vbsp}{\name{\code{\textvisiblespace} (space)}
   \field{symbol}{\code{\textvisiblespace}}
  }
  \gpunc{sym.fullstop}{\name{\code{.} (full stop or period)}
    \field{see}{idx.fullstop}
  }
  \gpunc{sym.nbsp}{\name{\code{\textasciitilde} (non-breaking space)}
    \field{symbol}{\code{\textasciitilde}}
    \field{see}{idx.nbsp}
  }
  \gpunc{sym.tilde}{\name{\code{\textasciitilde} (literal)}
    \field{symbol}{\code{\textasciitilde}}
  }
  \gidx{period}{\name{period (\code{.})}%
    \field{text}{period}
    \field{alias}{idx.fullstop}
  }
  \gidx{fullstop}{\name{full stop (\code{.})}%
    \field{text}{full stop}
    \field{symbol}{\code{.}}
  }
  \gidx{nbsp}{\name{non-breaking space (\code{\textasciitilde})}
    \field{symbol}{\code{\textasciitilde}}
  }
  % GENERAL ENVIRONMENTS
  \genv{document}{}
  \genv{equation}{}
  \genv{table}{}
  \genv{tabular}{}
  \genv{description}{}
  \genv{itemize}{}
  \genv{long\-table}{}% longtable
  \genv{super\-tabular}{}% supertabular
  \genv{multi\-cols}{}% multicols
  \genv{tab\-u\-larx}{}% tabularx
  \genv{align}{}% align
  \genv{frame}{}% (beamer)
  % GENERAL COUNTERS
  \gctr{equation}{}
  \gctr{section}{}
  \gctr{chapter}{}
  \gctr{part}{}
  \gctr{page}{}
  \gctr{table}{}
  % INDEXING OPTIONS
  \gidx{opt.noidx}{\name{Option 1 (\qt{noidx})}\field{text}{1}}
  \gidx{opt.mkidx}{\name{Option 2 (\appfmt{makeindex})}\field{text}{2}}
  \gidx{opt.xdy}{\name{Option 3 (\appfmt{xindy})}\field{text}{3}}
  \gidx{opt.b2g}{\name{Option 4 (\appfmt{bib2gls})}\field{text}{4}}
  \gidx{opt.unsrt}{\name{Option 5 (\qt{unsrt})}\field{text}{5}}
  \gidx{opt.standalone}{\name{Option 6 (\qt{standalone})}\field{text}{6}}
  % TERMS
  \gterm{field}%
  {%
   \common
    \name{field}
    \desc{entry data is stored in fields. These may have a
     corresponding key used to set the value, such as \gloskey{name}
     or \gloskey{description}}
  }
  \gterm{internalfield}%
  {%
    \name{internal field}
    \desc{an internal \idx{field} may refer to a key that shouldn't be
    used in the \ext{bib} file (\idx{bib2glsinternalfield}), such as
    the \gloskey{group} field, or it may refer to the
    \idxc{internalfieldlabel}{label} used to internally represent the
    \idx{field} (which may or may not match the key used to set the
    \idx{field} or may not have an associated key), such as \glosfield{useri} which
    corresponds to the \gloskey{user1} key, or it may refer to a \idx{field}
    that is only ever used internally that should not be explicitly
    modified, such as the field used to store the entry's
    hierarchical level
}
    \field{see}{idx.glosfield}
  }
  \gterm{bib2glsinternalfield}%
  {%
    \name{internal field (\appfmt{bib2gls})}
    \desc{a \idx{field} that is used or assigned by \app{bib2gls}
    that should typically not be used in the \ext+{bib} file}
  }
  \gterm{internalfieldlabel}%
  {%
    \name{internal field label}
    \desc{the field label that forms part of the internal control
    sequence used to store the field value. This may or may not
    match the key used to assign the value when defining the entry.
    See \Tableref{tab:fieldmap}}
  }
  \gterm{unsrtfam}%
  {%
    \name{print \qt{unsrt} glossary commands}
    \field{text}{\qt{unsrt} family of commands}
    \desc{the set of commands used for displaying a \idx{glossary} or
     partial \idx{glossary} that have \qt{unsrt} in the name, such as
     \gls{printunsrtglossary}. See the \sty{glossaries-extra} manual
    for further details}
  }
  \gterm{whatsit}%
  {%
    \desc{a command whose execution is delayed or an OS-specific special command.
    This includes writing to external files (which is what indexing does)}
  }
  \gterm{indexingapp}{\name{indexing application}%
   \common
   \desc{an application (piece of software) separate from
    \protect\TeX/\protect\LaTeX\ that collates and sorts information that has an
    associated page reference. Generally the information is an index
    entry but in this case the information is a \idx{glossary} entry.
    There are two main indexing applications that are used with \TeX: 
    \app+{makeindex} and \app+{xindy}. (There is also a new
    application called \app{xindex}, but this isn't supported by
    \sty{glossaries} or \sty{glossaries-extra}.) The \sty{glossaries-extra} 
    package additionally supports \app{bib2gls}. These are all
    \idx{cli} applications.}%
  }% 
  \gterm{indexingfile}%
  {
    \name{indexing file}
    \desc{a file that's input (read) by an \idx{indexingapp}, such
    as the style file (\ext{ist} or \ext{xdy}) or the files
    containing the \idx{indexing} data (the sort value, \hierarchical\
    information, \idx{locationencap} and
    \idx{entrylocation}). These files are output files from the
    point of view of the \sty{glossaries} package as it's \TeX\ that
    creates and writes to those files. An indexing file may also
    refer to the files that are created by the \idx{indexingapp}.
    These are output files from the \idx{indexingapp}['s] point of
    view, but they are input files from \TeX's point of view as they
    are input by commands used in the document.}
  }
  \gidx{glossaryfile}{\name{glossary file}\field{alias}{indexingfile}}
  \gterm{indexing}{%
   \common
    \name{indexing (or recording)}
    \field{text}{indexing}
    \desc{the process of saving the \idx+{entrylocation} and any
      associated information that is required in the \idx{glossary}. In
      the case of \app{makeindex} and \app{xindy}, the
      \idx{entrylocation}, \idx{encap}, entry item and sort value are written
      to a supplementary file associated with the \idx{glossary} that is
      subsequently read by \app{makeindex}\slash\app{xindy}. In the
      case of \app{bib2gls} and the \qt{noidx} method, the
      \idx{entrylocation}, \idx{encap} and label is written to the
      \ext+{aux} file.}
  }
  \gtermacr{cli}{CLI}{command-line interface}%
  {%
    \desc{an application that doesn't have a graphical user
     interface. That is, an application that doesn't have any windows,
     buttons or menus and can be run in
     \dickimawhref{latex/novices/html/terminal.html}{a command
     prompt or terminal}}%
  }%
  \gtermacr{gui}{GUI}{graphical user interface}%
  {%
    \desc{an application that has windows, buttons or menus}
  }
  \gtermacr{ascii}{ASCII}{American Standard Code for Information Interchange}
  {%
    \desc{a single-byte character \idx+{encoding}. Related blog article:
    \blog{binary-files-text-files-and-file-encodings/}{Binary
    Files, Text Files and File Encodings}}
  }
  \gtermacr{utf8}{UTF\glsxtrrevert{-8}}{Unicode Transformation Format (8-bit)}
  {%
    \desc{a variable-width \idx+{encoding} that uses 8-bit code units. This
    means that some characters are represented by more that one byte.
    \XeLaTeX\ and \LuaLaTeX\ treat the multi-byte sequence as a single
    token, but the older \LaTeX\ formats have single-byte tokens, which
    can cause complications, although these have mostly been addressed with
    the newer kernels introduced over the past few years. Related blog article:
    \blog{binary-files-text-files-and-file-encodings/}{Binary Files,
    Text Files and File Encodings}}
  }
  \gterm{latinchar}%
  {%
    \name{Latin character}
    \desc{One of the letters \qt{a}, \ldots, \qt{z}, 
    \qt{A}, \ldots, \qt{Z}\@}
    \field{seealso}{exlatinchar}
  }
  \gterm{exlatinchar}
  {%
    \name{extended Latin character}
    \desc{a character that's created by combining \idxpl{latinchar}
     to form ligatures (e.g.\ \ae) or by applying diacritical marks
     to a~\idx{latinchar} or characters (e.g.\ \'a)}
    \field{seealso}{nonlatinchar}
  }%
  \gterm{latexexlatinchar}%
  {%
    \name{standard \LaTeX\ extended Latin character}
    \desc{an \idx{exlatinchar} that can be created by a~core
    \LaTeX\ command, such as \csfmt{o} (\o) or \code{\csfmt{'}e} (\'e). 
    That is, the character can be produced without the need to load 
    a~particular package}
  }%
  \gterm{nonlatinchar}%
  {%
    \name{non-Latin character}
    \desc{an \idx{exlatinchar} or a~character that isn't a~\idx{latinchar}}
  }%
  \gterm{latinalph}%
  {%
    \name{Latin alphabet}%
    \desc{the alphabet consisting of \idxpl{latinchar}}
    \field{seealso}{exlatinalph}
  }%
  \gterm{exlatinalph}%
  {%
    \name{extended Latin alphabet}
    \desc{an alphabet consisting of \idxpl{latinchar} and \idxpl{exlatinchar}.}
  }%
  \gterm{nonlatinalph}%
  {%
    \name{non-Latin alphabet}
    \desc{an alphabet consisting of \idxpl{nonlatinchar}}
  }%
  \gterm{sanitize}%
  {%
    \desc{converts command names into character sequences. That is, a command called,
  say, \csfmt{foo}, is converted into the sequence of characters:
  \csfmt{}, \code{f}, \code{o}, \code{o}. Depending on the font,
  the backslash character may appear as a dash when used in the
  main document text, so \csfmt{foo} will appear as: ---foo.
  \glspar
  Earlier versions of \sty{glossaries} used this technique to write
  information to the files used by the indexing applications to
  prevent problems caused by fragile commands. Now, this is only used
  for the \gloskey{sort} key.}
  }%
  \gterm{idx.group}{\name{group (letters, numbers, symbols)}
   \field{text}{group}%
   \desc{a logical division within a \idx{glossary} that is typically a
    by-product of the \idx{indexingapp}['s] sorting algorithm.
    \Idxpl{glossarystyle} may or may not start each group with a
    title (such as \qt{Symbols} or \qt{A}) or a vertical space. See also
    \gallerypage{logicaldivisions}{Gallery: Logical Glossary Divisions
    (type vs group vs parent)}}%
  }%
  \gidx{lettergroup}{\name{letter group}\field{alias}{idx.group}}
  \gterm{hierarchicallevel}{\name{hierarchical level}%
   \common
   \desc{a number that indicates how many ancestors an entry has.
    An entry with no parent has hierarchical level~0. If an entry
    has a parent then the hierarchical level for the entry is one
    more than the hierarchical level of the parent. Most styles will
    format an entry according to its hierarchical level, giving
    prominence to level~0 entries, although some may have a maximum
    supported limit. The level is stored in the \glosfield{level}
    internal field. It can be accessed using commands like
    \gls{glsfieldfetch} or \gls{glsxtrusefield}, but neither the
    \glosfield{level} nor the \gloskey{parent} values should be altered
    as it will cause inconsistencies in the sorting and
    \idx{glossary} formatting. See also \sectionref{sec:subentries}}
  }
  \gidx{sub-entry}{%
    \field{plural}{sub-entries}
    \field{see}{hierarchicallevel}
  }
  \gterm{homograph}
  {
    \desc{each of a set of words that have the same spelling but
    have different meanings and origins. They may or may not have
    different pronunciations}
  }
  \gterm{locationlist}{\name{location list}%
   \common
    \desc{a list of \idxpl+{entrylocation} (also called a number
    list). May be suppressed for all \idxpl{glossary} with the package option
    \opt{nonumberlist} or for individual \idxpl{glossary} with
    \printglossopt{nonumberlist}. With \app{bib2gls}, the list may
    also be suppressed with \resourceoptval{save-locations}{false}}
  }
  \gterm{locationencap}{\name{location encap (format)}
    \field{text}{location encap}
    \desc{a command used to encapsulate an \idx{entrylocation}.
     The control sequence name (without the leading backslash)
     is identified by the \glsopt{format} key. The default encap is
     \gls{glsnumberformat}. See \sectionref{sec:encap} for further details}
  }
  \gidx{encap}{\field{alias}{locationencap}}
  \gidxpl{multipleencap}{
    \field{text}{multiple encap}
    \field{seealso}{locationencap}
  }
  \gidx{locationformat}{%
   \name{location}
   \field{parent}{idx.format}%
   \field{text}{location format}
   \field{alias}{locationencap}%
  }
  \gidx{standardformat}
  {
     \name{standard location format}
     \field{text}{standard format}
  }
  \gidx{formatstandard}
  {
    \name{standard}
    \field{parent}{idx.format}%
    \field{alias}{idx.standardformat}
  }
  \gterm{locationcounter}{\name{location counter}
    \desc{the counter used to obtain the \idx{entrylocation}}
  }
  \gterm{entrylocation}{\common\name{entry location}%
    \desc{the location of the entry in the document (obtained from
    the \idx{locationcounter} or from the \glsopt{thevalue} option). This defaults to the page number
    on which the entry has been
    referenced with any of the \gls{glslike}, \gls{glstextlike} or \gls{glsadd}
    commands. An entry may have multiple locations that form a list.
    See also \sectionref{sec:locationsyntax}}
  }
  \gidx{numberlist}{\name{number list}\field{alias}{locationlist}}
  \gidx{pagelist}{\name{page list}\field{see}{locationlist}}
  \gterm{ignoredlocation}{\name{ignored location (or record)}%
   \field{text}{ignored location}
   \desc{a \location\ that uses \encap{glsignore} as the
    \idx{encap}. With \app{bib2gls}, this indicates that the entry
    needs to be selected but the \location\ isn't added to the
    \idx{locationlist}. With other methods, this will simply create
    an invisible \location, which can result in unwanted commas if
    the \idx{locationlist} has other items. With \app{bib2gls}
    v3.0+, \idxpl+{emptylocation} will be converted to ignored locations}
  }
  \gidx{locationignored}{\name{location, ignored\slash invisible}%
    \field{see}{ignoredlocation}}
  \gidx{emptylocation}{\name{location, empty (or invisible)}
    \field{text}{empty location}
    \field{seealso}{ignoredlocation}
  }
  \gidx{invisiblelocation}{\name{invisible location}
    \field{alias}{idx.emptylocation}
  }
  \gterm{ignoredglossary}{\name{ignored glossary}%
    \common
    \field{plural}{ignored glossaries}%
    \desc{a \idx{glossary} that has been defined using a command like
     \gls{newignoredglossary}. These \idxpl{glossary} are omitted by
     iterative commands, such as \gls{printglossaries} and
     \gls{printunsrtglossaries}. An ignored
     \idx{glossary} can only be displayed with \gls{printunsrtglossary}}
  }
  \gidx{glossaryignored}{\name{glossary, ignored}\field{see}{ignoredglossary}}
  \gterm{firstuseflag}{\name{first use flag}%
    \common
    \desc{a conditional that keeps track of whether or not an entry
     has been referenced by any of the \gls{glslike} commands (which
     can adjust their behaviour according to whether or not this flag is
     true). The conditional is true if the entry hasn't been used by
     one of these commands
     (or if the flag has been reset) and false if it has been used
     (or if the flag has been unset)}
  }
  \gterm{firstuse}{\name{first use}%
    \common
    \desc{the first time an entry is used by a command that unsets
     the \idx{firstuseflag} (or the first time since the flag was
     reset)}
  }
  \gterm{firstusetext}{\name{first use text}%
    \common
    \desc{the \idx{linktext} that is displayed on \idx{firstuse} of
    the \gls{glslike} commands}
  }
  \gterm{subsequentuse}{\name{subsequent use}
    \common
    \desc{using an entry that unsets the \idx{firstuseflag} when it
    has already been unset}
  }
  \gterm{glslike}{\common\name{\csfmt{gls}-like}
   \common
    \desc{commands like \gls{gls} and \gls{glsdisp} that change the
    \idx{firstuseflag}. These commands index the entry (if indexing
    is enabled), create a \idx{hyperlink} to the entry's \idx{glossary} listing (if enabled)
    and unset the \idx{firstuseflag}. These commands end with the
    \idx{postlinkhook}}
  }
  \gterm{glstextlike}{\common\name{\csfmt{glstext}-like}
   \common
    \desc{commands like \gls{glstext} and \gls{glslink} that don't change
    the \idx{firstuseflag}. These commands index the entry (if indexing
    is enabled) and create a \idx{hyperlink} to the entry's \idx{glossary} listing (if enabled). These commands end with the \idx{postlinkhook}}
  }
  \gterm{linktext}{\name{link text}%
   \common
    \desc{the text produced by \gls{glslike} and \gls{glstextlike}
     commands that have the potential to be a \idx+{hyperlink}}
  }
  \gterm{postlinkhook}{\name{post-link hook}
    \desc{a hook (command) that is used after \idx{linktext} to
    allow code to be automatically added. The base \sty{glossaries}
    package provides a general purpose hook \gls{glspostlinkhook}. The
    \sty{glossaries-extra} package modifies this command to provide
    additional hooks}
  }
  \gterm{postdeschook}{\name{post-description hook}%
    \desc{a hook (\gls{glspostdescription}) included in some \idxpl{glossarystyle} 
    that is used after the description is displayed. 
    The \sty{glossaries-extra} package modifies
    this command to provide additional hooks}
  }
  \gterm{resourceset}%
  {%
    \name{resource set}
    \desc{all the settings (\idxpl{resourceopt}) and entries associated with a particular
     instance of \gls{GlsXtrLoadResources}}
  }
  \gterm{resourcefile}%
  {%
    \name{resource file}
    \desc{the \ext+{glstex} file created by \app{bib2gls} and loaded by
     \gls{GlsXtrLoadResources}}
  }
  \gterm{smallcaps}%
  {%
    \name{small capitals (small caps)}
    \field{text}{small caps}
    \desc{The \LaTeX\ kernel provides \code{\gls{textsc}\margm{text}} 
    to produce small capitals. This uses a font where
    \idx{lowercase} letters have a small capital design.
    \Idx{uppercase} letters have the standard height and there's no
    noticeable difference with \idx{uppercase} characters in corresponding 
    non-small caps fonts.  This means that for a small caps appearance, 
    you need to use \idx{lowercase} letters in the
    \meta{text} argument. The \sty{relsize} package provides
    \code{\gls{textsmaller}\margm{text}} which simulates small caps 
    by reducing the size of the font, so in this case the contents of 
    \meta{text} should be \idx{uppercase} (otherwise the effect is simply 
    smaller \idx{lowercase} letters). Some fonts don't support small caps 
    combined with bold or slanted properties. In this case, there will be 
    a font substitution warning and one of the properties (such as 
    small caps or slanted) will be dropped}
  }
  \gterm{casechange}{\name{case change}
   \common
   \desc{there are four types of case-changing commands provided by the
    \sty{glossaries} package:
    \begin{deflist}
    \itemtitle{\idx{allcaps}}
    \begin{itemdesc}For example, \gls{GLS} and \gls{GLStext}.
     All letters in the given text are converted to
    \idx{uppercase} (capitals). The actual case-conversion is
     performed by \gls{glsuppercase}.\end{itemdesc}
    \itemtitle{\idx{sentencecase}}
    \begin{itemdesc}For example, \gls{Gls} and \gls{Glstext}.
     Only the first letter is converted to \idx{uppercase}.
     The case-conversion for the \gls{glslike} and \gls{glstextlike}
     commands is performed via \gls{glssentencecase}, which is
     simply defined to use the robust \gls{makefirstuc}.
     Commands such as \gls{Glsentrytext} also use
     \gls{glssentencecase} in the document but use the expandable 
     \gls{MFUsentencecase} in \idxpl{PDFbookmark}.\end{itemdesc}
    \itemtitle{\idx{titlecase}}
    \begin{itemdesc}For example, \gls{glsentrytitlecase}.
    The first letter of each word is converted to \idx{uppercase}.
    The case-conversion is performed using \gls{glscapitalisewords}
    in the document text, but commands designed for use in section
    headings, use the expandable \gls{MFUsentencecase} in 
    \idxpl{PDFbookmark}.\end{itemdesc}
    \itemtitle{\idx{lowercase}}
    \begin{itemdesc}The command \gls{glslowercase} is provided 
    for use in modifying \idx{acronym} or \idx{abbreviation} commands to convert 
    the short form to \idx{lowercase} for \idx{smallcaps} styles,
    but isn't actually used by any of the commands provided by
    \sty{glossaries}. This command should be preferred to
    the robust \gls{MakeLowercase} if expansion is required.\end{itemdesc}
    \end{deflist}
    Ensure that you have at least \sty{mfirstuc} v2.08 for improved
    case-changing performed by new \LaTeX3 commands. See the
   \sty{mfirstuc} manual for further details.}
   \field{seealso}{idx.uppercase,idx.lowercase,idx.titlecase,idx.sentencecase,idx.allcaps}}
  \gterm{shellescape}
  {
     \name{shell escape}
     \desc{\TeX\ has the ability to run \idx{cli} applications while
      it's typesetting a document. Whilst this is a convenient way
      of using tools to help build the document, it's a security
      risk. To help protect users from arbitrary\dash and
      potentially dangerous\dash code from begin executed, \TeX\ has
      a restricted mode, where only trusted applications are allowed to
      run. This is usually the default mode, but your \TeX\
      installation may be set up so that the shell escape is disabled by
      default. The unrestricted mode allows you to run any
      application from the shell escape. Take care about
      enabling this option. If you receive a document or package
      from an untrusted source, first run \LaTeX\ with the shell escape
      disabled or in restricted mode and search the \ext{log} file for
      \qt{runsystem} before using the unrestricted mode}
  }
  \gterm{glossary}%
  {%
    \common
    \name{glossary}
    \field{plural}{glossaries}
    \desc{technically a glossary is an alphabetical list of words
    relating to a particular topic. For the purposes of describing
    the \styfmt{glossaries} and \sty{glossaries-extra} packages, a
    glossary is either the list produced by commands like
    \gls{printglossary} or \gls{printunsrtglossary} (which may or
    may not be ordered alphabetically) or a glossary is a set of
    \idx{entry} labels where the set is identified by the glossary label
    or type}
  }
  \gterm{entryline}
  {
     \name{entry line}
     \desc{the line in the \idx{glossary} where the \idx{entry} is
     shown. This may be a single row in a tabular-style or the start of a
     paragraph for list or index styles or mid-paragraph for the 
     \glostyle{inline} style. The exact formatting depends on the
     \idx{glossarystyle}, but usually includes the name and
      description. If \idxpl+{hyperlink} are enabled, the
     \gls{glslike} and \gls{glstextlike} commands will create a
     \idx{hyperlink} to this line}
  }
  % GLOSSARY TYPES
  % main
  \gglostype{main}{\common}
  % acronym
  \gglostype{acronym}{\common}
  % symbols
  \gglostype{symbols}{}
  % numbers
  \gglostype{numbers}{}
  % index
  \gglostype{index}{}
  % abbreviations
  \gglostype{abbreviations}{}
}

\newcommand*{\bibglsgallery}[2][\gallerytitle]{%
 \def\gallerytitle{#2}%
 \gallerypage{label=bib2gls-#2}{\appfmt{bib2gls} gallery: \gallerytitle}}

\newcommand*{\bibglsbegin}{%
 \ctansupportmirror{bib2gls/bib2gls-begin.pdf}{\styfmt{glossaries-extra} and \appfmt{bib2gls}: An Introductory Guide}}


\newcommand{\glsxtrnote}{\sidenote{\sty{glossaries-extra}}}
\newcommand{\bibglsnote}{\sidenote{\app{bib2gls}}}

\newenvironment{xtr}
{\begin{information}[title={\sty{glossaries-extra}}]}
{\end{information}}

\newenvironment{bib2gls}
{\begin{information}[title={\app{bib2gls}}]}
{\end{information}}

\title{User Manual for glossaries.sty v4.54}
\author{Nicola L.C. Talbot\\%
 \href{http://www.dickimaw-books.com/contact}{\nolinkurl{dickimaw-books.com/contact}}}

\date{2024-04-03}

\begin{document}
\maketitle

\htmlavailable

\begin{abstract}
The \sty+{glossaries} package provides a means to define terms or
\idxpl{acronym} or symbols that can be referenced within your document.
Sorted lists with collated \locations\ can be
generated either using \TeX\ or using a supplementary \idx{indexingapp}.
Sample documents are provided with the \sty{glossaries} package.
These are listed in \sectionref{sec:samples}.
\end{abstract}

\begin{xtr}
Additional features not provided here may be available through
the extension package \sty+{glossaries-extra} which, if required,
needs to be installed separately. New features will be added to
\sty{glossaries-extra}. Versions of the \sty{glossaries}
package after v4.21 will mostly be just bug fixes or minor
maintenance. The most significant update to the \sty{glossaries}
package since then is version 4.50, which involved the integration of
\sty{mfirstuc} v2.08 and the phasing out the use of
the now deprecated \sty{textcase} package.

Note that \sty{glossaries-extra} provides an extra indexing option
(\app{bib2gls}) which isn't available with just the base \sty{glossaries} package.
\end{xtr}

If you require multilingual support you must also install
the relevant language module. Each language module is called
\file{glossaries-language}, where \meta{language} is the
root language name. For example, \file{glossaries-french}
or \file{glossaries-german}. If a language module is required,
the \sty{glossaries} package will automatically try to load it
and will give a warning if the module isn't found.  See
\sectionref{sec:languages} for further details.
If there isn't any support available for your language, use
the \opt{nolangwarn} package option to suppress the warning
and provide your own translations. (For example, use
the \printglossopt{title} key in \gls{printglossary}.)

\begin{important}
Documents have wide-ranging styles when it comes to presenting \idxpl{glossary}
or lists of terms or notation. People have their own preferences and
to a large extent this is determined by the kind of information that
needs to go in the \idx{glossary}. They may just have symbols with
terse descriptions or they may have long technical words with
complicated descriptions. The \sty{glossaries} package is
flexible enough to accommodate such varied requirements, but this
flexibility comes at a price: a~big manual.

\twemoji{1f631} If you're freaking out at the size of this manual, start with
\qtdocref{The \styfmt{glossaries} package: a guide
for beginners}{glossariesbegin}. You should find it in the same directory as this
document or try
\texdocref{glossariesbegin}
Once you've got to grips with the basics, then come back to this
manual to find out how to adjust the settings.
\end{important}

The \sty{glossaries} bundle includes the following documentation:
\begin{deflist}
\itemtitle{\docref{The \styfmt{glossaries} package: a guide
for beginners}{glossariesbegin}}
\begin{itemdesc}
If you want some brief information and examples to get you going,
start with the guide for beginners.
\end{itemdesc}

\itemtitle{User Manual for glossaries.sty (\filefmt{glossaries-user.pdf)}}

\begin{itemdesc}
This document is the main user guide for the \sty{glossaries}
package.
\end{itemdesc}

\itemtitle{Documented Code for glossaries (\url{glossaries-code.pdf})}

\begin{itemdesc}
Advanced users wishing to know more about the inner workings of all the
packages provided in the \styfmt{glossaries} bundle should read
\qt{Documented Code for glossaries v4.54}.
\end{itemdesc}

\itemtitle{\url{CHANGES}}
\begin{itemdesc}
Change log.
\end{itemdesc}

\itemtitle{\url{README.md}}

\begin{itemdesc}
Package summary.
\end{itemdesc}

\itemtitle{\url{Depends.txt}}

\begin{itemdesc}
List of all packages unconditionally required by \sty{glossaries}.
Other unlisted packages may be required under certain circumstances.
For help on installing packages see, for example,
\texseref{questions/55437}{How
do I update my \TeX\ distribution?} or (for Linux users)
\texseref{questions/14925}{Updating \TeX\ on Linux}.
\end{itemdesc}

\end{deflist}
Related resources:
\begin{itemize}
\item \bibglsbegin.

\item \faqspkg{glossaries}

\item \gallerytopic{glossaries}

\item
\galleryref{glossaries-styles/}{a summary of all glossary styles provided by \styfmt{glossaries} and
\styfmt{glossaries-extra}}

\item
\galleryref{glossaries-performance.shtml}{\styfmt{glossaries}
performance} (comparing document build times for the different
options provided by \styfmt{glossaries} and \styfmt{glossaries-extra}).

\item \dickimawhref{latex/thesis/}{Using LaTeX to Write a PhD Thesis}
(chapter 6).

\item
\dickimawhref{latex/buildglossaries/}{Incorporating
\appfmt{makeglossaries} or \appfmt{makeglossaries-lite} or 
\appfmt{bib2gls} into the document build}

\item The \ctanref{pkg/glossaries-extra}{\styfmt{glossaries-extra} package}

\item \ctanref{pkg/bib2gls}{\appfmt{bib2gls}}
\end{itemize}

\begin{important}
If you use \sty{hyperref} and \sty{glossaries}, you must load
\sty{hyperref} \emph{first} (although, in general, \sty{hyperref} should be
loaded after other packages).
\end{important}

\frontmatter
\tableofcontents
\listoftables
\listofexamples
\mainmatter

\renewrobustcmd{\texidxoptiondef}[1]{%
  \maintexidxoptiondef{#1}%
} 
\part{User Guide}
\label{userguide}

\chapter{Introduction}
\label{sec:intro}

\pkgdef{glossaries}

The \sty{glossaries} package is provided to assist generating lists
of terms, symbols or \idxpl{acronym}. For convenience, these lists
are all referred to as \idxpl+{glossary} in this manual. The terms,
symbols and \idxpl{acronym} are collectively referred to as
\inlineidxdef{glossaryentry}.

The package has a certain amount of flexibility, allowing the
user to customize the format of the \idx{glossary} and define multiple
\idxpl{glossary}. It also supports \idxpl{glossarystyle} that
include an associated symbol (in addition to a name and description)
for each \idx{glossaryentry}.

There is provision for loading a database of glossary entries. Only
those entries \indexed\ in the document will be displayed in the \idx{glossary}.
(Unless you use \option{unsrt}, which doesn't use any \idx{indexing} but will
instead list all defined entries in order of definition.)

It's not necessary to actually have a \idx{glossary} in the document. You may be
interested in using this package just as means to consistently
format certain types of terms, such as \idxpl{acronym}, or you may
prefer to have descriptions scattered about the document and be able
to easily link to the relevant description (\option{standalone}).

\mExampleref{ex:simplenogloss} demonstrates a simple document
without a glossary:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[
  \opteqvalref{sort}{none} \comment{no sorting or \idx{indexing} required}
]
\marg{glossaries}
\codepar
\gls{newglossaryentry}
 \marg{cafe}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{caf\'e},
   \gloskeyval{description}{small restaurant selling refreshments}
 }
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}
 \marg{html}\comment{label}
 \marg{HTML}\comment{short form}
 \marg{hypertext markup language}\comment{long form}
\codepar
\gls{newglossaryentry}
 \marg{pi}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{pi}}},
   \gloskeyval{description}{Archimedes' Constant}
 }
\codepar
\gls{newglossaryentry}
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},
   \gloskeyval{description}{the length between two points},
   \gloskeyval{symbol}{m}
 }
\codepar
\cbeg{document}
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} (\gls{glsentrydesc}\marg{distance}) is measured in
\gls{glssymbol}\marg{distance}.
\cend{document}
\end{codebox}
(This is a trivial example. For a real document I recommend you use
\sty{siunitx} for units.)
\begin{resultbox}
\createexample*[title={Simple document with no glossary},
 label={ex:simplenogloss},
 description={Example document that defines some glossary entries
and references them in the text.}]
{%
\cmd{usepackage}[^^J
  \opteqvalref{sort}{none} \comment{no sorting or indexing required}
]
\marg{glossaries}
\codepar
\gls{newglossaryentry}^^J%
\marg{cafe}\comment{label}
\marg{\comment{definition:}
  \gloskeyval{name}{caf\'e},^^J
  \gloskeyval{description}{small restaurant selling refreshments}^^J%
}
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}^^J%
\marg{html}\comment{label}
\marg{HTML}\comment{short form}
\marg{hypertext markup language}\comment{long form}
\codepar
\gls{newglossaryentry}^^J%
\marg{pi}\comment{label}
\marg{\comment{definition:}
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{pi}}},^^J
  \gloskeyval{description}{Archimedes' Constant}^^J%
}
\codepar
\comment{This is a trivial example. For a real document I recommend 
you use siunitx for units}
\gls{newglossaryentry}^^J
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},^^J
   \gloskeyval{description}{the length between two points},^^J
   \gloskeyval{symbol}{m}^^J
 }
}
{%
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} (\gls{glsentrydesc}\marg{distance}) is measured in
\gls{glssymbol}\marg{distance}.
}
\end{resultbox}

\glsxtrnote
The \sty{glossaries-extra} package, which is distributed as a
separate bundle, extends the capabilities of the \sty{glossaries}
package. The simplest document with a \idx{glossary} can be created
with \sty{glossaries-extra} (which internally loads the
\sty{glossaries} package). \mExampleref{ex:simpleunsrt} demonstrates this:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[
 \optval{sort}{none},\comment{no sorting or indexing required}
 \opt{abbreviations},\comment{create list of \idxpl{abbreviation}}
 \opt{symbols},\comment{create list of symbols}
 \opt{postdot}, \comment{append a full stop after the descriptions}
 \opt{stylemods},\optval{style}{index} \comment{set the default glossary style}
]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry} \combase
 \marg{cafe}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{caf\'e},
   \gloskeyval{description}{small restaurant selling refreshments}
 }
\codepar
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}\comxr
\codepar
\gls{newabbreviation} \comxr
 \marg{html}\comment{label}
 \marg{HTML}\comment{short form}
 \marg{hypertext markup language}\comment{long form}
\codepar
\comxropt{symbols}
\gls{glsxtrnewsymbol} 
 \oarg{\gloskeyval{description}{Archimedes' constant}}\comment{options}
 \marg{pi}\comment{label}
 \marg{\gls{ensuremath}\marg{\cmd{pi}}}\comment{symbol}
\codepar
\gls{newglossaryentry} \combase
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},
   \gloskeyval{description}{the length between two points},
   \gloskeyval{symbol}{m}
 }
\codepar
\cbeg{document}
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} is measured in \gls{glssymbol}\marg{distance}.
\gls{printunsrtglossaries} \comment{list all defined entries}
\cend{document}
\end{codebox}

\begin{resultbox}
\createexample*[title={Simple document with unsorted glossaries},
 label={ex:simpleunsrt},
 description={Example document that defines some glossary entries,
references them in the text, and displays three simple unsorted glossaries.}]
{%
\cmd{usepackage}[
 \optval{sort}{none},\comment{no sorting or indexing required}
 \opt{abbreviations},\comment{create list of abbreviations}
 \opt{symbols},\comment{create list of symbols}
 \opt{postdot}, \comment{append a full stop after the descriptions}
 \opt{stylemods},\optval{style}{index} \comment{set the default glossary style}
]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry} \combase
\marg{cafe}\comment{label}
\marg{\comment{definition:}
 \gloskeyval{name}{caf\'e},^^J
 \gloskeyval{description}{small restaurant selling refreshments}^^J%
}
\codepar
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}\comxr
\gls{newabbreviation} \comxr
 \marg{html}\comment{label}
 \marg{HTML}\comment{short form}
 \marg{hypertext markup language}\comment{long form}
\comxropt{symbols}
\gls{glsxtrnewsymbol} 
 \oarg{\gloskeyval{description}{Archimedes' constant}}\comment{options}
 \marg{pi}\comment{label}
 \marg{\gls{ensuremath}\marg{\cmd{pi}}}\comment{symbol}
\comment{This is a trivial example. For a real document I recommend 
you use siunitx for units}
\gls{newglossaryentry} \combase
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},
   \gloskeyval{description}{the length between two points},
   \gloskeyval{symbol}{m}
 }
}
{%
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} is measured in \gls{glssymbol}\marg{distance}.^^J%
\gls{printunsrtglossaries} \comment{list all defined entries}
}
\end{resultbox}

Note the difference in the way the \idx{abbreviation} (HTML) and symbol
($\pi$) are defined in the two above examples. The
\opt{abbreviations}, \opt{postdot} and \opt{stylemods}
options are specific to \sty{glossaries-extra}. Other options are
passed to the base \sty{glossaries} package.

\begin{xtr}
In this user manual, commands and options displayed in \xtrfmt{tan}, such as
\gls{newabbreviation} and \opt{stylemods}, are only available with 
the \sty{glossaries-extra} package. There are also some commands and options (such
as \gls{makeglossaries} and \opt{symbols}) that are provided by the
base \sty{glossaries} package but are redefined by the
\sty{glossaries-extra} package. See the \sty{glossaries-extra} user
manual for further details of those commands.
\end{xtr}

One of the strengths of the \sty{glossaries} package is its flexibility, however
the drawback of this is the necessity of having a large manual
that covers 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}
There's a~common misconception that you have to have Perl installed
in order to use the \sty{glossaries} package. Perl is \emph{not}
a~requirement (as demonstrated by the above examples) but it does 
increase the available options, particularly if you use an \idx{exlatinalph} 
or a~\idx{nonlatinalph}.
\end{important}

This document uses the \sty{glossaries-extra} package with
\app{bib2gls} (\option{b2g}). For example, when viewing the
\idx{PDF} version of this document in a \idxc+{hyperlink}{hyperlinked-enabled}
\idx{PDF} viewer (such as Adobe Reader or Okular) if you click on
the word \qt{\idx{indexing}} you'll be taken to the \idx{entry} in
the \hyperref[glossary]{main glossary} where there's a brief
description of the term. This is the way the \sty{glossaries}
mechanism works. An \idx{indexingapp} (\app{bib2gls} in this case)
is used to generate the sorted list of terms. The
\idxpl{indexingapp} are \gls{cli} tools, which means they can be run
directly from a command prompt or terminal, or can be integrated
into some text editors, or you can use a build tool such as
\app{arara} to run them.

In addition to standard \idxpl{glossary}, this document has
\qt{standalone} definitions (\option{standalone}). For example, if you click on the
command \gls{gls}, the \idx+{hyperlink} will take you to main part of the
document where the command is described. The \hyperref[index]{index} 
and \hyperref[summaries]{summaries} are also glossaries. The
technique used is too complicated to describe in this manual, but an
example can be found in \tugboat{\appfmt{bib2gls}: Standalone
entries and repeated lists (a little book of
poisons)}{2022}{43}{1}{tb133talbot-bib2gls-reorder.pdf}.

Neither of the above two examples require an \idx{indexingapp}. The
first is just using the \sty{glossaries} package for consistent
formatting, and there is no list. The second has lists but they are
unsorted (see \option{unsrt}).

The remainder of this introductory section covers the following:
\begin{itemize}
\item \sectionref{sec:indexingoptions} lists the available indexing
options.

\item \sectionref{sec:lipsum} lists the files provided that contain dummy
glossary entries which may be used for testing.

\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 an
\gls{indexingapp} to create the sorted glossaries for your document
(\optionsor{mkidx,xdy}).

\end{itemize}

In addition to the examples provided in this document, there are
some sample documents provided with the \sty{glossaries} package.
They are described in \sectionref{sec:samples}.

The \sty{glossaries} package comes with a number of sample
documents that illustrate the various functions. These are listed in
\sectionref{sec:samples}.

\section{Rollback}
\label{sec:rollback}

The following rollback releases are available: 

\begin{itemize}
\item Version 4.52 (2022-11-03):
\begin{codebox}
\cmd{usepackage}\marg{glossaries}\oarg{=v4.52}
\end{codebox}
This is the last version that uses an internal comma-separated list
for the hyper group information in \sty{glossary-hypernav}. Version
4.53 has switched to using a sequence.

\item Version 4.49 (2021-11-01):
\begin{codebox}
\cmd{usepackage}\marg{glossaries}\oarg{=v4.49}
\end{codebox}
Note that this should also rollback \sty{mfirstuc} to version 2.07
if you have a later version installed.

\item Version 4.46 (2020-03-19):
\begin{codebox}
\cmd{usepackage}\marg{glossaries}\oarg{=v4.46}
\end{codebox}

\end{itemize}

If you rollback using \sty{latexrelease} to an earlier date, then
you will need to specify v4.46 for \sty{glossaries} as there are no
earlier rollback versions available. You may want to consider using
one of the historic \TeXLive\ Docker images instead. See, for
example, \blog{legacy-documents-and-tex-live-docker-images}{Legacy
Documents and TeX Live Docker Images}.

\section{Integrating Other Packages and Known Issues}
\label{sec:pkgintegration}

If you use \sty{hyperref} and \sty{glossaries}, you must load
\sty{hyperref} \emph{first} (although, in general, \sty{hyperref} should be
loaded after other packages).

Occasionally you may find that certain packages need to be
loaded \emph{after} packages that are required by \sty{glossaries}
but need to also be loaded before \sty{glossaries}. For
example, a package \meta{X} might need to be loaded after
\sty{amsgen} but before \sty{hyperref} (which needs to be loaded
before \sty{glossaries}). In which case, load the required package
first (for example, \sty{amsgen}), then \meta{X}, and finally load
\sty{glossaries}.
\begin{compactcodebox}
\cmd{usepackage}\marg{amsgen}\comment{load before \meta{X}}
\cmd{usepackage}\margm{X}\comment{must be loaded after \sty{amsgen}}
\cmd{usepackage}\marg{hyperref}\comment{load after \meta{X}}
\cmd{usepackage}\marg{glossaries}\comment{load after \sty{hyperref}}
\end{compactcodebox}

Some packages don't work with some \idxpl{glossarystyle}. For
example, \sty{classicthesis} doesn't work with the styles that use
the \env{description} environment, such as the \glostyle{list}
style. Since this is the default style, the \sty{glossaries} package
checks for \sty{classicthesis} and will change the default to the
\glostyle{index} style if it has been loaded.

Some packages conflict with a package that's required by
a \idx{glossarystyle} style package. For example, \sty{xtab}
conflicts with \sty{supertabular}, which is required by
\sty{glossary-super}. In this case, ensure the problematic \idx{glossarystyle}
package isn't loaded. For example, use the \opt{nosuper} option and
(with \sty{glossaries-extra}) don't use \optval{stylemods}{super} or
\optval{stylemods}{all}. The \sty{glossaries} package now (v4.50+)
checks for \sty{xtab} and will automatically implement \opt{nosuper}
if it has been loaded.

The language-support is implemented using \sty{tracklang}. This
needs to know the document languages that have to be supported. It
currently (version 1.6 at the time of writing) can't detect the use
of \gls{babelprovide}. The \sty{tracklang} package is able to pick
up known language labels from the document class options, for
example:
\begin{codebox}
\cmd{documentclass}[german]\marg{article}
\cmd{usepackage}[\optval{translate}{true}]\marg{glossaries}
\end{codebox}
The above doesn't load \sty{babel} or \sty{polyglossia} or
\sty{translator}, but the \optval{translate}{true} setting will
ensure that \sty{tracklang} is loaded and the language-sensitive
command provided by \sty{glossaries} will use the definitions in
\file{glossaries-german.ldf} (which needs to be installed
separately, see \sectionref{sec:languages}) because \sty{tracklang}
can pick up the \optfmt{german} document class option.

The \sty{tracklang} package is also able to pick up languages passed
as package options to \sty{babel} or \sty{translator}, provided they
were loaded before \sty{tracklang}. For example, 
\begin{codebox}
\cmd{usepackage}[french]\marg{babel}
\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries}
\end{codebox}
The \sty{tracklang} package used to be able to detect languages
identified by \sty{polyglossia}['s] \gls{setmainlanguage} and
\gls{setotherlanguage}, but \sty{tracklang} v1.5 can't with newer
versions of \sty{polyglossia}.  You will need to upgrade to
\sty{tracklang} v1.6+ to allow this to work again.

In the event that \sty{tracklang} can't pick up the required
languages, it's also possible to identify them with the
\opt{languages} option. For example:
\begin{codebox}
\cmd{usepackage}[nil]\marg{babel}
\gls{babelprovide}\marg{french}
\cmd{usepackage}[\optval{languages}{french}]\marg{glossaries}
\end{codebox}

\section{Indexing Options}
\label{sec:indexingoptions}

\glsadd{indexing}%
The basic idea behind the \sty{glossaries} package is that you first
define your \idxpl+{entry} (terms, symbols or \idxpl{acronym}). Then you can
reference these within your document (analogous to \gls{cite} or \gls{ref}).
You can also, optionally, display a~list of the \idxpl{entry} you have
referenced in your document (the \idx+{glossary}). This last part,
displaying the \idx{glossary}, is the part that most new users find
difficult. There are three options available with the base
\sty{glossaries} package (\optionsto{noidx}{xdy}). The
\sty{glossaries-extra} extension package provides two extra options
for lists (\options{b2g,unsrt}) as well as an option for standalone
descriptions within the document body (\option{standalone}).

An overview of \optionsto{noidx}{unsrt} is given in \tableref{tab:options}.
\option{standalone} is omitted from the table as it doesn't produce a list.  For a
more detailed comparison of the various methods, see the
\galleryref{glossaries-performance.shtml}{\styfmt{glossaries}
performance page}. If, for some reason, you want to know what
\idx{indexing} option is in effect, you can test the value of:
\cmddef{glsindexingsetting}
This is initialised to:
\begin{compactcodebox}
\gls{ifglsxindy} xindy\cmd{else} makeindex\cmd{fi}
\end{compactcodebox}
If the \opteqvalref{sort}{none} or \opteqvalref{sort}{clear} options
are used, \gls{glsindexingsetting} will be redefined to \code{none}.
If \gls{makeglossaries} is used \gls{glsindexingsetting} will be
updated to either \code{makeindex} or \code{xindy} as appropriate
(that is, the conditional will no longer be part of the definition).
If \gls{makenoidxglossaries} is used then \gls{glsindexingsetting} will
be updated to \code{noidx}. This means that \gls{glsindexingsetting}
can't be fully relied on until the start of the \env{document}
environment. (If you are using \sty{glossaries-extra}
v1.49+, then this command will also be updated to take the
\opt{record} setting into account.)

\begin{important}
If you are developing a class or package that loads
\sty{glossaries}, I recommend that you don't force the user into
a particular \idx{indexing} method by adding an unconditional \gls{makeglossaries}
into your class or package code. Aside from forcing the user into a
particular indexing method, it means that they're unable to use any
commands that must come before \gls{makeglossaries} (such as
\gls{newglossary}) and they can't switch off the indexing whilst
working on a draft document. (If you are using a class or package
that has done this, pass the \opt{disablemakegloss} option to
\sty{glossaries}. For example, via the document class options.)
\end{important}

Strictly speaking, \options{unsrt,standalone} aren't actually
\idx{indexing} options as no
\idx{indexing} is performed. In the case of \option{unsrt}, all defined entries are
listed in order of definition. In the case of \option{standalone}, the entry
hypertargets and descriptions are manually inserted at appropriate
points in the document. These two options are included here for
completeness and for comparison with the actual \idx{indexing} options.

\begin{table}[htbp]
 \caption{Glossary Options: Pros and Cons}
 \label{tab:options}
 \settabcolsep{3pt}%
 \centering
 \begin{tabular}{@{}>{\raggedright\small}p{0.35\textwidth}ccccc@{}}
   \bfseries Option
   & \bfseries \optionnum{noidx} 
   & \bfseries \optionnum{mkidx} 
   & \bfseries \optionnum{xdy}
   & \bfseries \optionnum{b2g} 
   & \bfseries \optionnum{unsrt}\\
   Requires \sty{glossaries-extra}? &
   \conno & \conno & \conno & \conyes & \conyes\\
   Requires an external application? &
   \conno & \conyes & \conyes & \conyes & \conno\\
   Requires Perl? &
   \conno & \conno & \conyes & \conno & \conno\\
   Requires Java? &
   \conno & \conno & \conno & \conyes & \conno\\
   Can sort \glspl{exlatinalph}
   or \glspl{nonlatinalph}? &
   \prono\fnsym{1} & \prono & \proyes & \proyes & N/A\\
   Efficient sort algorithm? &
   \prono & \proyes & \proyes & \proyes & N/A\\
   Can use a different sort method for each glossary? &
   \proyes
   & \prono\fnsym{2}
   & \prono\fnsym{2} & \proyes & N/A\\
   Any problematic sort values? &
   \conyes & \conyes & \conyes & \conno & \conno\fnsym{3}\\
   Are entries with identical sort values treated as separate unique
   entries? &
   \proyes & \proyes & \prono\fnsym{4} & \proyes & \proyes\\
   Can automatically form \idxpl{range} in the \idxpl{locationlist}? &
   \prono & \proyes & \proyes & \proyes & \prono\\
   Can have non-standard \locations\ in the \idxpl{locationlist}? &
   \proyes & \prono
    & \proyes\fnsym{5}
    & \proyes
    & \proyes\fnsym{6}\\
   Maximum hierarchical depth (style-dependent) &
   \unlimited\fnsym{7} & 3 & \unlimited & \unlimited & \unlimited\\
   \gls{glsdisplaynumberlist} reliable? &
   \proyes & \prono & \prono & \proyes & \prono\\
   \gls{newglossaryentry} allowed in \env{document} environment?
   (Not recommended.) &
   \no & \yes & \yes & \no\fnsym{8} & \yes\fnsym{9}\\
   Requires additional write registers? &
   \conno & \conyes & \conyes & \conno & \conno\fnsym{10}\\
   Default value of \opt{sanitizesort} package option &
   \optfmt{false} & \optfmt{true} & \optfmt{true}
    & \optfmt{true}\fnsym{11}
    & \optfmt{true}\fnsym{11}
 \end{tabular}
 \par
 \tablefns
 {%
   \fnsymtext{1}{Strips standard \LaTeX\ accents
  (that is, accents generated by core \LaTeX\ commands) so,
  for example, \csfmt{AA} is treated the same as A.}
   \fnsymtext{2}{Only with the hybrid method provided with \sty{glossaries-extra}.}
   \fnsymtext{3}{Provided \opteqvalref{sort}{none} is used.}
   \fnsymtext{4}{Entries with the same sort value are merged.}
   \fnsymtext{5}{Requires some setting up.}
   \fnsymtext{6}{The locations must be set explicitly
  through the custom \gloskey{location} field provided by
  \sty{glossaries-extra}.}
   \fnsymtext{7}{Unlimited but unreliable.}
   \fnsymtext{8}{Entries are defined in \ext{bib}
  format. \gls{newglossaryentry} should not be used explicitly.}
   \fnsymtext{9}{Provided \optval{docdef}{true} or
    \optval{docdef}{restricted} but not recommended.}
   \fnsymtext{10}{Provided \optval{docdef}{false} or
   \optval{docdef}{restricted}.}
   \fnsymtext{11}{Irrelevant with \opteqvalref{sort}{none}. (The
   \optval{record}{only} option automatically switches this on.)}
 }
\end{table}

\subsection{\idxoptiondef{noidx}}\label{option1}

This option isn't generally recommended for reasons given below.
It's best used with \opteqvalref{sort}{use} (order of use) or
\opteqvalref{sort}{def} (order of definition).
\mExampleref{ex:noidx} demonstrates this method:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}
\strong{\gls{makenoidxglossaries}} \comment{use TeX to sort}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha}},\gloskeyval{description}{a variable}}
\comment{an \idx{acronym}:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printnoidxglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{documentpreamble} with \gls{loadglsentries} (\emph{after}
\gls{makenoidxglossaries}). Note that six entries have been
defined but only five are referenced (\indexed) in the document so
only those five appear in the \idx{glossary}.
\begin{resultbox}
\createexample*[arara={pdflatex,pdflatex,pdfcrop},
 label={ex:noidx},
 title={Simple document that uses \TeX\ to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
 There are three letter groups, headed A, D and P}
]
{%
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}^^J%
\gls{makenoidxglossaries} \comment{use TeX to sort}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J
  \gloskeyval{description}{a brightly coloured tropical bird}}^^J%
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J
  \gloskeyval{description}{a waterbird}}^^J%
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J
  \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J%
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J
  \gloskeyval{description}{a flightless black and white seabird}}^^J%
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J%
\comment{an acronym:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}^^J
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.^^J%
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J%
 Next use: \gls{gls}\marg{arpanet}.^^J%
 \gls{printnoidxglossary}
}
\end{resultbox}
This uses the \glostyle{indexgroup} style, which puts a heading at
the start of each \idx{lettergroup}. The \idx{lettergroup} is determined by
the first character of the sort value. For a preview of all available
styles, see \gallerypage{glossaries-styles}{Gallery: Predefined Styles}.
The number 1 after each description is the \idx{numberlist} (or
\idx{locationlist}). This is the list of \locations\ (page numbers,
in this case) where the entry was \indexed. In this example, all
entries were \indexed\ on page~1.

This option doesn't require an external \idx{indexingapp} but, with
the default alphabetic sorting, it's very slow with severe limitations.
If you want a sorted list, it doesn't work well for
\idxpl{exlatinalph} or \idxpl{nonlatinalph}.  
However, if you use the \optval{sanitizesort}{false} package option (the default for
\option{noidx}) then the \idxc{latexexlatinchar}{standard \LaTeX\
accent commands} will be ignored, so if an entry's name is set to
\code{\gls+{cs.apos}elite} then the sort value will default to \code{elite} if
\optval{sanitizesort}{false} is used and will default to
the literal string \verb|\'elite| if \optval{sanitizesort}{true} is used. 

\begin{warning}
Previously, it was also possible to strip accents from \idx{utf8} characters,
but that's not possible following updates to the \LaTeX\
kernel. The kernel updates are beneficial as they make it
possible to use \idx{utf8} characters in labels, but the trick of
stripping accents was a hack that no longer works.
\end{warning}

If you have any other kinds of commands that don't expand to \idx{ascii} characters,
such as \gls{alpha}, then you must use
\optval{sanitizesort}{true} or change the sort method
(\opteqvalref{sort}{use} or \opteqvalref{sort}{def}) in the package options
or explicitly set the \gloskey{sort} key when you define the
relevant entries, as shown in the above example which has:
\begin{codebox}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha},}\gloskeyval{description}{a variable}
}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package has a modified \opt{symbols}
package option that provides \gls{glsxtrnewsymbol}, which automatically sets the
\gloskey{sort} key to the entry label (instead of the \gloskey{name}).
\end{xtr}

This option works best with the \opteqvalref{sort}{def} or
\opteqvalref{sort}{use} setting. For any
other setting, be prepared for a long document build time,
especially if you have a lot of entries defined. \strong{This
option is intended as a last resort for alphabetical sorting.}
This option allows a mixture of sort methods. (For example, 
sorting by word order for one glossary and order of use for another.)
This option is not suitable for \hierarchical\ glossaries and does
not form \idxpl{range} in the \idxpl{locationlist}. If you really can't use an
\idx{indexingapp} consider using \option{unsrt} instead.

Summary:
 \begin{enumerate}
   \item Add 
\begin{codebox*}
\gls{makenoidxglossaries}
\end{codebox*}
   to your \idx{documentpreamble} (before you start defining your 
   entries, as described in \sectionref{sec:newglosentry}).

   \item Put
\begin{codebox*}
\gls{printnoidxglossary}
\end{codebox*}
   where you want your list of entries to appear (described in
  \sectionref{sec:printglossary}). Alternatively, to display all
   glossaries use the iterative command:
\begin{codebox*}
\gls{printnoidxglossaries}
\end{codebox*}

   \item Run \LaTeX\ twice on your document. (As you would do to
   make a~table of contents appear.) For example, click twice on
   the \qt{typeset} or \qt{build} or \qt{\pdfLaTeX} button in your editor.
 \end{enumerate}

\subsection{\idxoptiondef{mkidx}}\label{option2}

\glsadd{app.makeindex}\mExampleref{ex:mkidx} demonstrates a simple
document that requires \app{makeindex}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}
\strong{\gls{makeglossaries}} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha}},\gloskeyval{description}{a variable}}
\comment{an \idx{acronym}:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{documentpreamble} with \gls{loadglsentries} (\emph{after}
\gls{makeglossaries}). The result is the same as for
\exampleref{ex:noidx}.
\begin{resultbox}
\createexample*[arara={pdflatex,makeglossaries,pdflatex,pdfcrop},
 label={ex:mkidx},
 title={Simple document that uses \appfmt{makeindex} to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
 There are three letter groups, headed A, D and P}
]
{%
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}^^J%
\gls{makeglossaries} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J
  \gloskeyval{description}{a brightly coloured tropical bird}}^^J%
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J
  \gloskeyval{description}{a waterbird}}^^J%
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J
  \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J%
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J
  \gloskeyval{description}{a flightless black and white seabird}}^^J%
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J%
\comment{an acronym:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}^^J
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.^^J%
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J%
  Next use: \gls{gls}\marg{arpanet}.^^J%
 \gls{printglossary}
}
\end{resultbox}

This option uses a~\idx{cli} application called \app{makeindex} to sort 
the entries. This application comes with all modern \TeX\ distributions, 
but it's hard-coded for the non-extended \idx{latinalph}. It can't
correctly sort accent commands (such as \gls{cs.apos} or \gls{c}) and fails
with \idx{utf8} characters, especially for any sort values that start
with a \idx{utf8} character (as it separates the octets resulting in an
invalid file \idx{encoding}). This process involves making \LaTeX\ write
the \idx{glossary} information to a temporary file which \app{makeindex}
reads.  Then \app{makeindex} writes a~new file containing the code
to typeset the \idx{glossary}. Then \gls{printglossary} reads this file in
on the next run.

\begin{information}
There are other applications that can read \app{makeindex} files,
such as \app{texindy} and \app{xindex}, but the \sty{glossaries}
package uses a customized \ext+{ist} style file (created by
\gls{makeglossaries}) that adjusts the special characters and input
keyword and also ensures that the resulting file (which is input by
\gls{printglossary}) adheres to the \idx{glossary} style.
If you want to use an alternative, you will need to ensure that it
can honour the settings in the \ext{ist} file.
\end{information}

This option works best if you want to sort entries according to the
English alphabet and you don't want to install Perl or Java. This
method can also work with the restricted \idx{shellescape} since
\app{makeindex} is considered a trusted application, which means you should
be able to use the \opteqvalref{automake}{immediate} or
\opteqvalref{automake}{true} package option provided the
\idx{shellescape} hasn't been completely disabled.

This method can form \idxpl{range} in the \idx{numberlist} but only
accepts limited number formats: \gls{arabic}, \gls{roman},
\gls{Roman}, \gls{alph} and \gls{Alph}. 

This option does not allow a mixture of sort methods. 
All \idxpl{glossary} must be sorted according to the same method: 
word\slash letter ordering or order of use or order of definition.
If you need word ordering for one \idx{glossary} and letter ordering
for another you'll have to explicitly call \app{makeindex} for 
each \idx{glossary} type.

\begin{xtr}
The \sty{glossaries-extra} package allows a hybrid mix of
\options{noidx,mkidx} to provide word\slash letter ordering with
\option{mkidx} and order of use\slash definition with
\option{noidx}.  See the \sty{glossaries-extra} documentation for
further details. See also the \sty{glossaries-extra} alternative to
\samplefile{Sort} in \sectionref{sec:samplessort}.
\end{xtr}

Summary:
   \begin{enumerate}
    \item If you want to use \app{makeindex}['s] \mkidxopt{g} option
    you must change the quote character using \gls{GlsSetQuote}. For example:
\begin{codebox}
\gls{GlsSetQuote}\marg{+}
\end{codebox}
    This must be used before \gls{makeglossaries}.
    Note that if you are using \sty{babel}, the shorthands aren't
    enabled until the start of the document, so you won't be able to use
    the shorthands in definitions that occur in the \idx+{documentpreamble}.

    \item Add 
\begin{codebox*}
\gls{makeglossaries}
\end{codebox*}
to your \idx{documentpreamble} (before you start
    defining your entries, as described in
    \sectionref{sec:newglosentry}).

    \item Put
\begin{codebox*}
\gls{printglossary}
\end{codebox*}
    where you want your list of entries to appear (described in
    \sectionref{sec:printglossary}). Alternatively, to display all
    glossaries use the iterative command:
\begin{codebox*}
\gls{printglossaries}
\end{codebox*}

    \item Run \LaTeX\ on your document. This creates files with the
    extensions \ext+{glo} and \ext+{ist} (for example, if your 
    \LaTeX\ document is called \filefmt{myDoc.tex}, then you'll have 
    two extra files called \filefmt{myDoc.glo} and \filefmt{myDoc.ist}).
    If you look at your document at this point, you won't see the 
    glossary as it hasn't been created yet. (If you use
    \sty{glossaries-extra} you'll see the section heading and some 
    boilerplate text.)

    If you have used package options such as \opt{symbols} there
    will also be other sets of files corresponding to the extra
    glossaries that were created by those options.

    \item\plabel{makeindex.run} Run \app{makeindex} with the \ext{glo} file as the
    input file and the \ext{ist} file as the style so that
    it creates an output file with the extension \ext+{gls}:
\begin{terminal}
makeindex \mkidxopt{s} myDoc.ist \mkidxopt{o} myDoc.gls myDoc.glo
\end{terminal}
   (Replace \code{myDoc} with the base name of your \LaTeX\
    document file. Avoid spaces in the file name if possible.)

\begin{important}
The file extensions vary according to the \idx{glossary} \gloskey{type}.
See \sectionref{sec:makeindexapp} for further details.
\app{makeindex} must be called for each set of files.
\end{important}

    If you don't know how to use the command prompt, then you can probably access
    \app{makeindex} via your text editor, but each editor has a
    different method of doing this. See \dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build} for some examples.

    Alternatively, run \app{makeindex} indirectly via the
\app{makeglossaries} script:
\begin{terminal}
makeglossaries myDoc
\end{terminal}
    Note that the file extension isn't supplied in this case.
    (Replace \app{makeglossaries} with \app{makeglossaries-lite} if
    you don't have Perl installed.)
    This will pick up all the file extensions from the
    \ext{aux} file and run \app{makeindex} the appropriate number
    of times with all the necessary switches.

    The simplest approach is to use \app{arara} and add the following
    comment lines to the start of your document:
\begin{codebox}
\araraline{pdflatex}
\araraline{makeglossaries}
\araraline{pdflatex}
\end{codebox}
    (Replace \code{makeglossaries} with \code{makeglossarieslite} in the 
     second line above if you don't have Perl installed. Note that
     there's no hyphen in this case.)

    The default sort is word order (\qt{sea lion} comes before \qt{seal}). 
    If you want letter ordering you need to add the \mkidxopt{l}
    switch:
\begin{terminal}
makeindex \mkidxopt{l} \mkidxopt{s} myDoc.ist -o myDoc.gls myDoc.glo
\end{terminal}
    (See \sectionref{sec:makeindexapp} for further details on using 
    \app{makeindex} explicitly.) If you use \app{makeglossaries}
    or \app{makeglossaries-lite} then use the \optval{order}{letter}
    package option and the \mkidxopt{l} option will be added
    automatically.

    \item\plabel{makeindex.relatex} Once you have successfully completed the previous step,
    you can now run \LaTeX\ on your document again.
   \end{enumerate}
You'll need to repeat the last step if you have used the \opt{toc}
option (unless you're using \sty{glossaries-extra}) to ensure the
section heading is added to the table of contents.  You'll also need
to repeat steps~\ref{makeindex.run} and~\ref{makeindex.relatex} if
you have any cross-references which can't be \indexed\ until the
\idx{indexingfile} has been created.

\subsection{\idxoptiondef{xdy}}\label{option3}

\glsadd{app.xindy}\mExampleref{ex:xdy} demonstrates a simple document that
requires \app{xindy}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\strong{\opt{xindy}},\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}
\strong{\gls{makeglossaries}} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha}},\gloskeyval{description}{a variable}}
\comment{an \idx{acronym}:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{documentpreamble} with \gls{loadglsentries} (\emph{after}
\gls{makeglossaries}). The result is the same as for
\exampleref{ex:noidx} and \exampleref{ex:mkidx}.
\begin{resultbox}
\createexample*[arara={pdflatex,makeglossaries,pdflatex,pdfcrop},
 label={ex:xdy},
 title={Simple document that uses \appfmt{xindy} to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
 There are three letter groups, headed A, D and P}
]
{%
\cmd{usepackage}[xindy,style=indexgroup]\marg{glossaries}^^J%
\gls{makeglossaries} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J
  \gloskeyval{description}{a brightly coloured tropical bird}}^^J%
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J
  \gloskeyval{description}{a waterbird}}^^J%
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J
  \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J%
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J
  \gloskeyval{description}{a flightless black and white seabird}}^^J%
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J%
\comment{an acronym:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}^^J
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.^^J%
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J%
  Next use: \gls{gls}\marg{arpanet}.^^J%
 \gls{printglossary}
}
\end{resultbox}

This option uses a~\idx{cli} application called
\app{xindy} to sort the entries. This application is more flexible than 
\app{makeindex} and is able to sort \idxpl{exlatinalph} or 
\idxpl{nonlatinalph}, however it does still have some limitations.

The \app{xindy} application comes with both \TeXLive\ and
\MikTeX, but since \app{xindy} is a Perl script, you will also need
to install Perl, if you don't already have it.  In a~similar way to
\option{mkidx}, this option involves making \LaTeX\ write the
\idx{glossary} information to a~temporary file which \app{xindy} reads. Then
\app{xindy} writes a~new file containing the code to typeset the
glossary. Then \gls{printglossary} reads this file in on the next run.

This is the best option with just the base \sty{glossaries}
package if you want to sort according to a~language other than 
English or if you want non-standard \idxpl+{locationlist}, but it can 
require some setting up (see \sectionref{sec:xindy}). There are
some problems with certain sort values:
\begin{itemize}
   \item entries with the same sort value are merged by \app{xindy}
   into a single glossary line so you must make sure that each entry
   has a unique sort value;
   \item \app{xindy} forbids empty sort values;
   \item \app{xindy} automatically strips control sequences, the math-shift
   character \idx{dollar} and braces \idx{bg}\idx{eg} from the sort value,
   which is usually desired but this can cause the sort value to
   collapse to an empty string which \app{xindy} forbids.
\end{itemize}
In these problematic cases, you must set the \gloskey{sort} field
explicitly, as in the above example which has:
\begin{codebox}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha},}\gloskeyval{description}{a variable}
}
\end{codebox}
\begin{xtr}
The \sty{glossaries-extra} package has a modified \opt{symbols}
package option that provides \gls{glsxtrnewsymbol}, which automatically sets the
\gloskey{sort} key to the entry label (instead of the \gloskey{name}).
\end{xtr}

All \idxpl{glossary} must be sorted according to the same method 
(word\slash letter ordering, order of use, or order of definition).

\begin{xtr}
The \sty{glossaries-extra} package allows a hybrid mix of
\options{noidx,xdy} to provide word\slash letter ordering with
\option{xdy} and order of use\slash definition with \option{mkidx}.
See the \sty{glossaries-extra} documentation for further details.
\end{xtr}

Summary:
\begin{enumerate}
     \item Add the \opt{xindy} option to the \sty{glossaries}
package option list:
\begin{codebox}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}
     If you are using a non-Latin script you'll also need to either
     switch off the creation of the number \idx{group}:
\begin{codebox}
\cmd{usepackage}[\optvalm{xindy}{\styoptxdyval{glsnumbers}{false}}]\marg{glossaries}
\end{codebox}
      or use either \code{\gls{GlsSetXdyFirstLetterAfterDigits}\margm{letter}} (to indicate the
first \idx{lettergroup} to follow the digits) or
     \code{\gls{GlsSetXdyNumberGroupOrder}\margm{spec}} to indicate where the number
     \idx{group} should be placed (see \sectionref{sec:xindy}).

     \item Add \gls{makeglossaries} to your \idx{documentpreamble} (before you start
     defining your entries, as described in \sectionref{sec:newglosentry}).

    \item Run \LaTeX\ on your document. This creates files with the
    extensions \ext+{glo} and \ext+{xdy} (for example, if your 
    \LaTeX\ document is called \filefmt{myDoc.tex}, then you'll have 
    two extra files called \filefmt{myDoc.glo} and \filefmt{myDoc.xdy}).
    If you look at your document at this point, you won't see the 
    glossary as it hasn't been created yet. (If you're using the
    \sty{glossaries-extra} extension package, you'll see the section
    header and some boilerplate text.)

    If you have used package options such as \opt{symbols} there
    will also be other sets of files corresponding to the extra
    glossaries that were created by those options.

    \item Run \app{xindy} with the \ext{glo} file as the
    input file and the \ext{xdy} file as a~module so that
    it creates an output file with the extension \ext+{gls}. You 
    also need to set the language name and input \idx{encoding}, as follows (all on one
    line):
\begin{terminal}
xindy \xdyopt{L} english \xdyopt{C} utf8 \xdyopt{I} xindy \xdyopt{M} myDoc \xdyopt{t} myDoc.glg \xdyopt{o} myDoc.gls myDoc.glo
\end{terminal}
    (Replace \code{myDoc} with the base name of your \LaTeX\
    document file. Avoid spaces in the file name. If necessary, also replace
    \code{english} with the name of your language and \code{utf8}
    with your input \idx{encoding}, for example, 
    \code{\xdyopt{L} german \xdyopt{C} din5007-utf8}.)

\begin{important}
The file extensions vary according to the glossary \gloskey{type}.
See \sectionref{sec:xindyapp} for further details.
\app{xindy} must be called for each set of files.
\end{important}

    It's much simpler to use \app{makeglossaries} instead:
\begin{terminal}
makeglossaries myDoc
\end{terminal}
    Note that the file extension isn't supplied in this case.
    This will pick up all the file extensions from the
    \ext{aux} file and run \app{xindy} the appropriate number
    of times with all the necessary switches.

    There's no benefit in using \app{makeglossaries-lite} with \app{xindy}.
    (Remember that \app{xindy} is a Perl script so if you can use
    \app{xindy} then you can also use \app{makeglossaries}, and if
    you don't want to use \app{makeglossaries} because you don't
    want to install Perl, then you can't use \app{xindy} either.)
   
    If you don't know how to use the command prompt, then you can 
    probably access \app{xindy} or \app{makeglossaries} via your text editor,
    but each editor has a different method of doing this. See
\dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build} for some examples.

    Again, a convenient method is to use \app{arara} and add the follow comment
    lines to the start of your document:
\begin{codebox}
\araraline{pdflatex}
\araraline{makeglossaries}
\araraline{pdflatex}
\end{codebox}

    The default sort is word order (\qt{sea lion} comes before \qt{seal}). 
    If you want letter ordering you need to add the
    \optval{order}{letter} package option:
\begin{codebox}
\cmd{usepackage}[\opt{xindy},\optval{order}{letter}]\marg{glossaries}
\end{codebox}
    (and return to the previous step). This option is picked up
    by \app{makeglossaries}. If you are explicitly using \app{xindy}
    then you'll need to add \code{\xdyopt{M} ord/letorder} to the options list.
    See \sectionref{sec:xindyapp} for further details on using 
    \app{xindy} explicitly.

    \item Once you have successfully completed the previous step,
    you can now run \LaTeX\ on your document again. As with
    \app{makeindex} (\option{mkidx}), you may need to repeat the previous
    step and this step to ensure the table of contents and cross-references are resolved.

\end{enumerate}

\subsection{\idxoptiondef{b2g}}\label{option4}

\glsxtrnote
\glsadd{app.bib2gls}This option is only available with the
\sty{glossaries-extra} extension package.  This method uses
\app{bib2gls} to both fetch \idx{entry} definitions from \ext+{bib} files
and to hierarchically sort and collate.

\mExampleref{ex:b2g} demonstrates a simple document that requires \app{bib2gls}:
\begin{codebox*}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\strong{\opt{record}},\optval{style}{\glostyle{indexgroup}}]\marg{\strong{glossaries-extra}}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-long}}
\comment{data in sample-entries.bib:}
\strong{\gls{GlsXtrLoadResources}}\oarg{\resourceoptvalm{src}{sample-entries}}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printunsrtglossary}}
\cend{document}
\end{codebox*}
Note that the \idx{abbrvstyle} must be set before \gls{GlsXtrLoadResources}.
The file \filefmt{sample-entries.bib} contains:
\begin{codebox}
\atentry{entry}\marg{parrot,
 \gloskeyval{name}{parrot}, 
 \gloskeyval{description}{a brightly coloured tropical bird}
}
\atentry{entry}\marg{duck,
 \gloskeyval{name}{duck}, 
 \gloskeyval{description}{a waterbird}
}
\atentry{entry}\marg{puffin,
 \gloskeyval{name}{puffin},
 \gloskeyval{description}{a seabird with a brightly coloured bill}
}
\atentry{entry}\marg{penguin,
 \gloskeyval{name}{penguin}, 
 \gloskeyval{description}{a flightless black and white seabird}
}
\atentry{symbol}\marg{alpha,
 \gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \gloskeyval{description}{a variable}
}
\atentry{abbreviation}\marg{arpanet,
  \gloskeyval{short}{ARPANET},
  \gloskeyval{long}{Advanced Research Projects Agency Network}
}
\end{codebox}
The result is slightly different from the previous examples. Letter
groups aren't created by default with \app{bib2gls} so, even though
the \idx{glossarystyle} supports \idxpl{lettergroup}, there's no 
\idx{group} information.
\begin{resultbox}
\createexample*[arara={pdflatex,bib2gls,pdflatex,pdfcrop},
 label={ex:b2g},
 title={Simple document that uses \appfmt{bib2gls} to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
  There are no letter groups}
]
{%
\cbeg{filecontents*}\marg{sample-entries.bib}^^J%
\atentry{entry}\marg{parrot,^^J
 \gloskeyval{name}{parrot}, ^^J
 \gloskeyval{description}{a brightly coloured tropical bird}^^J%
}^^J%
\atentry{entry}\marg{duck,^^J
 \gloskeyval{name}{duck}, ^^J
 \gloskeyval{description}{a waterbird}^^J%
}^^J%
\atentry{entry}\marg{puffin,^^J
 \gloskeyval{name}{puffin},^^J
 \gloskeyval{description}{a seabird with a brightly coloured bill}^^J%
}^^J%
\atentry{entry}\marg{penguin,^^J
 \gloskeyval{name}{penguin}, ^^J
 \gloskeyval{description}{a flightless black and white seabird}^^J%
}^^J%
\atentry{symbol}\marg{alpha,^^J
 \gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J
 \gloskeyval{description}{a variable}^^J%
}^^J%
\atentry{abbreviation}\marg{arpanet,^^J
  \gloskeyval{short}{ARPANET},^^J
  \gloskeyval{long}{Advanced Research Projects Agency Network}^^J%
}^^J%
\cend{filecontents*}^^J%
\cmd{usepackage}[\opt{record},style=indexgroup]\marg{glossaries-extra}^^J%
\gls{setabbreviationstyle}\marg{short-long}^^J%
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{sample-entries}}\comment{data in sample-entries.bib}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.^^J%
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J%
  Next use: \gls{gls}\marg{arpanet}.^^J%
 \gls{printunsrtglossary}
}
\end{resultbox}

All entries must be provided in one or more \ext{bib} files.
(See the \app{bib2gls} user manual for the required format.)
In this example, the terms \qt{parrot}, \qt{duck}, \qt{puffin} and
\qt{penguin} are defined using \atentry{atentry}, the symbol alpha
($\alpha$) is defined using \atentry{symbol} and the \idx{abbreviation}
\qt{ARPANET} is defined using \atentry{abbreviation}.

\begin{important}
Note that the \gloskey{sort} key should not be used. Each entry type
(\atentry{entry}, \atentry{symbol}, \atentry{abbreviation}) has a
particular field that's used for the sort value by default
(\gloskey{name}, the label, \gloskey{short}). You will break this
mechanism if you explicitly use the \gloskey{sort} key. See
\bibglsgallery{sorting} for examples.
\end{important}

The \sty{glossaries-extra} package needs to be loaded with the
\opt{record} package option:
\begin{codebox}
\cmd{usepackage}[\opt{record}]\marg{glossaries-extra}
\end{codebox}
or (equivalently)
\begin{codebox}
\cmd{usepackage}[\optval{record}{only}]\marg{glossaries-extra}
\end{codebox}
or (with \sty{glossaries-extra} v1.37+ and \app{bib2gls} v1.8+):
\begin{codebox}
\cmd{usepackage}[\optval{record}{nameref}]\marg{glossaries-extra}
\end{codebox}
The \optval{record}{nameref} option is the best method if you are
using \sty{hyperref}.

Each resource set is loaded with \gls{GlsXtrLoadResources}.
For example:
\begin{codebox*}
\gls{GlsXtrLoadResources}
\oarg{\comment{definitions in entries1.bib and entries2.bib:}
 \resourceoptvalm{src}{entries1,entries2},
 \resourceoptvalm{sort}{de-CH-1996}\comment{sort according to this locale}
}
\end{codebox*}
The \ext{bib} files are identified as a comma-separated list in the
value of the \resourceopt{src} key. The \resourceopt{sort} option
identifies the sorting method. This may be a locale identifier for
alphabetic sorting, but there are other sort methods available, such
as character code or numeric. One resource set may cover multiple
\idxpl{glossary} or one \idx{glossary} may be split across multiple resource
sets, forming logical sub-blocks.

If you want to ensure that all entries are selected, even if
they haven't been referenced in the document, then add the option
\resourceoptval{selection}{all}. (There are also ways of filtering the
selection or you can even have a random selection by shuffling and
truncating the list. See the \app{bib2gls} user manual for further details.)

The \idx{glossary} is displayed using:
\begin{codebox*}
\gls{printunsrtglossary}
\end{codebox*}
Alternatively all glossaries can be displayed using the iterative
command:
\begin{codebox*}
\gls{printunsrtglossaries}
\end{codebox*}
The document is built using:
\begin{terminal}
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
\end{terminal}
If \idxpl{lettergroup} are required, you need the \switch{group} switch:
\begin{terminal}
bib2gls \switch{group} myDoc
\end{terminal}
or with \app{arara}:
\begin{codebox}
\araraline{bib2gls: \marg{ group: on }}
\end{codebox}
(You will also need an appropriate \idx{glossarystyle}.)

Unlike \options{mkidx,xdy}, this method doesn't create a file containing
the typeset \idx{glossary} but simply determines which entries are
needed for the document, their associated locations and (if
required) their associated \idx{lettergroup}. This option allows
a mixture of sort methods. For example, sorting by word order
for one glossary and order of use for another or even sorting
one block of the \idx{glossary} differently to another block in the
same \idx{glossary}. See \bibglsgallery{sorting}.

This method supports Unicode and uses the Common Locale Data
Repository, which provides more extensive language support than
\app{xindy}. (Except for Klingon, which is supported by
\app{xindy}, but not by the CLDR.) The locations in the
\idx{numberlist} may be in any format. If \app{bib2gls} can deduce a
numerical value it will attempt to form \idxpl{range} otherwise it will
simply list the \locations.

Summary:
\begin{enumerate}
  \item Use \sty{glossaries-extra} with the \opt{record} package
option:
\begin{codebox}
\cmd{usepackage}[\opt{record}]\marg{glossaries-extra}
\end{codebox}

  \item Use \gls{GlsXtrLoadResources} to identify the \ext{bib}
file(s) and \app{bib2gls} options. The \ext{bib} extension may be
omitted:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms.bib,abbreviations.bib},\resourceoptval{sort}{en}}
\end{codebox}

 \item Put
\begin{codebox*}
\gls{printunsrtglossary}
\end{codebox*}
where you want your list of entries to appear. Alternatively to
display all glossaries use the iterative command:
\begin{codebox*}
\gls{printunsrtglossaries}
\end{codebox*}

\item Run \LaTeX\ on your document.

\item Run \app{bib2gls} with just the document base name.

\item Run \LaTeX\ on your document.

\end{enumerate}

See \bibglsbegin\ or the \app{bib2gls} user manual for further
details of this method, and
also \dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}.

\subsection{\idxoptiondef{unsrt}}\label{option5}

\glsxtrnote
This option is only available with the extension package
\sty{glossaries-extra}. No \idx{indexingapp} is required. 

\mExampleref{ex:unsrt} demonstrates this method:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries-extra}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \gloskeyval{description}{a variable}}
\comment{an \idx{abbreviation}:}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-long}}
\gls{newabbreviation}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printunsrtglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{documentpreamble} with \gls{loadglsentries}. 
There's no \qt{activation} command (such as \gls{makeglossaries} for
\options{mkidx,xdy}). 

The result is different from the previous examples. Now all entries
are listed in the \idx{glossary}, including \qt{penguin} which
hasn't been referenced in the document, and the list is in the order
that the entries were defined. There are no \idxpl{numberlist}.
\begin{resultbox}
\createexample*[arara={pdflatex,pdfcrop},
 label={ex:unsrt},
 title={Simple document with an unsorted list of all defined entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays an unsorted list
 of the defined entries: parrot, duck, puffin, penguin, alpha and
ARPANET. There are four letter groups with a repeated letter: P, D, P, A}
]
{%
\cmd{usepackage}[style=indexgroup]\marg{glossaries-extra}^^J%
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J
  \gloskeyval{description}{a brightly coloured tropical bird}}^^J%
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J
  \gloskeyval{description}{a waterbird}}^^J%
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J
  \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J%
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J
  \gloskeyval{description}{a flightless black and white seabird}}^^J%
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J%
\comment{an abbreviation:}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-long}}^^J%
\gls{newabbreviation}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.^^J%
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J%
 Next use: \gls{gls}\marg{arpanet}.^^J%
 \comment{entries are listed in order of definition}
 \gls{printunsrtglossary}
}
\end{resultbox}
Note that the letter groups are fragmented because the list isn't in
alphabetical order, so there are two \qt{P} letter groups.

The \gls{printunsrtglossary} command simply iterates over the set
of all defined entries associated with the given \idx{glossary} and 
lists them in the order of definition. This means that child 
entries must be defined immediately after their parent entry 
if they must be kept together in the glossary. Some \idxpl{glossarystyle}
indent entries that have a parent but it's the \idx{indexingapp}
that ensures the child entries are listed immediately after the
parent. If you're opting to use this manual approach then it's your
responsibility to define the entries in the correct order.

The \sty{glossaries-extra} package requires entries to be defined in the
\idx+{documentpreamble} by default. It's possible to remove this restriction, but
bear in mind that any entries defined after \gls{printunsrtglossary}
won't be listed.

The \idx{glossary} is displayed using:
\begin{codebox*}
\gls{printunsrtglossary}
\end{codebox*}
Alternatively all glossaries can be displayed using the iterative
command:
\begin{codebox*}
\gls{printunsrtglossaries}
\end{codebox*}

This method will display \emph{all} defined entries, regardless of
whether or not they have been used in the document. Note that this
uses the same command for displaying the \idx{glossary} as
\option{b2g}. This is because \app{bib2gls} takes advantage of this
method by defining the wanted entries in the required order and
setting the locations (and \idx{lettergroup} information, if required).
See the \sty{glossaries-extra} manual for further details.

Therefore, the above example document has a glossary containing the
entries: parrot, duck, puffin, penguin, $\alpha$ and ARPANET (in
that order). Note that the \qt{penguin} entry has been included even
though it wasn't referenced in the document.

This just requires a single \LaTeX\ call:
\begin{terminal}
pdflatex myDoc
\end{terminal}
unless the glossary needs to appear in the table of contents, in which case
a second run is required:
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
\end{terminal}
(Naturally if the document also contains citations, and so on, 
then additional steps are required. Similarly for all the other
options above.)

See the \sty{glossaries-extra} documentation for further details of this method.

\subsection{\idxoptiondef{standalone}}\label{option6}

\glsxtrnote
This option is only available with the \sty{glossaries-extra}
extension package. (You can just use the base
\sty{glossaries} package for the first case, but it's less
convenient. You'd have to manually insert the entry target before
the sectioning command and use \code{\gls{glsentryname}\margm{label}} or
\code{\gls{Glsentryname}\margm{label}} to display the entry name.) Instead
of creating a list, this has standalone definitions throughout the
document. The entry name may or may not be in a section heading.

You can either define entries in the \idx{documentpreamble} (or in an
external file loaded with \gls{loadglsentries}), as with
\option{unsrt}. \mExampleref{ex:standalone} demonstrates standalone definitions:
\begin{codebox*}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\optval{sort}{none},
   \opt{nostyles}\comment{<- no glossary styles are required}
 ]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{set},
  \gloskeyval{description}{a collection of any kind of objects},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}
}
\codepar
\gls{newglossaryentry}\marg{function}\marg{\gloskeyval{name}{function},
  \gloskeyval{description}{a rule that assigns every element in the 
  domain \gls{gls}\marg{set} to an element in the range \gls{gls}\marg{set}},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{f(x)}}
}
\cmd{newcommand}*\marg{\cmd{termdef}}[1]\marg{\comment{}
  \gls{section}\marg{\gls{glsxtrglossentry}\marg{\#1} \gls{glsentrysymbol}\marg{\#1}}\comment{}
  \cbeg{quote}\cmd{em}\gls{Glsentrydesc}\marg{\#1}.\cend{quote}\comment{}
}
\cbeg{document}
\cmd{tableofcontents}
\codepar
\gls{section}\marg{Introduction}
Sample document about \gls{glspl}\marg{function} and \gls{glspl}\marg{set}.
\codepar
\cmd{termdef}\marg{set}
\codepar
More detailed information about \gls{glspl}\marg{set} with examples.
\codepar
\cmd{termdef}\marg{function}
\codepar
More detailed information about \gls{glspl}\marg{function} with examples.
\codepar
\cend{document}
\end{codebox*}
This allows the references to \idx+{hyperlink} to the standalone
definitions rather than to a \idx{glossary}.
\begin{resultbox}
\createexample*[arara={pdflatex,pdflatex,pdfcrop},
 label={ex:standalone},
 title={Simple document with standalone entries},
 description={Example document that defines entries and displays them in the
document.}
]
{%
\cmd{usepackage}[colorlinks]\marg{hyperref}^^J%
\cmd{usepackage}[\optval{sort}{none},^^J
   \opt{nostyles}\comment{<- no glossary styles are required}
 ]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{set},^^J
  \gloskeyval{description}{a collection of any kind of objects},^^J
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}^^J%
}
\codepar
\gls{newglossaryentry}\marg{function}\marg{\gloskeyval{name}{function},^^J
  \gloskeyval{description}{a rule that assigns every element in the ^^J
  domain \gls{gls}\marg{set} to an element in the range \gls{gls}\marg{set}},^^J
  \gloskeyval{symbol}{\gls{ensuremath}\marg{f(x)}}
}^^J%
\cmd{newcommand}*\marg{\cmd{termdef}}[1]\marg{\comment{}
  \gls{section}\marg{\gls{glsxtrglossentry}\marg{\#1} \gls{glsentrysymbol}\marg{\#1}}\comment{}
  \cbeg{quote}\cmd{em}\gls{Glsentrydesc}\marg{\#1}.\cend{quote}\comment{}%
}
}
{%
\cmd{tableofcontents}
\codepar
\gls{section}\marg{Introduction}^^J%
Sample document about \gls{glspl}\marg{function} and \gls{glspl}\marg{set}.
\codepar
\cmd{termdef}\marg{set}
\codepar
More detailed information about \gls{glspl}\marg{set} with examples.
\codepar
\cmd{termdef}\marg{function}
\codepar
More detailed information about \gls{glspl}\marg{function} with examples.
}
\end{resultbox}

Or you can use \app{bib2gls} if you want to manage a large 
database of terms.  For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\opt{record},
   \opt{nostyles}\comment{<- no glossary styles are required}
  ]\marg{glossaries-extra}
\codepar
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},\resourceoptval{sort}{none},\resourceoptval{save-locations}{false}}
\codepar
\cmd{newcommand}*\marg{\cmd{termdef}}[1]\marg{\comment{}
  \gls{section}\marg{\gls{glsxtrglossentry}\marg{\#1} \strong{\gls{glossentrysymbol}}\marg{\#1}}\comment{}
  \gls{glsadd}\marg{\#1}\comment{<- index this entry}
  \cbeg{quote}\cmd{em}\gls{Glsentrydesc}\marg{\#1}.\cend{quote}\comment{}
}
\cbeg{document}
\cmd{tableofcontents}
\codepar
\gls{section}\marg{Introduction}
Sample document about \gls{glspl}\marg{function} and \gls{glspl}\marg{set}.
\codepar
\cmd{termdef}\marg{set}
\codepar
More detailed information about \gls{glspl}\marg{set} with examples.
\codepar
\cmd{termdef}\marg{function}
\codepar
More detailed information about \gls{glspl}\marg{function} with examples.
\cend{document}
\end{codebox}
Where the file \filefmt{terms.bib} contains:
\begin{codebox}
\atentry{entry}\marg{set,
  \gloskeyval{name}{set},
  \gloskeyval{description}{a collection of any kind of objects},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}
}
\atentry{entry}\marg{function,
  \gloskeyval{name}{function},
  \gloskeyval{description}{a rule that assigns every element in the domain
  \gls{gls}\marg{set} to an element in the range \gls{gls}\marg{set}},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{f(x)}}
}
\end{codebox}
The advantage in this approach (with \gls{loadglsentries} or 
\app{bib2gls}) is that you can use an existing database of
entries shared across multiple documents, ensuring consistent
notation for all of them.

In both cases, there's no need to load all the \idxpl{glossarystyle}
packages, as they're not required, so I've used the
\opt{nostyles} package option to prevent them from being loaded.

In the first case, you just need to define the terms (preferably in
the \idx{documentpreamble} or in a file that's input in the
\idx{documentpreamble}). 
No external tool is required. Just run \LaTeX\ as normal. (Twice to ensure that the
table of contents is up to date.)
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
\end{terminal}

In the second case, you need the \opt{record} package
option (as in \option{b2g}) since \app{bib2gls} is needed to select the
required entries, but you don't need a sorted list:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},\strong{\resourceoptval{sort}{none}}}
\end{codebox*}
This will ensure that any entries \indexed\ in the document (through
commands like \gls{gls} or \gls{glsadd}) will be selected by 
\app{bib2gls}, but it will skip the sorting step. 
(The chances are you probably also won't need \idxpl{locationlist} either.
If so, you can add the option \resourceoptval{save-locations}{false}.)

Remember that for this second case you need to run \app{bib2gls} as
per \option{b2g}:
\begin{terminal}
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
pdflatex myDoc
\end{terminal}

For both cases (with or without \app{bib2gls}), instead of listing
all the entries using \gls{printunsrtglossary}, you use
\code{\gls{glsxtrglossentry}\margm{label}} where you want the name (and
anchor with \sty{hyperref}) to appear in the document.  This will
allow the \idx{linktext} created by commands like \gls{gls} to link
to that point in the document. The description can simply be
displayed with \code{\gls{glsentrydesc}\margm{label}} or
\code{\gls{Glsentrydesc}\marg{label}}, as in the above examples. In both
examples, I've defined a custom command \csfmt{termdef} to simplify the
code and ensure consistency.  Extra styling, such as placing the
description in a coloured frame, can be added to this custom
definition as required.

(Instead of using \gls{glsentrydesc} or \gls{Glsentrydesc}, you can use 
\code{\gls{glossentrydesc}\margm{label}}, which will obey
\idxpl{categoryattribute} such as
\catattr{glossdesc} and \catattr{glossdescfont}. See the \sty{glossaries-extra} 
manual for further details.)

The symbol (if required) can be displayed with either
\code{\gls{glsentrysymbol}\margm{label}} or
\code{\gls{glossentrysymbol}\margm{label}}.
In the first example, I've used \gls{glsentrysymbol}. In the
second I've used \gls{glossentrysymbol}. The latter is
necessary with \app{bib2gls} if the symbol needs to go in a
section title as the entries aren't defined on the first \LaTeX\ run.

In normal document text, \gls{glsentrysymbol} will silently do nothing
if the entry hasn't been defined, but when used in a section heading
it will expand to an undefined internal command when written to the
\ext{aux} file, which triggers an error. 

The \gls{glossentrysymbol} command performs an existence check,
which triggers a warning if the entry is undefined. (All entries
will be undefined before the first \app{bib2gls} call.) You need at
least \sty{glossaries-extra} v1.42 to use this command in a section
title. (\gls{glossentrysymbol} is defined by the base
\sty{glossaries} package but is redefined by
\sty{glossaries-extra}.) If \sty{hyperref} has been loaded, this
will use \gls{texorpdfstring} to allow a simple expansion for the
\idxpl{PDFbookmark} (see the \sty{glossaries-extra} user manual for
further details).

If you want to test if the \gloskey{symbol} field has been set, you
need to use \gls{ifglshassymbol} outside of the section title. For
example:
\begin{codebox}
\gls{ifglshassymbol}\marg{\#1}\comment{}
\marg{\gls{section}\marg{\gls{glsxtrglossentry}\marg{\#1} \gls{glossentrysymbol}\marg{\#1}}}
\marg{\gls{section}\marg{\gls{glsxtrglossentry}\marg{\#1}}}
\end{codebox}

In both of the above examples, the section titles start with a \idx{lowercase}
character (because the \gloskey{name} value is all \idx{lowercase} in
entry definitions). You can apply automatic \idx{casechange} with the
\catattr{glossname} \idx{categoryattribute}. For example:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossname}}\marg{firstuc}
\end{codebox}
or (for title-case)
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossname}}\marg{title}
\end{codebox}
However, this won't apply the \idx{casechange} in the table of contents
or bookmarks. Instead you can use helper commands provided by
\sty{glossaries-extra} v1.49+ but make sure you have up-to-date
versions of \sty{glossaries} and \sty{mfirstuc}.

In the second example, you can instead use \app{bib2gls} to apply a
\idx{casechange}. For example, to apply \idx{sentencecase} to the
\gloskey{name} field:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},
 \resourceoptval{sort}{none},\resourceoptval{save-locations}{false}\strong{,
 \resourceoptvalm{replicate-fields}{name=text},
 \resourceoptval{name-case-change}{firstuc}}
}
\end{codebox*}
(Or \resourceoptval{name-case-change}{title} for \idx{titlecase}.)
This copies the \gloskey{name} value to the \gloskey{text} field and
then applies a \idx{casechange} to the \gloskey{name} field (leaving the
\gloskey{text} field unchanged). The name in the section titles now
starts with a capital but the \idx{linktext} produced by commands like
\gls{gls} is still \idx{lowercase}.

In the first example (without \app{bib2gls}) you can do this
manually. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{\strong{S}et},\strong{\gloskeyval{text}{set}},
  \gloskeyval{description}{a collection of any kind of objects},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}
}
\end{codebox}
A more automated solution can be obtained with the standalone helper
commands for the \idx{PDFbookmark} and heading text (\sty{glossaries-extra} v1.49+).

Note that if you use the default \resourceoptval{save-locations}{true}
with \app{bib2gls}, it's possible to combine \options{b2g,standalone} 
to have both standalone
definitions and an index. In this case, a \idx{glossarystyle} is
required. In the example below, I've use \glostyle{bookindex}, which is provided in
the \sty{glossary-bookindex} package (bundled with
\sty{glossaries-extra}). I don't need any of the other style
packages, so I can still keep the \opt{nostyles} option and just
load \sty{glossary-bookindex}:
\begin{codebox}
\cmd{usepackage}[\optval{record}{nameref},\comment{<- using \app{bib2gls}}
 \opt{nostyles},\comment{<- don't load default style packages}
 \optval{stylemods}{bookindex},\comment{<- load glossary-bookindex.sty}
 \optval{style}{\glostyle{bookindex}}\comment{<- set the default style to 'bookindex'}
]\marg{glossaries-extra}
\end{codebox}
I also need to sort the entries, so the resource command is now:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},\comment{definitions in terms.bib}
 \resourceoptval{sort}{en-GB},\comment{sort by this locale}
 \resourceoptvalm{replicate-fields}{name=text},
 \resourceoptval{name-case-change}{firstuc}
}
\end{codebox*}
At the end of the document, I can add the \idx{glossary}:
\begin{codebox}
\gls{printunsrtglossary}\oarg{\printglossoptval{title}{Index},\printglossoptval{target}{false}}
\end{codebox}
Note that I've had to switch off the hypertargets with
\printglossoptval{target}{false} (otherwise there would be duplicate
targets). If you want \idx{lettergroup} headings you need to use the
\switch{group} switch:
\begin{terminal}
bib2gls \switch{group} myDoc
\end{terminal}
or if you are using \app{arara}:
\begin{codebox}
\araraline{bib2gls: \marg{ group: on }}
\end{codebox}

The \glostyle{bookindex} style doesn't show the
description, so only the name and location is displayed. Remember
that the name has had a \idx{casechange} so it now starts with an
initial capital. If you feel this is inappropriate for the index,
you can adjust the \glostyle{bookindex} style so that it uses
the \gloskey{text} field instead. For example:
\begin{codebox*}
\cmd{renewcommand}*\marg{\gls{glsxtrbookindexname}}[1]\marg{\comment{}
  \gls{glossentrynameother}\marg{\#1}\marg{text}}
\end{codebox*}
See the \sty{glossaries-extra} user manual for further details about
this style.

Note that on the first \LaTeX\ run none of the entries will be
defined. Once they are defined, the page numbers may shift due to
the increased amount of document text. You may therefore need to
repeat the document build to ensure the page numbers are correct.

If there are extra terms that need to be included in the index that
don't have a description, you can define them with \atentry{index}
in the \ext{bib} file.  For example:
\begin{codebox}
\atentry{index}\marg{element}
\atentry{index}\marg{member,\gloskeyval{alias}{element}}
\end{codebox}
They can be used in the document as usual:
\begin{codebox}
The objects that make up a set are the \gls{glspl}\marg{element}
or \gls{glspl}\marg{member}.
\end{codebox}
See \bibglsbegin\ or the \app{bib2gls} user manual for further
details.

\section{Dummy Entries for Testing}
\label{sec:lipsum}

\nlctdownloadlinksfalse
In addition to the sample files described in \sectionref{sec:samples}, \sty{glossaries}
also provides some files containing lorum ipsum dummy \idxpl{entry}. These
are provided for testing purposes and are on \TeX's path (in
\filefmt{tex/latex/glossaries/test-entries}) so
they can be included via \gls{input} or \gls{loadglsentries}. The
\sty{glossaries-extra} package provides \ext{bib} versions of
all these files for use with \app{bib2gls}. The files are as
follows:

\filedef{example-glossaries-brief.tex}
These entries all have brief descriptions. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{lorem}\marg{\gloskeyval{name}{lorem},\gloskeyval{description}{ipsum}}
\end{codebox}

\filedef{example-glossaries-utf8.tex}
This file is based on \file{example-glossaries-brief.tex} but random
characters have been converted to accented characters to test
\idx{utf8} support.

\filedef{example-glossaries-long.tex}
These entries all have long descriptions. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{loremipsum}\marg{\gloskeyval{name}{lorem ipsum},
\gloskeyval{description}{dolor sit amet, consectetuer adipiscing 
elit. Ut purus elit, vestibulum ut, placerat ac, 
adipiscing vitae, felis. Curabitur dictum gravida 
mauris.}}
\end{codebox}

\filedef{example-glossaries-multipar.tex}
These entries all have multi-paragraph descriptions. For example:
\begin{codebox}
\gls{longnewglossaryentry}\marg{loremi-ii}\marg{\gloskeyval{name}{lorem 1--2}}\comment{}
\marg{\comment{}
Lorem ipsum ...
\codepar
Nam dui ligula...
}
\end{codebox}

\filedef{example-glossaries-symbols.tex}
These entries all use the \gloskey{symbol} key. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{alpha},
\gloskeyval{symbol}{\gls{ensuremath}\marg{\gls{alpha}}},
\gloskeyval{description}{Quisque ullamcorper placerat ipsum.}}
\end{codebox}

\filedef{example-glossaries-symbolnames.tex}
Similar to the previous file but the \gloskey{symbol} key isn't
used. Instead the symbol is stored in the \gloskey{name} key. For
example:
\begin{codebox}
\gls{newglossaryentry}\marg{sym.alpha}\marg{\gloskeyval{sort}{alpha},
\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
\gloskeyval{description}{Quisque ullamcorper placerat ipsum.}}
\end{codebox}

\filedef{example-glossaries-user.tex}
The \toplevel\ entries have the \gloskey{symbol} key and all
\gloskey{user1}, \glsaddeach{opt.gloskey.user2,opt.gloskey.user3,opt.gloskey.user4,opt.gloskey.user5}\ldots, \gloskey{user6} keys set. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sample-a}
\marg{\gloskeyval{name}{a name},
\gloskeyval{description}{a description},
\gloskeyval{symbol}{\cmd{ensuremath}\marg{\cmd{alpha}}},
\gloskeyval{user1}{A},
\gloskeyval{user2}{1},
\gloskeyval{user3}{i},
\gloskeyval{user4}{A-i},
\gloskeyval{user5}{25.2020788573521},
\gloskeyval{user6}{1585-11-06}}
\end{codebox}
There are also some \hierlevel{1} entries, which may or may not have
the \gloskey{symbol} and user keys set. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sample-b-0}
\marg{\gloskeyval{parent}{sample-b},
\gloskeyval{name}{b/0 name},
\gloskeyval{description}{child 0 of b},
\gloskeyval{symbol}{\cmd{ensuremath}\marg{\cmd{sigma}}},
\gloskeyval{user2}{0},
\gloskeyval{user4}{a-i}}
\end{codebox} 
There are no deeper \hierarchical\ entries. Where set, the
\gloskey{user1} key is an \idx{uppercase} letter (A--Z), the
\gloskey{user2} key is an integer, the \gloskey{user3} key is a
\idx{lowercase} Roman numeral, the \gloskey{user4} key is in the
form \meta{alpha}-\meta{roman} where \meta{alpha} is either an
upper or \idx{lowercase} letter (a--z or A--Z) and \meta{roman} is
either an upper or \idx{lowercase} Roman numeral. The
\gloskey{user5} key is a random number (in the range $(-50,+50)$ 
for \toplevel\ entries and $(-1,+1)$ for child entries).
The \gloskey{user6} key is a random date between 1000-01-01 and
2099-12-31.

\filedef{example-glossaries-images.tex}
These entries use the \gloskey{user1} key to store the name of an
image file. (The images are provided by the \sty{mwe} package and
should be on \TeX's path.) One entry doesn't have an associated
image to help test for a~missing key.  The descriptions are long to
allow for tests with the text wrapping around the image. For
example:
\begin{codebox}
\gls{longnewglossaryentry}\marg{sedfeugiat}\marg{\gloskeyval{name}{sed feugiat},
\gloskeyval{user1}{example-image}}\comment{}
\marg{\comment{}
Cum sociis natoque...
\codepar
Etiam...
}
\end{codebox}

\filedef{example-glossaries-acronym.tex}
These entries are all \idxpl+{acronym}.  For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}}}\marg{lid}\marg{LID}\marg{lorem ipsum 
dolor}
\end{codebox}
\begin{xtr}
If you use the \sty{glossaries-extra} extension package, then
\gls{newacronym} is redefined to use \gls{newabbreviation}
with the \gloskey{category} key set to \cat{acronym} (rather
than the default \cat{abbreviation}). This means that you need to
set the \idx{abbrvstyle} for the \cat{acronym} category. For
example:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{acronym}\marg{\abbrstyle{long-short}}
\end{codebox}
\end{xtr}

\filedef{example-glossaries-acronym-desc.tex}
This file contains entries that are all
\idxpl{acronym} that use the \gloskey{description} key.
For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}},
  \gloskeyval{description}{fringilla a, euismod sodales,
  sollicitudin vel, wisi}}\marg{ndl}\marg{NDL}\marg{nam dui ligula}
\end{codebox}
\begin{xtr}
If you use the \sty{glossaries-extra} extension package, then
\gls{newacronym} is redefined to use \gls{newabbreviation}
with the \gloskey{category} key set to \cat{acronym} (rather
than the default \cat{abbreviation}). This means that you need to
set the \idx{abbrvstyle} for the \cat{acronym} category. For
example:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-desc}}
\end{codebox*}
\end{xtr}

\filedef{example-glossaries-acronyms-lang.tex}
These entries are all \idxpl{acronym}, where some of them have 
a~translation supplied in the \gloskey{user1} key.
For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}},\gloskeyval{user1}{love itself}}
 \marg{li}\marg{LI}\marg{lorem ipsum}
\end{codebox}
\begin{xtr}
If you use the \sty{glossaries-extra} extension package, then
\gls{newacronym} is redefined to use \gls{newabbreviation}
with the \gloskey{category} key set to \cat{acronym} (rather
than the default \cat{abbreviation}). This means that you need to
set the \idx{abbrvstyle} for the \cat{acronym} category. For
example:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-user}}
\end{codebox*}
\end{xtr}

\filedef{example-glossaries-parent.tex}
These are hierarchical entries where the child entries 
use the \gloskey{name} key.  For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sedmattis}\marg{\gloskeyval{name}{sed mattis},
\gloskeyval{description}{erat sit amet}}
\codepar
\gls{newglossaryentry}\marg{gravida}\marg{\gloskeyval{parent}{sedmattis},
  \gloskeyval{name}{gravida},\gloskeyval{description}{malesuada}}
\end{codebox}

\filedef{example-glossaries-childnoname.tex}
These are hierarchical entries where the child entries 
don't use the \gloskey{name} key.
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{scelerisque}\marg{\gloskeyval{name}{scelerisque},
  \gloskeyval{description}{at}}
\codepar
\gls{newglossaryentry}\marg{vestibulum}\marg{\gloskeyval{parent}{scelerisque},
  \gloskeyval{description}{eu, nulla}}
\end{codebox}

\filedef{example-glossaries-longchild.tex}
These entries all have long descriptions and there are some 
child entries. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{longsedmattis}\marg{\gloskeyval{name}{sed mattis},
 \gloskeyval{description}{erat sit amet dolor sit amet, consectetuer adipiscing elit. 
 Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. 
 Curabitur dictum gravida mauris.}}
\codepar
\gls{newglossaryentry}\marg{longgravida}\marg{\gloskeyval{parent}{longsedmattis},\gloskeyval{name}{gravida},
 \gloskeyval{description}{malesuada libero, nonummy eget, consectetuer id, vulputate a, 
 magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas. Mauris ut
leo.}}
\end{codebox}

\filedef{example-glossaries-childmultipar.tex}
This consists of parent entries with single paragraph descriptions and
child entries with multi-paragraph descriptions. Some entries have
the \gloskey{user1} key set to the name of an image file provided by
the \sty{mwe} package. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{hiersedmattis}\marg{\gloskeyval{name}{sed mattis},\gloskeyval{user1}{example-image},
 \gloskeyval{description}{Erat sit amet dolor sit amet, consectetuer adipiscing elit. 
 Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris. Ut pellentesque augue sed urna. Vestibulum
diam eros, fringilla et, consectetuer eu, nonummy id, sapien. Nullam
at lectus. In sagittis ultrices mauris. Curabitur malesuada erat sit
amet massa. Fusce blandit. Aliquam erat volutpat.}}
\codepar
\gls{longnewglossaryentry}\marg{hierloremi-ii}
\marg{\gloskeyval{name}{lorem 1--2},\gloskeyval{parent}{hiersedmattis}}\comment{}
\marg{\comment{}
Lorem ipsum ...
\codepar
Nam dui ligula...
}
\end{codebox}

\filedef{example-glossaries-cite.tex}
These entries use the
\gloskey{user1} key to store a citation key (or comma-separated list
of citation keys). The citations are defined in \filefmt{xampl.bib},
which should be available on all modern \TeX\ distributions.
One entry doesn't have an associated citation to help test for a~missing
key. 
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{fusce}\marg{\gloskeyval{name}{fusce},
\gloskeyval{description}{suscipit cursus sem},\gloskeyval{user1}{article-minimal}}
\end{codebox}

\filedef{example-glossaries-url.tex}
These entries use the \gloskey{user1} key to store an \idx{URL} associated
with the entry.  For example:
\begin{codebox}
\gls{newglossaryentry}\marg{aenean-url}\marg{\gloskeyval{name}{aenean},
 \gloskeyval{description}{adipiscing auctor est},
 \gloskeyval{user1}{http://uk.tug.org/}}
\end{codebox}

The sample file \mirrorsamplefile{glossary-lipsum-examples.tex} in the 
\filefmt{doc/latex/glossaries/samples} directory
uses all these files. See also \gallerytopic{glossaries}.

\glsxtrnote
The \sty{glossaries-extra} package provides the additional test file:
\filedef{example-glossaries-xr.tex}
These entries use the \gloskey{see} key provided by the base
\styfmt{glossaries} package and also the \gloskey{alias} and
\gloskey{seealso} keys that require \sty{glossaries-extra}. For
example:
\begin{codebox}
\gls{newglossaryentry}\marg{alias-lorem}\marg{\gloskeyval{name}{alias-lorem},
 \gloskeyval{description}{ipsum},\gloskeyval{alias}{lorem}}
\codepar
\gls{newglossaryentry}\marg{amet}\marg{\gloskeyval{name}{amet},\gloskeyval{description}{consectetuer},
 \gloskeyval{see}{dolor}}
\codepar
\gls{newglossaryentry}\marg{arcu}{\gloskeyval{name}{arcu},\gloskeyval{description}{libero},
 \gloskeyval{seealso}{placerat,vitae,curabitur}}
\end{codebox}
\nlctdownloadlinkstrue

\section{Multi-Lingual Support}
\label{sec:languages}

\begin{important}
The \sty{glossaries} package uses the \sty{tracklang} package
to determine the document languages. Unfortunately, because there
isn't a standard language identification framework provided with
\LaTeX, \sty{tracklang} isn't always able to detect the selected
languages either as a result of using an unknown interface or where
the interface doesn't provide a way of detecting the language.
In particular, \sty{tracklang} can't pick up languages specified
using \sty{babel}['s] \gls{babelprovide}. In the event that
\sty{tracklang} can't detect the language, use the \opt{languages}
package option.
See \sectionref{sec:pkgintegration} and also
\dickimawhref{latex/tracklang/}{Localisation
with \filefmt{tracklang.tex}} for further details.
\end{important}

As from version 1.17, the \sty{glossaries} package can be
used with \app{xindy} as well as \app{makeindex}. If you
are writing in a language that uses an \idx{exlatinalph} or
\idx{nonlatinalph} it's best to use \option{xdy} (\app{xindy}) 
or \option{b2g} (\app{bib2gls})
as \app{makeindex} (\option{mkidx}) is hard-coded for the non-extended
\idx{latinalph} and \option{noidx} can only perform limited ASCII comparisons.

This means that with \optionsor{xdy,b2g} you are not restricted to the A,
\ldots, Z letter groups.  If you want to use \app{xindy}, remember
to use the \opt{xindy} package option. For example:
\begin{codebox}
\cmd{documentclass}[french]\marg{article}
\cmd{usepackage}[utf8]\marg{inputenc}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}\marg{babel}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}
If you are using a non-Latin script, you may need the
\optval{xindynoglsnumbers} option or use
\gls{GlsSetXdyFirstLetterAfterDigits} to indicate the first 
\idx{lettergroup} that should follow the number \idx{group}.

If you want to use \app{bib2gls}, you need to use the
\opt{record} option with \sty{glossaries-extra} and supply the
definitions in \ext{bib} files. (See the \app{bib2gls} user
manual for further details.)

\begin{important}
Note that although a~\idx{nonlatinchar}, such as \'e, looks like a
plain character in your \ext{tex} file, with standard \LaTeX\ it's
actually a~macro and can therefore cause problems. (This issue
doesn't occur with \XeLaTeX\ or Lua\LaTeX\ which both natively
support \idx{utf8}.) Recent versions of the \LaTeX\ kernel have
made significant improvements in handling \idx{utf8}. To ensure you have the best
\idx{utf8} support, use at least \sty{mfirstuc} v2.08+ with
\sty{glossaries} v4.50+ (and, if required, \sty{glossaries-extra}
v1.49+).
\end{important}

With old versions of \sty{mfirstuc} (pre v2.08), if you use a~\idx{utf8}
character at the start of an \idx{entry} name, you must place it in a
group, or it will cause a problem for \idx{sentencecase} commands
(e.g.\ \gls{Gls}). For example:
\begin{codebox}
\comment{\sty{mfirstuc} v2.07:}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\marg{\'e}lite},
\gloskeyval{description}{select group or class}}
\end{codebox}
This isn't necessary with \sty{glossaries} v4.50+ and \sty{mfirstuc}
v2.08+.
\begin{codebox}
\comment{\sty{mfirstuc} v2.08:}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\'elite},
\gloskeyval{description}{select group or class}}
\end{codebox}

If you are using \app{xindy} or \app{bib2gls}, the application needs
to know the \idx{encoding} of the \ext+{tex} file. This information
is added to the \ext{aux} file and can be picked up by
\app{makeglossaries} and \app{bib2gls}. If you use
\app{xindy} explicitly instead of via \gls{makeglossaries},
you may need to specify the \idx{encoding} using the \xdyopt{C} 
option. Read the \app{xindy} manual for further details of this
option.

If you have the double-quote character (\sym{dblquote}) as an
active character (for example, a \sty{babel} shorthand) and you 
want to use \app{makeindex}['s] \mkidxopt{g} option, you'll
need to change \app{makeindex}['s] quote character using:
\cmddef{GlsSetQuote}
Note that \meta{character} may not be one of \idx{questionmark}, 
\idx{pipe} or \idx{exclammark}.
For example:
\begin{codebox}
\gls{GlsSetQuote}\marg{+}
\end{codebox}
This must be done before \gls{makeglossaries} and any entry
definitions. It's only applicable for \app{makeindex}. This option
in conjunction with \optfmt{ngerman} will also cause
\app{makeglossaries} to use the \mkidxopt{g} switch when invoking
\app{makeindex}.

\begin{important}
Be careful of \sty{babel}['s] shorthands. These aren't switched
on until the start of the document, so any entries defined
in the \idx+{documentpreamble} won't be able to use those shorthands.
However, if you define the entries in the document and any
of those shorthands happen to be special characters for
\app{makeindex} or \app{xindy} (such as the double-quote)
then this will interfere with code that tries to escape
any of those characters that occur in the \gloskey{sort} key.
\end{important}

In general, it's best not to use \sty{babel}'s shorthands
in entry definitions. For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[ngerman]\marg{babel}
\cmd{usepackage}\marg{glossaries}
\codepar
\gls{GlsSetQuote}\marg{+}
\codepar
\gls{makeglossaries}
\codepar
\gls{newglossaryentry}\marg{rna}\marg{name={ribonukleins\"aure},
  \gloskeyval{sort}{ribonukleins"aure},
  \gloskeyval{description}{eine Nukleins\"aure}}
\codepar
\cbeg{document}
\gls{gls}\marg{rna}
\codepar
\gls{printglossaries}
\cend{document}
\end{codebox}

\subsection{Changing the Fixed Names}
\label{sec:fixednames}

The fixed names are produced using the commands listed in 
\tableref{tab:predefinednames}. If you aren't using a language
package such as \sty{babel} or \sty{polyglossia} that uses caption
hooks, you can just redefine these commands as appropriate. If you
are using \sty{babel} or \sty{polyglossia}, you need to use their
caption hooks to change the defaults. See \href{https://texfaq.org/FAQ-latexwords}{changing
the words babel uses} or read the \sty{babel} or \sty{polyglossia}
documentation. If you have loaded \sty{babel}, then \sty{glossaries}
will attempt to load \sty{translator}, unless you have used the
\opt{notranslate}, \optval{translate}{false} or
\optval{translate}{babel}
package options. If the \sty{translator} package is loaded, the
translations are provided by dictionary files (for example, 
\filefmt{glossaries-dictionary-English.dict}). See the
\sty{translator} package for advice on changing translations provided by
\sty{translator} dictionaries. If you can't work out how to modify
these dictionary definitions, try switching to \sty{babel}'s
interface using \optval{translate}{babel}:
\begin{codebox}
\cmd{documentclass}[english,french]\marg{article}
\cmd{usepackage}\marg{babel}
\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries}
\end{codebox}
and then use \sty{babel}'s caption hook mechanism. Note that if you
pass the language options directly to \sty{babel} rather that using
the document class options or otherwise passing the same options to
\sty{translator}, then \sty{translator} won't pick up the
language and no dictionaries will be loaded and \sty{babel}'s
caption hooks will be used instead.

\begin{table}[htbp]
\caption{Customised Text}
\label{tab:predefinednames}
\centering
\settabcolsep{3pt}
\begin{tabular}{@{}l>{\raggedright}p{0.3\linewidth}>{\raggedright}p{0.4\linewidth}@{}}
\bfseries Command Name & \bfseries Translator Key Word &
\bfseries Purpose\tabularnewline
\inlineglsdef{glossaryname} & \code{Glossary} & Title of the main
glossary.\tabularnewline
\inlineglsdef{acronymname} & \code{Acronyms} & Title of the list of acronyms
(when used with package option \opt{acronym}).\tabularnewline
\inlineglsdef{entryname} & \code{Notation (glossaries)} & 
Header for first column in the glossary (for 2, 3 or 4 column glossaries 
that support headers).\tabularnewline
\inlineglsdef{descriptionname} & \code{Description (glossaries)} &
Header for second column in the glossary (for 2, 3 or 4 column glossaries
that support headers).\tabularnewline
\inlineglsdef{symbolname} & \code{Symbol (glossaries)} & Header for symbol
column in the glossary for glossary styles that support this
option.\tabularnewline
\inlineglsdef{pagelistname} & \code{Page List (glossaries)} & 
Header for the \idx{pagelist} column in the glossary for glossaries that support 
this option.\tabularnewline
\inlineglsdef{glssymbolsgroupname} & \code{Symbols (glossaries)} & 
Header for symbols section of the glossary for glossary styles that 
support this option.\tabularnewline
\inlineglsdef{glsnumbersgroupname} & \code{Numbers (glossaries)} & Header for
numbers section of the glossary for glossary styles that support
this option.
\end{tabular}
\end{table}

As from version 4.12, multilingual support is provided by separate
language modules that need to be installed in addition to installing
the \sty{glossaries} package. You only need to install the
modules for the languages that you require. If the language module
has an unmaintained status, you can volunteer to take over the
maintenance by contacting me at
\url{http://www.dickimaw-books.com/contact.html}. The
\sty{translator} dictionary files for \sty{glossaries} are now
provided by the appropriate language module. For further details
about information specific to a given language, please see the
documentation for that language module.

Examples of use:
\begin{itemize}
\item Using \sty{babel} and \sty{translator}:
\begin{codebox}
\cmd{documentclass}[english,french]\marg{article}
\cmd{usepackage}\marg{babel}
\cmd{usepackage}\marg{glossaries}
\end{codebox}
(\sty{translator} is automatically loaded).

\item Using \sty{babel}:
\begin{codebox}
\cmd{documentclass}[english,french]\marg{article}
\cmd{usepackage}\marg{babel}
\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries}
\end{codebox}
(\sty{translator} isn't loaded). The \sty{glossaries-extra} package
has \optval{translate}{babel} as the default if \sty{babel} has been
loaded.

\item Using \sty{polyglossia}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{polyglossia}
\cmd{setmainlanguage}\marg{english}
\cmd{usepackage}\marg{glossaries}
\end{codebox}

\end{itemize}

Due to the varied nature of \idxpl{glossary}, it's likely that the
predefined translations may not be appropriate. If you are using the
\sty{babel} package and the \sty{glossaries} package option
\optval{translate}{babel}, you need to be familiar with the advice given in
\href{https://texfaq.org/FAQ-latexwords}{changing
the words babel uses}. If you are using the \sty{translator}
package, then you can provide your own dictionary with the necessary
modifications (using \csfmt{deftranslation}) and load it using
\csfmt{usedictionary}. If you simply want to change the title of a
\idx{glossary}, you can use the \printglossopt{title} key in
commands like \gls{printglossary} (but not the iterative commands
like \gls{printglossaries}).

\begin{important}
Note that the \sty{translator} dictionaries are loaded at the beginning of the
document, so it won't have any effect if you put \csfmt{deftranslation}
in the \idx+{documentpreamble}. It should be put in your personal dictionary
instead (as in the example below). See the \sty{translator}
documentation for further details.
\end{important}

Your custom dictionary doesn't have to be just a translation from
English to another language. You may prefer to have a dictionary for
a particular type of document. For example, suppose your
institution's in-house reports have to have the glossary labelled as
\qt{Nomenclature} and the \idx{locationlist} should be labelled
\qt{Location}, then you can create a file called, say,
\filefmt{myinstitute-glossaries-dictionary-English.dict}
that contains the following:
\begin{codebox}
\cmd{ProvidesDictionary}\marg{myinstitute-glossaries-dictionary}\marg{English}
\cmd{deftranslation}\marg{Glossary}\marg{Nomenclature}
\cmd{deftranslation}\marg{Page List (glossaries)}\marg{Location}
\end{codebox}
You can now load it using:
\begin{codebox}
\cmd{usedictionary}\marg{myinstitute-glossaries-dictionary}
\end{codebox}
(Make sure that \filefmt{myinstitute-glossaries-dictionary-English.dict}
can be found by \TeX.) If you want to share your custom dictionary,
you can upload it to \href{http://www.ctan.org/}{CTAN}.

If you are using \sty{babel} and don't want to use the
\sty{translator} interface, you can use the package
option \optval{translate}{babel}. For example:
\begin{codebox*}
\cmd{documentclass}[british]\marg{article}
\codepar
\cmd{usepackage}\marg{babel}
\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries}
\codepar
\cmd{addto}\captionslanguage{british}\marg{\comment{}
  \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{List of Terms}\comment{}
  \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{List of Acronyms}\comment{}
}
\end{codebox*}

Note that \app{xindy} and \app{bib2gls} provide much better
multi-lingual support than \app{makeindex}, so I~recommend that you
use \optionsor{mkidx,xdy} if you have \idx{glossary} entries that
contain \idxpl{nonlatinchar}. See \sectionref{sec:xindy} for further
details on \app{xindy}, and see the \app{bib2gls} user manual for
further details of that application.

\subsection{Creating a New Language Module}
\label{sec:newlang}

The \sty{glossaries} package now uses the \sty{tracklang} package
to determine which language modules need to be loaded. If you want
to create a new language module, you should first read the 
\sty{tracklang} documentation.

To create a new language module, you need to at least create two
files called: \file{glossaries-lang.ldf} and
\file{glossaries-dictionary-Lang.dict} where
\meta{lang} is the root language name (for example,
\code{english}) and \meta{Lang} is the language name used by
\sty{translator} (for example, \code{English}).

Here's an example of \file{glossaries-dictionary-English.dict}:
\begin{codebox}
\cmd{ProvidesDictionary}\marg{glossaries-dictionary}\marg{English}
\codepar
\cmd{providetranslation}\marg{Glossary}\marg{Glossary}
\cmd{providetranslation}\marg{Acronyms}\marg{Acronyms}
\cmd{providetranslation}\marg{Notation (glossaries)}\marg{Notation}
\cmd{providetranslation}\marg{Description (glossaries)}\marg{Description}
\cmd{providetranslation}\marg{Symbol (glossaries)}\marg{Symbol}
\cmd{providetranslation}\marg{Page List (glossaries)}\marg{Page List}
\cmd{providetranslation}\marg{Symbols (glossaries)}\marg{Symbols}
\cmd{providetranslation}\marg{Numbers (glossaries)}\marg{Numbers}
\end{codebox}
You can use this as a template for your dictionary file. Change
\code{English} to the \sty{translator} name for your language
(so that it matches the file name \file{glossaries-dictionary-Lang.dict})
and, for each \csfmt{providetranslation}, change the second argument to
the appropriate translation.

Here's an example of \file{glossaries-english.ldf}:
\begin{codebox*}
\gls{ProvidesGlossariesLang}\marg{english}
\codepar
\gls{glsifusedtranslatordict}\marg{English}
\marg{\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedLanguage}}\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedDialect}}\comment{}
}
\marg{\comment{}
  \cmd{@ifpackageloaded}\marg{polyglossia}\comment{}
  \marg{\comment{}
    \cmd{newcommand}*\marg{\cmd{glossariescaptionsenglish}}\marg{\comment{}
      \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{\cmd{textenglish}\marg{Glossary}}\comment{}
      \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{\cmd{textenglish}\marg{Acronyms}}\comment{}
      \cmd{renewcommand}*\marg{\gls{entryname}}\marg{\cmd{textenglish}\marg{Notation}}\comment{}
      \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{\cmd{textenglish}\marg{Description}}\comment{}
      \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{\cmd{textenglish}\marg{Symbol}}\comment{}
      \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{\cmd{textenglish}\marg{Page List}}\comment{}
      \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{\cmd{textenglish}\marg{Symbols}}\comment{}
      \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{\cmd{textenglish}\marg{Numbers}}\comment{}
    }\comment{}
  }\comment{}
  \marg{\comment{}
    \cmd{newcommand}*\marg{\cmd{glossariescaptionsenglish}}\marg{\comment{}
      \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{Glossary}\comment{}
      \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{Acronyms}\comment{}
      \cmd{renewcommand}*\marg{\gls{entryname}}\marg{Notation}\comment{}
      \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{Description}\comment{}
      \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{Symbol}\comment{}
      \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{Page List}\comment{}
      \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{Symbols}\comment{}
      \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{Numbers}\comment{}
    }\comment{}
  }\comment{}
  \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedDialect}}
  \marg{\comment{}
    \cmd{csappto}\marg{captions\gls{CurrentTrackedDialect}}\comment{}
    \marg{\comment{}
      \cmd{glossariescaptionsenglish}
    }\comment{}
  }\comment{}
  \marg{\comment{}
    \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedLanguage}}
    \marg{\comment{}
      \cmd{csappto}\marg{captions\gls{CurrentTrackedLanguage}}\comment{}
      \marg{\comment{}
        \cmd{glossariescaptionsenglish}
      }\comment{}
    }\comment{}
    {\comment{}
    }\comment{}
  }\comment{}
  \cmd{glossariescaptionsenglish}
}
\cmd{renewcommand}*\marg{\gls{glspluralsuffix}}\marg{s}
\cmd{renewcommand}*\marg{\gls{glsacrpluralsuffix}}\marg{\gls{glspluralsuffix}}
\cmd{renewcommand}*\marg{\gls{glsupacrpluralsuffix}}\marg{\gls{glstextup}\marg{\gls{glspluralsuffix}}}
\end{codebox*}
This is a somewhat longer file, but again you can use it as a
template. Replace \code{English} with the \sty{translator}
language label \meta{Lang} used for the dictionary file and
replace \code{english} with the root language name \meta{lang}. Within the
definition of \csfmt{glossariescaptions}\meta{lang}, replace the
English text (such as \qt{Glossaries}) with the appropriate
translation.

\plabel[plural suffix]{pluralsuffix}%
The suffixes used to generate the plural forms when the plural
hasn't been specified are given by \gls{glspluralsuffix} (for
general entries). For \idxpl{acronym} defined with the base
\gls{newacronym}, \gls{glsupacrpluralsuffix} is used for the
\idx{smallcaps} \idxpl{acronymstyle} where the suffix needs to be
set using \gls{glstextup} to counteract the effects of \gls{textsc}
and \gls{glsacrpluralsuffix} for other \idxpl{acronymstyle}.
There's no guarantee when these commands will be expanded. They may
be expanded on definition or they may be expanded on use, depending
on the \sty{glossaries} configuration.

\begin{important}
Therefore these plural suffix command definitions aren't included in
the \gls{captionslanguage} hook as that's typically not switched used
until the start of the document. \strong{This means that the suffix
in effect will be for the last loaded language that redefined these
commands.} It's best to initialise these commands to the most common
suffix required in your document and use the \gloskey{plural},
\gloskey{longplural}, \gloskey{shortplural} etc keys to override
exceptions.
\end{important}

If you want to add a regional variation, create a file called 
\file{glossaries-iso-lang-iso-region.ldf}, where \meta{iso-lang} is the ISO language
code and \meta{iso-region} is the ISO country code. For example,
\filefmt{glossaries-en-GB.ldf}. This file can load the root
language file and make the appropriate changes, for example:
\begin{codebox*}
 \gls{ProvidesGlossariesLang}\marg{en-GB}
 \gls{RequireGlossariesLang}\marg{english}
 \gls{glsifusedtranslatordict}\marg{British}
 \marg{\comment{}
   \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedLanguage}}\comment{}
   \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedDialect}}\comment{}
 }
 \marg{\comment{}
   \cmd{@ifpackageloaded}\marg{polyglossia}\comment{}
   \marg{\comment{}
     \comment{Modify \cmd{glossariescaptionsenglish} as appropriate for}
     \comment{polyglossia}
   }\comment{}
   \marg{\comment{}
     \comment{Modify \cmd{glossariescaptionsenglish} as appropriate for}
     \comment{non-polyglossia}
   }\comment{}
 }
\end{codebox*}

If the translations includes \idxpl{nonlatinchar}, it's a good idea to
provide code that's independent of the input \idx{encoding}. Remember that
while some users may use \idx{utf8} (and it's now the default
\idx{encoding} with modern \LaTeX\ kernels), others may use Latin-1 or any other
supported \idx{encoding}, but while users won't appreciate you enforcing
your preference on them, it's useful to provide a \idx{utf8} version.

The \file{glossaries-irish.ldf} file provides this as follows:
\begin{codebox*}
\gls{ProvidesGlossariesLang}\marg{irish}
\codepar
\gls{glsifusedtranslatordict}\marg{Irish}
\marg{\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedLanguage}}\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedDialect}}\comment{}
}
\marg{\comment{}
  \cmd{ifdefstring}\marg{\gls{inputencodingname}}\marg{utf8}
  \marg{\cmd{input}\marg{glossaries-irish-utf8.ldf}}\comment{}
  \marg{\comment{}
    \cmd{ifdef}{\cmd{XeTeXinputencoding}}\comment{XeTeX defaults to UTF-8}
    \marg{\cmd{input}\marg{glossaries-irish-utf8.ldf}}\comment{}
    \marg{\cmd{input}\marg{glossaries-irish-noenc.ldf}}
  }
  \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedDialect}}
  \marg{\comment{}
    \cmd{csappto}\marg{captions\gls{CurrentTrackedDialect}}\comment{}
    \marg{\comment{}
      \cmd{glossariescaptionsirish}
    }\comment{}
  }\comment{}
  \marg{\comment{}
    \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedLanguage}}
    \marg{
      \cmd{csappto}\marg{captions\gls{CurrentTrackedLanguage}}\comment{}
      \marg{\comment{}
        \cmd{glossariescaptionsirish}
      }\comment{}
    }\comment{}
    \marg{\comment{}
    }\comment{}
  }\comment{}
  \cmd{glossariescaptionsirish}
}
\end{codebox*}
(Again you can use this as a template. Replace \code{irish} with
your root language label and \code{Irish} with the
\sty{translator} dictionary label.)

There are now two extra files: \filefmt{glossaries-irish-noenc.ldf}
(no \idx{encoding} information)
and \filefmt{glossaries-irish-utf8.ldf} (\idx{utf8}).

These both define \csfmt{glossariescaptionsirish} but the \filefmt{*-noenc.ldf}
file uses \LaTeX\ accent commands:
\begin{codebox}
\cmd{@ifpackageloaded}\marg{polyglossia}\comment{}
\marg{\comment{}
  \cmd{newcommand}*\marg{\cmd{glossariescaptionsirish}}\marg{\comment{}
    \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{\cmd{textirish}\marg{Gluais}}\comment{}
    \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{\cmd{textirish}\marg{Acrainmneacha}}\comment{}
    \cmd{renewcommand}*\marg{\gls{entryname}}\marg{\cmd{textirish}\marg{Ciall}}\comment{}
    \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{\cmd{textirish}\marg{Tuairisc}}\comment{}
    \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{\cmd{textirish}\marg{Comhartha}}\comment{}
    \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{\cmd{textirish}\marg{Comhartha\gls{cs.apos}{\cmd{i}}}}\comment{}
    \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{\cmd{textirish}\marg{Leathanaigh}}\comment{}
    \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{\cmd{textirish}\marg{Uimhreacha}}\comment{}
  }\comment{}
}\comment{}
\marg{\comment{}
  \cmd{newcommand}*\marg{\cmd{glossariescaptionsirish}}\marg{\comment{}
    \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{Gluais}\comment{}
    \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{Acrainmneacha}\comment{}
    \cmd{renewcommand}*\marg{\gls{entryname}}\marg{Ciall}\comment{}
    \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{Tuairisc}\comment{}
    \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{Comhartha}\comment{}
    \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{Comhartha\gls{cs.apos}{\cmd{i}}}\comment{}
    \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{Leathanaigh}\comment{}
    \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{Uimhreacha}\comment{}
  }\comment{}
}
\end{codebox}
whereas the \filefmt{*-utf8.ldf} file replaces the accent commands with
the appropriate \idx{utf8} characters.

\section{Generating the Associated Glossary Files}
\label{sec:makeglossaries}

\begin{important}
This section is only applicable if you have chosen \optionsor{mkidx,b2g}. You can
ignore this section if you have chosen any of the other options. If you want to
alphabetically sort your entries always remember to use the
\gloskey{sort} key if the \gloskey{name} contains any \LaTeX\
commands (except if you're using \app{bib2gls}).
\end{important}

If this section seriously confuses you, and you can't work out how
to run external tools like \app{makeglossaries} or \app{makeindex},
you can try using the \opt{automake} package option, described in
\sectionref{sec:pkgopts-sort}, but you will need \TeX's
\idx{shellescape} enabled. See also
\dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}.

In order to generate a sorted \idx{glossary} with compact
\idxpl{numberlist}, it is necessary to use an external
\idx{indexingapp} as an intermediate step (unless you have chosen
\option{noidx}, which uses \TeX\ to do the sorting or \option{unsrt}, which doesn't
perform any sorting). It is this application
that creates the file containing the code required to typeset the
\idx{glossary}. \strong{If this step is omitted, the
\idxpl{glossary} will not
appear in your document.} The two \idxpl{indexingapp} 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. With the \sty{glossaries-extra} package, you
can also use \app{bib2gls} as the \idx{indexingapp}. (See
the \sty{glossaries-extra} and \app{bib2gls} user manuals for
further details.) Note that \app{xindy} and \app{bib2gls} have much
better multi-lingual support than \app{makeindex}, so \app{xindy}
or \app{bib2gls} are 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}.

\begin{important}
This is a multi-stage process, but there are methods of automating
document compilation using applications such as \app{latexmk} and
\app{arara}. With \app{arara} you can just add special comments to
your document source:
\begin{codebox}
\araraline{pdflatex}
\araraline{makeglossaries}
\araraline{pdflatex}
\end{codebox}
With \app{latexmk} you need to set up the required dependencies.
\end{important}

The \sty{glossaries} package comes with the Perl script
\app{makeglossaries} which will run \app{makeindex} or \app{xindy}
on all the \idxpl{indexingfile} using a customized style file (which is
created by \gls{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 (including
\app{xindy} and \app{latexmk}). Most Unix-like
operating systems come with a~Perl interpreter. \TeXLive\ also comes
with a~Perl interpreter. As far as I know, \MikTeX\ doesn't come with a~Perl
interpreter so if you are a~Windows \MikTeX\ user you will need to
install Perl if you want to use \app{makeglossaries} or \app{xindy}.
Further information is available at \url{http://www.perl.org/about.html}
and
\texseref{questions/158796}{MikTeX and Perl scripts (and one Python script)}.

The advantages of using \app{makeglossaries}:
\begin{itemize}
\item It automatically detects whether to use \app{makeindex} or
\app{xindy} and sets the relevant application switches.

\item One call of \app{makeglossaries} will run 
\app{makeindex}\slash\app{xindy} for each \idx{glossary} type.

\item If things go wrong, \app{makeglossaries} will scan the
messages from \app{makeindex} or \app{xindy} and attempt to diagnose
the problem in relation to the \sty{glossaries} package. This
will hopefully provide more helpful messages in some cases. If it
can't diagnose the problem, you will have to read the relevant transcript
file and see if you can work it out from the \app{makeindex} or
\app{xindy} messages.

\item If \app{makeindex} warns about \idx{multipleencap} values,
\app{makeglossaries} v2.18+ will detect this and attempt to correct the
problem. This correction is only provided by \app{makeglossaries} when
\app{makeindex} is used since \app{xindy} uses the order of the
\idxc{xindyattr}{attributes list} to determine which format should take precedence.
(see \sectionref{sec:xindyloc}.) This correction can be switched off with the \mkglsopt{e}
switch.

\item If \app{makeindex} warns about invalid or
\idxpl{emptylocation}, \app{makeglossaries} v4.50+ will detect this
and attempt to alter the location to fit \app{makeindex}['s] syntax.
This may or may not cause unexpected results in the
\idx{locationlist}, but it's useful if the \opt{nonumberlist} option
is used.

\item If \app{makeindex} has a warning that could be the result of a
command occurring within the \location, \app{makeglossaries} v4.50+
will attempt to repair it by moving the command out of the location
and into the \idx{encap}.

\end{itemize}
The first two items also apply to \app{makeglossaries-lite}.

As from version 4.16, the \sty{glossaries} package also comes
with a~Lua script called \app{makeglossaries-lite}. This is a
\emph{trimmed-down} alternative to the \app{makeglossaries} Perl
script. It doesn't have some of the options that the Perl version
has and it doesn't attempt to diagnose any problems, but since
modern \TeX\ distributions come with \LuaTeX\ (and therefore have
a~Lua interpreter) you don't need to install anything else in order
to use \app{makeglossaries-lite} so it's an alternative to
\app{makeglossaries} if you want to use \option{mkidx} (\app{makeindex}).

If things go wrong and you can't work out why your \idxpl{glossary}
aren't being generated correctly, you can use
\app{makeglossariesgui} as a diagnostic tool. Once you've
fixed the problem, you can then go back to using
\app{makeglossaries} or \app{makeglossaries-lite}.

Whilst I strongly recommended that you use the \app{makeglossaries}
Perl script or the \app{makeglossaries-lite} Lua script, it is
possible to use the \sty{glossaries} package without using those
applications. However, note that some commands and package options
have no effect if you explicitly run \app{makeindex}\slash\app{xindy}.  
These are listed in \tableref{tab:makeglossariesCmds}.

\begin{important}
If you are choosing not to use \app{makeglossaries} because you
don't want to install Perl, you will only be able to use
\app{makeindex} as \app{xindy} also requires Perl. (Other useful
Perl scripts include \appfmt{epstopdf} and \app{latexmk}, so it's
well-worth the effort to install Perl.)
\end{important}

Below, references to \app{makeglossaries} can usually be substituted
with \app{makeglossaries-lite}, except where noted otherwise.

If any of your entries use an entry that is not referenced outside
the \idx{glossary} (for example, the entry is only referenced in the
description of another entry), 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{codebox}
\gls{newglossaryentry}\marg{citrusfruit}\marg{\gloskeyval{name}{citrus fruit},
\gloskeyval{description}{fruit of any citrus tree. (See also 
\gls{gls}\marg{orange})}}
\codepar
\gls{newglossaryentry}\marg{orange}\marg{\gloskeyval{name}{orange},
\gloskeyval{description}{an orange coloured fruit.}}
\end{codebox}
and suppose you have \code{\gls{gls}\marg{citrusfruit}} in your document
but don't reference the \qt{orange} entry, then the
orange entry won't appear in your \idx{glossary} until
you first create the \idx{glossary} and then do another run
of \app{makeglossaries}, \app{makeindex} or \app{xindy}.
For example, if the document is called \filefmt{myDoc.tex}, then
you must do:
\begin{terminal}
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
\end{terminal}
(In the case of \option{b2g}, \app{bib2gls} will scan the description for
instances of commands like \gls{gls} to ensure they are selected but
an extra \app{bib2gls} call is required to ensure the \locations\ are
included, if \idxpl{locationlist} are required. See the
and \app{bib2gls} manual for further details.)

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 \idxpl{numberlist} 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 command prompt which is usually accessed via
the \menu{Start,All Programs} menu or
\menu{Start,All Programs,Accessories} menu or
\menu{Start,Windows System}.

Alternatively, your text editor may have the facility to create a
function that will call the required application. See
\dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}.

If any problems occur, remember to check the transcript files 
(e.g.\ \ext{glg} or \ext{alg}) for messages.

\begin{table}[htbp]
\caption{Commands and package options that have no effect when
using \apptext{xindy} or \apptext{makeindex} explicitly}
\label{tab:makeglossariesCmds}
\centering
\begin{tabular}{@{}lll@{}}
\bfseries Command or Package Option & 
\bfseries\app{makeindex} & 
\bfseries\app{xindy}\\
\optval{order}{letter} & use \mkidxopt{l} &
 use \code{\xdyopt{M} ord/letorder}\\
\optval{order}{word} & default & default\\
\optval{xindy}{\styoptxdyvalm{language}{lang},\styoptxdyvalm{codepage}{code}} &
N/A & use \code{\xdyopt{L} \meta{lang} \xdyopt{C} \meta{code}}\\
\code{\gls{GlsSetXdyLanguage}\margm{lang}} & N/A &
use \code{\xdyopt{L} \meta{lang}}\\
\code{\gls{GlsSetXdyCodePage}\margm{code}} & N/A &
use \code{\xdyopt{C} \meta{code}}
\end{tabular}
\par
\end{table}

\subsection{Using the \apptext{makeglossaries} Perl Script}
\label{sec:makeglossariesapp}

\appdef{makeglossaries}

The \app{makeglossaries} script picks up the relevant information
from the auxiliary (\ext+{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 \filefmt{myDoc.tex}, type the following in your
terminal:
\begin{terminal}
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
\end{terminal}
If you only want one \idx{glossary} processed (for example, if you
are working on a draft of a large document and want to concentrate on one specific
\idx{glossary}) then include the \meta{out-ext} extension supplied
to \gls{newglossary}, such as \ext{glo} for the \glostype{main}
glossary. Note that if you do specify the extension and your
document has multiple \idxpl{glossary} defined, then
\app{makeglossaries} will tell you how many \idxpl{glossary} have
been ignored unless the \mkglsopt{q} has been used.

Windows users: \TeXLive\ on Windows has its own internal Perl
interpreter and provides \filefmt{makeglossaries.exe} as a~convenient
wrapper for the \app{makeglossaries} Perl script. \MikTeX\ also
provides a~wrapper \filefmt{makeglossaries.exe} but doesn't provide
a~Perl interpreter (as far as I know), which is still required even if 
you run \MikTeX's \filefmt{makeglossaries.exe}, so with \MikTeX\ you'll need to install
Perl. There's more information about this at
\texseref{questions/158796}{MikTeX and Perl scripts (and one Python script)}. 

\begin{important}
When upgrading the \sty{glossaries} package, make sure you also
upgrade your version of \app{makeglossaries}. The current version is
4.53.
\end{important}

Some of the options are only applicable to \app{makeindex} and some
are only applicable to \app{xindy}.

\switchdef{mkgls.help}
Shows a summary of all available options.

\switchdef{mkgls.version}
Shows the version details.

\switchdef{mkgls.n}
Dry run mode. This doesn't actually run
\app{makeindex}\slash\app{xindy} but just prints the command it
would execute based on the information given in the \ext{aux} file
and the supplied options.

\switchdef{mkgls.d}
Instructs \app{makeglossaries} to change to the given directory,
which should be where the \ext+{aux}, 
\ext+{glo} etc files are located.
For example:
\begin{terminal}
pdflatex -output-directory myTmpDir myDoc
makeglossaries \mkglsopt{d} myTmpDir myDoc
\end{terminal}

\switchdef{mkgls.e}
Don't check for \idxpl{multipleencap} (only applicable with \app{makeindex}).
By default, if you are using
\app{makeindex}, \app{makeglossaries} will check the \app{makeindex}
transcript for \idx{multipleencap} warnings.  

The \idx{multipleencap} warning is where different \idx{locationencap}
values (location formats) are used on the same \location\ for the
same entry. For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{an example}}
\codepar
\cbeg{document}
\gls{gls}\marg{sample}, \gls{gls}\oarg{\glsoptval{format}{textbf}}\marg{sample}.
\gls{printglossaries}
\cend{document}
\end{codebox}
If you explicitly use \app{makeindex}, this will cause a warning and
the \idx{locationlist} will be \qt{1, \textbf{1}}. That is, the page
number will be repeated with each format. As from v2.18,
\app{makeglossaries} will check for this warning and, if found, will
attempt to correct the problem by removing duplicate locations and
retrying. If you actually want the duplicate location, you can
prevent \app{makeglossaries} from checking and correcting the
duplicates with \mkglsopt{e}.

There's no similar check for \app{xindy} as \app{xindy}
won't produce any warning and will simply discard duplicates.

\switchdef{mkgls.q}
Suppresses messages.
The \app{makeglossaries} script attempts to fork the
\app{makeindex}\slash\app{xindy} process using \code{open()} on the
piped redirection \code{2>\&1 |} and parses the processor output to
help diagnose problems.  If this method fails \app{makeglossaries}
will print an \qt{Unable to fork} warning and will retry without
redirection.  Without this redirection, the \mkglsopt{q} switch
doesn't work as well. Some operating systems don't support
redirection.

\switchdef{mkgls.Q}
Suppresses the \qt{Unable to fork} warning.

\switchdef{mkgls.k}
Don't attempt redirection.

\switchdef{mkgls.m}
The \app{makeindex} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

If you want to use an application that is capable of reading
\app{makeindex} files (including support for \app{makeindex} style
files via \mkidxopt{s}), then you can use \mkglsopt{m}
to specify the alternative application to use instead of
\app{makeindex}. Note that both \app{xindex} and \app{texindy} can
read \app{makeindex} files using the default \app{makeindex} syntax
but, as of the time of writing this, they don't support
\app{makeindex} style files.

\switchdef{mkgls.x}
The \app{xindy} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

\switchdef{mkgls.c}
Compress intermediate blanks. This will pass \mkidxopt{c} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkgls.r}
Disable implicit page \idx{range} formation. This will pass \mkidxopt{r} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkgls.p}
Set the starting page number. This will pass 
\code{\mkidxopt{p} \meta{num}} to \app{makeindex}. 
(Ignored if \app{xindy} should be called.)

The following switches may be used to override settings written to
the \ext{aux} file.

\switchdef{mkgls.l}
Use letter ordering. This will pass \mkidxopt{l} to \app{makeindex}
or \code{\xdyopt{M} ord/letorder} to \app{xindy}.

\switchdef{mkgls.L}
The language to pass to \app{xindy}. (Ignored if \app{makeindex}
should be called.)

\switchdef{mkgls.g}
Employ German word ordering. This will pass \mkidxopt{g} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkgls.s}
Set the style file. This will pass 
\code{\mkidxopt{s} \meta{filename}} to \app{makeindex}
or \code{\xdyopt{M} \meta{basename}} to \app{xindy} (where
\meta{basename} is \meta{filename} with the \ext+{xdy} extension
removed). This will generate an error if the extension is \ext{xdy}
when \app{makeindex} should be called, or if the extension isn't
\ext{xdy} when \app{xindy} should be called.

\switchdef{mkgls.o}
Sets the output file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the output filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{in-ext}
argument of \gls{newglossary}).

\switchdef{mkgls.t}
Sets the transcript file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the transcript filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{log-ext}
argument of \gls{newglossary}).

\subsection{Using the \apptext{makeglossaries-lite} Lua Script}
\label{sec:makeglossarieslua}

\appdef{makeglossaries-lite}

The Lua alternative to the \app{makeglossaries} Perl script requires
a~Lua interpreter, which should already be available if you have
a~modern \TeX\ distribution that includes \LuaTeX. Lua is 
a~light-weight, cross-platform scripting language, but because it's
light-weight it doesn't have the full-functionality of heavy-weight
scripting languages, such as Perl. The \app{makeglossaries-lite}
script is therefore limited by this and some of the options
available to the \app{makeglossaries} Perl script aren't available
here. (In particular the \mkglsopt{d} option.) Whilst it may be
possible to implement those features by requiring Lua packages, this
would defeat the purpose of providing this script for those don't
want the inconvenience of learning how to install interpreters or
their associated packages.

\begin{information}
The script is actually supplied as \filefmt{makeglossaries-lite.lua}
but \TeX\ distributions on Windows convert this to an executable
wrapper \filefmt{makeglossaries-lite.exe} and \TeXLive\ on Unix-like
systems provide a symbolic link without the extension.
\end{information}

The \app{makeglossaries-lite} script can be invoked in the same way
as \app{makeglossaries}. For example, if your document is called
\filefmt{myDoc.tex}, then do
\begin{terminal}
makeglossaries-lite myDoc
\end{terminal}
Note that the \app{arara} rule doesn't contain the hyphen:
\begin{codebox}
\araraline{makeglossarieslite}
\end{codebox}

Some of the options are only applicable to \app{makeindex} and some
are only applicable to \app{xindy}.

\switchdef{mkglslite.help}
Shows a summary of all available options.

\switchdef{mkglslite.version}
Shows the version details.

\switchdef{mkglslite.n}
Dry run mode. This doesn't actually run
\app{makeindex}\slash\app{xindy} but just prints the command it
would execute based on the information given in the \ext{aux} file
and the supplied options.

\switchdef{mkglslite.q}
Quiet mode. This suppresses some but not all messages.

\switchdef{mkglslite.m}
The \app{makeindex} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

\switchdef{mkglslite.x}
The \app{xindy} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

\switchdef{mkglslite.c}
Compress intermediate blanks. This will pass \mkidxopt{c} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkglslite.r}
Disable implicit page \idx{range} formation. This will pass \mkidxopt{r} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkglslite.p}
Set the starting page number. This will pass 
\code{\mkidxopt{p} \meta{num}} to \app{makeindex}. 
(Ignored if \app{xindy} should be called.)

The following switches may be used to override settings written to
the \ext{aux} file.

\switchdef{mkglslite.l}
Use letter ordering. This will pass \mkidxopt{l} to \app{makeindex}
or \code{\xdyopt{M} ord/letorder} to \app{xindy}.

\switchdef{mkglslite.L}
The language to pass to \app{xindy}. (Ignored if \app{makeindex}
should be called.)

\switchdef{mkglslite.g}
Employ German word ordering. This will pass \mkidxopt{g} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkglslite.s}
Set the style file.

\switchdef{mkglslite.o}
Sets the output file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the output filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{in-ext}
argument of \gls{newglossary}).

\switchdef{mkglslite.t}
Sets the transcript file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the transcript filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{log-ext}
argument of \gls{newglossary}).

\subsection{Using \apptext{xindy} explicitly (Option \glsfmttext{idx.opt.xdy})}
\label{sec:xindyapp}

\app{xindy} comes with \TeXLive. It has also been added to \MikTeX,
but if you don't have it installed, see
\texseref{questions/71167}{How to use Xindy with MikTeX}.

If you want to use \app{xindy} to process the glossary
files, you must make sure you have used the 
\opt{xindy} package option:
\begin{codebox}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}
This is required regardless of whether you use \app{xindy}
explicitly or whether it's called implicitly via applications such
as \app{makeglossaries}. This causes the glossary 
entries to be written in raw \app{xindy} format, so you need to
use \code{\xdyopt{I} xindy} \emph{not} \code{\xdyopt{I} tex}.

To run \app{xindy} type the following in your terminal 
(all on one line):
\begin{terminal}
xindy \xdyopt{L} \meta{language} \xdyopt{C} \meta{encoding} \xdyopt{I} xindy \xdyopt{M} \meta{style} \xdyopt{t} \meta{base}.glg \xdyopt{o} \meta{base}.gls \meta{base}.glo
\end{terminal}
where \meta{language} is the required language name, \meta{encoding}
is the \idx{encoding}, \meta{base} is the name of the document without the
\ext{tex} extension and \meta{style} is the name of the
\app{xindy} style file without the \ext{xdy} extension.
The default name for this style file is \meta{base}\ext{xdy}
but can be changed via \gls{setStyleFile}. 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 \filefmt{myDoc.tex} and
you are using \idx{utf8} \idx{encoding} in English, then type the
following in your terminal:
\begin{terminal}
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo
\end{terminal}

Note that this just creates the \glostype{main} \idx{glossary}. You need to do
the same for each of the other \idxpl{glossary} (including the
list of \idxpl{acronym} if you have used the \opt{acronym}
package option), substituting \ext+{glg}, \ext+{gls}
and \ext+{glo} with the relevant extensions. For example,
if you have used the \opt{acronym} package option, then 
you would need to do:
\begin{terminal}
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn
\end{terminal}
For additional \idxpl{glossary}, the extensions are those supplied
when you created the \idx{glossary} with \gls{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{terminal}
makeglossaries myDoc
\end{terminal}
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}.

\subsection{Using
\apptext{makeindex} explicitly (Option \glsfmttext{idx.opt.mkidx})}
\label{sec:makeindexapp}

If you want to use \app{makeindex} explicitly, you must
make sure that you haven't used the \opt{xindy} package
option or the \idxpl{glossaryentry} will be written in the wrong
format. To run \app{makeindex}, type the following in
your terminal:
\begin{terminal}
makeindex \mkidxopt{s} \meta{style}.ist \mkidxopt{t} \meta{base}.glg \mkidxopt{o} \meta{base}.gls \meta{base}.glo
\end{terminal}
where \meta{base} is the name of your document without the
\ext{tex} extension and \meta{style}\ext{ist} is the 
name of the \app{makeindex} style file. By default, this is
\meta{base}\ext{ist}, but may be changed via
\gls{setStyleFile}. Note that there are other options, 
such as \mkidxopt{l} (letter ordering). See the \app{makeindex}
manual for further details.

For example, if your document is called \filefmt{myDoc.tex}, then
type the following at the terminal:
\begin{terminal}
makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo
\end{terminal}
Note that this only creates the \glostype{main} \idx{glossary}. If you have
additional \idxpl{glossary} (for example, if you have used the
\opt{acronym} package option) then you must call 
\app{makeindex} for each glossary, substituting 
\ext+{glg}, \ext+{gls} and \ext+{glo} with the
relevant extensions. For example, if you have used the
\opt{acronym} package option, then you need to type the
following in your terminal:
\begin{terminal}
makeindex -s myDoc.ist -t myDoc.alg -o myDoc.acr myDoc.acn
\end{terminal}
For additional glossaries, the extensions are those supplied
when you created the glossary with \gls{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{terminal}
makeglossaries myDoc
\end{terminal}
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}.

\section{Note to Front-End and Script Developers}
\label{sec:notedev}

The information needed to determine whether to use \app{xindy},
\app{makeindex} or \app{bib2gls} is stored in the \ext+{aux}
file. This information can be gathered by a front-end, editor or
script to make the \idxpl{glossary} where appropriate. This section
describes how the information is stored in the auxiliary file.

\subsection{MakeIndex and Xindy}
\label{sec:notedev.makeindex.xindy}

The \idx{fileextension} of the \idxpl{indexingfile} used for each defined 
\idx{glossary} (not including any \idxpl{ignoredglossary}) are given by:
\cmddef{@newglossary}%{glossary-label}{log/glg}{out-ext/gls}{in-ext/glo}
where \meta{in-ext} is the extension of the
\emph{\idx{indexingapp}['s]} input file (the output file from the
\sty{glossaries} package's point of view), such as \ext+{glo},
\meta{out-ext} is the extension of the \emph{\idx{indexingapp}['s]}
output file (the input file from the \sty{glossaries} package's
point of view), such as \ext+{gls}, and \meta{log} is the extension
of the \idx{indexingapp}['s] transcript file, such as \ext+{glg}.
The label for the \idx{glossary} is also given. This isn't required
with \app{makeindex}, but with \app{xindy} it's needed to pick up
the associated language and \idx{encoding} (see below). For example, the
information for the default \glostype{main} \idx{glossary} is
written as:
\begin{codebox}
\gls{@newglossary}\marg{main}\marg{glg}\marg{gls}\marg{glo}
\end{codebox}
If \sty{glossaries-extra}['s] hybrid method has been used (with 
\gls{makeglossaries}\oargm{sub-list}), then the sub-list
of \idxpl{glossary} that need to be processed will be identified with:
\cmddef{glsxtr@makeglossaries}

The \idx{indexingapp}['s] style file is specified by:
\cmddef{@istfilename}
The file extension indicates whether to use \app{makeindex}
(\ext+{ist}) or \app{xindy} (\ext+{xdy}). Note that
the \idx{glossary} information has a different syntax depending on
which \idx{indexingapp} is supposed to be used, so it's 
important to call the correct one.

For example, with \app{arara} you can easily determine whether to
run \app{makeglossaries}:
\begin{codebox}
\araraline{makeglossaries if found("aux", "@istfilename")}
\end{codebox}
It's more complicated if you want to explicitly run \app{makeindex}
or \app{xindy}.

\begin{important}
Note that if you choose to explicitly call \app{makeindex} or
\app{xindy} then the user will miss out on the diagnostic
information and the \idx{encap}-clash fix 
that \app{makeglossaries} also provides.
\end{important}

Word or letter ordering is specified by:
\cmddef{@glsorder}
where \meta{order} can be either \code{word} or \code{letter}
(obtained from the \opt{order} package option).

If \app{xindy} should be used, the language for each \idx{glossary} is specified by:
\cmddef{@xdylanguage}
where \meta{glossary-label} identifies the \idx{glossary} and \meta{language} is
the root language (for example, \code{english}).

The \idx+{codepage} (file \idx+{encoding}) for all \idxpl{glossary} is specified by:
\cmddef{@gls@codepage}
where \meta{code} is the \idx{encoding} (for example, \code{utf8}). The above
two commands are omitted if \app{makeindex} should be used.

If \option{noidx} has been used, the \ext{aux} file will contain
\cmddef{@gls@reference}
for every time an entry has been referenced. 

\subsection{Entry Labels}
\label{sec:notedev.labels}

If you need to gather labels for \idx{auto-completion}, the
\opt{writeglslabels} package option will create a file containing
the labels of all defined \idxpl{entry} (regardless of whether or not the
\idx{entry} has been used in the document). As from v4.47, there is a
similar option \opt{writeglslabelnames} that writes both the
label and name (separated by a tab).

\begin{xtr}
The \sty{glossaries-extra}
package also provides \optval{docdef}{atom}, which will create the
\ext+{glsdefs} file but will act like \optval{docdef}{restricted}.
\end{xtr}

\subsection{Bib2Gls}
\label{sec:notedev.bib2gls}

\bibglsnote
If \option{b2g} has been used, the \ext{aux} file will contain one
or more instances of:
\cmddef{glsxtr@resource}
where \meta{basename} is the basename of the \ext+{glstex} file that
needs to be created by \app{bib2gls}. If
\resourceoptvalm{src}{\meta{bib list}} isn't present in
\meta{options} then \meta{basename} also indicates the name of the
associated \ext+{bib} file.

For example, with \app{arara} you can easily determine whether or
not to run \app{bib2gls}:
\begin{codebox}
\araraline{bib2gls if found("aux", "glsxtr@resource")}
\end{codebox}
(It gets more complicated if both \gls{glsxtr@resource} and
\gls{@istfilename} are present as that indicates the hybrid
\optval{record}{hybrid} option.)

Remember that with \app{bib2gls}, the \idxpl{glossaryentry} will never be defined
on the first \LaTeX\ call (because their definitions are contained
in the \ext{glstex} file created by \app{bib2gls}). You can
also pick up labels from the \records\ in \ext{aux} file, which
will be in the form:
\cmddef{glsxtr@record}
or (with \optval{record}{nameref}):
\cmddef{glsxtr@record@nameref}
or (with \gls{glssee}):
\cmddef{glsxtr@recordsee}\marg{label}\marg{xr list}
You can also pick up the commands defined with
\gls{glsxtrnewglslike}, which are added to the \ext{aux} file
for \app{bib2gls}['s] benefit:
\cmddef{@glsxtr@newglslike}
If \gls{GlsXtrSetAltModifier} is used, then the modifier is
identified with:
\cmddef{@glsxtr@altmodifier}
Label prefixes (for the \gls{dgls} set of commands) are identified
with:
\cmddef{@glsxtr@prefixlabellist}

\chapter{Package Options}
\label{sec:pkgopts}

This section describes the available \sty{glossaries} package
options. You may omit the \code{=true} for boolean options. (For
example, \opt{acronym} is equivalent to \optval{acronym}{true}).

\begin{xtr}
The \sty{glossaries-extra} package has additional options described
in the \sty{glossaries-extra} manual. The extension package also
has some different default settings to the base package. Those that
are available at the time of writing are included here. Future
versions of \sty{glossaries-extra} may have additional package
options or new values for existing settings that aren't listed here. 
\end{xtr}

\begin{important}
Note that \keyval\ package options can't be passed via the document
class options. (This includes options where the \meta{value} part
may be omitted, such as \opt{acronym}.) This is a general limitation
not restricted to the \sty{glossaries} package. Options that aren't
\keyval\ (such as \opt{makeindex}) may be passed via the document
class options.
\end{important}

\renewcommand{\cmddefbookmarkleveloffset}{2}

\section{General Options}
\label{sec:pkgopts-general}

\optiondef{nowarn}
This suppresses all warnings generated by
the \sty{glossaries} package. Don't use this option if you're new to using
\sty{glossaries} as the warnings are designed to help detect
common mistakes (such as forgetting to use \gls{makeglossaries}).
Note that if you use \opt{debug} with any value other than
\optfmt{false} it will override this option.

\optiondef{nolangwarn}
This suppresses the warning generated by a missing language module.

\optiondef{noredefwarn}
If you load \sty{glossaries} with
a~class or another package that already defines glossary related
commands, by default \sty{glossaries} will warn you that it's
redefining those commands. If you are aware of the consequences of
using \sty{glossaries} with that class or package and you don't
want to be warned about it, use this option to suppress those
warnings. Other warnings will still be issued unless you use the
\opt{nowarn} option described above. (This option is
automatically switched on by \sty{glossaries-extra}.)

\optiondef{debug}
Debugging mode may write information to the transcript file or 
add markers to the document.
The following values are available: 
\optionvaldef{debug}{false}
Switches off debugging mode.

\optionvaldef{debug}{true}
This will write the following line to the transcript file if any
attempt at indexing occurs before the associated files have been
opened by \gls{makeglossaries}:
\begin{compactcodebox}
wrglossary(\meta{glossary-type})(\meta{indexing info})
\end{compactcodebox}
Note that this setting will also cancel \opt{nowarn}.

\optionvaldef{debug}{showtargets}
As \opteqvalref{debug}{true} but also adds a marker where the
\idx{glossary}-related \idxpl{hyperlink} and targets occur in the document.

The \opteqvalref{debug}{showtargets} option will additionally use:
\cmddef{glsshowtarget}
to show the \idx{hypertarget} or \idx+{hyperlink} name when 
\gls{glsdohypertarget} is used by commands like \gls{glstarget}
and when \gls{glsdohyperlink} is used by commands like \gls{gls}.
In \idx{mathmode} or inner mode, this uses:
\cmddef{glsshowtargetinner}
which typesets the target name as:
\begin{compactcodebox}
\oarg{\gls{glsshowtargetfonttext}\margm{target name}}
\end{compactcodebox}
just before the link or anchor.  This uses the text-block command:
\cmddef{glsshowtargetfonttext}
which checks for math-mode before applying the font change.
In outer mode \gls{glsshowtarget} uses:
\cmddef{glsshowtargetouter}
which by default places the target name in the margin with a symbol
produced with: 
\cmddef{glsshowtargetsymbol}
which defaults to a small right facing triangle.

The font used by both \gls{glsshowtargetfonttext} and
\gls{glsshowtargetouter} is given by the declaration:
\cmddef{glsshowtargetfont}

\optionvaldef{debug}{showaccsupp}
As \opteqvalref{debug}{true} but also adds a marker where the
\idx{glossary}-related accessibility information occurs (see
\sty{glossaries-accsupp}) using:
\cmddef{glsshowaccsupp}

\begin{xtr}
The \sty{glossaries-extra} package provides extra values
\optval{debug}{showwrgloss}, that may be used to show where
the \idx{indexing} is occurring, and \optval{debug}{all}, which
switches on all debugging options. See the \sty{glossaries-extra}
manual for further details.
\end{xtr}

The purpose of the debug mode can be demonstrated with
the following example document:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\cmd{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},\gloskeyval{description}{example}}
\cmd{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},\gloskeyval{description}{example}}
\strong{\gls{glsadd}}\marg{sample2}\comment{<- does nothing here}
\strong{\gls{makeglossaries}}
\cbeg{document}
\gls{gls}\marg{sample1}.
\gls{printglossaries}
\cend{document}
\end{codebox}
In this case, only the \qt{sample1} entry has been \indexed, even
though \code{\gls{glsadd}\marg{sample2}} appears in the source code.
This is because \code{\gls{glsadd}\marg{sample2}} has been used before the
associated file is opened by \gls{makeglossaries}. Since the file
isn't open yet, the information can't be written to it, which is why
the \qt{sample2} entry doesn't appear in the \idx{glossary}.

Without \gls{makeglossaries} the \idx{indexing} is suppressed with
\options{mkidx,xdy} but, other than that, commands like \gls{gls}
behave as usual.

This situation doesn't cause any errors or warnings as it's
perfectly legitimate for a user to want to use \sty{glossaries} to
format the entries (for example, to show a different form on
\idx{firstuse}) but not display any \idxpl{glossary} (or the user
may prefer to use the unsorted \optionsor{unsrt,standalone}).  It's
also possible that the user may want to temporarily comment out
\gls{makeglossaries} in order to suppress the \idx{indexing} while
working on a draft version to speed compilation, or the user may
prefer to use \optionsor{noidx,b2g} for \idx{indexing}, which don't
use \gls{makeglossaries}.

Therefore \gls{makeglossaries} can't be used to enable
\gls{newglossaryentry} and commands like \gls{gls} and \gls{glsadd}.
These commands must be enabled by default. (It does, however, enable
the \gloskey{see} key as that's a more common problem. See below.)

The debug mode, enabled with the \opt{debug} option,
\begin{codebox}
\cmd{usepackage}[\opt{debug}]\marg{glossaries}
\end{codebox}
will write information to the log file when the \idx{indexing}
can't occur because the associated file isn't open.
The message is written in the form
\begin{transcript}
Package glossaries Info: wrglossary(\meta{type})(\meta{text}) on
input line \meta{line number}.
\end{transcript}
where \meta{type} is the glossary label and \meta{text} is the line
of text that would've been written to the associated file if
it had been open. So if any entries haven't appeared in the
glossary but you're sure you used commands like \gls{glsadd}
or \gls{glsaddall}, try switching on the \opt{debug} option
and see if any information has been written to the log file.

\optiondef{savewrites}
This is a boolean option to minimise the
number of write registers used by the \sty{glossaries} package.
The default is \optval{savewrites}{false}. With \options{mkidx,xdy}, one
write register is required per (non-ignored) \idx{glossary} and one for
the style file.

\begin{information}
In general, this package option is best avoided.
\end{information}

With all options except \options{noidx,b2g}14, another write register is
required if the \ext{glsdefs} file is needed to save document
definitions. With both \options{noidx,b2g}, no write registers are required
(document definitions aren't permitted and \idx{indexing} information is
written to the \ext{aux} file). If you really need document
definitions but you want to minimise the number of write registers
then consider using \optval{docdef}{restricted} with
\sty{glossaries-extra}.

There are only a limited number of write registers, and if you have
a large number of \idxpl{glossary} or if you are using a class or other
packages that create a lot of external files, you may exceed the
maximum number of available registers. If \opt{savewrites} is
set, the \idx{glossary} information will be stored in token registers
until the end of the document when they will be written to the
external files.

\begin{important}
This option can significantly slow document compilation and may
cause the \idx{indexing} to fail.  Page numbers in the \idx{numberlist}
will be incorrect on page boundaries due to \TeX's asynchronous
output routine.  As an alternative, you can use the \sty{scrwfile}
package (part of the KOMA-Script bundle) and not use this option.
\end{important}

By way of comparison, \filefmt{sample-multi2.tex}
provided with \app{bib2gls} has a total of 15 \idxpl{glossary}. With
\optionsor{mkidx,xdy}, this would require 46 associated files and 16
write registers. (These figures don't include standard files
and registers provided by the kernel or \sty{hyperref}, such as
\ext{aux} and \filefmt{out}.) With
\app{bib2gls}, no write registers are required and there are only 10
associated files for that particular document (9 resource files and
1 transcript file).

\begin{important}
If you want to use \TeX's \idx{shellescape} to call
\app{makeindex} or \app{xindy} from your document and use
\opt{savewrites}, then use \opteqvalref{automake}{immediate} or
\opteqvalref{automake}{makegloss} or \opteqvalref{automake}{lite}.
\end{important}

\optiondef{translate}
This can take one of the values listed below. If no supported
language package has been loaded the default is
\opteqvalref{translate}{false} otherwise the default is
\opteqvalref{translate}{true} for the base \sty{glossaries} package
and  \opteqvalref{translate}{babel} for \sty{glossaries-extra}.

\optionvaldef{translate}{true}
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 \sty{babel}['s]
\csfmt{addto}\gls{captionslanguage} mechanism. If
\sty{polyglossia} has been loaded, \sty{glossaries-polyglossia} will
be loaded.

\optionvaldef{translate}{false}
Don't provide translations, even if \sty{babel} or \sty{polyglossia}
has been loaded.  (Note that \sty{babel} provides the command
\gls{glossaryname} so that will still be translated if you have
loaded \sty{babel}.)

\optionvaldef{translate}{babel}
Don't load the \sty{translator} package. Instead load \sty{glossaries-babel}.

\begin{important}
I recommend you use \opteqvalref{translate}{babel} if you have any
problems with the translations or with \idxpl{PDFbookmark}, but to maintain backward
compatibility, if \sty{babel} has been loaded the default is
\opteqvalref{translate}{true}.
\end{important}

See \sectionref{sec:fixednames} for further details.

\optiondef{notranslate}
This is equivalent to \opteqvalref{translate}{false} and may be
passed via the document class options.

\optiondef{languages}
This automatically implements \opteqvalref{translate}{babel} (which
means that \sty{translator} won't automatically be loaded) but will
also add the list of languages to \sty{tracklang}['s] list of
tracked languages. Each element in the \meta{list} may be an ISO
language tag (such as \code{pt-BR}) or one of \sty{tracklang}['s]
known language labels (such as \code{british}).

\optiondef{hyperfirst}
If true, terms on \idx{firstuse} will have a \idx+{hyperlink}, if
supported, unless the \idx{hyperlink} is explicitly suppressed using
starred versions of commands such as \code{\gls{gls}*}.
If false, only \idx{subsequentuse} instances will have a \idx{hyperlink}
(if supported).

Note that \opt{nohypertypes} overrides \optval{hyperfirst}{true}.
This option only affects commands that check the \idx{firstuseflag}, such
as the \gls{glslike} commands (for example, \gls{gls} or
\gls{glsdisp}), but not the \gls{glstextlike} commands
(for example, \gls{glslink} or \gls{glstext}). 

The \opt{hyperfirst} setting applies to
all \idx{glossary} types (unless identified by \opt{nohypertypes} or
defined with \gls{newignoredglossary}). It can be overridden on an
individual basis by explicitly setting the \glsopt{hyper} key
when referencing an entry (or by using the plus or starred
version of the referencing command).

It may be that you only want to suppress \idxpl{hyperlink} for just the \idxpl{acronym}
(where the \idx{firstuse} explains the meaning of the \idx{acronym}) but not
for ordinary \idxpl{glossaryentry} (where the \idx{firstuse} is identical to
\idx{subsequentuse}). In this case, you can use \optval{hyperfirst}{false} and
apply \gls{glsunsetall} to all the regular (non-\idx{acronym})
\idxpl{glossary}.
For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optval{hyperfirst}{false}]\marg{glossaries}
\comment{\idx{acronym} and \idx{glossaryentry} definitions}
\codepar
\comment{at the end of the preamble}
\gls{glsunsetall}\oarg{\glostype{main}}
\end{codebox}

Alternatively you can redefine the hook
\cmddef{glslinkcheckfirsthyperhook}
which is used by the commands that check the \idx{firstuseflag}, such
as \gls{gls}. Within the definition of this command, you can use
\gls{glslabel} to reference the \idx{entry} label and \gls{glstype} to
reference the \idx{glossary} type. You can also use \gls{ifglsused}
to determine if the \idx{entry} has been used. You can test if an
\idx{entry} is an \idx{acronym} by checking if it has the \gloskey{long} key set using
\gls{ifglshaslong} (or if the \gloskey{short} key has been set using
\gls{ifglshasshort}). For example, to switch off the \idx+{hyperlink} on
\idx{firstuse} just for \idxpl{acronym}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkcheckfirsthyperhook}}\marg{\comment{}
 \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\comment{}
 \marg{\comment{}
   \gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}}{}\comment{}
 }\comment{}
}
\end{codebox}

Note that this hook isn't used by the commands that don't check the
\idx{firstuseflag}, such as \gls{glstext}. (You can, instead, redefine
\gls{glslinkpostsetkeys}, which is used by both the \gls{glslike} and
\gls{glstextlike} commands.)

\begin{xtr}
The \sty{glossaries-extra} package provides a method of disabling
the \idx{firstuse} \idx+{hyperlink} according to the \idx{entry}['s] associated
\gloskey{category}. For example, if you only want to switch off the \idx{firstuse}
hyperlink for \idxpl{abbreviation} then you simply need to set
the \catattr{nohyperfirst} \idxc{categoryattribute}{attribute} for the \cat{abbreviation}
and, if appropriate, \cat{acronym} categories. (Instead of using the
\opt{hyperfirst} package option.) See the
\sty{glossaries-extra} manual for further details.
\end{xtr}

\optiondef{writeglslabels}
This option will create a file called
\code{\gls{jobname}.\ext{glslabels}} at the end of the document.
This file simply contains a list of all defined entry labels
(including those in any \idxpl{ignoredglossary}). It's provided for
the benefit of text editors that need to know labels for
\idx{auto-completion}. If you also want the name, use
\opt{writeglslabelnames}. (See also \sty{glossaries-extra}['s]
\optval{docdef}{atom} package option.)

\begin{bib2gls}
Note that with \app{bib2gls} the file will only contain the entries
that \app{bib2gls} has selected from the \ext{bib} files.
\end{bib2gls}

\optiondef{writeglslabelnames}
Similar to \opt{writeglslabels} but writes both
the label and name (separated by a tab).

\optiondef{undefaction}

Only available with \sty{glossaries-extra}, the value for this
option may be one of:

\optionvaldef{undefaction}{error}
Generates an error if a referenced entry is
undefined (default, and the only available setting with just
the base \sty{glossaries} package).

\optionvaldef{undefaction}{warn}
Only warns if a referenced entry is undefined (automatically
activated with \option{b2g}).

\optiondef{docdef}

Only available with \sty{glossaries-extra}, this
option governs the use of \gls{newglossaryentry}. Available
values:

\optionvaldef{docdef}{false}
This setting means that \gls{newglossaryentry} is not permitted in
the \env{document} environment (default with \sty{glossaries-extra}
and for \option{noidx} with just the base \sty{glossaries} package).

\optionvaldef{docdef}{restricted}
This setting means that \gls{newglossaryentry} is only permitted in
the \env{document} environment if it occurs before
\gls{printglossary} (not available for some indexing options, such
as \options{b2g}).

\optionvaldef{docdef}{atom}
This setting is as \opteqvalref{docdef}{restricted} but creates the
\ext+{glsdefs} file for use by \app{atom} (without the
limitations of \opteqvalref{docdef}{true}).

\optionvaldef{docdef}{true}
This setting means that \gls{newglossaryentry} is permitted in the
\env{document} environment where it would normally be permitted by
the base \sty{glossaries} package. This will create the
\ext+{glsdefs} file if \gls{newglossaryentry} is found in the
\env{document} environment.

\section{Sectioning, Headings and TOC Options}
\label{sec:pkgopts-sec}

\optiondef{toc}
Adds the \idxpl{glossary} to the \idx+{tableofcontents} (\ext+{toc} file).
Note that an extra \LaTeX\ run is required with this option.
Alternatively, you can switch this function on and off using
\cmddef{glstoctrue}
and
\cmddef{glstocfalse}
You can test whether or not this option is set using:
\cmddef{ifglstoc}
The default value is \optval{toc}{false} for the base
\sty{glossaries} package and \optval{toc}{true} for
\sty{glossaries-extra}.

\optiondef{numberline}
When used with \optval{toc}{true} option, this will add
\code{\gls{numberline}\marg{}} in the final argument of
\gls{addcontentsline}. This will align the \idx{tableofcontents}
entry with the numbered section titles. Note that this option has no
effect with \optval{toc}{false}. If \optval{toc}{true} is used
without \opt{numberline}, the \idx{glossary} title will be aligned
with the section numbers rather than the section titles.

\optiondef{section} 

This option indicates the sectional unit to use for the \idx{glossary}.
The value \meta{name} should be the control sequence \emph{name} without the
leading backslash or following star (for example, just \code{chapter}
not \gls{chapter} or \code{chapter*}).

The default behaviour is for the glossary heading to use
\gls{chapter}, if that command exists, or \gls{section} otherwise. The
starred or unstarred form is determined by the \opt{numberedsection} option.

Example:
\begin{codebox}
\cmd{usepackage}\oarg{\optval{section}{subsection}}\marg{glossaries}
\end{codebox}
You can omit the value if you want to use \gls{section}:
\begin{codebox}
\cmd{usepackage}[\opt{section}]\marg{glossaries}
\end{codebox}
is equivalent to
\begin{codebox}
\cmd{usepackage}[\optval{section}{section}]\marg{glossaries}
\end{codebox}
You can change this value later in the document using
\cmddef{setglossarysection}
where \meta{name} is the sectional unit.

The start of each \idx{glossary} adds information to the page header via
\gls{glsglossarymark} (see \sectionref{sec:glossmarkup}).

\optiondef{ucmark}
If \optval{ucmark}{true}, this will make \gls{glsglossarymark} use
\idx+{allcaps} in the header, otherwise no \idx{casechange} will be
applied.
The default is
\optval{ucmark}{false}, unless \cls{memoir} has been loaded, in
which case the default is \optval{ucmark}{true}.

You can test if this option has been set using:
\cmddef{ifglsucmark}
For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsglossarymark}}[1]\marg{\comment{}
  \gls{ifglsucmark}
    \gls{markright}\marg{\gls{glsuppercase}\marg{\#1}}\comment{}
  \cmd{else}
    \gls{markright}\marg{\#1}\comment{}
  \cmd{fi}}
\end{codebox}

\optiondef{numberedsection}
The \idxpl{glossary} are placed in unnumbered sectional units by default,
but this can be changed using \opt{numberedsection}. This option can take
one of the following values:

\optionvaldef{numberedsection}{false}
No number, that is, use the starred form
of sectioning command (for example, \starredcs{chapter} or
\starredcs{section}).

\optionvaldef{numberedsection}{nolabel}
Use a numbered section, that is, the unstarred form of sectioning
command (for example, \gls{chapter} or \gls{section}), but 
no label is automatically added.

\optionvaldef{numberedsection}{autolabel}
Use numbered sections with automatic
labelling. Each \idx{glossary} uses the unstarred form of a sectioning
command (for example, \gls{chapter} or \gls{section}) and is assigned a label
(via \gls{label}). The label is formed from the \idx{glossary}['s]
label prefixed with:
\cmddef{glsautoprefix}
The default value of \gls{glsautoprefix} is empty.  For example, 
if you load \sty{glossaries} using:
\begin{codebox}
\cmd{usepackage}[\opt{section},\optval{numberedsection}{autolabel}]
  \marg{glossaries}
\end{codebox}
then each \idx{glossary} will appear in a numbered section, and can
be referenced using something like:
\begin{codebox}
The main glossary is in section\sym{nbsp}\gls{ref}\marg{main} and 
the list of acronyms is in section\sym{nbsp}\gls{ref}\marg{acronym}.
\end{codebox}
If you can't decide whether to have the acronyms in the main
glossary or a separate list of acronyms, you can use
\gls{acronymtype} which is set to \glostype{main} if the
\opt{acronym} option is not used and is set to \glostype{acronym}
if the \opt{acronym} option is used. For example:
\begin{codebox}
The list of acronyms is in section\sym{nbsp}\gls{ref}\marg{\gls{acronymtype}}.
\end{codebox}
You can redefine the prefix if the default label clashes with
another label in your document.
For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsautoprefix}}\marg{glo:}
\end{codebox}
will add \code{glo:} to the automatically generated label, so
you can then, for example, refer to the list of acronyms as follows:
\begin{codebox}
The list of acronyms is in 
section\sym{nbsp}\gls{ref}\marg{glo:\gls{acronymtype}}.
\end{codebox}
Or, if you are undecided on a prefix:
\begin{codebox}
The list of acronyms is in 
section\sym{nbsp}\gls{ref}\marg{\gls{glsautoprefix}\gls{acronymtype}}.
\end{codebox}

\optionvaldef{numberedsection}{nameref}
This setting is like
\optval{numberedsection}{autolabel} but uses an unnumbered
sectioning command (for example, \starredcs{chapter} or \starredcs{section}). It's
designed for use with the \sty{nameref} package. For example:
\begin{codebox}
\cmd{usepackage}\marg{nameref}
\cmd{usepackage}[\optval{numberedsection}{nameref}]\marg{glossaries}
\end{codebox}
Alternatively, since \sty{nameref} is automatically loaded by
\sty{hyperref}:
\begin{codebox}
\cmd{usepackage}\marg{hyperref}
\cmd{usepackage}[\optval{numberedsection}{nameref}]\marg{glossaries}
\end{codebox}
Now \code{\gls{nameref}\marg{main}} will display the
(\idx{tableofcontents}) section title
associated with the \glostype{main} glossary. As above, you can
redefine \gls{glsautoprefix} to provide a prefix for the label.

\section{Glossary Appearance Options}
\label{sec:pkgopts-printglos}

\optiondef{savenumberlist}
This is a boolean option that specifies whether or not to gather and
store the \idx{numberlist} for each entry. The default is
\optval{savenumberlist}{false} with \options{mkidx,xdy}. (See
\gls{glsentrynumberlist} and \gls{glsdisplaynumberlist} in
\sectionref{sec:glsnolink}.) This setting is always true if you use
\option{noidx} as a by-product of the way that \idx{indexing} method works.

\begin{bib2gls}
If you use the \opt{record} option (with either no value or
\optval{record}{only} or \optval{record}{nameref}) then this
package option has no effect. With \app{bib2gls}, the
\idxpl{numberlist} are automatically saved with the default
\resourceoptval{save-locations}{true} and
\resourceoptval{save-loclist}{true} resource settings.
\end{bib2gls}

\optiondef{entrycounter}
If set, this will create the counter:
\ctrdef{glossaryentry}
Each \toplevel\ entry will increment and display that counter
at the start of the \idx{entryline} when using
\idxpl{glossarystyle} that support this setting.
Note that if you also use \opt{subentrycounter} the option order
makes a difference. If \opt{entrycounter} is specified first, 
the sub-entry counter will be dependent on the \ctr{glossaryentry}
counter.

If you use this option (and are using a \idx{glossarystyle} that
supports this option) then you can reference the \idx{entry} number
within the document using:
\cmddef{glsrefentry}
where \meta{label} is the label associated with that glossary entry.
This will use \gls{ref} if either \optval{entrycounter}{true} or
\optval{subentrycounter}{true}, with the label \meta{prefix}\meta{label}, where
\meta{label} is the entry's label and \meta{prefix} is given by:
\cmddef{GlsEntryCounterLabelPrefix}
If both \optval{entrycounter}{false} and
\optval{subentrycounter}{false}, \code{\gls{gls}\margm{label}} will
be used instead.

\begin{important}
If you use \gls{glsrefentry}, you must run \LaTeX\ twice after
creating the \idxpl{indexingfile} using \app{makeglossaries},
\app{makeindex} or \app{xindy} (or after creating the \ext{glstex}
file with \app{bib2gls}) to ensure the cross-references are
up-to-date. This is because the counter can't be incremented and
labelled until the \idx{glossary} is typeset.
\end{important}

The \ctr{glossaryentry} counter can be reset back to zero with:
\cmddef{glsresetentrycounter}
This does nothing if \optval{entrycounter}{false}.
The \ctr{glossaryentry} counter can be simultaneously incremented and labelled (using
\gls{refstepcounter} and \gls{label}) with:
\cmddef{glsstepentry}
This command is within the definition of \gls{glsentryitem}, which is
typically used in \idxpl{glossarystyle} at the start of
\toplevel\ entries. The argument is the entry label.

The value of the \ctr{glossaryentry} counter can be displayed with:
\cmddef{theglossaryentry}
This command is defined when the \ctr{glossaryentry} counter is
defined, so won't be available otherwise. The formatted value is
more usually displayed with:
\cmddef{glsentrycounterlabel} 
This will do \code{\gls{theglossaryentry}.\gls{space}} if 
\optval{entrycounter}{true}, otherwise does nothing. This is
therefore more generally useful in \idxpl{glossarystyle} as it will
silently do nothing if the setting isn't on. This command is used
within the definition of \gls{glsentryitem}.

If you want to test whether or not this option is currently enabled,
use the conditional:
\cmddef{ifglsentrycounter}
You can later switch it off using:
\cmddef{glsentrycounterfalse}
and switch it back on with:
\cmddef{glsentrycountertrue}
but note that this won't define \ctr{glossaryentry} if
\optval{entrycounter}{true} wasn't used initially.
You can also locally enable or disable this option for a specific
\idx{glossary} using the \printglossopt{entrycounter}
\idx{printglossopt}.

\optiondef{counterwithin}
If used, this option will automatically set \opt{entrycounter}{true} and the
\ctr{glossaryentry} counter will be reset every time
\meta{parent-counter} is incremented. An empty value indicates that
\ctr{glossaryentry} has no parent counter (but \ctr{glossaryentry}
will still be defined).


\begin{important}
The \ctr{glossaryentry} counter isn't automatically reset at the
start of each glossary, except when glossary section numbering is on
and the counter used by \opt{counterwithin} is the same as the
counter used in the glossary's sectioning command.
\end{important}

If you want the counter reset at the start of each \idx{glossary}, you can
modify the \idxf{glossarypreamble} (\gls{glossarypreamble}) to use
\gls{glsresetentrycounter}. For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glossarypreamble}}\marg{\comment{}
  \gls{glsresetentrycounter}
}
\end{codebox}
or if you are using \gls{setglossarypreamble}, add it to each
\idxf{glossarypreamble}, as required. For example:
\begin{codebox}
\gls{setglossarypreamble}\oarg{\glostype{acronym}}\marg{\comment{}
  \gls{glsresetentrycounter}
  The preamble text here for the list of acronyms.
}
\gls{setglossarypreamble}\marg{\comment{}
  \gls{glsresetentrycounter}
  The preamble text here for the \glostype{main} glossary.
}
\end{codebox}

\optiondef{subentrycounter} 
If set, each \hierlevel{1} glossary \idx{entry} will be numbered at the
start of its \idx{entryline} when using \idxpl{glossarystyle}
that support this option. This option creates the counter
\ctrdef{glossarysubentry}
If the \opt{entrycounter} option is used before
\opt{subentrycounter}, then \ctr{glossarysubentry} will be added to
the reset list for \ctr{glossaryentry}. If \opt{subentrycounter} is
used without \opt{entrycounter} then the \ctr{glossarysubentry}
counter will be reset by \gls{glsentryitem}.  If
\opt{subentrycounter} is used before \opt{entrycounter} then the two
counters are independent.

\begin{information}
There's no support for deeper \idxpl{hierarchicallevel}. Some
styles, such as those that don't support any hierarchy,
may not support this setting or, for those that only support level~0
and level~1, may use this setting for all child entries.
\end{information}

As with the \opt{entrycounter} option, you can
reference the number within the document using
\gls{glsrefentry}. There are analogous commands to those for
\opt{entrycounter}.

The \ctr{glossarysubentry} counter can be reset back to zero with:
\cmddef{glsresetsubentrycounter}
This does nothing if \optval{subentrycounter}{false}.
This command is used within the definition of \gls{glsentryitem} if
\optval{entrycounter}{false}.

The \ctr{glossarysubentry} counter can be simultaneously incremented and labelled (using
\gls{refstepcounter} and \gls{label}) with:
\cmddef{glsstepsubentry}
This command is used in \gls{glssubentryitem} if
\optval{subentrycounter}{true}, otherwise it does nothing.  The
argument is the entry label and is passed to \gls{label} is as for
\gls{glsrefentry}.

The value of the \ctr{glossarysubentry} counter can be displayed with:
\cmddef{theglossarysubentry}
This command is defined when the \ctr{glossarysubentry} counter is
defined, so won't be available otherwise. The formatted value is
more usually displayed with:
\cmddef{glssubentrycounterlabel} 
This will do \code{\gls{theglossarysubentry})\gls{space}} if 
\optval{subentrycounter}{true}, otherwise does nothing. This is
therefore more generally useful in \idxpl{glossarystyle} as it will
silently do nothing if the setting isn't on. This command is used in 
\gls{glssubentryitem}.

If you want to test whether or not this option is currently enabled,
use the conditional:
\cmddef{ifglssubentrycounter}
You can later switch it off using:
\cmddef{glssubentrycounterfalse}
and switch it back on with:
\cmddef{glssubentrycountertrue}
but note that this won't define \ctr{glossarysubentry} if
\optval{subentrycounter}{true} wasn't used initially.
You can also locally enable or disable this option for a specific
\idx{glossary} using the \printglossopt{subentrycounter}
\idx{printglossopt}.

\optiondef{style}
This option sets the default \idx+{glossarystyle} to
\meta{style-name}. This is initialised to
\optval{style}{\glostyle{list}} unless \sty{classicthesis}
has been loaded, in which case the default is
\optval{style}{\glostyle{index}}. (The styles that use the
\env{description} environment, such as the \glostyle{list} style, are incompatible
with \sty{classicthesis}.)

This setting may only be used for styles that are defined when the
\sty{glossaries} package is loaded. This will usually be the styles
in the packages \sty{glossary-list}, \sty{glossary-long},
\sty{glossary-super} or \sty{glossary-tree}, unless they have been
suppressed through options such as \opt{nostyles}. Style packages
can also be loaded by the \opt{stylemods} option provided by
\sty{glossaries-extra}.

Alternatively, you can set the style later using:
\cmddef{setglossarystyle}
or use the \printglossopt{style} \idx{printglossopt}.
(See \sectionref{sec:styles} for further details.)

\optiondef{nolong}
This prevents the \sty{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
\idxpl{glossarystyle} defined in the \sty{glossary-long} package (unless
you explicitly load \sty{glossary-long}).

\begin{information}
Some style packages implicitly load \sty{glossary-long}, so this
package may still end up being loaded even if you use \opt{nolong}.
\end{information}

\optiondef{nosuper}
This prevents the \sty{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
\idxpl{glossarystyle} defined in the \sty{glossary-super} package
(unless you explicitly load \sty{glossary-super}).

\begin{information}
This option is automatically implemented if \sty{xtab} has been
loaded as it's incompatible with \sty{supertabular}. This option is
also automatically implemented if \sty{supertabular} isn't installed.
\end{information}

\optiondef{nolist}
This prevents the \sty{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
\idxpl{glossarystyle} defined in the \sty{glossary-list} package
(unless you explicitly load \sty{glossary-list}).
Note that since the default style is \glostyle{list} (unless
\sty{classicthesis} has been loaded), you will 
also need to use the \opt{style} option to set the style to
something else.

\optiondef{notree}
This prevents the \sty{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
\idxpl{glossarystyle} defined in the \sty{glossary-tree} package
(unless you explicitly load \sty{glossary-tree}). Note that if
\sty{classicthesis} has been loaded, the default style is
\glostyle{index}, which is provided by \sty{glossary-tree}.

\begin{information}
Some style packages implicitly load \sty{glossary-tree}, so this
package may still end up being loaded even if you use \opt{notree}.
\end{information}

\optiondef{nostyles}
This prevents all the predefined styles
from being loaded. If you use this option, you need to load a
\idx{glossarystyle} package (such as \sty{glossary-mcols}). Also if you
use this option, you can't use the \opt{style} package option
(unless you use \opt{stylemods} with \sty{glossaries-extra}).
Instead you must either use \gls{setglossarystyle} or the
\printglossopt{style} \idx{printglossopt}. Example:
\begin{codebox}
\cmd{usepackage}[\opt{nostyles}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-mcols}
\gls{setglossarystyle}\marg{\glostyle{mcoltree}}
\end{codebox}
Alternatively:
\begin{codebox}
\cmd{usepackage}[\opt{nostyles},\optval{stylemods}{mcols},\optval{style}{\glostyle{mcoltree}}]\marg{glossaries-extra}
\end{codebox}

\optiondef{nonumberlist}
This option will suppress the associated \idxpl{numberlist} in the
\idxpl{glossary} (see also \sectionref{sec:numberlists}).
This option can also be locally switched on or off for a specific
\idx{glossary} with the \printglossopt{nonumberlist}
\idxpl{printglossopt}.

\begin{warning}
Note that if you use \optionsor{mkidx,xdy} (\app{makeindex} or \app{xindy})
then the \locations\ must still be valid even if this
setting is on. This package option merely
prevents the \idx{numberlist} from being displayed, but both
\app{makeindex} and \app{xindy} still require a \location\ or
cross-reference for each term that's \indexed.
\end{warning}

Remember that \idx{numberlist} includes any cross-references, so
suppressing the \idx{numberlist} will also hide the cross-references
(in which case, you may want to use \opt{seeautonumberlist}).

\begin{bib2gls}
With \app{bib2gls}, it's more efficient to use
\resourceoptval{save-locations}{false} in the resource options if no
\locations\ are required.
\end{bib2gls}

\optiondef{seeautonumberlist}
If you suppress the
\idxpl{numberlist} with \opt{nonumberlist}, described above, this
will also suppress any cross-referencing information supplied by the
\gloskey{see} key in \gls{newglossaryentry} or \gls{glssee}. If you
use \opt{seeautonumberlist}, the \gloskey{see} key will
automatically implement \optval{nonumberlist}{false} for that entry.
(Note this doesn't affect \gls{glssee}.) For further details see
\sectionref{sec:crossref}.

\optiondef{counter}
This setting indicates that \meta{counter-name} should be the
default counter to use in the \idxpl{numberlist} (see
\sectionref{sec:numberlists}). This option can be overridden for a
specific \idx{glossary} by the \meta{counter} optional argument of
\gls{newglossary} or the \gloskey{counter} key when defining an
entry or by the \glsopt{counter} option when referencing an entry.

This option will redefine:
\cmddef{glscounter}
to \meta{counter-name}.

\optiondef{nopostdot}
If true, this option suppresses the default terminating
\idx{fullstop} in \idxpl{glossarystyle} that use the
post-description hook:
\cmddef{glspostdescription}

The default setting is \optval{nopostdot}{false} for the base
\sty{glossaries} package and \optval{nopostdot}{true} for
\sty{glossaries-extra}.

\begin{xtr}
The \sty{glossaries-extra} package provides \opt{postdot}, which
is equivalent to \optval{nopostdot}{false}, and also
\opt{postpunc}, which allows you to choose a different
punctuation character.
\end{xtr}

\optiondef{nogroupskip}
If true, this option suppresses the default vertical gap between 
letter groups used by some of the predefined \idxpl{glossarystyle}. 
This option can also be locally switched on or off for a specific
\idx{glossary} with the \printglossopt{nogroupskip}
\idxpl{printglossopt}.

This option is only relevant for \idxpl{glossarystyle} that use the
conditional:
\cmddef{ifglsnogroupskip}
to test for this setting.

\begin{bib2gls}
If you are using \app{bib2gls} without the \switch{group} (or
\bibglsopt{g}) switch then this option is irrelevant as 
there won't be any letter groups.
\end{bib2gls}

\optiondef{stylemods}

Loads the \sty{glossaries-extra-stylemods} package, which patches the
predefined \idxpl{glossarystyle}. The \meta{list} argument is optional. If present,
this will also load \styfmt{glossary-\meta{element}.sty} for each
\meta{element} in the comma-separated \meta{list}. See the
\sty{glossaries-extra} manual for further details.

\section{Indexing Options}
\label{sec:pkgopts-indexing}

\glsstartrange{indexing}%
\optiondef{seenoindex}
(This option is only relevant with \app{makeindex} and \app{xindy}.)
The \gloskey{see} key automatically \idxc{indexing}{indexes} the
cross-referenced entry using \gls{glssee}. This means that if this
key is used in an entry definition before the relevant
\idx{indexingfile} has been opened, the \idx{indexing} can't be performed.
Since this is easy to miss, the \sty{glossaries} package by
default issues an error message if the \gloskey{see} key is used
before \gls{makeglossaries}. 

This option may take one of the following values:
\optionvaldef{seenoindex}{error}
This is the default setting that issues an error message.

\optionvaldef{seenoindex}{warn}
This setting will trigger a warning rather than an error.

\optionvaldef{seenoindex}{ignore}
This setting will do nothing. 

For example, if you want to temporarily comment out
\gls{makeglossaries} to speed up the compilation of a draft document
by omitting the \idx{indexing}, you can use
\optval{seenoindex}{warn} or \optval{seenoindex}{ignore}.

\optiondef{esclocations}

Only applicable to \app{makeindex} and \app{xindy}.
As from v4.50, the initial setting is now
\optval{esclocations}{false}. Previously it was
\optval{esclocations}{true}.

Both \app{makeindex} and \app{xindy} are fussy about the \location\
syntax (\app{makeindex} more so than \app{xindy}) so, if
\optval{esclocations}{true}, the \sty{glossaries} package will try
to ensure that special characters are escaped, which allows for the
\location\ to be substituted for a format that's more acceptable to
the \idx{indexingapp}. This requires a bit of trickery to circumvent
the problem posed by \TeX's asynchronous output routine, which can
go wrong and also adds to the complexity of the document build.

If you're sure that your locations will always expand to an
acceptable format (or you're prepared to post-process the \idx{glossary}
file before passing it to the relevant indexing application) then
use \optval{esclocations}{false} to avoid the complex escaping of
location values. This is now the default. 

If, however, your \locations\ (for example, \gls{thepage} with the
default \optval{counter}{\ctr{page}}) expand to a robust command
then you may need to use \optval{esclocations}{true}. You may
additionally need to set the following conditional to true:
\cmddef{ifglswrallowprimitivemods}
which will locally redefine some primitives in order to escape
special characters without prematurely expanding \gls{thepage}.
Since this hack may cause some issues and isn't necessary for the
majority of documents, this is off by default.

This conditional can be switched on with:
\cmddef{glswrallowprimitivemodstrue}
but remember that it will have no effect with
\optval{esclocations}{false}.
If can be switched off with:
\cmddef{glswrallowprimitivemodsfalse}

If you are using \app{makeindex} and your \location\ expands to
content in the form \code{\meta{cs} \margm{num}}, where \meta{cs} is
a command (optionally preceded by \gls{protect}) and \meta{num} is a
location acceptable to \app{makeindex}, then you can use
\app{makeglossaries} to make a suitable adjustment without
\optval{esclocations}{true}. See \sectionref{sec:problemlocations}
for furthe details.

This isn't an issue for \optionsor{noidx,b2g} as the \locations\ are written to
the \ext{aux} file and both methods use \LaTeX\ syntax, so no conversion is required.

\optiondef{indexonlyfirst}
If true, this setting will only \idxc{indexing}{index} on \idx{firstuse}.
The default setting \optval{indexonlyfirst}{false}, 
will \idxc{indexing}{index} the entry every time one of the 
\gls{glslike} or \gls{glstextlike} commands are used. Note that \gls{glsadd}
will always add information to the external \idx{glossary}
file (since that's the purpose of that command).

You can test if this setting is on using the conditional:
\cmddef{ifglsindexonlyfirst}
This setting can also be switched on with:
\cmddef{glsindexonlyfirsttrue}
and off with:
\cmddef{glsindexonlyfirstfalse}

\begin{important}
Resetting the \idx{firstuseflag} with commands like
\gls{glsreset} after an entry has been \indexed\ will cause that entry to be 
indexed multiple times if it's used again after the reset.
Likewise unsetting the \idx{firstuseflag} before an entry has been
indexed will prevent it from being indexed (unless specifically
indexed with \gls{glsadd}).
\end{important}

You can customise the default behaviour by redefining
\cmddef{glswriteentry}
where \meta{label} is the entry's label and \meta{indexing code} is the
code that writes the entry's information to the external file.
The default definition of \gls{glswriteentry} is:
\begin{compactcodebox}
\cmd{newcommand}*\marg{\gls{glswriteentry}}[2]\marg{\comment{}
  \gls{ifglsindexonlyfirst}
    \gls{ifglsused}\marg{\#1}\marg{}\marg{\#2}\comment{}
  \cmd{else}
    \#2\comment{}
  \cmd{fi}
}
\end{compactcodebox}
This does \meta{indexing code} unless
\optval{indexonlyfirst}{true} and the entry identified by
\meta{label} has been marked as \glslink{firstuseflag}{used}

For example, suppose you only want to index the \idx{firstuse} for
entries in the \glostype{acronym} glossary and not in the
\glostype{main} (or any other) \idx{glossary}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glswriteentry}}[2]\marg{\comment{}
 \cmd{ifthenelse}{\cmd{equal}\marg{\gls{glsentrytype}\marg{\#1}}\marg{acronym}}
 \marg{\gls{ifglsused}\marg{\#1}\marg{}\marg{\#2}}\comment{}
 \marg{\#2}\comment{}
}
\end{codebox}
Here I've used \csfmt{ifthenelse} to ensure the arguments of
\csfmt{equal} are fully expanded before the comparison is made.
There are other methods of performing an expanded string comparison,
which you may prefer to use.

With the \sty{glossaries-extra} package it's possible to only index
\idx{firstuse} for particular categories. For example, if you only
want this enabled for \idxpl{abbreviation} then you can set
the \catattr{indexonlyfirst} \idxc{categoryattribute}{attribute} 
for the \cat{abbreviation}
and, if appropriate, \cat{acronym} categories. (Instead of using the
\opt{indexonlyfirst} package option.) See the
\sty{glossaries-extra} manual for further details.

\optiondef{indexcrossrefs}

This option is only available with \sty{glossaries-extra}.
If true, this will automatically index (\gls{glsadd}) any
cross-referenced entries that haven't been marked as used at the end
of the document. Note that this increases the document build time. See
\sty{glossaries-extra} manual for further details.

\begin{bib2gls}
Note that \app{bib2gls} can automatically find dependent entries
when it parses the \ext{bib} file. Use the \resourceopt{selection} option 
to determine the selection of dependencies.
\end{bib2gls}

\optiondef{autoseeindex}

This option is only available with \sty{glossaries-extra}.
The base \sty{glossaries} package always implements
\optval{autoseeindex}{true}.

If true, this makes the \gloskey{see} and
\gloskey{seealso} keys automatically index the entry
(with \gls{glssee}) when the entry is defined. This means that any
entry with the \gloskey{see} (or \gloskey{seealso}) key will
automatically be added to the \idx{glossary}. See the
\sty{glossaries-extra} manual for further details.

\begin{bib2gls}
With \app{bib2gls}, use the \resourceopt{selection} resource option 
to determine the selection of dependencies.
\end{bib2gls}

\optiondef{record}

This option is only available with \sty{glossaries-extra}.
See \sty{glossaries-extra} manual for further details. A brief
summary of available values:

\optionvaldef{record}{off} 
This default setting indicates that \app{bib2gls} isn't being used.

\optionvaldef{record}{only}
This setting indicates that \app{bib2gls} is being used to fetch entries
from one or more \ext{bib} files, to sort the entries and collate the
\idxpl{numberlist}, where the \location\ information is the same as
for \options{noidx,mkidx,xdy}.

\optionvaldef{record}{nameref}
This setting is like \optval{record}{only} but provides extra
information that allows the associated title to be used instead of
the location number and provides better support for hyperlinked
locations.

\optionvaldef{record}{hybrid}
This setting indicates a hybrid approach where \app{bib2gls}
is used to fetch entries from one or more \ext{bib} files but
\app{makeindex} or \app{xindy} are used for the \idx{indexing}. This
requires a more complicated document build and isn't recommended.

\optiondef{equations}

This option is only available with \sty{glossaries-extra}.
If true, this option will cause the default 
\idx{locationcounter} to automatically switch to \ctr{equation} when inside a
numbered equation environment.

\optiondef{floats}

This option is only available with \sty{glossaries-extra}.
If true, this option will cause the default \idx{locationcounter} 
to automatically switch to the corresponding counter when inside a
float. (Remember that with floats it's the \gls{caption} command that
increments the counter so the location will be incorrect if an entry
is \indexed\ within the float before the caption.)

\optiondef{indexcounter}

This option is only available with \sty{glossaries-extra}.
This valueless option is primarily intended for use with
\app{bib2gls} and \sty{hyperref} allowing the page location
\idx{hyperlink} target to be set to the relevant point within the page
(rather than the top of the page). Unexpected results will occur
with other indexing methods. See \sty{glossaries-extra} manual for
further details.
\glsendrange{indexing}%

\section{Sorting Options}
\label{sec:pkgopts-sort}

This section is mostly for \options{mkidx,xdy}. Only the \opt{sort} and
\opt{order} options are applicable for \option{noidx}.

\begin{xtr}
With \options{b2g,unsrt,standalone}, only \optval{sort}{none} is applicable 
(and this is automatically implemented by \opteqvalref{record}{only} and
\opteqvalref{record}{nameref}). With \app{bib2gls}, the sort method 
is provided in the optional argument of \gls{GlsXtrLoadResources} 
not with the \opt{sort} package option. There's no sorting
with \options{unsrt,standalone}.
\end{xtr}

\optiondef{sanitizesort}
This option determines whether or not to \idx{sanitize} the sort value when
writing to the external \idx{indexingfile}. For example, suppose you
define an entry as follows:
\begin{codebox*}
\gls{newglossaryentry}\marg{hash}\marg{\gloskeyval{name}{\gls{cs.hash}},\gloskeyval{sort}{\sym{hash}},
 \gloskeyval{description}{hash symbol}}
\end{codebox*}
The sort value (\sym{hash}) must be sanitized before writing it to the
\idx{indexingfile}, otherwise \LaTeX\ will try to interpret it as a
parameter reference. If, on the other hand, you want the sort value
expanded, you need to switch off the sanitization. For example,
suppose you do:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{mysortvalue}}\marg{AAA}
\gls{newglossaryentry}\marg{sample}\marg{\comment{}
  \gloskeyval{name}{sample},
  \gloskeyval{sort}{\cmd{mysortvalue}},
  \gloskeyval{description}{an example}}
\end{codebox}
and you actually want \csfmt{mysortvalue} expanded, so that the entry
is sorted according to \code{AAA}, then use the package option
\opt{sanitizesort}{false}.

The default for \options{mkidx,xdy} is \optval{sanitizesort}{true}, and the
default for \option{noidx} is \optval{sanitizesort}{false}.

\optiondef{sort}
If you use \optionsor{mkidx,xdy}, this package option is
the only way of specifying how to sort the glossaries. Only 
\option{noidx} allows you to specify sort methods for individual glossaries
via the \printglossopt{sort} key in the optional
argument of \gls{printnoidxglossary}. If you have multiple
\idxpl{glossary} in your document and you are using \option{noidx}, only use
the package options
\opteqvalref{sort}{def} or \opteqvalref{sort}{use} if you want to set this
sort method for \emph{all} your \idxpl{glossary}.

\optionvaldef{sort}{none}
This setting is only for documents that don't use
\gls{makeglossaries} (\optionsor{mkidx,xdy}) or
\gls{makenoidxglossaries} (\option{noidx}). It omits the code used
to sanitize or escape the sort value, since it's not required. This
can help to improve the document build speed, especially if there
are a large number of entries. This setting may be used if no
\idx{glossary} is required or if \gls{printunsrtglossary} is used
(\option{unsrt}). If you want an unsorted \idx{glossary} with
\app{bib2gls}, use the resource option \resourceoptval{sort}{none}
instead. This option will redefine \gls{glsindexingsetting} to
\code{none}.

\begin{information}
This option will still assign the \gloskey{sort} key to its default
value. It simply doesn't process it. If you want the \gloskey{sort}
key set to an empty value instead, use \opteqvalref{sort}{clear}
instead.
\end{information}

\optionvaldef{sort}{clear}
As \opteqvalref{sort}{none} but sets the \gloskey{sort} key to an
empty value. This will affect \idx{lettergroup} formations in
\gls{printunsrtglossary} with \option{unsrt}. See the
\sty{glossaries-extra} manual for further details. This option will
redefine \gls{glsindexingsetting} to \code{none}. The remaining
\opt{sort} options listed below don't change \gls{glsindexingsetting}.

\optionvaldef{sort}{def}
Entries are sorted in the order in
which they were defined. With \option{noidx}, this is implemented by
simply iterating over all defined entries so there's no actual
sorting. With \options{mkidx,xdy}, sorting is always performed
(since that's the purpose of \app{makeindex} and \app{xindy}). This
means that to obtain a list in order of definition, the
\gloskey{sort} key is assigned a numeric value that's incremented
whenever a new entry is defined.

\optionvaldef{sort}{use}
Entries are sorted according to the order in which they are used in
the document. With \option{noidx}, this order is obtained by
iterating over a list that's formed with the \ext{aux} file is input
at the start of the document. With \options{mkidx,xdy}, again the
\gloskey{sort} key is assigned a numeric value, but in this case the
value is incremented, and the \gloskey{sort} key is assigned, 
the first time an entry is \indexed.

Both \opteqvalref{sort}{def} and \opteqvalref{sort}{use} zero-pad the sort key to a
six digit number using:
\cmddef{glssortnumberfmt}
This can be redefined, if required, before the entries are defined (in the
case of \opteqvalref{sort}{def}) or before the entries are used
(in the case of \opteqvalref{sort}{use}).

Note that the \idx{group} styles (such as \glostyle{listgroup}) are
incompatible with the \opteqvalref{sort}{use} and \opteqvalref{sort}{def}
options.

\optionvaldef{sort}{standard}
Entries are sorted according to the value of the \gloskey{sort} key
used in \gls{newglossaryentry} (if present) or the \gloskey{name}
key (if \gloskey{sort} key is missing).

When the standard sort option is in use, you can hook into the sort mechanism by
redefining:
\cmddef{glsprestandardsort}
where \meta{sort cs} is a temporary control sequence that stores the
sort value (which was either explicitly set via the \gloskey{sort}
key or implicitly set via the \gloskey{name} key) before any escaping of the
\app{makeindex}\slash\app{xindy} special characters is performed.
By default \gls{glsprestandardsort} just does:
\cmddef{glsdosanitizesort}
which \idx{sanitize}[s] \meta{sort cs} if \optval{sanitizesort}{true} 
(or does nothing if \optval{sanitizesort}{false}).

The other arguments, \meta{type} and \meta{entry-label}, are the 
\idx{glossary} type and the entry label for the current entry. Note that
\meta{type} will always be a control sequence, but \meta{label} will
be in the form used in the first argument of \gls{newglossaryentry}.

\begin{important}
Redefining \gls{glsprestandardsort} won't affect any entries that 
have already been defined and will have no effect at all if you 
use another \opt{sort} setting.
\end{important}

\begin{example}{Mixing Alphabetical and Order of Definition Sorting}{ex:diffsorts}
Suppose I have three \idxpl{glossary}: \glostype{main},
\glostype{acronym} and \glostypefmt{notation}, and let's suppose
I want the \glostype{main} and \glostype{acronym} glossaries to be
sorted alphabetically, but the \glostypefmt{notation} type should be
sorted in order of definition. 

For \option{noidx}, the \printglossopt{sort} option can be
used in \gls{printnoidxglossary}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{word}}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\printglossoptval{sort}{word}}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{notation},\printglossoptval{sort}{def}}
\end{codebox}

For \optionsor{mkidx,xdy}, I can set \opteqvalref{sort}{standard}
(which is the default), and I can either define
all my \glostype{main} and \glostype{acronym} entries, then
redefine \gls{glsprestandardsort} to set \meta{sort cs} to
an incremented integer, and then define all my
\glostypefmt{notation} entries. Alternatively, I can redefine
\gls{glsprestandardsort} to check for the glossary type and only
modify \meta{sort cs} if \meta{type} is \glostypefmt{notation}.

The first method can be achieved as follows:
\begin{codebox}
\cmd{newcounter}\marg{sortcount}
\codepar
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
  \cmd{stepcounter}\marg{sortcount}\comment{}
  \cmd{edef}\#1\marg{\gls{glssortnumberfmt}\marg{\gls{arabic}\marg{sortcount}}}\comment{}
}
\end{codebox}
The second method can be achieved as follows:
\begin{codebox}
\cmd{newcounter}\marg{sortcount}
\codepar
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
  \cmd{ifdefstring}\marg{\#2}\marg{notation}\comment{}
  \marg{\comment{}
     \cmd{stepcounter}\marg{sortcount}\comment{}
     \cmd{edef}\#1\marg{\gls{glssortnumberfmt}\marg{\gls{arabic}\marg{sortcount}}}\comment{}
  }\comment{}
  \marg{\comment{}
     \gls{glsdosanitizesort}
  }\comment{}
}
\end{codebox}
(\csfmt{ifdefstring} is defined by the \sty{etoolbox} package, which
is automatically loaded by \sty{glossaries}.)
For a complete document, see the sample file \samplefile{Sort}.
\end{example}

\begin{example}{Customizing Standard Sort (Options
\glsfmttext{idx.opt.mkidx} or \glsfmttext{idx.opt.xdy})}{ex:customsort}
Suppose you want a \idx{glossary} of people and you want the names listed
as \meta{first-name} \meta{surname} in the glossary, but you want the names
sorted by \meta{surname}, \meta{first-name}. You can do this by
defining a command called, say,
\csfmt{name}\marg{first-name}\marg{surname} that you can use in the
\gloskey{name} key when you define the entry, but hook into the
standard sort mechanism to temporarily redefine \csfmt{name} while the
sort value is being set.

First, define two commands to set the person's name:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{sortname}}[2]\marg{\#2, \#1}
\cmd{newcommand}\marg{\cmd{textname}}[2]\marg{\#1 \#2}
\end{codebox}
and \csfmt{name} needs to be initialised to \csfmt{textname}:
\begin{codebox}
\cmd{let}\cmd{name}\cmd{textname}
\end{codebox}
Now redefine \gls{glsprestandardsort} so that it temporarily sets
\csfmt{name} to \csfmt{sortname} and expands the sort value, then sets
\csfmt{name} to \csfmt{textname} so that the person's name appears as
\meta{first-name} \meta{surname} in the text:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
 \cmd{let}\cmd{name}\cmd{sortname}
 \cmd{edef}\#1\marg{\cmd{expandafter}\cmd{expandonce}\cmd{expandafter}\marg{\#1}}\comment{}
 \cmd{let}\cmd{name}\cmd{textname}
 \gls{glsdosanitizesort}
}
\end{codebox}
(The somewhat complicate use of \csfmt{expandafter} etc helps to
protect fragile commands, but care is still needed.)

Now the entries can be defined:
\begin{codebox}
\gls{newglossaryentry}\marg{joebloggs}{\gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}},
  \gloskeyval{description}{some information about Joe Bloggs}}
\codepar
\gls{newglossaryentry}\marg{johnsmith}\marg{\gloskeyval{name}{\cmd{name}\marg{John}\marg{Smith}},
  \gloskeyval{description}{some information about John Smith}}
\end{codebox}
For a complete document, see the sample file \samplefile{People}.
\end{example}

\optiondef{order} 
This may take two values: 

\optionvaldef{order}{word}
Word order (\qt{sea lion} before \qt{seal}).

\optionvaldef{order}{letter}
Letter order (\qt{seal} before \qt{sea lion}).

\begin{important}
Note that with \options{mkidx,xdy}, the \opt{order} option has 
no effect if you explicitly call \app{makeindex} or \app{xindy}.
\end{important}

If you use \option{noidx}, this setting will be used if you use 
\printglossoptval{sort}{standard} in 
the optional argument of \gls{printnoidxglossary}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{standard}}
\end{codebox}
Alternatively, you can specify the order for individual
\idxpl{glossary}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{word}}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\printglossoptval{sort}{letter}}
\end{codebox}

\begin{bib2gls}
With \app{bib2gls}, use the \resourceopt{break-at} option
in \gls{GlsXtrLoadResources} instead of \opt{order}.
\end{bib2gls}

\optiondef{makeindex}
The \idx{glossary} information and \idx{indexing} style file will be
written in \app{makeindex} format. If you use \app{makeglossaries}
or \app{makeglossaries-lite}, 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~\ext{ist}
extension.

You may omit this package option if you are using \option{mkidx} as this is the
default. It's available in case you need to override the effect of an earlier
occurrence of \opt{xindy} in the package option list.

\optiondef{xindy} 
The \idx{glossary} information and \idx{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 \ext{xdy} extension.

This package option may additionally have a value that is a \keyval\
comma-separated list to override some default options.  Note that
these options are irrelevant if you explicitly call \app{xindy}.
See \sectionref{sec:xindy} for further details on using \app{xindy}
with the \sty{glossaries} package.

You can test if this option has been set using the conditional:
\cmddef{ifglsxindy}
Note that this conditional should not be changed after
\gls{makeglossaries} otherwise the syntax in the \idx{glossary}
files will be incorrect. If this conditional is false, it means that
any option other than \option{xdy} is in effect. (If you need to
know which indexing option is in effect, check the definition of
\gls{glsindexingsetting} instead.)

The \meta{options} value may be omitted. If set, it should be a
\keyval\ list, where the following three options may be used:

\optiondef*{xindy.language}
The language module to use, which is passed to \app{xindy} with the
\xdyopt{L} switch. The default is obtained from \gls{languagename}
but note that this may not be correct as \app{xindy} has a different
labelling system to \sty{babel} and \sty{polyglossia}. 

The \app{makeglossaries} script has a set of mappings of known
\sty{babel} language names to \app{xindy} language names, but new
\sty{babel} dialect names may not be included. The
\app{makeglossaries-lite} script doesn't have this feature (but
there's no benefit in use \app{makeglossaries-lite} instead of
\app{makeglossaries} when using \app{xindy}). The \optval{automake}
option that calls \app{xindy} explicitly also doesn't use any
mapping.

However, even if the appropriate mapping is available,
\gls{languagename} may still not expand to the language required for
the \idx{glossary}.  In which case, you need to specify the correct
\app{xindy} language. For example:
\begin{codebox}
\cmd{usepackage}[brazilian,english]\marg{babel}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{language}{portuguese}}]\marg{glossaries}
\end{codebox}
If you have multiple \idxpl{glossary} in different languages, use
\gls{GlsSetXdyLanguage} to set the language for each glossary.

\optiondef*{xindy.codepage}
The \idx{codepage} is the file \idx{encoding} for the \app{xindy} files and is
passed to \app{xindy} with the \xdyopt{C} switch. The default
\idx{codepage} is obtained from \gls{inputencodingname}. As from v4.50, if
\gls{inputencodingname} isn't defined, \idx{utf8} is assumed (which is
identified by the label \code{utf8}). If this is incorrect, you will
need to use the \opt{xindy.codepage} option but make sure you
use the \app{xindy} \idx{codepage} label (for example, \code{cp1252} or
\code{latin9}). See the \app{xindy} documentation for further
details.

\begin{important}
The \idx{codepage} may not simply be the \idx{encoding} but may
include a sorting rule, such as \code{ij-as-y-utf8} or
\code{din5007-utf8}. See \sectionref{sec:langenc}.
\end{important}

For example:
\begin{codebox}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{language}{english},\styoptxdyval{codepage}{cp1252}}]
  \marg{glossaries}
\end{codebox}

\optiondef*{xindy.glsnumbers}
If true, this option will define the number \idx{group} in the \app{xindy}
style file, which by default will be placed before the \qt{A} 
\idx{lettergroup}. If you don't want this \idx{lettergroup}, set this option to
false. Note that the \qt{A} \idx{lettergroup} is only available with
\idxpl{latinalph}, so if you are using a \idx{nonlatinalph}, you
will either need to switch off the number \idx{group} or identify the
\idx{lettergroup} that it should come before with
\gls{GlsSetXdyNumberGroupOrder}.

\optiondef{xindygloss}
This is equivalent to \opt{xindy} without any value supplied
and may be used as a document class option. The language
and code page can be set via \gls{GlsSetXdyLanguage} and
\gls{GlsSetXdyCodePage} if the defaults are inappropriate 
(see \sectionref{sec:langenc}.)

\optiondef{xindynoglsnumbers}
This is equivalent to
\optvalm{xindy}{\styoptxdyval{glsnumbers}{false}}
and may be used as a document class option.

\optiondef{automake} 
This option will attempt to use the \idx{shellescape} to run the
appropriate \idx{indexingapp}. You will still need to run \LaTeX\
twice. For example, if the document in the file \filefmt{myDoc.tex}
contains:
\begin{codebox}
\cmd{usepackage}[\opt{automake}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{an example}}
\cbeg{document}
\gls{gls}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
Then the document build is now:
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
\end{terminal}
This will run \app{makeindex} on every \LaTeX\ run. If you have a
large \idx{glossary} with a complex document build, this can end 
up being more time-consuming that simply running \app{makeindex}
(either explicitly or via \app{makeglossaries}) the minimum number
of required times.

\begin{important}
Note that you will need to have the
\idx{shellescape} enabled (restricted mode for a direct call to
\app{makeindex} and unrestricted mode for \app{xindy},
\app{makeglossaries} or \app{makeglossaries-lite}). If you switch
this option on and you are using \LuaLaTeX, then the \sty{shellesc}
package will be loaded.
\end{important}

If this option doesn't seem to work, open the \ext+{log} file in
your text editor and search for \qtt{runsystem}. For example, if the
document is in a file called \filefmt{myDoc.tex} and it has:
\begin{codebox}
\cmd{usepackage}[\opt{automake}]\marg{glossaries}
\end{codebox}
and you run \LaTeX\ in restricted mode, then if call was
successful, you should find the following line in the file
\filefmt{myDoc.log}:
\begin{transcript}
runsystem(makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo)...executed safely (allowed).
\end{transcript}
The parentheses immediately after \qtt{runsystem} show how the
command was called. The bit after the three dots \code{...}
indicates whether or not the command was run and, if so, whether it
was successful. In the above case, it has \qt{executed safely
(allowed)}. This means that it was allowed to run in restricted
mode because \app{makeindex} is on the list of trusted applications.

If you change the package option to:
\begin{codebox}
\cmd{usepackage}[\opteqvalref{automake}{makegloss}]\marg{glossaries}
\end{codebox}
and rerun \LaTeX\ in restricted mode, then the line in
\filefmt{myDoc.log} will now be:
\begin{transcript}
runsystem(makeglossaries myDoc)...disabled (restricted).
\end{transcript}
This indicates that an attempt was made to run \app{makeglossaries}
(rather than a direct call to \app{makeindex}), which isn't
permitted in restricted mode. There will be a similar message with
\opteqvalref{automake}{lite} or if the \opt{xindy} option is used.
These cases require the unrestricted \idx{shellescape}. 

\begin{important}
Think carefully before enabling unrestricted mode. Do you trust all
the packages your document is loading (either explicitly or
implicitly via another package)? Do you trust any code that you have
copied and pasted from some third party? First compile your document
in restricted mode (or with the \idx{shellescape} disabled) and
search the \ext{log} file for \qtt{runsystem} to find out exactly
what system calls are being attempted.
\end{important}

If the document is compiled in unrestricted mode, the corresponding
line in the \ext{log} file should now be:
\begin{transcript}
runsystem(makeglossaries myDoc)...executed.
\end{transcript}
This means that \app{makeglossaries} was run. If it has \qt{failed}
instead of \qt{executed}, then it means there was a fatal error.
Note that just because the \ext{log} file has \qt{executed} doesn't
mean that the application ran without a problem as there may have been
some warnings or non-fatal errors. If you get any unexpected
results, check the \idx{indexingapp}['s] transcript file (for
example, the \ext+{glg} file, \filefmt{myDoc.glg} in the above, for
the \glostype{main} glossary).

\optionvaldef{automake}{false}
No attempt is made to use the \idx{shellescape}.

\optionvaldef{automake}{true}
This is now a deprecated synonym for
\opteqvalref{automake}{delayed}. This used to be the default if the
value to \opt{automake} wasn't supplied, but the default switched to
the less problematic \opteqvalref{automake}{immediate} in version 4.50.

\optionvaldef{automake}{delayed}
A direct call to \app{makeindex} or \app{xindy} (as appropriate) for
each non-empty \idx{glossary} will be made at the end of the
document using a delayed write to ensure that the \idx{glossary}
files are complete. (It's necessary to delay writing to the
\idxpl{indexingfile} in order to ensure that \gls{thepage} is
correct.) Unfortunately, there are situations where the delayed
write never occurs, for example, if there are floats on the final
page. In those cases, it's better to use an immediate write (any of
the following options).

\optionvaldef{automake}{immediate}
A direct call to \app{makeindex} or \app{xindy} (as appropriate) for
each non-empty \idx{glossary} will be made at the start of
\gls{makeglossaries} using an immediate write. This ensures that the
\idxpl{indexingfile} are read by the \idx{indexingapp} before they
are opened (which will clear their content).

If you are using \app{xindy}, then \opteqvalref{automake}{makegloss}
is a better option that this one. Either way, you will need Perl and
the unrestricted mode, but with \app{makeglossaries} you get the
benefit of the language mappings and diagnostics.

\optionvaldef{automake}{makegloss}
A call to \app{makeglossaries} will be made at the start of
\gls{makeglossaries} using an immediate write if the \ext+{aux} file
exists. On the one hand, it's better to use \app{makeglossaries} as
it has some extra diagnostic functions, but on the other hand it
both requires Perl and the unrestricted \idx{shellescape}.

\optionvaldef{automake}{lite}
A call to \app{makeglossaries-lite} will be made at the start of
\gls{makeglossaries} using an immediate write if the \ext+{aux} file
exists. There's little benefit in this option over
\opteqvalref{automake}{immediate} and it has the added disadvantage
of requiring the unrestricted mode.

\optiondef{automakegloss}
This valueless option is equivalent to \opteqvalref{automake}{makegloss}.

\optiondef{automakeglosslite}
This valueless option is equivalent to \opteqvalref{automake}{lite}.

\optiondef{disablemakegloss}
This valueless option indicates that \gls{makeglossaries} and
\gls{makenoidxglossaries} should be disabled. This option is
provided in the event that you have to use a class or package that
disregards the advice in \sectionref{sec:indexingoptions} and
automatically performs \gls{makeglossaries} or
\gls{makenoidxglossaries} but you don't want this.  (For example,
you want to use a different \idx{indexing} method or you want to
disable \idx{indexing} while working on a draft document.)

Naturally, if there's a particular reason why the class or package
insists on a specific \idx{indexing} method, for example, it's an
editorial requirement, then you will need to abide by that
decision.

This option may be passed in the standard document class option list
or passed using \gls{PassOptionsToPackage} before \sty{glossaries} is
loaded. Note that this does nothing if
\gls{makeglossaries} or \gls{makenoidxglossaries} has already 
been used whilst enabled.

\optiondef{restoremakegloss}
Cancels the effect of \opt{disablemakegloss}. This option may be used in
\gls{setupglossaries}. It issues a warning if \gls{makeglossaries} or
\gls{makenoidxglossaries} has already been used whilst enabled. 
Note that this option removes the check for \gls{nofiles}, as this
option is an indication that the output files are actually required.

For example, suppose the class \clsfmt{customclass.cls}
automatically loads \sty{glossaries} and does \gls{makeglossaries}
but you need an extra \idx{glossary}, which has to be defined before
\gls{makeglossaries}, then you can do:
\begin{codebox}
\cmd{documentclass}[\opt{disablemakegloss}]\marg{customclass}
\gls{newglossary*}\marg{functions}\marg{Functions}
\gls{setupglossaries}\marg{restoremakegloss}
\gls{makeglossaries}
\end{codebox}
or
\begin{codebox}
\gls{PassOptionsToPackage}\marg{\opt{disablemakegloss}}\marg{glossaries}
\cmd{documentclass}\marg{customclass}
\gls{newglossary*}\marg{functions}\marg{Functions}
\gls{setupglossaries}\marg{restoremakegloss}
\gls{makeglossaries}
\end{codebox}

Note that restoring these commands doesn't necessarily mean that they can be
used. It just means that their normal behaviour given the current
settings will apply. For example, if you use the \optval{record}{only}
or \optval{record}{nameref} options with \sty{glossaries-extra}
then you can't use \gls{makeglossaries} or \gls{makenoidxglossaries}
regardless of \opt{restoremakegloss}.

\section{Glossary Type Options}
\label{sec:pkgopts-type}

\optiondef{nohypertypes}
Use this option if you have multiple
\idxpl{glossary} and you want to suppress the entry \idxpl{hyperlink} for a
particular \idx{glossary} or \idxpl{glossary}. The value of this option should
be a comma-separated list of \idx{glossary} types where \gls{gls} etc
shouldn't have \idxpl{hyperlink} by default. Make sure you enclose the
value in braces if it contains any commas. Example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optvalm{nohypertypes}{\glostype{acronym},notation}]
  \marg{glossaries}
\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Notation}
\end{codebox}
As illustrated above, the \idx{glossary} doesn't need to exist when
you identify it in \opt{nohypertypes}.

\begin{important}
The values must be fully expanded, so \strong{don't} try, for
example, \optval{nohypertypes}{\gls{acronymtype}}.
\end{important}

You may also use:
\cmddef{GlsDeclareNoHyperList}
instead or additionally.
See \sectionref{sec:glslink} for further details.

\begin{xtr}
The \sty{glossaries-extra} package has the \catattr{nohyper}
\idx{categoryattribute} which will suppress the \idx+{hyperlink} for entries
with the given category, which can be used as an alternative to
suppressing the \idx{hyperlink} on a per-\idx{glossary} basis.
\end{xtr}

\optiondef{nomain}
This suppresses the creation of the \glostype+{main}
glossary and associated \ext{glo} file, if unrequired. Note that
if you use this option, you must create another \idx{glossary} in which to
put all your entries (either via the \opt{acronym} (or
\opt{acronyms}) package option described in
\sectionref{sec:pkgopts-acronym} or via the \opt{symbols},
\opt{numbers} or \opt{index} options described in
\sectionref{sec:pkgopts-other} or via \gls{newglossary} described in
\sectionref{sec:newglossary}). Even if you don't intend to display
the \idx{glossary}, a default \idx{glossary} is still required.

If you don't use the \glostype{main} glossary and you don't use this
option to suppress its creation, \app{makeglossaries} will produce a warning:
\begin{transcript}
Warning: File '\meta{filename}.glo' is empty.
Have you used any entries defined in glossary '\glostype{main}'?
Remember to use package option '\opt{nomain}' if 
you don't want to use the \glostype{main} glossary.
\end{transcript}
If you did actually want to use the \glostype{main} glossary and you see this
warning, check that you have referenced the entries in that \idx{glossary}
via commands such as \gls{gls}.

\optiondef{symbols}
This valueless option defines a new \idx{glossary} type with
the label \glostypedef{symbols} via
\begin{compactcodebox}
\gls{newglossary}\oarg{slg}\marg{\glostype{symbols}}\marg{sls}\marg{slo}\marg{\gls{glssymbolsgroupname}}
\end{compactcodebox}
It also defines
\cmddef{printsymbols}
which is a synonym for
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{symbols}},\meta{options}}
\end{compactcodebox}

If you use \option{noidx}, you need to use:
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{symbols}},\meta{options}}
\end{compactcodebox}
to display the list of symbols.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{symbols} glossary and don't intend
to use the \glostype{main} glossary.
\end{important}

\begin{xtr}
The \sty{glossaries-extra} package has a slightly modified
version of this option which additionally provides \gls{glsxtrnewsymbol}
as a convenient shortcut method for defining symbols. See the
\sty{glossaries-extra} manual for further details.
\end{xtr}

\optiondef{numbers}
This valueless option defines a new \idx{glossary} type with
the label \glostypedef{numbers} via
\begin{compactcodebox}
\gls{newglossary}\oarg{nlg}\marg{\glostype{numbers}}\marg{nls}\marg{nlo}\marg{\gls{glsnumbersgroupname}}
\end{compactcodebox}
It also defines
\cmddef{printnumbers}
which is a synonym for
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{numbers}},\meta{options}}
\end{compactcodebox}

If you use \option{noidx}, you need to use:
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{numbers}},\meta{options}}
\end{compactcodebox}
to display the list of numbers.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{numbers} glossary and don't intend
to use the \glostype{main} glossary.
\end{important}

\begin{xtr}
The \sty{glossaries-extra} package has a slightly modified
version of this option which additionally provides \gls{glsxtrnewnumber}
as a convenient shortcut method for defining numbers. See the
\sty{glossaries-extra} manual for further details.
\end{xtr}

\optiondef{index}
This valueless option defines a new \idx{glossary} type with
the label \glostypedef{index} via
\begin{compactcodebox}
\gls{newglossary}\oarg{ilg}\marg{\glostype{index}}\marg{ind}\marg{idx}\marg{\gls{indexname}}
\end{compactcodebox}
It also defines
\cmddef{newterm}
which is a synonym for
\begin{compactcodebox}
\gls{newglossaryentry}\margm{entry-label}\marg{\gloskeyval{type}{\glostype{index}},\gloskeyval{name}{entry-label},
\gloskeyval{description}{\gls{nopostdesc}},\meta{options}}
\end{compactcodebox}
and
\cmddef{printindex}
which is a synonym for
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{index}},\meta{options}}
\end{compactcodebox}

If you use \option{noidx}, you need to use:
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{index}},\meta{options}}
\end{compactcodebox}
to display this \idx{glossary}.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{index} glossary and don't intend to
use the \glostype{main} glossary. Note that you
can't mix this option with \gls{index}. Either use
\sty{glossaries} for the \idx{indexing} or use a~custom \idx{indexing}
package, such as \sty{makeidx}, \sty{imakeidx}.
(You can, of course, load one of those packages and 
load \sty{glossaries} without the \opt{index} package option.)
\end{important}

Since the index isn't designed for terms with descriptions, you
might also want to disable the \idxpl{hyperlink} for this \idx{glossary} using
the package option \optval{nohypertypes}{index} or the command
\begin{compactcodebox}
\gls{GlsDeclareNoHyperList}\marg{\glostype{index}}
\end{compactcodebox}
However, it can also be useful to link to the index in order to look
up the term's \idx{locationlist} to find other parts of the document
where it might be used. For example, this manual will have a
\idx{hyperlink} to the \hyperref[index]{index} for general terms, such as
\qt{\idx{tableofcontents}}, or general commands, such as
\gls{index}, that aren't defined anywhere in the document.

The example file \samplefile{-index} illustrates the use of the
\opt{index} package option.

\optiondef{noglossaryindex}
This valueless option switches off \opt{index} if \opt{index} has
been passed implicitly (for example, through global document
options). This option can't be used in \gls{setupglossaries}.

\section{Acronym and Abbreviation Options}
\label{sec:pkgopts-acronym}

\glsaddeach{idx.acronym,idx.abbreviation}%
\optiondef{acronym}
If true, this creates a new \idx{glossary} with the
label \glostypedef{acronym}. This is equivalent to:
\begin{compactcodebox}
\gls{newglossary}\oarg{alg}\marg{\glostype{acronym}}\marg{acr}\marg{acn}\marg{\gls{acronymname}}
\end{compactcodebox}
It will also provide (if not already defined)
\cmddef{printacronyms}
that's equivalent to
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\meta{options}}
\end{compactcodebox}

If you are using \option{noidx}, you need to use
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\meta{options}}
\end{compactcodebox}
to display the list of acronyms.

If the \opt{acronym} package option is used, \gls+{acronymtype} is
set to \glostype{acronym} otherwise it is set to
\gls{glsdefaulttype} (which is normally the \glostype{main}
glossary.) Entries that are defined using \gls{newacronym} are
placed in the \idx{glossary} whose label is given by \gls{acronymtype},
unless another \idx{glossary} is explicitly specified with the
\gloskey{type} key.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{acronym} glossary. (That is, you
don't intend to use the \glostype{main} glossary.)
\end{important}

\begin{xtr}
The \sty{glossaries-extra} extension package comes with an analogous
\opt{abbreviations} option, which creates a new \idx{glossary} with
the label \glostype{abbreviations} and sets the command
\gls{glsxtrabbrvtype} to this. If the \opt{acronym} option hasn't
also been used, then \gls{acronymtype} will be set to
\gls{glsxtrabbrvtype}. This enables both \gls{newacronym} and
\gls{newabbreviation} to use the same \idx{glossary}.

Make sure you have at least v1.42 of \sty{glossaries-extra} if you
use the \opt{acronym} (or \opt{acronyms}) package option with
the extension package to avoid a bug that interferes with the
\idx{abbrvstyle}.
\end{xtr}

\optiondef{acronyms}
This is equivalent to \optval{acronym}{true} and may be used in the
document class option list.

\optiondef{abbreviations}

This valueless option provided by \sty{glossaries-extra} creates a new 
\idx{glossary} type with the label 
\inlineglsdef[optdef]{opt.glostype.abbreviations} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{glg-abr}\marg{\glostype{abbreviations}}\marg{gls-abr}\marg{glo-abr}\marg{\gls{abbreviationsname}}
\end{compactcodebox}
The label can be accessed with \gls{glsxtrabbrvtype}, which is
analogous to \gls{acronymtype}. See \sty{glossaries-extra} manual for
further details.

\optiondef{acronymlists}
This option is used to identify the \idxpl{glossary} that contain
\idxpl{acronym} so that they can have their \idx{entryformat}
adjusted by \gls{setacronymstyle}. (It also enables \gls{forallacronyms} to 
work.)

By default, if the list is empty when \gls{setacronymstyle} is used
then it will automatically add \gls{acronymtype} to the list. 

If you have other lists of \idxpl{acronym}, you can specify them as
a comma-separated list in the value of \opt{acronymlists}. For
example, if you use the \opt{acronym} package option but you also
want the \glostype{main} glossary to also contain a list of
\idxpl{acronym}, you can do:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optval{acronymlists}{\glostype{main}}]\marg{glossaries}
\end{codebox}
No check is performed to determine if the listed \idxpl{glossary} exist,
so you can add \idxpl{glossary} you haven't defined yet. For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optvalm{acronymlists}{\glostype{main},acronym2}]
  \marg{glossaries}
\gls{newglossary}\oarg{alg2}\marg{acronym2}\marg{acr2}\marg{acn2}\comment{}
  \marg{Statistical Acronyms}
\end{codebox}
You can use
\cmddef{DeclareAcronymList}
instead of or in addition to the \opt{acronymlists} option.
This will add the \idxpl{glossary} given in \meta{list} to the list of 
\idxpl{glossary} that are identified as lists of \idxpl{acronym}. 
To replace the list of \idx{acronym} lists with a new list use:
\cmddef{SetAcronymLists}

If the list is changed after \gls{setacronymstyle}
then it will result in inconsistencies in the formatting. If this does
happen, and is for some reason unavoidable (such as
\gls{setacronymstyle} occurring in a package that loads
\sty{glossaries}), you will need to set the \idx{entryformat} to
match the style:
\begin{compactcodebox}
\gls{DeclareAcronymList}\margm{glossary-label}
\gls{defglsentryfmt}\oargm{glossary-label}\marg{\gls{GlsUseAcrEntryDispStyle}}\margm{style-name}
\end{compactcodebox}

You can determine if a \idx{glossary} has been identified as being a list
of \idxpl{acronym} using:
\cmddef{glsIfListOfAcronyms}

\begin{xtr}
This option and associated commands are incompatible with \sty{glossaries-extra}['s]
\idx{abbreviation} mechanism. Lists of \idxpl{abbreviation} don't need identifying.
\end{xtr}

\optiondef{shortcuts}
This option provides shortcut commands
for \idxpl{acronym}.  See \sectionref{sec:acronyms} for further details.
Alternatively you can use:
\cmddef{DefineAcronymSynonyms}

\begin{xtr}
The \sty{glossaries-extra} package provides additional shortcuts.
\end{xtr}

\section{Deprecated Acronym Style Options}
\label{sec:pkgopts-old-acronym}

The package options listed in this section were deprecated in
version 4.02 (2013-12-05) and have now been removed. You will need to use
rollback with them (see \sectionref{sec:rollback}). These options
started generating warnings in version 4.47 (2021-09-20) and as from
version 4.50 will now generate an error unless you use rollback.

If you want to change the \idx{acronymstyle}, use \gls{setacronymstyle}
instead. See \sectionref{sec:acronyms} for further details.

\optiondef{description}
This option changed the definition of \gls{newacronym} to allow a description.
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short-desc}}
\end{codebox}
or (with \opt{smallcaps})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short-desc}}
\end{codebox}
or (with \opt{smaller})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sm-short-desc}}
\end{codebox}
or (with \opt{footnote})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-desc}}
\end{codebox}
or (with \opt{footnote} and \opt{smallcaps})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}
or (with \opt{footnote} and \opt{smaller})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm-desc}}
\end{codebox}
or (with \opt{dua})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{dua-desc}}
\end{codebox}

\optiondef{smallcaps}
This option changed the definition of
\gls{newacronym} and the way that acronyms are displayed. 
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short-desc}}
\end{codebox}
or (with \opt{description} and \opt{footnote})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}

\optiondef{smaller}
This option changed the definition of
\gls{newacronym} and the way that acronyms are displayed.
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sm-short}}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sm-short-desc}}
\end{codebox}
or (with \opt{description} and \opt{footnote})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm-desc}}
\end{codebox}

\optiondef{footnote}
This option changed the definition of
\gls{newacronym} and the way that acronyms are displayed.
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote}}
\end{codebox}
or (with \opt{smallcaps})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc}}
\end{codebox}
or (with \opt{smaller})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm}}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-desc}}
\end{codebox}
or (with \opt{smallcaps} and \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}
or (with \opt{smaller} and \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm-desc}}
\end{codebox}

\optiondef{dua}
This option changed the definition of
\gls{newacronym} so that acronyms are always expanded. 
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{dua}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{dua-desc}}
\end{codebox}

\section{Other Options}
\label{sec:pkgopts-other}

Other available options that don't fit any of the above categories
are described below.

\optiondef{accsupp}

Only available with \sty{glossaries-extra}, this option
loads the \sty{glossaries-accsupp} package, which needs to be loaded
either before \sty{glossaries-extra} or while \sty{glossaries-extra}
is loaded to ensure both packages are properly integrated.

\optiondef{prefix}

Only available with \sty{glossaries-extra}, this option
loads the \sty{glossaries-prefix} package.

\optiondef{nomissingglstext}

This option may be used to suppress the boilerplate text generated
by \gls{printglossary} if the \idx{indexingfile} is missing.

\optiondef{mfirstuc}

The value may be either \optfmt{expanded} or \optfmt{unexpanded} and
performs the same function as \sty{mfirstuc}['s] \optfmt{expanded}
and \optfmt{unexpanded} package options. Note that there's no value
corresponding to \sty{mfirstuc}['s] other package option.

The default is \optval{mfirstuc}{unexpanded} to safeguard against
\idxpl{glossarystyle} that convert the description to
\idx{sentencecase}. With older versions of \sty{mfirstuc} 
(pre v2.08), fragile commands in the description would not have been
affected by the \idx{casechange}, but now, if the entire description is passed
to \gls{MFUsentencecase}, it will be expanded, which could break
existing documents.

\optiondef{compatible-2.07}

Compatibility mode for old documents created using version 2.07 or
below. This option is now only available with rollback (see
\sectionref{sec:rollback}).

\optiondef{compatible-3.07}
Compatibility mode for old documents created using version 3.07 or
below.  This option is now only available with rollback (see
\sectionref{sec:rollback}).

\optiondef{kernelglossredefs}
As a legacy from the precursor \sty{glossary} package, the standard
glossary commands provided by the \LaTeX\ kernel (\gls{makeglossary}
and \gls{cs.glossary}) are redefined in terms of the \sty{glossaries}
package's commands.  However, they were never documented in this
user manual, and the conversion guide (\qtdocref{Upgrading from the
\styfmt{glossary} package to the \styfmt{glossaries} package}{glossary2glossaries})
explicitly discourages their use.

The redefinitions of these commands was removed in v4.10,
but unfortunately it turned out that some packages had hacked
the internal commands provided by \sty{glossaries} and no longer
worked when they were removed, so they were restored in v4.41 with
this option to undo the effect with \optval{kernelglossredefs}{true}
as the default. As from v4.50, the default is now
\optval{kernelglossredefs}{false}.

\optionvaldef{kernelglossredefs}{false}
Don't redefine \gls{cs.glossary} and \gls{makeglossary}. If they have
been previously redefined by \opt{kernelglossredefs} their original
definitions (at the time \sty{glossaries} was loaded) will be
restored.

\optionvaldef{kernelglossredefs}{true}
Redefine \gls{cs.glossary} and \gls{makeglossary}, but their use will
trigger warnings.

\optionvaldef{kernelglossredefs}{nowarn}
Redefine \gls{cs.glossary} and \gls{makeglossary} without any warnings.

The only glossary-related commands provided by the \LaTeX\
kernel are \gls{makeglossary} and \gls{cs.glossary}. Other packages
or classes may provide additional glossary-related commands or
environments that conflict with \sty{glossaries} (such as
\gls{printglossary} and \env{theglossary}). These non-kernel commands
aren't affected by this package option, and you will have to find
some way to resolve the conflict if you require both glossary
mechanisms. (The \sty{glossaries} package will override the existing
definitions of \gls{printglossary} and \env{theglossary}.)

In general, if possible, it's best to stick with just one package that
provides a glossary mechanism. (The \sty{glossaries} package does
check for the \sty{doc} package and patches \gls{PrintChanges}.)

\section{Setting Options After the Package is Loaded}
\label{sec:setupglossaries}

Some of the options described above may also be set after the
\sty{glossaries} package has been loaded using
\cmddef{setupglossaries}
The following package options \strong{can't} be used in
\gls{setupglossaries}: \opt{xindy}, \opt{xindygloss},
\opt{xindynoglsnumbers}, \opt{makeindex},
\opt{nolong}, \opt{nosuper}, \opt{nolist},
\opt{notree}, \opt{nostyles}, \opt{nomain},
\opt{compatible-2.07}, \opt{translate}, \opt{notranslate}, 
\opt{languages}, \opt{acronym}. These options have to be set while the package is
loading, except for the \opt{xindy} sub-options which can be set
using commands like \gls{GlsSetXdyLanguage} (see
\sectionref{sec:xindy} for further details).

\begin{important}
If you need to use this command, use it as soon as
possible after loading \sty{glossaries} otherwise you might 
end up using it too late for the change to take effect. If you 
try changing the sort option after you have 
started to define entries, you may get unexpected results.
\end{important}

\begin{xtr}
With \sty{glossaries-extra}, use \gls{glossariesextrasetup}
instead.
\end{xtr}
\renewcommand{\cmddefbookmarkleveloffset}{1}

\chapter{Setting Up}
\label{sec:setup}

In the \idx+{documentpreamble} you need to indicate which method you want to use to
generate the \idx{glossary} (or \idxpl{glossary}). The available options with
both \sty{glossaries} and \sty{glossaries-extra} are
summarized in \sectionref{sec:indexingoptions}. This chapter
documents \options{noidx,mkidx,xdy}, which are provided by the base package. See the
\sty{glossaries-extra} and \app{bib2gls} manuals for the full
documentation of the other options.

If you don't need to display any \idxpl{glossary}, for example, if you are
just using the \sty{glossaries} package to enable consistent
formatting, then skip ahead to \sectionref{sec:newglosentry}.

\section{Option \glsfmttext{idx.opt.noidx}}
\label{sec:setupopt1}

The command
\cmddef{makenoidxglossaries}
must be placed in the \idxf{documentpreamble}. This sets up the internal commands
required to make \option{noidx} work.
\strong{If you omit \gls{makenoidxglossaries} none of
the \idxpl{glossary} will be displayed.}

\section{Options \glsfmttext{idx.opt.mkidx} and \glsfmttext{idx.opt.xdy}}
\label{sec:setupopt23}

The command
\cmddef{makeglossaries}
must be placed in the \idxf{documentpreamble} in order to create the customised
\app+{makeindex} (\ext+{ist}) or \app+{xindy} (\ext+{xdy})
style file (for \optionsor{mkidx,xdy}, respectively) and to ensure that 
\idx{glossary} entries are written to the appropriate output files. 
\strong{If you omit \gls{makeglossaries} none of
the \idxpl{indexingfile} will be created.}

\begin{xtr}
If you are using \sty{glossaries-extra}, \gls{makeglossaries} has an
optional argument that allows you to have a hybrid of \optionsor{noidx,mkidx} or
\optionsor{noidx,xdy}. See \sty{glossaries-extra} manual for further details.
\end{xtr}

\begin{important}
Note that some of the commands provided by the \sty{glossaries}
package must not be used after \gls{makeglossaries} as they are
required when creating the customised style file. If you attempt
to use those commands after \gls{makeglossaries} you will generate
an error.
Similarly, there are some commands that must not be used before
\gls{makeglossaries} because they require the associated
\idxpl{indexingfile} to be open, if those files should be created.
These may not necessarily generate an error or warning as a
different \idx{indexing} option may be chosen that doesn't require
those files (such as \optionsor{unsrt,standalone}).
\end{important}

The \gls{makeglossaries} command internally uses:
\cmddef{writeist}
to create the custom \app{makeindex}\slash\app{xindy} style file.
This command disables itself by setting itself to \gls{relax} so
that it can only be used once. In general, there should be no reason 
to use or alter this command.

The default name for the customised style file is given by
\code{\gls{jobname}.\ext+{ist}} (\option{mkidx}) or 
\code{\gls{jobname}.\ext+{xdy}} (\option{xdy}). This name may be
changed using:
\cmddef{setStyleFile}
where \meta{name} is the name of the style file without the 
extension.

\plabel{sec:isthook}%
There is a hook near the end of \gls{writeist} that can be set with:
\cmddef{GlsSetWriteIstHook}
The \meta{code} will be performed while the style file is still
open, which allows additional content to be added to it. 
The associated write register is:
\cmddef{glswrite}
Note that this register is defined by \gls{writeist} to prevent an
unnecessary write register from being created in the event that neither \app{makeindex}
nor \app{xindy} is required.

If you use the \gls{GlsSetWriteIstHook} hook to write extra
information to the style file, make sure you use the appropriate
syntax for the desired \idx{indexingapp}. For example, with
\app{makeindex}:
\begin{codebox*}
\gls{GlsSetWriteIstHook}\marg{\comment{}
 \gls{write}\gls{glswrite}\marg{page\_precedence "arnAR"}\comment{}
 \gls{write}\gls{glswrite}\marg{line\_max 80}\comment{}
}
\end{codebox*}
This changes the \idx{pageprecedence} and the maximum line length
used by \app{makeindex}.

Remember that if you switch to \app{xindy}, this will no longer be
valid code.

You can suppress the creation of the customised \app{xindy}
or \app{makeindex} style file using:
\cmddef{noist}
This is provided in the event that you want to supply your own
customized style file that can't be replicated with the available
options and commands provided by the \sty{glossaries} package.
This command sets \gls{writeist} to \gls{relax} (making it do
nothing) but will also update the \app{xindy} 
\idxc{xindyattr}{attribute list} if applicable.

If you have a custom \ext{xdy} file created when using 
\sty{glossaries} version 2.07 (2010-0710) or below, you will need to use
rollback and the \opt{compatible-2.07} package option with it.
However, that is now so dated and the \LaTeX\ kernel has changed
significantly since that time that you may need to use a legacy
distribution (see
\blog{legacy-documents-and-tex-live-docker-images}{Legacy Documents
and TeX Live Docker Images}).

Each \idx{glossaryentry} is assigned a \idx{numberlist} that lists all 
the \locations\ in the document where that \idx{entry} was used. By default,
the \location\ refers to the page number but this may be overridden
using the \opt{counter} package option. The default form of
the \location\ number assumes a full stop \idx{compositor} (for example, 1.2),
but if your \location\ numbers use a different \idx{compositor} (for
example, 1-2) you need to set this using
\cmddef{glsSetCompositor}\marg{symbol}
For example:
\begin{codebox}
\gls{glsSetCompositor}\marg{-}
\end{codebox}
This command must not be used after \gls{makeglossaries}. Note that
with \app{makeindex}, any \locations\ with the wrong \idx{compositor} 
(or one that hasn't been correctly identified with
\gls{glsSetCompositor}) will cause \app{makeindex} to reject the
\location\ with an invalid number\slash digit message. As from
v4.50, \app{makeglossaries} will check for this message and attempt
a correction, but this can result in an incorrectly formatted
\location\ in the \idx{numberlist}. See the information about
\app{makeglossaries}['s] \mkglsopt{e} switch
in \sectionref{sec:makeglossariesapp} for further details.

An invalid page number will also cause \app{xindy} to fail with a
\qt{did not match any location-class} warning. This is also
something that \app{makeglossaries} will check for and will provided
diagnostic information, but it won't attempt to make any correction.

If you use \option{xdy}, you can have a different \idx{compositor} for page
numbers starting with an upper case alphabetical character using:
\cmddef{glsSetAlphaCompositor}
This command is only available with \app{xindy}. For example, if you want 
\idxpl{numberlist} containing a mixture of A-1 and 2.3 style
formats, then do:
\begin{codebox}
\gls{glsSetCompositor}\marg{.}\gls{glsSetAlphaCompositor}\marg{-}
\end{codebox}
See \sectionref{sec:numberlists} for further information about
\idxpl{numberlist}.

\chapter{Defining Glossary Entries}
\label{sec:newglosentry}

\begin{bib2gls}
If you want to use \app{bib2gls}, entries must be defined in
\ext{bib} files using the syntax described in the \app{bib2gls}
user manual.
\end{bib2gls}

\Idxpl{acronym} are covered in \sectionref{sec:acronyms} but they use the
same underlying mechanism as all the other \idxpl{glossaryentry}, so it's a good
idea to read this chapter first. The keys provided for
\gls{newglossaryentry} can also be used in the optional argument of
\gls{newacronym}, although some of them, such as \gloskey{first} and
\gloskey{plural}, interfere with the \idxpl{acronymstyle}.

All \idxpl{glossaryentry} must be defined before they are used, so it is
better to define them in the \idxf{documentpreamble} to ensure this. In fact, some
commands such as \gls{longnewglossaryentry}
may only be used in the \idx{documentpreamble}. See \sectionref{sec:docdefs} for
a discussion of the problems with defining \idxpl{entry} within the
document instead of in the \idx{documentpreamble}. (The \sty{glossaries-extra}
package has an option that provides a restricted form of document 
definitions that avoids some of the issues discussed in 
\sectionref{sec:docdefs}.)
\begin{important}
\option{noidx} enforces the \idx+{documentpreamble}-only restriction on
\gls{newglossaryentry}. \option{b2g} requires that definitions are provided
in \ext{bib} format. \options{unsrt,standalone} work best with either 
\idx{documentpreamble}-only
definitions or the use of the \sty{glossaries-extra} package option
\optval{docdef}{restricted}.
\end{important}

Bear in mind that with \optval{docdef}{restricted}, the
\idxpl{entry} must be defined before any \idxpl{entry} are used, 
including when they are displayed in the \idx{glossary} (for example, with
\gls{printunsrtglossary}) or where they appear in the
\idx+{tableofcontents} or list of floats. This is essentially the
same problem as defining a robust command mid-document and using it
in a section title or caption.

Only those \idxpl{entry} that are \indexed\ in the document 
(using any of the commands described in
\sectionref{sec:glslink}, \sectionref{sec:glsadd} or
\sectionref{sec:crossref}) will appear in the \idx{glossary}. See
\sectionref{sec:printglossary} to find out how to display the
\idx{glossary}.

New \idxpl+{glossaryentry} are defined using the command:
\cmddef{newglossaryentry}
This is a short command, so values in \keyvallist\ can't
contain any paragraph breaks. Take care to enclose values containing
any commas (\sym{comma}) or equal signs (\sym{equals}) with braces to hide them
from the \keyval\ list parser.

If you have a long description that
needs to span multiple paragraphs, use the following instead:
\cmddef{longnewglossaryentry}
Note that this command may only be used in the
\idx+{documentpreamble} (regardless of \opt{docdef}).

\begin{warning}
Be careful of unwanted spaces.
\end{warning}

\gls{longnewglossaryentry} will remove trailing spaces in the
description (via \gls{unskip}) but won't remove leading spaces. This
command also appends \gls{nopostdesc} to the end of the description,
which suppresses the post-description hook (since the terminating
punctuation is more likely to be included in a multi-paragraph
description).  The \sty{glossaries-extra} package provides a starred
version of \gls{longnewglossaryentry} that doesn't append either
\gls{unskip} or \gls{nopostdesc}.

There are also commands that will only define the \idx{entry} if it
hasn't already been defined:
\cmddef{provideglossaryentry}
and
\cmddef{longprovideglossaryentry}
(These are both \idx+{documentpreamble}-only commands.)

For all the above commands, the first argument, \meta{entry-label}, must be 
a~unique label with which to identify this \idx{entry}. \strong{This can't contain
any non-expandable or fragile commands.} The reason for
this restriction is that the label is used to construct internal commands
that store the associated information (similarly to commands
like \gls{label}) and therefore must be able to expand to a valid
control sequence name. With modern \LaTeX\ kernels, you should now
be able to use \idx{utf8} characters in the label.

\begin{important}
Be careful of \sty{babel}['s] options that change certain
punctuation characters, such as colon (\sym{colon}) or double-quote
(\sym{dblquote}), to active characters.
\end{important}

The second argument, \keyvallist, is
a \keyval\ list that supplies the relevant
information about this entry. There are two required fields:
\gloskey{description} and either \gloskey{name} or \gloskey{parent}.
The description is set in the third argument of
\gls{longnewglossaryentry} and \gls{longprovideglossaryentry}. With
the other commands it's set via the \gloskey{description} key.

As is typical with \keyval\ lists, values that contain 
a comma (\sym{comma}) or equal sign (\sym{equals}) must be 
enclosed in braces. Available fields
are listed below. Additional fields are provided by the
supplementary packages \sty{glossaries-prefix}
(\sectionref{sec:prefix}) and \sty{glossaries-accsupp}
(\sectionref{sec:accsupp}) and also by \sty{glossaries-extra}.
You can also define your own custom keys (see
\sectionref{sec:addkey}).

\optiondef{gloskey.name}
The name of the \idx{entry} (as it will appear in 
the \idx+{glossary}). If this key is omitted and the \gloskey{parent}
key is supplied, this value will be the same as the parent's name.

\begin{important}
If the \gloskey{name} key contains any commands, you must also
use the \gloskey{sort} key (described below) if you intend sorting
the \idxpl{entry} alphabetically with \optionsor{noidx,mkidx,xdy}, 
otherwise the entries can't be sorted correctly.
\end{important}

\optiondef{gloskey.description}
A brief description of this term (to appear in the \idx+{glossary}). 
Within this value, you can use:
\cmddef*{nopostdesc}
to suppress the description terminator for this entry. For example, if this
entry is a parent entry that doesn't require a description, you
can do \gloskeyval{description}{\gls{nopostdesc}}. If you want a paragraph
break in the description use:
\cmddef*{glspar}
or, better, use \gls{longnewglossaryentry}.
However, note that not all \idxpl{glossarystyle} support multi-line
descriptions. If you are using one of the tabular-like 
\idxpl{glossarystyle} that permit multi-line descriptions and you
really need an explicit line break, use \gls{newline} not \gls{cs.bsl}
(but in general, avoid \gls{cs.bsl} outside of tabular contexts anyway
and use a ragged \idxc{glossary}{style} if you are having problems
with line breaks in a narrow column).

\begin{xtr}
With \sty{glossaries-extra}, use \gls{glsxtrnopostpunc} instead of
\gls{nopostdesc} to suppress the post-description punctuation.
\end{xtr}

\optiondef{gloskey.parent}
This key establishes the \idx{entry}['s] \idx+{hierarchicallevel}.
The value must be the \emph{label} of the parent \idx{entry} 
(not the \gloskey{name}, although they may be the same). 
The \meta{parent-label} value must match the
\meta{entry-label} used when the parent \idx{entry} was defined.
See \sectionref{sec:subentries} for further details.

\begin{important}
The parent \idx{entry} must be defined before it's referenced in
the \gloskey{parent} key of another \idx{entry}.
\end{important}

\optiondef{gloskey.descriptionplural}
The plural form of the description, if required. If omitted, the
value is set to the same as the \gloskey{description} key.

\optiondef{gloskey.text}
How this entry will appear in the document text
when using \gls+{gls} on \idx+{subsequentuse}. If this
field is omitted, the value of the \gloskey{name} key is used.

This key is automatically set by \gls{newacronym}. Although it is
possible to override it by using \gloskey{text} in the optional
argument of \gls{newacronym}, it will interfere with the 
\idx{acronymstyle} and cause unexpected results.

\optiondef{gloskey.first}
How the \idx{entry} will appear in the document text on \idx+{firstuse}
with \gls+{gls}. If this field is omitted, the value of the
\gloskey{text} key is used. Note that if you use \gls{glspl},
\gls{Glspl}, \gls{GLSpl}, \gls{glsdisp} before using \gls{gls}, the
\gloskey{first} value won't be used with \gls{gls}.

You may prefer to use \idxpl{acronym} (\sectionref{sec:acronyms}) or the
\idxpl{abbreviation} or the category post-link hook (\gls{glsdefpostlink}) provided by
\sty{glossaries-extra} if you would like to automatically append
content on \idx{firstuse} in a consistent manner. See, for example,
\gallerypage{sample-units}{Gallery: Units (\styfmt{glossaries-extra.sty})}.

Although it is possible to use \gloskey{first} in the optional
argument of \gls{newacronym}, it can interfere with the 
\idx{acronymstyle} and cause unexpected results.

\optiondef{gloskey.plural}
How the entry will appear in the document text
when using \gls+{glspl} on \idx{subsequentuse}.  If this
field is omitted, the value is obtained by appending
\gls{glspluralsuffix} to the value of the \gloskey{text} field.

Although it is possible to use \gloskey{plural} in the optional
argument of \gls{newacronym}, it can interfere with the 
\idx{acronymstyle} and cause unexpected results. Use \gloskey{shortplural}
instead, if the default value is inappropriate.

\optiondef{gloskey.firstplural}
How the \idx{entry} will appear in the
document text on \idx+{firstuse} with \gls{glspl}. 
If this field is omitted, the value is obtained
from the \gloskey{plural} key, if the \gloskey{first} key is omitted,
or by appending \gls{glspluralsuffix} to the value of the
\gloskey{first} field, if the \gloskey{first} field is present. Note
that if you use \gls{gls}, \gls{Gls}, \gls{GLS}, \gls{glsdisp} before
using \gls{glspl}, the \gloskey{firstplural} value won't be used
with \gls{glspl}.

Although it is possible to use \gloskey{firstplural} in the optional
argument of \gls{newacronym}, it can interfere with the 
\idx{acronymstyle} and cause unexpected results. Use \gloskey{shortplural}
and \gloskey{longplural} instead, if the default value is inappropriate.

\begin{information}
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.
\end{information}

\optiondef{gloskey.symbol}
This field is provided to allow the user
to specify an associated symbol. If omitted, the value is set to
\gls{relax}. Note that not all \idxpl{glossarystyle} display the symbol.

\optiondef{gloskey.symbolplural}
This is the plural form of the symbol. If omitted, the value 
is set to the same as the \gloskey{symbol} key.

\optiondef{gloskey.sort}
This value indicates the text to be used by the sort comparator when
ordering all the \idxpl{glossaryentry}.  If omitted, the value is given by the
\gloskey{name} field unless one of the package options
\opteqvalref{sort}{def} and \opteqvalref{sort}{use} have been
used.  With \option{mkidx} it's best to use the \gloskey{sort} key
if the \gloskey{name} contains commands (for example,
\code{\gls{ensuremath}\marg{\cmd{alpha}}}) and with
\options{mkidx,xdy}, it's strongly recommended as the \idx{indexing}
may fail if you don't (see below).

You can also override the \gloskey{sort} key by redefining
\gls{glsprestandardsort} (see \sectionref{sec:pkgopts-sort}).

\begin{bib2gls}
The \gloskey{sort} key shouldn't be used with \app{bib2gls}. It has
a system of fallbacks that allow different types of \idxpl{entry} to
obtain the sort value from the most relevant field. See the
\app{bib2gls} manual for further details, and see also
\bibglsgallery{sorting}.
\end{bib2gls}

\option{noidx} by default strips the \glslink{latexexlatinchar}{standard
\LaTeX\ accents} (that is, accents generated by core \LaTeX\ commands) from the
\gloskey{name} key when it sets the \gloskey{sort} key. So with
\option{noidx}:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{
  \gloskeyval{name}{\gls{cs.apos}elite},
  \gloskeyval{description}{select group of people}
}
\end{codebox}
This is equivalent to:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{
  \gloskeyval{name}{\gls{cs.apos}elite},
  \gloskeyval{description}{select group of people}
  \gloskeyval{sort}{elite}
}
\end{codebox}
Unless you use the package option \optval{sanitizesort}{true}, in
which case it's equivalent to:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{
  \gloskeyval{name}{\gls{cs.apos}elite},
  \gloskeyval{description}{select group of people}
  \gloskeyval{sort}{\sym{bksl}\sym+{apos}elite},
}
\end{codebox}
This will place the \idx{entry} before the \qt{A} \idx{lettergroup} since the
sort value starts with a symbol (a literal backslash \sym{bksl}).
Note that \option{noidx} shouldn't be used with \idx{utf8}
characters. With old \LaTeX\ kernels, it was able to convert a
\idx{utf8} character, such as \code{\'e}, to an \idx{ascii}
equivalent but this is no longer possible.

With \options{mkidx,xdy}, the default value of \gloskey{sort} will either be
set to the \gloskey{name} key (if \optval{sanitizesort}{true}) or it
will set it to the expansion of the \gloskey{name} key (if
\optval{sanitizesort}{false}).

\begin{important}
Take care with \app{xindy} (\option{xdy}): if you have \idxpl{entry} with the same
\gloskey{sort} value they will be treated as the
same entry. If you use \app{xindy} and aren't using the
\optvalref{sort}{def}
or \optvalref{sort}{use} sort methods, \strong{always} use the \gloskey{sort}
key for entries where the name just consists of commands
(for example \gloskeyval{name}{\csfmt{alpha}}).

Take care if you use \option{noidx} and the \gloskey{name} contains fragile
commands. You will either need to explicitly set the \gloskey{sort}
key or use the \optval{sanitizesort}{true} package option (unless
you use the \optvalref{sort}{def} or \optvalref{sort}{use} sort methods).
\end{important}

\optiondef{gloskey.type}
This specifies the label of the \idx{glossary} in which this entry
belongs. If omitted, the default \idx{glossary} identified by
\gls{glsdefaulttype} is assumed unless \gls{newacronym} is used (see
\sectionref{sec:acronyms}).

Six keys are provided for any additional information the user may want
to specify.  (For example, an associated dimension or an alternative
plural or some other grammatical construct.) Alternatively, you can
add new keys using \gls{glsaddkey} or \gls{glsaddstoragekey} 
(see \sectionref{sec:addkey}).

\optiondef{gloskey.user1}
The first user key.

\optiondef{gloskey.user2}
The second user key.

\optiondef{gloskey.user3}
The third user key.

\optiondef{gloskey.user4}
The fourth user key.

\optiondef{gloskey.user5}
The fifth user key.

\optiondef{gloskey.user6}
The sixth user key.

\optiondef{gloskey.nonumberlist}
If the value is missing or is \optfmt{true}, this will suppress 
the \idx+{numberlist} just for
this \idx{entry}. Conversely, if you have used the package option
\optval{nonumberlist}{true}, you can activate the \idx{numberlist} just
for this entry with \gloskeyval{nonumberlist}{false}.
(See \sectionref{sec:numberlists}.)

This key works by adding \gls{glsnonextpages}
(\gloskeyval{nonumberlist}{true}) or \gls{glsnextpages}
(\gloskeyval{nonumberlist}{false}) to the \idx{indexing} information
for \options{mkidx,xdy}. Note that this means that if the entry is
added to the \idx{glossary} simply because it has an \indexed\
descendent (and has not been \indexed\ itself) then the first
\indexed\ sub-entry that follows will have its \idx{numberlist} suppressed
instead.

With \option{noidx}, this key saves the appropriate command in the
\glosfield{prenumberlist} internal field, which is used by
\gls{glsnoidxprenumberlist}.

\optiondef{gloskey.see}
This key essentially provides a convenient shortcut that performs
\begin{compactcodebox*}
\gls{glssee}\oargm{tag}\margm{entry-label}\margm{xr-list}
\end{compactcodebox*}
after the \idx{entry} has been defined. (See \sectionref{sec:crossref}.) 
It was originally designed for synonyms that may not occur in the
document text but needed to be included in the \idx{glossary} in order to
redirect the reader. Note that it doesn't \idxc{indexing}{index} the cross-referenced
\idx{entry} (or \idxpl{entry}) as that would interfere with their \idxpl{numberlist}.

\begin{important}
Using the \gloskey{see} key will \emph{automatically add this \idx{entry}
to the \idx{glossary}}, but will not automatically add the
cross-referenced \idx{entry}.
\end{important}

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{courgette}\marg{\gloskeyval{name}{courgette},
  \gloskeyval{description}{variety of small marrow}}
\gls{newglossaryentry}\marg{zucchini}\marg{\gloskeyval{name}{zucchini},
  \gloskeyval{description}{(North American)},
  \gloskeyval{see}{courgette}}
\end{codebox}
This defines two entries (courgette and zucchini) and automatically
adds a cross-reference from zucchini to courgette. (That is, it adds
\qt{\emph{see} courgette} to zucchini's \idx{numberlist}.) This
doesn't automatically \idxc{indexing}{index} courgette since this would create an
unwanted \location\ in courgette's \idx{numberlist}. (Page~1, if the
definitions occur in the \idx{documentpreamble}.)

Note that while it's possible to put the cross-reference in the
description instead, for example:
\begin{codebox}
\gls{newglossaryentry}\marg{zucchini}\marg{\gloskeyval{name}{zucchini},
  \gloskeyval{description}{(North American) see \gls{gls}\marg{courgette}}}
\end{codebox}
this won't \idxc{indexing}{index} the zucchini entry, so if zucchini
isn't \indexed\ elsewhere (with commands like \gls{gls} or \gls{glsadd}) then it won't
appear in the \idx{glossary} even if courgette does.

The referenced \idx{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
\gloskeyval{see}{[see also]\marg{anotherlabel}}.

\begin{warning}
If you have suppressed the \idx+{numberlist}, the cross-referencing
information won't appear in the \idx{glossary}, as it forms part of
the \idx{numberlist}.
\end{warning}

You can override this for individual \idxpl{glossaryentry} using
\gloskeyval{nonumberlist}{false}.  Alternatively, you can use the
\opt{seeautonumberlist} package option.  For further details, see
\sectionref{sec:crossref}.

\begin{important}
For \options{mkidx,xdy}, \gls{makeglossaries} must be used before any occurrence of
\gls{newglossaryentry} that contains the \gloskey{see} key.
\end{important}

Since it's useful to suppress the \idx{indexing} while working on a draft
document, consider using the \opt{seenoindex} package option to
warn about or ignore the \gloskey{see} key while \gls{makeglossaries} is
commented out.

If you use the \gloskey{see} key, you may want to consider using the
\sty{glossaries-extra} package which additionally
provides a \gloskey+{seealso} and \gloskey+{alias} key. If you want to
avoid the automatic \idx{indexing} triggered by the \gloskey{see} key,
consider using \option{b2g}. See also the FAQ item 
\faqitem{whyseekeyautoindex}{Why does the see key automatically index the entry?}

\begin{bib2gls}
The analogous \app{bib2gls} \gloskey{see}, \gloskey{seealso} and
\gloskey{alias} fields have a slightly different meaning. The
\resourceopt{selection} resource option determines the behaviour.
\end{bib2gls}

\optiondef{gloskey.seealso}
This key is only available with \sty{glossaries-extra} and is
similar to \gloskey{see} but it doesn't allow for the optional tag.
The \sty{glossaries-extra} package provides \gls{seealsoname} and
\gloskeyval{seealso}{xr-list} is essentially like
\gloskeyval{see}{[\gls{seealsoname}]\meta{xr-list}}
(\options{xdy,b2g} may treat these differently).

\optiondef{gloskey.alias}
This key is only available with \sty{glossaries-extra} and is
another form of cross-referencing.  An entry can be aliased to
another entry with \gloskeyval{alias}{other-label}. This behaves like
\gloskeyval{see}{other-label} but also alters the behaviour of commands
like \gls{gls} so that they \idxc{indexing}{index} the \idx{entry} 
given by \meta{label} instead of the original \idx{entry}. (See, for example,
\gallerypage{aliases}{Gallery: Aliases}.)

\begin{bib2gls}
More variations with the \gloskey{alias} key are available with \app{bib2gls}.
\end{bib2gls}

\optiondef{gloskey.counter}
This key will set the default \idx{locationcounter} for the given
\idx{entry}. This will override the \idxc{locationcounter}{counter}
assigned to the entry's \idx{glossary} in the final optional
argument of \gls{newglossary} (if provided) and the counter
identified by the \opt{counter} package option. The
\idx{locationcounter} can be overridden by the \glsopt{counter}
option when using the \gls{glslike} and \gls{glstextlike} commands.

\optiondef{gloskey.category}
This key is only available with \sty{glossaries-extra} and is used
to assign a category to the \idx{entry}. The value should be a label that
can be used to identify the category. See
\sty{glossaries-extra} manual for further details.

The following keys are reserved for \gls{newacronym} (see
\sectionref{sec:acronyms}) and also for \gls{newabbreviation} (see the
\sty{glossaries-extra} manual): \inlineglsdef[optdef]{opt.gloskey.long}, 
\inlineglsdef[optdef]{opt.gloskey.longplural},
\inlineglsdef[optdef]{opt.gloskey.short} and
\inlineglsdef[optdef]{opt.gloskey.shortplural}.
You can use \gloskey{longplural} and \gloskey{shortplural} in the
optional argument of \gls{newacronym} (or \gls{newabbreviation}) to
override the defaults, but don't explicitly use the \gloskey{long}
or \gloskey{short} keys as that may interfere with
\idx{acronymstyle} (or \idx{abbrvstyle}).

\begin{bib2gls}
There are also special internal field names used by \app{bib2gls}.
See the \app{bib2gls} manual for further details.
\end{bib2gls}

The supplementary packages \sty{glossaries-prefix} (\sectionref{sec:prefix}) and
\sty{glossaries-accsupp} (\sectionref{sec:accsupp}) provide additional keys.

\begin{important}
Avoid using any of the \gls{glslike} or \gls{glstextlike} commands within
the \gloskey{text}, \gloskey{first}, \gloskey{short} or
\gloskey{long} keys (or their plural equivalent) or any
other key that you plan to access through those commands.
(For example, the \gloskey{symbol} key if you intend to use
\gls{glssymbol}.) Otherwise you can up with nested links, which
can cause complications. You can use them within the value of keys 
that won't be accessed through those commands. For example,
the \gloskey{description} key if you don't use \gls{glsdesc}.
Additionally, they'll confuse the formatting placeholder commands, such as
\gls{glslabel}. The \sty{glossaries-extra} package provides
\gls{glsxtrp} for this type of situation.
\end{important}

With older \LaTeX\ kernels and pre-2.08 versions of \sty{mfirstuc}, 
if the name starts with \idx{nonlatinchar}, you need to group the character, 
otherwise it will cause a problem for commands like \gls{Gls} and \gls{Glspl}. 
For example:
\begin{codebox}
\comment{\sty{mfirstuc} v2.07}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\marg{\gls{cs.apos}e}lite},
\gloskeyval{description}{select group or class}}
\end{codebox}
Note that the same applies with \sty{inputenc}:
\begin{codebox}
\comment{\sty{mfirstuc} v2.07}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\marg{\'e}lite},
\gloskeyval{description}{select group or class}}
\end{codebox}
This doesn't apply for \XeLaTeX\ or \LuaLaTeX\ documents or with
\sty{mfirstuc} v2.08+.
\begin{codebox}
\comment{\sty{mfirstuc} v2.08}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\'elite},
\gloskeyval{description}{select group or class}}
\end{codebox}
See the \sty{mfirstuc} manual for further details.

Note that in the above \idx{utf8} examples, you will also need to
supply the \gloskey{sort} key if you are using \optionsor{noidx,mkidx}
whereas \app{xindy} (\option{xdy}) is usually able to sort
\idxpl{nonlatinchar} correctly.

\section{Plurals}
\label{sec:plurals}

You may have noticed from above that you can specify the plural form
when you define an \idx{entry}. If you omit this, the plural will be 
obtained by appending: 
\cmddef{glspluralsuffix}
to the singular form.  
This command may expand when the \idx{entry} is defined, if expansion is
on for the relevant keys, or may not expand until the \idx{entry} is
referenced, if expansion is off or if the suffix has been hidden
inside non-expanding context (which can happen when defining
\idxpl{acronym} or \idxpl{abbreviation}).

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},\gloskeyval{description}{a fully grown
female of any bovine animal}}
\end{codebox}
defines a new \idx{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{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},\gloskeyval{plural}{kine},
\gloskeyval{description}{a fully grown female of any bovine animal}}
\end{codebox}

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{codebox}
\gls{newglossaryentry}\marg{cow}\marg{
  \gloskeyval{name}{cow},
  \gloskeyval{description}{a fully grown female of any bovine animal 
               (plural cows, archaic plural kine)},
  \gloskeyval{user1}{kine}}
\end{codebox}
You can then use \code{\gls{glspl}\marg{cow}} to produce \qt{cows} and 
\code{\gls{glsuseri}\marg{cow}} to produce \qt{kine}. You can, of course,
define an easy to remember synonym. For example:
\begin{codebox}
\cmd{let}\cmd{glsaltpl}\gls{glsuseri}
\end{codebox}
Then you don't have to remember which key you used to store the
second plural. (Be careful with using \csfmt{let} as it doesn't
check if the command already exists.)

Alternatively, you can define your own keys using
\gls{glsaddkey}, described in \sectionref{sec:addkey} (or simply use
\gls{glsdisp} or \gls{glslink} with the appropriate text).

If you are using a language that usually forms plurals
by appending a different letter, or sequence of letters, you can
redefine \gls{glspluralsuffix} as required. However, this must be
done \emph{before} the entries are defined and is unreliable for
multilingual documents. 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). 

\section{Other Grammatical Constructs}
\label{sec:grammar}

You can use the six user keys to provide alternatives, such as
participles. For example:
\begin{codebox}
\cmd{let}\cmd{glsing}\gls{glsuseri}
\cmd{let}\cmd{glsd}\gls{glsuserii}
\codepar
\cmd{newcommand}*\marg{\cmd{ingkey}}\marg{\gloskey{user1}}
\cmd{newcommand}*\marg{\cmd{edkey}}\marg{\gloskey{user2}}
\codepar
\cmd{newcommand}*\marg{\cmd{newword}}[3][]\marg{\comment{}
  \gls{newglossaryentry}\marg{\#2}\marg{\comment{}
   \gloskeyval{name}{\#2},\comment{}
   \gloskeyval{description}{\#3},\comment{}
   \cmd{edkey}=\marg{\#2ed},\comment{}
   \cmd{ingkey}=\marg{\#2ing},\#1\comment{}
  }%
}
\end{codebox}
With the above definitions, I can now define terms like this:
\begin{codebox}
\cmd{newword}\marg{play}\marg{to take part in activities for enjoyment}
\cmd{newword}[\cmd{edkey}=\marg{ran},\cmd{ingkey}=\marg{running}]\marg{run}\marg{to move fast using 
the legs}
\end{codebox}
and use them in the text:
\begin{codebox}
Peter is \cmd{glsing}\marg{play} in the park today.
\codepar
Jane \cmd{glsd}\marg{play} in the park yesterday.
\codepar
Peter and Jane \cmd{glsd}\marg{run} in the park last week.
\end{codebox}

Alternatively, you can define your own keys using
\gls{glsaddkey}, described below in \sectionref{sec:addkey}.
It may, however, be simpler just to use \gls{glslink} or
\gls{glsdisp} with the appropriate \idx{linktext}.

\section{Additional Keys}
\label{sec:addkey}

You can define your own custom keys using the
commands described in this section. There are two types of keys:
those for use within the document and those to store information
used behind the scenes by other commands.

For example, if you want to add a key that indicates the associated
unit for a~term, you might want to reference this unit in your
document. In this case use \gls{glsaddkey} described in 
\sectionref{sec:glsaddkey}. If, on the other hand, you want to add a
key to indicate to a \idx{glossarystyle} or \idx{acronymstyle} that
this \idx{entry} should be formatted differently to other
\idxpl{entry}, then you can use \gls{glsaddstoragekey} described in
\sectionref{sec:glsaddstoragekey}.

In both cases, a new command \meta{no link cs} will be defined that
can be used to access the value of this key (analogous to commands
such as \gls{glsentrytext}). This can be used in an expandable
context (provided any fragile commands stored in the key have been
protected). The new keys must be added using \gls{glsaddkey} or
\gls{glsaddstoragekey} before \idxpl{glossaryentry} are defined.

\subsection{Document Keys}
\label{sec:glsaddkey}

A custom key that can be used in the document is defined using:
\cmddef{glsaddkey}
where the arguments are as follows:
\begin{description}
\item[\meta{key}] is the new key to use in \gls{newglossaryentry}
(or similar commands such as \gls{longnewglossaryentry});
\item[\meta{default value}] is the default value to use if this key
isn't used in an entry definition (this may reference the current
entry label via \gls{glslabel}, but you will have to switch on
expansion via the starred version of \gls{glsaddkey} and protect
fragile commands);
\item[\meta{no link cs}] is the control sequence to use analogous
to commands like \gls{glsentrytext};
\item[\meta{no link ucfirst cs}] is the control sequence to use analogous
to commands like \gls{Glsentrytext};
\item[\meta{link cs}] is the control sequence to use analogous
to commands like \gls{glstext};
\item[\meta{link ucfirst cs}] is the control sequence to use analogous
to commands like \gls{Glstext};
\item[\meta{link allcaps cs}] is the control sequence to use analogous
to commands like \gls{GLStext}.
\end{description}
The starred version of \gls{glsaddkey} switches on expansion for this
key. The unstarred version doesn't override the current expansion
setting.

\begin{example}{Defining Custom Keys}{ex:addkey}
Suppose I want to define two new keys, \optfmt{ed} and \optfmt{ing},
that default to the entry text followed by \qt{ed} and \qt{ing},
respectively. The default value will need expanding in both cases, so 
I need to use the starred form:
\begin{codebox}
\comment{Define "ed" key:}
 \gls{glsaddkey}*
  \marg{ed}\comment{key}
  \marg{\gls{glsentrytext}\marg{\gls{glslabel}}ed}\comment{default value}
  \marg{\cmd{glsentryed}}\comment{command analogous to \gls{glsentrytext}}
  \marg{\cmd{Glsentryed}}\comment{command analogous to \gls{Glsentrytext}}
  \marg{\cmd{glsed}}\comment{command analogous to \gls{glstext}}
  \marg{\cmd{Glsed}}\comment{command analogous to \gls{Glstext}}
  \marg{\cmd{GLSed}}\comment{command analogous to \gls{GLStext}}
\codepar
\comment{Define "ing" key:}
 \gls{glsaddkey}*
  \marg{ing}\comment{key}
  \marg{\gls{glsentrytext}\marg{\gls{glslabel}}ing}\comment{default value}
  \marg{\cmd{glsentrying}}\comment{command analogous to \gls{glsentrytext}}
  \marg{\cmd{Glsentrying}}\comment{command analogous to \gls{Glsentrytext}}
  \marg{\cmd{glsing}}\comment{command analogous to \gls{glstext}}
  \marg{\cmd{Glsing}}\comment{command analogous to \gls{Glstext}}
  \marg{\cmd{GLSing}}\comment{command analogous to \gls{GLStext}}
\end{codebox}
Now I can define some \idxpl{entry}:
\begin{codebox}
\comment{No need to override defaults for this entry:}
\gls{newglossaryentry}\marg{jump}\marg{\gloskeyval{name}{jump},\gloskeyval{description}{}}
\codepar
\comment{Need to override defaults on these entries:}
\gls{newglossaryentry}\marg{run}\marg{\gloskeyval{name}{run},
  ed=\marg{ran},
  ing=\marg{running},
  \gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{waddle}\marg{\gloskeyval{name}{waddle},
  ed=\marg{waddled},
  ing=\marg{waddling},
  \gloskeyval{description}{}}
\end{codebox}

These \idxpl{entry} can later be used in the document:
\begin{codebox}
The dog \cmd{glsed}\marg{jump} over the duck.
\codepar
The duck was \cmd{glsing}\marg{waddle} round the dog.
\codepar
The dog \cmd{glsed}\marg{run} away from the duck.
\end{codebox}
For a complete document, see the sample file \samplefile{-newkeys}.
\end{example}

\subsection{Storage Keys}
\label{sec:glsaddstoragekey}

A custom key that can be used for simply storing information is 
defined using:
\cmddef{glsaddstoragekey}
where the arguments are as the first three arguments of
\gls{glsaddkey}, described above in \sectionref{sec:glsaddkey}.

This is essentially the same as \gls{glsaddkey} except that it
doesn't define the additional commands. You can access or update
the value of your new field using the commands described in 
\sectionref{sec:fetchset}.

\begin{example}{Defining Custom Storage Key (Acronyms and Initialisms)}{ex:addstoragekey}
Suppose I want to define acronyms (an abbreviation that is
pronounced as a word) and other forms of abbreviations, such as
initialisms, but I want them all in the same \idx{glossary} and I
want the acronyms on \idx{firstuse} to be displayed with the short
form followed by the long form in parentheses, but the opposite way
round for other forms of abbreviations. (The \sty{glossaries-extra}
package provides a simpler way of achieving this.)

Here I can define a new key that determines whether the term is
actually an acronym rather than some other form of abbreviation. I'm
going to call this key \optfmt{abbrtype} (since \gloskey{type}
already exists):
\begin{codebox}
\gls{glsaddstoragekey}
 \marg{abbrtype}\comment{key/field name}
 \marg{word}\comment{default value if not explicitly set}
 \marg{\cmd{abbrtype}}\comment{custom command to access the value if required}
\end{codebox}

Now I can define a \idxc{acronymstyle}{style} that looks up the value of 
this new key to determine how to display the full form:
\begin{codebox}
\gls{newacronymstyle}
 \marg{mystyle}\comment{style name}
 \marg{\comment{Use the generic display}
   \gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}\comment{}
 }\comment{}
 \marg{\comment{Put the long form in the description}
   \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
       \gloskeyval{description}{\cmd{the}\gls{glslongtok}}}\comment{}
   \comment{For the full format, test the value of the "abbrtype" key.}
   \comment{If it's set to "word" put the short form first with}
   \comment{the long form in brackets.}
   \cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }\comment{}
    \marg{\comment{is another form of abbreviation}
     \gls{glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
   }\comment{}
   \comment{\idx{sentencecase} version:}
   \cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{Glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }
    \marg{\comment{is another form of abbreviation}
     \gls{Glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
   }\comment{}
   \comment{plural}
   \cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}\comment{}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }\comment{}
    \marg{\comment{is another form of abbreviation}
     \gls{glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
  }\comment{}
  \comment{plural and \idx{sentencecase}}
  \cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}\comment{}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{Glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }\comment{}
    \marg{\comment{is another form of abbreviation}
     \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
  }\comment{}
  \comment{Just use the short form as the name part in the \idx{glossary}:}
  \cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{}
     \gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}}\comment{}
  \comment{Sort by the short form:}
  \cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}1}\comment{}
  \comment{Just use the surrounding font for the short form:}
  \cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\idx{hashhash}1}\comment{}
  \comment{Same for \idx{firstuse}:}
  \cmd{renewcommand}*\marg{\gls{firstacronymfont}}[1]\marg{\gls{acronymfont}\marg{\idx{hashhash}1}}\comment{}
  \comment{Default plural suffix if the plural isn't explicitly set}
  \cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glspluralsuffix}}\comment{}
 }
\end{codebox}
Remember that the new style needs to be set before defining any
terms:
\begin{codebox}
\gls{setacronymstyle}\marg{mystyle}
\end{codebox}

Since it may be a bit confusing to use \gls{newacronym} for something
that's not technically an acronym, let's define a new command for
initialisms:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newinitialism}}[4][]\marg{\comment{}
  \gls{newacronym}\oarg{abbrtype=initialism,\#1}\marg{\#2}\marg{\#3}\marg{\#4}\comment{}
}
\end{codebox}
Now the \idxpl{entry} can all be defined:
\begin{codebox}
\gls{newacronym}\marg{radar}\marg{radar}\marg{radio detecting and ranging}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\gls{newacronym}\marg{scuba}\marg{scuba}\marg{self-contained underwater breathing
apparatus}
\cmd{newinitialism}\marg{dsp}\marg{DSP}\marg{digital signal processing}
\cmd{newinitialism}\marg{atm}\marg{ATM}\marg{automated teller machine}
\end{codebox}
On \idx{firstuse}, \code{\gls{gls}\marg{radar}} will produce \qt{radar (radio
detecting and ranging)} but \code{\gls{gls}\marg{dsp}} will produce \qt{DSP
(digital signal processing)}.

For a complete document, see the sample file
\samplefile{-storage-abbr}.
\end{example}

In the above example, if \gls{newglossaryentry} is explicitly used
(instead of through \gls{newacronym}) the \optfmt{abbrtype} key will
be set to its default value of \qt{word} but the \gls{ifglshaslong}
test in the custom \idx{acronymstyle} will be false (since the
\gloskey{long} key hasn't been set) so the \idx{displaystyle} will switch
to that given by \gls{glsgenentryfmt} and they'll be no test
performed on the \optfmt{abbrtype} field.

\begin{example}{Defining Custom Storage Key (Acronyms and
Non-Acronyms with Descriptions)}{ex:addstoragekey2}
The previous example can be modified if the \gloskey{description}
also needs to be provided. Here I've changed \qt{word} to
\qt{acronym}:
\begin{codebox}
\gls{glsaddstoragekey}
 \marg{abbrtype}\comment{key/field name}
 \marg{acronym}\comment{default value if not explicitly set}
 \marg{\cmd{abbrtype}}\comment{custom command to access the value if required}
\end{codebox}
This may seem a little odd for non-abbreviated \idxpl{entry} that are defined using
\gls{newglossaryentry} directly, but \gls{ifglshaslong} can be used
to determine whether or not to reference the value of this new
\optfmt{abbrtype} field.

The new \idx{acronymstyle} has a~minor modification that forces the user
to specify a description. In the previous example, the line:
\begin{codebox}
   \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
     \gloskeyval{description}{\cmd{the}\gls{glslongtok}}}\comment{}
\end{codebox}
needs to be changed to:
\begin{codebox}
   \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}\comment{}
\end{codebox}
Additionally, to accommodate the change in the default value of the
\optfmt{abbrtype} key, all instances of 
\begin{codebox}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}
\end{codebox}
need to be changed to:
\begin{codebox}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{acronym}
\end{codebox}

Once this new \idxc{acronymstyle}{style} has been set, the new acronyms can be defined
using the optional argument to set the description:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{system for detecting the position and
speed of aircraft, ships, etc}}\marg{radar}\marg{radar}\marg{radio detecting
and ranging}
\end{codebox}

No change is required for the definition of \cmd{newinitialism} but
again the optional argument is required to set the description:
\begin{codebox}
\cmd{newinitialism}\oarg{\gloskeyval{description}{mathematical manipulation of an
information signal}}\marg{dsp}\marg{DSP}\marg{digital signal processing}
\end{codebox}

We can also accommodate contractions in a similar manner to the
initialisms:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newcontraction}}[4][]\marg{\comment{}
  \gls{newacronym}\oarg{abbrtype=contraction,\#1}\marg{\#2}\marg{\#3}\marg{\#4}\comment{}
}
\end{codebox}
The contractions can similarly been defined using this new command:
\begin{codebox}
\cmd{newcontraction}[\gloskeyval{description}{front part of a ship below the
deck}]\marg{focsle}\marg{fo'c's'le}\marg{forecastle}
\end{codebox}

Since the custom \idx{acronymstyle} just checks if \optfmt{abbrtype} is
\qt{acronym}, the contractions will be treated the same as the
initialisms, but the \idxc{acronymstyle}{style} could be modified by a further test of
the \optfmt{abbrtype} value if required.

To test regular non-abbreviated entries, I've also defined a simple
word:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{a fruit}}
\end{codebox}

Now for a new \idx{glossarystyle} that provides information about the
abbreviation (in addition to the description):
\begin{codebox}
\gls{newglossarystyle}
 \marg{mystyle}\comment{style name}
 \marg{\comment{base it on the "list" style}
   \gls{setglossarystyle}\marg{list}\comment{}
   \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
     \gls{item}\oarg{\gls{glsentryitem}\marg{\idx{hashhash}1}\comment{}
          \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}}
       \gls{ifglshaslong}\marg{\idx{hashhash}1}\comment{}
       \marg{ (\cmd{abbrtype}\marg{\idx{hashhash}1}: \gls{glsentrylong}\marg{\idx{hashhash}1})\gls{space}}\marg{}\comment{}
       \gls{glossentrydesc}\marg{\idx{hashhash}1}\gls{glspostdescription}\gls{space} \idx{hashhash}2}\comment{}
 }
\end{codebox}
This uses \gls{ifglshaslong} to determine whether or not the term is
an abbreviation. (An alternative is to use \gls{ifglshasshort}. The
\gloskey{long} and \gloskey{short} keys are only set for
\idxpl{acronym}\slash\idxpl{abbreviation}.) 

If the entry has an \gloskey{short}\slash\gloskey{long} value, the full form is
supplied in parentheses and \csfmt{abbrtype} (defined by
\gls{glsaddstoragekey} earlier) is used to indicate the type of
abbreviation.

With this style set, the \qt{apple} entry is simply displayed in
the glossary as:
\begin{description}
\item[apple] a fruit.
\end{description}
but the abbreviations are displayed in the form
\begin{description}
\item[laser] (acronym: light amplification by
stimulated emission of radiation) device that creates a narrow beam
of intense light.
\end{description}
(for acronyms) or
\begin{description}
\item[DSP] (initialism: digital signal processing) mathematical
manipulation of an information signal.
\end{description}
(for initalisms) or
\begin{description}
\item[fo'c's'le] (contraction: forecastle) front part of a ship
below the deck.
\end{description}
(for contractions).

For a complete document, see \samplefile{-storage-abbr-desc}.
\end{example}

\section{Expansion}
\label{sec:expansion}

When you define new \idxpl{glossaryentry} expansion is performed by
default, except for the \gloskey{name}, \gloskey{description},
\gloskey{descriptionplural}, \gloskey{symbol}, \gloskey{symbolplural}
and \gloskey{sort} keys (these keys all have expansion suppressed via
\gls{glssetnoexpandfield}).

You can switch expansion on or off for individual keys using:
\cmddef{glssetexpandfield}
or
\cmddef{glssetnoexpandfield}
respectively, where \meta{field} is the \idx{internalfieldlabel} corresponding to
the key. In most cases, this is the same as the name of the key
except for those listed in \tableref{tab:fieldmap}.

\begin{table}[htbp]
\caption{Key to Field Mappings}
\label{tab:fieldmap}
\centering
\begin{tabular}{ll}
\bfseries Key & \bfseries Field\\
\gloskey+{sort} & \glosfielddef{sortvalue}\\
\gloskey+{firstplural} & \glosfielddef{firstpl}\\
\gloskey+{description} & \glosfielddef{desc}\\
\gloskey+{descriptionplural} & \glosfielddef{descplural}\\
\gloskey+{user1} & \glosfielddef{useri}\\
\gloskey+{user2} & \glosfielddef{userii}\\
\gloskey+{user3} & \glosfielddef{useriii}\\
\gloskey+{user4} & \glosfielddef{useriv}\\
\gloskey+{user5} & \glosfielddef{userv}\\
\gloskey+{user6} & \glosfielddef{uservi}\\
\gloskey+{longplural} & \glosfielddef{longpl}\\
\gloskey+{shortplural} & \glosfielddef{shortpl}
\end{tabular}
\end{table}

Any keys that haven't had the expansion explicitly set using
\gls{glssetexpandfield} or \gls{glssetnoexpandfield} are governed by
\cmddef{glsexpandfields}
and
\cmddef{glsnoexpandfields}

If your entries contain any fragile commands, I recommend you switch
off expansion via \gls{glsnoexpandfields}. (This should be used
before you define the entries.)

\begin{information}
Both \gls{newacronym} and \gls{newabbreviation} partially suppress
expansion of some keys regardless of the above expansion settings.
\end{information}

\section{Sub-Entries}
\label{sec:subentries}

A \inlineidxdef{sub-entry} is created by setting the \gloskey+{parent} key. These
will normally be sorted so that they are placed immediately after
their parent \idx{entry}. However, some sort methods aren't suitable when
there are \idxpl{sub-entry}. In particular, \idxpl{sub-entry} are problematic
with \option{noidx}, and with \option{unsrt} the \idxpl{sub-entry} must
be defined immediately after their parent \idx{entry} (rather than at any
point after the parent \idx{entry} has been defined).

The \idx+{hierarchicallevel} indicates the \idx{sub-entry} level. An
\idx{entry} with no parent (a top level entry) is a \idx{hierarchicallevel}[~0]
entry. An \idx{entry} with a parent has a \idx{hierarchicallevel} that's
one more than its parent's level. The level is calculated when an
\idx{entry} is defined. 

\begin{information}
The \idx{hierarchicallevel} is stored in the \glosfield{level}
internal field. It can be accessed using commands like
\gls{glsfieldfetch} or (with \sty{glossaries-extra})
\gls{glsxtrusefield}, but neither the \glosfield{level} nor the
\gloskey{parent} values should be altered as it can cause
inconsistencies in the sorting and \idx{glossary} formatting.  The
\idx{indexing} syntax for \options{mkidx,xdy} is generated when the
entry is first defined, so it's too late to change the hierarchy
after that, and \app{bib2gls} obtains the hierarchical
information from the \ext{bib} files and the resource options.
Note, however, that \sty{glossaries-extra} does allow the ability to
locally alter the level with the \printglossopt{leveloffset} option,
which is mainly intended for nested \idx{glossary}. See the
\sty{glossaries-extra} manual for further details and also
\gallerypage{bib2gls-inner}{Gallery: Inner or Nested Glossaries}.
\end{information}

There are two different types of \idxpl{sub-entry}: those that have the
same name as their parent (\idxpl{homograph}, see
\sectionref{sec:homographs}) and those that establish a hierarchy
(see \sectionref{sec:hierarchical}). Both types are considered
\hierarchical\ entries from the point of view of the \sty{glossaries}
package and the \idxpl{indexingapp}, but typically \idxpl{homograph}
will have the \gloskey{name} key obtained from the parent, rather
than have it explicitly set, and have a maximum \idx{hierarchicallevel} of~1.

Not all \idxpl+{glossarystyle} support \hierarchical\ entries and
may display all the \idxpl{entry} in a flat format. Of the
\idxc{glossarystyle}{styles} that support \idxpl{sub-entry}, some
display the \idx{sub-entry}['s] name whilst others don't. Therefore
you need to ensure that you use a suitable
\idxc{glossarystyle}{style}. (See \sectionref{sec:styles} for a list
of predefined \idxpl{glossarystyle}.) If you want \hierlevel{1}
\idxpl{sub-entry} automatically numbered (in \idxpl{glossarystyle} that
support it) use the \opt{subentrycounter} package option (see
\sectionref{sec:pkgopts-printglos} for further details).

Note that the parent \idx{entry} will automatically be added to the
\idx{glossary} if any of its child \idxpl{entry} are used in the document.
If the parent \idx{entry} is not referenced in the document, it will not
have a \idx{numberlist}. Note also that \app{makeindex} has a
restriction on the maximum \hierarchical\ depth.

\subsection{Hierarchy}
\label{sec:hierarchical}

To create a \idx{glossary} with \hierarchical\ divisions, you need
to first define the division, which will be a \toplevel\ entry, and
then define the \idxpl{sub-entry} using the relevant higher level
entry as the value of the \gloskey+{parent} key. (In a
\hierarchical\ context, a higher level indicates a numerically
smaller level number, so level~0 is one level higher than level~1.)
The top level entry may represent, for example, a topic or
classification.  A level~1 entry may represent, for example, a
sub-topic or sub-classification.

\begin{example}{Hierarchical Divisions\dash Greek and Roman 
Mathematical Symbols}{ex:hierarchical}

Suppose I want a \idx{glossary} of mathematical symbols that
are divided into Greek letters and Roman letters. Then I can define
the divisions as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{greekletter}\marg{\gloskeyval{name}{Greek letters},
\gloskeyval{description}{\gls{nopostdesc}}}
\codepar
\gls{newglossaryentry}{romanletter}\marg{\gloskeyval{name}{Roman letters},
\gloskeyval{description}{\gls{nopostdesc}}}
\end{codebox}

Note that in this example, the top level entries don't need a
description so I have set the descriptions to \gls{nopostdesc}.
This gives a blank description and suppresses the
description terminator.

I can now define my \idxpl{sub-entry} as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{pi}{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{pi}}},\gloskeyval{sort}{pi},
\gloskeyval{description}{ratio of the circumference of a circle to 
the diameter},
\gloskeyval{parent}{greekletter}}
\codepar
\gls{newglossaryentry}\marg{C}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{C}},\gloskeyval{sort}{C},
\gloskeyval{description}{Euler's constant},
\gloskeyval{parent}{romanletter}}
\end{codebox}
For a complete document, see the sample file \samplefile{tree}.

\begin{xtr}
If you want to switch to \option{unsrt}, you will need to move the
definitions of the \idxpl{sub-entry} to immediately after the definition
of their parent \idx{entry}. So, in this case, \qt{pi} needs to be defined
after \qt{greekletter} and before \qt{romanletter}.
\end{xtr}
\end{example}

\subsection{Homographs}
\label{sec:homographs}

\glsadd{homograph}%
\Idxpl{sub-entry} that have the same name as the parent \idx{entry} don't need
to have the \gloskey+{name} key explicitly set. 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{codebox}
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
\gloskeyval{description}{\gls{nopostdesc}},
\gloskeyval{plural}{glossaries}}
\end{codebox}
As in the previous example, the parent entry has no description, so the description
terminator needs to be suppressed using \gls{nopostdesc}.

Now define the two different meanings of the word with the
\gloskey+{parent} key set to the above parent \idx{entry} label:
\begin{codebox}
\gls{newglossaryentry}\marg{glossarylist}\marg{
\gloskeyval{description}{list of technical words},
\gloskeyval{sort}{1},
\gloskeyval{parent}{glossary}}
\codepar
\gls{newglossaryentry}\marg{glossarycol}\marg{
\gloskeyval{description}{collection of glosses},
\gloskeyval{sort}{2},
\gloskeyval{parent}{glossary}}
\end{codebox}
Note that if I reference the parent \idx{entry} (for example,
\code{\gls{gls}\marg{glossary}}), the \location\ will be added to
the parent's \idx{numberlist}, whereas if I reference any of the
child entries (for example, \code{\gls{gls}\marg{glossarylist}}),
the \location\ will be added to the child entry's \idx{numberlist}.
Note also that since the \idxpl{sub-entry} have the same name, the
\gloskey{sort} key is required with \option{xdy} (\app{xindy}) and recommended
with \option{mkidx} (\app{makeindex}). You can use the \opt{subentrycounter} package
option to automatically number the \hierlevel{1} child entries in the
\idx{glossary} (if you use a \idx{glossarystyle} that supports it).
See \sectionref{sec:pkgopts-printglos} for further details.

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 \idxpl{sub-entry}
have different plurals, they will need to be specified. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{bravo}\marg{\gloskeyval{name}{bravo},
\gloskeyval{description}{\gls{nopostdesc}}}
\codepar
\gls{newglossaryentry}\marg{bravocry}\marg{\gloskeyval{description}{cry of approval 
(pl.\ bravos)},
\gloskeyval{sort}{1},
\gloskeyval{plural}{bravos},
\gloskeyval{parent}{bravo}}
\codepar
\gls{newglossaryentry}\marg{bravoruffian}\marg{\gloskeyval{description}{hired 
ruffian or killer (pl.\ bravoes)},
\gloskeyval{sort}{2},
\gloskeyval{plural}{bravoes},
\gloskeyval{parent}{bravo}}
\end{codebox}
For a complete document, see the sample file \file{sample.tex}.

\section{Loading Entries From a File}
\label{sec:loadglsentries}

You can store all your \idx{glossaryentry} definitions in another
file and use:
\cmddef{loadglsentries}
where \meta{filename} is the name of the file containing all the
\gls{newglossaryentry}, \gls{longnewglossaryentry}, \gls{newacronym}
etc commands.  The optional argument \meta{type} is the name of the
\idx{glossary} to which those \idxpl{entry} should belong, for those
\idxpl{entry} where the \gloskey+{type} key has been omitted (or, more
specifically, for those entries whose \gloskey{type} has been set to
\gls{glsdefaulttype}, which is what \gls{newglossaryentry} uses by
default). See \samplefile{DB} for a complete example document.

\begin{information}
Commands like \gls{newacronym}, \gls{newabbreviation},
\gls{newterm}, \gls{glsxtrnewsymbol} and \gls{glsxtrnewnumber} all
set the \gloskey{type} key to the appropriate \idx{glossary}.  This
means that the \meta{type} optional argument won't apply to those
commands, unless they have \gloskeyval{type}{\gls{glsdefaulttype}}.
\end{information}

This is a~\idx+{documentpreamble}-only command. You may also use \gls{input} to load
the file but don't use \gls{include}. If you find that your file is
becoming unmanageably large, you may want to consider switching to
\app{bib2gls} and use an application such as JabRef to manage the
entry definitions.

\begin{important}
If you want to use \gls{AtBeginDocument} to \gls{input} all your
\idxpl{entry} automatically at the start of the document, add the
\gls{AtBeginDocument} command \emph{before} you load the
\sty{glossaries} package (and \sty{babel}, if you are also loading
that) to avoid the creation of the
\ext+{glsdefs} file and any associated problems that are caused
by defining commands in the \env{document} environment.
(See \sectionref{sec:docdefs}.) Alternatively, if you are using
\sty{glossaries-extra}, use the \opteqvalref{docdef}{restricted}
package option.
\end{important}

\begin{example}{Loading Entries from Another File}{ex:loadgls}
Suppose I have a file called \filefmt{myentries.tex} which contains:
\begin{codebox}
\gls{newglossaryentry}\marg{perl}\marg{\gloskeyval{type}{\glostype{main}},
\gloskeyval{name}{Perl},
\gloskeyval{description}{A scripting language}}
\codepar
\gls{newglossaryentry}\marg{tex}\marg{\gloskeyval{name}{\cmd{TeX}},
\gloskeyval{description}{A typesetting language},\gloskeyval{sort}{TeX}}
\codepar
\gls{newglossaryentry}\marg{html}\marg{\gloskeyval{type}{\gls{glsdefaulttype}},
\gloskeyval{name}{html},
\gloskeyval{description}{A mark up language}}
\end{codebox}
and suppose in my \idx{documentpreamble} I use the command:
\begin{codebox}
\gls{loadglsentries}\oarg{languages}\marg{myentries}
\end{codebox}
then this will add the entries \qt{tex} and \qt{html}
to the \idx{glossary} whose type is given by \optfmt{languages}, but
the entry \qt{perl} will be added to the \glostype{main} glossary, since
it explicitly sets the \gloskey{type} to \glostype{main}.
\end{example}

Now suppose I have a file \filefmt{myacronyms.tex} that contains:
\begin{codebox}
\gls{newacronym}\marg{aca}\marg{aca}\marg{a contrived acronym}
\end{codebox}
then (supposing I have defined a new \idx{glossary} type called
\optfmt{altacronym})
\begin{codebox}
\gls{loadglsentries}\oarg{altacronym}\marg{myacronyms}
\end{codebox}
will add \qt{aca} to the glossary type \glostype{acronym}, if the
package option \opt{acronym} has been specified, or will add
\qt{aca} to the glossary type \optfmt{altacronym}, if the
package option \opt{acronym} is not specified. This is
because \gls{acronymtype} is set to \gls{glsdefaulttype} if the
\opt{acronym} package option is not used so the optional argument of
\gls{loadglsentries} will work in that case, but if the
\opt{acronym} option is used then \gls{acronymtype} will be
redefined to \glostype{acronym}.

If you want to use \gls{loadglsentries} with the \opt{acronym}
package option set, there are two possible solutions to this problem:
\begin{enumerate}
\item Change \filefmt{myacronyms.tex} so that entries are defined in
the form:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}}}\marg{aca}\marg{aca}\marg{a 
contrived acronym}
\end{codebox}
and do:
\begin{codebox}
\gls{loadglsentries}\oarg{altacronym}\marg{myacronyms}
\end{codebox}

\item Temporarily change \gls{acronymtype} to the target \idx{glossary}:
\begin{codebox}
\cmd{let}\cmd{orgacronymtype}\gls{acronymtype}
\cmd{renewcommand}\marg{\gls{acronymtype}}\marg{altacronym}
\gls{loadglsentries}{myacronyms}
\cmd{let}\gls{acronymtype}\cmd{orgacronymtype}
\end{codebox}
\end{enumerate}

Note that only those entries that have been \indexed\
in the text will appear in the relevant \idxpl{glossary}.
Note also that \gls{loadglsentries} may only be used in the 
\idx{documentpreamble}.

\begin{warning}
Don't use the \gloskey{see} key in a large file of entries that may
or may not be \indexed\ in the document. Similarly for
\gloskey{seealso} and \gloskey{alias} with \sty{glossaries-extra}.
If you need them and you need a large database of entries, consider
switching to \app{bib2gls}.
\end{warning}

Remember that you can use \gls{provideglossaryentry} rather than
\gls{newglossaryentry}. Suppose you want to maintain a large database
of \idxpl{acronym} or terms that you're likely to use in your documents,
but you may want to use a modified version of some of those \idxpl{entry}.
(Suppose, for example, one document may require a more detailed
description.) Then if you define the \idxpl{entry} using
\gls{provideglossaryentry} in your database file, you can override
the definition by simply using \gls{newglossaryentry} before loading
the file. For example, suppose your file (called, say,
\filefmt{terms.tex}) contains:
\begin{codebox}
\gls{provideglossaryentry}\marg{mallard}\marg{\gloskeyval{name}{mallard},
 \gloskeyval{description}{a type of duck}}
\end{codebox}
but suppose your document requires a more detailed description, you
can do:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{newglossaryentry}\marg{mallard}\marg{\gloskeyval{name}{mallard},
 \gloskeyval{description}{a dabbling duck where the male has a green head}}
\codepar
\gls{loadglsentries}\marg{terms}
\end{codebox}
Now the \qt{mallard} definition in the \filefmt{terms.tex} file
will be ignored.

\section{Moving Entries to Another Glossary}
\label{sec:moveentry}

You can move an entry from one \idx+{glossary} to another using:
\cmddef{glsmoveentry}
where \meta{entry-label} is the unique label identifying the required
\idx{entry} and \meta{target glossary label} is the unique label
identifying the \idx{glossary} in which to put the \idx{entry}. If you are
using \optionsor{mkidx,xdy}, \idxpl{entry} shouldn't be moved after the
\idxpl{indexingfile} have been opened by \gls{makeglossaries}.

\begin{warning}
Simply changing the value of the \gloskey{type} field using a
command like \gls{glsfielddef} won't correctly move the entry, since the label
needs to be removed from the old \idx{glossary}['s] internal list
and added to the new \idx{glossary}['s] internal list to allow
commands such as \gls{glsaddall} and \gls{glsunsetall} to work.
\end{warning}

Note that no check is performed to determine the existence of
the target \idx{glossary}. If you want to move an entry to a \idx{glossary}
that's skipped by \gls{printglossaries}, then define an 
\idx{ignoredglossary} with \gls{newignoredglossary}. (See
\sectionref{sec:newglossary}.) With \options{b2g,unsrt}, it's also
possible to copy an entry to another \idx{glossary} with
\gls{glsxtrcopytoglossary}. See the \sty{glossaries-extra} manual
for further details.

\begin{important}
Unpredictable results may occur if you move an entry to a different
\idx{glossary} from its parent or children.
\end{important}

\section{Drawbacks With Defining Entries in the Document Environment}
\label{sec:docdefs}

Originally, \gls{newglossaryentry} (and \gls{newacronym}) could only
be used in the \idx+{documentpreamble}. I reluctantly removed this
restriction in version 1.13, but there are issues with defining
commands in the \env{document} environment instead of the
\idx{documentpreamble}, which is why the restriction is maintained
for newer commands. This restriction is also reimposed for
\gls{newglossaryentry} by \option{noidx} because in that case the
\idxpl{entry} must be defined before the \ext+{aux} file is input.
(The \sty{glossaries-extra} package automatically reimposes the
\idx{documentpreamble}-only restriction but provides the
\opt{docdef} package option to allow document definitions for
\options{mkidx,xdy} if necessary.)

\begin{bib2gls}
With \option{b2g}, all \idx{entry} data should be supplied in \ext{bib} files. 
From \app{bib2gls}['s] point of view, the \idxpl{entry} are defined in the
\ext{bib} files. From \TeX's point of view, the \idxpl{entry} are defined
in the \ext{glstex} files that are input by
\gls{GlsXtrLoadResources}, which is a \idx{documentpreamble}-only command.
\end{bib2gls}

\subsection{Technical Issues}
\label{sec:techissues}

\begin{enumerate}
 \item If you define an \idx{entry} mid-way through your document, but
subsequently shuffle sections around, you could end up using an
\idx{entry} before it has been defined. This is essentially the same
problem as defining a command with \cmd{newcommand} in the middle of
the document and then moving things around so that the command is
used before it has been defined.

 \item \Idx{entry} information is required when displaying the \idx{glossary}.
If this occurs at the start of the document, but the \idxpl{entry} aren't
defined until later, then the \idx{entry} details are
being looked up before the \idx{entry} has been defined. This means that
it's not possible to display the content of the \idx{glossary} unless the
\idx{entry} definitions are saved on the previous \LaTeX\ run and can be
picked up at the start of the \env{document} environment on the next run
(in a similar way that \gls{label} and \gls{ref} work).

 \item If you use a package, such as \sty{babel}, that makes
certain characters active at the start of the \env{document}
environment, there can be a~problem if those characters have
a~special significance when defining \idxpl{glossaryentry}.
These characters include \idx{dblquote}, \idx{exclammark}, 
\idx{questionmark}, and \idx{pipe}. They
must not be active when defining a~\idx{glossaryentry} where they occur
in the \gloskey{sort} key (and they should be avoided in the label
if they may be active at any point in the document). Additionally, 
the comma (\sym{comma}) character and the equals (\sym{equals}) character
should not be active when using commands that have
\keyval\ arguments.

\end{enumerate}

To overcome the first two problems, as from version 4.0 the
\sty{glossaries} package modifies the definition of
\gls{newglossaryentry} at the beginning of the \env{document}
environment so that the definitions are written to an external file
(\filefmt{\gls+{jobname}.\ext+{glsdefs}}) which is then read in at the start
of the document on the next run. This means that the entry can now
be looked up in the \idx{glossary}, even if the \idx{glossary} occurs at the
beginning of the document.

There are drawbacks to this mechanism: if you modify an entry
definition, you need a second run to see the effect of your
modification in \gls{printglossary} (if it occurs at the start of the
document); this method requires an extra \gls{newwrite}, which may
exceed \TeX's maximum allocation; unexpected expansion issues could
occur.

Version 4.47 has introduced changes that have removed some of
the issues involved, and there are now warning messages if there is an
attempt to multiply define the same \idx{entry} label.

The \sty{glossaries-extra} package provides a setting (but not for
\optionsor{noidx,b2g}) that allows \gls{newglossaryentry} to occur in the
document environment but doesn't create the \ext{glsdefs}
file. This circumvents some problems but it means that you can't
display any of the \idxpl{glossary} before all the \idxpl{entry} have been
defined (so it's all right if all the \idxpl{glossary} are at the end of
the document but not if any occur in the front matter).

\subsection{Good Practice Issues}
\label{sec:goodpractice}

\sectionref{sec:techissues} above covers technical issues that can
cause your document to have compilation errors or produce incorrect
output. This section focuses on good writing practice. The main
reason cited by users wanting to define \idxpl{entry} within the
\env{document} environment rather than in the \idx{documentpreamble} is that they
want to write the definition as they type in their document text.
This suggests a \qt{stream of consciousness} style of writing that
may be acceptable in certain literary genres but is inappropriate
for factual documents.

When you write technical documents, regardless of whether it's a PhD
thesis or an article for a~journal or proceedings, you must plan what you write
in advance. If you plan in advance, you should have a fairly good
idea of the type of terminology that your document will contain,
so while you are planning, create a new file with all your \idx{entry}
definitions. If, while you're writing your document, you remember
another term you need, then you can switch over to your definition file and
add it. Most text editors have the ability to have more than one
file open at a time. The other advantage to this approach is that if
you forget the label, you can look it up in the definition file
rather than searching through your document text to find the
definition.

\chapter{Referencing Entries in the Document}
\label{sec:usingentries}

Once you have defined a \idx+{glossaryentry} using a command such as
\gls{newglossaryentry} (\sectionref{sec:newglosentry}) or
\gls{newacronym} (\sectionref{sec:acronyms}), you can refer to that
\idx{entry} in the document with one of the provided commands that are
describe in this manual. (There are some additional commands
provided by \sty{glossaries-extra}.) The text produced at that point
in the document (the \idx+{linktext}) is determined by the command and can also be
governed by whether or not the entry has been
\idxc{firstuseflag}{marked as used}.

Some of these commands are more complicated than others. Many of
them are robust and can't be used in fully expandable contexts, such
as in \idxpl{PDFbookmark}.

The commands are broadly divided into:
\begin{enumerate}
\item Those that display text in the document (where the formatting
can be adjusted by a style or hook) and also \idxc+{indexing}{index} the
\idx{entry} (so that it's added to the \idx{glossary}) are described in
\sectionref{sec:glslink}. This set of commands can
be further sub-divided into those that mark the entry as having been
\idxc{firstuseflag}{used} (the \gls{glslike} commands, 
\sectionref{sec:gls-like}) and those that don't
(the \gls{glstextlike} commands, \sectionref{sec:glstext-like}).

\item Those that display text in the document without \idx{indexing} or applying any
additional formatting (\sectionref{sec:glsnolink}). These typically
aren't robust or can partially expand so that they can be used in
\idxpl{PDFbookmark} (with a few exceptions).
\end{enumerate}
There are additional commands specific to entries defined with
\gls{newacronym} that are described in \sectionref{sec:longshortfull}.

\section{Links to Glossary Entries}
\label{sec:glslink}

The text which appears at the point in the document when using any
of the commands described in \sectionref{sec:gls-like} or
\sectionref{sec:glstext-like} is referred to as the \idx+{linktext}
(even if there are no \idxpl{hyperlink}). These commands also add
content to an external \idx{indexingfile} that is used to generate the relevant
\idx{entryline} in the \idx{glossary}. This information includes an associated
\location\ that is added to the \idx{numberlist} for that \idx{entry}. By
default, the \location\ refers to the page number. For further
information on \idxpl{numberlist}, see \sectionref{sec:numberlists}.
These external \idx{indexingfile} need to be post-processed by
\app{makeindex} or \app{xindy} if you have chosen
\optionsor{mkidx,xdy}. If you don't use \gls{makeglossaries} these
external files won't be created.  (\options{noidx,b2g} write the
information to the \ext{aux} file instead.)

\begin{important}
The \idx{linktext} isn't scoped by default as grouping can interfere
with spacing in \idx{mathmode}. Any unscoped declarations in the
\idx{linktext} may affect subsequent text.
\end{important}

Note that repeated use of these commands for the same \idx{entry} can
cause the \idx{numberlist} to become quite long, which may not be
particular helpful to the reader. In this case, you can use the
non-indexing commands described in \sectionref{sec:glsnolink} or
you can use the \sty{glossaries-extra} package, which
provides a means to suppress the automated \idx{indexing} of the commands listed
in this chapter. (For example, in this manual, common terms such as
\idx{glossary} have too many references in the document to list them
all in their \idx{numberlist} in the \hyperref[index]{index}. They have a custom
key created with \gls{glsaddstoragekey} that's used
to set their default \idx{indexing} option.)

\begin{important}
I strongly recommend that you don't use the commands
defined in this chapter in the arguments of sectioning or caption
commands, such as \gls+{chapter} or \gls+{caption}.

Aside from problems with expansion issues, \idxpl{PDFbookmark} and
possible nested \idxpl{hyperlink} in the \idx+{tableofcontents} (or list of
whatever) any use of the commands described in \sectionref{sec:gls-like}
will have their \idx{firstuseflag} unset when they appear in the 
\idx{tableofcontents} (or list of whatever) which is usually too soon
and will not match the actual heading or caption in the document if
there is a different \idxc{firstuse}{first}\slash\idxc{subsequentuse}{subsequent} use.
\end{important}

The above warning is particularly important if you are using the
\sty{glossaries} package in conjunction with the \sty{hyperref}
package. Instead, use one of the \emph{expandable} commands listed in
\sectionref{sec:glsnolink} (such as \gls{glsentrytext}). Alternatively, provide an
alternative via the optional argument to the sectioning\slash caption
command or use \sty{hyperref}'s \gls{texorpdfstring}. Examples:
\begin{codebox}
\gls+{chapter}{An overview of \gls{glsentrytext}\marg{perl}}
\gls{chapter}\oarg{An overview of Perl}{An overview of \gls{gls}\marg{perl}}
\gls{chapter}\marg{An overview of \gls{texorpdfstring}\marg{\gls{gls}\marg{perl}}\marg{Perl}}
\end{codebox}
(You can use \gls{glstexorpdfstring} instead of \gls{texorpdfstring}
if you don't know whether or not \sty{hyperref} will be needed.)
\begin{xtr}
The \sty{glossaries-extra} package provides commands
for use in captions and section headings, such as \gls{glsfmttext},
that overcome some of the problems.
\end{xtr}

If you want the \idx+{linktext} to produce a \idx{hyperlink} to the
corresponding \idx{entryline} in the \idx{glossary}, you should load the
\sty{hyperref} package \emph{before} the \sty{glossaries}
package. That's what I've done in this manual, so if you encounter a
hyperlinked term, such as \idx{linktext}, you can click on the word
or phrase and it will take you to a brief description in this
document's \idx{glossary} or you can click on a command name, such
as \gls{gls}, and it will take you to the relevant part of the
document where the command is described or you can click on a
general word or phrase, such as \idx{tableofcontents}, and it will
take you to the relevant line in the \hyperref[index]{index} where
you can find the \idx+{numberlist} to navigate to other parts of the
document that are pertinent. If, however, you click on
\qt{\idx{numberlist}}, you'll find it leads you to the
\idx{locationlist} entry in the index instead. This is because
\idx{numberlist} has been aliased to \idx{locationlist} using the
\gloskey{alias} key. Whereas if you click on \qt{\idx{pagelist}}
it will take you to the corresponding \idx{pagelist} entry in the \idx{glossary}
that has a cross-reference to \idx{locationlist}, because the
\gloskey{see} key was used instead.

\begin{important}
If you use the \sty{hyperref} package, I strongly recommend you use
\app{pdflatex} rather than \app{latex} to compile your document, if
possible. The \idx{DVI} format of \LaTeX\ has limitations with the
\idxpl+{hyperlink} that can cause a problem when used with the
\sty{glossaries} package. Firstly, the \idx{DVI} format can't break a
\idx{hyperlink} across a line whereas \pdfLaTeX\ can. This means that long
\idxpl{glossaryentry} (for example, the full form of an acronym) won't be
able to break across a line with the \idx{DVI} format. Secondly, the 
\idx{DVI} format doesn't correctly size \idxpl{hyperlink} in subscripts or
superscripts. This means that if you define a term that may be used
as a subscript or superscript, if you use the \idx{DVI} format, it won't
come out the correct size.

These are limitations of the \idx{DVI} format not of the \sty{glossaries}
package.
\end{important}

It may be that you only want terms in certain \idxpl{glossary} to have
\idxpl{hyperlink}, but not for other \idxpl{glossary}. In this case, you can use the
package option \opt{nohypertypes} to identify the \idx{glossary} lists
that shouldn't have hyperlinked \idx{linktext}. See 
\sectionref{sec:pkgopts-general} for further details.

The way the \idx{linktext} is displayed depends on 
\cmddef{glstextformat}
For example, to make all \idx{linktext} appear in a sans-serif
font, do:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glstextformat}}[1]\marg{\cmd{textsf}\marg{\#1}}
\end{codebox}
Further customisation can be done via \gls{defglsentryfmt} or by
redefining \gls{glsentryfmt}. See \sectionref{sec:glsdisplay} for
further details.

Each entry has an associated conditional referred to as the
\idx+{firstuseflag}. Some of the commands described in this chapter
automatically unset this flag and can also use it
to determine what text should be displayed. These types of commands
are the \idx+{glslike} commands and are described in
\sectionref{sec:gls-like}. The commands that don't reference or change
the \idx{firstuseflag} are \idx+{glstextlike} commands and are described
in \sectionref{sec:glstext-like}.  See \sectionref{sec:glsunset} for 
commands that unset (mark the entry as having been used) or reset
(mark the entry as not used) the \idx{firstuseflag} without referencing
the \idxpl{entry}.

The \gls{glslike} and \gls{glstextlike} commands all take a first
optional argument that is a comma-separated list of \keyval\
options, described below. They also have a \idx{starmod}-variant,
which inserts \glsoptval{hyper}{false} at the start of the list of
options and a \idx{plusmod}-variant, which inserts
\glsoptval{hyper}{true} at the start of the list of options. For
example \code{\gls{gls}\sym{starmod}\marg{sample}} is the same as
\code{\gls{gls}\oarg{\glsoptval{hyper}{false}}\marg{sample}} and
\code{\gls{gls}\sym{plusmod}\marg{sample}} is the same as
\code{\gls{gls}\oarg{\glsoptval{hyper}{true}}\marg{sample}}, whereas
just \code{\gls{gls}\marg{sample}} will use the default
\idx+{hyperlink} setting which depends on a number of factors (such
as whether the entry is in a \idx{glossary} that has been identified
in the \opt{nohypertypes} list).  You can override the
\glsopt{hyper} key in the variant's optional argument, for example,
\code{\gls{gls}\sym{starmod}\oarg{\glsoptval{hyper}{true}}\marg{sample}}
but this creates redundancy and is best avoided. The
\sty{glossaries-extra} package provides the option to add a third
custom variant and commands to override the behaviour of the
\idx{starmod} and \idx{plusmod} variants.

\begin{important}
Avoid nesting these commands. For example don't do
\code{\gls{glslink}\margm{label}\marg{\gls{gls}\margm{label2}}}
as this is likely to cause problems. By implication, this
means that you should avoid using any of these commands within
the \gloskey{text}, \gloskey{first}, \gloskey{short} or
\gloskey{long} keys (or their plural equivalent) or any
other key that you plan to access through these commands.
(For example, the \gloskey{symbol} key if you intend to use
\gls{glssymbol}.) The \sty{glossaries-extra} package provides
\gls{glsxtrp} to use instead, which helps to mitigate against
nesting problems.
\end{important}

\subsection{Options}
\label{sec:glslinkoptions}

The keys listed below are available for the optional first argument
of the \gls{glslike} and \gls{glstextlike} commands.
The \sty{glossaries-extra} package provides additional keys.
(See the \sty{glossaries-extra} manual for further details.)

\optiondef{glsopt.hyper}
If true, this option can be used to enable\slash disable the
\idx+{hyperlink} to the relevant \idx{entryline} in the
\idx{glossary}. If this key is omitted, the value is determined by
the current settings. For example, when used with a \gls{glslike}
command, if this is the \idx{firstuse} and the \optval{hyperfirst}{false}
package option has been used, then the default value is
\glsoptval{hyper}{false}. The \idx{hyperlink} can be forced on using
\glsoptval{hyper}{true} unless the \idxpl{hyperlink} have been
suppressed using \gls{glsdisablehyper}. You must load the
\sty{hyperref} package before the \sty{glossaries} package to ensure
the \idxpl{hyperlink} work.

\optiondef{glsopt.format}
This specifies how to \idxc+{locationencap}{format} the
associated \location\ number within the \idx{locationlist} 
(see \sectionref{sec:encap}).

\begin{information}
There is a special format \encap{glsignore} which simply ignores its
argument to create an \idx{invisiblelocation}.
\end{information}

\optiondef{glsopt.counter}
This specifies which \idxc{locationcounter}{counter}
to use for this \location. This overrides the default
\gloskey{counter} used by the \idx{entry}, the default counter
associated with the \idx{glossary} (supplied in the final optional
argument of \gls{newglossary}) and the default counter identified by
the \opt{counter} package option. See also \sectionref{sec:numberlists}.
The \sty{glossaries-extra} package has additional options that
affect the counter used, such as \opt{floats} and \opt{equations}.
This manual uses the \opt{floats} option to automatically switch the
counter to \ctr{table} for any entries \indexed\ in tables (such as
those in \tableref{tab:hyperxx}).

\optiondef{glsopt.local}
This is a boolean key that only makes a difference when used with
\gls{glslike} commands that change the entry's \idx+{firstuseflag}.
If \glsoptval{local}{true}, the change to the \idx{firstuseflag}
will be localised to the current scope.

\optiondef{glsopt.noindex}
If true, this option will suppress the \idx+{indexing}. 
Only available with \sty{glossaries-extra}. This manual doesn't use
\glsopt{noindex} for common entries. Instead it uses
\glsoptval{format}{\encap{glsignore}}, which is preferable with
\app{bib2gls}.

\optiondef{glsopt.hyperoutside}
If true, this will put the \idx+{hyperlink} outside of \gls{glstextformat}. 
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.wrgloss}
This key determines whether to \idxc+{indexing}{index} before
(\glsoptval{wrgloss}{before}) or after (\glsoptval{wrgloss}{after})
the \idx{linktext}, which alters where the \idx{whatsit} occurs. 
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.textformat}
The value is the name of the control sequence (without the leading
backslash) to encapsulate the \idx{linktext} instead of the default
\gls{glstextformat}.  Only available with \sty{glossaries-extra}.

\optiondef{glsopt.prefix}
This key locally redefines \gls{glolinkprefix} to the given value.
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.thevalue}
This key explicitly sets the \location\ value instead of obtaining it from
the \idx+{locationcounter}.
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.theHvalue}
This key explicitly sets the \idx{hyperlink} location value instead
of obtaining it from the \idx{locationcounter}.
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.prereset}
Determines whether or not to reset the \idx+{firstuseflag} before the
\idx{linktext}.  Only available with \sty{glossaries-extra}.

\optiondef{glsopt.preunset}
Determines whether or not to unset the \idx+{firstuseflag} before the
\idx{linktext}.  Only available with \sty{glossaries-extra}.

\optiondef{glsopt.postunset}
Determines whether or not to unset the \idx+{firstuseflag} after the
\idx{linktext}.  Only available with \sty{glossaries-extra}.

\subsection{The \glsfmttext{gls}-Like Commands (First Use Flag Queried)}
\label{sec:gls-like}

This section describes the \idx+{glslike} commands that unset (mark
as used) the \idx+{firstuseflag} after the \idx+{linktext}, and in
most cases they use the current state of the flag to determine the
text to be \idxc{entryformat}{displayed}. As described above, these
commands all have a \idx{starmod}-variant (\glsoptval{hyper}{false})
and a \idx{plusmod}-variant (\glsoptval{hyper}{true}) and have an
optional first argument that is a \keyval\ list.  These commands use
\gls{glsentryfmt} or the equivalent definition provided by
\gls{defglsentryfmt} to determine the automatically generated text
and its \idxc{entryformat}{format} (see
\sectionref{sec:glsdisplay}).

Apart from \gls{glsdisp}, the commands described in this section
also have a \emph{final} optional argument \meta{insert} which may
be used to insert material into the automatically generated text.

\begin{important}
Since the commands have a final optional argument, take care if
you actually want to display an open square bracket after the command
when the final optional argument is absent. Insert an empty optional
argument or \gls+{relax} or an empty set of
braces \code{\marg{}} immediately before the opening square bracket to
prevent it from being interpreted as the final argument. For
example:
\begin{codebox}
\gls{gls}\marg{sample}\oarg{} [Editor's comment]
\gls{gls}\marg{sample}\marg{} [Editor's comment]
\gls{gls}\marg{sample} \gls{relax}\oarg{Editor's comment}
\end{codebox}
Use of a semantic command can also help avoid this problem. For
example:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{edcom}}[1]{[\#1]}
\comment{later:}
\gls{gls}\marg{sample} \cmd{edcom}\marg{Editor's comment}
\end{codebox}

Don't use any of the \gls{glslike} or \gls{glstextlike} commands in the 
\meta{insert} argument.
\end{important}

Take care using these commands within commands or environments that
are processed multiple times as this can confuse the \idx{firstuseflag}
query and state change. This includes frames with overlays in
\cls{beamer} and the \env{tabularx} environment provided by \sty{tabularx}. 
The \sty{glossaries} package automatically deals with this issue
in \sty{amsmath}'s \env{align} environment. You can apply a patch
to \sty{tabularx} by placing the command \gls{glspatchtabularx} in the
\idx{documentpreamble}.
This does nothing if \sty{tabularx} hasn't been loaded. There's no
patch available for \cls{beamer}. See \sectionref{sec:glsunset} for
more details and also \sectionref{sec:measuring}.

Most of the commands below have \casechanging\ variants to convert
the \idx+{linktext} to \idx+{sentencecase} or \idx+{allcaps}. The
\idx{sentencecase} conversion is performed by \gls{glssentencecase}
and the \idx{allcaps} is performed by \gls{glsuppercase}.
Ensure you have at least version 2.08 of \sty{mfirstuc} to use the
modern \LaTeX3 \casechanging\ commands instead of the now deprecated
\sty{textcase} package. See the \sty{mfirstuc} manual for further
details.

\cmddef{gls}
This command typically determines the \idx{linktext} from the values
of the \gloskey{text} or \gloskey{first} keys supplied when the
\idx{entry} was defined using \gls{newglossaryentry}. However, if the
entry was defined using \gls{newacronym} and \gls{setacronymstyle} was 
used, then the \idx{linktext} will usually be determined from the \gloskey{long} or
\gloskey{short} keys (similarly for \gls{newabbreviation}).

The \casechanging\ variants:
\cmddef{Gls}
(\idx{sentencecase})
and
\cmddef{GLS}
(\idx{allcaps}).

There are plural forms that are analogous to \gls{gls}:
\cmddef{glspl}
\Idx{sentencecase}:
\cmddef{Glspl}
\Idx{allcaps}:
\cmddef{GLSpl}
These typically determine the \idx{linktext} from the \gloskey{plural} or
\gloskey{firstplural} keys supplied when the \idx{entry} was 
defined using \gls{newglossaryentry} or, if the \idx{entry} was defined
with \gls{newacronym} and \gls{setacronymstyle} was used, from the 
\gloskey{longplural} or \gloskey{shortplural} keys. (Similarly for
\gls{newabbreviation}.)

\begin{important}
Be careful when you use \idxpl{glossaryentry} in \idx{mathmode} especially if you 
are using \sty+{hyperref} as it can affect the spacing of subscripts and
superscripts in \idx{mathmode}. For example, suppose you have defined the following
entry:
\begin{codebox}
\gls{newglossaryentry}\marg{Falpha}\marg{\gloskeyval{name}{F\sym+{sb}\gls+{alpha}},
\gloskeyval{description}{sample}}
\end{codebox}
and later you use it in \idx{mathmode}:
\begin{codebox}
\$\gls{gls}\marg{Falpha}\sym+{sp}2\$
\end{codebox}
This will result in $F_\alpha{}^2$ instead of $F_\alpha^2$. In this
situation it's best to bring the superscript into the \idx+{hyperlink} using
the final \meta{insert} optional argument:
\begin{codebox}
\$\gls{gls}\marg{Falpha}\oarg{\idx{sp}2}\$
\end{codebox}
\end{important}

\cmddef{glsdisp}
This behaves in the same way as \gls{gls}, except
that the \meta{link text} is explicitly set. There's no final
optional argument as any inserted material can be added to the
\meta{link text} argument. Even though the
\idx{firstuseflag} doesn't influence the \idx{linktext}, it's still
unset after the \idx{linktext} and so may influence the \idx{postlinkhook}.

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{locationcounter}\marg{
  \gloskeyval{name}{location counter},
  \gloskeyval{description}{...}
}
\comment{later in the document:}
The \gls{glsdisp}\marg{locationcounter}\marg{counter} identifying the location.
\end{codebox}
This ensures that the \idx{entry} is \indexed\ and, if enabled,
creates a \idx{hyperlink} to the \idx{entryline} in the \idx{glossary}.
It will also follow the \idx{displaystyle} and have the
\idx{linktext} encapsulated with \gls{glstextformat}.

Since the actual text is being supplied,
any \casechanging\ can be placed in the argument. For example:
\begin{codebox}
\gls{glsdisp}\marg{locationcounter}\marg{Counters} associated with locations 
\end{codebox}
However, a \idx{sentencecase} variant is provided:
\cmddef{Glsdisp}
This essentially does:
\begin{compactcodebox}
\gls{glsdisp}\oargm{options}\margm{entry-label}\marg{\gls{glssentencecase}\margm{text}}
\end{compactcodebox}
The main reason for providing this command is to set up a mapping
for \gls{makefirstuc}. See the \sty{mfirstuc} manual for further
details about mappings.

\begin{important}
Don't use any of the \gls{glslike} or \gls{glstextlike} commands in the 
\meta{link text} argument of \gls{glsdisp}.
\end{important}

\subsection{The \glsfmttext{glstext}-Like Commands (First Use Flag Not Queried)}
\label{sec:glstext-like}

This section describes the commands that don't change or reference
the \idx{firstuseflag}. As described above, these commands all have a
\idx{starmod}-variant (\glsoptval{hyper}{false}) and a \idx{plusmod}-variant
(\glsoptval{hyper}{true}) and have an optional first argument
that is a \keyval\ list. These commands also don't
use \gls{glsentryfmt} or the equivalent definition provided by
\gls{defglsentryfmt} (see \sectionref{sec:glsdisplay}). 
They do, however, have their \idx{linktext} encapsulated with
\gls{glstextformat}.

Additional commands for \idxpl{acronym} are described in
\sectionref{sec:acronyms}. (Additional commands for
\idxpl{abbreviation} are described in the \sty{glossaries-extra}
manual.)

Apart from \gls{glslink}, the commands described in this section
also have a \emph{final} optional argument \meta{insert} which may
be used to insert material into the automatically generated text.
See the caveat above in \sectionref{sec:gls-like}. As with the
\gls{glslike} commands described in \sectionref{sec:gls-like}, these
commands also have \casechanging\ variants.

\cmddef{glslink}
This command explicitly sets the \idx{linktext} as given in the
final argument. As with \gls{glsdisp}, there's a \idx{sentencecase}
variant to allow a \idx{sentencecase} mapping to be established:
\cmddef{Glslink}
See the \sty{mfirstuc} package for further details.

\begin{important}
Don't use any of the \gls{glslike} or \gls{glstextlike} commands in the 
argument of \gls{glslink}. By extension, this means that you can't
use them in the value of fields that are used to form \idx{linktext}.
\end{important}

\cmddef{glstext}
This command always uses the value of the \gloskey+{text} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glstext}
(\idx{sentencecase}) and
\cmddef{GLStext}
(\idx{allcaps}).

There's no equivalent command for \idx+{titlecase}, but you
can use the more generic command \gls{glsentrytitlecase}
in combination with \gls{glslink}. For example:
\begin{codebox}
\gls{glslink}\marg{sample}\marg{\gls{glsentrytitlecase}\marg{sample}\marg{text}}
\end{codebox}
(See \sectionref{sec:glsnolink}.)

\cmddef{glsfirst}
This command always uses the value of the \gloskey+{first} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsfirst}
(\idx{sentencecase}) and
\cmddef{GLSfirst}
(\idx{allcaps}).

\begin{important}
The value of the \gloskey{first} key (and \gloskey{firstplural} key)
doesn't necessarily match the \idx{linktext} produced by \gls{gls} (or
\gls{glspl}) on \idx{firstuse} as the \idx{linktext} used by
\gls{gls} may be modified through \idxc+{entryformat}{entry
formatting} commands like \gls{defglsentryfmt}. (Similarly, the value
of the \gloskey{text} and \gloskey{plural} keys don't necessarily
match the \idx{linktext} used by \gls{gls} or \gls{glspl} on
\idx{subsequentuse}.)
\end{important}

\cmddef{glsplural}
This command always uses the value of the \gloskey+{plural} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsplural}
(\idx{sentencecase}) and
\cmddef{GLSplural}
(\idx{allcaps}).

\cmddef{glsfirstplural}
This command always uses the value of the \gloskey+{firstplural} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsfirstplural}
(\idx{sentencecase}) and
\cmddef{GLSfirstplural}
(\idx{allcaps}).

\cmddef{glsname}
This command always uses the value of the \gloskey+{name} key as the
\idx{linktext}. Note that this may be different from the values of
the \gloskey{text} or \gloskey{first} keys. In general it's better
to use \gls{glstext} or \gls{glsfirst} instead of \gls{glsname},
unless you have a particular need for the actual name.

\begin{information}
The name is displayed in the \idx{glossary} using
\gls{glossentryname} not \gls{glsname}. 
\end{information}

The \casechanging\ variants are:
\cmddef{Glsname}
(\idx{sentencecase}) and
\cmddef{GLSname}
(\idx{allcaps}).

\begin{important}
In general it's best to avoid \gls{glsname} with \idxpl{acronym}. Instead,
consider using \gls{acrlong}, \gls{acrshort} or \gls{acrfull}.
Alternatively, for \idxpl{abbreviation} defined with
\sty{glossaries-extra}, use \gls{glsxtrlong}, \gls{glsxtrshort} or
\gls{glsxtrfull}.
\end{important}

\cmddef{glssymbol}
This command always uses the value of the \gloskey+{symbol} key as the
\idx{linktext}.

\begin{information}
The symbol is displayed in the \idx{glossary} using
\gls{glossentrysymbol} not \gls{glssymbol}. 
\end{information}

The \casechanging\ variants are:
\cmddef{Glssymbol}
(\idx{sentencecase}) and
\cmddef{GLSsymbol}
(\idx{allcaps}).

\cmddef{glsdesc}
This command always uses the value of the \gloskey+{description} key as the
\idx{linktext}.

\begin{information}
The description is displayed in the \idx{glossary} using
\gls{glossentrydesc} not \gls{glsdesc}. 
\end{information}

The \casechanging\ variants are:
\cmddef{Glsdesc}
(\idx{sentencecase}) and
\cmddef{GLSdesc}
(\idx{allcaps}).

\cmddef{glsuseri}
This command always uses the value of the 
\gloskey+{user1} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuseri}
(\idx{sentencecase}) and
\cmddef{GLSuseri}
(\idx{allcaps}).

\cmddef{glsuserii}
This command always uses the value of the 
\gloskey+{user2} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuserii}
(\idx{sentencecase}) and
\cmddef{GLSuserii}
(\idx{allcaps}).

\cmddef{glsuseriii}
This command always uses the value of the 
\gloskey+{user3} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuseriii}
(\idx{sentencecase}) and
\cmddef{GLSuseriii}
(\idx{allcaps}).

\cmddef{glsuseriv}
This command always uses the value of the 
\gloskey+{user4} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuseriv}
(\idx{sentencecase}) and
\cmddef{GLSuseriv}
(\idx{allcaps}).

\cmddef{glsuserv}
This command always uses the value of the 
\gloskey+{user5} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuserv}
(\idx{sentencecase}) and
\cmddef{GLSuserv}
(\idx{allcaps}).

\cmddef{glsuservi}
This command always uses the value of the 
\gloskey+{user6} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuservi}
(\idx{sentencecase}) and
\cmddef{GLSuservi}
(\idx{allcaps}).

\subsection{Changing the Format of the \glsfmttext{glslike} Link Text}
\label{sec:glsdisplay}

\begin{xtr}
The \sty{glossaries-extra} package provides ways of altering the
\idx{displaystyle} according to the \gloskey{category}. See the \sty{glossaries-extra}
manual for further details.
\end{xtr}

The default \inlineidxdef{entryformat} (display style) of the \idx{linktext} for the 
\gls{glslike} commands is governed by:
\cmddef{glsentryfmt}
The \sty{glossaries} package defines this to simply use
\gls{glsgenentryfmt}. The \sty{glossaries-extra} package redefines
\gls{glsentryfmt} to allow it to integrated with the
\idxpl{abbrvstyle}.

\begin{information}
The \idx{entryformat} is only applicable to the \gls{glslike}
commands, not the \gls{glstextlike} commands. However, both sets of
commands use \gls{glstextformat} for the font.
\end{information}

You can redefine \gls{glsentryfmt} (but beware of breaking
\idxpl{abbreviation} with \sty{glossaries-extra}), but if you only want the
change the \idx{displaystyle} for a given \idx{glossary}, use:
\cmddef{defglsentryfmt}
instead of redefining \gls{glsentryfmt}. The optional first argument 
\meta{glossary-type} is the \idx{glossary} type. This defaults to
\gls{glsdefaulttype} if omitted. The second argument is the
\idx{entryformat} definition, which needs to use the placeholder commands
described in this section.

In the remainder of this section, \meta{definition} refers to the
argument of \gls{defglsentryfmt} or to the definition of
\gls{glsentryfmt}.

\begin{important}
Note that \gls{glsentryfmt} is the default \idx{displaystyle} for
\idxpl{glossaryentry}. Once the \idx{displaystyle} has been changed for an individual
\idx{glossary} using \gls{defglsentryfmt}, redefining \gls{glsentryfmt}
won't have an effect on that \idx{glossary}, you must instead use
\gls{defglsentryfmt} again. Note that \idxpl{glossary} that have
been identified as lists of \idxpl{acronym} (via the package option
\opt{acronymlists} or the command \gls{DeclareAcronymList}, 
see \sectionref{sec:pkgopts-acronym}) use 
\gls{defglsentryfmt} to set their \idx{displaystyle}.
(The \sty{glossaries-extra} package provides \idx{abbreviation}
support within its redefinition of \gls{glsentryfmt}.)
\end{important}

Within \meta{definition} you may use the following commands:
\cmddef{glslabel}
This expands to the label of the \idx{entry} being referenced.

You can also access the entry's \idx{glossary} type using:
\cmddef{glstype}
This is defined using \gls{protected@edef} so the replacement text is the
actual \idx{glossary} type rather than
\code{\gls{glsentrytype}\marg{\gls{glslabel}}}.

\cmddef{glsinsert}
Expands to the final \meta{insert} optional argument to \gls{gls},
\gls{glspl} and their \casechanging\ variants (or empty if
\meta{insert} was omitted).

\cmddef{glsifplural}
If the plural commands \gls+{glspl}, \gls+{Glspl} or \gls+{GLSpl}
was used, this command expands to \meta{true} otherwise it expands
to \meta{false}.

\cmddef{glscapscase}
If \gls{gls}, \gls{glspl} or \gls{glsdisp} were used, this expands
to \meta{no change}. If the \idx+{sentencecase} commands \gls{Gls} or \gls{Glspl} 
were used, this expands to \meta{sentence}. If the \idx+{allcaps}
commands \gls{GLS} or \gls{GLSpl} were used, this expands to \meta{all caps}.

\cmddef{glscustomtext}
Expands to the custom text supplied in \gls{glsdisp}. It's always empty
for \gls{gls}, \gls{glspl} and their \casechanging\ variants. (You can 
use \sty{etoolbox}'s \csfmt{ifdefempty} to determine if
\gls{glscustomtext} is empty.)

\begin{important}
If \gls{Glsdisp} is used, \gls{glscustomtext} will include the
\idx+{sentencecase} command (\gls{glssentencecase}), but
\gls{glscapscase} will expand to \meta{no change} (since
\gls{Glsdisp} simply uses \gls{glsdisp} without modifying the
placeholder commands).  However, the generic \gls{glsgenentryfmt}
doesn't use \gls{glscapscase} (or \gls{glsifplural}) if
\gls{glscustomtext} isn't empty.
\end{important}

\cmddef{glsifhyperon}
This will do \meta{true} if the \idxpl+{hyperlink} are on for the
current reference, otherwise it will do \meta{false}. The
\idx{hyperlink} may be off even if it wasn't explicitly switched off with
\glsoptval{hyper}{false} key or the use of a starred (\sym{starmod}) command.
It may be off because the \sty{hyperref} package hasn't been loaded
or because \gls{glsdisablehyper} has been used or because the entry
is in a \idx{glossary} type that's had the \idxpl{hyperlink} switched off (using
\opt{nohypertypes}) or because it's the \idx{firstuse} and the
hyperlinks have been suppressed on \idx{firstuse}.

If you want to know if the calling command used to reference
the \idx{entry} was used with the star (\sym+{starmod}) or plus
(\sym+{plusmod}) variant, you can use:
\cmddef{glslinkvar}
This will do \meta{unmodified} if the unmodified version was used,
or will do \meta{star case} if the starred version was used, or
will do \meta{plus case} if the plus version was used. The
custom modifier provided by \sty{glossaries-extra}['s]
\gls{GlsXtrSetAltModifier} will make \gls{glslinkvar} expand to
\meta{unmodified}.

Note that this doesn't take into account if the 
\glsopt{hyper} key was used to override the default
setting, so this command shouldn't be used to guess whether or not
the \idx{hyperlink} is on for this reference. This command is
therefore of limited use. If you want to make the \idx{starmod} or
\idx{plusmod} behave differently, you can try
\gls{GlsXtrSetStarModifier} or \gls{GlsXtrSetPlusModifier} instead,
if you are using \sty{glossaries-extra}.

Note that you can also use commands such as \gls{ifglsused} within
\meta{definition} (see \sectionref{sec:glsunset}), but don't use
\gls{ifglsused} in the \idx{postlinkhook}.

\begin{xtr}
The \sty{glossaries-extra} package has additional commands that may
be used within \meta{definition} to obtain information about the
calling command.
\end{xtr}

The commands \gls{glslabel}, \gls{glstype}, \gls{glsifplural},
\gls{glscapscase}, \gls{glsinsert} and \gls{glscustomtext} are
typically updated at the start of the \gls{glslike} and
\gls{glstextlike}
commands so they can usually be accessed in the hook user commands,
such as \gls{glspostlinkhook} and \gls{glslinkpostsetkeys}.

\begin{warning}
This means that using commands like \gls{gls} within the fields
that are accessed using the \gls{glslike} or \gls{glstextlike} commands
(such as the \gloskey{first}, \gloskey{text}, \gloskey{long}
or \gloskey{short} keys) will cause a problem. The definitions of
the placeholder commands can't be scoped otherwise they won't be
available for the \idx{postlinkhook}, and grouping can also cause
unwanted spacing issues in \idx{mathmode}.
\end{warning}

If you only want to make minor modifications to \gls{glsentryfmt},
you can use the generic \idxc{entryformat}{entry formatting} command:
\cmddef{glsgenentryfmt}
This uses the above commands to display just the \gloskey{first}, 
\gloskey{text}, \gloskey{plural} or \gloskey{firstplural} keys 
(or the custom text) with the insert text appended. For example, to
make the symbol appear in parentheses for the \glostype{symbols}
glossary:
\begin{codebox}
\gls{defglsentryfmt}\oarg{\glostype{symbols}}\marg{\gls{glsgenentryfmt} (\gls{glsentrysymbol}\marg{\gls{glslabel}})}
\end{codebox}

The \idxpl+{acronymstyle} use a similar method to adjust the formatting.
For example, the \acrstyle{long-short} style implements:
\begin{codebox}
\gls{defglsentryfmt}\oargm{type}\marg{\gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}}
\end{codebox}
For each \idx{glossary} that has been identified as a list of
acronyms. This uses the generic \idx{entryformat} command \gls{glsgenentryfmt}
for general \idxpl{entry} (that don't have the \gloskey{long} key set),
otherwise it uses the generic \idx{acronymformat}:
\cmddef{glsgenacfmt}
This uses the values from the \gloskey{long}, \gloskey{short},
\gloskey{longplural} and \gloskey{shortplural} keys, rather than
using the \gloskey{text}, \gloskey{plural}, \gloskey{first} 
and \gloskey{firstplural} keys. The \idx+{firstuse} singular text is obtained via:
\cmddef{genacrfullformat}
instead of from the \gloskey{first} key, and the \idx{firstuse} plural
text is obtained via:
\cmddef{genplacrfullformat}
instead of from the \gloskey{firstplural} key.
In both cases, \meta{label} is the \idx{entry}['s] label and \meta{insert}
is the insert text provided in the final optional argument of
commands like \gls{gls}. The default behaviour is to do the long
form (or plural long form) followed by \meta{insert} and a~space and 
the short form (or plural
short form) in parentheses, where the short form is in the argument
of \gls{firstacronymfont}. There are also \idx{sentencecase}
versions:
\cmddef{Genacrfullformat}
and
\cmddef{Genplacrfullformat}
See \sectionref{sec:acronyms} for details on changing the style of \idxpl{acronym}.

\begin{important}
Note that \gls{glsentryfmt} (or the formatting given by \gls{defglsentryfmt}) 
is not used by the \gls{glstextlike} commands.
\end{important}

\begin{example}{Custom Entry Display in Text}{ex:customfmt}
Suppose you want a \idx{glossary} of measurements and
units, you can use the \gloskey{symbol} key to store the unit:
\begin{codebox}
\gls{newglossaryentry}\marg{distance}\marg{\gloskeyval{name}{distance},
\gloskeyval{description}{The length between two points},
\gloskeyval{symbol}{km}}
\end{codebox}
and now suppose you want \code{\gls{gls}\marg{distance}} to produce
\qt{distance (km)} on \idx{firstuse}, then you can redefine
\gls{glsentryfmt} as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space} (\gls{glsentrysymbol}\marg{\gls{glslabel}})}\comment{}
}
\end{codebox}

(Note that I've used \gls{glsentrysymbol} rather than \gls{glssymbol}
to avoid nested \idxpl{hyperlink}.)

All of the \idx{linktext} will be formatted according
to \gls{glstextformat} (described earlier). So if you do, say:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstextformat}}[1]\marg{\gls{textbf}\marg{\#1}}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space}(\gls{glsentrysymbol}\marg{\gls{glslabel}})}\comment{}
}
\end{codebox}
then \code{\gls{gls}\marg{distance}} will produce \qt{\textbf{distance (km)}}.
This is different from using the \idx{postlinkhook} which is
outside of \gls{glstextformat}.

For a complete document, see the sample file \samplefile{-entryfmt}.
\end{example}

\begin{example}{Custom Format for Particular Glossary}{ex:defglsentryfmt}
Suppose you have created a new \idx{glossary} called
\optfmt{notation} and you want to change the way the entry is
displayed on \idx{firstuse} so that it includes the symbol, you can do:
\begin{codebox}
\gls{defglsentryfmt}\oarg{notation}\marg{\gls{glsgenentryfmt}
 \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space}
   (denoted \gls{glsentrysymbol}\marg{\gls{glslabel}})}}
\end{codebox}
Now suppose you have defined an entry as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{type}{notation},
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of objects},
  \gloskeyval{symbol}{\gls{ensuremath}{S}}
}
\end{codebox}
The \idxc{firstuse}{first time} you reference this entry it will be displayed as:
\qt{set (denoted $S$)} (assuming \gls{gls} was used).

Remember that if you use the \gloskey{symbol} key, you need to use a
\idx{glossarystyle} that displays the symbol, as many of the styles
ignore it.
\end{example}

\subsection{Hooks}
\label{sec:glshooks}

Both the \gls{glslike} and \gls{glstextlike} commands use:
\cmddef{glslinkpostsetkeys}
after the \meta{options} are set. This macro does nothing by default
but can be redefined. (For example, to switch off the \idx{hyperlink}
under certain conditions.) The \sty{glossaries-extra} package
additionally provides \gls{glslinkpresetkeys}.

There is also a hook (the
\idx+{postlinkhook}) that's implemented at the end:
\cmddef{glspostlinkhook}
This is done after the \idx{linktext} has been displayed and also
\emph{after} the \idx{firstuseflag} has been unset (see
example~\ref{ex:dotabbr}). This means that it's too late to use
\gls{ifglsused} in the definition of \gls{glspostlinkhook}. The
\sty{glossaries-extra} package provides \gls{glsxtrifwasfirstuse}
for use in the \idx{postlinkhook}.

\begin{xtr}
The \sty{glossaries-extra} package redefines \gls{glspostlinkhook}
to allow for additional hooks that can vary according to the entry's
\gloskey{category}. If you migrate over from only using the base
\sty{glossaries} package to \sty{glossaries-extra} and
you have redefined \gls{glspostlinkhook}, consider moving your
modifications to the category post-link hook to avoid breaking the
extended \idx{postlinkhook} features. See the \sty{glossaries-extra}
manual for further details.
\end{xtr}


\subsection{Enabling and Disabling Hyperlinks to Glossary Entries}
\label{sec:disablehyperlinks}

If you load \sty{hyperref} prior to loading the \sty{glossaries}
package, the \gls{glslike} and \gls{glstextlike} commands will
automatically have \idxpl+{hyperlink} to the relevant 
\idx{glossaryentry}, unless the \glsopt{hyper} option has been switched off
(either explicitly or through implicit means, such as via the
\opt{nohypertypes} package option).

You can disable or enable \idxpl{hyperlink} using:
\cmddef{glsdisablehyper}
and
\cmddef{glsenablehyper}
respectively. The effect can be localised by placing the commands
within a group. Note that you should only use \gls{glsenablehyper}
if the commands \gls{hyperlink} and \gls{hypertarget} have been
defined, otherwise you will get undefined control sequence errors.
If the \sty{hyperref} package is loaded before \sty{glossaries},
\gls{glsenablehyper} will be use automatically.

You can disable just the \idx{firstuse} links using the package
option \optval{hyperfirst}{false}. Note that this option only
affects the \gls{glslike} commands that recognise the
\idx{firstuseflag}.

\begin{example}{First Use With Hyperlinked Footnote Description}{ex:hyperdesc}
Suppose I want the \idx+{firstuse} to have a \idx{hyperlink} to the
description in a footnote instead of hyperlinking to the relevant
place in the \idx{glossary}. First I need to disable the
\idxpl{hyperlink} on \idx{firstuse} via the package option 
\optval{hyperfirst}{false}:
\begin{codebox}
\cmd{usepackage}[\optval{hyperfirst}{false}]\marg{glossaries}
\end{codebox}
Now I need to redefine \gls{glsentryfmt} (see
\sectionref{sec:glsdisplay}):
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls+{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}\comment{}
}
\end{codebox}

Now the \idx{firstuse} won't have hyperlinked text, but will be followed
by a footnote.
See the sample file \samplefile{-FnDesc} for a complete document.
\end{example}

Note that the \opt{hyperfirst} option applies to all defined
\idxpl{glossary}.  It may be that you only want to disable the
\idxpl{hyperlink} on \idx{firstuse} for \idxpl{glossary} that have a
different form on \idx{firstuse} (such as list of \idxpl{acronym}). This
can be achieved by noting that since the \idxpl{entry} that require
hyperlinking for all instances have identical \idxc{firstuse}{first} 
and \idxc{subsequentuse}{subsequent} text, they can be unset via \gls{glsunsetall} (see
\sectionref{sec:glsunset}) so that the \opt{hyperfirst} option
doesn't get applied.

\begin{example}{Suppressing Hyperlinks on First Use Just For
Acronyms}{ex:hyperfirst}
Suppose I want to suppress the \idx{hyperlink} on \idx{firstuse} for
\idxpl{acronym} but not for \idxpl{entry} in the \glostype{main} glossary.  I~can load
the \sty{glossaries} package using:
\begin{codebox}
\cmd{usepackage}[\optval{hyperfirst}{false},\opt{acronym}]\marg{glossaries}
\end{codebox}
Once all \idxpl{glossaryentry} have been defined I~then do:
\begin{codebox}
\gls{glsunsetall}\oarg{\glostype{main}}
\end{codebox}
(Alternatively use the \catattr{nohyperfirst} \idx{categoryattribute} with
\sty{glossaries-extra}.)
\end{example}

For more complex requirements, you might find it easier to switch
off all \idxpl{hyperlink} via \gls{glsdisablehyper} and put the
\idxpl{hyperlink} (where required) within the definition of
\gls{glsentryfmt} (see \sectionref{sec:glsdisplay}) via
\gls{glshyperlink} (see \sectionref{sec:glsnolink}).

\begin{example}{Only Hyperlink in Text Mode Not Math
Mode}{ex:nomathhyper}
This is a bit of a contrived example, but suppose, for some reason,
I only want the \gls{glslike} commands to have
hyperlinks when used in text mode, but not in \idx{mathmode}. I~can do
this by adding the \idx{glossary} to the list of \opt{nohypertypes} and redefining 
\gls{glsentryfmt}:
\begin{codebox}
\gls{GlsDeclareNoHyperList}\marg{\glostype{main}}
\codepar
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \cmd{ifmmode}
    \gls{glsgenentryfmt}
  \cmd{else}
    \gls{glsifhyperon}
    \marg{\gls{glsgenentryfmt}}\comment{hyperlink already on}
    \marg{\gls{glshyperlink}\oarg{\gls{glsgenentryfmt}}\marg{\gls{glslabel}}}\comment{}
  \cmd{fi}
}
\end{codebox}
Note that this doesn't affect the \gls{glstextlike} commands, which will
have the hyperlinks off unless they're forced on using the 
\idx{plusmod} variant or with an explicit use of \glsopt{hyper}{true}.

See the sample file \samplefile{-nomathhyper} for a complete
document.
\end{example}

\begin{example}{One Hyper Link Per Entry Per Chapter}{ex:chap-hyperfirst}
Here's a more complicated example that will only have the
\idx{hyperlink} on the first time an entry is used per chapter. This
doesn't involve resetting the \idx{firstuseflag}. Instead it adds
a~new key using \gls{glsaddstoragekey} (see
\sectionref{sec:glsaddstoragekey}) that keeps track of the chapter
number that the entry was last used in:
\begin{codebox}
\gls{glsaddstoragekey}\marg{chapter}\marg{0}\marg{\cmd{glschapnum}}
\end{codebox}
This creates a new user command called \csfmt{glschapnum} that's
analogous to \gls{glsentrytext}. The default value for this key is~0.
I~then define my \idxpl{glossaryentry} as usual.

Next I redefine the hook \gls{glslinkpostsetkeys}
(see \sectionref{sec:glsdisplay}) so that it determines the current
chapter number (which is stored in \csfmt{currentchap} using
\csfmt{edef}). This value is then compared with the value of the
\idx{entry}['s] \optfmt{chapter} key that I defined earlier. If they're the
same, this \idx{entry} has already been used in this chapter so the
\idx{hyperlink} is switched off using \sty{xkeyval}'s \csfmt{setkeys}
command. If the chapter number isn't the same, then this \idx{entry}
hasn't been used in the current chapter. The \optfmt{chapter} field
is updated using \gls{glsfieldxdef} (\sectionref{sec:fetchset})
provided the user hasn't switched off the \idx{hyperlink}.
(This test is performed using \gls{glsifhyperon}.)
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkpostsetkeys}}\marg{\comment{}
 \cmd{edef}\cmd{currentchap}\marg{\gls{arabic}\marg{\ctr{chapter}}}\comment{}
 \cmd{ifnum}\cmd{currentchap}=\cmd{glschapnum}\marg{\gls{glslabel}}\gls{relax}
  \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\comment{}
 \cmd{else}
  \gls{glsifhyperon}\marg{\gls{glsfieldxdef}\marg{\gls{glslabel}}\marg{chapter}\marg{\cmd{currentchap}}}{}\comment{}
 \cmd{fi}
}
\end{codebox}
Note that this will be confused if you use \gls{gls} etc when the
chapter counter is~0. (That is, before the first \gls{chapter}.)

See the sample file \samplefile{-chap-hyperfirst} for a complete
document.
\end{example}

\section{Using Glossary Terms Without Indexing}
\label{sec:glsnolink}

The commands described in this section display \idx{entry} details without
adding any information to the \idx{glossary}. They don't use
\gls{glstextformat} or the \idx{entryformat}, they don't have any
optional arguments, they don't affect the \idx{firstuseflag} and,
apart from \gls{glshyperlink} and the \idx{numberlist} commands,
they don't produce \idxpl{hyperlink}.

\begin{important}
If you want to use the \idx+{sentencecase} commands in
\idxpl+{PDFbookmark}, such as
\gls{Glsentrytext}, ensure you have at least version 2.08 of
\sty{mfirstuc}. Inside \idxpl{PDFbookmark}, those commands will expand
with the \idx{sentencecase} applied using the expandable 
\gls{MFUsentencecase}. Outside of \idxpl{PDFbookmark} those commands will expand
to an internal robust command that applies the \idx{sentencecase}
with \gls{glssentencecase} (which defaults to \gls{makefirstuc}).
\end{important}

If you want to \idx+{titlecase} a field, you can use:
\cmddef{glsentrytitlecase}
where \meta{entry-label} is the label identifying the \idx{glossaryentry},
\meta{field} is the \idx{internalfieldlabel} (see \tableref{tab:fieldmap}).
This internally uses \gls{glscapitalisewords}. Within \idxpl{PDFbookmark}, 
this command will expand to \idx{sentencecase} using the expandable
\gls{MFUsentencecase}.  (The \idx{titlecase} command
\gls{capitalisewords} isn't expandable.)

\begin{warning}
If your field contains formatting commands, you will need to
redefine \gls{glscapitalisewords} to use \gls{capitalisefmtwords}
instead of \gls{capitalisewords}.  See the \sty{mfirstuc} manual for
further details.
\end{warning}

For example, to convert the description to \idx{titlecase} for the
entry identified by the label \qt{sample}:
\begin{codebox}
\gls{glsentrytitlecase}\marg{sample}\marg{\glosfield{desc}}
\end{codebox}
(If you want \idxc{titlecase}{title-casing} in your
\idx{glossarystyle}, you might want to
investigate the \sty{glossaries-extra} package.) This command will
trigger an error if the entry is undefined.

If you want a \idx+{hyperlink} to an \idx{entry}['s] line in the
\idx{glossary} but don't want the \idx{indexing} or
formatting associated with the \gls{glslike} and \gls{glstextlike}
commands, you can use:
\cmddef{glshyperlink}
This command provides a \idx{hyperlink} \strong{but does not add any
information to the \idx{glossaryfile}}. The \idx{hyperlink} text is
given by the optional argument, which defaults to
\code{\gls{glsentrytext}\margm{label}}.  Note that the \idx{hyperlink} will
be suppressed if you have used \gls{glsdisablehyper} or if you
haven't loaded the \sty{hyperref} package.

\begin{important}
If you use \gls{glshyperlink}, you need to ensure that the relevant
entry has been added to the \idx{glossary} using any of the commands
described in \sectionref{sec:glslink} or \sectionref{sec:glsadd}
otherwise you will end up with an undefined \idx{hyperlink} target.
\end{important}

The following commands in form form \csmetafmt{glsentry}{field}{} 
expand to the associated field value for the
entry identified by \meta{entry-label} for the non-\casechanging\
versions. Those commands don't check if the \idx{entry} has been defined.
The \idx{sentencecase} versions \csmetafmt{Glsentry}{field}{} only
expand in \idxpl{PDFbookmark}. In both cases, any fragile commands within the field
values will need to be protected or made robust if the field values
are required in a moving argument.

There are also commands in the form \csmetafmt{glossentry}{field}{}
for the \gloskey{name}, \gloskey{description} and \gloskey{symbol}
that are used by the \idxpl{glossarystyle}. Those commands will 
issue a warning if the \idx{entry} hasn't been defined. See
\sectionref{sec:styles} for further information.

\cmddef{glsentryname}
Expands to the value of the \gloskey{name} field. Note that within
\idxpl{glossarystyle}, the name is displayed using
\gls{glossentryname}.
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryname}

\begin{important}
In general it's best to avoid \gls{Glsentryname} with \idxpl{acronym}
or \idxpl{abbreviation}. Instead,
consider using \gls{Glsentrylong}, \gls{Glsentryshort} or \gls{Glsentryfull}.
\end{important}

\cmddef{glsentrytext}
Expands to the value of the \gloskey{text} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrytext}

\cmddef{glsentryplural}
Expands to the value of the \gloskey{plural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryplural}

\cmddef{glsentryfirst}
Expands to the value of the \gloskey{first} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryfirst}

\cmddef{glsentryfirstplural}
Expands to the value of the \gloskey{firstplural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryfirstplural}

\cmddef{glsentrydesc}
Expands to the value of the \gloskey{description} field. Note that within
\idxpl{glossarystyle}, the description is displayed using
\gls{glossentrydesc}.
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrydesc}

\cmddef{glsentrydescplural}
Expands to the value of the \gloskey{descriptionplural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrydescplural}

\cmddef{glsentrysymbol}
Expands to the value of the \gloskey{symbol} field. Note that within
\idxpl{glossarystyle}, the description is displayed using
\gls{glossentrysymbol}.
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrysymbol}

\cmddef{glsentrysymbolplural}
Expands to the value of the \gloskey{symbolplural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrysymbolplural}

\cmddef{glsentryuseri}
Expands to the value of the \gloskey{user1} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuseri}

\cmddef{glsentryuserii}
Expands to the value of the \gloskey{user2} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuserii}

\cmddef{glsentryuseriii}
Expands to the value of the \gloskey{user3} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuseriii}

\cmddef{glsentryuseriv}
Expands to the value of the \gloskey{user4} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuseriv}

\cmddef{glsentryuserv}
Expands to the value of the \gloskey{user5} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuserv}

\cmddef{glsentryuservi}
Expands to the value of the \gloskey{user6} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuservi}

The next two commands, \gls{glsentrynumberlist} and
\gls{glsdisplaynumberlist}, display the \idx{entry}['s] \idx{numberlist}. This 
information is readily available with \options{noidx,b2g} (where the
\idx{numberlist} is stored in the \glosfield{loclist} or
\gloskey{location} internal fields) but not for
\options{mkidx,xdy} (where the \idx{numberlist} is simply part of
the code to typeset the \idx{glossary} written in the \idx{glossaryfile}).

If you need to parse the \idx{numberlist}, split it into groups
based on the \idx{locationcounter}, or extract a primary \location\
then \option{b2g} (\app{bib2gls}) is your best option.

\cmddef{glsentrynumberlist}
Displays the \idx{numberlist} for the given \idx{entry} in the same format
as it's shown by default in the \idx{glossary}. The \locations\ will
have \idxpl{hyperlink} if supported.

This command is at its simplest with \option{b2g}, where it just
displays the value of the \gloskey{location} internal field that's
set by \app{bib2gls} in the \ext{glstex} file. This will use the
delimiters supplied by \app{bib2gls} (\gls{bibglsdelimN} and
\gls{bibglslastDelimN}) for individual \locations\ as well as \gls{delimR}
for \idxpl{range}, as used in the \idx{glossary}.

With \option{noidx}, \gls{glsentrynumberlist} passes the value of
the \idx{entry}['s] \glosfield{loclist} internal field (that's created when
the \ext+{aux} file is input) to \gls{glsnoidxloclist} (which is
also used by \gls{printnoidxglossary}). This will result in a simple
list with each \location\ separated with \gls{delimN}, as used in
the \idx{glossary}.  Note that this doesn't allow for \idxpl{range} (as with
\gls{printnoidxglossary}).

With \options{mkidx,xdy}, you will need the \opt{savenumberlist}
package option, which will attempt to gather the \idx{numberlist}
information when the \idxc{indexingfile}{glossary file} is input by
\gls{printglossary}. Since \idxpl{glossary} often occur at the end
of the document, this means that the information has to be saved in
the \ext+{aux} file for the next \LaTeX\ run. Therefore an extra
\LaTeX\ call is required if \gls{glsentrynumberlist} is needed with
\app{makeindex} or \app{xindy}. This will use the same \gls{delimN}
and \gls{delimR} as used in the \idx{glossary}.

\cmddef{glsdisplaynumberlist}
This attempts to display the \idx{numberlist} with the separators:
\cmddef{glsnumlistsep}
between each \location\ except for the last pair and
\cmddef{glsnumlistlastsep}
between the last pair.

As with \gls{glsentrynumberlist}, this is again at its simplest with
\option{b2g}. This works by locally setting \gls{bibglsdelimN} to
\gls{glsnumlistsep} and \gls{bibglslastDelimN} to
\gls{glsnumlistlastsep} and then displaying the value of the
\gloskey{location} field. You can instead simply redefine
\gls{bibglsdelimN} and \gls{bibglslastDelimN} as desired and use
\gls{glsentrynumberlist}.

With \option{noidx}, the \idx{numberlist} information is stored in
the \glosfield{loclist} internal field, which is in the format of an
\sty{etoolbox} internal list. So with \option{noidx},
\gls{glsdisplaynumberlist} uses \sty{etoolbox}['s] \gls{forlistloop}
to iterate over the field value using the handler macro:
\cmddef{glsnoidxdisplayloclisthandler}
Note that this doesn't allow for \idxpl{range}.

If \sty{hyperref} has been loaded, \gls{glsdisplaynumberlist}
doesn't work with \options{mkidx,xdy}. In which case, a warning will
be triggered and \gls{glsentrynumberlist} will be used instead.
Without \sty{hyperref}, the \opt{savenumberlist} package option is
still required, and an attempt will be made to parse the formatted
\idx{numberlist} created by \app{makeindex}\slash\app{xindy} in
order to obtain the desired result.

\begin{warning}
\gls{glsdisplaynumberlist} is fairly experimental. It works best with
\option{b2g}, works with limited results with \options{noidx}, but
for \optionsor{mkidx,xdy} it only works when the default 
\idx{locationformat} is used (that is, with the default
\glsopt{format}{glsnumberformat}).  This command will only work with
\sty{hyperref} if you choose \optionsor{noidx,b2g}.
\end{warning}

\chapter{Acronyms and Other Abbreviations}
\label{sec:acronyms}

\begin{information}
The term \qt{\inlineidxdef{acronym}} is used here to describe the
base \sty{glossary} package's mechanism for dealing with acronyms,
initialisms, contractions and anything else that may have a
shortened form for brevity. The term
\qt{\inlineidxdef{abbreviation}} is used to describe the enhanced
mechanism provided by the \sty{glossaries-extra} package, which is
incompatible with the base \idx{acronym} mechanism.
\end{information}

\Idxpl{acronym} internally use \gls{newglossaryentry}, so you can
reference them with \gls{gls} and \gls{glspl} as with other
\idxpl{entry}. Whilst it is possible to simply use
\gls{newglossaryentry} explicitly with the
\gloskey{first} and \gloskey{text} keys set to provide a full form on
\idx{firstuse} and a shortened form on \idx{subsequentuse}, using
\gls{newacronym} establishes a consistent format. It also makes it
possible to shift the \meta{insert} optional argument of the
\gls{glslike} commands inside the full form, so that it is placed
before the parentheses.

The way the \idx{acronym} is displayed on \idx{firstuse} is
governed by the \idx{acronymstyle} that's identified with
\gls{setacronymstyle}.  This should be set before you define
your \idxpl{acronym}. \mExampleref{ex:simpleacronyms} demonstrates the
use of \gls{newacronym}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup language}
\cbeg{document}
First use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
\codepar
Next use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
\cend{document}
\end{codebox}
\begin{resultbox}
\createexample*[title={Simple document with acronyms},
 label={ex:simpleacronyms},
 description={Example document that defines some acronym entries
and references them in the text.}]
{%
\cmd{usepackage}\marg{glossaries}^^J%
\gls{setacronymstyle}\marg{long-short}^^J%
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}^^J%
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup language}
}%
{%
First use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
\codepar
Next use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
}
\end{resultbox}

\Idxpl{acronym} are defined using:
\cmddef{newacronym}
This creates a \idx+{glossaryentry} with the given label. This automatically sets
\gloskeyval{type}{\gls{acronymtype}} but if the \idx{acronym} should go in 
another \idx{glossary} you can set the \gloskey{type} in the
optional argument \keyvallist, which is added to the end of
the \keyvallist\ in \gls{newglossaryentry}.

The \gls{newacronym} command also uses the \gloskey{long},
\gloskey{longplural}, \gloskey{short} and \gloskey{shortplural} keys
in \gls{newglossaryentry} to store the long and short forms and
their plurals. 

\begin{xtr}
If you use \gls{newacronym} with \sty{glossaries-extra}, you need to
first set the \idx{abbrvstyle} for the \cat{acronym} category with:
\begin{compactcodebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\margm{style-name}
\end{compactcodebox}
\end{xtr}

Note that the same restrictions on \meta{entry-label} in
\gls{newglossaryentry} also apply to \gls{newacronym} (see
\sectionref{sec:newglosentry}).  Since \gls{newacronym} is defining
the \idx{entry} with \gls{newglossaryentry}, you can use \gls{glsreset} to
reset the \idx{firstuseflag}.

\begin{warning}
Remember to declare the specified \idx{glossary} type as a
list of \idxpl{acronym} (via the package option \opt{acronymlists} or the
command \gls{DeclareAcronymList}) if you have multiple lists of
\idxpl{acronym}. See \sectionref{sec:pkgopts-acronym}.
Alternatively, use \sty{glossaries-extra} to have better support for
a mixed \idxpl{glossary}.
\end{warning}

The optional argument \keyvallist\ allows you to specify
additional information. Any key that can be used in the second
argument of \gls{newglossaryentry} can also be used here in
\keyvallist, but be careful about overriding any keys that are set
by the \idx{acronymstyle}, such as \gloskey{name}, \gloskey{short}
and \gloskey{long}.

For example, you may need to supply \gloskey{description} (when used
with one of the \idxc{acronymstyle}{styles} that require a description, described in
\sectionref{sec:setacronymstyle}) or you can override plural forms
of \meta{short} or \meta{long} using the \gloskey{shortplural} or
\gloskey{longplural} keys.  For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{longplural}{diagonal matrices}}
  \marg{dm}\marg{DM}\marg{diagonal matrix}
\end{codebox}
If the \idx{firstuse} uses the plural form, \code{\gls{glspl}\marg{dm}} will
display: diagonal matrices (DMs).

As with \gloskey{plural}, if \gloskey{longplural} is missing, it's
obtained by appending \gls{glspluralsuffix} to the singular form. The
short plural \gloskey{shortplural} is obtained (if not explicitly
set in \keyvallist) by appending: 
\cmddef{glsacrpluralsuffix}
to the short form. These commands may be changed by the associated
language files, but they can't be added to the usual caption hooks
as there's no guarantee when they'll be expanded (as
\hyperref[pluralsuffix]{discussed earlier} in \sectionref{sec:newlang}). 

\begin{xtr}
A different approach is used by \sty{glossaries-extra}, which has
\idxpl{categoryattribute} to determine whether or not to append a
suffix when forming the default value of \gloskey{shortplural}.
\end{xtr}

\begin{important}
Since \gls{newacronym} implicitly sets
\gloskeyval{type}{\gls{acronymtype}}, if you want to load a
file containing \idx{acronym} definitions using \gls{loadglsentries}, the
optional argument that specifies the \idx{glossary} will not have an
effect unless you explicitly set
\gloskeyval{type}{\gls{glsdefaulttype}} in the optional argument to
\gls{newacronym}. See \sectionref{sec:loadglsentries}.
\end{important}

\mExampleref{ex:newacronym} defines the \idx{acronym} IDN and then uses it in the
document text. It then resets the \idx{firstuseflag} and uses it
again.
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
\cbeg{document}
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.
Next use:
the \gls{gls}\marg{idn}['s] prefix is a capital letter.
\cend{document}
\end{codebox}
The reset (\gls{glsreset}) makes the next instance of \gls{gls}
behave as \idx{firstuse}. Note also the way the final \meta{insert}
optional argument is treated.
\begin{resultbox}
\createexample*[title={Defining and Using an Acronym},
 label={ex:newacronym},
 description={Example document that defines an acronym
and references it in the text.}]
{%
\cmd{usepackage}\marg{glossaries}^^J%
\gls{setacronymstyle}\marg{long-short}^^J%
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
}
{%
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.^^J%
Next use: the \gls{gls}\marg{idn}['s] prefix is a capital letter.
}
\end{resultbox}
If the \idx{acronym} had simply been defined with:
\begin{codebox}
\gls{newglossaryentry}\marg{idn}\marg{
  \gloskey{name}{IDN},
  \gloskey{first}{identification number (IDN)},
  \gloskey{description}{identification number}
}
\end{codebox}
then the \idx{firstuse} of \code{\gls{gls}\marg{idn}['s]} would have placed in the
\meta{insert} after the parentheses:
\begin{resultbox}
The identification number (IDN)'s prefix is a capital letter.
\end{resultbox}

If you want to use one of the \idx{smallcaps} \idxpl{acronymstyle},
described in \sectionref{sec:setacronymstyle}, you need to use
\idx{lowercase} characters for the shortened form:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\gls{newacronym}\marg{idn}\marg{idn}\marg{identification number}
\end{codebox}

\begin{important}
Avoid nested definitions.
\end{important}

Recall from the warning in \sectionref{sec:newglosentry} that you
should avoid using the \gls{glslike} and \gls{glstextlike} commands
within the value of keys like \gloskey{text} and \gloskey{first} due
to complications arising from nested links. The same applies to
acronyms defined using \gls{newacronym}.

For example, suppose you have defined:
\begin{codebox}
\gls{newacronym}\marg{ssi}\marg{SSI}\marg{server side includes}
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}
\end{codebox}
you may be tempted to do:
\begin{codebox}
\gls{newacronym}\marg{shtml}\marg{S\gls{gls}\marg{html}}\marg{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}
\end{codebox}
\strong{Don't!} This will break the \casechanging\ commands, such
as \gls{Gls}, it will cause inconsistencies on \idx+{firstuse}, and,
if \idxpl+{hyperlink} are enabled, will cause nested
\idxpl{hyperlink}, and it will \idxc{indexing}{index} the nested
\idxpl{entry} every time the dependent \idx{entry} is \indexed,
which creates unnecessary \locations. It will
also confuse the commands used by the \idxc{entryformat}{entry formatting} (such as
\gls{glslabel}).

Instead, consider doing:
\begin{codebox}
\gls{newacronym}
 \oarg{\gloskeyval{description}{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}}
 \marg{shtml}\marg{SHTML}\marg{SSI enabled HTML}
\end{codebox}
or if the font needs to match the style:
\begin{codebox}
\gls{newacronym}
 \oarg{\gloskeyval{description}{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}}
 \marg{shtml}\marg{SHTML}\marg{\gls{acronymfont}\marg{SSI} enabled \gls{acronymfont}\marg{HTML}}
\end{codebox}
Alternatively:
\begin{codebox}
\gls{newacronym}
 \oarg{\gloskeyval{description}{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}}
 \marg{shtml}\marg{SHTML}
 \marg{server side includes enabled hypertext markup language}
\end{codebox}
Similarly for the \gls{glstextlike} commands.

\begin{xtr}
Other approaches are available with \sty{glossaries-extra}.
See the sections \qt{Nested Links} and \qt{Multi (or Compound)
Entries} in the \sty{glossaries-extra} user manual.
\end{xtr}

\section{Displaying the Long, Short and Full Forms (Independent of
First Use)}
\label{sec:longshortfull}

It may be that you want the long, short or full form
regardless of whether or not the \idx{acronym} has already been 
\idxc{firstuse}{used} in the document. You can do so with the
commands described in this section.

The \csfmt{acr\ldots} commands described below are part of the set
of \gls{glstextlike} commands. That is, they \idxc+{indexing}{index}
and can form \idxpl+{hyperlink}, and they don't modify or test the
\idx+{firstuseflag}.  However, unlike the other \gls{glstextlike}
commands, their \idxc{displaystyle}{display} is governed by
\gls{defglsentryfmt} with \gls{glscustomtext} set to the appropriate
\idx{linktext}. So, for example, 
\begin{compactcodebox}
\gls{acrshort}\margm{label}\oargm{insert}
\end{compactcodebox}
is similar to:
\begin{compactcodebox}
\gls{glsdisp}\marg{\comment{}
 \gls{acronymfont}\marg{\gls{glsentryshort}\margm{label}}\meta{insert}}
\end{compactcodebox}
except that the \idx{firstuseflag} isn't unset.

All caveats that apply to the \gls{glstextlike} commands also apply
to the following commands.  (Including the above warning about
nested links.)

\begin{xtr}
If you are using \sty{glossaries-extra}, don't use the commands
described in this section. The \sty{glossaries-extra} package
provides analogous \csfmt{glsxtr\ldots} or \csfmt{glsfmt\ldots}
commands.  For example, \gls{glsxtrshort} instead of \gls{acrshort}
or, if needed in a heading, \gls{glsfmtshort}. (Similarly for the
\casechanging\ variants.)
\end{xtr}

The optional arguments are the same as those for the \gls{glstextlike}
commands, and there are similar star (\sym{starmod}) and plus
(\sym{plusmod}) variants that switch
off or on the \idxpl{hyperlink}. As with the \gls{glstextlike} commands, the
\idx{linktext} is placed in the argument of \gls{glstextformat}.

\cmddef{acrshort}
This sets the \idx{linktext} to the short form (within the argument
of \gls{acronymfont}) for the \idx{acronym} given by \meta{entry-label}. The short
form is as supplied by the \gloskey{short} key, which
\gls{newacronym} implicitly sets.

There are also analogous \casechanging\ variants:
\cmddef{Acrshort}
(\idx{sentencecase}) and
\cmddef{ACRshort}
(\idx{allcaps}).

There are also plural versions:
\cmddef{acrshortpl}
As \gls{acrshort} but uses the \gloskey{shortplural} value.
\cmddef{Acrshortpl}
(\idx{sentencecase}) and
\cmddef{ACRshortpl}
(\idx{allcaps}).

\cmddef{acrlong}
This sets the \idx{linktext} to the long form for the \idx{acronym} given by 
\meta{entry-label}. The long form is as supplied
by the \gloskey{long} key, which \gls{newacronym} implicitly sets.

There are also analogous \casechanging\ variants:
\cmddef{Acrlong}
(\idx{sentencecase}) and
\cmddef{ACRlong}
(\idx{allcaps}).

Again there are also plural versions:
\cmddef{acrlongpl}
As \gls{acrlong} but uses the \gloskey{longplural} value.
\cmddef{Acrlongpl}
(\idx{sentencecase}) and
\cmddef{ACRlongpl}
(\idx{allcaps}).

\cmddef{acrfull}
This sets the \idx{linktext} to show the full form according to the
format governed by the \idx{acronymstyle}. This may not necessarily
be the same format as that produced on the \idx{firstuse} of \gls{gls}.
For example, the \acrstyle{footnote} style has the long form in a
footnote on the \idx{firstuse} of \gls{gls} but \gls{acrfull} has the long form in
parentheses instead.

There are also analogous \casechanging\ variants:
\cmddef{Acrfull}
(\idx{sentencecase}) and
\cmddef{ACRfull}
(\idx{allcaps}).

The plural version is:
\cmddef{acrfullpl}
with \casechanging\ variants:
\cmddef{Acrfullpl}
(\idx{sentencecase}) and
\cmddef{ACRfullpl}
(\idx{allcaps}).

If you find the above commands too cumbersome to write, you can use
the \opt{shortcuts} package option to activate the shorter
command names listed in \tableref{tab:shortcuts}.

\begin{table}[htbp]
\caption{Synonyms provided by the \glsfmttext{opt.shortcuts} package option}
\label{tab:shortcuts}
\centering
\begin{tabular}{ll}
\bfseries Shortcut Command & \bfseries Equivalent Command\\
\inlineglsdef{acs} & \gls{acrshort}\\
\inlineglsdef{Acs} & \gls{Acrshort}\\
\inlineglsdef{acsp} & \gls{acrshortpl}\\
\inlineglsdef{Acsp} & \gls{Acrshortpl}\\
\inlineglsdef{acl} & \gls{acrlong}\\
\inlineglsdef{Acl} & \gls{Acrlong}\\
\inlineglsdef{aclp} & \gls{acrlongpl}\\
\inlineglsdef{Aclp} & \gls{Acrlongpl}\\
\inlineglsdef{acf} & \gls{acrfull}\\
\inlineglsdef{Acf} & \gls{Acrfull}\\
\inlineglsdef{acfp} & \gls{acrfullpl}\\
\inlineglsdef{Acfp} & \gls{Acrfullpl}\\
\inlineglsdef{ac} & \gls{gls}\\
\inlineglsdef{Ac} & \gls{Gls}\\
\inlineglsdef{acp} & \gls{glspl}\\
\inlineglsdef{Acp} & \gls{Glspl}
\end{tabular}
\end{table}

It is also possible to access the long and short forms without
\idx{indexing} using commands analogous to \gls{glsentrytext}
(described in \sectionref{sec:glsnolink}). These don't include the
\idx{acronym} font commands, such as \gls{acronymfont}.

\cmddef{glsentrylong}
Expands to the long form (that is, the value of the \gloskey{long}
key, which is internally set by \gls{newacronym}).
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrylong}

\cmddef{glsentrylongpl}
Expands to the long plural form (that is, the value of the
\gloskey{longplural}).
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrylongpl}

\cmddef{glsentryshort}
Expands to the short form (that is, the value of the \gloskey{short}
key, which is internally set by \gls{newacronym}).
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryshort}

An similar command is available for the full form:
\cmddef{glsentryfull}
This command is redefined by the \idx{acronymstyle}.
Unlike \gls{glsentrylong} and \gls{glsentryshort}, this does include
\gls{acronymfont}, so if you need to use it in a section heading,
you may need to disable it in \idxpl{PDFbookmark}:
\begin{codebox*}
\gls{pdfstringdefDisableCommands}\marg{\comment{provided by \sty{hyperref}}
 \cmd{let}\gls{acronymfont}\gls{@firstofone}
 \cmd{let}\gls{firstacronymfont}\gls{@firstofone}
}
\end{codebox*} 

\cmddef{Glsentryfull}
This is like \gls{glsentryfull} but applies \idx{sentencecase}.

The analogous plural commands are:
\cmddef{glsentryfullpl}
(no \idx{casechange}) and
\cmddef{Glsentryfullpl}
(\idx{sentencecase}).

\section{Changing the Acronym Style}
\label{sec:setacronymstyle}

\begin{xtr}
If you are using \sty{glossaries-extra}, don't use the commands
described in this section. Use \gls{setabbreviationstyle} to set
the \idx{abbrvstyle}. This uses a different (but more consistent) naming
scheme. For example, \abbrstyle{long-noshort} instead of
\acrstyle{dua}. See the \qt{Abbreviations} chapter in the 
\sty{glossaries-extra} manual for further details.
\end{xtr}

The \idx+{acronymstyle} is set using:
\cmddef{setacronymstyle}
where \meta{style name} is the name of the required style.
The style must be set before the \idxpl{acronym} are defined
otherwise you will end up with inconsistencies.

For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries}
\codepar
\gls{makeglossaries}
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\codepar
\gls{newacronym}\marg{html}\marg{html}\marg{hypertext markup language}
\gls{newacronym}\marg{xml}\marg{xml}\marg{extensible markup language}
\end{codebox}

Unpredictable results will occur if you try to use multiple styles
since each \idx{acronymstyle} redefines commands like
\gls{glsentryfull} and \gls{genacrfullformat} that govern the way
the full form is displayed. The closest you can get to different
styles if you only want to use the base \sty{glossaries} package is
to adjust the \idx{entryformat} (see \sectionref{sec:glsdisplay})
or to provide a custom \idx{acronymstyle} such as in 
\exampleref{ex:addstoragekey}.

\begin{important}
If you need multiple styles, then 
use the \sty{glossaries-extra} package, which has better
\idx{abbreviation} management. See, for example,
\gallerypage{sample-name-font}{Gallery: Mixing Styles}.
\end{important}

The \gls{setacronymstyle} command will redefine \gls{newacronym} to
use the newer \idx{acronym} mechanism introduced in version 4.02
(2013-12-05).  The older mechanism was available, but deprecated, for
backward-compatibility until version 4.50 when it was removed.  If
the pre-4.02 \idx{acronym} styles are required, you will need to use
rollback. As from v4.50, if you don't use \gls{setacronymstyle}, the
first instance of \gls{newacronym} will automatically implement:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
which is the closest match to the old default.
\mExampleref{ex:newacronymrollback} is a modification of the earlier
\exampleref{ex:newacronym} so that it uses rollback in order to
demonstrate the difference:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}[=v4.46]\comment{rollback to v4.46}
\comment{no \gls{setacronymstyle} so old style used}
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
\cbeg{document}
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.
Next use:
the \gls{gls}\marg{idn}['s] prefix is a capital letter.
\cend{document}
\end{codebox}
This produces:
\begin{resultbox}
\createexample*[title={Defining and Using an Acronym (Rollback)},
 label={ex:newacronymrollback},
 description={Example document that defines an acronym
and references it in the text using deprecated style with rollback.}]
{%
\cmd{usepackage}\marg{glossaries}[=v4.46]\comment{rollback to v4.46}
\comment{no \gls{setacronymstyle} so old style used}
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
}
{%
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.^^J%
Next use: the \gls{gls}\marg{idn}['s] prefix is a capital letter.
}
\end{resultbox}
The most noticeable difference is the way the \meta{insert} optional
argument is treated with \gls{gls} on \idx{firstuse} (\code{\gls{gls}\marg{idn}['s]}).
With the old way, \gls{newacronym} simply set
\gloskey{first}{identification number (IDN)} when it internally used
\gls{newglossaryentry} to define the \idx{acronym}. The default
\idx{entryformat} simply appends the \meta{insert} after the value of
the \gloskey{first} key. 

Unlike the original pre-4.02 behaviour of \gls{newacronym}, the
styles set via \gls{setacronymstyle} don't use the \gloskey{first}
key, but instead they use \gls{defglsentryfmt} to
set a~custom \idx{displaystyle} that uses the \gloskey{long} and \gloskey{short}
keys (or their plural equivalents). This means that these styles
cope better with plurals that aren't formed by simply appending the
singular form with the letter \qt{s}. In fact, most of the predefined
styles use \gls{glsgenacfmt} and modify the definitions of commands
like \gls{genacrfullformat}. If the original behaviour is still
required for some reason, use rollback.

In both the old and new implementation, the \gloskey{text} key is set to
the short form. Since the \gloskey{first} isn't set with the new
form, it will default to the value of the \gloskey{text} key. This
means that with the new implementation, \gls{glsfirst} will 
produce the same result as \gls{glstext}. This is why you need to
use \gls{acrlong} or \gls{acrfull} instead. Alternatively, reset the
\idx{firstuseflag} and use \gls{gls}.

When you use \gls{setacronymstyle} the \gloskey{name} key is set to:
\cmddef{acronymentry}
and the \gloskey{sort} key is set to
\cmddef{acronymsort}
These commands are redefined by the \idxpl{acronymstyle}. However, you can
redefine them again after the style has been set but before you use
\gls{newacronym}. Protected expansion is performed on \gls{acronymsort}
when the \idx{acronym} is defined.

\subsection{Predefined Acronym Styles}
\label{sec:predefinedacrstyles}

The \sty{glossaries} package provides a~number of predefined
\idxpl+{acronymstyle}. These styles apply:
\cmddef{firstacronymfont}
to the short form on \idx{firstuse} and
\cmddef{acronymfont}
on \idx{subsequentuse}. The styles modify the definition of
\gls{acronymfont} and \gls{firstacronymfont} as required. Usually,
\code{\gls{firstacronymfont}\margm{text}} simply does
\code{\gls{acronymfont}\margm{text}}.
If you want the short form displayed differently on \idx{firstuse}, you
can redefine \gls{firstacronymfont} after the \idx{acronymstyle} is
set.

The predefined \idx+{smallcaps} styles that contain \qt{sc} in their
name (for example \acrstyle{long-sc-short}) redefine
\gls{acronymfont} to use \gls+{textsc}, which means that the short
form needs to be specified in \idx+{lowercase} if it should be
rendered in \idx{smallcaps}.  This is because \idx{smallcaps} has
small capital glyphs for \idx{lowercase} letters but normal sized
capital glyphs for \idx{uppercase} letters, which means there's no
visual difference between a normal upright font and a
\idx{smallcaps} font if the text is in \idx{allcaps}.
This is demonstrated in \mexampleref{ex:longscshort}:
\begin{coderesult}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\gls{newacronym}\marg{mathml}\marg{MathML}\marg{mathematical markup language}
\cbeg{document}
\gls{acrshort}\marg{mathml}
\cend{document}
\tcblower
\createexample*[title={Small-Caps Acronym},
 label={ex:longscshort},
 description={Example document that uses the long-sc-short acronym
style, which renders the short form in a small-capital font.}]
{%
\cmd{usepackage}\marg{glossaries}^^J%
\gls{setacronymstyle}\marg{long-sc-short}^^J%
\gls{newacronym}\marg{mathml}\marg{MathML}\marg{mathematical markup language}
}%
{%
\gls{acrshort}\marg{mathml}
}
\end{coderesult}

\hypertarget{boldsc}{}%
\begin{important}%
Some fonts don't support bold \idx{smallcaps}, so you may need to redefine 
\gls{glsnamefont} (see \sectionref{sec:printglossary}) to switch to
medium weight if you are using a \idx{glossarystyle} that displays
\idx{entry} names in bold and you have chosen an \idx{acronymstyle} that uses
\gls{textsc}. (Alternatively, switch to a font that does support bold
\idx{smallcaps}.)
\end{important}

The predefined \idxpl{glossarystyle} that contain \qt{sm} in their name
(for example \acrstyle{long-sm-short}) redefine \gls{acronymfont} to
use \gls+{textsmaller}.

\hypertarget{smaller}{}%
\begin{important}
Note that the \sty{glossaries} package doesn't define or load any package that
defines \gls{textsmaller}. If you use one of the \idxpl{acronymstyle} that
set \gls{acronymfont} to \gls{textsmaller} you must
explicitly load the \sty{relsize} package or otherwise define
\gls{textsmaller}.
\end{important}

The remaining predefined styles redefine \gls{acronymfont}
to simply do its argument without any font change. 

\begin{important}
The predefined styles adjust \gls+{acrfull} and
\gls+{glsentryfull} (and their plural and \casechanging\ variants) to
reflect the style.
\end{important}

When \idxpl{acronym} are defined, \gls{newacronym} will set the
\gloskey{sort} key to \gls{acronymsort}.
The \idxpl{acronymstyle} redefine this to suit the style. This
command must fully expand in order for the \idx{indexingapp} to pick
up the correct sort value.
If the \gloskey{sort} key is set in the optional argument of
\gls{newacronym}, it will override this.

The \gloskey{name} key is set to \gls{acronymentry}.
Again, the \idxpl{acronymstyle} redefine this to suit the style.
If the \gloskey{name} key is set in the optional argument of
\gls{newacronym}, it will override this.

The \gloskey{type} key is set to \gls{acronymtype}.
If the \gloskey{type} key is set in the optional argument of
\gls{newacronym}, it will override this.

The \gloskey{shortplural} is set to the short form appended by:
\cmddef{acrpluralsuffix}
This is redefined by the \idxpl{acronymstyle} to the appropriate
suffix. In most cases, it will simply be defined to
\gls{glspluralsuffix}, but the \idx+{smallcaps} styles define it to:
\cmddef{glsupacrpluralsuffix}
This uses:
\cmddef{glstextup}
to cancel the effect of the \idx{smallcaps} font command \gls{textsc}.

If the \gloskey{shortplural} key is set in the optional argument of
\gls{newacronym}, it will override this default.

The \gloskey{longplural} is set to the long form appended by
\gls{glspluralsuffix}.
If the \gloskey{longplural} key is set in the optional argument of
\gls{newacronym}, it will override this default.

Some styles set the \gloskey{description} key to the long form, but others don't.
If you use a style that doesn't set it, you will have to supply the
\gloskey{description} in the optional argument of \gls{newacronym}.

\subsubsection{Long (Short)}
\label{sec:acrstyleslongshort}

With the \qt{long (short)} styles, \idxpl{acronym} are displayed in the form:
\begin{compactcodebox*}
\meta{long} (\gls{firstacronymfont}\margm{short})
\end{compactcodebox*}
on \idx{firstuse} and
\begin{compactcodebox*}
\gls{acronymfont}\margm{short}
\end{compactcodebox*}
on \idx{subsequentuse}.

They also set \gls{acronymsort} so that it just expands to its first
argument \meta{short}.  This means that the acronyms are sorted according to
their short form.  In addition, \gls{acronymentry}\marg{label} is set
to just the short form (enclosed in \gls{acronymfont}) and the
\gloskey{description} key is set to the long form.

\acrstyledef{long-short}
This is the default style that will be implemented if
\gls{setacronymstyle} isn't used (as from v4.50, which has removed
the default deprecated style). This shows the long form followed by
the short form in parentheses on \idx{firstuse} and also with
\gls{acrfull}. This redefines \gls{acronymfont} to simply do its
argument.

\acrstyledef{long-sc-short}
This is like \acrstyle{long-short} but uses \idx+{smallcaps} for the
short form, so it redefines \gls{acronymfont} to use \gls{textsc}
and \gls{acrpluralsuffix} to \gls{glsacrpluralsuffix}.

\acrstyledef{long-sm-short}
This is like \acrstyle{long-short} but uses \gls{textsmaller} for the
short form, so it redefines \gls{acronymfont} to use
\gls{textsmaller}. This style will require \sty{relsize} to be
loaded.

\acrstyledef{long-sp-short}
This is like \acrstyle{long-short} but instead of simply using a
space between the long and short form, it uses:
\cmddef*{glsacspace}
This measures the short form for the given entry and, if the width is
smaller than 3em, it will use \idx+{nbsp}. Otherwise it will use
\gls+{space}.

\begin{xtr}
Although the \sty{glossaries-extra} package doesn't support the base
\idxpl{acronymstyle}, it does redefine \gls{glsacspace} to use
\gls{glsacspacemax} instead of the hard-coded 3em, as
\gls{glsacspace} may also be useful in \idxpl{abbrvstyle}.
\end{xtr}

\begin{example}{Adapting a Predefined Acronym Style}{ex:acrstyle}
Suppose I~want to use the \acrstyle{footnote-sc-desc} style, but 
I~want the \gloskey{name} key set to the short form followed by the
long form in parentheses and the \gloskey{sort} key set to the short
form. Then I need to specify the \acrstyle{footnote-sc-desc} style:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}
and then redefine \gls{acronymsort} and \gls{acronymentry}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\#1}\comment{sort by short form}
\cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{short (long) name}
  \gls{acronymfont}\marg{\gls{glsentryshort}\marg{\#1}}\gls{space} (\gls{glsentrylong}\marg{\#1})}\comment{}
\end{codebox}
(I've used \gls{space} for extra clarity, but you can just use an
actual space instead.)

Note that the default Computer Modern fonts don't support bold
\idx+{smallcaps}, so another font is required. For example:
\begin{codebox}
\cmd{usepackage}[T1]\marg{fontenc}
\end{codebox}
The alternative is to redefine \gls{acronymfont} so that it
always switches to medium weight to ensure the \idx{smallcaps} setting is
used. For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\cmd{textmd}\marg{\cmd{scshape} \#1}}
\end{codebox}

The sample file \samplefile{FnAcrDesc} illustrates this
example.
\end{example}

\subsubsection{Short (Long)}
\label{sec:acrstylesshortlong}

With the \qt{short (long)} styles, \idxpl{acronym} are displayed in the form:
\begin{compactcodebox*}
\gls{firstacronymfont}\margm{short} (\meta{long} )
\end{compactcodebox*}
on \idx{firstuse} and
\begin{compactcodebox*}
\gls{acronymfont}\margm{short}
\end{compactcodebox*}
on \idx{subsequentuse}.

They also set \gls{acronymsort}\marg{short}\marg{long} to just
\meta{short}.  This means that the \idxpl{acronym} are sorted according to
their short form.  In addition, \gls{acronymentry}\marg{label} is set
to just the short form (enclosed in \gls{acronymfont}) and the
\gloskey{description} key is set to the long form.

\acrstyledef{short-long}
This shows the short form followed by
the long form in parentheses on \idx{firstuse} and also with
\gls{acrfull}. This redefines \gls{acronymfont} to simply do its
argument.

\acrstyledef{sc-short-long}
This is like \acrstyle{short-long} but uses \idx+{smallcaps} for the
short form, so it redefines \gls{acronymfont} to use \gls{textsc}
and \gls{acrpluralsuffix} to \gls{glsacrpluralsuffix}.

\acrstyledef{sm-short-long}
This is like \acrstyle{short-long} but uses \gls{textsmaller} for the
short form, so it redefines \gls{acronymfont} to use
\gls{textsmaller}. This style will require \sty{relsize} to be
loaded.

\subsubsection{Long (Short) User Supplied Description}
\label{sec:acrstyleslongshortdesc}

\acrstyledef{long-short-desc}
This is like \acrstyle{long-short} but the \gloskey{description} key
must be provided in the optional argument of \gls{newacronym}.
The sort value command \gls{acronymsort} is redefined to expand to
its second argument (\meta{long}), and \gls{acronymentry} is
redefined to show the long form followed by the short form in
parentheses.

\acrstyledef{long-sc-short-desc}
This is like \acrstyle{long-short-desc} except that it uses
\idx+{smallcaps}, as \acrstyle{long-sc-short}.

\acrstyledef{long-sm-short-desc}
This is like \acrstyle{long-short-desc} except that it uses
\gls+{textsmaller}, as \acrstyle{long-sm-short}.

\acrstyledef{long-sp-short-desc}
This is like \acrstyle{long-short-desc} except that it uses
\gls{glsacspace}, as \acrstyle{long-sp-short}.

\subsubsection{Short (Long) User Supplied Description}
\label{sec:acrstylesshortlongdesc}

\acrstyledef{short-long-desc}
This is like \acrstyle{short-long} but the \gloskey{description} key
must be provided in the optional argument of \gls{newacronym}.
The sort value command \gls{acronymsort} is redefined to expand to
its second argument (\meta{long}), and \gls{acronymentry} is
redefined to show the long form followed by the short form in
parentheses.

\acrstyledef{sc-short-long-desc}
This is like \acrstyle{short-long-desc} except that it uses
\idx+{smallcaps}, as \acrstyle{long-sc-short}.

\acrstyledef{sm-short-long-desc}
This is like \acrstyle{short-long-desc} except that it uses
\gls+{textsmaller}, as \acrstyle{long-sm-short}.

\subsubsection{Do Not Use Acronym (DUA)}
\label{sec:acrstylesdua}

With these styles, the \gls{glslike} commands always display the long form 
regardless of whether the entry has been \idx{firstuse}{used} or not. 
However, \gls{acrfull}
and \gls{glsentryfull} will display the long form followed by the
short form, as per the \acrstyle{long-short} style.

\acrstyledef{dua}
The sort value command \gls{acronymsort} expands to just its second
argument (the long form), and \gls{acronymentry} shows just the
long form.

\acrstyledef{dua-desc}
The sort value command \gls{acronymsort} expands to just its second
argument (the long form), and \gls{acronymentry} shows just the
long form.

\subsubsection{Footnote}
\label{sec:acrstylesfootnote}

With these styles, the \gls{glslike} commands show the short form
followed by the long form in a footnote on \idx{firstuse}. 
The footnote is simply added with \gls{footnote}.
The \gls{acrfull} set of commands show the short form followed by the
long form in parentheses (as per styles like \acrstyle{short-long}).
The definitions of \gls{acronymsort} and \gls{acronymentry} are as
for the \qt{short (long)} styles described in \sectionref{sec:acrstylesshortlong}.

\begin{information}
The footnote styles automatically set \optval{hyperfirst}{false} to
prevent nested \idxpl+{hyperlink}. 
\end{information}

\acrstyledef{footnote}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{short-long} style

\acrstyledef{footnote-sc}
This defines \gls{acronymentry}, \gls{acronymsort},
\gls{acronymfont} and \gls{acrpluralsuffix} in the same way as the 
\acrstyle{sc-short-long} style

\acrstyledef{footnote-sm}
This defines \gls{acronymentry}, \gls{acronymsort} and
\gls{acronymfont} in the same way as the 
\acrstyle{sm-short-long} style

\acrstyledef{footnote-desc}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{short-long-desc} style

\acrstyledef{footnote-sc-desc}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{sc-short-long-desc} style

\acrstyledef{footnote-sm-desc}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{sm-short-long-desc} style

\subsection{Defining A Custom Acronym Style}
\label{sec:customacronym}

You may find that the predefined \idxpl{acronymstyle} that come with the
\sty{glossaries} package don't suit your requirements. In this
case you can define your own style using:
\cmddef{newacronymstyle}
where \meta{style name} is the name of the new style (avoid active
characters). The second argument, \meta{format def}, is equivalent to
the \meta{definition} argument of \gls{defglsentryfmt}. You can simply use
\gls{glsgenacfmt} or you can customize the \idxc{entryformat}{display} using commands
like \gls{ifglsused}, \gls{glsifplural} and \gls{glscapscase}.
(See \sectionref{sec:glsdisplay} for further details.)

If the style is likely to be used with a mixed \idx{glossary} (that
is, \idxpl{entry} in that \idx{glossary} are defined both with \gls{newacronym} and
\gls{newglossaryentry}) then you can test if the \idx{entry} is an
\idx{acronym} and use \gls{glsgenacfmt} if it is or \gls{glsgenentryfmt} if it
isn't. For example, the \acrstyle{long-short} style sets
\meta{format def} as
\begin{compactcodebox}
\gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}
\end{compactcodebox}
(You can use \gls{ifglshasshort} instead of \gls{ifglshaslong} to
test if the \idx{entry} is an \idx{acronym} if you prefer.)

The third argument, \meta{style defs}, can be used to redefine the
commands that affect the display style, such as \gls{acronymfont}
and \gls{genacrfullformat}.

\begin{information}
Bear in mind that you will need to use \idx{hashhash} rather than
\sym{hash} to reference parameters in command definitions within
\meta{style defs}.
\end{information}

Note that \gls{setacronymstyle} redefines \gls{glsentryfull} and
\gls{acrfullfmt} to use \gls{genacrfullformat} (and similarly for
the plural and \casechanging\ variants). If this isn't appropriate for the
style (as in the case of styles like \acrstyle{footnote} and
\acrstyle{dua}) \gls{newacronymstyle} should redefine these commands
within \meta{style defs}.

Within \gls{newacronymstyle}'s \meta{style defs} argument you 
can also redefine:
\cmddef{GenericAcronymFields}
This should expand to the list of additional fields to be set in
\gls{newglossaryentry}, when it's internally called by
\gls{newacronym}.
You can use the following token registers to access information
passed to the arguments of \gls{newacronym}.

\cmddef{glskeylisttok} 
Contains the \keyvallist\ options.

\cmddef{glslabeltok} 
Contains the \meta{entry-label}.

\cmddef{glsshorttok} 
Contains the \meta{short} form argument.

\cmddef{glslongtok} 
Contains the \meta{long} form argument.

As with all token registers, you can obtain the value of the
register with \gls{the}\meta{register}.  For example, the
\acrstyle{long-short} style does:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
   \gloskeyval{description}{\gls{the}\gls{glslongtok}}}
\end{compactcodebox}
which sets the \gloskey{description} field to the long form of the
\idx{acronym} whereas the \acrstyle{long-short-desc} style does:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}
\end{compactcodebox}
since the description needs to be specified by the user.

It may be that you want to define a new \idx{acronymstyle} that's based
on an existing style. Within \meta{format def} of the new style, you can use
\cmddef{GlsUseAcrEntryDispStyle}
to use the \meta{format def} definition from the style given by
\meta{style name}.

Within \meta{display defs} of the new style, you can use
\cmddef{GlsUseAcrStyleDefs}
to use the \meta{display defs} from the style given by \meta{style name}.

For example, the \acrstyle{long-sc-short} \idx{acronymstyle} is
based on the \acrstyle{long-short} style with minor
modifications:
\begin{compactcodebox}
\gls{newacronymstyle}\marg{\acrstyle{long-sc-short}}\comment{}
\marg{\comment{use the same display as \acrstyle{long-short}}
  \gls{GlsUseAcrEntryDispStyle}\marg{\acrstyle{long-short}}\comment{}
}\comment{}
\marg{\comment{use the same definitions as \acrstyle{long-short}}
  \gls{GlsUseAcrStyleDefs}\marg{\acrstyle{long-short}}\comment{}
  \comment{Minor modifications:}
  \cmd{renewcommand}\marg{\gls{acronymfont}}[1]\marg{\gls{textsc}\marg{\idx{hashhash}1}}\comment{}
  \cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glstextup}\marg{\gls{glspluralsuffix}}}\comment{}
}
\end{compactcodebox}

\begin{example}{Defining a Custom Acronym Style}{ex:customacrstyle}
Suppose I want my acronym on \idx{firstuse} 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. That is, in the text I want \gls{gls} on \idx{firstuse}
to display:
\begin{compactcodebox}
\gls{textsc}\margm{short}\gls{footnote}\marg{\meta{long}: \meta{description}}
\end{compactcodebox}
on \idx{subsequentuse}:
\begin{compactcodebox}
\gls{textsc}\margm{short}
\end{compactcodebox}
and in the list of acronyms, each entry will be displayed in the
form:
\begin{compactcodebox}
\meta{long} (\meta{short}) \meta{description}
\end{compactcodebox}

Let's suppose it's possible that I may have a mixed \idx{glossary}. I can
check this in the second argument (\meta{format def}) of \gls{newacronymstyle} using:
\begin{codebox}
\gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}
\end{codebox}
This will use \gls{glsgenentryfmt} if the entry isn't an \idx{acronym},
otherwise it will use \gls{glsgenacfmt}. The third argument
(\meta{display defs}) of
\gls{newacronymstyle} needs to redefine \gls{genacrfullformat} etc 
so that the \idx{firstuse} displays the short form in the text with the 
long form in a footnote followed by the description. This is done as
follows:
\begin{codebox}
\comment{No case change, singular \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{\Idx{sentencecase}, singular \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{Glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{No case change, plural \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{\Idx{sentencecase}, plural \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{Glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}
\end{codebox}
If you think it inappropriate for the short form to be capitalised
at the start of a sentence you can change the above to:
\begin{codebox}
\comment{No case change, singular \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{No case change, plural \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\cmd{let}\gls{Genacrfullformat}\gls{genacrfullformat}
\cmd{let}\gls{Genplacrfullformat}\gls{genplacrfullformat}
\end{codebox}
Another variation is to use \gls{Glsentrylong} and
\gls{Glsentrylongpl} in the footnote instead of \gls{glsentrylong} and
\gls{glsentrylongpl}.

Now let's suppose that commands such as \gls{glsentryfull} and
\gls{acrfull} shouldn't
use a~footnote, but instead use the format: \meta{long}
(\meta{short}).
This means that the style needs to redefine \gls{glsentryfull},
\gls{acrfullfmt} and their plural and \casechanging\ variants.

First, the non-linking commands: 
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfull}}[1]\marg{\comment{}
  \gls{glsentrylong}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Glsentryfull}}[1]\marg{\comment{}
  \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{glsentryfullpl}}[1]\marg{\comment{}
  \gls{glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Glsentryfullpl}}[1]\marg{\comment{}
  \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
}
\end{codebox}
Now for the linking commands:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acrfullfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Acrfullfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{Glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{ACRfullfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{glsuppercase}\marg{\comment{}
     \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
       (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{acrfullplfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Acrfullplfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{Glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{ACRfullplfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}{\idx{hashhash}2}{\comment{}
   \gls{glsuppercase}\marg{\comment{}
     \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\space
       (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
  }\comment{}
}
\end{codebox}
(This may cause problems with long \idxpl{hyperlink}, in which case adjust
the definitions so that, for example, only the short form is inside
the argument of \gls{glslink}.)

The style also needs to redefine \gls{acronymsort} so that the
\idxpl{acronym} are sorted according to the long form:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}2}
\end{codebox}
If you prefer them to be sorted according to the short form you can
change the above to:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}1}
\end{codebox}
The \idx{acronym} font needs to be set to \gls{textsc} and the plural
suffix adjusted so that the \qt{s} suffix in the plural short form
doesn't get converted to \idx{smallcaps}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\gls{textsc}\marg{\idx{hashhash}1}}\comment{}
\cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glsupacrpluralsuffix}}\comment{}
\end{codebox}
There are a number of ways of dealing with the format in the list of
\idxpl{acronym}. The simplest way is to redefine \gls{acronymentry} to the
long form followed by the upper case short form in parentheses:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{}
  \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
    (\gls{glsuppercase}{\gls{glsentryshort}\marg{\idx{hashhash}1}})}
\end{codebox}
(I've used \gls{Glsentrylong} instead of \gls{glsentrylong} to
capitalise the name in the \idx{glossary}.)

An alternative approach is to set \gls{acronymentry} to just the
long form and redefine \gls{GenericAcronymFields} to set the
\gloskey{symbol} key to the short form and use a \idx{glossarystyle} that
displays the symbol in parentheses after the \gloskey{name} (such as
the \glostyle{tree} style) like this:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\gls{Glsentrylong}\marg{\idx{hashhash}1}}\comment{}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
   \gloskeyval{symbol}{\cmd{protect}\gls{glsuppercase}\marg{\gls{the}\gls{glsshorttok}}}}\comment{}
\end{codebox}
I'm going to use the first approach and set
\gls{GenericAcronymFields} to do nothing:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}\comment{}
\end{codebox}

Finally, this style needs to switch off \idxpl{hyperlink} on
\idx{firstuse} to avoid nested links:
\begin{codebox*}
\gls{glshyperfirstfalse}
\end{codebox*}
Putting this all together:
\begin{codebox}
\gls{newacronymstyle}\marg{custom-fn}\comment{new style name}
\marg{\comment{\idx{entryformat}}
 \gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}\comment{}
}\comment{}
\marg{\comment{}
 \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}\comment{}
 \gls{glshyperfirstfalse}
 \comment{No case change, singular \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{\Idx{sentencecase}, singular \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{Glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{No case change, plural \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{\Idx{sentencecase}, plural \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{Glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{non-linking commands}
 \cmd{renewcommand}*\marg{\gls{glsentryfull}}[1]\marg{\comment{}
   \gls{glsentrylong}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Glsentryfull}}[1]\marg{\comment{}
   \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{glsentryfullpl}}[1]\marg{\comment{}
   \gls{glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Glsentryfullpl}}[1]\marg{\comment{}
   \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \comment{linking commands}
 \cmd{renewcommand}*\marg{\gls{acrfullfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Acrfullfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{Glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{ACRfullfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{glsuppercase}\marg{\comment{}
      \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
        (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
    }\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{acrfullplfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
      (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Acrfullplfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{Glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
      (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{ACRfullplfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}{\idx{hashhash}2}{\comment{}
    \gls{glsuppercase}\marg{\comment{}
      \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\space
        (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
    }\comment{}
   }\comment{}
 }\comment{}
 \comment{font}
 \cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\gls{textsc}\marg{\idx{hashhash}1}}\comment{}
 \cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glsupacrpluralsuffix}}\comment{}
 \comment{\gloskey{sort}}
 \cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}2}\comment{}
 \comment{\gloskey{name}}
 \cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{}
   \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
     (\gls{glsuppercase}{\gls{glsentryshort}\marg{\idx{hashhash}1}})}\comment{}
}
\end{codebox}

Now I need to specify that I want to use this new style:
\begin{codebox}
\gls{setacronymstyle}\marg{custom-fn}
\end{codebox}
I also need to use a \idx{glossarystyle} that suits this acronym style,
for example \glostyle{altlist}:
\begin{codebox}
\gls{setglossarystyle}\marg{\glostyle{altlist}}
\end{codebox}

Once the \idx{acronymstyle} has been set, I can define my
\idxpl{acronym}:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{set of tags for use in 
developing hypertext documents}}\marg{html}\marg{html}\marg{Hyper 
Text Markup Language}
\codepar
\gls{newacronym}\oarg{\gloskeyval{description}{language used to describe the 
layout of a document written in a markup language}}\marg{css}
\marg{css}\marg{Cascading Style Sheet}
\end{codebox}

The sample file \samplefile{-custom-acronym} illustrates this
example.
\end{example}

\begin{example}{Italic and Upright Abbreviations}{ex:font-abbr}
Suppose I~want to have some \idxpl{acronym} in italic and some that
just use the surrounding font. Hard-coding this into the
\meta{short} argument of \gls{newacronym} can cause complications.

This example uses \gls{glsaddstoragekey} to add an extra field that
can be used to store the formatting declaration (such as \csfmt{em}).
\begin{codebox}
\gls{glsaddstoragekey}\marg{font}\marg{}\marg{\cmd{entryfont}}
\end{codebox}
This defines a~new field/key called \optfmt{font}, which defaults to
nothing if it's not explicitly set. This also defines a command
called \csfmt{entryfont} that's analogous to \gls{glsentrytext}. A~new
style is then created to format \idxpl{acronym} that access this field.

There are two ways to do this. The first is to create a style that
doesn't use \gls{glsgenacfmt} but instead provides a~modified
version that doesn't use \gls{acronymfont}
but instead uses
\begin{compactcodebox}
\marg{\cmd{entryfont}\marg{\gls{glslabel}}\meta{short}}.
\end{compactcodebox}
The full format given by commands such as \gls{genacrfullformat}
need to be similarly adjusted. For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
 \gls{glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
 (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\end{codebox}
This will deal with commands like \gls{gls} but not commands like
\gls{acrshort} which still use \gls{acronymfont}. Another approach
is to redefine \gls{acronymfont} to look up the required font
declaration. Since \gls{acronymfont} doesn't take the entry label as
an argument, the following will only work if \gls{acronymfont} is
used in a~context where the label is provided by \gls{glslabel}.
This is true in \gls{gls}, \gls{acrshort} and \gls{acrfull}. The
redefinition is now:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\marg{\cmd{entryfont}\marg{\gls{glslabel}}\idx{hashhash}1}}\comment{}
\end{codebox}
So the new style can be defined as:
\begin{codebox}
\gls{newacronymstyle}\marg{long-font-short}
\marg{\comment{}
 \gls{GlsUseAcrEntryDispStyle}\marg{long-short}\comment{}
}\comment{}
\marg{\comment{}
 \gls{GlsUseAcrStyleDefs}\marg{long-short}\comment{}
 \cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
  \gls{glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
  \gls{Glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
  \gls{glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
  \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\marg{\cmd{entryfont}\marg{\gls{glslabel}}\idx{hashhash}1}}\comment{}
 \cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}}}\comment{}
}
\end{codebox}
Remember the style needs to be set before defining the entries:
\begin{codebox}
\gls{setacronymstyle}\marg{long-font-short}
\end{codebox}

The complete document is contained in the sample file
\samplefile{-font-abbr}.
\end{example}

Some writers and publishing houses have started to drop
\idxpl{fullstop} (periods) from \idx{uppercase} initials but may
still retain them for \idx{lowercase} abbreviations, while others
may still use them for both \idxc{uppercase}{upper} and
\idx{lowercase}. This can cause complications. Chapter~12 of
\booktitle{The \TeX book} discusses the spacing between words but,
briefly, the default behaviour of \TeX\ is to assume that an
\idx{uppercase} character followed by a~\idx{fullstop} and space is
an abbreviation, so the space is the default \idx{interwordspace}
whereas a~\idx{lowercase} character followed by a~\idx{fullstop} and
space is a word occurring at the end of a~sentence, which requires
an \idx{intersentencespace} (which may or may not be the same as an
\idx{interwordspace}).  In the event that this isn't true, you need
to make a~manual adjustment using \glsname{cs.sp} (backslash space)
in place of just a~space character for an inter-word mid-sentence
space and use \gls{cs.at} before the \idx{fullstop} to indicate the end
of the sentence.

For example:
\begin{codebox}
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{codebox}
is typeset as
\begin{resultbox}
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{resultbox}
The spacing is more noticeable with the typewriter font:
\begin{codebox}
\cmd{ttfamily}
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{codebox}
is typeset as
\begin{resultbox}\ttfamily
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{resultbox}
The \idx{lowercase} letter at the end of \qt{B.Sc.}\ is confusing \TeX\
into thinking that the \idx{fullstop} after it marks the end of the
sentence. Whereas the \idx{uppercase} letter at the end of \qt{Ph.D.} has
confused \TeX\ into thinking that the following \idx{fullstop} is just
part of the abbreviation. These can be corrected:
\begin{codebox}
I was awarded a B.Sc.\gls{cs.sp}and a Ph.D\gls{cs.at}. (From the same place.)
\end{codebox}

This situation is a bit problematic for \sty{glossaries}. The
\idxpl{fullstop} can form part of the \meta{short} argument of
\gls{newacronym} and the \code{B.Sc.\glsname{cs.sp}} part can be dealt with by
remembering to add \glsname{cs.sp} (for example,
\code{\gls{gls}\marg{bsc}\glsname{cs.sp}}
but the end of sentence case is more troublesome as you need to omit
the sentence terminating \idx{fullstop} (to avoid two dots) which can
make the source code look a little strange but you also need to
adjust the \idx{spacefactor}, which is usually done by inserting
\gls{cs.at}
before the \idx{fullstop}.

The next example shows one way of achieving this.

\begin{xtr}
The \sty{glossaries-extra} package provides a much
simpler way of doing this, which you may prefer to use. See 
\gallery{sample-initialisms.shtml}{Gallery: Initialisms}.
\end{xtr}

\begin{example}{Abbreviations with Full Stops (Periods)}{ex:dotabbr}
The \idx+{postlinkhook} (\gls{glspostlinkhook})
is called at the very end of the \gls{glslike} and \gls{glstextlike}
commands. This can be redefined to check if the following character
is a \idx{fullstop}. The \sty{amsgen} package (which is automatically
loaded by \sty{glossaries}) provides an internal command
called \csfmt{new@ifnextchar} that can be used to determine if the
given character appears next. (For more information see the
\sty{amsgen} documentation. Alternatively, \LaTeX3 may provide a
better way of doing this.)

It's possible that I~may also want acronyms or contractions (without
\idxpl{fullstop}) in my
document, so I~need some way to differentiate between them.
Here I'm going to use the same method as in
\exampleref{ex:addstoragekey} where a~new field is defined
to indicate the type of abbreviation:
\begin{codebox}
\gls{glsaddstoragekey}\marg{abbrtype}\marg{word}\marg{\cmd{abbrtype}}
\codepar
\cmd{newcommand}*\marg{\cmd{newabbr}}[1][]\marg{\gls{newacronym}\oarg{abbrtype=initials,\#1}}
\end{codebox}
Now I just use \gls{newacronym} for the acronyms, for example,
\begin{codebox}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\end{codebox}
and my new command \csfmt{newabbr} for initials, for example,
\begin{codebox}
\cmd{newabbr}\marg{eg}\marg{e.g.}\marg{exempli gratia}
\cmd{newabbr}\marg{ie}\marg{i.e.}\marg{id est}
\cmd{newabbr}\marg{bsc}\marg{B.Sc.}\marg{Bachelor of Science}
\cmd{newabbr}\marg{ba}\marg{B.A.}\marg{Bachelor of Arts}
\cmd{newabbr}\marg{agm}\marg{A.G.M.}\marg{annual general meeting}
\end{codebox}
Within \gls{glspostlinkhook} the \idx{entry}['s] label can be accessed using
\gls{glslabel} and \gls{ifglsfieldeq} can be used to determine if
the current entry has the new \optfmt{abbrtype} field set to
\qt{initials}. If it doesn't, then nothing needs to happen, but if
it does, a~check is performed to see if the next character is 
a~\idx{fullstop}. If it is, this signals the end of a~sentence otherwise it's
mid-sentence.

Remember that internal commands within the document file (rather
than in a~class or package) need to be placed between
\gls{makeatletter} and \gls{makeatother}:
\begin{codebox}
\gls{makeatletter}
\cmd{renewcommand}\marg{\gls{glspostlinkhook}}\marg{\comment{}
 \gls{ifglsfieldeq}\marg{\gls{glslabel}}\marg{abbrtype}\marg{initials}\comment{}
 \marg{\cmd{new@ifnextchar}\sym{fullstop}\cmd{doendsentence}\cmd{doendword}}
 \marg{}\comment{}
}
\gls{makeatother}
\end{codebox}
In the event that a \idx{fullstop} is found then \csfmt{doendsentence} is
performed, but it will be followed by the \idx{fullstop}, which needs to
be discarded. Otherwise \csfmt{doendword} will be done, but it won't be
followed by a \idx{fullstop} so there's nothing to discard. The
definitions for these commands are:
\begin{codebox*}
\cmd{newcommand}\marg{\cmd{doendsentence}}[1]\marg{\gls{spacefactor}=10000 }
\cmd{newcommand}\marg{\cmd{doendword}}\marg{\gls{spacefactor}=1000 }
\end{codebox*}
Now, I can just do \code{\gls{gls}\marg{bsc}} mid-sentence and
\code{\gls{gls}\marg{phd}\sym{fullstop}}\ at the end of the sentence. 
The terminating \idx{fullstop} will be discarded in the latter case, 
but it won't be discarded in, say,
\code{\gls{gls}\marg{laser}\sym{fullstop}} as that doesn't have the
\optfmt{abbrtype} field set to \qt{initials}.

This also works on \idx{firstuse} when the style is set to one of the
\meta{long} (\meta{short}) styles but it will fail with the
\meta{short} (\meta{long}) styles as in this case the terminating
\idx{fullstop} shouldn't be discarded. Since \gls{glspostlinkhook} is
used after the \idx{firstuseflag} has been unset for the \idx{entry}, this
can't be fixed by simply checking with \gls{ifglsused}. One possible
solution to this is to redefine \gls{glslinkpostsetkeys} to check
for the \idx{firstuseflag} and define a macro that can then be used in
\gls{glspostlinkhook}.

The other thing to consider is what to do with plurals. One
possibility is to check for plural use within \csfmt{doendsentence}
(using \gls{glsifplural}) and put the \idx{fullstop} back if the plural
has been used.

The complete document is contained in the sample file
\samplefile{-dot-abbr}.
\end{example}

\section{Displaying the List of Acronyms}
\label{sec:disploa}

The list of acronyms is just like any other type of \idx{glossary} and can
be displayed on its own using the appropriate 
\gls{print...glossary} command, according to the
\idx{indexing} method.

For example, \option{noidx}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}
\end{codebox}

\optionsor{mkidx,xdy}:
\begin{codebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}
\end{codebox}
Or if you have used the \opt{acronym} or \opt{acronyms} package option:
\begin{codebox}
\gls{printacronyms}
\end{codebox}
See \sectionref{sec:pkgopts-acronym}.)

Alternatively, the list of acronyms can be displayed with all the other 
\idxpl{glossary} using \gls{printnoidxglossaries} (\option{noidx})
or \gls{printglossaries} (\optionsor{mkidx,xdy}).

The remaining \idx{indexing} methods require \sty{glossaries-extra},
which has its own \idx{abbreviation} commands that are incompatible
with the base \idx{acronym} commands.

\begin{warning}
Care must be taken to choose a \idx{glossarystyle} that's
appropriate to your \idx{acronymstyle}.
Alternatively, you can define your own custom style (see 
\sectionref{sec:newglossarystyle} for further details).
\end{warning}

\section{Upgrading From the \stytext{glossary} Package}
\label{sec:oldacronym}

\begin{information}
The old \sty{glossary} package was made obsolete in 2007, when the
first version of \sty+{glossaries} was released, so this section is
largely redundant but is retained in the event that someone may
happen to have an old document that needs to be converted to work
with a modern \TeX\ distribution. See also the accompanying
document \qtdocref{Upgrading from the \styfmt{glossary} package to
the \styfmt{glossaries} package}{glossary2glossaries}.
\end{information}

Users of the obsolete \sty{glossary} package may recall that
the syntax used to define new acronyms has changed with the
replacement \sty{glossaries} package. In addition, the old
\sty{glossary} package created the command 
\csmetafmt{}{acr-name}{} when defining the acronym \meta{acr-name}.

In order to facilitate migrating from the old \sty{glossary} package to the new
one, the \sty{glossaries} package provides the command:
\cmddef{oldacronym}
This uses the same syntax as the \sty{glossary} package's
method of defining acronyms. It is equivalent to:
\begin{compactcodebox}
\gls{newacronym}\oarg{\keyvallist}\margm{label}\margm{short}\margm{long}
\end{compactcodebox}
In addition, \gls{oldacronym} also defines the commands
\csmetafmt{}{label}{}, which is equivalent to
\code{\gls{gls}\margm{label}}, and \csmetafmt{}{label}{*}, which is
equivalent to the \idx{sentencecase} \code{\gls{Gls}\margm{label}}.
If \meta{label} is omitted, \meta{short} is used. Since commands
names must consist only of alphabetical characters, \meta{label}
must also only consist of alphabetical characters. Note that
\csmetafmt{}{label}{} doesn't allow you to use the first optional
argument of \gls{gls} or \gls{Gls}\dash you will need to explicitly
use \gls{gls} or \gls{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
\csmetafmt{}{label}{} unless you additionally load the \sty{xspace}
package, but be aware that there are some issues with using
\sty{xspace}. (See David Carlisle's explanation in
\href{http://tex.stackexchange.com/questions/86565/drawbacks-of-xspace}{Drawbacks
of xspace}.)
\end{important}

The \sty{glossaries} package doesn't load the \sty{xspace} package
since there are both advantages and disadvantages to using
\gls{xspace} in \csmetafmt{}{label}{}. If you don't use the
\sty{xspace} package, then you need to explicitly force a space
using \glsname{cs.sp} (backslash space). On the other hand, you can
follow the \csmetafmt{}{label}{} command with the optional
\meta{insert} text in square brackets (the final optional argument
to \gls{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 \gls{gls} to achieve that).

To illustrate this, suppose I define the acronym \qt{abc} as
follows:
\begin{codebox}
\gls{oldacronym}\marg{abc}\marg{example acronym}\marg{}
\end{codebox}
This will create the command \csfmt{abc} and its starred version
\csfmt{abc*}. \Tableref{tab:xspace} illustrates the effect of
\csfmt{abc} (on \idx{subsequentuse}) 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 \stytext{xspace} with \glsfmttext{oldacronym}}
\label{tab:xspace}
\centering
\begin{tabular}{lll}
\bfseries Code & \bfseries With \sty{xspace} &
\bfseries Without \sty{xspace}\\
\code{\cmd{abc}.} & abc. & abc.\\
\code{\cmd{abc} xyz} & abc xyz & abcxyz\\
\code{\cmd{abc}\gls{cs.sp}xyz} & abc xyz & abc xyz\\
\code{\cmd{abc}* xyz} & Abc xyz & Abc xyz\\
\code{\cmd{abc}\oarg{'s} xyz} & abc ['s] xyz & abc's xyz
\end{tabular}
\end{table}

\chapter{Unsetting and Resetting Entry Flags}
\label{sec:glsunset}

When using the \gls{glslike} commands it is possible that you may
want to use the value given by the \gloskey{first} key, even though
you have already \idxc{firstuse}{used} the \idx{glossaryentry}.
Conversely, you may want to use the value given by the
\gloskey{text} key, even though you haven't used the
\idx{glossaryentry}.

The former can be achieved by one of the following commands:
\cmddef{glsreset}
which globally resets the \idx{firstuseflag} and
\cmddef{glslocalreset}
which locally resets the \idx{firstuseflag}.

The latter can be achieved by one of the following commands:
\cmddef{glsunset}
which globally unsets the \idx{firstuseflag} and
\cmddef{glslocalunset}
which locally unsets the \idx{firstuseflag}.

The above commands are for the specific \idx{entry} identified by
the argument \meta{entry-label}.
You can also reset or unset all \idxpl{entry} for a given
\idx{glossary} or multiple \idxpl{glossary} using:
\cmddef{glsresetall}
which globally resets the \idxpl{firstuseflag} and
\cmddef{glslocalresetall}
which locally resets the \idxpl{firstuseflag} or
\cmddef{glsunsetall}
which globally unsets the \idxpl{firstuseflag} and
\cmddef{glslocalunsetall}
which locally unsets the \idxpl{firstuseflag}.

The optional argument \meta{glossary labels list} should be a comma-separated
list of \idx{glossary} labels. If omitted, the list of all
non-\idxpl{ignoredglossary} is assumed.

For example, to reset all entries in the \glostype{main} glossary and the
\glostype{acronym} list:
\begin{codebox}
\gls{glsresetall}\oarg{\glostype{main},\glostype{acronym}}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package additional provides the options 
\glsopt{preunset} and \glsopt{prereset} for the \gls{glslike}
commands, that will unset or reset the \idx{firstuseflag} before the
\idx{linktext}, which will make the \gls{glslike} command behave
as though it was the \idx{subsequentuse} or \idx{firstuse},
irrespective of whether or not the \idx{entry} has actually been
used.
\end{xtr}

You can determine whether an entry's \idx{firstuseflag} is set with
\gls{ifglsused}. With \app{bib2gls}, you may need to use
\gls{GlsXtrIfUnusedOrUndefined} instead.

\begin{important}
Be careful when using \gls{glslike} commands within an
environment or command argument that gets processed multiple times
as it can cause unwanted side-effects when the \idx{firstuse} displayed
text is different from \idx{subsequentuse}.
\end{important}

For example, the \env{frame} environment in \cls{beamer} processes
its argument for each overlay. This means that the
\idx{firstuseflag} will be unset on the first overlay and subsequent
overlays will use the \idx{subsequentuse} form.

Consider the following example:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\gls{newacronym}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\cbeg{document}
\codepar
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{gls}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\codepar
\cend{document}
\end{codebox}

On the first overlay, \code{\gls{gls}\marg{svm}} produces \qt{support vector
machine (SVM)} and then unsets the \idx{firstuseflag}. When the second
overlay is processed, \code{\gls{gls}\marg{svm}} now produces \qt{SVM}, which
is unlikely to be the desired effect. I~don't know anyway around
this and I can only offer the following suggestions.

\begin{enumerate}
\item
Unset all \idxpl{acronym} at the start of the document and
explicitly use \gls{acrfull} when you want the full version to be
displayed:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\gls{newacronym}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\gls{glsunsetall}
\codepar
\cbeg{document}
\codepar
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{acrfull}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\codepar
\cend{document}
\end{codebox}

\item
Explicitly reset each \idx{acronym} on \idx{firstuse}:
\begin{codebox}
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{glsreset}\marg{svm}\gls{gls}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\end{codebox}
Alternatively, with \sty{glossaries-extra}:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries-extra}
\codepar
\gls{newabbreviation}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\cbeg{document}
\codepar
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{gls}\oarg{\glsopt{prereset}}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\codepar
\cend{document}
\end{codebox}

\item Use the \sty{glossaries-extra} package's unset buffering
mechanism:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries-extra}
\codepar
\gls{newabbreviation}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\cbeg{document}
\codepar
\gls{GlsXtrStartUnsetBuffering}
\gls{GlsXtrUnsetBufferEnableRepeatLocal}
\cbeg{frame}
\gls{GlsXtrResetLocalBuffer}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{gls}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\gls{GlsXtrStopUnsetBuffering}
\codepar
\cend{document}
\end{codebox}
See the \sty{glossaries-extra} manual for further details.
\end{enumerate}

These are non-optimal, but the \cls{beamer} class is too complex for
me to provide a programmatic solution. Other potentially problematic
environments are some \env{tabular}-like environments (but not
\env{tabular} itself) that process the contents in order to work out
the column widths and then reprocess the contents to do the actual
typesetting.

The \sty{amsmath} environments, such as \env{align}, also process
their contents multiple times, but the \sty{glossaries} package now
checks for this. For \sty{tabularx}, you need to explicitly patch it
by placing \gls{glspatchtabularx} in the \idx{documentpreamble} (or anywhere
before the problematic use of \env{tabularx}).

\section{Counting the Number of Times an Entry has been Used (First Use
Flag Unset)}
\label{sec:enableentrycount}

It's possible to keep track of how many times an entry is used. That
is, how many times the \idx+{firstuseflag} is unset. Note that the
supplemental \sty{glossaries-extra} package improves this function
and also provides per-unit counting, which isn't available with the
\sty{glossaries} package.

\begin{important}
This function is disabled by default as it adds extra
overhead to the document build time and also switches
\gls{newglossaryentry} (and therefore \gls{newacronym}) into
a~\idx+{documentpreamble}-only command.
\end{important}

To enable this function, use:
\cmddef{glsenableentrycount}
before defining your \idxpl{entry}. This adds two extra (internal) fields
to entries: \glosfielddef{currcount} and \glosfielddef{prevcount}.

The \glosfield{currcount} field keeps track of how many times
\gls{glsunset} is used within the document. A~local unset (using
\gls{glslocalunset}) performs a~local rather than global increment to
\glosfield{currcount}. Remember that not all commands use
\gls{glsunset}. Only the \gls{glslike} commands do this. 

The behaviour of the reset commands depend on the conditional:
\cmddef{ifglsresetcurrcount}
If true, the reset commands \gls{glsreset} and \gls{glslocalreset} 
will reset the value of the \glosfield{currcount} field back to 0.
This conditional can be set to true with:
\cmddef{glsresetcurrcounttrue}
and to false with:
\cmddef{glsresetcurrcountfalse}
The default is false, as from version 4.50.

The \glosfield{prevcount} field stores the final value of the
\glosfield{currcount} field \emph{from the previous run}. This value is
read from the \ext{aux} file at the beginning of the
\env{document} environment.

You can access these fields using
\cmddef{glsentrycurrcount}
for the \glosfield{currcount} field, and
\cmddef{glsentryprevcount}
for the \glosfield{prevcount} field. 

\begin{important}
These commands are only defined if you have used \gls{glsenableentrycount}.
\end{important}

For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{glsenableentrycount}
\codepar
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{a fruit}}
\codepar
\cbeg{document}
Total usage on previous run: \gls{glsentryprevcount}\marg{apple}.
\codepar
\gls{gls}\marg{apple}. \gls{gls}\marg{apple}.  \gls{glsadd}\marg{apple}\gls{glsentrytext}\marg{apple}.
\gls{glslink}\marg{apple}\marg{apple}.  \gls{glsdisp}\marg{apple}\marg{apple}. \gls{Gls}\marg{apple}.
\codepar
Number of times apple has been used: \gls{glsentrycurrcount}\marg{apple}.
\cend{document}
\end{codebox}
On the first \LaTeX\ run, \code{\gls{glsentryprevcount}\marg{apple}}
produces~0. At the end of the document,
\code{\gls{glsentryprevcount}\marg{apple}} produces~4. This is because
the only commands that have incremented the entry count are those
that use \gls{glsunset}. That is: \gls{gls}, \gls{glsdisp} and
\gls{Gls}. The other commands used in the above example, \gls{glsadd},
\gls{glsentrytext} and \gls{glslink}, don't use \gls{glsunset} so they
don't increment the entry count. On the \emph{next} \LaTeX\ run,
\code{\gls{glsentryprevcount}\marg{apple}} now produces~4 as that was the
value of the \glosfield{currcount} field for the \qt{apple} entry
at the end of the document on the previous run.

When you enable the entry count using \gls{glsenableentrycount}, you
also enable the following commands:
\cmddef{cgls}
(no case-change, singular, analogous to \gls{gls})
\cmddef{cglspl}
(no case-change, plural, analogous to \gls{glspl})
\cmddef{cGls}
(first letter uppercase, singular, analogous to \gls{Gls}), and
\cmddef{cGlspl}
(first letter uppercase, plural, analogous to \gls{Glspl}).

\begin{xtr}
\Idx{allcaps} versions are only available with \sty{glossaries-extra}.
\end{xtr}

If you don't use \gls{glsenableentrycount}, these commands behave
like their counterparts \gls{gls}, \gls{glspl}, \gls{Gls} and \gls{Glspl},
respectively, but there will be a warning that you haven't enabled
entry counting.

If you have enabled entry counting with
\gls{glsenableentrycount} then these commands test if
\code{\gls{glsentryprevcount}\margm{entry-label}} equals~1. If it doesn't then the
analogous \gls{gls} etc will be used. If it is~1, then the first optional
argument will be ignored and 
\begin{compactcodebox}
\meta{cs format}\margm{entry-label}\margm{insert}\gls{glsunset}\margm{entry-label}
\end{compactcodebox}
will be performed, where \meta{cs format} is a command that takes
two arguments. The command used depends whether you have used
\gls{cgls}, \gls{cglspl}, \gls{cGls} or \gls{cGlspl}.

The formatting command \meta{cs format} will be one of the
following:
\cmddef{cglsformat}
This command is used by \gls{cgls} and defaults to
\begin{compactcodebox}
\gls{glsentrylong}\margm{entry-label}\meta{insert}
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{glsentryfirst}\margm{entry-label}\meta{insert}
\end{compactcodebox}
otherwise.

\cmddef{cglsplformat}
This command is used by \gls{cglspl} and defaults to
\begin{compactcodebox}
\gls{glsentrylongpl}\margm{entry-label}\meta{insert} 
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{glsentryfirstplural}\margm{label}\meta{insert}
\end{compactcodebox}
otherwise.

\cmddef{cGlsformat}
This command is used by \gls{cGls} and defaults to
\begin{compactcodebox}
\gls{Glsentrylong}\margm{entry-label}\meta{insert}
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{Glsentryfirst}\margm{entry-label}\meta{insert}
\end{compactcodebox}
otherwise.

\cmddef{cGlsplformat}
This command is used by \gls{cGlspl} and defaults to
\begin{compactcodebox}
\cmddef{Glsentrylongpl}\margm{entry-label}\meta{insert}
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{Glsentryfirstplural}\margm{entry-label}\meta{insert}
\end{compactcodebox}
otherwise.

This means that if the previous count for the given entry was~1, the
entry won't be \idxc+{hyperlink}{hyperlinked} with the
\gls{cgls}-like commands and those commands won't
\idxc+{indexing}{index} (that is, they won't add a~line to the
external \idx{glossaryfile}). If you haven't used any of the other
commands that \idxc{indexing}{index} (such as \gls{glsadd} or the
\gls{glstextlike} commands) then the \idx{entry} won't appear in the
\idx{glossary}.

Remember that since these commands use \gls{glsentryprevcount} you
need to run \LaTeX\ twice to ensure they work correctly.  The
document build requires a second \LaTeX\ call before running the
\idx{indexingapp}. For example, if the document is in a file called
\filefmt{myDoc.tex}, then the document build needs to be:
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
\end{terminal}

In \mexampleref{sec:entrycount}, the \idxpl{acronym} that have only been used once
(on the previous run) only have their long form shown with
\gls{cgls}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{glsenableentrycount}
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\codepar
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}
\gls{newacronym}\marg{css}\marg{CSS}\marg{cascading style sheets}
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup language}
\gls{newacronym}\marg{sql}\marg{SQL}\marg{structured query language}
\gls{newacronym}\marg{rdbms}\marg{RDBMS}\marg{relational database management system}
\gls{newacronym}\marg{rdsms}\marg{RDSMS}\marg{relational data stream management system}
\codepar
\cbeg{document}
These entries are only used once: \gls{cgls}\marg{sql}, \gls{cgls}\marg{rdbms},
\gls{cgls}\marg{xml}. These entries are used multiple times:
\gls{cgls}\marg{html}, \gls{cgls}\marg{html}, \gls{cgls}\marg{css}, \gls{cgls}\marg{css}, \gls{cgls}\marg{css},
\gls{cgls}\marg{rdsms}, \gls{cgls}\marg{rdsms}.
\codepar
\gls{printglossaries}
\cend{document}
\end{codebox}
After a complete document build the list of \idxpl{acronym} only
includes the entries HTML, CSS and RDSMS. The entries SQL, RDBMS and
XML only have their long forms displayed and don't have
a~\idx{hyperlink}.
\begin{resultbox}
\createexample*[
 title={Don't index entries that are only used once},
 label={sec:entrycount},
 description={Example document that only includes the entries that
have been used more than once in the document},
 arara={pdflatex,pdflatex,makeglossaries,pdflatex,pdfcrop}
]
{%
\cmd{usepackage}[colorlinks]\marg{hyperref}^^J%
\cmd{usepackage}[acronym]\marg{glossaries}^^J%
\gls{makeglossaries}
\codepar
\gls{glsenableentrycount}
\codepar
\gls{setacronymstyle}\marg{long-short}
\codepar
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup
language}^^J%
\gls{newacronym}\marg{css}\marg{CSS}\marg{cascading style
sheets}^^J%
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup
language}^^J%
\gls{newacronym}\marg{sql}\marg{SQL}\marg{structured query
language}^^J%
\gls{newacronym}\marg{rdbms}\marg{RDBMS}\marg{relational database
management system}^^J%
\gls{newacronym}\marg{rdsms}\marg{RDSMS}\marg{relational data stream management system}
}%
{%
These entries are only used once: \gls{cgls}\marg{sql},
\gls{cgls}\marg{rdbms},^^J%
\gls{cgls}\marg{xml}. These entries are used multiple times:^^J%
\gls{cgls}\marg{html}, \gls{cgls}\marg{html}, \gls{cgls}\marg{css},
\gls{cgls}\marg{css}, \gls{cgls}\marg{css},^^J%
\gls{cgls}\marg{rdsms}, \gls{cgls}\marg{rdsms}.
\codepar
\gls{printglossaries}
}
\end{resultbox}

\begin{bib2gls}
With \app{bib2gls} there's an analogous record counting set of
commands. See \sty{glossaries-extra} and \app{bib2gls} manuals for further details. 
\end{bib2gls}

\chapter{Displaying a Glossary}
\label{sec:printglossary}

All defined \idxpl+{glossary} may be displayed using the appropriate
command, such as \gls{printglossary}, that matches the
\idx{indexing} method.  These commands are collectively referred to
as the \inlineglsdef{print...glossary} set of commands.

\begin{information}
With \optionsor{mkidx,xdy,b2g}, if the \idx{glossary} does not
appear after you re-\LaTeX\ your document, check the
\app{makeindex}, \app{xindy} or \app{bib2gls} log files (\ext+{glg}
or the \meta{log-ext} argument of \gls{newglossary}), as applicable,
to see if there is a problem.  With \option{noidx}, you just need
two \LaTeX\ runs to make the \idxpl{glossary} appear, but you may
need further runs to make the \idxpl{numberlist} up-to-date.
If you have used the \opt{automake} option, check the \ext+{log}
file for \qt{runsystem} lines (see the information about the
\opt{automake} option in \sectionref{sec:pkgopts-sort} for further
details).
\end{information}

\option{noidx}
(must be used with \gls{makenoidxglossaries} in the \idxf{documentpreamble}):
\cmddef{printnoidxglossary}
This displays the \idx{glossary} identified by the \printglossopt{type}
option in \meta{options} or, if omitted, the \idx{glossary} identified by
\gls{glsdefaulttype}. This command iterates over a list of
\idx{entry} labels, which it will have to first sort with
\opteqvalref{sort}{standard}. The list will only include those
\idxpl{entry} that have been \indexed\ and the appropriate
\idx{glossary} markup is added within the loop. This makes it
unsuitable for the tabular-like \idxpl{glossarystyle}, such as
\glostyle{long} and \glostyle{super}.

The following is an iterative command:
\cmddef{printnoidxglossaries}
which internally uses \gls{printnoidxglossary} for each 
non-\idx{ignoredglossary}.

\options{mkidx,xdy}
(must be used with \gls{makeglossaries} in the \idxf{documentpreamble}):
\cmddef{printglossary}
This displays the \idx{glossary} identified by the \printglossopt{type}
option in \meta{options} or, if omitted, the \idx{glossary} identified by
\gls{glsdefaulttype}. This command internally inputs the associated
\idx+{glossaryfile} (created by the relevant \idx{indexingapp}) if it exists.
The \idx{glossaryfile} contains the markup to typeset the
\idx{glossary}. See \sectionref{sec:makeglossaries} for information
on how to create the \idx{glossaryfile}.

The following is an iterative command:
\cmddef{printglossaries}
which internally uses \gls{printglossary} for each 
non-\idx{ignoredglossary}.

\begin{important}
While the external \idxpl{glossaryfile} are missing, \gls{printglossary} will just do
\gls{null} for each missing \idx{glossary} to assist dictionary style
documents that just use \gls{glsaddall} without inserting any text.  
This use of \gls{null} ensures that all \idx{indexing} information is
written before the final page is shipped out. Once the external
\idxpl{glossaryfile} are present \gls{null} will no longer be used. This can cause a
spurious blank page on the first \LaTeX\ run before the 
\idxpl{glossaryfile} have been created. Once these files are present, \gls{null}
will no longer be used and so shouldn't cause interference for the
final document. With \sty{glossaries-extra}, placeholder text is
used instead.
\end{important}

\options{b2g,unsrt}
(\sty{glossaries-extra} only):
\cmddef{printunsrtglossary}
This displays the \idx{glossary} identified by the \printglossopt{type}
option in \meta{options} or, if omitted, the \idx{glossary} identified by
\gls{glsdefaulttype}. This command is similar to
\gls{printnoidxglossary}, in that it iterates over a list of
\idx{entry} labels, but in this case all defined entries within the
given glossary are included and the list is in the order in which
they were defined (that is, the order in which they were added to
the \idx{glossary}['s] internal label list).

The reason this command works with \app{bib2gls} is because
\app{bib2gls} writes the entry definitions in the \ext{glstex} file in
the order obtained by the \resourceopt{sort} resource option, and
\app{bib2gls} will only include the \idxpl{entry} that match the
required selection criteria.

With \option{unsrt} (that is, without \app{bib2gls}) the result will
be in the order the \idxpl{entry} were defined in the \ext{tex} file.
There's no attempt to gather child entries (see \sectionref{sec:subentries}).
This means that if you don't define child entries immediately after
their parent, you will have a strange result (depending on the
\idx{glossarystyle}).

As with \gls{printnoidxglossary}, the \idx{glossary} markup is
inserted during the loop but, unlike that command,
\gls{printunsrtglossary} performs the loop outside of the
\idx{glossarystyle}, which means that there are no issues with the
tabular-like styles. See the \sty{glossaries-extra} manual for
further details.

The following is an iterative command:
\cmddef{printunsrtglossaries}
which internally uses \gls{printunsrtglossary} for each 
non-\idx{ignoredglossary}.

The \sty{glossaries-extra} package also provides
\cmddef{printunsrtinnerglossary}
which is designed for inner or nested glossaries. It allows many, but not all,
of the options listed below.  There's an example available in the gallery: 
\gallerypage{bib2gls-inner}{Inner or Nested Glossaries}.
See the \sty{glossaries-extra} package for further details.

All the individual \idx{glossary} commands \gls{print...glossary}
have an optional argument. Available options are listed 
in \sectionref{sec:printglossoptions}.

After the options have been set, the following command will be
defined:
\cmddef{currentglossary}
This expands to the label of the current \idx{glossary} (identified
by the \printglossopt{type} option). It may be used within
\idx{glossarystyle} hooks, if required.

\section{\glsfmttext{print...glossary} Options}
\label{sec:printglossoptions}

These options may be used in the optional argument of the
\gls+{print...glossary} set of commands.
Some options are available for all those commands, but those that aren't
are noted. Before the options are set, the following commands are
defined to their defaults for the given \idx{glossary}. They may
then be redefined by applicable options.

\printglossoptdef{type}
Identifies the \idx{glossary} to display. The value should be the
\idx{glossary} label. Note that you can only display an
\idx{ignoredglossary} with \gls{printunsrtglossary} or
\gls{printunsrtinnerglossary}, otherwise \meta{glossary-label}
should correspond to a \idx{glossary} that was defined with
\gls{newglossary} or \gls{altnewglossary}.

\printglossoptdef{title}
Sets the \idx{glossary}['s] title (\gls{glossarytitle}). This option isn't available
with \gls{printunsrtinnerglossary}.

\printglossoptdef{toctitle}
Sets the \idx{glossary}['s] \idx+{tableofcontents} title
(\gls{glossarytoctitle}). This option isn't available
with \gls{printunsrtinnerglossary}.

\printglossoptdef{style}
The \idx{glossarystyle} to use with this \idx{glossary} (overriding
the current style that was either set with the \opt{style} package
option or with \gls{setglossarystyle}). 
This option isn't available with \gls{printunsrtinnerglossary}.

\printglossoptdef{numberedsection}
This may be used to override the \opt{numberedsection} package
option, and has the same syntax as that option (see \sectionref{sec:pkgopts-sec}). 
This option isn't available with \gls{printunsrtinnerglossary}.

\printglossoptdef{nonumberlist}
This may be used to override the \opt{nonumberlist} package option.
Note that, unlike the valueless package option, this option is boolean.

\printglossoptdef{nogroupskip}
This may be used to override the \opt{nogroupskip} package option.
Only relevant if the \idx{glossarystyle} uses the conditional 
\gls{ifglsnogroupskip} to test for this option.

\printglossoptdef{nopostdot}
This may be used to override the \opt{nopostdot} package option.
This option is only applicable if the \idx{glossarystyle} uses
\gls{glspostdescription}.

\printglossoptdef{entrycounter}
This may be used to override the \opt{entrycounter} package option.
Note that one of the package options \optval{entrycounter}{true} or
\optval{subentrycounter}{true} must be
used to make \gls{glsrefentry} work correctly. The setting can then
be switched off with this option for individual \idxpl{glossary}
where the setting shouldn't apply.

\printglossoptdef{subentrycounter}
This may be used to override the \opt{subentrycounter} package option.
Note that one of the package options \optval{entrycounter}{true}
or \optval{subentrycounter}{true} must be
used to make \gls{glsrefentry} work correctly. The setting can then
be switched off with this option for individual \idxpl{glossary}
where the setting shouldn't apply.

\begin{warning}
If you want to set both the \printglossopt{entrycounter} and
\printglossopt{subentrycounter} settings, and you haven't already
enabled them with the \opt{entrycounter} and \opt{subentrycounter}
package options, make sure you specify \printglossopt{entrycounter}
first (but bear in mind \gls{glsrefentry} won't work).
In general, it's best to enable these settings via the package
options and switch them off for the \idxpl{glossary} where they don't
apply.
\end{warning}

\printglossoptdef{sort}
This key is only available with \gls{printnoidxglossary}.

\begin{important}
If you use the \printglossopteqvalref{sort}{use} or
\printglossopteqvalref{sort}{def} values make sure
that you select a \idx{glossarystyle} that doesn't have a visual
indicator between groups, as the grouping no longer makes sense.
Consider using the \opt{nogroupskip} option.
\end{important}

If you don't get an error with \printglossopteqvalref{sort}{use} and
\printglossopteqvalref{sort}{def} but you do get an error with one
of the other sort options, then you probably need to use the
\optval{sanitizesort}{true} package option or make sure none of the
\idxpl{entry} have fragile commands in their \gloskey{sort} field.

\optionvaldef{printgloss.sort}{use}
Order of use. There's no actual sorting in this case. The order is
obtained from the \idx{indexing} information in the \ext{aux} file.

\optionvaldef{printgloss.sort}{def}
Order of definition. There's no actual sorting in this case. The order is
obtained from the \idx{glossary}['s] internal list of labels.

\begin{information}
The above two settings don't perform any actual sorting. The
following settings sort using simple character code comparisons
and are therefore unsuitable for non-\idx{ascii} documents.

For a locale-sensitive sort, you must use
either \app{xindy} (\option{xdy}) or \app{bib2gls} (\option{b2g}).
Note that \app{bib2gls} provides many other sort options.
\end{information}

\optionvaldef{printgloss.sort}{nocase}
Case-insensitive order.

\optionvaldef{printgloss.sort}{case}
Case-sensitive order.

\optionvaldef{printgloss.sort}{word}
Word order.

\optionvaldef{printgloss.sort}{letter}
Letter order.

\optionvaldef{printgloss.sort}{standard}
Word or letter order according to the \opt{order}
package option.

The word and letter order sort methods use \sty{datatool}['s]
\gls{dtlwordindexcompare} and \gls{dtlletterindexcompare} handlers.
The case-insensitive sort method uses \sty{datatool}['s]
\gls{dtlicompare} handler.  The case-sensitive sort method uses
\sty{datatool}['s] \gls{dtlcompare} handler. See the \sty{datatool}
documentation for further details.

\printglossoptdef{label}
This key is only available with \sty{glossaries-extra} and labels
the \idx{glossary} with \code{\gls{label}\margm{label}}. This is an alternative to
the package option \optval{numberedsection}{autolabel}.
This option isn't available with \gls{printunsrtinnerglossary}.

\printglossoptdef{target}
This key is only available with \sty{glossaries-extra} and can be used to switch
off the automatic hypertarget for each \idx{entry}. (This refers to the
target used by commands like \gls{gls} and \gls{glslink}.)

This option is useful with \gls{printunsrtglossary} as it allows
the same list (or sub-list) of \idxpl{entry} to be displayed multiple
times without causing duplicate hypertarget names.

\printglossoptdef{prefix}
This key is only available with \sty{glossaries-extra} and provides
another way of avoiding duplicate hypertarget names. In this case it uses a
different prefix for those names. This locally redefines
\gls{glolinkprefix} but note this will also affect the target for any entry
referenced within the glossary with commands like \gls{gls},
\gls{glslink} or \gls{glshyperlink}.

\printglossoptdef{targetnameprefix}
This key is only available with \sty{glossaries-extra}.
This is similar to the \printglossopt{prefix} option, but it alters the prefix of
the hypertarget anchors without changing \gls{glolinkprefix} (so it
won't change the \idxpl{hyperlink} for any \idxpl{entry} referenced in the
\idx{glossary}).

\printglossoptdef{groups}
This key is only available with \gls{printunsrtglossary} and
\gls{printunsrtinnerglossary}.
If true, the \qt{unsrt} function that creates the code for
typesetting the \idx{glossary} will insert \idx{lettergroup}
headers whenever a change is detected in the \idx{lettergroup}
label between entries of the same \idx{hierarchicallevel}. 
See the \sty{glossaries-extra} manual for further details.

\printglossoptdef{leveloffset}
This key is only available with \gls{printunsrtglossary} and
\gls{printunsrtinnerglossary}.
It can be used to locally adjust the
\idx{hierarchicallevel} used by the \idx{glossarystyle}. See the
\sty{glossaries-extra} manual for further details and also
\gallerypage{bib2gls-inner}{Gallery: Inner or Nested Glossaries}.

\printglossoptdef{flatten}
This key is only available with \gls{printunsrtglossary} and
\gls{printunsrtinnerglossary}.  It can be used to locally remove the
\idx{hierarchicallevel} used by the \idx{glossarystyle}. See the
\sty{glossaries-extra} manual for further details.

\section{Glossary Markup}
\label{sec:glossmarkup}

This section describes the commands that are used to display the
\idx{glossary}. If you want to suppress the \idxpl{numberlist}
you can use the \opt{nonumberlist} option. If you want to save the
\idxpl{numberlist} for some other purpose outside of the
\idx{glossary}, you can use the \opt{savenumberlist} option. 
If you want information about an \idx{entry}['s] parent then you can use
\gls{ifglshasparent} (to determine if the entry has a parent)
or \gls{glsentryparent} (to expand to the parent's label).
The \idx{hierarchicallevel} is provided in \gls{subglossentry}
(and is 0 with \gls{glossentry}) but it's also stored in the
\glosfield{level} internal field.

If you're trying to work out how to parse the \idx{glossary} in
order to gather \idx{indexing} information, consider using
\app{bib2gls} instead, which stores all the \idx{indexing}
information, such as \idxpl{locationlist} and \idx{lettergroup}
labels, in internal fields. It can also store lists of sibling
entries or child entries. If you really want to input the
\idx{glossaryfile} in order to gather information obtained by
\app{makeindex} or \app{xindy} without actually displaying anything
(by redefining the markup commands to not produce any text), use
\gls{input} rather than \gls{printglossary}.

The \idx{glossary} is always started with:
\begin{compactcodebox}
\gls{glossarysection}\oarg{\gls{glossarytoctitle}}\marg{\gls{glossarytitle}}
\end{compactcodebox}
This creates the heading. This command sets the page header with:
\begin{compactcodebox}
\gls{glsglossarymark}\marg{\gls{glossarytoctitle}}
\end{compactcodebox} 
If this is unsuitable for your chosen class file or page style package,
you will need to redefine \gls{glsglossarymark}. If
\gls{phantomsection} is defined (\sty{hyperref}) then
\gls{glossarysection} will start with:
\begin{compactcodebox}
\gls{glsclearpage}
\gls{phantomsection}
\end{compactcodebox}

\cmddef{glossarysection}
By default, this command uses either \starredcs{chapter} or
\starredcs{section}, depending on whether or not \gls{chapter} is
defined.  This can be overridden by the \opt{section} package option
or the \gls{setglossarysection} command. Numbered sectional units
can be obtained using the \opt{numberedsection} package option. 
If the default unnumbered section setting is on, then the
\meta{toc-title} will only be added to the \idx+{tableofcontents} if
the \opt{toc} option is set. If \opt{numberedsection} is on, the
addition to the \idx{tableofcontents} is left to the sectional
command.

\begin{information}
Further information about these options and commands is given in
\sectionref{sec:pkgopts-sec}.
\end{information}

\cmddef{glsglossarymark}
This sets the page header, if supported by the current page style.
Originally the command \inlineglsdef{glossarymark} was provided for
this purpose, but this command is also provided by other packages
and classes, notably \cls{memoir} which has a different syntax. 
Therefore the command \gls{glossarymark} will
only be defined if it doesn't already exist. In which case,
\gls{glsglossarymark} will simply use \gls{glossarymark}.

If \cls{memoir} has been loaded, \gls{glsglossarymark} will be
defined to use \gls{markboth} otherwise, if some other class or
package has defined \gls{glossarymark}, \gls{glsglossarymark} will
be defined to use \gls{@mkboth} (using the same definition as the
\sty{glossaries} package's version of \gls{glossarymark}).

If \optval{ucmark}{true}, the \idx{casechange} will be applied
using \gls{memUChead} if \cls{memoir} has been loaded, otherwise it
will use \gls{glsuppercase}.

So if you want to redefine the way the header mark is set for the
\idxpl{glossary}, you need to redefine \gls{glsglossarymark} not
\gls{glossarymark}.
For example, to only change the right header:
\begin{codebox*}
\cmd{renewcommand}\marg{\gls{glsglossarymark}}[1]\marg{\gls{markright}\marg{\#1}}
\end{codebox*}
or to prevent it from changing the headers:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsglossarymark}}[1]\marg{}
\end{codebox}
If you want \gls{glsglossarymark} to use \idx{allcaps} in the header, use the
\opt{ucmark} option described below.

With \sty{hyperref} and unnumbered section headings, \gls{phantomsection}
is need to create an appropriate anchor (see the \sty{hyperref}
manual). This will need the page cleared for \starredcs{chapter},
which is done with:
\cmddef{glsclearpage}
If the \optval{section}{chapter} setting is on then
\gls{glsclearpage} will use \gls{cleardoublepage}, if it's defined
and if the \gls{if@openright} conditional (provided by classes with
an \opt{openright} option such as \cls{book} and \cls{report}) isn't
defined or is defined and is true, otherwise \gls{clearpage} is
used.

Occasionally you may find that another package defines 
\gls{cleardoublepage} when it is not required. This may cause an 
unwanted blank page to appear before each \idx{glossary}
If you only want a single page cleared, you can redefine
\gls{glsclearpage}. For example:
\begin{codebox*}
\cmd{renewcommand}*\marg{\gls{glsclearpage}}\marg{\gls{clearpage}}
\end{codebox*}
Note that this will no longer take the \opt{section} package option
into account.

\cmddef{glossarytitle}
This expands to the title that should be used by the \idx{glossary}
section header. It's initialised to the title provided in
\gls{newglossary} when the \idx{glossary} was defined. The
\printglossopt{title} option will redefined this command.

\cmddef{glossarytoctitle}
This expands to the \idx+{tableofcontents} title that's supplied in
the optional argument of the \idx{glossary} section command. It will
only be added to the \idx{tableofcontents} is the \opt{toc} package
option is on, but it may also be used in the page header (depending
on the definition of \gls{glsglossarymark} and the current page style).

The \gls{glossarytoctitle} command is initialised to \gls{glossarytitle}.
The \printglossopt{toctitle} option will redefine this command.
If neither the \printglossopt{title} nor \printglossopt{toctitle} are
used, \gls{glossarytoctitle} will be defined via:
\cmddef{glssettoctitle}
By default, this will redefine \gls{glossarytoctitle} to the title
provided in \gls{newglossary} when the \idx{glossary} was defined.

This means that if neither \printglossopt{title} nor
\printglossopt{toctitle} are set, the \idx{glossary}['s] associated
title will be used for both. If only \printglossopt{title} is used,
then it will also apply to the \idx{tableofcontents} title, and if
only \printglossopt{toctitle} is used, then \gls{glossarytoctitle} will
be defined to that value but \gls{glossarytitle} will be the
\idx{glossary}['s] associated title.


After the heading, but before the main body of the \idx{glossary}, is
the \inlineidxfdef{glossarypreamble} which is given by:
\cmddef{glossarypreamble}
You can redefine this before the \idx{glossary} is shown. For
example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glossarypreamble}}\marg{Numbers in italic 
indicate primary definitions.}
\end{codebox}
A \idx{glossary} may have its own specific \idx{glossarypreamble}. If it has one
defined, then the \gls{print...glossary} set of commands will
locally redefine \gls{glossarypreamble} to that \idx{glossarypreamble} instead.
Since this change is scoped, the previous definition will be
restored after the \gls{print...glossary} command.

You can globally assign a \idx{glossarypreamble} to a specific \idx{glossary} with:
\cmddef{setglossarypreamble}
If \meta{type} is omitted, \gls{glsdefaulttype} is used.
For example:
\begin{codebox}
\gls{setglossarypreamble}\marg{Numbers in italic 
indicate primary definitions.}
\end{codebox}
This will set the given \idx{glossarypreamble} text for just the
\glostype{main} glossary, not for any other \idx{glossary}. The
\sty{glossaries-extra} package additionally provides:
\cmddef{apptoglossarypreamble}
which locally appends \meta{text} to the \idx{glossarypreamble} for the specific
\idx{glossary} and
\cmddef{pretoglossarypreamble}
which locally prepends \meta{text} to the \idx{glossarypreamble} for
the specific \idx{glossary}.

There is also a \inlineidxdef{postamble} at the end of each \idx{glossary} which 
is given by:
\cmddef{glossarypostamble}
This is less useful than a \idx{glossarypreamble} and so there's no analogous
command to \gls{setglossarypreamble}.

\begin{information}
The \idx{glossarypreamble} and \idx{postamble} occur outside of \env{theglossary} and so
shouldn't be influenced by the \idx+{glossarystyle}.
\end{information}

\begin{example}{Switch to Two Column Mode for Glossary}{ex:twocolumn}
Suppose you are using the \glostyle{superheaderborder} style, and
you want the \idx{glossary} to be in two columns (you can't use the
\glostyle{longheaderborder} style for this example as you can't use
the \env{longtable} environment in two column mode), but after the
\idx{glossary} you want to switch back to one column mode, you could do:
\begin{codebox*}
\cmd{renewcommand}*\marg{\gls{glossarysection}}[2][]\marg{\comment{}
  \gls{twocolumn}\oarg{\marg{\gls{chapter}*\marg{\#2}}}\comment{}
  \cmd{setlength}\gls{glsdescwidth}\marg{0.6\cmd{linewidth}}\comment{}
  \gls{glsglossarymark}\marg{\gls{glossarytoctitle}}\comment{}
}
\codepar
\cmd{renewcommand}*\marg{\gls{glossarypostamble}}\marg{\gls{onecolumn}}
\end{codebox*}
(You may prefer to use the \glostyle{mcolalttree} style if you're
not interested in the column headers or borders.)
\end{example}

The actual \idx{glossary} content is contained within the
\env{theglossary} environment, which will typically be in the form:
\begin{compactcodebox}
\cbeg{theglossary}\gls{glossaryheader}
\gls{glsgroupheading}\margm{group-label}\cmd{relax}\gls{glsresetentrylist}
\gls{glossentry}\margm{entry-label}\margm{number-list}
\gls{subglossentry}\margm{level}\margm{entry-label}\margm{number-list}
\comment{\ldots}
\gls{glsgroupskip}
\gls{glsgroupheading}\margm{group-label}\cmd{relax}\gls{glsresetentrylist}
\gls{glossentry}\margm{entry-label}\margm{number-list}
\gls{subglossentry}\margm{level}\margm{entry-label}\margm{number-list}
\comment{\ldots}
\cend{theglossary}
\end{compactcodebox}

The entire \idx{numberlist} for each \idx{entry} is encapsulated with:
\cmddef{glossaryentrynumbers}
This command allows \gls{glsnonextpages}, \gls{glsnextpages}, and
the \opt{nonumberlist} and \opt{savenumberlist} options to work.
The \gls{glossaryentrynumbers} command is reset by:
\cmddef{glsresetentrylist}

With \option{noidx}, this command is preceded by:
\cmddef{glsnoidxprenumberlist}
The default behaviour is to use the value of the
\glosfield{prenumberlist} internal field. This command is not used
with \options{mkidx,xdy}.

If you want to suppress the \idx{numberlist} for a particular entry,
you can add the following to the entry's description:
\cmddef{glsnonextpages}
Within the \idx{glossary}, this will redefine \gls{glossaryentrynumbers}
to ignore its argument and then reset itself. This means that the
next \idx{numberlist} will be suppressed. Note that if the entry
doesn't have a \idx{numberlist} (for example, it's a parent entry
that only appears in the \idx{glossary} because it has an \indexed\
descendent entry) then the next \idx{numberlist} will be for the
first child entry that's been \indexed. This command does nothing
outside of the \idx{glossary}.

Similarly, if you want to override the \opt{nonumberlist} option to
ensure that the next \idx{numberlist} is shown, then use:
\cmddef{glsnextpages}
This command does nothing outside of the \idx{glossary}.

\begin{information}
The \gloskey{nonumberlist} key that may be used when defining an
\idx{entry}, works by automatically adding \gls{glsnonextpages} or
\gls{glsnextpages} to the \idx{indexing} information before
\gls{glossentry} or \gls{subglossentry} with \options{mkidx,xdy}.
With \option{noidx}, the relevant command is put in the
\glosfield{prenumberlist} internal field, but since
\gls{printnoidxglossary} only uses \gls{glsnoidxprenumberlist}
and \gls{glossaryentrynumbers} when the \glosfield{loclist} field is
set, it won't affect sub-entries.
\end{information}

The \env{theglossary} environment, and the other commands
(\gls{glossaryheader}, \gls{glsgroupskip}, \gls{glsgroupheading},
\gls{glossentry} and \gls{subglossentry}) are all redefined by
\idxpl{glossarystyle} and are described in
\sectionref{sec:newglossarystyle}.

\chapter{Defining New Glossaries}
\label{sec:newglossary}

A new \idx+{glossary} can be defined using:
\cmddef{newglossary}
where \meta{glossary-label} is the label to assign to this
\idx{glossary}. This label is used to reference the \idx{glossary}
in the value of the \gloskey{type} key when defining \idxpl{entry} or,
the similarly named, \printglossopt{type} option in the
\gls{print...glossary} commands.

\begin{important}
As with labels in general, \meta{glossary-label} must not contain any active
characters. 
\end{important}

The arguments \meta{in-ext} and \meta{out-ext} specify the
extensions of the input and output (from \TeX's point of
view) \idxc+{glossaryfile}{files} for that \idx{glossary},
\meta{title} is the default title for this new \idx{glossary}, and
the final optional argument \meta{counter} specifies which
\idx{locationcounter} to use for the associated \idxpl{numberlist}
(see also \sectionref{sec:numberlists}). If not specified, the
default \idx{locationcounter} will be the one identified in the
\opt{counter} option, if that option is used, otherwise it will be
the \ctr+{page} counter.

The first optional argument \meta{log-ext} specifies the extension
for the \idx{indexingapp}['s] transcript file (this information is
used by \app{makeglossaries} which picks up the information
from the \ext+{aux} file and also by the \opt{automake} option).  If
omitted, \ext+{glg} is used.

The file extensions only apply to \options{mkidx,xdy}. For the other
options, the \idx{indexing} information is written to the \ext{aux}
file for \options{noidx,b2g}. No input file is required for
\option{noidx} and \option{b2g} always has the \ext+{glstex} file
extension. Since the file extensions are only relevant for
\options{mkidx,xdy}, there is a starred version that omits those
arguments:
\cmddef{newglossary*}
This is equivalent to
\begin{compactcodebox}
\gls{newglossary}\oarg{\meta{glossary-label}-glg}\margm{glossary-label}\marg{\meta{glossary-label}-gls}\marg{\meta{glossary-label}-glo}\margm{title}\oargm{counter}
\end{compactcodebox}
or you can use:
\cmddef{altnewglossary}
which is equivalent to
\begin{compactcodebox}
\gls{newglossary}\oarg{\meta{tag}-glg}\margm{glossary-label}\marg{\meta{tag}-gls}\marg{\meta{tag}-glo}\margm{title}\oargm{counter}
\end{compactcodebox}
Note that in both cases distinct file extensions are defined so these
commands are still useful with \options{mkidx,xdy}.

It may be that you have some terms that are so common
that they don't need to be listed. In this case, you can define 
a~special type of \idx{glossary} that doesn't create any associated files.
This is referred to as an \qt{\idx+{ignoredglossary}} and it's ignored by
commands that iterate over all the \idxpl{glossary}, such as
\gls{printglossaries}. To define an \idx{ignoredglossary}, use
\gls{newignoredglossary}
where \meta{glossary-label} is the glossary label (as above). This
\idx{glossary} type will automatically be added to the
\opt{nohypertypes} list, since there are no hypertargets for
the entries in an \idx{ignoredglossary}.
(The sample file \samplefile{-entryfmt} defines an ignored glossary.)

An \idx{ignoredglossary} can't be displayed with
\gls{printnoidxglossary} or \gls{printglossary} but can be displayed
with \gls{printunsrtglossary} and \gls{printunsrtinnerglossary}.

\begin{xtr}
The \sty{glossaries-extra} package provides a starred version 
\starredcs{newignoredglossary} that doesn't suppress
\idxpl{hyperlink} (since \idxpl{ignoredglossary} can be
useful with \app{bib2gls}). There is also an analogous 
\gls{provideignoredglossary} command.
\end{xtr}

You can test if a \idx{glossary} is an ignored one using:
\cmddef{ifignoredglossary}
This does \meta{true} if \meta{glossary-label} was defined as an 
\idx{ignoredglossary}, otherwise it does \meta{false}.

Note that the \glostypedef{main} (default) \idx{glossary} is automatically created as:
\begin{compactcodebox}
\gls{newglossary}\marg{main}\marg{\ext+{gls}}\marg{\ext+{glo}}\marg{\gls{glossaryname}}
\end{compactcodebox}
so it can be identified by the label \glostype{main} (unless the
\opt{nomain} package option is used). If the \sty{doc} package has
been loaded (which uses the \ext{gls} and \ext{glo} extensions for
the change log) then the \glostype{main} glossary will instead be
defined as:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{glg2}}\marg{main}\marg{\ext+{gls2}}\marg{\ext+{glo2}}\marg{\gls{glossaryname}}
\end{compactcodebox}
If you are using a class or package that similarly requires
\ext{gls} and \ext{glo} as file extensions, you will need to use the
\opt{nomain} option and define your own custom \idx{glossary}, but
be aware of other possible conflicts, such as different definitions
of commands and environments like \gls{printglossary} or
\env{theglossary}.

The \opt{acronym} (or \opt{acronyms}) package option is equivalent to:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{alg}}\marg{\glostype{acronym}}\marg{\ext+{acr}}\marg{\ext+{acn}}\marg{\gls{acronymname}}
\end{compactcodebox}
so it can be identified by the label \glostype{acronym}. If you are
not sure whether the \opt{acronym} option has been used, you
can identify the list of \idxpl{acronym} by the command:
\cmddef{acronymtype}
The default definition is simply \gls{glsdefaulttype}. The
\opt{acronym} or \opt{acronyms} option will redefine \gls{acronymtype} to
\glostype{acronym}. If you want additional \idxpl{glossary} for
use with \idxpl{acronym}, remember to declare them with
\opt{acronymlists}.

The \opt{symbols} package option creates a new \idx{glossary} with the
label \glostype{symbols} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{slg}}\marg{\glostype{symbols}}\marg{\ext+{sls}}\marg{\ext+{slo}}\marg{\gls{glssymbolsgroupname}}
\end{compactcodebox}
The \opt{numbers} package option creates a new \idx{glossary} with
the label \glostype{numbers} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{nlg}}\marg{\glostype{numbers}}\marg{\ext+{nls}}\marg{\ext+{nlo}}\marg{\gls{glsnumbersgroupname}}
\end{compactcodebox}
The \opt{index} package option creates a new \idx{glossary} with
the label \glostype{index} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{ilg}}\marg{\glostype{index}}\marg{\ext+{ind}}\marg{\ext+{idx}}\marg{\gls{indexname}}
\end{compactcodebox}

\begin{important}
With \options{mkidx,xdy} all \idxpl{glossary} must be defined before
\gls+{makeglossaries} to ensure that the relevant output
\idxc{glossaryfile}{files} are opened.

See \sectionref{sec:fixednames} if you want to redefine \gls{glossaryname}, 
especially if you are using a language package.
(Similarly for \gls{glssymbolsgroupname} and
\gls{glsnumbersgroupname}.) If you want to redefine \gls{indexname},
just follow the advice in
\texfaq{FAQ-fixnam}{How to change LaTeX's \qt{fixed names}}.
\end{important}

\chapter{Adding an Entry to the Glossary Without Generating Text}
\label{sec:glsadd}

It is possible to \idx+{index}{indexing} an \idx{entry} without
\cmddef{glsadd}
This is similar to the \gls{glstextlike} commands, only it doesn't produce
any text. Therefore, there is no \glsopt{hyper} key
available in \meta{options} but all the other base options that can
be used with the \gls{glstextlike} commands can be passed to \gls{glsadd}.
The \sty{glossaries-extra} package provides addition options, such
as \glsopt{textformat}, that aren't applicable when there's no
\idx{linktext}, so they are also not available.
This ensures that the given entry is listed in the \idx{glossary}
and that the current \location\ is included in the entry's
\idx{numberlist}.

This command is particularly useful to create an explicit \idx{range} that
covers an entire section or block of text that might otherwise end
up with a long, ragged \idx{numberlist}. For example, suppose I have
defined an \idx{entry} with the label \qt{set}:
\begin{codebox}
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{set},
 \gloskeyval{description}{a collection}}
\end{codebox}
Suppose I have a section about sets spanning from page~3 to page~8
with repeated use of \code{\gls{gls}\marg{set}} on pages~3, 5, 7 
and 8. This will result in the \idx{numberlist} \qt{3, 5, 7, 8}
which is a bit untidy. It would look far more compact, and better
emphasize that the section of the document from page~3 to~8 covers
sets, if the \idx{numberlist} was simply \qt{3--8}.

This can be done with an explicit \idx{range}:
\begin{codebox}
\gls{glsadd}\oarg{\glsoptval{format}{\sym+{startrange}}}\marg{set}
Lots of text about sets spanning page 3 to page 8.
\gls{glsadd}\oarg{\glsoptval{format}{\sym+{endrange}}}\marg{set}
\end{codebox}
See \sectionref{sec:encap} for more information about the
\idx{locationencap}.

\begin{xtr}
Explicit ranges can also be created using \gls{glsstartrange}
and \gls{glsendrange} with \sty{glossaries-extra}. You can also add
a subset of entries with \gls{glsaddeach}.
\end{xtr}

To add all entries that have been defined, use:
\cmddef{glsaddall}
The optional argument is the same as for \gls{glsadd}, except
there is also a key \glsoptdef{types} which can be
used to specify which \idxpl{glossary} to use. This should be a
comma-separated list. For example, if you only want to add
all the \idxpl{entry} belonging to the list of acronyms (specified by
the glossary type \gls{acronymtype}) and a list of
notation (specified by the glossary type \optfmt{notation}) then you can
do:
\begin{codebox}
\gls{glsaddall}\oarg{\glsoptvalm{types}{\gls{acronymtype},notation}}
\end{codebox}

\begin{bib2gls}
If you are using \app{bib2gls} with \sty{glossaries-extra}, you
can't use \gls{glsaddall}. Instead use the \resourceoptval{selection}{all}
resource option to select all \idxpl{entry} in the given \ext+{bib} files.
(You can use \gls{glsaddeach} with \app{bib2gls}.)
\end{bib2gls}

\begin{important}
Note that \gls{glsadd} and \gls{glsaddall} add the current
\location\ to the \idx{numberlist}. In the case of \gls{glsaddall},
all \idxpl{entry} in the listed \idxpl{glossary} will have the same
\location\ in the \idx{numberlist} (the \location\ at the point in
the document where \gls{glsaddall} was used, which will be page~1 if
it occurs in the \idx{documentpreamble}). If you want to use
\gls{glsaddall}, it's best to suppress the \idx{numberlist} with the
\opt{nonumberlist} package option. (See
sections~\ref{sec:pkgopts-printglos} and~\ref{sec:numberlists}.)
\end{important}

If you want to ensure that all \idx{entry} are added to the
\idx{glossary}, but only want the \locations\ of entries that have
actually been used in the document, then you can use:
\cmddef{glsaddallunused}
Note that in this case, the optional argument is simply a list of
\idx{glossary} labels. The options available to \gls{glsadd} and
\gls{glsaddall} aren't available here. If the optional argument is
omitted, the list of all non-\idxpl{ignoredglossary} is assumed.

This command implements:
\begin{compactcodebox}
\gls{glsadd}\oarg{\glsoptval{format}{\encap{glsignore}}}\margm{entry-label}
\end{compactcodebox}
for each \idx{entry} in each \idx{glossary} listed in the optional
argument if the entry has been marked as \glslink{firstuseflag}{used}.
Since \gls{glsignore} discards its argument, this effectively
creates an \idx{invisiblelocation}. This is necessary because
\app{makeindex} and \app{xindy} require an associated \location\ for
each line in the \idx{indexingfile}. (They are
\glslink{indexingapp}{\emph{indexing} applications} not glossary
applications, so they expect page numbers.)

This means that \gls{glsaddallunused} adds \code{\gls{glsignore}\margm{location}} to
the \idx{numberlist} of all the \emph{unused} \idxpl{entry}.
If any of those \idxpl{numberlist} have other \locations\ (for
example, the \idxpl{firstuseflag} was reset before
\gls{glsaddallunused} or only the \gls{glstextlike} commands were
used or if any \idx{indexing} occurs after \gls{glsaddallunused})
then this will cause spurious commas or en-dashes in the
\idx{numberlist} that have been placed before or after the 
\idx{invisiblelocation}.

\begin{important}
If you want to use \gls{glsaddallunused}, it's best to place the
command at the end of the document to ensure that all the commands
you intend to use have already been used and make sure to use the
\gls{glslike} commands and don't issue any resets (\gls{glsreset} etc).
\end{important}

\begin{bib2gls}
You can't use \gls{glsaddallunused} with \app{bib2gls}. However,
since \app{bib2gls} was designed specifically for
\sty{glossaries-extra}, it recognises \encap{glsignore} as a special
format that indicates the \location\ shouldn't be added to the
\idx{locationlist} but the \idx{entry} should be selected.
So you can index an entry with \glsoptval{format}{\encap{glsignore}}
to ensure that the entry is selected without adding a \location\ to
the \idx{numberlist}.

Alternatively, the \resourceoptval{selection}{all} resource option
can be used, which will ensure all \idxpl{entry} are selected but only
those \indexed\ with one or more non-ignored \locations\ will have a
\idx{locationlist}.
\end{bib2gls}

Base \sty{glossaries} package only:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{cat}\marg{\gloskeyval{name}{cat},\gloskeyval{description}{feline}}
\gls{newglossaryentry}\marg{dog}\marg{\gloskeyval{name}{dog},\gloskeyval{description}{canine}}
\cbeg{document}
\gls{gls}\marg{cat}.
\gls{printglossaries}
\gls{glsaddallunused} \comment{<- make sure dog is also listed}
\cend{document}
\end{codebox}
Corresponding \sty{glossaries-extra} and \app{bib2gls} document code:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\oarg{\opt{record}}\marg{glossaries-extra}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{all}}
\cbeg{document}
\gls{gls}\marg{cat}.
\gls{printunsrtglossaries}
\cend{document}
\end{codebox}
With the file \filefmt{entries.bib}:
\begin{codebox}
\atentry{entry}\marg{cat,\gloskeyval{name}{cat},\gloskeyval{description}{feline}}
\atentry{entry}\marg{dog,\gloskeyval{name}{dog},\gloskeyval{description}{canine}}
\end{codebox}

\begin{example}{Dual Entries}{ex:dual}
The example file \samplefile{-dual} makes use of \gls{glsadd} to
allow for an \idx{entry} that should appear both in the \glostype{main} glossary and
in the list of \idxpl{acronym}. This example sets up the list of 
\idxpl{acronym} using the \opt{acronym} package option:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries}
\end{codebox}
A new command (\gls{newdualentry}) is then defined to make it easier to define dual
entries:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newdualentry}}[5][]\marg{\comment{}
  \gls{newglossaryentry}\marg{main-\#2}\marg{\gloskeyval{name}{\#4},\comment{}
  \gloskeyval{text}{\#3\gls{glsadd}\marg{\#2}},\comment{}
  \gloskeyval{description}{\#5},\comment{}
  \#1
  }\comment{}
  \gls{newacronym}\marg{\#2}\marg{\#3\gls{glsadd}\marg{main-\#2}}\marg{\#4}\comment{}
}
\end{codebox}
This has the following syntax:
\begin{compactcodebox}
\gls{newdualentry}\oargm{options}\margm{label}\margm{abbrv}\margm{long}\margm{description}
\end{compactcodebox}
You can then define a new dual entry:
\begin{codebox}
\gls{newdualentry}\marg{svm}\comment{label}
  \marg{SVM}\comment{abbreviation}
  \marg{support vector machine}\comment{long form}
  \marg{Statistical pattern recognition technique}\comment{description}
\end{codebox}
Now you can reference the acronym with \code{\gls{gls}\marg{svm}} or you can
reference the entry in the \glostype{main} glossary with
\code{\gls{gls}\marg{main-svm}}.

This is just an example.
In general, think twice before you add this kind of duplication.
If all information (short, long and description) can be provided in
a single list, it's redundant to provide a second list unless any
of the short forms start with a different letter to the associated
long form, which may make it harder to lookup.

\begin{bib2gls}
Note that with \app{bib2gls}, there are special dual entry types
that implement this behaviour. That is, if an entry is referenced
then its corresponding dual entry will automatically be selected as
well. So there is less need for \gls{glsadd} with \app{bib2gls}.
(Although it can still be useful, for example with \option{standalone}.)
\end{bib2gls}
\end{example}

\chapter{Cross-Referencing Entries}
\label{sec:crossref}

\begin{important}
You must use \gls{makeglossaries} (\optionsor{mkidx,xdy}) or
\gls{makenoidxglossaries} (\option{noidx}) \emph{before} defining
any \idxpl{entry} that cross-reference other \idxpl{entry}. If any
of the \idxpl{entry} that you have cross-referenced don't appear
in the \idx{glossary}, check that you have put
\gls{makeglossaries}\slash\gls{makenoidxglossaries} before all entry
definitions. The \sty{glossaries-extra} package provides better
cross-reference handling.
\end{important}

There are several ways of cross-referencing \idx{entry} in the 
\idxpl{glossary}: 

\begin{enumerate}
\item\label{itm.descsee} You can use commands such as \gls{gls} in the
entries description. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},
\gloskeyval{description}{firm, round fruit. See also \gls{gls}\marg{pear}}}
\end{codebox}
Note that with this method, if you don't use the cross-referenced term 
in the main part of the document, you will need two runs of
\app{makeglossaries}:
\begin{terminal}
pdflatex filename
makeglossaries filename
pdflatex filename
makeglossaries filename
pdflatex filename
\end{terminal}
This is because the \gls{gls} in the description won't be detected
until the \idx{glossary} has been created (unless the description is used
elsewhere in the document with \gls{glsentrydesc}). Take care not to
use \gls{glsdesc} (or \gls{Glsdesc}) in this case as it will cause a
nested link.

\item\label{itm.glssee} After you have defined the entry, use
\cmddef{glssee}
where \meta{xr-list} is a comma-separated list of \idx{entry}
labels to be cross-referenced, \meta{entry-label} is the label of the
\idx{entry} doing the cross-referencing and \meta{tag} is the \qt{see} tag.
(The default value of \meta{tag} is \gls{seename}.)

This command is essentially performing:
\begin{compactcodebox}
\gls{glsadd}\oarg{\glsoptval{format}{\meta{cross-ref-encap}}}\margm{entry-label}
\end{compactcodebox}
where \meta{cross-ref-encap} is a special form of \idx{locationencap}
that includes \meta{tag} and \meta{xr-list}. Remember from
\sectionref{sec:glsadd} that \app{makeindex} always requires a
\location. This special \idx{locationencap} discards the provided
location (which \gls{glssee} sets to \qt{Z} to push the
cross-reference to the end of the \idx{numberlist}) and replaces it
with the cross-reference in the form \qt{\emph{see} \meta{name(s)}}.

This means that \gls{glssee} indexes \meta{entry-label} so that
\meta{entry-label} appears in the \idx{glossary} but it doesn't
\idxc{indexing}{index} any of the entries listed in \meta{xr-list}.

For example:
\begin{codebox}
\gls{glssee}\oarg{see also}\marg{series}\marg{FourierSeries,TaylorsTheorem}
\end{codebox}
This \idxc{indexing}{indexes} the entry identified by the label
\qt{series} and adds a \location\ to the \qt{series} \idx{numberlist} 
that looks something like:
\begin{compactcodebox}
\emph{see also} \gls{glsentryname}\marg{FourierSeries} \gls{cs.amp}
\gls{glsentryname}\marg{TaylorsTheorem}
\end{compactcodebox}
(The actual format is performed with \gls{glsseeformat}.)

\item\label{itm.seekey} As described in \sectionref{sec:newglosentry}, you can use the
\gloskey{see} key when you define the entry. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{MaclaurinSeries}\marg{\gloskeyval{name}{Maclaurin series},
\gloskeyval{description}{Series expansion},
\gloskeyval{see}{TaylorsTheorem}}
\end{codebox}
This key was provided as a simple shortcut that does:
\begin{codebox}
\gls{newglossaryentry}\marg{MaclaurinSeries}\marg{\gloskeyval{name}{Maclaurin series},
\gloskeyval{description}{Series expansion}}
\gls{glssee}\marg{MaclaurinSeries}\marg{TaylorsTheorem}
\end{codebox}
This means that \qt{MaclaurinSeries} will automatically be added to
the \idx{glossary} with something like
\begin{compactcodebox}
\gls{emph}\marg{see} \gls{glsentryname}\marg{TaylorsTheorem}
\end{compactcodebox}
in its \idx{numberlist}, but \qt{TaylorsTheorem} will need to be
\indexed\ elsewhere to ensure that it also appears in the
\idx{glossary} otherwise, it would end up with the preamble
\location\ (page~1) in its \idx{numberlist}, assuming that the
\idx{entry} was defined in the \idx{documentpreamble}.

You therefore need to ensure that you use the
cross-referenced term with the commands described in
\sectionref{sec:glslink} or \sectionref{sec:glsadd}.

The \qt{see} tag is produce using \gls{seename}, but can be
overridden in specific instances using square brackets
at the start of the \gloskey{see} value. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{MaclaurinSeries}\marg{\gloskeyval{name}{Maclaurin series},
\gloskeyval{description}{Series expansion},
\gloskey{see}=\oarg{see also}\marg{TaylorsTheorem}}
\end{codebox}
Take care if you want to use the optional argument of commands such
as \gls{newacronym} or \gls{newterm} as the value will need to be
grouped. For example:
\begin{codebox}
\gls{newterm}\marg{seal}
\gls{newterm}\oarg{\gloskeyval{see}{\oarg{see also}seal}}\marg{sea lion}
\end{codebox}
Similarly if the value contains a list. For example:
\begin{codebox}
\gls{glossaryentry}\marg{lemon}
\marg{
  \gloskeyval{name}{lemon},
  \gloskeyval{description}{Yellow citrus fruit}
}
\gls{glossaryentry}\marg{lime}
\marg{
  \gloskeyval{name}{lime},
  \gloskeyval{description}{Green citrus fruit}
}
\gls{glossaryentry}\marg{citrus}
\marg{
  \gloskeyval{name}{citrus},
  \gloskeyval{description}{Plant in the Rutaceae family},
  \gloskeyval{see}{lemon,lime}
}
\end{codebox}
\end{enumerate}

In both cases~\ref{itm.glssee} and \ref{itm.seekey} above, the
cross-referenced information appears in the \idx{numberlist},
whereas in case~\ref{itm.descsee}, the cross-referenced information
appears in the description. (See the \samplefile{-crossref} example
file that comes with this package.) This means that in
cases~\ref{itm.glssee} and~\ref{itm.seekey}, the cross-referencing
information won't appear if you have suppressed the
\idx{numberlist}. In this case, you will need to activate the
\idx{numberlist} for the given entries using
\gloskey{nonumberlist}{false}. Alternatively, if you just use the
\gloskey{see} key instead of \gls{glssee}, you can automatically
activate the \idx{numberlist} using the \opt{seeautonumberlist}
package option.

\begin{bib2gls}
\app{bib2gls} provides much better support for cross-references,
including the ability to only show the cross-reference in the
\idx{locationlist} (\resourceoptvalm{save-locations}{see}) without
the actual \locations.  See, for example, 
\gallery{index.php?label=bib2gls-xr}{Gallery: Cross-References (bib2gls)}.
\end{bib2gls}

\section{Customising Cross-Reference Text}
\label{sec:customxr}

When you use either the \gloskey{see} key or the
\gls{glssee} command, the cross-referencing information will be typeset in the 
\idx{glossary} (within the \idx{numberlist}) according to:
\cmddef{glsseeformat}
The default definition:
\begin{compactcodebox}
\cmd{emph}\margm{tag} \gls{glsseelist}\margm{xr-list}
\end{compactcodebox}
Note that the \meta{location} argument is always ignored.
(\app{makeindex} will always assign a \location\ number, even if it's not needed, so it
needs to be discarded.) For example, if you want the tag to appear
in bold, you can do:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeformat}}[3][\gls{seename}]\marg{\cmd{textbf}\marg{\#1} 
 \gls{glsseelist}\marg{\#2}}
\end{codebox}

The list of labels is formatted by: 
\cmddef{glsseelist}
This iterates through the comma-separated list of \idx{entry} labels
\meta{label-list} and formats each entry in the list. The \idxpl{entry}
are separated by:
\cmddef{glsseesep}
between all but the last pair, and
\cmddef{glsseelastsep}
between the last pair.

Each entry item in the list is formatted with:
\cmddef{glsseeitem}
This does: 
\begin{compactcodebox}
\gls{glshyperlink}\oarg{\gls{glsseeitemformat}\marg{\#1}}\marg{\#1}
\end{compactcodebox}
which creates a \idx{hyperlink}, if enabled, to the cross-referenced
entry. The \idx{hyperlink} text is given by:
\cmddef{glsseeitemformat}
This does:
\begin{compactcodebox}
\gls{ifglshasshort}\margm{entry-label}
 \marg{\gls{glsentrytext}\margm{entry-label}}\comment{acronym}
 \marg{\gls{glsentryname}\margm{entry-label}}\comment{non-acronym}
\end{compactcodebox}
which uses the \gloskey{text} field for \idxpl{acronym} and the
\gloskey{name} field otherwise.

\begin{information}
When \gls{glssee} was first introduced in v1.17, the cross-referenced entry was
displayed with just \gls{glsentryname}, but this caused problems because
back then the \gloskey{name} field had to be sanitized because it was
written to the \idx{glossaryfile}, which caused strange results if
the \gloskey{name} contained any commands. So in v3.0, the default
definition was switched to using \gls{glsentrytext} to avoid the
issue. In v3.08a, the information written to the \idx{glossaryfile}
was changed and the \gloskey{name} was no longer sanitized, but the
new definition was retained for backward-compatibility.

However, the original definition is more appropriate in some ways,
as it makes more sense for the cross-reference to show the name as
it appears in the \idx{glossary}, except for \idxpl{acronym} which
could have wide names if the long form is included. So in v4.50,
which had major compatibility-breaking changes to remove the
unconditional dependency on the now deprecated \sty{textcase}
package, the original use of \gloskey{name} was restored for
non-\idxpl{acronym}, which brings it into line with
\sty{glossaries-extra}.
\end{information}

For example, to make the cross-referenced list use small caps with
the \gloskey{text} (not \gloskey{name}) field:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsseeitemformat}}[1]\marg{\comment{}
  \gls{textsc}\marg{\gls{glsentrytext}\marg{\#1}}}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package redefines \gls{glsseeitemformat}
to use \gls{glsfmttext} for \idxpl{abbreviation} and
\gls{glsfmtname} otherwise.  Additionally, it provides
\gls{glsxtrhiername} which can be used as an alternative for
\hierarchical\ entries. See the \sty{glossaries-extra} manual for
further details.
\end{xtr}

\begin{important}
You can use \gls{glsseeformat} and \gls{glsseelist} in the main body
of the text, but they won't automatically add the cross-referenced
entries to the \idx{glossary}. If you want them added with that location,
you can do:
\begin{codebox}
Some information (see also 
\gls{glsseelist}\marg{FourierSeries,TaylorsTheorem}\comment{}
\gls{glsadd}\marg{FourierSeries}\gls{glsadd}\marg{TaylorsTheorem}).
\end{codebox}
\end{important}

\chapter{Number Lists}
\label{sec:numberlists}

Each \idx{entry} in the \idx{glossary} has an associated
\idx+{numberlist} (or \idx+{locationlist}).  By default, these
numbers (the \idxpl+{entrylocation}) refer to the pages on which
that \idx{entry} has been \indexed\ (using any of the commands
described in \sectionref{sec:glslink} and \sectionref{sec:glsadd})
and will also include any cross-references obtained with \gls{glssee}
(or the \gloskey{see} key).

The \locations\ in the \idx{numberlist} are separated with:
\cmddef{delimN}

The \idx{numberlist} can be suppressed using the
\opt{nonumberlist} package option, or an alternative counter can
be set as the default using the \opt{counter} package option.
The \sty{glossaries-extra} package additionally provides the
\opt{equations} and \opt{floats} options that can be used to
automatically switch the \idx{locationcounter} in certain
environments.

\begin{bib2gls}
With \app{bib2gls} you can prevent the \idx{numberlist} from being
created with the \resourceoptval{save-locations}{false} resource
option, or only include the cross-references with the
\resourceoptval{save-locations}{see} option.
\end{bib2gls}

\Idxpl{numberlist} are more common with indexes rather than
\idxpl{glossary} (although you can use the \sty{glossaries} package for
indexes as well). However, \options{mkidx,xdy} makes use of
\app{makeindex} or \app{xindy} to hierarchically sort and collate
the \idxpl{entry}. These applications are readily available with most
modern \TeX\ distributions, but because they are both designed as
\idxpl{indexingapp} they both require that terms either have a valid
\location\ or a cross-reference. 

\begin{important}
Even if you use \opt{nonumberlist}, the \locations\ must still be
provided and acceptable to the \idx{indexingapp} or they will cause
an error during the \idx{indexing} stage, which will interrupt the
document build.  \Idxpl{emptylocation} are not permitted with
\options{mkidx,xdy}. See \sectionref{sec:problemlocations}.
\end{important}

If you're not interested in the \locations, each
\idx{entry} only needs to be indexed once, so consider using
\opt{indexonlyfirst}, which can improve the document build time by
only \idx{indexing} the \idx{firstuse} of each term.

The \gls{glsaddall} command (see \sectionref{sec:glsadd}), which is used to
automatically \idxc{indexing}{index} all \idxpl{entry}, iterates over 
all defined \idxpl{entry} (in non-\idxpl{ignoredglossary})
and does \code{\gls{glsadd}\margm{entry-label}} for each 
\idx{entry} (where \meta{entry-label} is that \idx{entry}['s] label). 
This means that \gls{glsaddall} automatically
adds the same \location\ to every entry's \idx{numberlist}, which
looks weird if the \idx{numberlist} hasn't been suppressed.

With \option{b2g}, the \idx{indexing} is performed by \app{bib2gls}, which was
specifically designed for the \sty{glossaries-extra} package. 
So it will allow \idxc{emptylocation}{empty} or unusual locations.
(As from \app{bib2gls} v3.0, \idxpl{emptylocation} will be converted
to \idxpl{ignoredlocation}.)
Additionally, the \resourceoptval{selection}{all} resource option
option will select all \idxpl{entry} without adding an unwanted 
\location\ to the \idx{numberlist}. If \app{bib2gls} can deduce a numerical value for
a \location, it will attempt to form a \idx{range} over consecutive
\locations, otherwise it won't try to form a \idx{range} and the
\location\ will just form an individual item in the list.

\option{noidx} also allows any \location\ but it doesn't form
\idxpl{range}. Any \idxpl{emptylocation} or location with the
\encap{glsignore} format will result in an \idx{invisiblelocation} in the
\idx{numberlist}.

\section{Encap Values (Location Formats)}
\label{sec:encap}

The \idxc+{locationencap}{location encap or format} is the
encapsulating command used to format an \idx+{entrylocation}.
That is, it's a command that takes an argument that will be the
\location.

\begin{information}
If you aren't using \sty{hyperref} then you can use the control
sequence name of any text-block command that takes a single
argument. For example, \glsoptval{format}{\encap{emph}}. 
If you require \idxpl+{hyperlink} then it's more complicated.
\end{information}

The \qt{\idx{encap}} usually refers to the control sequence \emph{name} without
the leading backslash (such as \encap{textbf}) and is essentially
the same as the \app{makeindex} \idx{encap} value that can be provided within
the standard \gls{index} command.

\begin{warning}
Be careful not to use a declaration (such as
\gls{bfseries}) instead of a text-block command (such as
\gls{textbf}) as the effect is not guaranteed to be localised,
either within the \idx{numberlist} or throughout the \idx{glossary}.
\end{warning}

There is a special format:
\cmddef{glsignore}
which simply ignores its argument. With \options{noidx,mkidx,xdy} this
creates an \idxc{emptylocation}{empty (invisible) location} which can lead
to spurious commas or en-dashes if the \idx{numberlist} contains
other \locations.  However, with \app{bib2gls}, this format
identifies the \location\ as a special \idx{ignoredlocation} which
won't be added to the \idx{locationlist} but will influence
selection.

If you want to apply more than one style to a given \location\ (for example,
\textbf{bold} and \emph{italic}) you will need to create a command
that applies both formats. For example: 
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{textbfem}}[1]\marg{\gls{textbf}\marg{\gls{emph}\marg{\#1}}}
\end{codebox}
and use that command.

In this document, \idxn{standardformat} refer to the standard text
block commands such as \gls{textbf} or \gls{emph} or any of the
commands listed in \tableref{tab:hyperxx}.

\begin{important}
If you use \app{xindy} instead of \app{makeindex}, you
must use \gls{GlsAddXdyAttribute} to identify any 
non-\idxpl{standardformat} 
that you want to use with the \glsopt{format} key. So if you use
\app{xindy} with the above example \csfmt{textbfem}, you would need to add:
\begin{codebox}
\gls{GlsAddXdyAttribute}\marg{textbfem}
\end{codebox}
See \sectionref{sec:xindy} for further details.
\end{important}

If you are using \idxpl+{hyperlink} and you want to change the font
of the hyperlinked \location\, don't use \gls{hyperpage} (provided
by the \sty{hyperref} package) as the \locations\ may not refer to a
page number and the location argument may contain the range delimiter \gls{delimR}.
Instead, the \sty{glossaries} package provides
\idx{hyperlink}-supported \idxpl{encap} listed in
\tableref{tab:hyperxx}. These commands all use \gls{glshypernumber}
(described below) and so shouldn't be used in other contexts.

The \csmetafmt{hyper}{xx}{} can also be used without \sty{hyperref}, since
\gls{glshypernumber} will simply do its argument if \gls{hyperlink}
hasn't been defined. In which case, only the font change will be
applied.

\begin{table}[htbp]
\caption{Predefined Hyperlinked Location Formats}
\label{tab:hyperxx}
\centering
\begin{tabular}{ll}
\inlineencapdef{hyperrm} & serif (\gls{textrm}) \idx{hyperlink}\\
\inlineencapdef{hypersf} & sans-serif (\gls{textsf}) \idx{hyperlink}\\
\inlineencapdef{hypertt} & monospaced (\gls{texttt}) \idx{hyperlink}\\
\inlineencapdef{hyperbf} & bold (\gls{textbf}) \idx{hyperlink}\\
\inlineencapdef{hypermd} & medium weight (\gls{textmd}) \idx{hyperlink}\\
\inlineencapdef{hyperit} & italic (\gls{textit}) \idx{hyperlink}\\
\inlineencapdef{hypersl} & slanted (\gls{textsl}) \idx{hyperlink}\\
\inlineencapdef{hyperup} & upright (\gls{textup}) \idx{hyperlink}\\
\inlineencapdef{hypersc} & small caps (\gls{textsc}) \idx{hyperlink}\\
\inlineencapdef{hyperemph} & emphasized (\gls{emph}) \idx{hyperlink}
\end{tabular}
\par
\end{table}

If you want to make a new \idx{locationformat} that supports
\idxpl{hyperlink}, you
will need to define a command which takes one argument and use that
with the location encapsulated with \gls{glshypernumber} or the
appropriate \csmetafmt{hyper}{xx}{} command.
For example, if you want the \location\ number to be in a bold
sans-serif font, you can define a command called, say,
\csfmt{hyperbsf}:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{hyperbsf}}[1]\marg{\gls{textbf}\marg{\gls{hypersf}\marg{\#1}}}
\end{codebox}
and then use \optfmt{hyperbsf} as the value for the \glsopt{format} key.

\begin{important}
When defining a custom \idx{locationformat} command
that uses one of the \csmetafmt{hyper}{xx}{} commands, make sure
that the argument of \csmetafmt{hyper}{xx}{} is just the \location.
Any formatting must be outside of \csmetafmt{hyper}{xx}{} (as in the
above \csfmt{hyperbfsf} example).
\end{important}

Remember that if you use \app{xindy}, you
will need to add this to the list of location \idxpl{xindyattr}:
\begin{codebox*}
\gls{GlsAddXdyAttribute}\marg{hyperbsf}
\end{codebox*}

Complications can arise if you use different \idx{encap} values for the
same \location. For example, suppose on page~10 you have both the
default \encap{glsnumberformat} and \encap{hyperbf} \idxpl{encap}.  While it may
seem apparent that \encap{hyperbf} should override \encap{glsnumberformat}
in this situation, the \idx{indexingapp} may not know it.
This is therefore something you need to be careful about if you use the
\glsopt{format} key or if you use a command that implicitly sets it.

In the case of \app{xindy}, it only accepts one \idx{encap} (according to
the order of precedence given in the \app{xindy} module) and discards the
others for identical \locations\ (for the same \idx{entry}). This can cause
a problem if a discarded \location\ forms the start or end of a \idx{range}. 

In the case of \app{makeindex}, it accepts different \idxpl{encap} for the
same \location, but warns about it (\qt{\idxpl{multipleencap}}).  
This leads to a \idx{numberlist}
with the same \location\ repeated in different formats.  If you use
the \app{makeglossaries} Perl script with \option{mkidx} it will detect
\app{makeindex}['s] warning and attempt to fix the problem, ensuring
that the \encap{glsnumberformat} \idx{encap} always has the least precedence
unless it includes a \idx{range} identifier. Other conflicting
\idxpl{encap} will have the last one override earlier ones for the same 
\location\ with \idx{range} identifiers taking priority. If you
actually want the repeat, you can disable this feature with the
\mkglsopt{e} switch.

No discard occurs with \option{noidx} so again you get the same
\location\ repeated in different formats. With \option{b2g},
\app{bib2gls} will discard according to order of precedence, giving
priority to start and end \idxpl{range}.  (See the \app{bib2gls}
manual for further details.)

The default \location\ format is:
\cmddef{glsnumberformat}
This will simply do its argument \meta{location(s)} if
\sty{hyperref} hasn't been loaded, otherwise it will use:
\cmddef{glshypernumber}
This will create a \idx+{hyperlink} to the \location\ or will simply do
its argument if \sty{hyperref} hasn't been loaded. The
\meta{location(s)} argument may contain multiple \locations. If so,
they must be separated with \gls{delimR} or \gls{delimN}. (Usually
\gls{delimN} won't occur. The \gls{delimR} separator may occur with
\idxpl{range} and \app{makeindex}.) Any other markup is likely to cause a
problem (see \sectionref{sec:problemlocations}).

Each \location\ within \gls{glshypernumber} will have a
\idx{hyperlink} created with:
\begin{compactcodebox}
\gls+{hyperlink}\margm{anchor}\margm{text}
\end{compactcodebox}
where the \meta{text} is the location encapsulated with:
\cmddef{glswrglosslocationtextfmt}
This just does its argument by default.

The \meta{anchor} is constructed from the location but requires the
prefix and \idx{locationcounter}, which first have to be set with:
\cmddef{setentrycounter}
This command will be automatically inserted before the location in the
\idx{numberlist} by the appropriate \idx{indexing} method.
In the case of \app{makeindex}, this will be inserted at the start
of the \idx{encap} information, but with \app{xindy} the counter
will form part of the \idxc{xindyattr}{attribute} and a helper
command has to be provided that uses \gls{setentrycounter}. With
\option{noidx} the command occurs inside the definition of
\gls{glsnoidxdisplayloc}. 

The \meta{counter} will be stored in:
\cmddef{glsentrycounter}
and may be used in the hooks described below. Note that the prefix
can't be referenced as \gls{glswrglossdisableanchorcmds} is also
used when obtaining the prefix during \idx{indexing}.

The \meta{anchor} is then constructed as follows:
\begin{enumerate}
\item Use the \gls{glswrglossdisableanchorcmds} hook to disable problematic 
commands (scoped).
\item Expand (protected)
\begin{compactcodebox}
\meta{counter}\meta{prefix}\gls{glswrglosslocationtarget}\margm{location}
\end{compactcodebox}
\item Sanitize the result.
\end{enumerate}
For example:
\begin{compactcodebox}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\comment{page counter and empty prefix}
\gls{glshypernumber}\marg{1}
\end{compactcodebox}
will essentially do:
\begin{compactcodebox}
\gls{hyperlink}\marg{page.1}{1}
\end{compactcodebox}
whereas
\begin{compactcodebox}
\gls{setentrycounter}\oarg{1}\marg{\ctr{equation}}\comment{}
\gls{glshypernumber}\marg{2}
\end{compactcodebox}
will essentially do:
\begin{compactcodebox}
\gls{hyperlink}\marg{equation.1.2}{2}
\end{compactcodebox}

The initial hook to disable the problematic commands is:
\cmddef{glswrglossdisableanchorcmds}
By default, this is defined to:
\begin{compactcodebox}
\cmd{let}\gls+{glstexorpdfstring}\cmd{@secondoftwo}
\end{compactcodebox}
If \sty{hyperref} is loaded the definition will also include:
\begin{compactcodebox*}
\cmd{let}\gls{texorpdfstring}\cmd{@secondoftwo}
\gls{pdfstringdefPreHook}
\end{compactcodebox*}
The location is encapsulated with:
\cmddef{glswrglosslocationtarget}
This must expand but may be used to make adjustments. The default
definition is to simply expand to its argument. The 
\gls{glswrglossdisableanchorcmds} hook may be used to alter the
definition if some condition is required, but bear in mind that 
\gls{glswrglosslocationtarget} won't be used when the prefix is
obtained during \idx{indexing}.

Any leftover robust or protected commands will end up sanitized to
prevent an obscure error from occurring, but an invalid target name is
likely to result. See \sectionref{sec:problemlocations} for an
example.

The use of \gls{setentrycounter} to set the prefix and counter is 
necessary because the hypertarget can't be included in the
\idx{indexing} information supplied to \app{makeindex} or
\app{xindy}, because neither the \app{makeindex} nor \app{xindy}
syntax supports it. Unfortunately, not all definitions of
\gls{theHcounter} can be split into a prefix and location that can
be recombined in this way. This problem can occur, for example,
with \optval{counter}{\ctr{equation}} when it depends on the \ctr{chapter}
counter. This can result in warnings in the form:
\begin{transcript}
name\margm{target-name} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
The \samplefile{Eq} sample file deals with this issue by redefining
\theHcounter{equation} as follows:
\begin{codebox}
\cmd{renewcommand}*\theHcounter{equation}\marg{\theHcounter{chapter}.\gls{arabic}\marg{equation}}
\end{codebox}

\begin{bib2gls}
This issue is avoided with \app{bib2gls} and \optval{record}{nameref}
as that syntax allows the \idx{hyperlink} target to be supplied with the
\idx{indexing} information.
\end{bib2gls}

\section{Range Formations}
\label{sec:ranges}

There are two types of \inlineidxpdef{range}: explicit and implicit.
Neither are supported with \option{noidx}. Both are supported by
\options{mkidx,xdy,b2g}. Implicit ranges can be switched off using
the appropriate option for the required \idx{indexingapp}.
The start and end of a \idx{range} is separated with:
\cmddef{delimR}
\options{mkidx,xdy} can merge implicit and explicit \idxpl{range}
that overlap. With \option{b2g}, individual \locations\ can be
merged into an explicit range, but an individual location on either
side of the explicit range won't be merged into the explicit range.

As with \gls{index}, the characters \sym{startrange} and \sym{endrange} 
can be used at the start of the \glsopt{format} value to specify the
beginning and ending of a number \idx{range}. They must be in matching
pairs with the same \idx{encap}. For example,
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{emph}}}\marg{sample}
\end{codebox}
on one page to start the \idx{range} and later:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{emph}}}\marg{sample}
\end{codebox}
to close the \idx{range}. This will create an explicit \idx{range} in the
\idx{numberlist} that's encapsulated with \gls{emph}. If the default 
\encap{glsnumberformat} should be used, you can omit it and just
have the \sym{startrange} and \sym{endrange} characters.

\begin{xtr}
Explicit ranges can also be created using \gls{glsstartrange}
and \gls{glsendrange} with \sty{glossaries-extra}.
\end{xtr}


Implicit \idxpl{range} are formed by concatenating a sequence of
three or more consecutive \locations. For example, if an \idx{entry}
is \indexed\ on pages~3, 4, 5, and 6, this will be compacted into
\qt{3--6}.

With \option{xdy}, you can vary the minimum sequence length using
\gls{GlsSetXdyMinRangeLength}
where the argument is either the minimum number or the keyword
\optfmt{none}, which indicates that no implicit \idxpl{range} should be
formed. See \sectionref{sec:xindyloc} for further details.

\begin{xtr}
With \option{b2g}, the minimum number for form implicit \idxpl{range}
is given by the \resourceopt{min-loc-range} resource option.
Again, the value is either the minimum number or the keyword
\optfmt{none}, which indicates that no implicit \idxpl{range} should be
formed. It's also possible to compact a ragged sequence into a range
with \resourceopt{max-loc-diff}. For example, with
\resourceoptval{max-loc-diff}{2}, the sequence \qt{2, 4, 5, 6, 8}
can be compressed into the range \qt{2--8}. Another \idx{range}-related option is
\resourceopt{compact-ranges} which allows \idxpl{range} to be more
compact by omitting matching initial digits at the end of the
\idx{range}. For example, \qt{184--189} can be compacted into \qt{184--9}.
\end{xtr}

With both \app{makeindex} and \app{xindy} (\options{mkidx,xdy}), you can replace
the separator and the closing number at the end of the range using:
\cmddef{glsSetSuffixF}
to set the suffix for two consecutive \locations\ and
\cmddef{glsSetSuffixFF}
to set the suffix for three or more consecutive \locations.
\option{b2g} provides a similar feature with the
\resourceopt{suffixF} and \resourceopt{suffixFF} resource options.

For example:
\begin{codebox}
\gls{glsSetSuffixF}\marg{f.}
\gls{glsSetSuffixFF}\marg{ff.}
\end{codebox}
Note that if you use \app{xindy} (\option{xdy}), you will also need to
set the minimum range length to 1 if you want to change these
suffixes:
\begin{codebox}
\gls{GlsSetXdyMinRangeLength}\marg{1}
\end{codebox}
If you use the \sty{hyperref} package, you will need
to use \gls{nohyperpage} in the suffix to ensure that the 
\idxpl+{hyperlink} work correctly. For example:
\begin{codebox}
\gls{glsSetSuffixF}\marg{\gls{nohyperpage}\marg{f.}}
\gls{glsSetSuffixFF}\marg{\gls{nohyperpage}\marg{ff.}}
\end{codebox}

\begin{important}
Note that \gls{glsSetSuffixF} and \gls{glsSetSuffixFF} must be used 
before \gls{makeglossaries} and have no effect if \gls{noist} is 
used.
\end{important}

\section{Locations}
\label{sec:locationsyntax}

Each \idxc+{entrylocation}{location} in an \idx{entry}['s] \idx{numberlist} is the
result of \idx{indexing} the \idx{entry} at the point
in the document that corresponds to the location (typically where a
command such as \gls{gls} occurred). By default, this
is the page number, but can be changed with the \opt{counter}
package option, the \meta{counter} optional argument in
\gls{newglossary}, the \gloskey{counter} key in
\gls{newglossaryentry} or the \glsopt{counter} option in the
\gls{glslike} and \gls{glstextlike} commands (or in \gls{glsadd}).

The syntax of the \location\ must be valid for the given
\idx{indexingapp} if you use \optionsor{mkidx,xdy}. In the case of
\app{makeindex}, the syntax is quite restricted. The \location\ may
be a digit (\gls{arabic}), upper or lowercase Roman numerals
(\gls{Roman} or \gls{roman}) or upper or lowercase \idx{ascii}
letters (\gls{Alph} or \gls{alph}). The syntax also allows 
\idxpl{compositelocation} formed by combining the allowed digits, numerals and
letters with a \idx{compositor} (which can be identified with
\gls{glsSetCompositor}).

The following \locations\ are valid, assuming the default
\idx{fullstop} compositor:
\begin{itemize}
\item \qt{325}: a numeric location (\gls{arabic});
\item \qt{IV}: a Roman numeral location (\gls{Roman});
\item \qt{B}: an alphabetic location (\gls{Alph});
\item \qt{12.3.4}: a \idx{compositelocation}.
\end{itemize}
The following are invalid:
\begin{itemize}
\item \qt{I-3.2}: mixed \idxpl{compositor} not permitted;
\item \qt{X7}: a separator must be used in \idxpl{compositelocation};
\item \qt{\O}: letters must be \idx{ascii};
\item \qt{\code{\gls{textsc}\marg{iv}}}: commands not permitted in
locations;
\item \qt{}: locations can't be \idxc{emptylocation}{empty}.
\end{itemize}

\begin{warning}
Invalid \locations\ will be rejected by \app{makeindex}, which will
result in the entry being dropped from the \idx{glossary} if it has
no valid \locations.
\end{warning}

In the case of \app{xindy}, the \location\ syntax must be declared
in the \ext+{xdy} style file. This covers both the way that the 
location appears in the \idx{indexingfile} as a result of protected
expansion but also the \idxc{locationcounter}{counter} used to obtain the
\location, and is described in more detail in
\sectionref{sec:xindyloc}. The standard digit (\gls{arabic}), upper
or lowercase Roman numerals (\gls{Roman} or \gls{roman}) or upper or
lowercase \idx{ascii} letters (\gls{Alph} or \gls{alph}) are
automatically added for the \ctr{page} counter.

If a \location\ doesn't match any declared syntax, a warning will
be written to \app{xindy}['s] transcript file (\ext{glg}):
\begin{transcript}
WARNING: location-reference "\margm{prefix}\margm{location}" did not match any location-class! (ignored)
\end{transcript}
As with \app{makeindex} when it encounters an invalid \location,
\app{xindy} will drop that \location, which will result in the entry
being dropped from the \idx{glossary} if it has no valid \locations.

Additional problems can occur with \app{xindy} if any of
\app{xindy}['s] special characters occur in the \location. This
includes the backslash \sym{bksl} character, which is particularly
problematic if any robust or protected commands are written in the location
as \csmetafmt{}{csname}{} will have to be written to the file as
\code{\gls{cs.bsl}\meta{csname}}. This is quite difficult to do without
prematurely expanding \gls{thepage}.

If \opt{esclocations}{true}, an attempt will be made to hack commands
like \gls{@arabic} and \gls{@roman} to enable this, but, like all
hacks, this is problematic and liable to break in awkward
situations or with future releases of the \LaTeX\ kernel or other
packages. This setting is now off by default and it's better to use
the hooks below to ensure that the content written to the file is valid.

\begin{warning}
Any commands that end up in the \location\ can interfere with 
\gls{glsdohypertarget} when it tries to create \idxpl{hyperlink}.
\end{warning}

The following hook is used during the protected write:
\cmddef{glswrglossdisablelocationcmds}
This does nothing by default but may be used to disable problematic
commands that could lead to an invalid location. Note that this
can lead to unexpected results in the \idx{numberlist}, but you may
be able to correct this with a custom \idx{encap} or (if
\gls{glshypernumber} creates a \idx{hyperlink}) a custom
definition of \gls{glswrglosslocationtextfmt}. See
\sectionref{sec:problemlocations} for an example.

\begin{important}
The \gls{glswrglossdisablelocationcmds} hook occurs after
\gls{protected@write} sets \gls{thepage} to \gls{relax}.
By the time \gls{thepage} actually gets expanded when it's written
to the \idx{indexingfile}, any changes made within the hook will be
lost.
\end{important}

Both \options{noidx,b2g} write the \idx{indexing} information in the
\ext{aux} file and will accept any \location\ syntax (that's valid
in a \LaTeX\ document). In the case of \option{b2g}, \app{bib2gls}
will try parsing the \location\ and if it fits a common pattern that
allows it to obtain a numeric value, then it will be able to form an
implicit \idx{range} (if required), otherwise it will accept the
\location\ but not form any implicit \idxpl{range}.

With \optionsto{noidx}{b2g} (except with \optval{record}{nameref})
the location anchor isn't included in the \idx{indexing}
information. If a \idx{hyperlink} is required for the location, the
target (anchor name) has to be constructed from the location. The
\sty{hyperref} package provides \gls{hyperpage} for normal indexes
(with \gls{index}), but this forms the anchor from
\code{page.\meta{location}} which isn't suitable with
\sty{glossaries} as the \idx{locationcounter} may not be the default
\ctr{page}. Therefore the counter is saved within the \idx{encap}. A
prefix is also necessary if \gls{theHcounter} is defined and
isn't equivalent to \gls{thecounter}. 

The assumption here is that \gls{theHcounter} expands to the
equivalent of \code{\meta{prefix}\gls{thecounter}}.
If \gls{theHcounter} and \gls{thecounter} are equivalent then
\meta{prefix} will be empty.

The prefix is found as follows:
\begin{enumerate}
\item Use the \gls{glswrglossdisableanchorcmds} hook to disable problematic 
commands (scoped).

\item Perform a protected expansion on \gls{theHcounter} (\meta{Hloc}) and
\gls{thecounter} (\meta{loc}). If \meta{Hloc} ends with \meta{loc},
so that \meta{Hloc} is \meta{prefix}\meta{loc},
then the prefix is the \meta{prefix} substring.

In this step, \gls{thepage} may be incorrect, due to \TeX's
asynchronous output routine, but it will be incorrect in both
\meta{Hloc} and \meta{loc} and shouldn't occur in the prefix
(unless you have an unusual numbering system that's reset on every
page, in which case you may have other problems), so it shouldn't affect
the prefix formation. When the actual write operation occurs,
\gls{thepage} should then expand correctly.
\end{enumerate}

Unfortunately, not all definitions of \gls{theHcounter} will expand
in the form \code{\meta{prefix}\gls{thecounter}}. In which case a
warning will occur:
\begin{transcript}
Hyper target `\meta{Hloc}' can't be formed by prefixing
location `\meta{loc}'. You need to modify the definition of \gls{theHcounter}
otherwise you will get the warning: "`name\marg{\meta{counter}.\meta{loc}}' has been
referenced but does not exist"
\end{transcript}
If you need the \location\ hyperlink, you will either have to
redefine \gls{theHcounter} or switch to \option{b2g} and
\optval{record}{nameref}.

\section{Page Precedence}
\label{sec:pageprecedence}

The \inlineidxdef{pageprecedence} indicates the \location\ ordering within the
\idx{numberlist} based on the \location\ syntax. For example, if an
\idx{entry} has been \indexed\ on pages~5, 7, i and ii, then the
\idx{numberlist} will be \qt{i, ii, 5, 7} with the default order of
precedence.

With \app{makeindex}, the default precedence is \code{rnaRA}, which
indicates: \idx{lowercase} Roman
(\gls{roman}), numeric (\gls{arabic}), \idx{lowercase} alphabetic
(\gls{alph}), \idx{uppercase} Roman (\gls{Roman}), and
\idx{uppercase} alphabetic (\gls{Alph}). This order can be changed
by adding the \code{page\_precedence} parameter to the \ext+{ist}
file. There's no specific command provided for this, so you will
need to use the \gls{GlsSetWriteIstHook} to add this. For example:
\begin{codebox}
\gls{GlsSetWriteIstHook}\marg{\comment{}
 \gls{write}\gls{glswrite}\marg{page\_precedence "arnAR"}\comment{}
}
\end{codebox}

With \app{xindy}, the precedence is given by the order the
location classes are listed in \code{define-location-class-order} 
within the \ext+{xdy} style file. This order can either be changed
in a custom \ext{xdy} file or can be set with
\gls{GlsSetXdyLocationClassOrder}.

Since neither \options{noidx,b2g} recognise specific location
classes, they have no concept of \idx{pageprecedence}. They will
both create \idxpl{locationlist} that are in the same order as the
\locations\ were \indexed, which means they will match the order
those locations occur in the document. However, with \app{bib2gls},
it's possible to gather the \locations\ into sub-groups according to
the associated \idxc{locationcounter}{counter} or split off
\locations\ with identified primary formats. See the \app{bib2gls}
manual for further details.

\section{Problematic Locations}
\label{sec:problemlocations}

The default \idx{locationcounter} is the \ctr{page} counter, the
value of which is obtained with \gls{thepage}. Due to \TeX's
asynchronous output routine, \gls{thepage} may be incorrect at the
start of a new page. To ensure that the page number is correct, a
delayed write is needed, which is what is usually done when writing
information to the \ext+{aux} and \ext{toc} files (and to
\idxpl{indexingfile}).

This works fine with \options{noidx,b2g} since neither of those
options have any restrictions on the location syntax (provided that
it's valid \LaTeX\ code). With \app{bib2gls}, if it can't work out a
numeric value for the location then it simply won't be able to form
a \idx{range}. Additionally, \app{bib2gls} v3.0+, converts an
\idx{emptylocation} into an \idx{ignoredlocation}, which means the
\idx{entry} will still be selected so that it can be included in the
\idx{glossary}, but it won't cause a spurious comma or en-dash as
there won't be an invisible location in the \idx{numberlist}.

The only problematic \locations\ with \options{noidx,b2g} are where
\idxpl+{hyperlink} are required but the target name can't be formed
from the prefix, counter and location information (see
\sectionref{sec:locationsyntax}). The best solution with
\app{bib2gls} in this case is to use \optval{record}{nameref}, which
saves the actual target name in the \idx{indexing} record.
With \option{noidx} you will have to redefine \gls{theHcounter} as
appropriate.

With \options{mkidx,xdy}, the \location\ must expand to content that
is compatible with the \idx{indexingapp}['s] syntax. The syntax for
\app{makeindex} is quite restrictive and is described in 
\sectionref{sec:locationsyntax}.

For example, \thecounter{part} is normally formatted as an
\idx{uppercase} Roman numeral. There's no Roman numeral for 0 so if
the \ctr{part} counter is 0 (that is, before the first \gls{part})
then \thecounter{part} will expand to nothing.
This can be demonstrated in the following document:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{counter}{\ctr{part}}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{}}
\cbeg{document}
\gls{gls}\marg{sample}\comment{part = 0}
\gls{part}\marg{Sample Part}
\gls{section}\marg{Sample Section}
\gls{gls}\marg{sample}.
\gls{printglossaries}
\cend{document}
\end{codebox}
In the above, the first instance of \code{\gls{gls}\marg{sample}}
will have an \idx{emptylocation}. This will cause \app{makeindex} to
reject the \location\ with the following message in the transcript
(assuming the document file is called \filefmt{myDoc.tex}):
\begin{transcript}
!! Input index error (file = myDoc.glo, line = 1):
   -- Illegal page number  or page\_precedence rnaRA.
\end{transcript}
If \app{makeglossaries} encounters this warning, it will replace the
\idx{emptylocation} with \qt{0} and change the \idx{locationencap} to
\encap{glsignore}. In the above example, this will lead to an
\idx{invisiblelocation} in the \idx{numberlist}, but that's exactly
what an \idx{emptylocation} would do if \app{makeindex} allowed it.

Similarly, if the \idx{pagecompositor} hasn't been correctly identified,
then it can also result in an invalid \location. For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{counter}{\ctr{section}}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{}}
\comment{default compositor is '.' not '-'}
\cmd{renewcommand}\marg{\thecounter{section}}\marg{\thecounter{part}-\gls{arabic}\marg{\ctr{section}}}
\cbeg{document}
\gls{part}\marg{Sample Part}
\gls{section}\marg{Sample Section}
\gls{gls}\marg{sample}.
\gls{printglossaries}
\cend{document}
\end{codebox}
This will cause \app{makeindex} to reject the \location\ with the 
following message in the transcript:
\begin{transcript}
!! Input index error (file = myDoc.glo, line = 1):
   -- Illegal Roman number: position 2 in I-1.
\end{transcript}
If \app{makeglossaries} encounters this warning, it will replace any
invalid content (the hyphen, in this case) with the \idx{pagecompositor}
specified in the \ext+{ist} file.

In both of the above examples, using \app{makeglossaries} will help
the document build to complete without the \idxpl{entry}
disappearing from the \idx{glossary}, however the resulting
\idx{numberlist} may look strange. If you are using
\opt{nonumberlist} then this isn't a problem.

If you don't use \app{makeglossaries} but explicitly call
\app{makeindex} then you won't have those corrections, and some or
all of your \idxpl{entry} may be omitted from the \idx{glossary}.
In which case, you will have to adjust the \location\ so that it fits
\app{makeindex}['s] syntax \emph{even if you have
\opt{nonumberlist}}. In the case of the invalid \idx{pagecompositor}
problem, you can simply use \gls{glsSetCompositor} to set the
correct compositor. In the case of \idxpl{emptylocation} you will
need to chose a different \idx{locationcounter}.

Other problems occur with commands that don't fully expand, which results
in \LaTeX\ markup in the \location\ in the \idx{indexingfile}.
For example, if \sty{babel} is used with \optfmt{spanish},
\idx{lowercase} Roman numerals (which may occur in the front matter)
will expand to the internal command \gls{es@scroman}, as in the
following:
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\cbeg{document}
\gls+{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}\comment{problem location}
\gls+{mainmatter}
\gls{chapter}\marg{Sample}
\gls{gls}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
The first instance of \gls{gls} occurs in the front matter on
page~i, which in this case is formatted in faked \idx{smallcaps} with
\gls{es@scroman}. This can be found in the \ext+{glo} file, which
contains:
\begin{codebox}
\cmd{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{page}\sym{dblquote}\gls{glsnumberformat}}\marg{\gls{es@scroman} \marg{i}}
\cmd{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{\ctr{page}}\sym{dblquote}\gls{glsnumberformat}}\marg{1}
\end{codebox}
Each line in the \ext+{glo} file corresponds to a single
\idx{indexing} instance (created with \gls{gls} in this case).

The double-quote (\sym{dblquote}) is \app{makeindex}['s] escape
character (which can be changed with \gls{GlsSetQuote}). It's not
necessary in the above but was added as a by-product of the internal
escaping of special characters (the backslash isn't a special
character for \app{makeindex}, except in the \ext{ist} file, 
but is for \app{xindy}).

The \idx{indexing} data is contained in the arguments of:
\cmddef{glossaryentry}
This isn't a defined command but is simply used as a keyword 
in the \idx{indexingfile}. By default, \app{makeindex} expects
\gls{indexentry}. The custom \ext+{ist} style file created by
\gls{makeglossaries} identifies \gls{glossaryentry} as the keyword:
\begin{compactcodebox}
keyword "\string\\glossaryentry"
\end{compactcodebox}

The syntax for the second argument \meta{location} is as described
in \sectionref{sec:locationsyntax}.
The syntax for the first argument \meta{data} is in the form:
\begin{compactcodebox}
\meta{sort}\sym{questionmark}\meta{text}\sym{pipe}\meta{encap}
\end{compactcodebox}
or for sub-entries:
\begin{compactcodebox}
\meta{parent sort}\sym{questionmark}\meta{parent text}\sym{exclammark}\meta{sort}\sym{questionmark}\meta{text}\sym{pipe}\meta{encap}
\end{compactcodebox}
The question mark (\sym{questionmark}) is the \qt{actual character}
and separates the sort value from the actual text that's written to
the \ext+{gls} file (which is input by \gls{printglossary}).

By default, \app{makeindex} uses \sym{at} as the actual character but
this caused a problem for early versions of \sty{glossaries} where
there was a greater chance of internal commands occurring in the
\ext{glo} file. The custom \ext{ist} file identifies
\sym{questionmark} as the actual character:
\begin{compactcodebox}
actual '?'
\end{compactcodebox}

You may remember from \sectionref{sec:encap} that the
\glsopt{format} option specifies the \idx{encap}, which I claimed
was essentially the same as the \idx{encap} with \gls{index}, but as
can be seen from the above example, that's not strictly speaking
true. The real \idx{encap} has to include \gls{setentrycounter} so
that (if \idxpl{hyperlink} are supported) the appropriate target
name can be constructed.

The way that \app{makeindex} works is that it will write
\begin{compactcodebox}
\sym{bksl}\meta{encap}\margm{location}
\end{compactcodebox}
in the \ext{gls} (or equivalent) file. What \sty{glossaries}
actually needs for the \idxpl{hyperlink} to work is:
\begin{compactcodebox}
\gls{setentrycounter}\oargm{prefix}\margm{counter}\sym{bksl}\meta{cs}\margm{location}
\end{compactcodebox}
where \meta{cs} is the real formatting command name (identified in
the \glsopt{format} option).

So from \app{makeindex}['s] point of view, the real \idx{encap} in
the above example is the literal string:
\begin{compactcodebox}
setentrycounter[]\marg{page}\cmd{glsnumberformat}
\end{compactcodebox}

In the above example, the \location\ has ended up as
\code{\gls{es@scroman}  \marg{i}} which is invalid, as
\app{makeindex} requires the location to consist solely of digits,
Roman numerals or alphabetic, optionally separated by a \idxpl{compositor}.

That means that this example will trigger a message from \app{makeindex}
which will be written to the \ext+{glg} transcript file:
\begin{transcript}
Scanning input file myDoc.glo...
!! Input index error (file = myDoc.glo, line = 1):
   -- Illegal space within numerals in second argument.
.done (1 entries accepted, 1 rejected).
Sorting entries...done (0 comparisons).
Generating output file myDoc.gls....done (6 lines written, 0 warnings).
\end{transcript}
Note that 1 entry has been rejected, but it also shows 0 warnings
and it has a 0 exit code, which means that it won't interrupt the
overall document build.

If you run \app{makeglossaries} instead of running \app{makeindex}
explicitly, then \app{makeglossaries} will search the \ext{glg}
transcript for the \qt{(\meta{n} entries accepted, \meta{m} rejected)}
line, and if \meta{m} is greater than 0 it will attempt to diagnose
and fix the problem.

Messages about the \qt{second argument} (as in \qt{Illegal space
within numerals in second argument}) indicate that the problem is
with the \location, so \app{makeglossaries} will search the
locations for content that matches \code{\cmd{\meta{csname}}
\margm{num}} (with any or no spaces after the command name and
optionally preceded by \gls{protect}). If it
finds a match, it will shift \meta{csname} into the \idx{encap} with
the following message:
\begin{transcript}
Encap/location issue: potential LaTeX commands in location detected. Attempting to remedy.
Reading myDoc.glo...
Invalid location '\gls{es@scroman}  \marg{i}' detected for entry 'sample'. Replaced with 'i'
Writing myDoc.glo...
Retrying
\end{transcript}
The altered \ext{glo} file now contains:
\begin{compactcodebox}
\gls{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{page}\sym{dblquote}\gls{glslocationcstoencap}\marg{glsnumberformat}\marg{es@scroman}}\marg{i}
\gls{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{page}\sym{dblquote}\gls{glsnumberformat}}\marg{1}
\end{compactcodebox}
and \app{makeglossaries} will re-run \app{makeindex}.

Following this correction, the \idx{numberlist} for the 
\qt{sample} entry now contains:
\begin{compactcodebox}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\gls{glslocationcstoencap}\marg{\encap{glsnumberformat}}\marg{es@scroman}\marg{i}\gls{delimN}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\gls{glsnumberformat}\marg{1}
\end{compactcodebox}
The corrected \location\ needs to be encapsulated with both the designated
\idx{encap} (\encap{glsnumberformat} in this case) and the
formatting command that needs to be applied to the \location.
This is done via:
\cmddef{glslocationcstoencap}
This is simply defined to do:
\begin{compactcodebox}
\cmd{csuse}\margm{location-csname}\marg{\cmd{csuse}\margm{encap-csname}\margm{location}}
\end{compactcodebox}
This puts the intended \idx{encap} (\encap{glsnumberformat} in this
case) closer to the \location\ to enable it to work better with
\idxpl{hyperlink}, although this may not always work, particularly if
the command with the name \meta{location-csname} expects a numerical argument.

In the above example, the location command is \gls{es@scroman} which is
provided by \styfmt{babel-spanish} and performs fake
\idx{smallcaps}. Internal commands provided by other packages for
their own private use can't be relied upon. So the \sty{glossaries}
package can't assume they will stay the same, and the above example
document may produce a different result with different versions of
\sty{babel}. However, in this case (provided you use
\app{makeglossaries}), the document will correctly end up with 
the \idx{numberlist} \qt{\textsc{i}, 1} for the \qt{sample} entry in
the \idx{glossary}, which matches the document
page numbering. If you use \app{makeindex} explicitly, the
\idx{numberlist} will simply be \qt{1}.

This become more complicated if \sty{hyperref} is added to the
document (before \sty{glossaries}). Now \gls{glsnumberformat} uses
\gls{glshypernumber}, which needs to take into account that its
argument may contain a \idx{range} with the start and end location
separated by \gls{delimR} (the range delimiter), and it needs to
create a separate \idx{hyperlink} for each location component.

Here's a modified example that has an implicit \idx{range} in the front
matter and an explicit \idx{range} in the main matter.
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\cbeg{document}
\gls{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\gls{mainmatter}
\gls{chapter}\marg{Sample}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{hyperbf}}}\marg{sample}
\cmd{newpage}
Some text
\cmd{newpage}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{hyperbf}}}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
This again has problematic \locations, but \app{makeglossaries} can
shift the \gls{es@scroman} into the \idx{encap} as before. The
resulting \ext{gls} file has the following \idx{numberlist} for the
\qt{sample} entry:
\begin{compactcodebox}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\comment{prefix and counter}
\gls{glslocationcstoencap}\marg{\encap{glsnumberformat}}\marg{es@scroman}\marg{i\gls{delimR} iii}\gls{delimN} 
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\comment{prefix and counter}
\gls{hyperbf}\marg{1\gls{delimR} 3}
\end{compactcodebox}
Both \idxpl{range} have been compacted so that the \idx{range},
including the \gls{delimR} separator, is in the argument of the
\idx{encap} command.

The default definition of \gls{glslocationcstoencap} means that the
first \idx{range} is formatted according to:
\begin{compactcodebox}
\gls{es@scroman}\marg{\gls{glshypernumber}\marg{i\gls{delimR} iii}}
\end{compactcodebox}
This allows \gls{glshypernumber} to detect the delimiter and split
up the range so that it can apply a separate \idx{hyperlink} to the start and
end locations, so that it effectively becomes:
\begin{compactcodebox}
\gls{es@scroman}\marg{\gls{hyperlink}\margm{target1}\marg{i}\gls{delimR}
\gls{hyperlink}\margm{target2}\marg{iii}}
\end{compactcodebox}
In this type of situation, the most problematic document is one where 
the \meta{location-csname} can't handle \gls{hyperlink} in its argument
and needs to be shifted into the \idx{hyperlink} text. In the above
example document, no actual error occurs, but there are warnings from \pdfTeX:
\begin{transcript}
pdfTeX warning (dest): name\marg{page.iii} has been referenced but does not exist, replaced by a fixed one
[...]
pdfTeX warning (dest): name\marg{page.i} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
This is due to the way that \gls{glshypernumber} forms the target
name. Since the actual target name isn't saved in the
\idx{indexing} data, it has to be reconstituted from available
information: the prefix, the counter and the location.
So the targets become \code{page.i} for location \qt{i} and
\code{page.iii} for location \qt{iii}. This usually works for common
page formats, but it doesn't in this case. Adding \optfmt{debug} to
\sty{hyperref}['s] package options reveals the following information
in the transcript:
\begin{transcript}
Package hyperref Info: Anchor `page.I'
[...]
Package hyperref Info: Anchor `page.II'
\end{transcript}
So the correct anchors are \qt{page.I} and \qt{page.II}.

The \idx{casechange} occurs as a result of the fake \idx{smallcaps},
but since \gls{es@scroman} is outside of \gls{glshypernumber}, the
\idx{casechange} isn't part of the location and so doesn't affect
the anchor name.

I can redefine \gls{glslocationcstoencap} to swap them around:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glslocationcstoencap}}[3]\marg{\cmd{csuse}\marg{\#1}\marg{\cmd{csuse}\marg{\#2}\marg{\#3}}}
\end{codebox}
However, now the transcript shows:
\begin{transcript}
pdfTeX warning (dest): name\marg{page.\string\\protect\string\040\string\\es@scroman\string\040\string\040\marg{i--iii}} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
This is because \gls{es@scroman} doesn't fully expand.

The \gls{glswrglossdisableanchorcmds} hook provides a workaround
for the problematic command:
\begin{codebox*}
\gls{appto}\gls{glswrglossdisableanchorcmds}\marg{\gls{csletcs}\marg{es@scroman}\marg{text\_uppercase:n}}
\end{codebox*}
This will cause \gls{es@scroman} to be locally redefined to just
convert its argument to \idx*{uppercase} while the anchor is being
constructed. Unfortunately this patch is only partially successful
as the transcript now has:
\begin{transcript}
pdfTeX warning (dest): name\marg{page.I\longswitch III} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
The problem now is that \gls{glshypernumber} can't split on the
\idx{range} delimiter, so the location is now \qt{I\longswitch III}.

If the \idx{numberlist} doesn't contain any \idxpl{range}, then the
above redefinition of \gls{glslocationcstoencap} and the addition to
\gls{glswrglossdisableanchorcmds} will fix the \idx{hyperlink}.

Instead of redefining \gls{glslocationcstoencap} and altering
\gls{glswrglossdisableanchorcmds}, a solution that works with
\idxpl{range} can be achieved by redefining
\gls{glswrglosslocationtarget} to convert its argument to
\idx{uppercase}. You can do this with:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glswrglosslocationtarget}}[1]\marg{\gls{glsuppercase}\marg{\#1}}
\end{codebox}

This will successfully construct the anchor names \code{page.I} and
\code{page.III}. It won't affect the anchors for the main matter as
digits aren't affected by the \casechanging\ command.

If you're not using \app{makeglossaries} and are either calling
\app{makeindex} explicitly or via \app{makeglossaries-lite} or
with the \opt{automake} option, then you will need to find another
way of converting problematic \location\ into a form that won't be
discarded by \app{makeindex}. This is quite difficult if the
problematic content is inside \gls{thepage} since its delayed
expansion means that any attempt at locally changing the problematic
within \gls{glswrglossdisablelocationcmds} will be lost.

The earlier example can be rewritten to (sort of!) work without
\app{makeglossaries}:
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\codepar
\cmd{newcommand}\marg{\cmd{locthepage}}\marg{\gls{Roman}\marg{\ctr{page}}}
\cmd{newcommand}\marg{\cmd{delayedlocthepage}}\marg{\cmd{expandonce}\marg{\cmd{locthepage}}}
\cmd{appto}\gls{glswrglossdisablelocationcmds}\marg{\cmd{let}\gls{thepage}\cmd{delayedlocthepage}}
\codepar
\cbeg{document}
\gls{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\gls{mainmatter}
\cmd{renewcommand}\marg{\cmd{locthepage}}\marg{\gls{arabic}\marg{\ctr{page}}}
\gls{chapter}\marg{Sample}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{hyperbf}}}\marg{sample}
\cmd{newpage}
Some text
\cmd{newpage}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{hyperbf}}}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
Note that the custom \csfmt{locthepage} command needs to be
redefined after the page numbering changes at the start of the main
matter.

This ensures that the locations are valid in the \ext{glo} file, so
\app{makeindex} will process it without losing any rejecting any
entry lines. The hyperlink targets will also be correct. The only
problem now is that the front matter \locations\ will be in
\idx{uppercase} in the \idx{glossary}.

The above problems are all due to \app{makeindex} having a
restrictive location syntax. With \app{xindy}, you can define
location classes for custom \locations. Unfortunately, the backslash
\sym{bksl} is a special character for \app{xindy} that indicates an
escape sequence that indicates the next character should be
interpreted literally, which means that any \LaTeX\ commands that end up
in the \app{xindy} \idx{indexingfile} must have their initial
backslash escaped. This is quite tricky to do given the delayed
expansion of \gls{thepage}. If it's expanded early in order to
pre-process it then the page number could end up being incorrect.

The sample file \samplefile{xdy} provides a custom page format that
uses a robust command called \csfmt{tallynum}, which ends up in the
\ext{glo} file. With the default \optval{esclocations}{false}
setting, the location for the first page is written to the file as:
\begin{compactcodebox}
:locref "\marg{}\marg{\cmd{tallynum} \marg{1}}"
\end{compactcodebox}
This results in the following message from \app{xindy}:
\begin{transcript}
WARNING: location-reference "\marg{}\marg{tallynum \marg{1}}" did not match any location-class! (ignored)
\end{transcript}
Note that the backslash has gone from the start of \code{tallynum}.
As with \app{makeindex}, invalid \locations\ are dropped.

If you use \app{makeglossaries} rather than running \app{xindy}
directly, \app{makeglossaries} will detect the warning and provide
some diagnostic information:
\begin{transcript}
You may have forgotten to add a location 
class with \gls{GlsAddXdyLocation} or you may have 
the format incorrect or you may need 
the package option \optval{esclocations}{true}.
\end{transcript}
In this case, you need to use the package option
\optval{esclocations}{true}. This will use a hack to provide a way
to escape the backslash without prematurely expanding the actual
value of the \ctr{page} counter. As this is a hack, it may not work
and can result in obscure error messages.

Returning to the earlier \styfmt{babel-spanish} example, if it's
converted to use \app{xindy} instead of \app{makeindex}, a similar
problem arises. For example, simply adding the \opt{xindy} package
option:
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\strong{\opt{xindy}}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\cbeg{document}
\gls{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\gls{mainmatter}
\gls{chapter}\marg{Sample}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{hyperbf}}}\marg{sample}
\cmd{newpage}
Some text
\cmd{newpage}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{hyperbf}}}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
The \ext{glo} file now contains locations with \gls{es@scroman}, but
as with the \csfmt{tallynum} example, the leading backslash hasn't
been escaped:
\begin{compactcodebox}
:locref "\marg{}\marg{\gls{es@scroman}  \marg{i}}"
\end{compactcodebox}
This needs \optval{esclocations}{true} to escape the backslash.
\begin{codebox}
\cmd{usepackage}[\opt{xindy},\strong{\opt{esclocations}}]\marg{glossaries}
\end{codebox}
Note that this produces a different result in the \ext{glo} file:
\begin{compactcodebox}
:locref "\marg{}\marg{\string\\protect \string\\es@scroman  \marg{i}}"
\end{compactcodebox}
This results from the partial protected expansion used on \gls{thepage}
before the special characters are escaped.
If you inspect the \ext+{xdy} file created by \gls{makeglossaries},
you should find the following:
\begin{compactcodebox}
(define-location-class "roman-page-numbers"
   ( :sep "\marg{}\marg{"  :sep "\gls{protect} \gls{es@scroman} \marg{" "roman-numbers-lowercase" :sep "}" :sep "}" )
   :min-range-length 2
)
\end{compactcodebox}
This is because the non-default behaviour of \gls{roman} has been
detected and a custom location class has automatically been supplied.
(Whereas with the \samplefile{xdy} sample file, it was necessary to
provide the custom class to support \csfmt{tallynum} with \gls{GlsAddXdyLocation}.)

\section{Iterating Over Locations}
\label{sec:numberlistloop}

\begin{important}
Not available with \options{mkidx,xdy}. The commands described here
rely on the \locations\ being stored in the \glosfield{loclist} internal field
in an \sty{etoolbox} internal list format, which is what happens
with \option{noidx}.
\end{important}

The \gls{printnoidxglossary} command displays the \idx{locationlist}
using:
\cmddef{glsnoidxloclist}
where \meta{list cs} is a temporary command that contains the 
value of the \glosfield{loclist} field. This uses \gls{forlistloop} to iterate
over all the \locations\ in the list with the handler macro:
\cmddef{glsnoidxloclisthandler}
This keeps track of the previous element in the list to determine whether or
not to insert the \gls{delimN} separator. Note that it doesn't attempt to
determine whether or not any of the locations are \idxpl{range}.

\begin{xtr}
The \gls{printunsrtglossary} command will also use \gls{glsnoidxloclist} if the
\glosfield{loclist} field has been set but the \gloskey{location}
field hasn't, but in general it's better to instruct \app{bib2gls}
to save the formatted \idx{locationlist} (which is the default).
\end{xtr}

You can iterate over an entry's \glosfield{loclist} field using:
\cmddef{glsnumberlistloop}
where \meta{entry-label} is the entry's label and \meta{handler cs} is a
handler control sequence with the syntax:
\begin{compactcodebox}
\meta{handler cs}\margm{prefix}\margm{counter}\margm{format}\margm{location}
\end{compactcodebox}
where \meta{prefix} is the hypertarget prefix, \meta{counter} is
the name of the \idx{locationcounter}, \meta{format} is the
\idx{locationencap} (for example, \encap{textbf})
and \meta{location} is the \location.

The third argument \meta{xr handler cs} is the control sequence that
will be applied to any cross-references in the list. This handler
should have the syntax:
\begin{compactcodebox}
\meta{xr handler cs}\oargm{tag}\margm{xr list}\margm{empty}
\end{compactcodebox}
where \meta{tag} is the cross-referenced textual tag (for example, \qt{see}) and
\meta{xr list} is a~comma-separated list of \idx{entry} labels. The final
argument \meta{empty} will always be empty, but it allows for
\gls{glsseeformat} to be used as the handler.

\begin{bib2gls}
This method is designed for \option{noidx}, but \app{bib2gls} also
saves individual \locations\ in the \glosfield{loclist} field (in
addition to the formatted \idx{locationlist} which is stored in the
\gloskey{location} field).
However, the format for each item in the internal list varies
depending on whether \optval{record}{only} or
\optval{record}{nameref} was used. See the \sty{glossaries-extra}
manual for further details.
\end{bib2gls}

For example, if on page~12 I~have:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\encap{textbf}}}\marg{apple}
\end{codebox}
and on page~18 I~have:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{emph}}\marg{apple}
\end{codebox}
then
\begin{codebox}
\gls{glsnumberlistloop}\marg{apple}\marg{\cmd{myhandler}}
\end{codebox}
will be equivalent to:
\begin{codebox}
\cmd{myhandler}\marg{}\marg{\ctr{page}}\marg{\encap{textbf}}\marg{12}\comment{}
\cmd{myhandler}\marg{}\marg{\ctr{page}}\marg{\encap{emph}}\marg{18}\comment{}
\end{codebox}
There is a predefined handler that's used to display the
\idx{numberlist} in \gls{printnoidxglossary}:
\cmddef{glsnoidxdisplayloc}
This simply does:
\begin{compactcodebox}
\gls{setentrycounter}\oargm{prefix}\margm{counter}\comment{}
\cmd{csuse}\margm{format}\margm{location}
\end{compactcodebox}
which sets up the \idx{hyperlink} information needed for
\gls{glshypernumber} (in case it's required by the \idx{encap})
and encapsulates the \location, with the provided formatting
command.

Internally, \gls{glsnumberlistloop} uses \sty{etoolbox}['s]
\gls{forlistloop} with the handler:
\cmddef{glsnoidxnumberlistloophandler}
The default behaviour is simply to do its argument, which (for
\option{noidx}) will be in the form:
\begin{compactcodebox}
\gls{glsnoidxdisplayloc}\margm{prefix}\margm{counter}\margm{format}\margm{location}
\end{compactcodebox}
The \gls{glsnumberlistloop} works by temporarily redefining \gls{glsnoidxdisplayloc}
to \meta{handler} and \gls{glsseeformat} to \meta{xr handler cs}.

\begin{xtr}
With \sty{glossaries-extra}, you can use the more general purpose
\gls{glsxtrfieldforlistloop} and provide your own handler that can
be customized to suit \optval{record}{only} or
\optval{record}{nameref}.
\end{xtr}

\chapter{Glossary Styles}
\label{sec:styles}

The markup used in the \idx{glossary} is described in
\sectionref{sec:glossmarkup}. \sectionref{sec:newglossarystyle}
describes how to define a new \idx{glossarystyle}.
Commands that may be used in styles, but should not be redefined by
styles, are described in \sectionsref{sec:glossarycmds,sec:hypernav}.  The
commands that should be redefined by the \idx{glossarystyle} are
described in \sectionref{sec:glossarystylecmds}.

\Idxpl{glossarystyle} typically use \gls{glossentryname} to display
the \idx{entry}['s] name, but some may use the \idx{sentencecase} version 
\gls{Glossentryname} instead. Both encapsulate the name with:
\cmddef{glsnamefont}
which takes one argument: the entry name (obtained with
\gls{glsentryname} or \gls{Glsentryname}).

By default, \gls{glsnamefont} simply displays its argument in
whatever the surrounding font happens to be, but bear in mind that
the \idx{glossarystyle} may switch the font.

\begin{xtr}
With \sty{glossaries-extra} the \catattr{glossnamefont} and
\catattr{glossname} \idxpl{categoryattribute} can be used to adjust
font and, for \gls{glossentryname} only, \casechanging.
\end{xtr}

For example, the \glostyle{tree} style displays the name as follows:
\begin{compactcodebox}
\gls{glstreenamefmt}\marg{\gls{glstarget}\margm{entry-label}\marg{\gls{glossentryname}\margm{entry-label}}}
\end{compactcodebox}
which is essentially (ignoring the \idx{hyperlink} target):
\begin{compactcodebox}
\gls{glstreenamefmt}\marg{\gls{glsnamefont}\marg{\gls{glsentryname}\margm{entry-label}}}
\end{compactcodebox}
Since \gls{glstreenamefmt} is defined to display its argument in
bold, the name will end up in bold unless \gls{glsnamefont} is
redefined to change it.

The \glostyle{list} style displays the name in the option argument
of \gls{item}:
\begin{compactcodebox}
\gls{item}\oarg{\gls{glsentryitem}\margm{entry-label}\gls{glstarget}\margm{entry-label}\marg{\gls{glossentryname}\margm{entry-label}}}
\end{compactcodebox}
which is essentially (ignoring the \glslink{opt.entrycounter}{entry
counter} and \idx{hyperlink} target):
\begin{compactcodebox}
\gls{item}\oarg{\gls{glsnamefont}\marg{\gls{glsentryname}\margm{entry-label}}}
\end{compactcodebox}
This occurs within the \env{description} environment, which by
default uses bold for the item text. However, this may be changed by
various classes or packages. So the name may end up in bold or may
be in some other font, such as sans-serif.

The \glostyle{long} style displays the name in the first column of a
\env{longtable}:
\begin{compactcodebox*}
\gls{glsentryitem}\margm{entry-label}\gls{glstarget}\margm{entry-label}\marg{\gls{glossentryname}\margm{entry-label}} \idx{amp}
\end{compactcodebox*}
So the only font change will come from \gls{glsnamefont}, which
doesn't apply any change by default.

\Idxpl{glossarystyle} will typically display the description with
\gls{glossentrydesc} but may not show the symbol. If the symbol is
shown, it should be displayed with \gls{glossentrysymbol}.

There's no analogous font command for the description or symbol, but
the \sty{glossaries-extra} package provides the
\catattr{glossdescfont} and \catattr{glosssymbolfont} 
\idxc{categoryattribute}{attributes} to
change the font according to the \idx{entry}['s] category.

Some styles may supply their own helper commands (such as \gls{glstreenamefmt})
to make it easier to adjust the formatting without having to define
a new \idx{glossarystyle}.

\begin{example}{Changing the Font Used to Display Entry Names in the
Glossary}{ex:glsnamefont}
Suppose you want all the \idx{entry} names to appear in 
medium weight small caps in your \idxpl{glossary}, then you can do:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsnamefont}}[1]\marg{\gls{textsc}\marg{\cmd{mdseries} \#1}}
\end{codebox}
\end{example}

\begin{xtr}
The \sty{glossaries-extra-stylemods} package provides additional hooks that
can be used to make other minor adjustments.
\end{xtr}

Some styles support \idxpl{group}. These may simply insert a
vertical gap between groups, but some may also include
a heading with the \idx{group} title. The base \sty{glossaries}
package only has a simple mechanism for obtaining the title from the
\idx{group} label via \gls{glsgetgrouptitle}, which will test if
\gls{group-labelgroupname} exists where the \meta{group-label}
is \code{glssymbols}, \code{glsnumbers} or a single character.

\begin{xtr}
The \sty{glossaries-extra} package has commands \gls{glsxtrsetgrouptitle}
and \gls{glsxtrlocalsetgrouptitle} to set the \idx{group} title,
which take precedence over \gls{group-labelgroupname}. 
\end{xtr}


\section{Predefined Styles}
\label{sec:predefinedstyles}

The predefined styles can accommodate numbered \toplevel\ 
and \hierlevel{1} entries. See the
package options \opt{entrycounter}, \opt{counterwithin} and
\opt{subentrycounter} described in
\sectionref{sec:pkgopts-printglos}. There is a summary
of available styles in \tableref{tab:styles}. 
You can view samples of all the predefined styles at
\galleryurl{glossaries-styles/}.
Note that \sty{glossaries-extra} provides additional styles
in the supplementary packages \sty{glossary-bookindex},
\sty{glossary-topic} and \sty{glossary-longextra}. See the
\sty{glossaries-extra} manual for further details.

\begin{important}
Note that the \idx{group} styles (such as \glostyle{listgroup}) will
have unexpected results if used with the \opteqvalref{sort}{def}
or \opteqvalref{sort}{use} options. If you don't sort your entries
alphabetically, it's best to set the \opt{nogroupskip}
package option to prevent odd vertical gaps appearing.
\end{important}

The \idx{group} title is obtained using \gls{glsgetgrouptitle}\marg{label},
which is described in \sectionref{sec:newglossarystyle}.

\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 (for example, \code{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 \unlimited\ there is no limit, but note that 
\app{makeindex} (\option{mkidx}) imposes a limit of 2 sub-levels. If the
\idx{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.}
\label{tab:styles}
\centering
\begin{tabular}{lccc}
\bfseries Style & \bfseries Maximum Level &
\bfseries Homograph & \bfseries Symbol\\
\code{listdotted} & 0 & & \\
\code{sublistdotted} & 1 & & \\
\code{list*} & 1 & \yes & \\
\code{altlist*} & 1 & \yes & \\
\code{long*3col*} & 1 & \yes & \\
\code{long4col*} & 1 & \yes & \yes \\
\code{altlong*4col*} & 1 & \yes & \yes \\
\code{long*} & 1 & \yes & \\
\code{super*3col*} & 1 & \yes & \\
\code{super4col*} & 1 & \yes & \yes \\
\code{altsuper*4col*} & 1 & \yes & \yes \\
\code{super*} & 1 & \yes & \\
\code{*index*} & 2 & & \yes\\
\code{treenoname*} & \unlimited & \yes & \yes\\
\code{*alttree*} & \unlimited & & \yes\\
\code{*tree*} & \unlimited & & \yes\\
\code{inline} & 1 & \yes &  
\end{tabular}
\par
\end{table}

The tabular-like styles that allow multi-line descriptions and 
\idxpl{numberlist} use the length:
\cmddef{glsdescwidth}
to set the width of the description column and the length
\cmddef{glspagelistwidth} 
to set the width of the \idx{numberlist} column.

\begin{information}
These lengths will not be available if you use both the \opt{nolong}
and \opt{nosuper} package options or if you use the \opt{nostyles}
package option unless you explicitly load the relevant package.
\end{information}

These will need to be changed using \cmd{setlength} if the
\idx{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
\idxpl{entry}. Instead you should use the analogous \glostyle{altlong4col}
and \glostyle{altsuper4col} styles.  If you need to
explicitly create a line-break within a multi-line description in
a tabular-like style it's better to use \gls{newline} instead of
\gls{cs.bsl} (but consider using a ragged style with narrow columns).

\begin{important}
Remember that a cell within a tabular-like environment can't
be broken across a page, so even if a tabular-like style, such as
\glostyle{long}, allows multilined descriptions, you'll probably encounter
page-breaking problems if you have entries with long descriptions.
You may want to consider using the \glostyle{alttree} style instead.
\end{important}

Note that if you use the \printglossopt{style} key in the
optional argument to \gls{print...glossary}, it will override any 
previous style settings for the given \idx{glossary}, so if, for example,
you do
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{no effect}
\gls{printglossary}\oarg{\printglossoptval{style}{\glostyle{long}}}
\end{codebox}
then the new definition of \gls{glsgroupskip} will not have an affect
for this \idx{glossary}, as \gls{glsgroupskip} is redefined by 
\printglossoptval{style}{\glostyle{long}}. Likewise, \gls{setglossarystyle} will also
override any previous style definitions, so, again
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}{}\comment{no effect}
\gls{setglossarystyle}\marg{\glostyle{long}}
\end{codebox}
will reset \gls{glsgroupskip} back to its default definition for the
named \idx{glossarystyle} (\glostyle{long} in this case). If you want to 
modify the styles, either use \gls{newglossarystyle} (described
in the next section) or make the modifications after 
\gls{setglossarystyle}. For example:
\begin{codebox}
\gls{setglossarystyle}\marg{\glostyle{long}}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}
\end{codebox}
In this case, it's better to use \opt{nogroupskip} to suppress the
gap between groups for the default styles instead of redefining
\gls{glsgroupskip}.

All the styles except for the three- and four-column styles and the
\glostyle{listdotted} style use the \idx{postdeschook}:
\cmddef{glspostdescription}
after the description. This simply displays a \idx+{fullstop} by default.
To eliminate this \idx{fullstop} (or replace it with something else, say,
a comma) you will need to redefine \gls{glspostdescription} before
the \idx{glossary} is displayed. Alternatively, you can suppress it for a
given entry by placing \gls{nopostdesc} in the entry's description.
Note that \gls{longnewglossaryentry} puts \gls{nopostdesc} at the end
of the description. The \sty{glossaries-extra} package provides a
starred version that doesn't.

Alternatively, you can use the package option \opt{nopostdot} to
suppress this \idx{fullstop}.  This is implemented by default with
\sty{glossaries-extra}.  You can switch it back on with
\optval{nopostdot}{false} or \optval{postdot} or you can use
\opt{postpunc} for a different punctuation character.

\begin{xtr}
The \sty{glossaries-extra-stylemods} package provides some
adjustments to some of the predefined styles listed here, allowing
for greater flexibility. See the \sty{glossaries-extra}
documentation for further details.
\end{xtr}

\subsection{List Styles}
\label{sec:liststyles}

\pkgdef*{glossary-list}

The \idxpl{glossarystyle} 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 \idx{entry}['s]
\gloskey{symbol}.  Note that these styles will automatically be
available unless you use the \opt{nolist} or \opt{nostyles}
package options.

\begin{important}
Note that, except for the \glostyle{listdotted} style, these 
list styles are incompatible with \sty{classicthesis}. They
may also be incompatible with other classes or packages that
modify the \env{description} environment.
\end{important}

There is an initialisation hook that provides a patch
if the \sty{gettitlestring} package is loaded, since this is used by
\sty{hyperref}.
\cmddef{glslistinit}
Note that this automatically implements:
\begin{codebox*}
\gls{GetTitleStringSetup}\marg{expand}
\end{codebox*}
This patch should ensure that the combination of \sty{hyperref} and
\opt{entrycounter} will correctly expand the \idx{entry} name to the
\ext{aux} file. The name is expanded using:
\cmddef{glslistexpandedname}
This uses \gls{glsunexpandedfieldvalue}. If you need the name to
fully expand, you can redefine this. For example:
\begin{codebox}
\cmd{newcommand}\marg{\gls{glslistexpandedname}}[1]\marg{\gls{glsentryname}\marg{\#1}}
\end{codebox}

If \optval{nogroupskip}{false}, the \gls{glsgroupskip} command creates
a vertical space using:
\cmddef{indexspace}
This command is defined by some other packages, so it's only defined
by \sty{glossary-list} if it hasn't already been defined.

For the styles that should \idx{group} headings, the group title is
encapsulated with:
\cmddef{glslistgroupheaderfmt}
This simply does its argument by default, but it occurs inside the
optional argument of \gls{item} so may appear bold from the item
font change.

For the styles that have a navigation line, the line is
formatted according to:
\cmddef{glslistnavigationitem}
This puts its argument inside the optional argument of \gls{item},
which can cause a problem if the navigation line is too long, in
which case you will need to redefine \gls{glslistnavigationitem}. For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslistnavigationitem}}[1]\marg{\gls{item} \gls{textbf}\marg{\#1}}
\end{codebox}
You may prefer to use the tree-like styles, such as
\glostyle{treehypergroup} instead.

\glostyledef{list}
The \glostyle{list} style uses the \env{description}
environment. The \idx{entry} name is placed in the optional argument of
the \gls{item} command (so it will usually appear in bold by default). The
description follows, and then the associated \idx{numberlist} 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 \gls{indexspace} with the
default \optval{nogroupskip}{true}.

The closest matching non-list style is the \glostyle{index} style.

\glostyledef{listgroup}
The \glostyle{listgroup} style is like \glostyle{list} but the
\idxpl{group} have headings obtained using \gls{glsgetgrouptitle},
which is described in \sectionref{sec:newglossarystyle}.

\glostyledef{listhypergroup}
The \glostyle{listhypergroup} style is like
\glostyle{listgroup} but has a navigation line at the start of the
\idx{glossary} with links to each \idx{group} that is present in the
glossary, which is displayed in the glossary header with
\gls{glslistnavigationitem}.
This requires an additional run through \LaTeX\ to ensure the \idx{group}
information is up to date. Within the navigation line, each
\idx{group} item is separated by \gls{glshypernavsep}.

\glostyledef{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.

The closest matching non-list style is the \glostyle{index}
style with the following adjustment:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstreepredesc}}\marg{\comment{}
 \gls{glstreeitem}\cmd{parindent}\cmd{hangindent}}
\end{codebox}

\glostyledef{altlistgroup}
The \glostyle{altlistgroup} style is like 
\glostyle{altlist} but the glossary \idxpl{group} have headings.

\glostyledef{altlisthypergroup}
The \glostyle{altlisthypergroup} style is like 
\glostyle{altlistgroup} but has a set of links to the glossary 
\idxpl{group}. The navigation line is the same as that for 
\glostyle{listhypergroup}, described above.

\glostyledef{listdotted}
This style uses the \env{description}
environment.\footnote{This style was supplied by Axel~Menzel.} Each
entry starts with \code{\gls{item}\oarg{}}, followed by the name followed by a
dotted line, followed by the description. Note that this style
ignores both the \idx{numberlist} and the symbol. The length
\cmddef{glslistdottedwidth}
governs where the description should start. This is a flat style, so
child entries are formatted in the same way as the parent entries.

A non-list alternative is to use the \glostyle{index} style with
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstreepredesc}}\marg{\cmd{dotfill}}
\cmd{renewcommand}\marg{\gls{glstreechildpredesc}}\marg{\cmd{dotfill}}
\end{codebox}
Note that this doesn't use \gls{glslistdottedwidth} and causes
the description to be flush-right and will display the
symbol, if provided. (It also doesn't suppress
the \idx{numberlist}, but that can be achieved with the
\opt{nonumberlist} option.)

\glostyledef{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}. Unlike the
\glostyle{listdotted} style, this style is incompatible with
\sty{classicthesis}.

\subsection{Longtable Styles}
\label{sec:longstyles}

\pkgdef*{glossary-long}

The \idxpl{glossarystyle} 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 \opt{nolong} or \opt{nostyles} package
options.  These styles fully justify the description and 
\idx{numberlist} columns.  If you want ragged right formatting instead, use the
analogous styles described in \sectionref{sec:longraggedstyles}.
If you want to incorporate rules from the \sty{booktabs} package,
try the styles described in \sectionref{sec:longbooktabsstyles}.

\Idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\gls{setglossarystyle}\marg{\glostyle{long}}
\end{codebox}
Both may be combined in the same option list. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip},\optval{style}{\glostyle{long}}]\marg{glossaries}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{longragged}}}
\end{codebox}
The following doesn't work:
\begin{compactcodebox}
\gls{setglossarystyle}\marg{\glostyle{long}}
\gls{printglossary}\oarg{\printglossopt{nogroupskip}}\comment{too late}
\end{compactcodebox}
This is because the \gls{ifglsnogroupskip} conditional needs to be
outside of \gls{glsgroupskip} with tabular-like styles, so the
conditional is in the style definition to determine the appropriate
definition of \gls{glsgroupskip}.

\begin{xtr}
There are additional styles that use the \env{longtable} environment
provided with the \sty{glossary-longextra} package, but that
requires \sty{glossaries-extra}.
\end{xtr}

\glostyledef{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 \idx{entry}['s] name and the second
column contains the description followed by the \idx{numberlist}.
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
\gls{glsdescwidth}. Child entries have a similar format to the
parent entries except that their name is suppressed.

\glostyledef{longborder}

The \glostyle{longborder} style is like
\glostyle{long} but has horizontal and vertical lines around it.

\glostyledef{longheader}

The \glostyle{longheader} style is like \glostyle{long} but has a header row.
You may prefer the \glostyle{long-booktabs} style instead.

\glostyledef{longheaderborder}

The \glostyle{longheaderborder} style is like \glostyle{longheader}
but has horizontal and vertical lines around it.  The
\glostyle{long-booktabs} style is generally better.

\glostyledef{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 \idx{numberlist}.
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
\gls{glsdescwidth}, and the width of the third column is governed by the
length \gls{glspagelistwidth}.

\glostyledef{long3colborder}

The \glostyle{long3colborder} style is like
the \glostyle{long3col} style but has horizontal and vertical
lines around it.

\glostyledef{long3colheader}

The \glostyle{long3colheader} style is like
\glostyle{long3col} but has a header row.
You may prefer the \glostyle{long3col-booktabs} style instead.

\glostyledef{long3colheaderborder}

The \glostyle{long3colheaderborder} style is like
\glostyle{long3colheader} but has horizontal and vertical lines
around it.  The
\glostyle{long3col-booktabs} style is generally better.

\glostyledef{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.

\glostyledef{long4colborder}

The \glostyle{long4colborder} style is like the \glostyle{long4col}
style but has horizontal and vertical lines around it.

\glostyledef{long4colheader}

The \glostyle{long4colheader} style is like
\glostyle{long4col} but has a header row.
You may prefer the \glostyle{long4col-booktabs} style instead.

\glostyledef{long4colheaderborder}

The \glostyle{long4colheaderborder} style is like
\glostyle{long4colheader} but has horizontal and vertical lines
around it.

\glostyledef{altlong4col}

The \glostyle{altlong4col} style is like \glostyle{long4col} but
allows multi-line descriptions and \idxpl{numberlist}.  The width of the
description column is governed by the length \gls{glsdescwidth} and
the width of the \idx{numberlist} column is governed by the length
\gls{glspagelistwidth}. The widths of the name and symbol columns
are governed by the widest entry in the given column.

\glostyledef{altlong4colborder}

The \glostyle{altlong4colborder} style is like
the \glostyle{long4colborder} but allows multi-line descriptions and
\idxpl{numberlist}.

\glostyledef{altlong4colheader}

The \glostyle{altlong4colheader} style is like
\glostyle{long4colheader} but allows multi-line descriptions and
\idxpl{numberlist}.
You may prefer the \glostyle{altlong4col-booktabs} style instead.

\glostyledef{altlong4colheaderborder}

The \glostyle{altlong4colheaderborder} 
style is like \glostyle{long4colheaderborder} but allows multi-line
descriptions and \idxpl{numberlist}.

\subsection{Longtable Styles (Ragged Right)}
\label{sec:longraggedstyles}

\pkgdef*{glossary-longragged}

The \idxpl{glossarystyle} 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{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-longragged}
\gls{setglossarystyle}\marg{\glostyle{longragged3col}}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \styfmt{glossaries} package has been loaded.
If you want to incorporate rules from the \sty{booktabs} package,
try the styles described in \sectionref{sec:longbooktabsstyles}.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{longragged3col}},\optval{stylemods}{longragged}]\marg{glossaries-extra}
\end{codebox}

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-longragged}
\gls{setglossarystyle}\marg{\glostyle{longragged}}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{longragged}}}
\end{codebox}

\glostyledef{longragged}

The \glostyle{longragged} style has two columns: the first column
contains the \idx{entry}['s] name and the second column contains the
(left-justified) description followed by the \idx{numberlist}.  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 \gls{glsdescwidth}. Child entries have a
similar format to the parent entries except that their name is
suppressed.

\glostyledef{longraggedborder}

The \glostyle{longraggedborder} style is like \glostyle{longragged}
but has horizontal and vertical lines around it.

\glostyledef{longraggedheader}

The \glostyle{longraggedheader} style is like
\glostyle{longragged} but has a header row.
You may prefer the \glostyle{longragged-booktabs} style instead.

\glostyledef{longraggedheaderborder}

The \glostyle{longraggedheaderborder} style is like
\glostyle{longraggedheader} but has horizontal and vertical lines
around it.

\glostyledef{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) \idx{numberlist}.  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 \gls{glsdescwidth}, and the width of the
third column is governed by the length \gls{glspagelistwidth}.

\glostyledef{longragged3colborder}

The \glostyle{longragged3colborder} style is like the
\glostyle{longragged3col} style but has horizontal and vertical
lines around it.

\glostyledef{longragged3colheader}

The \glostyle{longragged3colheader} style is like
\glostyle{longragged3col} but has a header row.
You may prefer the \glostyle{longragged3col-booktabs} style instead.

\glostyledef{longragged3colheaderborder}

The \glostyle{longragged3colheaderborder} style is
like \glostyle{longragged3colheader} but has horizontal and vertical lines
around it.

\glostyledef{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 \gls{glsdescwidth} and the width of
the \idx{numberlist} column is governed by the length
\gls{glspagelistwidth}. The widths of the name and symbol columns
are governed by the widest entry in the given column.

\glostyledef{altlongragged4colborder}

The \glostyle{altlongragged4colborder} style is like the
\glostyle{altlongragged4col} but has horizontal and vertical lines
around it.

\glostyledef{altlongragged4colheader}

The \glostyle{altlongragged4colheader} style is like
\glostyle{altlongragged4col} but has a header row.
You may prefer the \glostyle{altlongragged4col-booktabs} style instead.

\glostyledef{altlongragged4colheaderborder}

The \glostyle{altlongragged4colheaderborder} style is like
\glostyle{altlongragged4colheader} but has horizontal and vertical
lines around it.

\subsection{Longtable Styles (\styfmt{booktabs})}
\label{sec:longbooktabsstyles}

\pkgdef*{glossary-longbooktabs}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-longbooktabs}.

Since these styles all use the
\env{longtable} environment, they are governed by the same
parameters as that environment. The \sty{glossary-longbooktabs}
package automatically loads the \sty{glossary-long}
(\sectionref{sec:longstyles})
and \sty{glossary-longragged} (\sectionref{sec:longraggedstyles}) packages.  Note that
these styles will only be available if you explicitly load
\sty{glossary-longbooktabs}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-longbooktabs}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \sty{glossaries} package has been loaded.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long3col-booktabs}},\optval{stylemods}{longbooktabs}]\marg{glossaries-extra}
\end{codebox}

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-longbooktabs}
\gls{setglossarystyle}\marg{\glostyle{long-booktabs}}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{long-booktabs}}}
\end{codebox}

These styles are similar to the \qt{header} styles in the \sty{glossary-long} and
\sty{glossary-longragged} packages, but they add the rules
provided by the \sty{booktabs} package, \gls{toprule}, \gls{midrule} and
\gls{bottomrule}. Additionally these styles patch the
\env{longtable} environment to check for instances of the group
skip occurring at a page break. If you don't want this patch to
affect any other use of \env{longtable} in your document, you can
scope the effect by only setting the style through the
\printglossopt{style} key in the optional argument of
\gls{print...glossary}.

Alternatively, you can restore the original \env{longtable}
behaviour with:
\cmddef{glsrestoreLToutput}

The penalty check is tested with:
\cmddef{glsLTpenaltycheck}
The default definition is:
\begin{compactcodebox}
\cmd{ifnum}\cmd{outputpenalty}=-50\cmd{vskip}-\cmd{normalbaselineskip}\cmd{relax}\cmd{fi}
\end{compactcodebox}

With the default \optval{nogroupskip}{false}, \gls{glsgroupskip}
will be defined to use:
\cmddef{glspenaltygroupskip}
to insert the vertical gap. This is defined as:
\begin{compactcodebox}
\cmd{noalign}\marg{\cmd{penalty}-50\cmd{vskip}\cmd{normalbaselineskip}}
\end{compactcodebox}

\glostyledef{long-booktabs}

This style is similar to the \glostyle{longheader} style but adds
rules above and below the header (\gls{toprule} and \gls{midrule}) and
inserts a rule at the bottom of the table (\gls{bottomrule}).

\glostyledef{long3col-booktabs}

This style is similar to the \glostyle{long3colheader} style but
adds rules as per \glostyle{long-booktabs}.

\glostyledef{long4col-booktabs}

This style is similar to the \glostyle{long4colheader} style but
adds rules as above.

\glostyledef{altlong4col-booktabs}

This style is similar to the \glostyle{altlong4colheader} style but
adds rules as above.

\glostyledef{longragged-booktabs}

This style is similar to the \glostyle{longraggedheader} style but
adds rules as above.

\glostyledef{longragged3col-booktabs}

This style is similar to the \glostyle{longragged3colheader} style
but adds rules as above.

\glostyledef{altlongragged4col-booktabs}

This style is similar to the \glostyle{altlongragged4colheader}
style but adds rules as above.

\subsection{Supertabular Styles}
\label{sec:superstyles}

\pkgdef*{glossary-super}

The \idxpl{glossarystyle} 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 \opt{nosuper} or \opt{nostyles} package
options.  In general, the \env{longtable} environment is better,
but there are some circumstances where it is better to use
\env{supertabular}. (For example, with the \sty{flowfram}
package.) These styles fully justify the description and \idx{numberlist}
columns.  If you want ragged right formatting instead, use the
analogous styles described in \sectionref{sec:superraggedstyles}.

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\gls{setglossarystyle}\marg{\glostyle{super}}
\end{codebox}
Or
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip},\optval{style}{\glostyle{super}}]\marg{glossaries}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{super}}}
\end{codebox}

\begin{warning}
Sometimes the \env{supertabular} style doesn't put page breaks in
the right place. If you have unexpected output, try the
\sty{glossary-long} styles instead. Alternatively, try the
\glostyle{alttree} style.
\end{warning}

\glostyledef{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 \idx{entry}['s] name and the second
column contains the description followed by the \idx{numberlist}.
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
\gls{glsdescwidth}. Child entries have a similar format to the
parent entries except that their name is suppressed.

\glostyledef{superborder}

The \glostyle{superborder} style is like \glostyle{super} but has
horizontal and vertical lines around it.

\glostyledef{superheader}

The \glostyle{superheader} style is like \glostyle{super} but has a
header row.

\glostyledef{superheaderborder}

The \glostyle{superheaderborder} style is
like \glostyle{superheader} but has horizontal and vertical lines
around it.

\glostyledef{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 \idx{numberlist}. 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
\gls{glsdescwidth}. The width of the third column is governed by the
length \gls{glspagelistwidth}.

\glostyledef{super3colborder}

The \glostyle{super3colborder} style is like
the \glostyle{super3col} style but has horizontal and vertical
lines around it.

\glostyledef{super3colheader}

The \glostyle{super3colheader} style is like
\glostyle{super3col} but has a header row.

\glostyledef{super3colheaderborder}

The \glostyle{super3colheaderborder} style is like the
\glostyle{super3colheader} style but has horizontal and vertical
lines around it.

\glostyledef{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.

\glostyledef{super4colborder}

The \glostyle{super4colborder} style is like the
\glostyle{super4col} style but has horizontal and vertical lines
around it.

\glostyledef{super4colheader}

The \glostyle{super4colheader} style is like \glostyle{super4col}
but has a header row.

\glostyledef{super4colheaderborder}

The \glostyle{super4colheaderborder} style is like the
\glostyle{super4colheader} style but has horizontal and vertical
lines around it.

\glostyledef{altsuper4col}

The \glostyle{altsuper4col} style is like \glostyle{super4col} but
allows multi-line descriptions and \idxpl{numberlist}.  The width of the
description column is governed by the length \gls{glsdescwidth} and
the width of the \idx{numberlist} column is governed by the length
\gls{glspagelistwidth}. The width of the name and symbol columns is
governed by the widest entry in the given column.

\glostyledef{altsuper4colborder}

The \glostyle{altsuper4colborder} style is like the
\glostyle{super4colborder} style but allows multi-line descriptions
and \idxpl{numberlist}.

\glostyledef{altsuper4colheader}

The \glostyle{altsuper4colheader} style is like
\glostyle{super4colheader} but allows multi-line descriptions and
\idxpl{numberlist}.

\glostyledef{altsuper4colheaderborder}

The \glostyle{altsuper4colheaderborder} style is like
\glostyle{super4colheaderborder} but allows multi-line descriptions
and \idxpl{numberlist}.

\subsection{Supertabular Styles (Ragged Right)}
\label{sec:superraggedstyles}

\pkgdef*{glossary-superragged}

The \idxpl{glossarystyle} 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{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-superragged}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \sty{glossaries} package has been loaded.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{superragged3col}},\optval{stylemods}{superragged}]\marg{glossaries-extra}
\end{codebox}

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-superragged}
\gls{setglossarystyle}\marg{\glostyle{superragged}}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{superragged}}}
\end{codebox}

\glostyledef{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 \idx{entry}['s] name and the
second column contains the (left justified) description followed by
the \idx{numberlist}.  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
\gls{glsdescwidth}. Child entries have a similar format to the
parent entries except that their name is suppressed.

\glostyledef{superraggedborder}

The \glostyle{superraggedborder} style is like
\glostyle{superragged} but has horizontal and vertical lines around
it.

\glostyledef{superraggedheader}

The \glostyle{superraggedheader} style is like
\glostyle{superragged} but has a header row.

\glostyledef{superraggedheaderborder}

The \glostyle{superraggedheaderborder} style is like
\glostyle{superraggedheader} but has horizontal and vertical lines
around it.

\glostyledef{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) \idx{numberlist}. 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
\gls{glsdescwidth}. The width of the third column is governed by the
length \gls{glspagelistwidth}.

\glostyledef{superragged3colborder}

The \glostyle{superragged3colborder}
style is like the \glostyle{superragged3col} style but has
horizontal and vertical lines around it.

\glostyledef{superragged3colheader}

The \glostyle{superragged3colheader}
style is like \glostyle{superragged3col} but has a header row.

\glostyledef{superragged3colheaderborder}

The \glostyle{superragged3colheaderborder} style is like the above
but has horizontal and vertical lines around it.

\glostyledef{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.

\glostyledef{altsuperragged4colborder}

The \glostyle{altsuperragged4colborder} style is like the
\glostyle{altsuperragged4col} style but has horizontal and vertical
lines around it.

\glostyledef{altsuperragged4colheader}

The \glostyle{altsuperragged4colheader} style is like
\glostyle{altsuperragged4col} but has a header row.

\glostyledef{altsuperragged4colheaderborder}

The \glostyle{altsuperragged4colheaderborder} style is like the
above but has horizontal and vertical lines around it.

\subsection{Tree-Like Styles}
\label{sec:treestyles}

\pkgdef*{glossary-tree}

The \idxpl{glossarystyle} 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 \idx{entry}['s] symbol if it
has been set. Note that these styles will automatically be available
unless you use the \opt{notree} or \opt{nostyles} package
options. 

These styles all format the entry name using:
\cmddef{glstreenamefmt}
This defaults to \code{\gls{textbf}\margm{text}}, but note that \meta{text}
will include \gls{glsnamefont} so the bold setting in \gls{glstreenamefmt}
may be counteracted by another font change in \gls{glsnamefont} (or
in \gls{acronymfont}). The tree-like styles that also display the
header use
\cmddef{glstreegroupheaderfmt}
to format the heading. This defaults to
\code{\gls{glstreenamefmt}\margm{text}}. The tree-like styles that display
navigation links to the groups (such as \glostyle{indexhypergroup}), format
the navigation line using
\cmddef{glstreenavigationfmt}
which defaults to \code{\gls{glstreenamefmt}\margm{text}}. 

Note that this is different from \gls{glslistnavigationitem},
provided with the styles such as \glostyle{listhypergroup}, as that
also includes \gls{item}.

With the exception of the \glostyle{alttree} style (and those
derived from it), the space before the description for top-level
entries is produced with
\cmddef{glstreepredesc}
This defaults to \gls{space}.

With the exception of the \glostyle{treenoname} and
\glostyle{alttree} styles (and those derived from them), the 
space before the description for child
entries is produced with
\cmddef{glstreechildpredesc}
This defaults to \gls{space}.

\begin{important}
Most of these styles are not designed for multi-paragraph 
descriptions. (The \glostyle{tree} style isn't too bad for
multi-paragraph top-level entry descriptions, or you can use the
\glostyle{index} style with the adjustment shown below.)
\end{important}

\glostyledef{index}

The \glostyle{index} style is similar to the way standard indices
are usually formatted in that it has a \hierarchical\ structure up
to three levels (the main level plus two sub-levels).  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.
\Idxpl{group} are separated using \gls{indexspace}.

Each main level item is started with
\cmddef{glstreeitem}
The \hierlevel{1} entries are started with
\cmddef{glstreesubitem}

The \hierlevel{2} entries are started with
\cmddef{glstreesubsubitem}

Note that the \glostyle{index} style automatically sets
\begin{compactcodebox*}
\cmd{let}\gls{item}\gls{glstreeitem}
\cmd{let}\gls{subitem}\gls{glstreesubitem}
\cmd{let}\gls{subsubitem}\gls{glstreesubsubitem}
\end{compactcodebox*}
at the start of the \env{theglossary} environment for backward compatibility.

The \glostyle{index} style isn't suitable for multi-paragraph
descriptions, but this limitation can be overcome by redefining
the above commands. For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstreeitem}}\marg{\comment{}
 \cmd{parindent}0pt\cmd{par}\cmd{hangindent}40pt
 \cmd{everypar}\marg{\cmd{parindent}50pt\cmd{hangindent}40pt}}
\end{codebox}

\glostyledef{indexgroup}

The \glostyle{indexgroup} style is similar to the \glostyle{index}
style except that each group has a heading obtained using
\gls{glsgetgrouptitle}.

\glostyledef{indexhypergroup}

The \glostyle{indexhypergroup} style is like \glostyle{indexgroup}
but has a set of links to the glossary \idxpl{group}. The navigation
line is the same as that for \glostyle{listhypergroup}, described
above, but is formatted using \gls{glstreenavigationfmt}.

\glostyledef{tree}

The \glostyle{tree} style is similar to the
\glostyle{index} style except that it can have arbitrary 
\idxpl{hierarchicallevel}.
(Note that \app{makeindex} is limited to three levels, so
you will need to use another indexing method if you want more than 
three levels.) Each sub-level is indented according to the length
\cmddef{glstreeindent}
This value can be changed with \cmd{setlength}.

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.)

\glostyledef{treegroup}

The \glostyle{treegroup} style is similar to the \glostyle{tree}
style except that each \idx{group} has a heading.

\glostyledef{treehypergroup}

The \glostyle{treehypergroup} style is like 
\glostyle{treegroup} but has a set of links to the glossary 
\idxpl{group}. The navigation line is the same as that for 
\glostyle{listhypergroup}, described above, but is formatted using
\gls{glstreenavigationfmt}.

\glostyledef{treenoname}

The \glostyle{treenoname} style is like the \glostyle{tree} style
except that the name for each sub-entry is ignored.

\glostyledef{treenonamegroup}

The \glostyle{treenonamegroup} style is similar to the
\glostyle{treenoname} style except that each group has a heading.

\glostyledef{treenonamehypergroup}

The \glostyle{treenonamehypergroup} style is like
\glostyle{treenonamegroup} but has a set of links to the glossary
\idxpl{group}. The navigation line is the same as that for
\glostyle{listhypergroup}, described above, but is formatted using
\gls{glstreenavigationfmt}.

\glostyledef{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
\cmddef{glssetwidest}
The optional argument \meta{level} indicates the
\idx{hierarchicallevel}, where 0 indicates the top-most level, 1
indicates the first level sub-entries, etc. If \gls{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.

\begin{warning}
If you use the \glostyle{alttree} style without setting the widest
\toplevel\ name, there will be no room available for the name.
If a name overlaps the description, then this is an indication that 
there is a name wider than the one specified.
\end{warning}

This requires keeping track of which \idx{entry} has the widest name,
which may not be practical for large \idxpl{glossary}. Instead you
can use:
\cmddef{glsfindwidesttoplevelname}
This iterates over all entries in the glossaries identified by the
comma-separated list \meta{glossary labels} and determines the
widest \toplevel\ entry. If the optional argument is omitted, all
non-\idxpl{ignoredglossary} are assumed.

For example, to have the same name width for all glossaries:
\begin{codebox}
\gls{glsfindwidesttoplevelname}
\gls{setglossarystyle}\marg{\glostyle{alttree}}
\gls{printglossaries}
\end{codebox}
Alternatively, to compute the widest entry for each glossary
before it's displayed:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glossarypreamble}}\marg{\comment{}
  \gls{glsfindwidesttoplevelname}\oarg{\gls{currentglossary}}}
\gls{setglossarystyle}\marg{\glostyle{alttree}}
\gls{printglossaries}
\end{codebox}

\begin{information}
These commands only affects the \glostyle{alttree} styles, including those 
listed below and the ones in the \sty{glossary-mcols} package.
\end{information}

\begin{xtr}
The \gls{glssetwidest} command also affects the styles provided by
\sty{glossary-topic}.
The \sty{glossaries-extra-stylemods} package provides additional
commands. With \app{bib2gls}, you may prefer the
\resourceopt{set-widest} resource option.
\end{xtr}

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.

The name is placed inside a left-aligned \gls{makebox}, created with:
\cmddef{glstreenamebox}
where \meta{width} is the width of the box (calculated from the
widest name) and \meta{text} is the contents of the box. For
example, to make the name right-aligned:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glstreenamebox}}[2]\marg{\comment{}
  \cmd{makebox}[\#1][r]\marg{\#2}\comment{}
}
\end{codebox}

\glostyledef{alttreegroup}

The \glostyle{alttreegroup} is like the \glostyle{alttree} style
except that each \idx{group} has a heading.

\glostyledef{alttreehypergroup}

The \glostyle{alttreehypergroup} style is like
\glostyle{alttreegroup} but has a set of links to the glossary
\idxpl{group}.

\subsection{Multicols Style}
\label{sec:mcolstyles}

\pkgdef*{glossary-mcols}

The \sty{glossary-mcols} package provides tree-like
\idxpl{glossarystyle} that are in the \env{multicols} environment
(defined by the \sty{multicol} package). The style names are as
their analogous tree styles (as defined in
\sectionref{sec:treestyles}) but are prefixed with \qt{mcol}.  For
example, the \glostyle{mcolindex} style is essentially the
\glostyle{index} style but put in a \env{multicols} environment.
For the complete list, see \tableref{tab:mcols}. The
\sty{glossary-tree} package is automatically loaded by
\sty{glossary-mcols} (even if the \opt{notree} package option is
used when loading \sty{glossaries}). The formatting commands
\gls{glstreenamefmt}, \gls{glstreegroupheaderfmt} and
\gls{glstreenavigationfmt} are all used by the corresponding
\sty{glossary-mcols} styles.

Note that these styles will only be available if you explicitly load
\sty{glossary-mcols}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-mcols}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \sty{glossaries} package has been loaded.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{mcolindex}},\optval{stylemods}{mcols}]\marg{glossaries-extra}
\end{codebox}

The default number of columns is 2, but can be changed by redefining:
\cmddef{glsmcols}
For example, for a three column glossary:
\begin{codebox}
\cmd{usepackage}\marg{glossary-mcols}
\cmd{renewcommand}*\marg{\gls{glsmcols}}\marg{3}
\gls{setglossarystyle}\marg{mcolindex}
\end{codebox}

\begin{table}[htbp]
\caption{Multicolumn Styles}
\label{tab:mcols}
\centering
\begin{tabular}{ll}
\bfseries \sty{glossary-mcols} Style &
\bfseries Analogous Tree Style\\
\inlineglostyledef{mcolindex} & \glostyle{index}\\
\inlineglostyledef{mcolindexgroup} & \glostyle{indexgroup}\\
\inlineglostyledef{mcolindexhypergroup} or \inlineglostyledef{mcolindexspannav} 
 & \glostyle{indexhypergroup}\\
\inlineglostyledef{mcoltree} & \glostyle{tree}\\
\inlineglostyledef{mcoltreegroup} & \glostyle{treegroup}\\
\inlineglostyledef{mcoltreehypergroup} or \inlineglostyledef{mcoltreespannav}
  & \glostyle{treehypergroup}\\
\inlineglostyledef{mcoltreenoname} & \glostyle{treenoname}\\
\inlineglostyledef{mcoltreenonamegroup} & \glostyle{treenonamegroup}\\
\inlineglostyledef{mcoltreenonamehypergroup} or
\inlineglostyledef{mcoltreenonamespannav} & \glostyle{treenonamehypergroup}\\
\inlineglostyledef{mcolalttree} & \glostyle{alttree}\\
\inlineglostyledef{mcolalttreegroup} & \glostyle{alttreegroup}\\
\inlineglostyledef{mcolalttreehypergroup} or 
\inlineglostyledef{mcolalttreespannav} & \glostyle{alttreehypergroup}
\end{tabular}
\end{table}

The styles with a navigation line, such as
\glostyle{mcoltreehypergroup}, now have a variant (as from v4.22)
with \qt{hypergroup} replaced with \qt{spannav} in the style name.
The original \qt{hypergroup} styles place the navigation line at the
start of the first column. The newer \qt{spannav} styles put the
navigation line in the optional argument of the \env{multicols}
environment so that it spans across all the columns.


\subsection{In-Line Style}
\label{sec:inline}

\pkgdef*{glossary-inline}

This section covers the \sty{glossary-inline} package that supplies
the \glostyle{inline} style. This is a \idx{glossarystyle} that is designed for
in-line use (as opposed to block styles, such as lists or tables).
This style doesn't display the \idx{numberlist}.

Note that this style will only be available if you explicitly load
\sty{glossary-inline}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-inline}
\end{codebox}

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{inline}},\optval{stylemods}{inline}]\marg{glossaries-extra}
\end{codebox}

You will most likely need to redefine \gls{glossarysection} with
this style. For example, suppose you are required to have your
\idxpl{glossary} and list of \idxpl{acronym} in a footnote, you can do:
\begin{codebox}
\cmd{usepackage}\marg{glossary-inline}
\cmd{renewcommand}*\marg{\gls{glossarysection}}[2][]\marg{\gls{textbf}\marg{\#1}: }
\gls{setglossarystyle}\marg{inline}
\end{codebox}
Then where you need to include your \idxpl{glossary} as a footnote you can do:
\begin{codebox}
\gls{footnote}\marg{\gls{printglossaries}}
\end{codebox}

\glostyledef{inline}
This is the only style provided by \sty{glossary-inline}.

The group skip command \gls{glsgroupskip} is defined to do nothing,
regardless of the \opt{nogroupskip} option. Likewise,
\gls{glsgroupheading} is defined to do nothing. If you want to
create a custom style base on the \glostyle{inline} style that shows
a heading, then add \inlineglsdef{glsinlinedopostchild} to the definition of
\gls{glsgroupheading} in case a \idx{group} heading follows a child
entry.

\begin{important}
Don't redefine \gls{glsinlinedopostchild}. It's provided as a user
command to make it easier to add it to the start of a custom definition
of \gls{glossaryheader} to enable \idx{group} headings.
If you need to adjust the content between a sub-entry and the next
entry, redefine \gls{glsinlinepostchild} instead.
\end{important}

The \glostyle{inline} style is governed by the following commands.

\cmddef{glsinlineseparator}
This is used between \toplevel\ entries.

\cmddef{glsinlinesubseparator}
This is used between sub-entries.

\cmddef{glsinlineparentchildseparator}
This is used between a \toplevel\ parent entry and its first sub-entry.

\cmddef{glspostinline}
This is used at the end of the glossary.
The default definition is:
\begin{compactcodebox}
\gls{glspostdescription}\gls{space}
\end{compactcodebox}
This is the only place that the post-description hook is used in
this style.

\cmddef{glsinlinenameformat}
This is used to create the target, where \meta{name} is provided
in the form \code{\gls{glossentryname}\margm{entry-label}} and 
\meta{entry-label} is the entry's label. 
The default definition is:
\begin{compactcodebox}
\gls{glstarget}\margm{entry-label}\margm{name}
\end{compactcodebox}

For example, if you want the name to appear in \idx{smallcaps}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsinlinenameformat}}[2]\marg{\gls{glstarget}\marg{\#1}\marg{\gls{textsc}\marg{\#2}}}
\end{codebox}

This style needs to know if an entry has any children. This test is
performed with:
\cmddef{glsinlineifhaschildren}
The default definition simply uses \gls{ifglshaschildren}, which is
inefficient as it has to iterate through all \idxpl{entry} (in the
same \idx{glossary} as \meta{entry-label}) to determine
which ones have the given entry as a parent. This can be
time-consuming for large \idxpl{glossary}, but the assumption here is
that an inline \idx{glossary} is unlikely to be used with a large
set of entries. However, if you are using \app{bib2gls} with the
\resourceopt{save-child-count} resource option, it's more efficient
to use \gls{GlsXtrIfHasNonZeroChildCount} instead (particularly if
you are using \gls{printunsrtglossary} with a filtered subset). For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsinlineifhaschildren}}[3]\marg{\comment{}
 \gls{GlsXtrIfHasNonZeroChildCount}\margm{\#1}\marg{\#2}\marg{\#3}\comment{}
}
\end{codebox}

Sub-entry names are formatted according to:
\cmddef{glsinlinesubnameformat}
which has the same syntax as \gls{glsinlinenameformat} but a
different definition:
\begin{compactcodebox}
\gls{glstarget}\margm{entry-label}\marg{}
\end{compactcodebox}
which means that the sub-entry name is ignored.

If the description is empty or has been suppressed (according to
\gls{ifglshasdesc} and \gls{ifglsdescsuppressed}, respectively) then:
\cmddef{glsinlineemptydescformat}
(which does nothing by default) is used,
otherwise the description is formatted according to:
\cmddef{glsinlinedescformat}
This defaults to just \code{\gls{space}\meta{description}} so the symbol and
\idx{locationlist} are ignored.

For example, if you want a colon between the name and the
description:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsinlinedescformat}}[3]\marg{: \#1}
\end{codebox}

The sub-entry description is formatted according to:
\cmddef{glsinlinesubdescformat}
This defaults to just \meta{description}.

\cmddef{glsinlinepostchild}
This hook is used at the start of a \toplevel\ entry that immediate
follows a sub-entry.  It does nothing by default.

\section{Defining your own glossary style}
\label{sec:newglossarystyle}

The markup used in the \idx{glossary} is described in
\sectionref{sec:glossmarkup}. Commands that may be used by styles,
but should not be redefined by styles, are described in
\sectionsref{sec:glossarycmds,sec:hypernav}.
The commands that should be redefined by the \idx{glossarystyle} are
described in \sectionref{sec:glossarystylecmds}.

\begin{important}
Commands like \gls{printglossary} are designed to produce content in
the \idx{PDF}. If your intention is to design a style that doesn't print
any content (for example, to simply capture information) then you
are likely to experience unwanted side-effects. If you just want to
capture \idx{indexing} information (such as \locations) then a much better
approach is to use \app{bib2gls}, which automatically stores this
information in dedicated fields when the entry is defined.
If you still really want to use a style to capture information
obtained from \app{makeindex} or \app{xindy} then simply \gls{input}
the \idx{indexingfile} instead of using \gls{printglossary}.
\end{important}

If the predefined \idxpl{glossarystyle} don't fit your requirements, you can
define your own style using:
\cmddef{newglossarystyle}
where \meta{style-name} is the name of the new \idx{glossarystyle}
(to be used in the \opt{style} option or \gls{setglossarystyle}). 
An existing style can be redefined with:
\cmddef{renewglossarystyle}
In both cases, the second argument \meta{definitions}
needs to redefine all of the commands listed in \sectionref{sec:glossarystylecmds}.

\begin{important}
Bear in mind that parameters will need to be referenced with
\idx{hashhash} rather than \sym{hash}.
\end{important}

A style may inherit from an existing style by starting
\meta{definitions} with \gls{setglossarystyle} and then just
redefine the commands that are different from the inherited style.

For example, the \glostyle{indexgroup} style is basically the same as
the \glostyle{index} style, except for the definition of
\gls{glsgroupheading}, so the style is simply defined as:
\begin{compactcodebox}
\gls{newglossarystyle}\marg{\glostyle{indexgroup}}\marg{\comment{}
 \gls{setglossarystyle}\marg{\glostyle{index}}\comment{inherit \glostyle{index}}
\comment{alter the command that's different:}
 \cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{\comment{}
   \gls{item}\gls{glstreegroupheaderfmt}\marg{\gls{glsgetgrouptitle}\marg{\idx{hashhash}1}}\comment{}
   \gls{indexspace}
 }\comment{}
}
\end{compactcodebox}

\subsection{Commands For Use in Glossary Styles}
\label{sec:glossarycmds}

These commands are typically used in style definitions but should
not be modified by the style. See \sectionref{sec:hypernav} for
\idxpl{hyperlink} to \idx{group} headings.

In order to support the \optval{entrycounter} option, a style needs
to use:
\cmddef{glsentryitem}
at the place where the associated number should appear if the option
is set.
If \optval{entrycounter}{true}, \gls{glsentryitem} will do:
\begin{compactcodebox}
\gls{glsstepentry}\margm{label}\gls{glsentrycounterlabel}
\end{compactcodebox}
otherwise it will do \gls{glsresetsubentrycounter} (which ensures
the sub-entry counter is reset if it has been enabled with
\opt{subentrycounter}).

For example, the \glostyle{list} style defines \gls{glossentry} as follows:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
  \gls{item}\oarg{\gls{glsentryitem}\marg{\idx{hashhash}1}\comment{}
      \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}}
   \gls{glossentrydesc}\marg{\idx{hashhash}1}\gls{glspostdescription}\gls{space} \idx{hashhash}2}
\end{compactcodebox}

In order to support the \optval{subentrycounter} option, a style needs
to use:
\cmddef{glssubentryitem} 
at the place where the associated number should appear if the option
is set.
If \optval{subentrycounter}{true}, this will do:
\begin{compactcodebox}
\gls{glsstepsubentry}\margm{label}\gls{glssubentrycounterlabel}
\end{compactcodebox}
otherwise it does nothing.
This will typically only be used with \hierlevel{1} and omitted
for deeper \idxpl{hierarchicallevel}.

For example, the \glostyle{index} style has:
\begin{compactcodebox}
\cmd{renewcommand}\marg{\gls{subglossentry}}[3]\marg{\comment{}
  \cmd{ifcase}\idx{hashhash}1\relax
    \comment{level 0}
    \gls{item}
  \cmd{or}
    \comment{level 1}
    \gls{subitem}
    \gls{glssubentryitem}\marg{\idx{hashhash}2}\comment{}
  \cmd{else}
    \comment{all other levels}
    \gls{subsubitem}
  \cmd{fi}
  \gls{glstreenamefmt}\marg{\gls{glstarget}\marg{\idx{hashhash}2}\marg{\gls{glossentryname}\marg{\idx{hashhash}2}}}\comment{}
  \gls{ifglshassymbol}\marg{\idx{hashhash}2}\marg{\gls{space}(\gls{glossentrysymbol}\marg{\idx{hashhash}2})}\marg{}\comment{}
  \gls{glstreechildpredesc}\gls{glossentrydesc}\marg{\idx{hashhash}2}\gls{glspostdescription}\gls{space} \idx{hashhash}3\comment{}
}
\end{compactcodebox}
The test for level~0 is redundant in this case as \gls{glossentry}
will be used for \toplevel\ entries, but is provided for
completeness. Note that \gls{glssubentryitem} is only used for
level~1.

The style will typically also create the target to enable \idxpl{hyperlink}
from an entry reference within the document (created with commands
like \gls{gls}) to the \idx{entryline} in the \idx{glossary}.

The target is created with:
\cmddef{glstarget}
If \idxpl{hyperlink} aren't enabled, this simply does the second
argument \meta{text}, otherwise it will create a target with the
name \meta{prefix}\meta{entry-label}, where the prefix is obtained
by expanding:
\cmddef{glolinkprefix}
The \sty{glossaries-extra} package has options, such as
\printglossopt{prefix}, that can be used to override this.

\cmddef{glossentryname}
This is used in \idxpl{glossarystyle} to display the name
encapsulated with \gls{glsnamefont}. Unlike \gls{glsentryname}, this
command will trigger a warning if the \idx{entry}
hasn't been defined. The \idx{sentencecase} version is:
\cmddef{Glossentryname}
Both commands internally use \gls{glsnamefont} so
there's no need to explicitly use that command in a style.

\begin{xtr}
With \sty{glossaries-extra}, the \catattr{glossnamefont}
and \catattr{glossname} \idxpl{categoryattribute} can be used to adjust font and,
for \gls{glossentryname}, \casechanging. If you just use
\gls{glsentryname}, the style won't be influenced by those
attributes.
\end{xtr}

\cmddef{glossentrydesc}
This is used in \idxpl{glossarystyle} to display the description. 
Unlike \gls{glsentrydesc}, this command will trigger a warning if
the \idx{entry} hasn't been defined. The \idx{sentencecase} version is:
\cmddef{Glossentrydesc}

\begin{xtr}
With \sty{glossaries-extra} the \catattr{glossdescfont}
and \catattr{glossdesc} \idxpl{categoryattribute} can be used to adjust font and,
for \gls{glossentrydesc}, \casechanging. If you just use
\gls{glsentrydesc}, the style won't be influenced by those
attributes.
\end{xtr}

\cmddef{glossentrysymbol}
This is used in \idxpl{glossarystyle} to display the \gloskey{symbol}. 
Unlike \gls{glsentrysymbol}, this command will trigger a warning if
the \idx{entry} hasn't been defined. The \idx{sentencecase} version is:
\cmddef{Glossentrysymbol}

\begin{xtr}
With \sty{glossaries-extra} you can use the \catattr{glosssymbolfont}
\idx{categoryattribute} to adjust font. If you just use
\gls{glsentrysymbol}, the style won't be influenced by that
attribute.
\end{xtr}

\idxpl{glossarystyle} that support \idxpl{group} can obtain the
group title with:
\cmddef{glsgetgrouptitle}
This gets the title associated with the \idx{group} identified by
\meta{group-label} and displays it. The title is determined as
follows:
\begin{itemize}
\item if \meta{group-label} is a single character or either
\code{glsnumbers} or \code{glssymbols} and the command
\inlineglsdef{group-labelgroupname} exists, then that command is
used as the title.

\item otherwise the title is the same as the group label.
\end{itemize}

\begin{xtr}
The \sty{glossaries-extra} package provides improved support for
\idx{group} titles, but redefines \gls{glsgetgrouptitle} to
accommodate the enhanced features.
\end{xtr}

\subsection{Hyper Group Navigation}
\label{sec:hypernav}

\pkgdef{glossary-hypernav}

There is no need to load this package. It will automatically be
loaded by \sty{glossaries}. If \sty{hyperref} hasn't been loaded,
these commands will still be available but simply won't form
\idxpl{hyperlink} or targets, so they can be used in
\idxpl{glossarystyle} without any need to check for \idx{hyperlink}
support. (However, the result might look a bit strange if the reader
expects the navigation text to be \idxpl{hyperlink}.)

\cmddef{glsnavhypertarget}
Creates a hyper target for a \idx{group}.
The \meta{glossary-label} argument is the label that identifies the
\idx{glossary}. If omitted, \gls{currentglossary} is assumed.
The \meta{group-label} argument is the label that identifies the
\idx{group}. This additionally writes information to the \ext+{aux} file so that
on the next \LaTeX\ run, \gls{glsnavigation} will have a list of
\idxpl{group} for the \idx{glossary}.

For example, the \glostyle{indexhypergroup} includes a \idx{group}
target in the header:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{\comment{}
  \gls{item}\gls{glstreegroupheaderfmt}
    \marg{\gls{glsnavhypertarget}\marg{\#1}\marg{\gls{glsgetgrouptitle}\marg{\#1}}}\comment{}
  \gls{indexspace}
}
\end{compactcodebox}

\cmddef{glsnavhypergroupdotarget}
This is used by \gls{glsnavhypertarget} to create the actual \idx{hyperlink} 
target. So if you need to change the way that the target is created,
redefine this command rather than \gls{glsnavhypertarget}.

\cmddef{glsnavhyperlink}
Creates a \idx{hyperlink} to the given \idx{group}, where the
target name is obtained from:
\cmddef{glsnavhyperlinkname}
The \meta{glossary-label} argument is the label that identifies the
\idx{glossary}. If omitted, \gls{currentglossary} is assumed.
Typically, styles don't need to explicitly use this command as they
can use the following command instead.

\begin{information}
Version 4.53 has switched from using an internal comma-separated
list to a sequence command. If you have hacked the internal commands
you will need to either rollback to v4.52 or switch to the newer
commands.
\end{information}

\cmddef{glsnavigation}
Displays a simple navigation list, where each item in the list has a
\idx{hyperlink} created with \gls{glsnavhyperlink} to a \idx{group},
where the \idx{group} title is obtained with \gls{glsgetgrouptitle}.  
Each item in the list has the title and hyperlink set with:
\cmddef{glsnavigationitem}
This fetches the corresponding group title and creates a hyperlink
with \gls{glsnavhyperlink}.
The items are separated with:
\cmddef{glshypernavsep}
The default definition is \code{\gls{space}\gls{textbar}\gls{space}}
which creates a vertical bar with a space on either side.

\cmddef{glssymbolnav}
Just produces a simple set of navigation links for the symbol and
number \idxpl{group} and ends with the \gls{glshypernavsep}
separator. Unlike \gls{glsnavigation}, there's no check
to determine if the \idx{glossary} has those \idxpl{group}. This
command is a historical artefact leftover from early versions. There should
be little need for it now as \gls{glsnavigation} should
include all the \idxpl{group} that are in the \idx{glossary}.

\subsection{Glossary Style Commands}
\label{sec:glossarystylecmds}

The commands listed in this section should all be redefined by every
\idx{glossarystyle}.  However, a style may be based on another
style, in which case the style definitions should start with
\gls{setglossarystyle} and then only redefine the commands that
should differ from the inherited style.

Note that \gls{print...glossary} sets \gls{currentglossary}
to the current glossary label, so it's possible to create a glossary
style that varies according to the glossary type, but this will
generally limit its usefulness.

\envdef{theglossary}
The actual content of the \idx{glossary} is placed inside the
\env{theglossary} environment. For example, the \glostyle{list} style
redefines this to start and end the \env{description} environment:
\begin{compactcodebox}
\cmd{renewenvironment}\marg{theglossary}\comment{}
  \marg{\gls{glslistinit}\cbeg{description}}\marg{\cend{description}}
\end{compactcodebox}
Immediately after \code{\cbeg{theglossary}} comes the header:
\cmddef{glossaryheader}
For example, the \glostyle{longheader} style has:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glossaryheader}}\marg{\comment{}
 \cmd{bfseries} \gls{entryname} \idx{amp} \cmd{bfseries} \gls{descriptionname}\cmd{tabularnewline}\cmd{endhead}}
\end{compactcodebox}
(Note that this is not the same as the \idx{glossarypreamble} which
occurs before the start of the \env{theglossary} environment and is
not part of the style.)

The rest of the contents of the \env{theglossary} environment is
divided into \idx+{lettergroup} blocks. Each block starts with the
\idx{group} heading:
\cmddef{glsgroupheading}
Note that the argument is a label that identifies the \idx{group}. Some
\idxpl{glossarystyle} redefine this command to do nothing, which
means there's no \idx{group} title displayed. Others, such as
\idxpl{glossarystyle}, will obtain the group title from the
\meta{group-label} and format the title to fit the style.

\begin{information}
The \meta{group-label} is typically obtained by the
\idx{indexingapp}, based on the sort value.
\end{information}

With \options{noidx,mkidx,xdy}, \idxpl{group} only related to
\toplevel\ entries.

\begin{xtr}
The \sty{glossaries-extra} package additionally provides
\gls{glssubgroupheading} to support sub-\idxpl{group}, which are
only available with \options{b2g,unsrt}. \Idxpl{glossarystyle}
should only include a redefinition of \gls{glssubgroupheading}  if
the style is specifically designed for use with
\sty{glossaries-extra} as the command won't be available with just
the base \sty{glossaries} package. (A default definition will be
provided if this command isn't set with \sty{glossaries-extra}.)
\end{xtr}

After the \idx{group} heading, each \toplevel\ \gls+{entryline} within the
\idx{group} is formatted with:
\cmddef{glossentry}
The first argument is the \idx{entry}['s] label. The second is the
\idx{numberlist} that was collated by the \idx{indexingapp}.

The \meta{number-list} argument may be empty or \gls{relax}, or may contain the
\idx{numberlist} encapsulated with \gls{glossaryentrynumbers},
possibly prefixed with a pre-\idx{numberlist} hook. If
\meta{number-list} is an unbraced \gls{relax}, that typically indicates that
\optionsor{mkidx,xdy} were used and the entry was a parent that wasn't
\indexed\ but has been included because it has an \indexed\ child entry.
An empty \meta{number-list} argument is more likely to be a result
of \optionsor{noidx,b2g,unsrt}, in which case nothing can be
inferred about whether or not the entry was actually \indexed.

Each \glslink{entryline}{sub-entry line} is formatted with:
\cmddef{subglossentry}
where \meta{level} is the \idx{hierarchicallevel}. The other
arguments are the same as for \gls{glossentry}. Some
\idxpl{glossarystyle} redefine this command to simply use
\gls{glossentry}, in which case the \idx{glossary} will have a flat
(no-hierarchy) appearance, but the \idx{indexingapp} will still take the
hierarchy into account when ordering the \idxpl{entry}.

\begin{important}
The \idxpl{glossarystyle} should redefine \gls{glossentry} and
\gls{subglossentry} to fit the style, but they should not 
redefine the markup in \meta{number-list}. If the style doesn't
support \idxpl{numberlist}, then the \meta{number-list} argument
should simply be ignored.
\end{important}

The \idxpl{glossarystyle} will typically redefine \gls{glossentry}
to use \gls{glsentryitem} to support the \opt{entrycounter} option, 
\gls{glstarget} to create the \idx{hyperlink} target,
and will use \gls{glossentryname} to format the name.

Similarly, \gls{subglossentry} will typically start with
\gls{glssubentryitem} to support the \opt{subentrycounter} option.
Again \gls{glstarget} is needed to create the \idx{hyperlink}
target. The entry name may be displayed with \gls{glossentryname} or
may be omitted to support \idxpl{homograph}.

Between each \idx{lettergroup} block (that is, before all instances
of \gls{glsgroupheading} except for the first one) is the \idx{group} skip:
\cmddef{glsgroupskip}
Some \idxpl{glossarystyle} redefine this to do nothing, but some
may define it to create a vertical gap in order to visually separate
the \idxpl{lettergroup}. Most of the predefined styles use the
\gls{ifglsnogroupskip} conditional within this command to determine whether or
not to add the gap.

For example, the \glostyle{list} style defines \gls{glsgroupskip} as
follows:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{\gls{ifglsnogroupskip}\cmd{else}\gls{indexspace}\cmd{fi}}%
\end{compactcodebox}
This has the conditional inside the definition of \gls{glsgroupskip}
which allows it to be changed after the style has been set. This
causes a problem for tabular-like styles, so those need to have the
conditional outside of the definition. For example, the
\glostyle{long-booktabs} style has:
\begin{compactcodebox}
\gls{ifglsnogroupskip}
  \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{}
\cmd{else}
  \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{\gls{glspenaltygroupskip}}\comment{}
\cmd{fi}
\end{compactcodebox}
This requires the conditional to be set before the style definitions
are performed.

\begin{example}{Creating a completely new style}{sec:exnewstyle}

If you want a completely new style, you will need to redefine all
of the commands and the environment listed above in this section. 

For example, suppose you want each entry to start with a bullet point.
This means that the \idx{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 \idxpl{group} (so \gls{glsgroupheading} and \gls{glsgroupskip}
should do nothing) and suppose you don't want anything to appear
immediately after \code{\cbeg{theglossary}} (so \gls{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 \idx{numberlist} should appear within square brackets
at the end. Then you can create this new \idx{glossarystyle}, called, say,
\optfmt{mylist}, as follows:
\begin{codebox}
\gls{newglossarystyle}\marg{mylist}\marg{\comment{}
 \comment{put the glossary in the itemize environment:}
 \cmd{renewenvironment}\marg{\env{theglossary}}\comment{}
   \marg{\cbeg{itemize}}\marg{\cend{itemize}}\comment{}
 \comment{no header after \cbeg{theglossary}}
 \cmd{renewcommand}*\marg{\gls{glossaryheader}}\marg{}\comment{}
 \comment{no visual distinction between glossary \idxpl{group}:}
 \cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{}\comment{}
 \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{}
 \comment{set how each entry should appear:}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
 \gls{item} \comment{bullet point}
 \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}\comment{the entry name}
 \gls{space} (\gls{glossentrysymbol}\marg{\idx{hashhash}1})\comment{the symbol in brackets}
 \gls{space} \gls{glossentrydesc}\marg{\idx{hashhash}1}\comment{the description}
 \gls{space} \oarg{\idx{hashhash}2}\comment{the number list in square brackets}
 }\comment{}
 \comment{set how sub-entries appear:}
 \cmd{renewcommand}*\marg{\gls{subglossentry}}[3]\marg{\comment{}
   \gls{glossentry}\marg{\idx{hashhash}2}\marg{\idx{hashhash}3}}\comment{}
 }
\end{codebox}
Note that this style creates a flat glossary, where sub-entries
are displayed in exactly the same way as the top level entries.
It also hasn't used \gls{glsentryitem} or \gls{glssubentryitem} so
it won't be affected by the \opt{entrycounter},
\opt{counterwithin} or \opt{subentrycounter} package options.

Variations:
\begin{itemize}
\item You might want the entry name to start with a capital, in
which case use \gls{Glossentryname} instead of \gls{glossentryname}.

\item You might want to check if the symbol hasn't been set and omit
the parentheses if the symbol is absent. In this case you can use
\gls{ifglshassymbol} (see \sectionref{sec:utilities}):
\begin{codebox}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
 \gls{item} \comment{bullet point}
 \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}\comment{the entry name}
 \strong{\gls{ifglshassymbol}\marg{\idx{hashhash}1}}\comment{check if symbol exists}
 \marg{\comment{}
   \gls{space} (\gls{glossentrysymbol}\marg{\idx{hashhash}1})\comment{the symbol in brackets}
 }\comment{}
 \marg{}\comment{no symbol so do nothing}
 \gls{space} \gls{glossentrydesc}\marg{\idx{hashhash}1}\comment{the description}
 \gls{space} \oarg{\idx{hashhash}2}\comment{the number list in square brackets}
 }\comment{}
\end{codebox}
\end{itemize}
\end{example}

\begin{example}{Creating a new glossary style based on an
existing style}{sec:exadaptstyle}

If you want to define a new style that is a slightly modified
version of an existing style, you can use \gls{setglossarystyle}
within the second argument of \gls{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 \gls{indexspace} between \idxpl{group}, then you
can create a new \idx{glossarystyle} called, say, \optfmt{mylist} as
follows:
\begin{codebox}
\cmd{newglossarystyle}\marg{mylist}\marg{\comment{}
 \gls{setglossarystyle}\marg{\glostyle{list}}\comment{base this style on the list style}
 \comment{make nothing happen between \idxpl{group}:}
 \cmd{renewcommand}\marg{\gls{glsgroupskip}}\marg{}\comment{} 
}
\end{codebox} 
(In this case, you can actually achieve the same effect using the
\glostyle{list} style in combination with the package option
\opt{nogroupskip}.)
\end{example}

\begin{example}{Example: creating a glossary style that uses the
\gloskeyfmttext{user1}, \ldots, \gloskeyfmttext{user6} keys}{sec:exuserstyle}

Suppose each \idx{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 
\idx{glossarystyle} that displays each entry in a \env{longtable} as follows:
\begin{codebox}
\gls{newglossarystyle}\marg{long6col}\marg{\comment{}
 \comment{put the glossary in a \env{longtable} environment:}
 \cmd{renewenvironment}\marg{\env{theglossary}}\comment{}
  \marg{\cbeg{longtable}\marg{lp\marg{\gls{glsdescwidth}}cccp\marg{\gls{glspagelistwidth}}}}\comment{}
  \marg{\cend{longtable}}\comment{}
 \comment{Set the table's header:}
 \cmd{renewcommand}*\marg{\gls{glossaryheader}}\marg{\comment{}
  \gls{bfseries} Term \idx{amp} \gls{bfseries} Description \idx{amp} \gls{bfseries} Symbol \idx{amp}
  \gls{bfseries} Units \idx{amp} \gls{bfseries} Dimensions \idx{amp} \gls{bfseries} Page List
  \gls{cs.bsl}\cmd{endhead}}\comment{}
 \comment{No heading between \idxpl{group}:}
  \cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{}\comment{}
 \comment{\toplevel\ entries displayed in a row optionally numbered:}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
   \gls{glsentryitem}\marg{\idx{hashhash}1}\comment{Entry number if required}
   \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}\comment{Name}
   \idx{amp} \gls{glossentrydesc}\marg{\idx{hashhash}1}\comment{Description}
   \idx{amp} \gls{glossentrysymbol}\marg{\idx{hashhash}1}\comment{Symbol}
   \idx{amp} \gls{glsentryuseri}\marg{\idx{hashhash}1}\comment{Units}
   \idx{amp} \gls{glsentryuserii}\marg{\idx{hashhash}1}\comment{Dimensions}
   \idx{amp} \idx{hashhash}2\comment{Page list}
   \cmd{tabularnewline} \comment{end of row}
 }\comment{}
 \comment{Similarly for sub-entries (no sub-entry numbers)}
 \cmd{renewcommand}*\marg{\gls{subglossentry}}[3]\marg{\comment{}
    \comment{ignoring first argument (sub-level)}
    \gls{glstarget}\marg{\idx{hashhash}2}\marg{\gls{glossentryname}\marg{\idx{hashhash}2}}\comment{Name}
    \idx{amp} \gls{glossentrydesc}\marg{\idx{hashhash}2}\comment{Description}
    \idx{amp} \gls{glossentrysymbol}\marg{\idx{hashhash}2}\comment{Symbol}
    \idx{amp} \gls{glsentryuseri}\marg{\idx{hashhash}2}\comment{Units}
    \idx{amp} \gls{glsentryuserii}\marg{\idx{hashhash}2}\comment{Dimensions}
    \idx{amp} \idx{hashhash}3\comment{Page list}
    \cmd{tabularnewline} \comment{end of row}
 }\comment{}
 \comment{Nothing between \idxpl{group}:}
 \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{}
}
\end{codebox}
\end{example}


\chapter{Xindy (Option \glsfmttext{idx.opt.xdy})}
\label{sec:xindy}

\glsstartrange{app.xindy,ext.xdy}%
If you want to use \app{xindy} to sort the \idx{glossary}, you
must use the package option \opt+{xindy}:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{xindy}}\marg{glossaries}
\end{codebox}
This ensures that the information is written
to the \idxpl{indexingfile} using \app{xindy}['s] raw syntax.

\Sectionref{sec:makeglossaries} covers how to use the external
\idx{indexingapp}, and \sectionref{sec:locationsyntax} covers the
issues involved in the \location\ syntax. This section covers the
commands provided by the \sty{glossaries} package that allow you
to adjust the \app{xindy} style file (\ext+{xdy}) and
parameters.

To assist writing information to the \app{xindy} style
file, the \sty{glossaries} package provides the following
commands:
\cmddef{glsopenbrace}
which expands to \sym{bg} (a literal open brace) and
\cmddef{glsclosebrace}
which expands to \sym{eg} (a literal closing brace). 
This is needed because \gls{cs.openbrace} and \gls{cs.closebrace} don't expand
to a simple brace character when written to a file.

\cmddef{glspercentchar}
Expands to \sym{pc} (a literal percent).

\cmddef{glstildechar}
Expands to \sym{tilde} (a literal tilde).

For example, a newline character is specified in a \app{xindy} style
file using \idx{tilden} so you can use \code{\gls{glstildechar} n}
to write this correctly (or you can do \code{\gls{string}\idx{tilde}n}).

\cmddef{glsbackslash}
Expands to \sym{bksl} (a literal tilde).

In addition, if you are using a package that makes
\idx{dblquote} active you can use:
\cmddef{glsquote}
which will produce \code{\sym{dblquote}\meta{text}\sym{dblquote}},
where \sym{dblquote} is a literal character.
Alternatively, you can use \code{\gls{string}\sym{dblquote}} to write 
the double-quote character. 
This document assumes that the double quote character has not been
made active, so the examples just use \sym{dblquote} for clarity.

If you want greater control over the \app{xindy} style file than is
available through the \LaTeX\ commands provided by the
\sty{glossaries} package, you will need to edit the \app{xindy}
style file. In which case, you must use \gls{noist} to prevent the
style file from being overwritten by \gls+{makeglossaries}
package. For additional information about \app{xindy}, read the
\app{xindy} documentation. I'm sorry I can't provide any assistance
with writing \app{xindy} style files. If you need help, I recommend
you ask on the \app*{xindy}
\urlfootref{http://xindy.sourceforge.net/mailing-list.html}{mailing list}.

\section{Required Styles}
\label{sec:xdystyles}

The \ext{xdy} file created by \gls{makeglossaries} starts with 
identifying the required styles.
By default, the \optfmt{tex} style is automatically added, so the \ext{xdy} 
file should contain:
\begin{compactcodebox}
; required styles
   
(require "tex.xdy")
\end{compactcodebox}
Any additional styles can be identified in the \idx{documentpreamble} 
(before \gls{makeglossaries}) with:
\cmddef{GlsAddXdyStyle}
The styles are all stored as a comma-separated list, so you can list
multiple styles within the argument, but avoid spurious spaces.
You can reset the style list (for example, if a style needs to be identified before
\filefmt{tex.xdy}) with:
\cmddef{GlsSetXdyStyles} 
The argument should be a comma-separated list where, again, you need to make
sure there are no spurious spaces.

\section{Language and Encodings}
\label{sec:langenc}

\begin{information}
The commands in this section are only relevant if you use
\app{makeglossaries} or \opt{automake}. If you are calling \app{xindy} explicitly you
need to set the \xdyopt{L} and \xdyopt{C} switches appropriately.
\end{information}

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 
(\ext{aux}) file.  The \app{makeglossaries} script attempts to 
find the \app{xindy} language name given your document settings,
which may not match the \sty{babel} or \sty{polyglossia} name, using
set of known mappings. 

\begin{information}
Language mappings aren't supported with \app{makeglossaries-lite}
or \opt{automake}.
\end{information}

The default is to use \gls{languagename}. The information is written to the
\ext{aux} file at the start of \gls{printglossary}, which means that
it should match the language in the document at that point.

In the event that \app{makeglossaries} gets the language name wrong
or if \app{xindy} doesn't support 
that language, then you can specify the required language using:
\cmddef{GlsSetXdyLanguage}
where \meta{language} is the name of the language. The
optional argument can be used if you have multiple \idxpl{glossary}
in different languages. If \meta{glossary type} is omitted, 
\gls{glsdefaulttype} is assumed. If a language hasn't been set for a
particular \idx{glossary} then the language will be as for the
default glossary.

\begin{information}
The \app{xindy} \inlineidxdef{codepage} may not simply be the file \idx+{encoding}
but may also include sorting rules.
\end{information}

The default \idx{codepage} will be obtained from the value of
\gls{inputencodingname}. If that command isn't defined or is empty,
\code{utf8} is assumed. As with \gls{languagename}, the input
\idx{encoding} name obtained with \gls{inputencodingname} may not match
the \app{xindy} \idx{codepage} name, which may include additional
information, such as \code{ij-as-ij} (with Dutch) or
\code{din5007} (with German).

Again, \app{makeglossaries} will try to adjust the \idx{codepage}
for known cases, but it may get it wrong.  Neither
\app{makeglossaries-lite} nor the \opt{automake} option will make
those adjustments.

If the default is incorrect, you can specify the correct \idx{codepage} using:
\cmddef{GlsSetXdyCodePage}
where \meta{code-page} is the name of the \idx{codepage}. Note there's only one
\idx{codepage} for all \idxpl{glossary} as it's rare to
switch \idx{encoding} mid-document.
For example:
\begin{codebox}
\gls{GlsSetXdyLanguage}\marg{dutch}
\gls{GlsSetXdyCodePage}\marg{ij-as-y-utf8}
\end{codebox}
This can also be implemented as a package option:
\begin{codebox}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{language}{dutch}},\styoptxdyval{codepage}{ij-as-y-utf8}]\marg{glossaries}
\end{codebox}

In the event that you want one \idx{glossary} sorted with
\code{ij-as-y} and another with \code{ij-as-ij} you will need to
call \app{xindy} explicitly for each \idx{glossary}.

\begin{important}
Some \app{xindy} modules only support one encoding for a particular
language. For example, the Latin language module only supports
\idx{utf8}
\end{important}

If you write your own custom \app{xindy} style file that 
includes the language settings, you need to set the language
to nothing:
\begin{codebox}
\gls{GlsSetXdyLanguage}\marg{}
\end{codebox}
(and remember to use \gls{noist} to prevent the style file from
being overwritten).

\section{Locations and Number lists}
\label{sec:xindyloc}

If you use \app{xindy}, the \sty{glossaries} package needs to
know which \idxc+{locationcounter}{counters} you will be using in the \idx{numberlist} 
in order to correctly format the \app{xindy} style
file. Counters specified using the \opt{counter} package option
or the \meta{counter} option of \gls{newglossary} are
automatically taken care of, but if you plan to use a different
counter in the \glsopt{counter} key for the \gls{glslike} or
\gls{glstextlike} commands,
then you need to identify these counters \emph{before} 
\gls{makeglossaries} using:
\cmddef{GlsAddXdyCounters}
where \meta{counter list} is a comma-separated list of counter names.

\Inlineidxdef{xindyattr} normally correspond to the \idx{encap} when
using the standard \gls{index} command where the \locations\ are all
page numbers, but the \sty{glossaries} package needs to
incorporate the \idx{locationcounter} as well. For example, if the
\encap{hyperbf} \idx{encap} is used with the \ctr{section} counter,
then the \idx{xindyattr} will be \code{sectionhyperbf}.
This is in contrast to using \app{makeindex}, where the counter is
incorporated in the \idx{encap} with \gls{setentrycounter}.

The most likely \idxpl+{xindyattr} (such as \code{pagehyperbf}) are
automatically added to the \ext{xdy} style file, but if you want to
use another \idx{encap}, you need to add it with:
\cmddef{GlsAddXdyAttribute}
where \meta{name} is the name of the \idx{encap}, as used in
the \glsopt{format} key. 

Note that \gls{GlsAddXdyAttribute} will define commands in the form:
\cmddef{glsXcounterXformat}
where \meta{counter} is the \idx{locationcounter} and \meta{format}
is the \idx{encap} (identified by the \meta{name} argument of
\gls{GlsAddXdyAttribute}).

This command is provided for each counter that has been identified either by the
\opt{counter} package option, the \meta{counter} option for
\gls{newglossary} or in the argument of \gls{GlsAddXdyCounters}.
Each command has a definition in the form:
\begin{compactcodebox}
\gls+{setentrycounter}\oargm{H-prefix}\margm{counter}\csmetafmt{}{format}{}\margm{location}
\end{compactcodebox}
This ensures that, if required, location \idxpl{hyperlink} can be
supported.

\begin{warning}
The \gls{glsXcounterXformat} commands may need redefining for
unusual \locations\ where the default definition won't work with \idxpl{hyperlink}
(see \exampleref{ex:dice}).
\end{warning}

Take care if you have multiple instances of the same \location\ with
different formats. The duplicate \locations\ will be discarded
according to the order in which the \idxc{xindyattr}{attributes} are listed. Consider
defining semantic commands to use for primary references. For
example:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{primary}}[1]\marg{\gls{hyperbf}\marg{\sym{hash}1}}
\gls{GlsAddXdyAttribute}\marg{primary}
\end{codebox}
Then in the document:
\begin{codebox}
A \gls{gls}\oarg{\glsoptval{format}{primary}}\marg{duck} is an aquatic bird.
There are lots of different types of \gls{gls}\marg{duck}.
\end{codebox}
This will give the \glsoptval{format}{primary} instance preference over
the next use that doesn't use the \glsopt{format} key.

\begin{example}{Custom Font for Displaying a Location}{ex:hyperbfit}
Suppose I want a bold, italic, hyperlinked location. I first need to define a
command that will do this:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{hyperbfit}}[1]\marg{\gls{textit}\marg{\gls{hyperbf}\marg{\sym{hash}1}}}
\end{codebox}
but with \app{xindy}, I also need to add this as an allowed
\idxc{xindyattr}{attribute}:
\begin{codebox}
\gls{GlsAddXdyAttribute}\marg{hyperbfit}
\end{codebox}
Now I can use it in the optional argument of commands like
\gls{gls}:
\begin{codebox}
Here is a \gls{gls}\oarg{\glsopt{format}{hyperbfit}}\marg{sample} entry.
\end{codebox}
(where \qt{sample} is the label of the required entry).
\end{example}

\begin{important}
Note that \gls{GlsAddXdyAttribute} has no effect if \gls{noist} is
used or if \gls{makeglossaries} is omitted.
\gls{GlsAddXdyAttribute} must be used before \gls{makeglossaries}.
Additionally, \gls{GlsAddXdyCounters} must come before
\gls{GlsAddXdyAttribute}.
\end{important}


If the \locations\ include robust or protected formatting commands, then
you need to add a location style using the appropriate \app{xindy}
syntax using:
\cmddef{GlsAddXdyLocation}
where \meta{name} is the name of the location style and \meta{definition} is
the \app{xindy} definition. The optional argument \meta{H-prefix}
is needed if \gls{theHcounter} either isn't defined or is
different from \gls{thecounter}.
Be sure to also read \sectionref{sec:locationsyntax} for some issues
that you may encounter.

\begin{important}
Note that \gls{GlsAddXdyLocation} has no effect if \gls{noist} is
used or if \gls{makeglossaries} is omitted.
\gls{GlsAddXdyLocation} must be used before \gls{makeglossaries}.
\end{important}

\begin{example}{Custom Numbering System for Locations}{ex:customloc}
Suppose I decide to use a somewhat eccentric numbering
system for sections where I redefine \thecounter{section} as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{section}}\marg{[\thecounter{chapter}]\gls{arabic}\marg{\ctr{section}}}
\end{codebox}
If I haven't used the package option \optval{counter}{section},
then I need to specify that the \ctr{section} counter will be used as a
\idx{locationcounter}:
\begin{codebox}
\gls{GlsAddXdyCounters}\marg{\ctr{section}}
\end{codebox}
Next I need to add the location syntax:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{section}\marg{:sep "[" "arabic-numbers" :sep "]"
  "arabic-numbers"
}
\end{codebox}
This assumes that \thecounter{chapter} is defined as
\code{\gls{arabic}\marg{\ctr{chapter}}}.

Note that if I have further decided to use the \sty{hyperref}
package and want to redefine \theHcounter{section} as:
\begin{codebox}
\cmd{renewcommand}*\marg{\theHcounter{section}}\marg{\thecounter{part}.\thecounter{section}}
\cmd{renewcommand}*\marg{\thecounter{part}}\marg{\gls{Roman}\marg{\ctr{part}}}
\end{codebox}
then I need to modify the \gls{GlsAddXdyLocation} code above to:
\begin{codebox}
\gls{GlsAddXdyLocation}\oarg{"roman-numbers-uppercase"}\marg{section}\marg{:sep "[" 
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
Since \gls{Roman} will result in an empty string if the counter is
zero, it's a good idea to add an extra location to catch this:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{zero.section}\marg{:sep "[" 
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
This example is illustrated in the sample file
\samplefile{xdy2}.
\end{example}

\begin{example}{Locations as Dice}{ex:dice}
This example will cause \app{xindy} special characters to appear in
the \location, which means that location escaping will need to be
enabled:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{xindy},\opt+{esclocations}}\marg{glossaries}
\gls+{glswrallowprimitivemodstrue}
\end{codebox}

Suppose I want a rather eccentric page numbering system that's
represented by the number of dots on dice. The \sty{stix} package
provides \gls{dicei}, \glsaddeach{diceii,diceiii,diceiv,dicev}\ldots, 
\gls{dicevi} that represent the six
sides of a die. I can define a command that takes a number as its
argument. If the number is less than seven, the appropriate
\csmetafmt{dice}{n}{} command is used otherwise it does \gls{dicevi} the
required number of times with the leftover in a final
\csmetafmt{dice}{n}{}. For example, the number 16 is represented by
\code{\gls{dicevi}\gls{dicevi}\gls{diceiv}} ($6+6+4=16$). I've called this command
\cmd{tallynum} to match the example given earlier in 
\sectionref{sec:locationsyntax}:
\begin{codebox}
\cmd{newrobustcmd}\marg{\cmd{tallynum}}[1]\marg{\comment{}
 \cmd{ifnum}\cmd{number}\sym{hash}1<7
  \$\cmd{csname} dice\cmd{romannumeral}\sym{hash}1\cmd{endcsname}\$\comment{}
 \cmd{else}
  \$\gls{dicevi}\$\comment{}
  \cmd{expandafter}\cmd{tallynum}\cmd{expandafter}\marg{\cmd{numexpr}\sym{hash}1-6}\comment{}
 \cmd{fi}
}
\end{codebox}
Here's the counter command:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{tally}}[1]\marg{\cmd{tallynum}\marg{\gls{arabic}\marg{\sym{hash}1}}}
\end{codebox}
The \ctr{page} counter representation (\thecounter{page}) needs to be
changed to use this command:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{page}}\marg{\cmd{tally}\marg{\ctr{page}}}
\end{codebox}
The \cmd{tally} command expands to \code{\cmd{tallynum} \marg{number}} so
this needs a location class that \emph{exactly} matches this format:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{tally}\marg{\comment{}
 :sep "\cmd{string}\cmd{tallynum}\gls{space}\gls{glsopenbrace}"
 "arabic-numbers"
 :sep "\gls{glsclosebrace}"
}
\end{codebox}
The space between \cmd{tallynum} and \marg{number} is
significant to \app{xindy} so \gls{space} is required.

The sample file \samplefile{xdy}, which comes with the \sty{glossaries}
package, uses the default \ctr{page} counter for \locations, and it
uses the default \gls{glsnumberformat} and a custom \cmd{hyperbfit}
format. A new \app{xindy} location called \qt{tallynum}, as
illustrated above, is defined to make the page numbers appear as
dice. In order for the location numbers to
hyperlink to the relevant pages, I~need to redefine the necessary
\gls{glsXcounterXformat} commands:
\begin{codebox}
\cmd{renewcommand}\marg{\cmd{glsXpageXglsnumberformat}}[2]\marg{\comment{}
 \cmd{linkpagenumber}\sym{hash}2\comment{}
}
\codepar
\cmd{renewcommand}\marg{\cmd{glsXpageXhyperbfit}}[2]\marg{\comment{}
 \gls{textbf}\marg{\cmd{em}\cmd{linkpagenumber}\sym{hash}2}\comment{}
}
\codepar
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[2]\marg{\gls{hyperlink}\marg{page.\sym{hash}2}\marg{\sym{hash}1\marg{\sym{hash}2}}}
\end{codebox}
Note that the second argument of \cmd{glsXpageXglsnumberformat} is
in the form \code{\cmd{tallynum}\margm{number}} so the line
\begin{codebox}
 \cmd{linkpagenumber}\sym{hash}2\comment{}
\end{codebox}
does
\begin{codebox}
 \cmd{linkpagenumber}\cmd{tallynum}\margm{number}
\end{codebox}
so \cmd{tallynum} is the first argument of \cmd{linkpagenumber}
and \meta{number} is the second argument.
\end{example}

\begin{important}
This method is very sensitive to the internal definition of the
location command. If you are defining your own command, you control
how it expands, but if you are using a command provided by another
package, be aware that it may stop working in a future version of
that package.
\end{important}

\begin{example}{Locations as Words not Digits}{ex:fmtcount}
This example will cause \app{xindy} special characters to appear in
the \location, which means that location escaping will need to be
enabled:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{xindy},\opt+{esclocations}}\marg{glossaries}
\gls+{glswrallowprimitivemodstrue}
\end{codebox}

Suppose I want the page numbers written as words
rather than digits and I~use the \sty{fmtcount} package to
do this. I~can redefine \gls{thepage} as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{thepage}}\marg{\gls{Numberstring}\marg{\ctr{page}}}
\end{codebox}
This \emph{used} to get expanded to 
\begin{compactcodebox}
\cmd{protect} \cmd{Numberstringnum} \margm{n}
\end{compactcodebox}
where \meta{n} is the Arabic page number. This means that I~needed to
define a new location with the form:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{Numberstring}\marg{:sep "\cmd{string}\cmd{protect}\gls{space}
  \cmd{string}\cmd{Numberstringnum}\gls{space}\gls{glsopenbrace}"
  "arabic-numbers" :sep "\gls{glsclosebrace}"}
\end{codebox}
and if I'd used the \cmd{linkpagenumber} command from the previous
example, it would need \emph{three} arguments (the first being
\cmd{protect}):
\begin{codebox}
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[3]\marg{\gls{hyperlink}\marg{page.\sym{hash}3}\marg{\sym{hash}1\sym{hash}2\marg{\sym{hash}3}}}
\end{codebox}

The internal definition of \gls{Numberstring} has since changed
so that it now expands to 
\begin{compactcodebox}
\cmd{Numberstringnum} \margm{n}
\end{compactcodebox}
(no \cmd{protect}). This means that the location class definition
must be changed to:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{Numberstring}\marg{\comment{no \cmd{protect} now!}
  :sep "\cmd{string}\cmd{Numberstringnum}\gls{space}\gls{glsopenbrace}"
  "arabic-numbers" :sep "\gls{glsclosebrace}"}
\end{codebox}
and \cmd{linkpagenumber} goes back to only two arguments:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[2]\marg{\gls{hyperlink}\marg{page.\sym{hash}2}\marg{\sym{hash}1\marg{\sym{hash}2}}}
\end{codebox}
The other change is that \gls{Numberstring} uses
\begin{compactcodebox}
\cmd{the}\cmd{value}\margm{counter}
\end{compactcodebox}
instead of
\begin{compactcodebox}
\cmd{expandafter}\cmd{the}\cmd{csname} c@\meta{counter}\cmd{endcsname}
\end{compactcodebox}
so it hides \cmd{c@page} from the location escaping mechanism 
(see \sectionref{sec:locationsyntax}). This means that the page
number may be incorrect if the \idx{indexing} occurs during the output
routine.

A more recent change to \sty{fmtcount} (v3.03) now puts three
instances of \cmd{expandafter} before \code{\cmd{the}\cmd{value}} which
no longer hides \cmd{c@page} from the location escaping mechanism, so
the page numbers should once more be correct. Further changes
to the \sty{fmtcount} package may cause a problem again.

\begin{important}
When dealing with custom formats where the internal definitions
are outside of your control and liable to change, it's best
to provide a wrapper command.
\end{important}

Instead of directly using \gls{Numberstring} in the definition of
\gls{thepage}, I can provide a custom command in the same form
as the earlier \cmd{tally} command:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{customfmt}}[1]\marg{\cmd{customfmtnum}\marg{\gls{arabic}\marg{\sym{hash}1}}}
\cmd{newrobustcmd}\marg{\cmd{customfmtnum}}[1]\marg{\cmd{Numberstringnum}\marg{\sym{hash}1}}
\end{codebox}
This ensures that the location will always be written to
the indexing file in the form:
\begin{compactcodebox}
:locref "\gls{glsopenbrace}\gls{glsclosebrace}\gls{glsopenbrace}\cmd{string}\gls{cs.bsl}customfmtnum \margm{n}\gls{glsclosebrace}"
\end{compactcodebox}
So the location class can be defined as:
\begin{compactcodebox}
\gls{GlsAddXdyLocation}\marg{customfmt}\marg{
 :sep "\cmd{string}\cmd{customfmtnum}\gls{space}\gls{glsopenbrace}"
 "arabic-numbers" 
 :sep "\gls{glsclosebrace}"}
\end{compactcodebox}

The sample file
\samplefile{xdy3} illustrates this.
\end{example}

In the \idx{numberlist}, the \locations\ are sorted according to the list of
provided location classes. The default ordering is: 
\begin{enumerate}
\item \code{roman-page-numbers} (i, ii, \ldots);
\item \code{arabic-page-numbers} (1, 2, \ldots);
\item \code{arabic-section-numbers} (for example, 1.1 if the \idx{compositor} is a
full stop or 1-1 if the compositor is a hyphen);
\item \code{alpha-page-numbers} (a, b, \ldots);
\item \code{Roman-page-numbers} (I, II, \ldots);
\item \code{Alpha-page-numbers} (A, B, \ldots);
\item \code{Appendix-page-numbers} (for
example, A.1 if the Alpha compositor, see \gls{glsSetAlphaCompositor}, is a
full stop or A-1 if the Alpha \idx{compositor} is a hyphen);
\item user defined location names (as specified by 
\gls{GlsAddXdyLocation} in the order in which
they were defined);
\item \code{see} (cross-referenced entries).
\end{enumerate}

\begin{xtr}
With \sty{glossaries-extra} \code{seealso} is appended to the end of the
list.
\end{xtr}

This ordering can be changed using:
\cmddef{GlsSetXdyLocationClassOrder}
where each location name is delimited by double quote marks and
separated by white space. For example:
\begin{codebox}
\gls{GlsSetXdyLocationClassOrder}\marg{
  "arabic-page-numbers"
  "arabic-section-numbers"
  "roman-page-numbers"
  "Roman-page-numbers"
  "alpha-page-numbers"
  "Alpha-page-numbers"
  "Appendix-page-numbers"
  "see"
}
\end{codebox}
(Remember to add \code{"seealso"} if you're using \sty{glossaries-extra}.)

\begin{important}
Note that \gls{GlsSetXdyLocationClassOrder} has no effect if 
\gls{noist} is used or if \gls{makeglossaries} is omitted.
\gls{GlsSetXdyLocationClassOrder} must be used before 
\gls{makeglossaries}.
\end{important}

If a \idx{numberlist} 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:
\cmddef{GlsSetXdyMinRangeLength}
The \meta{value} may be the keyword \optfmt{none}, to indicate no 
\idx{range} formation, or a number.
For example:
\begin{codebox}
\gls{GlsSetXdyMinRangeLength}\marg{3}
\end{codebox}
See the \app{xindy} manual for further details on \idx{range} formations.

\begin{important}
Note that \gls{GlsSetXdyMinRangeLength} has no effect if \gls{noist}
is used or if \gls{makeglossaries} is omitted.
\gls{GlsSetXdyMinRangeLength} must be used before 
\gls{makeglossaries}.
\end{important}
See also \sectionref{sec:ranges}.

\section{Glossary Groups}
\label{sec:groups}

The \idx{glossary} is divided into \idxpl+{group} according to the first
letter of the sort key. The \sty{glossaries} package also adds
a number \idx{group} by default, unless you suppress it in the
\opt{xindy} package option. For example:
\begin{codebox*}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{glsnumbers}{false}}]\marg{glossaries}
\end{codebox*}
Any entry that doesn't go in one of the letter \idxpl{group} or the
number group is placed in the default group. If you want \app{xindy}
to sort the number group numerically (rather than by a string sort)
then you need to use \app{xindy}['s] \optfmt{numeric-sort} module:
\begin{codebox}
\gls{GlsAddXdyStyle}\marg{numeric-sort}
\end{codebox}

With the default \styoptxdyval{glsnumbers}{true}, the number group will be placed
before the \qt{A} letter group. This is done in the \code{define-letter-group}
block in the \ext{xdy} file:
\begin{compactcodebox}
(define-letter-group "glsnumbers"
   :prefixes ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
   :before "A")
\end{compactcodebox}

If you are not using a Roman alphabet, you need
to change this with:
\cmddef{GlsSetXdyFirstLetterAfterDigits}\marg{letter}
where \meta{letter} is the first letter of your alphabet. 
This will change \code{:before "A"} to \code{:before "\meta{letter}"}.

A starred version of this command was added to v4.33 which sanitized \meta{letter}
before writing it to the \ext{xdy} file to protect it from expansion
with \sty{inputenc}. This shouldn't be necessary with recent \LaTeX\
kernels.

Alternatively you can use:
\cmddef{GlsSetXdyNumberGroupOrder}
This will change \code{:before "A"} to \meta{relative location}.
Again, a starred version was provided to sanitize the argument, which
should no longer be necessary unless \idx{sym.dblquote} is active.

For example:
\begin{codebox}
\gls{GlsSetXdyNumberGroupOrder}\marg{:after "Z"}
\end{codebox}
will put the number group after the \qt{Z} letter group.

\begin{important}
Note that these commands have no effect if 
\gls{noist} is used or if \gls{makeglossaries} is omitted.
\gls{GlsSetXdyFirstLetterAfterDigits} must be used before 
\gls{makeglossaries}.
\end{important}

\glsendrange{app.xindy,ext.xdy}

\chapter{Utilities}
\label{sec:utilities}

This section describes the utility commands provided with the base
\sty{glossaries} package.

\begin{xtr}
The \sty{glossaries-extra} package provides extra utility commands,
such as \gls{glsxtrusefield} and \gls{glsxtrfieldformatlist}.
See the \sty{glossaries-extra} manual for further details.
\end{xtr}

\section{\stytext{hyperref}}
\label{sec:hyperref}

The \sty{hyperref} package needs to be loaded before
\sty{glossaries} to ensure that the commands provided by
\sty{hyperref} are only used if they have been defined.

\cmddef{glsdisablehyper}
This disables the creation of \idxpl+{hyperlink} and targets by
commands such as \gls{glshyperlink}, the \gls{glslike} and
\gls{glstextlike} commands and \gls{glstarget}. This setting is the
default if \sty{hyperref} hasn't been loaded.

The commands that normally create a \idx{hyperlink} will use:
\cmddef{glsdonohyperlink}

The internal command used by \gls{glstarget} to create a target is just set to
\cmd{@secondoftwo}.

\cmddef{glsenablehyper}
This enables the creation of \idxpl+{hyperlink} and targets, and is
the default if \sty{hyperref} has been loaded.

The internal command used by \gls{glstarget} to create a target is
set to:
\cmddef{glsdohypertarget}
This will include the debugging information if \opteqvalref{debug}{showtargets}
has been used, but also measures the height of \meta{text} so that
it can place the actual target at the top of \meta{text} rather than
along the baseline. This helps to prevent \meta{text} from scrolling
off the top of the page out of sight.

The corresponding command that's used to link to this target is:
\cmddef{glsdohyperlink}
This includes the debugging information, if applicable, and creates
a link with \gls{hyperlink}.

Both the above target and link commands have a corresponding hook that does
nothing by default. These commands are not used if hyperlinks have been 
disabled (or if \sty{hyperref} has not been loaded).
\cmddef{glsdohypertargethook}
This hook occurs after the height of the \meta{text} has been measured and
before the target is inserted.

\cmddef{glsdohyperlinkhook}
This hook occurs immediately before the link is created with \gls{hyperlink}.

\cmddef{glslabelhypertarget}
This command is provided for use in \gls{glsdohypertargethook} and will simulate
a label corresponding to the target. It's primarily intended for use with 
\gls{pageref} rather than \gls{ref} as there is no corresponding counter
to provide a numeric value. It is an alternative to using the \opt{entrycounter}
option. The label is given by \code{\meta{prefix}\meta{target}}, where the
\meta{prefix} is obtained by expanding:
\cmddef{glslabelhypertargetprefix}
The target \meta{text} will be the title corresponding to the label (which
can be referenced with \gls{nameref}). Since there is no numeric value, 
the text obtained with \gls{ref} will either be empty or the name of the most recent
entry in the glossary list where the hypertarget occurs.
For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsdohypertargethook}}[2]\marg{\gls{glslabelhypertarget}\marg{\#1}\marg{\#2}}
\end{codebox}
Certain commands that may occur in the \meta{text} argument, such as
\gls{glossentryname}, are locally redefined during the protected write
to the \ext{aux} file. These redefinitions are performed by:
\cmddef{glslabelhypertargetdefs}
You can append any additional redefinitions of problematic commands to this 
hook.

The \qt{value} part of the label (that is, the text produced with \gls{ref}) is
obtained by expanding:
\cmddef{glslabelhypertargetvalue}
The default definition expands
\begin{compactcodebox}
\gls{glsentryname}\gls{glscurrententrylabel}
\end{compactcodebox}
if \gls{glscurrententrylabel} is defined and not empty. Otherwise it expands to nothing.

\cmddef{glstexorpdfstring}
If you're not sure whether or not the \sty{hyperref} package will be
loaded, this command will use \gls{texorpdfstring} if
that command has been defined, otherwise it will simply expand to
\meta{\TeX}.


\section{Case-Changing}
\label{sec:casechanging}

These commands may be used to perform a \idx+{casechange}.

\begin{important}
Ensure you have at least \sty{mfirstuc} v2.08 installed to take
advantage of improved case-changing. If you also use
\sty{glossaries-extra}, make sure you have at least v1.49.
See the \sty{mfirstuc} manual for further details.
\end{important}

\cmddef{glsuppercase}

An expandable command that converts \meta{text} to 
\idx+{uppercase} (\idx+{allcaps}).
This is used by commands such as \gls{GLS} and \gls{GLStext} and is affected by
\gls{glsmfuexcl}.

\cmddef{glslowercase}

An expandable command that converts \meta{text} to \idx+{lowercase}.
This isn't used by the \sty{glossaries} package, but you may find it
useful with \idx{acronym} or \idx{abbreviation} font commands for
\idx{smallcaps} styles. This command is affected by
\gls{glsmfuexcl}.

\cmddef{MFUsentencecase}

This command is used by \idx+{sentencecase} commands, such as
\gls{Glsentrytext}, when expanding in a \idx{PDFbookmark}.

This command is actually defined by \sty{mfirstuc} v2.08+, but if an
old version of \sty{mfirstuc} is installed, the \sty{glossaries}
package will provide the same command. This command is affected by
\gls{glsmfuexcl}.

\cmddef{glssentencecase}

Converts \meta{text} to \idx+{sentencecase}. This is used by
commands such as \gls{Gls} and \gls{Glstext}, and also by commands
like \gls{Glsentrytext} in the document text.

The default definition is to use the robust \gls{makefirstuc}
provided by the \sty{mfirstuc} package.  If you need an expandable
command, use \gls{MFUsentencecase} instead.

Note that \gls{makefirstuc} internally uses \gls{glsmakefirstuc},
which is provided by \sty{mfirstuc}. The default definition is:
\begin{compactcodebox}
\cmd{newcommand}*\marg{\gls{glsmakefirstuc}}[1]\marg{\gls{MFUsentencecase}\marg{\cmd{unexpanded}\marg{\sym{hash}1}}}
\end{compactcodebox}
The \optval{mfirstuc}{expanded} package option will redefine this
command without \cmd{unexpanded}.

The reason for the use of \cmd{unexpanded} is mostly a
backward-compatibility feature, as without it there is now the
possibility for fragile commands to expand prematurely and cause an
error.

This is because the \LaTeX3 kernel command used by
\gls{MFUsentencecase} expands its argument before applying the
\idx{casechange}. With previous versions of \sty{mfirstuc},
\gls{glsmakefirstuc} would simply apply the \idx{casechange} to the
first token.

Suppose a document created with \sty{mfirstuc} v2.07 had something
like:
\begin{compactcodebox}
\gls{newglossaryentry}\marg{sample}\marg{
  \gloskeyval{name}{sample},
  \gloskeyval{description}{an example with a \cmd{fragilecommand}}
}
\end{compactcodebox}
and a \idx{glossarystyle} is used that performs automated
sentence-casing for the description (for example, with the
\glostyle{topic} style, provided by \sty{glossaries-extra}), then
this would essentially do:
\begin{compactcodebox}
\gls{makefirstuc}\marg{an example with a \cmd{fragilecommand}}
\end{compactcodebox}
With old versions of \sty{mfirstuc}, this would simply end up as:
\begin{compactcodebox}
\gls{MakeTextUppercase}{a}n example with a \cmd{fragilecommand}
\end{compactcodebox}
so the fragile command is unaffected.

However, with \sty{mfirstuc} v2.08 and \optval{mfirstuc}{expanded}
this would end up as:
\begin{compactcodebox}
\gls{MFUsentencecase}{an example with a \cmd{fragilecommand}}
\end{compactcodebox}
and the underlying \cmd{text\_titlecase\_first:n} will expand the
entire argument, which will break the fragile command.

The use of \cmd{unexpanded} prevents this from happening, but if you
don't have fragile commands and you want the content to be expanded,
then use \optval{mfirstuc}{expanded}.

\cmddef{glscapitalisewords}

Converts \meta{text} to \idx+{titlecase}. The default definition is
to use the robust \gls{capitalisewords} provided by \sty{mfirstuc}.
You may need to redefine this command to use \gls{capitalisefmtwords}
instead.

\cmddef{glsmfuexcl}

This uses \gls{MFUexcl} with \sty{mfirstuc} v2.08+, otherwise its defined in the
same way (so it won't affect \gls{makefirstuc} but will affect
commands like \gls{glsuppercase}).

\cmddef{glsmfublocker}

This uses \gls{MFUblocker} with \sty{mfirstuc} v2.08+, otherwise it simply uses
\gls{glsmfuexcl}.

\cmddef{glsmfuaddmap}

This uses \gls{MFUaddmap} with \sty{mfirstuc} v2.08+, otherwise it
simply does
\begin{compactcodebox}
\gls{glsmfuexcl}\margm{cs}
\gls{glsmfublocker}\margm{Cs}
\end{compactcodebox}

This uses \gls{MFUblocker} if defined, otherwise it simply uses
\gls{glsmfuexcl}.


\section{Loops}
\label{sec:loops}

\begin{important}
Some of the commands described here take a comma-separated list as
an argument. As with \LaTeX's \gls{@for} command, make sure your list
doesn't have any unwanted spaces in it as they don't get stripped.
(Discussed in more detail in
\dickimawhref{latex/admin/html/docsvlist.shtml\#spacesinlists}{\S2.7.2 of \qt{\LaTeX\ for Administrative
Work}}.)
\end{important}

\cmddef{forallglossaries}
This iterates through \meta{types}, a comma-separated list of
\idx+{glossary} labels (as supplied when the glossary was defined).
At each iteration the command \meta{cs} is defined to the
\idx{glossary} label for the current iteration and \meta{body} is
performed. If \meta{types} is omitted, the default is to iterate
over all non-\idxpl{ignoredglossary}.

\cmddef{forallacronyms}
This is like \gls{forallglossaries} but only iterates over the
lists of \idxpl{acronym} (that have previously been declared using
\gls{DeclareAcronymList} or the \opt{acronymlists} package
option). This command doesn't have an optional argument. If you want
to explicitly say which lists to iterate over, just use the optional
argument of \gls{forallglossaries}.

\begin{xtr}
The \sty{glossaries-extra} package provides an analogous command
\gls{forallabbreviationlists}.
\end{xtr}

\cmddef{forglsentries}
This iterates through all \idxpl{entry} in the \idx{glossary} given by
\meta{type}. At each iteration the command \meta{cs} is defined 
to the entry label for the current
iteration and \meta{body} is performed. If \meta{type} is
omitted, \gls{glsdefaulttype} is used.

\cmddef{forallglsentries}
This is just a nested loop that essentially does:
\begin{compactcodebox}
\gls{forallglossaries}\oargm{types}\margm{type-cs}\margm{\comment{outer loop}
  \gls{forglsentries}\oargm{type-cs}\margm{cs}\margm{body}\comment{inner loop}
}
\end{compactcodebox}
If \meta{types} is omitted, the default is the list of all non-\idxpl{ignoredglossary}.
(The current glossary label can be obtained using 
\code{\gls{glsentrytype}\margm{cs}} within \meta{body}.)

\begin{xtr}
The \sty{glossaries-extra} package provides commands like \gls{glsxtrforcsvfield}
to iterate over any fields that contain comma-separated lists.
\end{xtr}

\section{Conditionals}
\label{sec:conditionals}

\begin{xtr}
The \sty{glossaries-extra} package provides many more conditional
commands.
\end{xtr}

\cmddef{ifglossaryexists}

This checks if the \idx{glossary} given by \meta{glossary-type} 
exists (that is, if it has been defined). If it does exist \meta{true part} 
is performed, otherwise \meta{false part}.

The unstarred form will treat \idxpl{ignoredglossary} as
non-existent. The starred form will consider them as existing.
So both forms will do \meta{true} if \meta{glossary-type} was
defined by \gls{newglossary}, but only the starred form will do
\meta{true} if \meta{glossary-type} was defined with
\gls{newignoredglossary}.

For example, given:
\begin{codebox}
\gls{newignoredglossary}\marg{common}
\end{codebox}
then
\begin{codebox}
\gls{ifglossaryexists}\marg{common}\marg{true}\marg{false}
\gls{ifglossaryexists}*\marg{common}\marg{true}\marg{false}
\end{codebox}
will produce \qt{false true}.

\cmddef{ifglsentryexists}

This checks if the \idx{glossaryentry} given by \meta{entry-label} exists. If it
does exist then \meta{true} is performed, otherwise this does \meta{false}.
Simply uses \sty{etoolbox}['s] \gls{ifcsundef} so can expand.

\cmddef{glsdoifexists}
Does \meta{code} if the entry given by \meta{entry-label} exists. If it
doesn't exist, an undefined error is generated.

\cmddef{glsdoifnoexists}
Does \meta{code} if the entry given by \meta{entry-label} doesn't exist. If it
does exist, an already defined error is generated.

\cmddef{glsdoifexistsorwarn}
As \gls{glsdoifexists} but issues a warning rather than an error if
the entry doesn't exist.

\cmddef{glsdoifexistsordo}
Does \meta{code} if the entry given by \meta{entry-label} exists otherwise
it generates an undefined error and does \meta{else code}.

\begin{xtr}
The undefined\slash already defined errors can be converted to warnings 
with \optval{undefaction}{warn}.
\end{xtr}

\cmddef{ifglsused}

Tests the entry's \idx+{firstuseflag}.  If the \idx{entry} has been
used, \meta{true} will be done, otherwise (if the \idx{entry} has
been defined) \meta{false} will be done.  If the \idx{entry} isn't
defined, then an undefined error will occur and neither \meta{true} nor
\meta{false} will be done (see \sectionref{sec:glsunset}).

This means that \gls{ifglsused} is unreliable with \app{bib2gls} as
no \idxpl{entry} are defined on the first \LaTeX\ run, which means there's no
way of determining if it has been used, so
\sty{glossaries-extra} provides a similar command:
\cmddef{GlsXtrIfUnusedOrUndefined}
In this case, \meta{true} will be done if the entry hasn't been
used or hasn't been defined, which is essentially the logical
negation of \gls{ifglsused} for defined \idxpl{entry}.

\begin{important}
Some of the following \csmetafmt{ifglshas}{xxx}{} commands use
\gls{glsdoifexists}. In those cases, the \meta{true} or \meta{false} parts are only
performed if the entry exists. Neither are done if the entry doesn't
exist.
\end{important}

\cmddef{ifglshaschildren}

This does \meta{true} if any \idxpl{entry} in the same \idx{glossary}
as \meta{entry-label} had \gloskeyval{parent}{\meta{entry-label}}.
This is inefficient and time-consuming if there are a large number
of entries defined. Uses \gls{glsdoifexists}.

\begin{bib2gls}
If you use \app{bib2gls}, a more efficient method is to use the
\resourceopt{save-child-count} resource option and test the value of
the \glosfield{childcount} field with \gls{GlsXtrIfHasNonZeroChildCount}.
\end{bib2gls}

\cmddef{ifglshasparent}

This does \meta{true} if the \gloskey+{parent} field is non-empty
for the entry identified by \meta{entry-label}. Uses \gls{glsdoifexists}.

\cmddef{ifglshassymbol}

A robust command that does \meta{true} if the \gloskey+{symbol} field is non-empty
and not \gls{relax} for the entry identified by \meta{entry-label}.

\cmddef{ifglshaslong}

A robust command that does \meta{true} if the \gloskey+{long} field is non-empty
and not \gls{relax} for the entry identified by \meta{entry-label}.

\cmddef{ifglshasshort}

A robust command that does \meta{true} if the \gloskey+{short} field is non-empty
and not \gls{relax} for the entry identified by \meta{entry-label}.

\cmddef{ifglshasdesc}

Expands to \meta{true} if the \gloskey{description} is empty for the
entry identified by \meta{entry-label}, otherwise expands to
\meta{false}. Compare with:
\cmddef{ifglsdescsuppressed}
This expands to \meta{true} if \gloskeyval{description}{\gls{nopostdesc}}
for the entry identified by \meta{entry-label}
otherwise expands to \meta{false}.

There are also commands available for arbitrary fields. Some may
allow the field to be identified by its corresponding key (such as
\gloskey{description}) but some require the \idx{internalfieldlabel}
(such as \glosfield{desc}). See \tableref{tab:fieldmap} for the
\idxpl{internalfieldlabel} that correspond to each key. If you
provide your own keys, for example with \gls{glsaddkey}, then the
internal label will be the same as the key.

\cmddef{ifglsfieldvoid}
Expands to \meta{true} if the field identified by its
\idx{internalfieldlabel} \meta{field-label} is void for the entry
identified by \meta{entry-label}, otherwise it expands to
\meta{false}. The void test is performed with \sty{etoolbox}['s]
\gls{ifcsvoid}. This means that an undefined field or an undefined
entry will be considered void. An empty field value or a field set
to \gls{relax} are also considered void.

\cmddef{ifglshasfield}

This robust command tests the value of the field given by
\meta{field} for the entry identified by \meta{entry-label}. 
The \meta{field} argument may either be the key associated with the
field or the \idx{internalfieldlabel}.

If the field value is empty or \gls{relax}, then \meta{false} is
performed, otherwise \meta{true} is performed. If the field supplied
is unrecognised \meta{false part} is performed and a warning is
issued. If the entry is undefined, an undefined error occurs.

Within \meta{true}, you can access the field's value with:
\cmddef{glscurrentfieldvalue}
This command is initially defined to empty but has
no relevance outside of the \meta{true} argument. This saves re-accessing the
field if the test is true. For example:
\begin{codebox}
\gls{ifglshasfield}\marg{useri}\marg{sample}\marg{, \gls{glscurrentfieldvalue}}\marg{}
\end{codebox}
will insert a comma, space and the field value if the
\gloskey{user1} key has been set for
the entry whose label is \qt{sample}.

\cmddef{ifglsfieldeq}
This robust command does \meta{true} if the entry identified by
\meta{entry-label} has the field identified by its
\idx{internalfieldlabel} (not the key) \meta{field-label} defined and set to
the given \meta{string}. The test is performed by \sty{etoolbox}['s]
\gls{ifcsstring}. An error will occur if the field value is
undefined or if the entry hasn't been defined.

The result may vary depending on whether or not expansion was on for
the given field when the entry was defined (see \sectionref{sec:expansion}).
For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},\gloskeyval{description}{an example},
\gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},\gloskeyval{description}{an example},
\gloskeyval{user1}{\cmd{foo}}}
\cbeg{document}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
This will produce \qt{TRUE} in both cases since expansion is on for
the \gloskey{user1} key, so
\cmd{foo} was expanded to \qt{FOO} when \qt{sample2} was defined.
If the tests are changed to:
\begin{codebox}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\end{codebox}
then this will produce \qt{FALSE} in both cases. Now suppose
expansion is switched off for the \gloskey{user1} key:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{glssetnoexpandfield}\marg{\glosfield{useri}}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},\gloskeyval{description}{an example},
\gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},\gloskeyval{description}{an example},
\gloskeyval{user1}{\cmd{foo}}}
\cbeg{document}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
This now produces \qt{TRUE} for the first case (comparing \qt{FOO}
with \qt{FOO}) and \qt{FALSE} for the second case (comparing
\qt{\cmd{foo}} with \qt{FOO}).

The reverse happens in the following:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{glssetnoexpandfield}\marg{\glosfield{useri}}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},\gloskeyval{description}{an example},
\gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},\gloskeyval{description}{an example},
\gloskeyval{user1}{\cmd{foo}}}
\cbeg{document}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
This now produces \qt{FALSE} for the first case (comparing \qt{FOO}
with \qt{\cmd{foo}}) and \qt{TRUE} for the second case (comparing
\qt{\cmd{foo}} with \qt{\cmd{foo}}).

You can test if the value of a field is equal to the replacement
text of a command using:
\cmddef{ifglsfielddefeq}
This robust command is essentially like \gls{ifglsfieldeq} but
internally uses \sty{etoolbox}'s \gls{ifdefstrequal} command to
perform the comparison. The argument \meta{cs} argument must be a macro.

For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{glssetnoexpandfield}\marg{\glosfield{useri}}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},\gloskeyval{description}{an example},
\gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},\gloskeyval{description}{an example},
\gloskeyval{user1}{\cmd{foo}}}
\codepar
\cbeg{document}
\gls{ifglsfielddefeq}\marg{sample1}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfielddefeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
Here, the first case produces \qt{TRUE} since the value of the
\glosfield{useri} field (\qt{FOO}) is the same as the replacement text
(definition) of \cmd{foo} (\qt{FOO}). We have the result
\qt{\code{FOO}} is equal to \qt{\code{FOO}}.

The second case produces \qt{FALSE} since the value of the
\glosfield{useri} field (\qt{\cmd{foo}}) is not the same as the replacement
text (definition) of \cmd{foo} (\qt{FOO}). No expansion has been
performed on the value of the \glosfield{useri} field. We have the
result \qt{\cmd{foo}} is not equal to \qt{\code{FOO}}.

If we add:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{FOO}}\marg{\cmd{foo}}
\gls{ifglsfielddefeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{FOO}}\marg{TRUE}\marg{FALSE}.
\end{codebox}
we now get \qt{TRUE} since the value of the
\glosfield{useri} field (\qt{\cmd{foo}}) is the same as the replacement
text (definition) of \cmd{FOO} (\qt{\cmd{foo}}). We have the result
\qt{\cmd{foo}} is equal to \qt{\cmd{foo}}.

There is a similar command that requires the control sequence name
(without the leading backslash) instead of the actual control sequence:
\cmddef{ifglsfieldcseq}
This robust command is like {ifglsfielddefeq}
but internally uses \sty{etoolbox}'s \gls{ifcsstrequal} command
instead of \gls{ifdefstrequal}.

\section{Measuring}
\label{sec:measuring}

Sometimes it's necessary to measure the width or height of some
text. For example, \gls{glsdohypertarget} measures the height of the
supplied text to position the target at the top of the line instead
of at the baseline (where it can cause the line to scroll up out of
view). Some styles measure the width of text to assist with
alignment.

Measuring can be performed using \gls{settowidth}, \gls{settoheight}
and \gls{settodepth}, but if the content being measured contains any
\idx{glslike} or \idx{glstextlike} commands, or if it contains
commands like \gls{glsentryitem}, it can cause duplication.  (See
also \sectionref{sec:glsunset} for the problems this can cause with
unsetting and resetting the \idx{firstuseflag}.)

The following measuring commands locally disable \idx{indexing}, the
unset/reset commands, and \gls{label}, and adjust
\gls{refstepcounter} to only locally update the counter value.

\cmddef{glsmeasureheight}
Measures the height of \meta{text} and stores the result in the
supplied \meta{length} register.

\cmddef{glsmeasuredepth}
Measures the depth of \meta{text} and stores the result in the
supplied \meta{length} register.

\cmddef{glsmeasurewidth}
Measures the width of \meta{text} and stores the result in the
supplied \meta{length} register.

You can test if content is inside an area that's being measured
with:
\cmddef{glsifmeasuring}
This will do \meta{true} if it occurs inside either of the above
commands and does \meta{false} otherwise. This will also take
\sty{amsmath}['s] \cmd{ifmeasuring@} into account.

If \sty{tabularx} is loaded, its \cmd{TX@trial} command can be
patched with:
\cmddef{glspatchtabularx}
If you use \sty{tabularx} and have any of the \idx{glslike} commands
inside a \env{tabularx} environment, you will need to use
\gls{glspatchtabularx} in the \idx{documentpreamble} to disable
unset/reset while the environment measures its content.

\begin{warning}
Patches made on other package's internal commands may break if the
other package removes those commands or changes their definitions.
\end{warning}

\section{Fetching and Updating the Value of a Field}
\label{sec:fetchset}

In addition to the commands described in \sectionref{sec:glsnolink},
the commands described in this section may also be used to fetch field information.

\begin{xtr}
The \sty{glossaries-extra} package has additional commands, such as
\gls{glsxtrusefield}.
\end{xtr}

\cmddef{glsentrytype}
Expands to the value of the entry's \gloskey{type} field, which
is the label of the \idx{glossary} the entry has been assigned to. 
No existence check is performed.

\cmddef{glsentryparent}
Expands to the value of the entry's \gloskey{parent} field, 
which is the label identifying the entry's parent. No existence check is
performed.

\cmddef{glsentrysort}
Expands to the entry's \gloskey{sort} value. No existence check is performed.
This is not intended for general use, but can be useful to display
the value for debugging purposes. Note that there is also an
\idxc{internalfieldlabel}{internal field} \glosfield{sortvalue}
which contains the escaped sort value, which may not necessarily be
the same as the \gloskey{sort} value.

\cmddef{glsfieldfetch}\marg{label}\marg{field}\marg{cs}

This robust command fetches the value of the field identified by its
\idx{internalfieldlabel}\meta{field-label} for the \idx{entry}
identified by \meta{entry-label} and stores it in the
given command \meta{cs}. An error will occur if the entry doesn't
exist or if the field hasn't been defined.

\cmddef{glsletentryfield}

This command simply assigns the supplied command \meta{cs} to the
value of the field identified by its
\idx{internalfieldlabel}\meta{field-label} for the \idx{entry}
identified by \meta{entry-label}. This differs from
\gls{glsfieldfetch} in that it doesn't test for existence. If either
the field or the entry haven't been defined, no error or warning
will be trigger but \meta{cs} will be undefined. You can then use
\sty{etoolbox}['s] \gls{ifdef} or \gls{ifundef} on \meta{cs}.

For example, to store
the description for the entry whose label is \qt{apple} in the
control sequence \code{\cmd{tmp}}:
\begin{codebox}
\gls{glsletentryfield}\marg{\cmd{tmp}}\marg{apple}\marg{\glosfield{desc}}
\gls{ifdef}\marg{\cmd{tmp}}{description: \cmd{tmp}}\marg{no description}
\end{codebox}
An alternative is to use \gls{ifglshasfield} or, with
\sty{glossaries-extra}, \gls{glsxtrifhasfield}.

\cmddef{glsunexpandedfieldvalue}
This command is provided for use in expandable contexts where the
field value is required but the contents should not be expanded.
The \meta{field-label} argument must be the
\idx{internalfieldlabel}. Does nothing if the field or entry isn't
defined.

You can change the value of a given field using one of the following
commands. Note that these commands only change the value of the
given field. They have no affect on any related field. For example,
if you change the value of the \gloskey{text} field, it won't modify the
value given by the \gloskey{name}, \gloskey{plural}, \gloskey{first} 
or any other related key.

\begin{warning}
There are some fields that should only be set when the \idx{entry}
is defined and will cause unexpected results if changed later.  For
example, \gloskey{type} (which additionally needs to add the
\idx{entry}['s] label to the corresponding \idx{glossary}['s]
internal list), \gloskey{parent} (which needs to calculate the
\idx{hierarchicallevel} and setup the \idx{indexing} syntax
appropriately), and \gloskey{sort} (which may need pre-processing
and is required to setup the \idx{indexing} syntax).
\end{warning}

In all the four related commands below, \meta{entry-label}
identifies the entry and \meta{field-label} is the
\idx{internalfieldlabel}.  The \meta{definition} argument is the new
value of the field. Both the entry and field must already be
defined. If you want internal fields that don't require a
corresponding key to be defined, you will need the supplementary
commands provided by \sty{glossaries-extra}.

\cmddef{glsfielddef}
This robust command uses \gls{def} to change the value of the field (so it will be
localised by any grouping).

\cmddef{glsfieldedef}
This robust command uses \gls{protected@csedef} to change the value of the 
field (so it will be localised by any grouping).

\cmd{glsfieldgdef}
This uses \gls{gdef} to change the value of the field (so it will
have a global effect).

\cmddef{glsfieldxdef}
This robust command uses \gls{protected@csxdef} to change the value of the 
field (so it will be localised by any grouping).

\chapter{Prefixes or Determiners}\label{sec:prefix}

\pkgdef{glossaries-prefix}

The \sty{glossaries-prefix} package that comes with the
\sty{glossaries} package provides additional keys that can be used
as prefixes. For example, if you want to specify determiners (such
as \qt{a}, \qt{an} or \qt{the}). The \sty{glossaries-prefix} package
automatically loads the \sty{glossaries} package and has the same
package options.

\begin{xtr}
The \sty{glossaries-prefix} package can automatically be loaded 
with \sty{glossaries-extra} via the \opt{prefix} package option.
\end{xtr}

The extra keys for \gls{newglossaryentry} are as follows:

\optiondef{gloskey.prefix}

The prefix associated with the \gloskey{text} key. This defaults to nothing.

\optiondef{gloskey.prefixplural}

The prefix associated with the \gloskey{plural} key. This defaults to nothing.

\optiondef{gloskey.prefixfirst}

The prefix associated with the \gloskey{first} key. If omitted, this
defaults to the value of the \gloskey{prefix} key.

\optiondef{gloskey.prefixfirstplural}

The prefix associated with the \gloskey{firstplural} key. If
omitted, this defaults to the value of the \gloskey{prefixplural}
key.

\begin{example}{Defining Determiners}{ex:determiners}
Here's the start of my example document:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\opt{toc},\opt{acronym}]\marg{glossaries-prefix}
\end{codebox}
Note that I've simply replaced \sty{glossaries} from previous
sample documents with \sty{glossaries-prefix}. Now for a sample
definition:
\begin{codebox*}
\gls{newglossaryentry}\marg{sample}\marg{\gloskey{name}{sample},
  \gloskeyval{description}{an example},
  \gloskeyval{prefix}{a\sym{nbsp}},
  \gloskeyval{prefixplural}{the\gls{space}}
}
\end{codebox*}
(Single letter words, such as \qt{a} and \qt{I}
should typically not appear at the end of a line, hence the
non-breakable space \sym{nbsp} after \qt{a} in the \gloskey{prefix} field.)

Note that I've had to explicitly insert a~space after the prefix
since there's no designated separator between the prefix and the
term being referenced. This not only means that you can vary between
a breaking space and non-breaking space, but also
allows for the possibility of prefixes that shouldn't have a~space, 
such as:
\begin{codebox}
\gls{newglossaryentry}\marg{oeil}\marg{\gloskeyval{name}{oeil},
  \gloskeyval{plural}{yeux},
  \gloskeyval{description}{eye},
  \gloskeyval{prefix}{l'},
  \gloskeyval{prefixplural}{les\gls{space}}}
\end{codebox}

\begin{important}
Where a space is required at the end of the prefix, you must use 
a~spacing command, such as \gls{space}, \gls{cs.sp} (backslash space) or
\sym{nbsp} due to the automatic spacing trimming performed in
\keyval\ options.
\end{important}

In the event that you always require a space between the prefix and
the term, then you can instead redefine \gls{glsprefixsep}
to do a space. For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsprefixsep}}\marg{\gls{space}}
\end{codebox}

The prefixes can also be used with acronyms. For example:
\begin{codebox}
\gls{newacronym}
 \oarg{
   \gloskeyval{prefix}{an\gls{space}},\gloskeyval{prefixfirst}{a\sym{nbsp}}
 }\marg{svm}\marg{SVM}\marg{support vector machine}
\end{codebox}
\end{example}

The \sty{glossaries-prefix} package provides convenient commands to
use these prefixes with commands such as \gls{gls}. Note that the
prefix is not considered part of the \idx{linktext}, so it's not
included in the hyperlink (where hyperlinks are enabled). The
options and any star or plus modifier are passed on to the
appropriate \gls{glslike} command. (See \sectionref{sec:glslink} for
further details.)

\cmddef{glsprefixsep}
The separator used between the appropriate prefix and the
corresponding \gls{glslike} command.

Each of the following commands \csmetafmt{p}{gls}{} essentially does
\code{\meta{prefix}\gls{glsprefixsep}\meta{gls}} if the appropriate
prefix field has been set, otherwise it simply does \meta{gls},
where \meta{gls} is the corresponding \gls{glslike} command.

The \idx+{allcaps} commands \csmetafmt{P}{GLS}{} will convert the
prefix to \idx{allcaps} (using \gls{glsuppercase}) and use the
\idx{allcaps} \gls{glslike} counterpart.

The \idx+{sentencecase} commands \csmetafmt{P}{Gls}{} are slightly
more complicated. If the appropriate prefix field has been set, then
the prefix will have the \idx{casechange} applied and the non-case 
\gls{glslike} command will be used (\gls{gls} or \gls{glspl}).
If the appropriate prefix field hasn't been set, then the
\idx{sentencecase} \gls{glslike} command is used (\gls{Gls} or
\gls{Glspl}).

The usual \gls{glslike} optional argument and star (\sym{starmod})
and plus (\sym{plusmod}) modifiers can be used with these commands,
in which case they will be applied to the applicable \gls{glslike}
command.

\cmddef{pgls}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{gls}} if
\meta{prefix} is non-empty otherwise just uses \gls{gls}.

The \meta{prefix} will be the value of the \gloskey{prefixfirst} key on 
\idx+{firstuse} or the \gloskey{prefix} key on \idx+{subsequentuse}.

\cmddef{pglspl}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{glspl}} if
\meta{prefix} is non-empty otherwise just uses \gls{glspl}.

The \meta{prefix} will be the value of the
\gloskey{prefixfirstplural} key on \idx{firstuse} or the
\gloskey{prefixplural} key on \idx{subsequentuse}.

\cmddef{Pgls}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{gls}} if
\meta{prefix} is non-empty otherwise just uses \gls+{Gls}.

As \gls{pgls}, the prefix fields are \gloskey{prefixfirst} on 
\idx{firstuse} or the \gloskey{prefix} on \idx{subsequentuse}, but
the \meta{prefix} will now be obtained from the \idx{sentencecase}
commands \gls{Glsentryprefix} and \gls{Glsentryprefixfirst}.

\cmddef{Pglspl}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{glspl}} if
\meta{prefix} is non-empty otherwise just uses \gls+{Glspl}.

As \gls{pglspl}, the prefix fields are \gloskey{prefixfirstplural} on 
\idx{firstuse} or the \gloskey{prefixplural} on \idx{subsequentuse}, but
the \meta{prefix} will now be obtained from the \idx{sentencecase}
commands \gls{Glsentryprefixplural} and
\gls{Glsentryprefixfirstplural}.

\cmddef{PGLS}
Does:
\begin{compactcodebox}
\gls{glsuppercase}\marg{\meta{prefix}\gls{glsprefixsep}}\gls{GLS}
\end{compactcodebox}
if \meta{prefix} is non-empty otherwise just uses \gls+{GLS}.

The \meta{prefix} will be the value of the \gloskey{prefixfirst} key on 
\idx{firstuse} or the \gloskey{prefix} key on \idx{subsequentuse}.

\cmddef{PGLSpl}
Does:
\begin{compactcodebox}
\gls{glsuppercase}\marg{\meta{prefix}\gls{glsprefixsep}}\gls{GLSpl}
\end{compactcodebox}
if
\meta{prefix} is non-empty otherwise just uses \gls+{GLSpl}.

The \meta{prefix} will be the value of the
\gloskey{prefixfirstplural} key on \idx{firstuse} or the
\gloskey{prefixplural} key on \idx{subsequentuse}.

\begin{xtr}
The \sty{glossaries-extra} package provides additional commands,
such as \gls{pglsxtrshort}, for use in section headings.
\end{xtr}

\begin{example}{Using Prefixes}{ex:prefixes}
Continuing from \exampleref{ex:determiners}, now that I've defined
my entries, I~can use them in the text via the above commands:
\begin{codebox}
First use: \gls{pgls}\marg{svm}. Next use: \gls{pgls}\marg{svm}.
Singular: \gls{pgls}\marg{sample}, \gls{pgls}\marg{oeil}.
Plural: \gls{pglspl}\marg{sample}, \gls{pglspl}\marg{oeil}.
\end{codebox}
which produces:
\begin{resultbox}
First use: a~support vector machine (SVM). Next use: an SVM.
Singular: a~sample, l'oeil. Plural: the samples, les yeux.
\end{resultbox}
For a complete document, see \samplefile{-prefix}.
\end{example}

This package also provides the commands described below, none of
which perform any check to determine the entry's existence.

\cmddef{ifglshasprefix}
Expands to \meta{true} if the \gloskey{prefix} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{ifglshasprefixplural}
Expands to \meta{true} if the \gloskey{prefixplural} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{ifglshasprefixfirst}
Expands to \meta{true} if the \gloskey{prefixfirst} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{ifglshasprefixfirstplural}
Expands to \meta{true} if the \gloskey{prefixfirstplural} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{glsentryprefix}
Expands to the value if the \gloskey{prefix} field.

\cmddef{glsentryprefixplural}
Expands to the value if the \gloskey{prefixplural} field.

\cmddef{glsentryprefixfirst}
Expands to the value if the \gloskey{prefixfirst} field.

\cmddef{glsentryprefixfirstplural}
Expands to the value if the \gloskey{prefixfirstplural} field.

There are also variants that convert to \idx+{sentencecase}. As with
command like \gls{Glsentrytext}, these will use
\gls{MFUsentencecase} to expand in \idxpl{PDFbookmark}, but will use
\gls{glssentencecase} in the document.

\cmddef{Glsentryprefix}
As \gls{glsentryprefix} with \idx{sentencecase} applied.

\cmddef{Glsentryprefixplural}
As \gls{glsentryprefixplural} with \idx{sentencecase} applied.

\cmddef{Glsentryprefixfirst}
As \gls{glsentryprefixfirst} with \idx{sentencecase} applied.

\cmddef{Glsentryprefixfirstplural}
As \gls{glsentryprefixfirstplural} with \idx{sentencecase} applied.

\begin{example}{Adding Determiner to Glossary Style}{ex:plist}
You can use the above commands to define a new \idx{glossarystyle} that
uses the determiner. For example, the following style is a slight
modification of the \glostyle{list} style that inserts the prefix
before the name:
\begin{codebox}
\gls{newglossarystyle}\marg{plist}\marg{\comment{}
 \gls{setglossarystyle}\marg{\glostyle{list}}\comment{}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
  \gls{item}\oarg{\gls{glsentryitem}\marg{\sym{hashhash}1}\comment{}
      \gls{glsentryprefix}\marg{\sym{hashhash}1}\comment{}
      \gls{glstarget}\marg{\sym{hashhash}1}\marg{\gls{glossentryname}\marg{\sym{hashhash}1}}}
   \gls{glossentrydesc}\marg{\sym{hashhash}1}\gls{glspostdescription}\gls{space} \sym{hashhash}2}\comment{}
}
\end{codebox}
If you want to change the prefix separator (\gls{glsprefixsep}) then
the following is better:
\begin{codebox}
\gls{newglossarystyle}\marg{plist}\marg{\comment{}
 \setglossarystyle{list}\comment{}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
   \gls{item}\oarg{\gls{glsentryitem}\marg{\sym{hashhash}1}\comment{}
        \gls{ifglshasprefix}\marg{\sym{hashhash}1}\marg{\gls{glsentryprefix}\marg{\sym{hashhash}1}\gls{glsprefixsep}}\marg{}\comment{}
        \gls{glstarget}\marg{\sym{hashhash}1}\marg{\gls{glossentryname}\marg{\sym{hashhash}1}}}
     \gls{glossentrydesc}\marg{\sym{hashhash}1}\gls{glspostdescription}\gls{space} \sym{hashhash}2}\comment{}
}
\end{codebox}
The conditional is also useful if you want the style to use an
\idx{uppercase} letter at the start of the entry item:
\begin{codebox}
\gls{newglossarystyle}\marg{plist}\marg{\comment{}
  \gls{setglossarystyle}\marg{\glostyle{list}}\comment{}
  \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
    \gls{item}\oarg{\gls{glsentryitem}\marg{\sym{hashhash}1}\comment{}
        \gls{glstarget}\marg{\sym{hashhash}1}\comment{}
        \marg{\comment{}
          \gls{ifglshasprefix}\marg{\sym{hashhash}1}\comment{}
          \marg{\gls{Glsentryprefix}\marg{\sym{hashhash}1}\gls{glsprefixsep}\gls{glossentryname}\marg{\sym{hashhash}1}}\comment{}
          \marg{\gls{Glossentryname}\marg{\sym{hashhash}1}}\comment{}
        }}
     \gls{glossentrydesc}\marg{\sym{hashhash}1}\gls{glspostdescription}\gls{space} \sym{hashhash}2}\comment{}
}
\end{codebox}
\end{example}

\chapter{Accessibility Support}\label{sec:accsupp}

\pkgdef{glossaries-accsupp}

Limited accessibility support is provided by the accompanying
\sty{glossaries-accsupp} package, but note that this package is
experimental. This package automatically
loads the \sty{glossaries} package. Any options are passed to
\sty{glossaries} (if it hasn't already been loaded). For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries-accsupp}
\end{codebox}
This will load \sty{glossaries} with the \opt{acronym} package
option as well as loading \sty{glossaries-accsupp}.

\begin{xtr}
If you are using the \sty{glossaries-extra} extension package, you
need to load \sty{glossaries-extra} with the \opt{accsupp}
package option. For example:
\begin{verbatim}
\usepackage[abbreviations,accsupp]{glossaries-extra}
\end{verbatim}
This will load \sty{glossaries-extra} (with the
\opt{abbreviations} option), \sty{glossaries} and
\sty{glossaries-accsupp} and make appropriate patches to integrate
the accessibility support with the extension commands.
\end{xtr}

\section{Accessibility Keys}
\label{sec:accsuppkeys}

The \sty{glossaries-accsupp} package defines
additional keys that may be used when defining \idxpl{glossaryentry}.
If a key isn't set, then there will be not accessibility support for
the corresponding field.

\optiondef{gloskey.access}

The value of this key is the replacement text corresponding to
the \gloskey{name} key.

\optiondef{gloskey.textaccess}

The value of this key is the replacement text corresponding to
the \gloskey{text} key.

\optiondef{gloskey.firstaccess}

The value of this key is the replacement text corresponding to
the \gloskey{first} key.

\optiondef{gloskey.pluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{plural} key.

\optiondef{gloskey.firstpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{firstplural} key.

\optiondef{gloskey.symbolaccess}

The value of this key is the replacement text corresponding to
the \gloskey{symbol} key.

\optiondef{gloskey.symbolpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{symbolplural} key.

\optiondef{gloskey.descriptionaccess}

The value of this key is the replacement text corresponding to
the \gloskey{description} key. The corresponding
\idx{internalfieldlabel} is \glosfield{descaccess}.

\optiondef{gloskey.descriptionpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{descriptionplural} key. The corresponding
\idx{internalfieldlabel} is \glosfield{descpluralaccess}.

\optiondef{gloskey.longaccess}

The value of this key is the replacement text corresponding to
the \gloskey{long} key.

\optiondef{gloskey.longpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{longplural} key.

\optiondef{gloskey.shortaccess}

The value of this key is the replacement text corresponding to
the \gloskey{short} key.

If you define \idxpl{acronym} with \gls{newacronym}, the
\gloskey{shortaccess} field will automatically be set to:
\cmddef{glsdefaultshortaccess}
This just expands to \meta{long}. If redefined, this command must be
fully expandable. It expands when the \idx{acronym} is defined.

\optiondef{gloskey.shortpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{shortplural} key.

\optiondef{gloskey.user1access}

The value of this key is the replacement text corresponding to
the \gloskey{user1} key. The corresponding
\idx{internalfieldlabel} is \glosfield{useriaccess}.

\optiondef{gloskey.user2access}

The value of this key is the replacement text corresponding to
the \gloskey{user2} key. The corresponding
\idx{internalfieldlabel} is \glosfield{useriiaccess}.

\optiondef{gloskey.user3access}

The value of this key is the replacement text corresponding to
the \gloskey{user3} key. The corresponding
\idx{internalfieldlabel} is \glosfield{useriiiaccess}.

\optiondef{gloskey.user4access}

The value of this key is the replacement text corresponding to
the \gloskey{user4} key. The corresponding
\idx{internalfieldlabel} is \glosfield{userivaccess}.

\optiondef{gloskey.user5access}

The value of this key is the replacement text corresponding to
the \gloskey{user5} key. The corresponding
\idx{internalfieldlabel} is \glosfield{uservaccess}.

\optiondef{gloskey.user6access}

The value of this key is the replacement text corresponding to
the \gloskey{user6} key. The corresponding
\idx{internalfieldlabel} is \glosfield{userviaccess}.

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{tex}\marg{\gloskeyval{name}{\cmd{TeX}},\gloskeyval{description}{Document 
preparation language},\gloskeyval{access}{TeX}}
\end{codebox}
Now the \idx{linktext} produced by \code{\gls{gls}\marg{tex}} will be:
\begin{codebox}
\gls{BeginAccSupp}\marg{ActualText=\marg{TeX}}\cmd{TeX}\gls{EndAccSupp}{}
\end{codebox}
which is produced via \gls{glsaccessibility}. If you want to use
another accessibility package, see \sectionref{sec:accsuppdevnote}.

The sample file \samplefile{accsupp} illustrates the
\sty{glossaries-accsupp} package.

\section{Incorporating Accessibility Support}
\label{sec:accsuppcmds}

The \gls{glslike} and \gls{glstextlike} commands have their
\idx{linktext} adjusted to incorporate the accessibility support, if
provided.
A helper command is used to identify the replacement text that depends 
on the field name:
\cmddef{glsfieldaccsupp}
This will use 
\cmddef{glsfield-labelaccsupp} 
if it's defined otherwise it will just use:
\cmddef{glsaccsupp}
Note that \meta{field-label} is the \idx{internalfieldlabel} which may not
match the corresponding key. For example, the \glosfield{shortpl}
field label corresponds to the \gloskey{shortplural} key.

\begin{xtr}
With \sty{glossaries-extra}, there's a prior test for the existence
of the command \gls{glsxtrcategoryfieldaccsupp}.
\end{xtr}

There are two commands pre-defined:
\cmddef{glsshortaccsupp}
which is defined as:
\begin{compactcodebox}
\gls{glsaccessibility}\marg{E}\margm{replacement}\margm{content}
\end{compactcodebox}
and
\cmddef{glsshortplaccsupp}
which is simply defined to use \gls{glsshortaccsupp}.

These helper commands all internally use:
\cmddef{glsaccessibility}
The default definition uses commands provided by the \sty{accsupp}
package. If you want to experiment with another accessibility
package, see \sectionref{sec:accsuppdevnote}. The \meta{options} are
passed to the underlying accessibility support command.

The \meta{PDF element} argument is the appropriate \idx{PDFelement}
tag. The \idx+{PDF} specification identifies three different types of
replacement text:
\begin{deflist}
\itemtitle{Alt}
\begin{itemdesc}
Description of some content that's non-textual (for
example, an image). A word break is assumed after the content.
\end{itemdesc}

\itemtitle{ActualText}

\begin{itemdesc}
A character or sequence of characters that replaces textual content
(for example, a dropped capital, a ligature or a symbol). No word
break is assumed after the content.
\end{itemdesc}

\itemtitle{E}

\begin{itemdesc}
Expansion of an abbreviation to avoid ambiguity (for
example, \qt{St} could be short for \qt{saint} or \qt{street}).
\end{itemdesc}
\end{deflist}

\begin{important}
Many \idx{PDF} viewers don't actually support any type of replacement text. Some may
support \qt{ActualText} but not \qt{Alt} or \qt{E}. 
\href{https://pdfbox.apache.org/}{PDFBox}'s \qt{PDFDebugger} tool
can be used to inspect the PDF content to make sure that the
replacement text has been correctly set.
\end{important}

You can define your own custom helper commands for specific fields
that require them. For example:
\begin{codebox}
\cmd{newcommand}\marg{\glsfieldlabelaccsupp{symbol}}[2]\marg{\comment{}
 \gls{glsaccessibility}\oarg{method=hex,unicode}\marg{ActualText}\marg{\sym{hash}1}\marg{\sym{hash}2}\comment{}
}
\end{codebox}
This definition requires the replacement text to be specified with
the hexadecimal character code. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{int}\marg{\gloskeyval{name}{int},\gloskeyval{description}{integral},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{int}}},\gloskeyval{symbolaccess}{222B}
}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package provides additional support.
\end{xtr}

\section{Incorporating the Access Field Values}
\label{sec:glsentryaccessdisplay}

These robust commands are all in the form
\begin{compactcodebox}
\csmetafmt{gls}{field}{accessdisplay}\margm{text}\margm{entry-label}
\end{compactcodebox}
They may be used to apply the supplied accessibility
information to \meta{text}. If the relevant access field hasn't
been set, these simply do \meta{text}.

\glsxtrnote
The \sty{glossaries-extra} package provides convenient wrapper
commands such as:
\begin{compactcodebox*}
\cmd{newcommand}*\marg{\gls{glsaccessname}}[1]\marg{\comment{}
 \gls{glsnameaccessdisplay}\marg{\gls{glsentryname}\marg{\sym{hash}1}}{\sym{hash}1}\comment{}
}
\end{compactcodebox*}
See the \sty{glossaries-extra} manual for further details.

\cmddef{glsnameaccessdisplay}
Applies the accessibility information from the \gloskey{access}
field to \meta{text}.

\cmddef{glstextaccessdisplay}
Applies the accessibility information from the \gloskey{textaccess}
field to \meta{text}.

\cmddef{glspluralaccessdisplay}
Applies the accessibility information from the \gloskey{pluralaccess}
field to \meta{text}.

\cmddef{glsfirstpluralaccessdisplay}
Applies the accessibility information from the \gloskey{firstpluralaccess}
field to \meta{text}.

\cmddef{glssymbolaccessdisplay}
Applies the accessibility information from the \gloskey{symbolaccess}
field to \meta{text}.

\cmddef{glssymbolpluralaccessdisplay}
Applies the accessibility information from the \gloskey{symbolpluralaccess}
field to \meta{text}.

\cmddef{glsdescriptionaccessdisplay}
Applies the accessibility information from the \glosfield{descaccess}
field (which corresponds to the \gloskey{descriptionaccess} key) to \meta{text}.

\cmddef{glsdescriptionpluralaccessdisplay}
Applies the accessibility information from the \glosfield{descpluralaccess}
field (which corresponds to the \gloskey{descriptionpluralaccess} key) to \meta{text}.

\cmddef{glsshortaccessdisplay}
Applies the accessibility information from the \gloskey{shortaccess}
field to \meta{text}.

\cmddef{glsshortpluralaccessdisplay}
Applies the accessibility information from the \gloskey{shortpluralaccess}
field to \meta{text}.

\cmddef{glslongaccessdisplay}
Applies the accessibility information from the \gloskey{longaccess}
field to \meta{text}.

\cmddef{glslongpluralaccessdisplay}
Applies the accessibility information from the \gloskey{longpluralaccess}
field to \meta{text}.

\cmddef{glsuseriaccessdisplay}
Applies the accessibility information from the \glosfield{useriaccess}
field (which corresponds to the \gloskey{user1access} key) to \meta{text}.

\cmddef{glsuseriiaccessdisplay}
Applies the accessibility information from the \glosfield{useriiaccess}
field (which corresponds to the \gloskey{user2access} key) to \meta{text}.

\cmddef{glsuseriiiaccessdisplay}
Applies the accessibility information from the \glosfield{useriiiaccess}
field (which corresponds to the \gloskey{user3access} key) to \meta{text}.

\cmddef{glsuserivaccessdisplay}
Applies the accessibility information from the \glosfield{userivaccess}
field (which corresponds to the \gloskey{user4access} key) to \meta{text}.

\cmddef{glsuservaccessdisplay}
Applies the accessibility information from the \glosfield{uservaccess}
field (which corresponds to the \gloskey{user5access} key) to \meta{text}.

\cmddef{glsuserviaccessdisplay}
Applies the accessibility information from the \glosfield{userviaccess}
field (which corresponds to the \gloskey{user6access} key) to \meta{text}.

\section{Obtaining the Access Field Values}
\label{sec:glsentryaccess}

There are commands analogous to \gls{glsentrytext} if you need to
obtain the value of any of the accessibility fields. Since the
accessibility information isn't intended to be typeset but should be
written as a \idx{PDF} string, use the expandable
\gls{MFUsentencecase} or \gls{glsuppercase} if any \idx{casechange}
is required.

\cmddef{glsentryaccess}
Expands to the value of the \gloskey{access} field.

\cmddef{glsentrytextaccess}
Expands to the value of the \gloskey{textaccess} field.

\cmddef{glsentryfirstaccess}
Expands to the value of the \gloskey{firstaccess} field.

\cmddef{glsentrypluralaccess}
Expands to the value of the \gloskey{pluralaccess} field.

\cmddef{glsentryfirstpluralaccess}
Expands to the value of the \gloskey{firstpluralaccess} field.

\cmddef{glsentrysymbolaccess}
Expands to the value of the \gloskey{symbolaccess} field.

\cmddef{glsentrysymbolpluralaccess}
Expands to the value of the \gloskey{symbolpluralaccess} field.

\cmddef{glsentrydescaccess}
Expands to the value of the \glosfield{descaccess} field, which
corresponds to the \gloskey{descriptionaccess} key.

\cmddef{glsentrydescpluralaccess}
Expands to the value of the \glosfield{descpluralaccess} field, which
corresponds to the \gloskey{descriptionpluralaccess} key.

\cmddef{glsentryshortaccess}
Expands to the value of the \gloskey{shortaccess} field.

\cmddef{glsentryshortpluralaccess}
Expands to the value of the \gloskey{shortpluralaccess} field.

\cmddef{glsentrylongaccess}
Expands to the value of the \gloskey{longaccess} field.

\cmddef{glsentrylongpluralaccess}
Expands to the value of the \gloskey{longpluralaccess} field.

\cmddef{glsentryuseriaccess}
Expands to the value of the \glosfield{useriaccess} field, which
corresponds to the \gloskey{user1access} key.

\cmddef{glsentryuseriiaccess}
Expands to the value of the \glosfield{useriiaccess} field, which
corresponds to the \gloskey{user2access} key.

\cmddef{glsentryuseriiiaccess}
Expands to the value of the \glosfield{useriiiaccess} field, which
corresponds to the \gloskey{user3access} key.

\cmddef{glsentryuserivaccess}
Expands to the value of the \glosfield{userivaccess} field, which
corresponds to the \gloskey{user4access} key.

\cmddef{glsentryuservaccess}
Expands to the value of the \glosfield{uservaccess} field, which
corresponds to the \gloskey{user5access} key.

\cmddef{glsentryuserviaccess}
Expands to the value of the \glosfield{userviaccess} field, which
corresponds to the \gloskey{user6access} key.

\section{Developer's Note}
\label{sec:accsuppdevnote}

Currently there's only support for \sty{accsupp}. If you want to
experiment with another package that provides accessibility support, 
define the following command before \sty{glossaries-accsupp} is
loaded:
\cmddef{gls@accsupp@engine}
If this command has its default definition of \code{accsupp} when
\sty{glossaries-accsupp} loads then the \sty{accsupp} package will
automatically be loaded, otherwise it won't and you'll need to
redefine \gls{gls@accessibility} to use the appropriate
accessibility commands.

\cmddef{gls@accessibility}
This command is used internally by \gls{glsaccessibility}. The
default definition if \gls{gls@accsupp@engine} is defined to
\code{accsupp} does:
\begin{compactcodebox}
\gls{BeginAccSupp}\marg{\meta{options},\meta{PDF element}\dequals\margm{value}}\meta{content}\gls{EndAccSupp}\marg{}
\end{compactcodebox}
Otherwise it simply does \meta{content}.

\chapter{Sample Documents}
\label{sec:samples}

The \sty{glossaries} package is provided with some sample
documents that illustrate the various functions. These should
be located in the \filefmt{samples} subdirectory (folder) of the
\sty{glossaries} documentation directory. This location varies
according to your operating system and \TeX\ distribution. You
can use \app{texdoc} to locate the main \sty{glossaries} documentation.
For example:
\texdocref{-l glossaries}
This should display a list of all the files in the \sty{glossaries}
documentation directory with their full pathnames. (The \idx{gui} version
of \app{texdoc} may also provide you with the information.)

If you can't find the sample files on your computer, they are also available
from your nearest CTAN mirror at
\url{http://mirror.ctan.org/macros/latex/contrib/glossaries/samples/}. 
Each sample file listed below has a \idx{hyperlink} to the file's location on
the CTAN mirror.

The \sty{glossaries-extra} package and \app{bib2gls}
provide some additional sample files. There are also examples in the
\gallery{Dickimaw Books Gallery}.

If you prefer to use \idx{utf8} aware engines (\appfmt{xelatex} or
\appfmt{lualatex}) remember that you'll need to switch from
\sty{fontenc} \& \sty{inputenc} to \sty{fontspec} where
appropriate.

If you get any errors or unexpected results, check that you have
up-to-date versions of all the required packages. (Search the log
file for lines starting with \qtt{Package:\ }.) Where
\sty{hyperref} is loaded you will get warnings about non-existent
references that look something like:
\begin{transcript}
pdfTeX warning (dest): name\marg{glo:aca} has been 
referenced but does not exist, replaced by a fixed one
\end{transcript}
These warnings may be ignored on the first \LaTeX\ run. (The
destinations won't be defined until the \idx{glossary} has been created.)

\section{Basic}
\label{sec:samplesbasic}

\filedef{minimalgls.tex}
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 \file{minimalgls.tex} through \LaTeX\ either by 
  typing
\begin{terminal}
pdflatex minimalgls
\end{terminal}
  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 \idx{glossary} in the document.

  \item If you have Perl installed, run \app{makeglossaries} on the document 
  (\sectionref{sec:makeglossaries}). This can
  be done on a terminal by typing:
\begin{terminal}
makeglossaries minimalgls
\end{terminal}
  otherwise use \app{makeglossaries-lite}:
\begin{terminal}
makeglossaries-lite minimalgls
\end{terminal}
  If for some reason you want to call \app{makeindex} explicitly, you can do this
  in a terminal by typing (all on one line):
\begin{terminal}
makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo
\end{terminal}
  See \sectionref{sec:makeindexapp} for further details on using 
   \app{makeindex} explicitly.

  Note that if the file name contains spaces, you will need to use
  the double-quote character to delimit the name.

  \item Run \file{minimalgls.tex} through \LaTeX\ again (as step~1)
  \end{enumerate}
You should now have a complete document. The number following
each entry in the \idx{glossary} is the
\idxc{entrylocation}{location number}. By default, this is the page
number where the entry was referenced.

The \opt{acronym} package option creates a second \idx{glossary} with
the label \glostype{acronym} (which can be referenced with
\gls{acronymtype}). If you decide to enable this option then there
will be a second set of \idxpl{indexingfile} that need to be processed by
\app{makeindex}. If you use \app{makeglossaries} or
\app{makeglossaries-lite} you don't need to worry about it, as
those scripts automatically detect which files need to be processed
and will run \app{makeindex} (or \app{xindy}) the appropriate number
of times.

If for some reason you don't want to use \app{makeglossaries} or
\app{makeglossaries-lite} and you want the \opt{acronym}
package option then the complete build process is:
\begin{terminal}
pdflatex minimalgls
makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo
makeindex -s minimalgls.ist -t minimalgls.alg -o minimalgls.acr minimalgls.acn
pdflatex minimalgls
\end{terminal}

There are three other files that can be used as 
\href{http://www.dickimaw-books.com/latex/minexample/}{minimal working
examples}: \mirrorsamplefile{mwe-gls.tex}, \mirrorsamplefile{mwe-acr.tex} and
\mirrorsamplefile{mwe-acr-desc.tex}.

\glsxtrnote
If you want to try out the \sty{glossaries-extra} extension package,
you need to replace the package loading line:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{\strong{glossaries}}
\end{codebox}
with:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}\strong{,\opt{postdot},\opt{stylemods}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Note the different default package options. (You may omit the
\opt{acronym} package option in both cases if you only want a
single \idx{glossary}.) The \sty{glossaries-extra} package internally
loads the base \sty{glossaries} package so you don't need to
explicitly load both (in fact, it's better to let
\sty{glossaries-extra} load \sty{glossaries}).

Next, replace:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\strong{\cat{acronym}}}\marg{\abbrstyle{long-short}}
\end{codebox}
The optional argument \cat{acronym} identifies the category that
this style should be applied to. The \gls{newacronym} command
provided by the base \sty{glossaries} package is redefined by
\sty{glossaries-extra} to use \gls{newabbreviation} with the category
set to \cat{acronym}.

If you prefer to replace \gls{newacronym} with \gls{newabbreviation}
then the default category is \cat{abbreviation} so the style should
instead be:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\strong{\cat{abbreviation}}}\marg{\abbrstyle{long-short}}
\end{codebox}
This is actually the default category if the optional argument is
omitted, so you can simply do:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}
\end{codebox}
The \abbrstyle{long-short} style is the default for the
\cat{abbreviation} category so you can omit this line completely if
you replace \gls{newacronym}. (The default style for the
\cat{acronym} category is \abbrstyle{short-nolong}, which only shows
the short form on \idx{firstuse}.)

As mentioned earlier, the \opt{acronym} package option creates a
new \idx{glossary} with the label \glostype{acronym}. This is independent of
the \cat{acronym} category.  You can use the \opt{acronym}
package option with either \gls{newacronym} or \gls{newabbreviation}.

You may instead prefer to use the \opt{abbreviations} package
option, which creates a new \idx{glossary} with the label \glostype{abbreviations}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{abbreviations}},\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}
This can again be used with either \gls{newacronym} or
\gls{newabbreviation}, but the file extensions are different. This
isn't a problem if you are using \app{makeglossaries} or
\app{makeglossaries-lite}. If you are explicitly calling
\app{makeindex} (or \app{xindy}) then you need to modify the file
extensions.
See the \sty{glossaries-extra} user manual for further details.

If you use both the \opt{acronym} and \opt{abbreviations}
package options then \gls{newacronym} will default to the
\glostype{acronym} glossary and \gls{newabbreviation} will default to
the \glostype{abbreviations} glossary.

\bibglsnote
If you want to try \app{bib2gls}, you first need to convert the
document to use \sty{glossaries-extra} as described above. Then add
the \opt{record} package option. For example:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next you need to convert the \idx{entry} definitions into the
\ext{bib} format required by \app{bib2gls}. This can easily be
done with \app{convertgls2bib}. For example:
\begin{terminal}
convertgls2bib \switch{preamble-only} minimalgls.tex entries.bib
\end{terminal}
This will create a file called \strong{\filefmt{entries.bib}}. Next, replace:
\begin{codebox}
\gls{makeglossaries}
\end{codebox}
with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{\strong{entries}}}
\end{codebox}
Now remove all the entry definitions in the \idxf{documentpreamble}
(\gls{longnewglossaryentry}, \gls{newglossaryentry} and \gls{newacronym}
or \gls{newabbreviation}). 

The \idx{abbrvstyle} command
must go before \gls{GlsXtrLoadResources}. For example (if you are
using \gls{newacronym}):
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
Finally, replace:
\begin{codebox}
\gls{printglossaries}
\end{codebox}
with:
\begin{codebox}
\gls{printunsrtglossaries}
\end{codebox}
The document build is now:
\begin{terminal}
pdflatex minimalgls
bib2gls minimalgls
pdflatex minimalgls
\end{terminal}

\file{sampleDB.tex}
This document illustrates how
to load external files containing the glossary entry definitions. It also
illustrates how to define a new \idx{glossary} type. This document has the
\idx{numberlist} suppressed and uses \gls{glsaddall} to add all
the entries to the \idxpl{glossary} without referencing each one
explicitly. (Note that it's more efficient to use
\sty{glossaries-extra} and \app{bib2gls} if you have a large number
of entries.) To create the document do:
\begin{terminal}
pdflatex sampleDB
makeglossaries sampleDB
pdflatex sampleDB
\end{terminal}
or
\begin{terminal}
pdflatex sampleDB
makeglossaries-lite sampleDB
pdflatex sampleDB
\end{terminal}
The glossary definitions are stored in the accompanying files
\mirrorsamplefile{database1.tex} and \mirrorsamplefile{database2.tex}. If for some
reason you want to call \app{makeindex} explicitly you must
have a separate call for each glossary:
\begin{enumerate}
\item Create the \glostype{main} glossary (all on one line):
\begin{terminal}
makeindex -s sampleDB.ist -t sampleDB.glg -o sampleDB.gls sampleDB.glo
\end{terminal}
\item Create the secondary glossary (all on one line):
\begin{terminal}
makeindex -s sampleDB.ist -t sampleDB.nlg -o sampleDB.not sampleDB.ntn
\end{terminal}
Note that both \app{makeglossaries} and \app{makeglossaries-lite} do
this all in one call, so they not only make it easier because you
don't need to supply all the switches and remember all the
extensions but they also call \app{makeindex} the appropriate number of times.
\end{enumerate}

\bibglsnote
If you want to switch to using \app{bib2gls} with \sty{glossaries-extra}, you can convert
\mirrorsamplefile{database1.tex} and
\mirrorsamplefile{database2.tex} to \ext{bib}
files using \app{convertgls2bib}:
\begin{terminal}
convertgls2bib database1.tex database1.bib
convertgls2bib database2.tex database2.bib
\end{terminal}
The document code then needs to be:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks,plainpages=false]\marg{hyperref}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot}]\marg{\strong{glossaries-extra}}
\codepar
\strong{\gls{newglossary*}}\marg{punc}\marg{Punctuation Characters}
\codepar
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{database1},
 \strong{\resourceoptval{selection}{all}},\resourceoptval{sort}{en}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{database2},\strong{\resourceoptval{type}{punc},}
 \strong{\resourceoptval{selection}{all}},\resourceoptval{sort}{letter-case}}
\codepar
\cbeg{document}
\glslink{printunsrtglossaries}{\xtrcsfmt{print\strong{unsrt}glossaries}}
\cend{document}
\end{codebox}
Note that the \opt{nonumberlist} package option has been omitted.
It's not needed because there are no locations in this amended
document (whereas in the original \samplefile{DB} locations are
created with \gls{glsaddall}). The starred \gls{newglossary*} is used
since the \app{makeindex}/\app{xindy} extensions are now irrelevant.

Instead of using \app{makeglossaries} you need to use \app{bib2gls} 
when you build the document:
\begin{terminal}
pdflatex sampleDB
bib2gls sampleDB
pdflatex sampleDB
\end{terminal}
Note that one \app{bib2gls} call processes all the \idx{indexing} (rather
than one call per \idx{glossary}). Unlike \app{makeindex} and \app{xindy},
\app{bib2gls} processes each resource set in turn, but the resource
sets aren't linked to a specific \idx{glossary}. Multiple \idxpl{glossary} may
be processed in a single resource set or sub-blocks of a single
glossary may be processed by multiple resource sets. In this
example, there happens to be one resource set per glossary because
each glossary requires a different sort method. (A locale-sensitive
alphabetical sort for the first and a character code sort for the
second.)

If you want \idxpl{lettergroup}, you need to use the \switch{group}
switch:
\begin{terminal}
bib2gls \switch{group} sampleDB
\end{terminal}
and use an appropriate glossary style.

See also \bibglsgallery{sorting}, \bibglsbegin\ and the \app{bib2gls} user manual.

\section{Acronyms and First Use}
\label{sec:sampleacronyms}

\file{sampleAcr.tex}
This document has some sample \idxpl{acronym}. It also adds the
\idx{glossary} to the \idx{tableofcontents},
so an extra run through \LaTeX\ is required to ensure the document
is up to date:
\begin{terminal}
pdflatex sampleAcr
makeglossaries sampleAcr
pdflatex sampleAcr
pdflatex sampleAcr
\end{terminal}
(or use \app{makeglossaries-lite}).

Note that if the \idx{glossary} is at the start of the document
and spans across multiple pages, then this can cause the locations
to be shifted. In that case, an extra \app{makeglossaries} and
\LaTeX\ call are required. In this particular example, the \idx{glossary}
is at the end of the document so it's not a problem. It's also not a
problem for a \idx{glossary} at the start of the document if the page
numbering is reset at the end of the glossary. For example, if the
\idx{glossary} is at the end of the front matter in a book-style document.

This document uses \gls{ifglsused} to determine whether to use
\qt{a} or \qt{an} in:
\begin{codebox}
\ldots\ is \gls{ifglsused}\marg{svm}\marg{an}\marg{a} \gls{gls}\marg{svm} \ldots
\end{codebox}
This clumsy bit of code can be tidied up with the
\sty{glossaries-prefix} package. Since that package automatically
loads \sty{glossaries} and passes all its options to the base
package it's possible to do a simple replacement of:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long}},\opt{toc}]\marg{glossaries}
\end{codebox}
with:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long}},\opt{toc}]\marg{\strong{glossaries-prefix}}
\end{codebox}
The definition of \qt{svm} now needs an adjustment:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{statistical pattern recognition 
technique\sym{nbsp}\cmd{protect}\gls{cite}\marg{svm}},
\strong{\gloskeyval{prefixfirst}{a\sym{nbsp}},\gloskeyval{prefix}{an\gls{space}}}
}\marg{svm}\marg{svm}\marg{support vector machine}
\end{codebox}
The clumsy text can now simply be changed to:
\begin{codebox}
\ldots\ is \gls{pgls}\marg{svm} \ldots
\end{codebox}

\glsxtrnote
If you want to convert this sample document to use \sty{glossaries-extra},
you may want the patched version of the styles provided in \sty{glossary-long}, 
in which case you can also add \opt{stylemods}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{stylemods},}\optval{style}{\glostyle{long}}]\marg{\strong{glossaries-extra}}
\end{codebox}
If you want to suppress all the other glossary style packages with
\opt{nostyles}, then you need to specify exactly which package
(or packages) that you do want:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{nostyles},}\opt{stylemods}\strong{=long},\optval{style}{\glostyle{long}}]\marg{glossaries-extra}
\end{codebox}
(Now that \sty{glossaries-extra} is being used, there are more
available \qt{long} styles in the \sty{glossary-longextra} package,
which you may prefer.)

If you want to use \sty{glossaries-prefix}, you can simply add the
\opt{prefix} package option.

Note that the \opt{toc} package option has been dropped. This is
the default with \sty{glossaries-extra}, so it doesn't need to be
specified now. The document build is now shorter:
\begin{terminal}
pdflatex sampleAcr
makeglossaries sampleAcr
pdflatex sampleAcr
\end{terminal}
The third \LaTeX\ call is no longer required to make the 
\idx{tableofcontents} up-to-date. This is because \sty{glossaries-extra} provides
boilerplate text on the first \LaTeX\ call when the \idxpl{indexingfile}
are missing. This means that the \idx{glossary} header is added to the
\ext{toc} file on the first \LaTeX\ call, whereas with just the
base \sty{glossaries} package, the header isn't present until the
second \LaTeX\ call. (As with just the base \sty{glossaries}
package, if the \idx{glossary} occurs at the start of the document without
a page reset after it then part of the build process needs repeating
to ensure all referenced page numbers are up-to-date. This problem isn't
specific to the \sty{glossaries} package.)

The other different default setting is the post-description
punctuation. The base package has \optval{nopostdot}{false} as the
default. This means that a \idx{fullstop} (period) is automatically
inserted after the description in the glossary. The extension
package has \opt{nopostdot}{true} as the default. If you want the
original behaviour then you can use \optval{nopostdot}{false} or the
shorter synonym \opt{postdot}. 

The \sty{glossaries-extra} package has different
\idx{abbreviation} handling that's far more flexible than that provided by
the base \sty{glossaries} package. The style now needs to be set with
\gls{setabbreviationstyle} instead of \gls{setacronymstyle}:
\begin{codebox}
\strong{\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-sc}}}
\gls{newacronym}\marg{svm}\marg{svm}\marg{support vector machine}
\end{codebox}
(Note the different style name \abbrstyle{long-short-sc} instead of
\acrstyle{long-sc-short} and the optional argument \cat{acronym}.) If you
prefer to replace \gls{newacronym} with \gls{newabbreviation} then
omit the optional argument:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc}}
\gls{newabbreviation}\marg{svm}\marg{svm}\marg{support vector machine}
\end{codebox}
(The optional argument of \gls{setabbreviationstyle} is the
category to which the style should be applied. If it's omitted, 
\cat{abbreviation} is assumed. You can therefore have different
styles for different categories.)

Finally, you need to replace \gls{acrshort}, \gls{acrlong} and
\gls{acrfull} and their variants with \gls{glsxtrshort}, \gls{glsxtrlong} and
\gls{glsxtrfull} etc.

\filedef{sampleAcrDesc.tex}
This is similar to the previous example, except that the
\idxpl{acronym} have an associated description. As with the previous
example, the \idx{glossary} is added to the table of contents, so an extra
run through \LaTeX\ is required:
\begin{terminal}
pdflatex sampleAcrDesc
makeglossaries sampleAcrDesc
pdflatex sampleAcrDesc
pdflatex sampleAcrDesc
\end{terminal}
This document uses the \opt{acronym} package option, which
creates a new \idx{glossary} used by \gls{newacronym}. This leaves the
default \glostype{main} glossary available for general terms. However,
in this case there are no general terms so the \glostype{main}
glossary is redundant. The \opt{nomain} package option will
prevent its creation. Obviously, if you decide to add some terms
with \gls{newglossaryentry} you will need to remove the
\opt{nomain} option as the \glostype{main} glossary will now be
required.

\glsxtrnote
As with the previous example, if you want to convert this document
to use \sty{glossaries-extra} you need to make a few modifications.
The most obvious one is to replace \sty{glossaries} with
\sty{glossaries-extra} in the \csfmt{usepackage} argument. Again you
can omit \opt{toc} as this is the default for
\sty{glossaries-extra}. As in the previous example, you may want to
use the patched styles. This document uses \glostyle{altlist} which
is provided by \sty{glossary-list}, so the style can be patched with
\opt{stylemods}.
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\opt{nomain},\optval{style}{altlist}\strong{,\opt{stylemods}}]\marg{\strong{glossaries-extra}}
\end{codebox}
You may prefer to replace the \opt{acronym} option with
\opt{abbreviations}, but this will change the file extensions.
If you use \app{makeglossaries} or \app{makeglossaries-lite} you
don't need to worry about it.

Again the style command needs to be changed:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-sc-desc}}
\end{codebox}
(Note the change in style name \abbrstyle{long-short-sc-desc}
instead of \acrstyle{long-sc-short-desc} and the optional argument \cat{acronym}.) 

As with the previous example, if
you prefer to use \gls{newabbreviation} instead of \gls{newacronym}
then you need to omit the optional argument:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc-desc}}
\end{codebox}
The original document uses:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeitemformat}}[1]\marg{\comment{}
 \gls{acronymfont}\marg{\gls{glsentrytext}\marg{\#1}}}
\end{codebox}
to ensure that the cross-references (from the \gloskey{see} key) use
the acronym font. The new \idxpl{abbrvstyle} don't
use \gls{acronymfont} so this isn't appropriate with
\sty{glossaries-extra}. If you're using at least version 1.42 of
\sty{glossaries-extra}, you don't need to do anything as it
automatically redefines \gls{glsseeitemformat} to take the style
formatting into account. If you have an earlier version you can
redefine this command as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeitemformat}}[1]\marg{\comment{}
 \gls{ifglshasshort}\marg{\#1}\marg{\gls{glsfmttext}\marg{\#1}}\marg{\gls{glsfmtname}\marg{\#1}}\comment{}
}
\end{codebox}
This will just show the short form in the cross-reference. If you
prefer the name instead (which includes the short and long form) you can use:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeitemformat}}[1]\marg{\gls{glsfmtname}\marg{\#1}}
\end{codebox}

The \sty{glossaries-extra} package provides two additional
cross-referencing keys \gloskey{seealso} and \gloskey{alias}, 
so \code{\gloskeyval{see}{[see also]\marg{svm}}}
can be replaced with a more appropriate key:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{Statistical pattern recognition 
technique using the ``kernel trick''},
\strong{\gloskeyval{seealso}{svm}},
}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine}
\end{codebox}

Finally, as with the previous example, you need to replace
\gls{acrshort}, \gls{acrlong} and \gls{acrfull} etc with
\gls{glsxtrshort}, \gls{glsxtrlong} and \gls{glsxtrfull} etc.

\bibglsnote
If you want to convert this document so that it uses \app{bib2gls},
you first need to convert it to use \sty{glossaries-extra}, as above, 
but remember that you now need the \opt{record} option:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\opt{nomain},\optval{style}{altlist},\strong{\opt{record},\opt{postdot},\opt{stylemods}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
Now you need to convert the \idx{acronym} definitions to the \ext{bib}
format required by \app{bib2gls}. This can be done with:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampleAcrDesc.tex entries.bib
\end{terminal}
If you retained \gls{newacronym} from the original example file,
then the new \filefmt{entries.bib} file will contain entries
defined with \atentry{acronym}. For example:
\begin{codebox}
\atentry{acronym}\marg{ksvm,
  \gloskeyval{description}{Statistical pattern recognition technique
  using the ``kernel trick''},
  \gloskeyval{seealso}{svm},
  \gloskeyval{short}{ksvm},
  \gloskeyval{long}{kernel support vector machine}
}
\end{codebox}
If you switched to \gls{newabbreviation} then the entries will
instead be defined with \atentry{abbreviation}.

Next replace \gls{makeglossaries} with the resource command, but note
that the \idx{abbrvstyle} must be set first:
\begin{codebox*}
\strong{\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-sc-desc}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{terms defined in entries.bib}
 \strong{\resourceoptval{abbreviation-sort-fallback}{long}}}
\end{codebox*}
Another possibility is to make \atentry{acronym} behave as though it
was actually \atentry{abbreviation}:
\begin{codebox}
\strong{\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc-desc}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\resourceoptval{abbreviation-sort-fallback}{long}\strong{,
 \resourceoptvalm{entry-type-aliases}{acronym=abbreviation}}}
\end{codebox}
Note that the category is now \cat{abbreviation} not \cat{acronym} so the optional
argument of \gls{setabbreviationstyle} needs to be removed.

If the \gloskey{sort} field is missing (which should usually be the
case), then both \atentry{acronym} and \atentry{abbreviation} will
fallback on the \gloskey{short} field (not the \gloskey{name} field,
which is usually set by the style and therefore not visible to
\app{bib2gls}). For some styles, as in this example, it's more
appropriate to sort by the long form so the fallback is changed.
(Remember that you will break this fallback mechanism if you
explicitly set the sort value.) See the \app{bib2gls} manual for
further details and other examples.

Remember to delete any \gls{newacronym} or \gls{newabbreviation} in
the \ext{tex} file. 
Finally replace \gls{printglossary} with \gls{printunsrtglossary}.
The document build is now:
\begin{terminal}
pdflatex sampleAcrDesc
bib2gls sampleAcrDesc
pdflatex sampleAcrDesc
\end{terminal}

Note that it's now much easier to revert back to the descriptionless
style used in \samplefile{Acr}:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\strong{\abbrstyle{long-short-sc}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}\strong{,\resourceoptvalm{ignore-fields}{description}}}
\end{codebox*}
With the other options it would be necessary to delete all the
\gloskey{description} fields from the \idx{abbreviation} definitions in
order to omit them, but with \app{bib2gls} you can simply instruct
\app{bib2gls} to ignore the description. This makes it much easier
to have a large database of \idxpl{abbreviation} for use across multiple
documents that may or may not require the description.

\filedef{sampleDesc.tex}
This is similar to the previous example, except that it defines the
\idxpl{acronym} as normal \idxpl{entry} using \gls{newglossaryentry} instead of
\gls{newacronym}. As with the previous example, the \idx{glossary} is
added to the \idx{tableofcontents}, so an extra run through \LaTeX\ is
required:
\begin{terminal}
pdflatex sampleDesc
makeglossaries sampleDesc
pdflatex sampleDesc
pdflatex sampleDesc
\end{terminal}
This sample file demonstrates the use of the \gloskey{first} and
\gloskey{text} keys but in general it's better to use
\gls{newacronym} instead as it's more flexible. For even greater
flexibility use \gls{newabbreviation} provided by \sty{glossaries-extra}.
For other variations, such as showing the symbol on \idx{firstuse},
you may prefer to make use of the post-link category hook. For
examples, see the section \qt{Changing the Formatting} in \bibglsbegin.

\filedef{sampleFnAcrDesc.tex}
This document has some sample \idxpl{acronym} that
use the \acrstyle{footnote-sc-desc} \idx{acronymstyle}. As with the previous example, 
the \idx{glossary} is added to the \idx{tableofcontents}, so an extra run through 
\LaTeX\ is required:
\begin{terminal}
pdflatex sampleFnAcrDesc
makeglossaries sampleFnAcrDesc
pdflatex sampleFnAcrDesc
pdflatex sampleFnAcrDesc
\end{terminal}
\glsxtrnote
If you want to convert this sample document to use
\sty{glossaries-extra}, then you just need to follow the same steps
as for \samplefile{Acr} with a slight modification. This time the 
\abbrstyle{short-sc-footnote-desc} \idx{abbrvstyle} is needed:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{short-sc-footnote-desc}}
\end{codebox}
The command redefinitions (performed with \csfmt{renewcommand}) should
now all be deleted as they are no longer applicable.

You may prefer to use the \abbrstyle{short-sc-postfootnote-desc}
style instead. There are subtle differences between the \abbrstyle{postfootnote} and
\abbrstyle{footnote} set of styles. Try changing the \idx{abbrvstyle} to
\abbrstyle{short-sc-footnote} and compare the position of the footnote marker
with the two styles.

This modified sample file now has a shorter build:
\begin{terminal}
pdflatex sampleFnAcrDesc
makeglossaries sampleFnAcrDesc
pdflatex sampleFnAcrDesc
\end{terminal}
This is because the \sty{glossaries-extra} package produces
boilerplate text when the \idx{indexingfile} is missing (on the first
\LaTeX\ run) which adds the \idx{glossary} title to the
\idx{tableofcontents} (\ext{toc}) file.

\filedef{sampleCustomAcr.tex}
This document has some sample \idxpl{acronym} with a
custom \idx+{acronymstyle}. It also adds the \idx{glossary} to the 
\idx{tableofcontents}, so an extra run through \LaTeX\ is required:
\begin{terminal}
pdflatex sampleCustomAcr
makeglossaries sampleCustomAcr
pdflatex sampleCustomAcr
pdflatex sampleCustomAcr
\end{terminal}
This is a slight variation on the previous example where the name is
in the form \meta{long} (\meta{short}) instead of \meta{short}
(\meta{long}), and the \gloskey{sort} key is set to the long form
instead of the short form.  On \gls{firstuse}, the footnote text is
in the form \meta{long}: \meta{description} (instead of just the
long form). This requires defining a \idx{newacronym}
style that inherits from the \acrstyle{footnote-sc-desc} style.

\glsxtrnote
The conversion to \sty{glossaries-extra} starts in much the same way
as the previous examples:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\opt{nomain},\strong{\opt{postdot},\opt{stylemods},}\optval{style}{\glostyle{altlist}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
The \idxpl{abbrvstyle} have associated helper commands that may be
redefined to make minor modifications. These redefinitions should be
done before the \idxpl{abbreviation} are defined.

The \abbrstyle{short-sc-footnote-desc} \idx{abbrvstyle} is the closest match
to the requirement, so replace the \gls{setacronymstyle} command
with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{short-sc-footnote-desc}}
\end{codebox}
Again, you may prefer \abbrstyle{short-sc-postfootnote-desc}. Both
styles use the same helper commands.

Next some adjustments need to be made to fit the new requirements.
The name needs to be \meta{long} (\meta{short}):
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescname}}\marg{\comment{}
  \cmd{protect}\strong{\gls{glslongfont}\marg{\cmd{the}\gls{glslongtok}}}\comment{}
  \cmd{protect}\gls{glsxtrfullsep}\marg{\cmd{the}\gls{glslabeltok}}\comment{}
  \cmd{protect}\gls{glsxtrparen}\marg{\cmd{protect}\strong{\gls{glsabbrvfont}\marg{\cmd{the}\gls{glsshorttok}}}}\comment{}
}
\end{codebox}
This command expands when the \idxpl{abbreviation} are defined so take care
to \csfmt{protect} commands that shouldn't be expanded at that point,
and make sure that the token registers that store the label, long
and short values are able to expand. Similarly the sort value needs
adjusting:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescsort}}\marg{\strong{\cmd{the}\gls{glslongtok}}}
\end{codebox}
The footnote for all the footnote \idxpl{abbrvstyle} is produced
with:
\begin{codebox}
\gls{glsxtrabbrvfootnote}\margm{label}\margm{text}
\end{codebox}
where \meta{text} is the singular or plural long form, depending on
what command was used to reference the \idx{abbreviation} (\gls{gls},
\gls{glspl} etc). This can simply be redefined as:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}\marg{\comment{}
  \#2: \gls{glsentrydesc}\marg{\#1}}}
\end{codebox}
This will mimic the result from the original sample document.
Note that newer versions of \sty{glossaries-extra} may have
additional helper commands associated with certain \idxpl{abbrvstyle}.

You may prefer to replace \code{\#2} with a reference to a
specific field (or fields). For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}\marg{\comment{}
 \gls{Glsfmtlong}\marg{\#1} (\gls{glsfmtshort}\marg{\#1}): \gls{glsentrydesc}\marg{\#1}.}}
\end{codebox}
As with the earlier \samplefile{AcrDesc}, you need to remove or change the redefinition of
\gls{glsseeitemformat} since \gls{acronymfont} is no longer appropriate.

In the original \file{sampleCustomAcr.tex} source code, I started
the description with a capital:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{Statistical pattern recognition 
technique using the ``kernel trick''},
\gloskeyval{see}{[see also]\marg{svm}},
}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine}
\end{codebox}
This leads to a capital letter after the colon in the footnote,
which is undesirable, but I would like to have the description start
with a capital in the \idx{glossary}. The solution to this problem
is easy with \sty{glossaries-extra}. I start the description with a
\idx{lowercase} letter and set the \catattr{glossdesc}
\idx{categoryattribute} to \optfmt{firstuc} to convert the
description to \idx{sentencecase} in the \idx{glossary}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{glossdesc}}\marg{firstuc}
\end{codebox}
The \idx{abbreviation} definitions are modified slightly:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{\strong{s}tatistical pattern recognition 
technique using the ``kernel trick''},
\strong{\gloskeyval{seealso}{svm}},
}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine}
\end{codebox}
Note the use of the \gloskey{seealso} key, which is only
available with \sty{glossaries-extra}.

If you prefer to use \gls{newabbreviation} instead of
\gls{newacronym}, then the category needs to be
\cat{abbreviation} rather than \cat{acronym}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\strong{\cat{abbreviation}}}\marg{\catattr{glossdesc}}\marg{firstuc}
\end{codebox}
and the style command needs to be adjusted so that it omits the
optional argument. For example:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-sc-postfootnote-desc}}
\end{codebox}

\filedef{sample-FnDesc.tex}
This example defines a custom \idx+{entryformat}{display format} that 
puts the description in a footnote on \idx{firstuse}.
\begin{terminal}
pdflatex sample-FnDesc
makeglossaries sample-FnDesc
pdflatex sample-FnDesc
\end{terminal}
In order to prevent nested \idxpl{hyperlink}, this document uses the
\optval{hyperfirst}{false} package option (otherwise the footnote
marker \idx{hyperlink} would be inside the \idx{hyperlink} around the
\idx{linktext} which would result in a nested \idx{hyperlink}).

\glsxtrnote
The \sty{glossaries-extra} package has category \idxpl{postlinkhook}
that make it easier to adjust the \idxc{entryformat}{formatting}.
The \idx{postlinkhook} is placed after the \idx{hyperlink} around
the \idx{linktext}, so a \idx{hyperlink} created by \gls{footnote}
in the \idx{postlinkhook} won't cause a nested link. This means that the
\optval{hyperfirst}{false} option isn't required:
\begin{codebox}
\cmd{usepackage}[\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}

\begin{important}
Never use commands like \gls{gls} or \gls{glsdesc} in the 
\idx{postlinkhook} as you can end up with infinite recursion. Use commands that
don't themselves have a \idx{postlinkhook}, such as \gls{glsentrydesc} or
\gls{glossentrydesc}, instead.
\end{important}

In the original \file{sample-FnDesc.tex} file, the \idx{entryformat} was
adjusted with:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}%
}
\end{codebox}
This can be changed to:
\begin{codebox}
\gls{glsdefpostlink}
\marg{\cat{general}}\comment{category label}
\marg{\gls{glsxtrifwasfirstuse}\marg{\gls{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}\marg{}}
\end{codebox}
This sets the \idx{postlinkhook} for the \cat{general} category
(which is the default category for \idxpl{entry} defined with \gls{newglossaryentry}). If I
added some \idxpl{abbreviation} (which have a different category) then this
change wouldn't apply to them.

The first paragraph in the document is:
\begin{codebox}
First use: \gls{gls}\marg{sample}.
\end{codebox}
So the \idx{PDF} will have the word \qt{sample} (the \idx{linktext}
created by \code{\gls{gls}\marg{sample}}) as a \idx{hyperlink} to the entry in the
\idx{glossary} followed by the footnote marker, which is a
\idx{hyperlink} to
the footnote. This is then followed by the sentence terminator. 
\qt{First use: sample\textsuperscript{1}.}

It would look tidier if the footnote marker could be shifted after
the full stop. \qt{First use: sample.\textsuperscript{1}} 
This can easily be achieved with a minor modification:
\begin{codebox}
\gls{glsdefpostlink}
\marg{\cat{general}}\comment{category label}
\marg{\gls{glsxtrifwasfirstuse}
 \marg{\gls{glsxtrdopostpunc}\marg{\gls{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}}\comment{}
 \marg{}\comment{}
}
\end{codebox}
You may prefer to use \gls{glossentrydesc} instead of
\gls{glsentrydesc}. This will obey the \catattr{glossdesc} 
\idx{categoryattribute}.
If you append \gls{glspostdescription}, you can also pick up the
\opt{postdot} package option. For example:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossdesc}}\marg{firstuc}
\codepar
\gls{glsdefpostlink}
\marg{\cat{general}}\comment{category label}
\marg{\gls{glsxtrifwasfirstuse}
 \marg{\gls{glsxtrdopostpunc}\marg{\gls{footnote}\marg{\comment{}
   \strong{\gls{glossentrydesc}}\marg{\gls{glslabel}}\strong{\gls{glspostdescription}}}}}\comment{}
 \marg{}\comment{}
}
\end{codebox}
Alternatively, you could just use \gls{Glsentrydesc} and explicitly
append the full stop.

\filedef{sample-custom-acronym.tex}
This document illustrates how to define your own \idx{acronymstyle} if
the predefined styles don't suit your requirements.
\begin{terminal}
pdflatex sample-custom-acronym
makeglossaries sample-custom-acronym
pdflatex sample-custom-acronym
\end{terminal}
In this case, a style is defined to show the short form in the text
with the long form and description in a footnote on \idx{firstuse}.
The long form is used for the \gloskey{sort} value.
The short form is displayed in \idx+{smallcaps} in the main part of the
document but in \idx{uppercase} in the list of acronyms. (So it's a slight
variation of some of the examples above.) The \gloskey{name} is set
to the long form (starting with an initial capital) followed by the
\idx+{allcaps} short form in parentheses. The final requirement is that
the inline form should show the long form followed by the short form
in parentheses.

\glsxtrnote
As with \samplefile{FnAcrDesc}, the \abbrstyle{short-sc-footnote-desc}
and \abbrstyle{short-sc-postfootnote-desc} \idxpl{abbrvstyle} produce 
almost the required effect so one of those can be used as a starting point. 
However the final requirement doesn't fit. It's now necessary to actually define a custom
\idx{abbrvstyle}, but it can mostly inherit from the
\abbrstyle{short-sc-footnote-desc} or \abbrstyle{short-sc-postfootnote-desc} style:
\begin{codebox}
\gls{newabbreviationstyle}\marg{custom-fn}\comment{}
\marg{\comment{}
  \gls{GlsXtrUseAbbrStyleSetup}\marg{\abbrstyle{short-sc-footnote-desc}}\comment{}
}\comment{}
\marg{\comment{}
  \gls{GlsXtrUseAbbrStyleFmts}\marg{\abbrstyle{short-sc-footnote-desc}}\comment{}
  \cmd{renewcommand}*\marg{\gls{glsxtrinlinefullformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{glsaccesslong}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}\comment{}
     \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshort}\marg{\idx{hashhash}1}}}}\comment{}
  }\comment{}
  \cmd{renewcommand}*\marg{\gls{glsxtrinlinefullplformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{glsaccesslongpl}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}%
    \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshortpl}\marg{\idx{hashhash}1}}}}\comment{}
  }%
  \cmd{renewcommand}*\marg{\gls{Glsxtrinlinefullformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{Glsaccesslong}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}\comment{}
     \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshort}\marg{\idx{hashhash}1}}}}\comment{}
  }\comment{}
  \cmd{renewcommand}*\marg{\gls{Glsxtrinlinefullplformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{Glsaccesslongpl}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}\comment{}
    \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshortpl}\marg{\idx{hashhash}1}}}}\comment{}
  }\comment{}
}
\end{codebox}
(See the \sty{glossaries-extra} user manual for further details.)

This new custom style now needs to be set:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{custom-fn}
\end{codebox}
Remember that if you decide to use \gls{newabbreviation} instead 
of \gls{newacronym} then the category will be \cat{abbreviation} not \cat{acronym}:
\begin{codebox}
\gls{setabbreviationstyle}\marg{custom-fn}
\end{codebox}
This custom style simply adjusts the inline full form. There are other
adjustments to be made that apply to the inherited style. (The alternative is to
design a new style from scratch.) The footnote contains the long form followed by the
description. This is the same as the modification to an earlier
example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}\marg{\#2:
\gls{glsentrydesc}\marg{\#1}.}}
\end{codebox}
As with \samplefile{CustomAcr}, if you specifically
want the singular long form then you can ignore the second argument.
For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}
 \marg{\gls{Glsfmtlong}\marg{\#1}: \gls{glsentrydesc}\marg{\#1}.}}
\end{codebox}

The \gloskey{name} now needs to be the long form followed by the
short form in parentheses, but note the new requirement that the
short form should now be in \idx{allcaps} not \idx{smallcaps} and the
long form should start with a capital letter.
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescname}}\marg{\comment{}
  \cmd{protect}\gls{glsfirstlongfootnotefont}
    \marg{\gls{makefirstuc}\marg{\cmd{the}\gls{glslongtok}}}
  (\cmd{protect}\gls{glsuppercase}\marg{\cmd{the}\gls{glsshorttok}})\comment{}
}
\end{codebox}
The inherited \idx{abbrvstyle} uses the short form as the 
\gloskey{sort} value by default. This needs to be changed to the long form:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescsort}}\marg{\cmd{the}\strong{\gls{glslongtok}}}
\end{codebox}

\begin{bib2gls}
If you want to switch to using \app{bib2gls}, remember to set the
\idx{abbrvstyle} before the resource command and change the
default sort fallback field to \gloskey{long}, as with
\samplefile{AcrDesc}.
\end{bib2gls}

\filedef{sample-dot-abbr.tex}
This document illustrates how to use the base
\idx{postlinkhook} to adjust the space factor after \idxpl{acronym}.
\begin{terminal}
pdflatex sample-dot-abbr
makeglossaries sampledot-abbrf
pdflatex sample-dot-abbr
\end{terminal}
This example creates a custom storage key that provides a similar
function to \sty{glossaries-extra}['s] \gloskey{category} key.

\glsxtrnote
This example is much simpler with \sty{glossaries-extra}. The custom
storage key, which is defined using:
\begin{codebox}
\gls{glsaddstoragekey}\marg{abbrtype}\marg{word}\marg{\cmd{abbrtype}}
\end{codebox}
can now be removed.

The \gloskey{category} key is set to \qt{initials} for
the initialisms (which are defined with the custom \csfmt{newacr}
command). The \idxpl{abbrvstyle} can be set with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{setabbreviationstyle}\oarg{initials}\marg{\abbrstyle{long-short}}
\end{codebox}
The \catattr{discardperiod} \idx{categoryattribute} will discard any \idx{fullstop}
(period) following commands like \gls{gls}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{initials}\marg{\catattr{discardperiod}}\marg{true}
\end{codebox}
(If you want to use the \catattr{noshortplural} attribute then you will
also need to set the \catattr{pluraldiscardperiod} attribute.)

The \idx{firstuse} is governed by the \catattr{retainfirstuseperiod}
\idx{categoryattribute}. If set, the period won't be discarded if it follows the
\idx{firstuse} of commands like \gls{gls}. This is useful for styles
where the \idx{firstuse} doesn't end with the short form. In this
case, the \idx{firstuse} of the \abbrstyle{long-short} style ends
with a closing parenthesis, so the end of sentence might be clearer
if the period is retained:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{initials}\marg{\catattr{retainfirstuseperiod}}\marg{true}
\end{codebox}

The \catattr{insertdots} \idx{categoryattribute} can automatically insert dots into
the short form with a final space factor adjustment:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{initials}\marg{\catattr{insertdots}}\marg{true}
\end{codebox}

The custom helper command defined in the example needs to be
slightly modified:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newabbr}}[1][]\marg{\comment{}
 \strong{\gls{newabbreviation}}\oarg{\strong{\gloskey{category}}=initials,\#1}}
\end{codebox}
The definitions need to be slightly modified to work with the
\catattr{insertdots} \idxc{categoryattribute}{attribute}:
\begin{codebox}
\cmd{newabbr}\marg{eg}\marg{\strong{eg}}\marg{eg}
\cmd{newabbr}\marg{ie}\marg{\strong{ie}}\marg{ie}
\cmd{newabbr}\marg{bsc}\marg{\strong{B\marg{Sc}}}\marg{Bachelor of Science}
\cmd{newabbr}\marg{ba}\marg{\strong{BA}}\marg{BA}
\cmd{newabbr}\marg{agm}\marg{\strong{AGM}}\marg{AGM}
\end{codebox}
(This makes it much easier to change your mind if you decide at a
later date to omit the dots, especially if you are storing all your
definitions in a file that's shared across multiple documents, but
note the need to group \qt{Sc}.)

The \qt{laser} definition remains unchanged:
\begin{codebox}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\end{codebox}
The remaining code in the \idxf{documentpreamble} must now be removed. (It will
interfere with \sty{glossaries-extra}['s] category post-link hooks.)
No change is required in the document body.

See the \sty{glossaries-extra} user manual for further details about
\idxpl{categoryattribute} and post-link hooks.

\filedef{sample-font-abbr.tex}
This document illustrates how to have different fonts
for \idxpl{acronym} within the style. The document build is:
\begin{terminal}
pdflatex sample-font-abbr
makeglossaries sample-font-abbr
pdflatex sample-font-abbr
\end{terminal}
The \idx{acronym} mechanism provided by the base \sty{glossaries}
package isn't well suited to having a mixture of styles. This
example provides a workaround that involves defining a new storage
key with \gls{glsaddstoragekey} that's used to hold the font
declaration (such as \csfmt{em}).
\begin{codebox}
\gls{glsaddstoragekey}\marg{font}\marg{}\marg{\cmd{entryfont}}
\end{codebox}
A new custom \idx+{acronymstyle} is defined that fetches the font
information from this new key so that it can be applied to the
\idx{acronym}. Some helper commands are also provided to define the
different types of \idxpl{acronym}:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newitabbr}}[1][]\marg{\gls{newacronym}\oarg{font=\cmd{em},\#1}}
\cmd{newcommand}*\marg{\cmd{newupabbr}}\marg{\gls{newacronym}}
\codepar
\cmd{newitabbr}\marg{eg}\marg{e.g.}\marg{exempli gratia}
\cmd{newupabbr}\marg{bsc}\marg{BSc}\marg{Bachelor of Science}
\end{codebox}
This makes the \idx{firstuse} of \code{\gls{gls}\marg{eg}} appear as \qt{exempli
gratia (\emph{e.g.})} whereas the \idx{firstuse} of \code{\gls{gls}\marg{bsc}}
is \qt{Bachelor of Science (BSc)}.

\glsxtrnote
This example document is much simpler with \sty{glossaries-extra}.
First the \csfmt{usepackage} command needs adjusting:
\begin{codebox}
\cmd{usepackage}[\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}
The custom storage key can now be removed and also the custom
\idx{acronymstyle}. Now replace the \gls{setacronymstyle} line with:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-em}}
\end{codebox*}
and change the definition of the helper commands:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newitabbr}}\marg{\gls{newacronym}}
\cmd{newcommand}*\marg{\cmd{newupabbr}}\marg{\strong{\gls{newabbreviation}}}
\end{codebox}
Note that the \code{font=\cmd{em},} part has been removed from the
definition of the first command and the second command uses
\gls{newabbreviation} instead of \gls{newacronym}. This means that
\csfmt{newitabbr} will default to
\gloskeyval{category}{\cat{acronym}} and \csfmt{newupabbr} will
default to \gloskeyval{category}{\cat{abbreviation}}. The
default style for the \cat{abbreviation} category is
\abbrstyle{long-short}, which is the required style for this
example. This just means that only the \cat{acronym} category needs
to have the style set (with the above \gls{setabbreviationstyle}
command).

Finally, the \gls{acrshort}, \gls{acrlong} and \gls{acrfull} commands
need to be replaced with \gls{glsxtrshort}, \gls{glsxtrlong} and
\gls{glsxtrfull}.

You may notice that the spacing after \qt{e.g\@.} and \qt{i.e\@.}
isn't correct. This is similar to the \samplefile{-dot-abbr} example
where the space factor needs adjusting. In this case I've inserted
the dots manually (rather than relying on the \catattr{insertdots}
\idxc{categoryattribute}{attribute}). You can either remove the dots 
and use \catattr{insertdots} with \catattr{discardperiod}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{insertdots}}\marg{true}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{discardperiod}}\marg{true}
\codepar
\cmd{newitabbr}\marg{eg}\marg{\strong{eg}}\marg{exempli gratia}
\cmd{newitabbr}\marg{ie}\marg{\strong{ie}}\marg{id est}
\end{codebox}
Or you can manually insert the space factor adjustment with \gls{cs.at} and only use
the \catattr{discardperiod} \idxc{categoryattribute}{attribute}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{discardperiod}}\marg{true}
\codepar
\cmd{newitabbr}\marg{eg}\marg{e.g.\strong{\gls{cs.at}}}\marg{exempli gratia}
\cmd{newitabbr}\marg{ie}\marg{i.e.\strong{\gls{cs.at}}}\marg{id est}
\end{codebox}

You don't have to use the \cat{acronym} category. You may prefer a
different label that fits better semantically. For example:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\strong{latinabbr}}\marg{\abbrstyle{long-short-em}}
\cmd{newcommand}*\marg{\cmd{new\strong{latin}abbr}}[1][]\marg{\gls{newabbreviation}\oarg{\gloskeyval{category}{\strong{latinabbr}},\#1}}
\gls{glssetcategoryattribute}\marg{\strong{latinabbr}}\marg{\catattr{insertdots}}\marg{true}
\gls{glssetcategoryattribute}\marg{\strong{latinabbr}}\marg{\catattr{discardperiod}}\marg{true}
\codepar
\cmd{new\strong{latin}abbr}\marg{eg}\marg{e.g.\strong{\gls{cs.at}}}\marg{exempli gratia}
\cmd{new\strong{latin}abbr}\marg{ie}\marg{i.e.\strong{\gls{cs.at}}}\marg{id est}
\end{codebox}

\section{Non-Page Locations}
\label{sec:samplecounter}

\filedef{sampleEq.tex}
This document illustrates how to change the \idx{entrylocation} to something
other than the page number. In this case, the \ctr{equation} counter
is used since all \idxpl{glossaryentry} appear inside an \env{equation}
environment. To create the document do:
\begin{terminal}
pdflatex sampleEq
makeglossaries sampleEq
pdflatex sampleEq
\end{terminal}
The \sty{glossaries} package provides some \idxpl{locationformat}, such
as \encap{hyperrm} and \encap{hyperbf}, that allow the \locations\ in the
\idx{numberlist} to \idx{hyperlink} to the appropriate place in the document (if
\sty{hyperref} has been used). Since it's not possible to include
the \idx{hyperlink} name in the \idx{indexing} information with \app{makeindex}
and \app{xindy}, the \sty{glossaries} package has to reform the
name from a prefix and the \location\ value.

Unfortunately it's not always possible to split the link name into a
prefix and location.  That happens with the \ctr{equation}
counter in certain classes, such as the \cls{report} class (which
is used in this example). This means that it's necessary to redefine
\theHcounter{equation} so that it has a format that fits the requirement:
\begin{codebox}
\cmd{renewcommand}*\theHcounter{equation}\marg{\theHcounter{chapter}.\gls{arabic}\marg{equation}}
\end{codebox}
If you don't do this, the equation \locations\ in the \idx{glossary} won't
form valid \idxpl{hyperlink}.

Each \idx{glossaryentry} represents a mathematical symbol. This means
that with \options{noidx,mkidx,xdy} it's necessary to use the \gloskey{sort} key.
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\gloskeyval{description}{Gamma function},\strong{\gloskeyval{sort}{Gamma}}}
\end{codebox}

\bibglsnote
If you want to switch to using \app{bib2gls}, the first change you
need to make is to switch from explicitly loading
\sty{glossaries} to loading \sty{glossaries-extra} with the
\opt{record} package option. If \optval{record}{only} (or
\opt{record} without a value) is used, then the above
redefinition of \theHcounter{equation} is still required. If
\optval{record}{nameref} is used instead then the redefinition of
\theHcounter{equation} isn't required. You may also want to use the
\opt{stylemods} and \opt{postdot} options:
\begin{codebox}
\cmd{usepackage}[\strong{\optval{record}{nameref}},\opt{stylemods},\opt{postdot},
 \opt{ucmark},\optval{style}{\glostyle{long3colheader}},\optval{counter}{\ctr{equation}}]\marg{\strong{glossaries-extra}}
\end{codebox}
The entries now need to be converted into the \ext{bib} format required 
by \app{bib2gls}, which can be done with \app{convertgls2bib}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampleEq.tex entries.bib
\end{terminal}
This will create a file called \filefmt{entries.bib} that starts:
\begin{codebox}
\comment{Encoding: UTF-8}
\atentry{entry}\marg{Gamma,
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
  \gloskeyval{description}{Gamma function}
}
\end{codebox}
You may prefer to change \atentry{entry} to \atentry{symbol}. (This
should be easy to do with your text editor's search and replace
function.)

Note that the \gloskey{sort} key has been omitted. This is because
it typically shouldn't be used. The difference between using
\atentry{entry} and \atentry{symbol} is that with \atentry{entry}
the sort value will be obtained from the \gloskey{name} but with
\atentry{symbol} the sort value will be obtained from the label.
If you explicitly use the \gloskey{sort} key then you will break
this behaviour. (If you try this example out, notice the difference
in the ordering if you switch between \atentry{entry} and
\atentry{symbol}. See also \bibglsgallery{sorting}.)

Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
If you have used \optval{record}{nameref} then you can remove the
redefinition of \theHcounter{equation}. Next remove all the lines
defining the glossary entries (since they're now defined in the
\ext{bib} file). 

Finally, replace \gls{printglossary} with \gls{printunsrtglossary}:
\begin{codebox}
\strong{\gls{printunsrtglossary}}\oarg{\printglossoptvalm{title}{Index of Special Functions and Notations}}
\end{codebox}
The rest of the document remains unchanged (unless you want to use
\gls{glsxtrfmt} as described in the following example).

\filedef{sampleEqPg.tex}
This is similar to the previous example, but the \idxpl{numberlist} are a
mixture of page numbers and equation numbers. This example adds the
\idx{glossary} to the \idx{tableofcontents}, so an extra \LaTeX\ run is
required:
\begin{terminal}
pdflatex sampleEqPg
makeglossaries sampleEqPg
pdflatex sampleEqPg
pdflatex sampleEqPg
\end{terminal}
As with the previous example, entries are defined like this:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\gloskeyval{description}{Gamma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
The \optval{counter}{\ctr{equation}} package option is used to set the
default indexing counter to \ctr{equation}. This means that it
has to be changed for \idx{indexing} outside of any numbered equation. For
example:
\begin{codebox}
\gls{glslink}\oarg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}\marg{Gamma}\marg{gamma function}
\end{codebox}
I've set the \glsopt{format} to \encap{hyperbf} to indicate that
this is a primary reference. (Note that I'm using \encap{hyperbf} not
\encap{textbf} in order to include a \idx{hyperlink} in the location.)

The \idx{linktext} here is almost identical to the
description. The only difference is that the description starts with
a capital (\idx{sentencecase}). If it started with a \idx{lowercase} character instead, I could
simply use \gls{glsdesc} instead of \gls{glslink}. If I change the
entry descriptions so that they all start with a \idx{lowercase} letter
then I would need to create a custom \idx{glossarystyle} that used
\gls{Glossentrydesc} instead of \gls{glossentrydesc}.

\glsxtrnote
If I switch to using \sty{glossaries-extra} I wouldn't need a new
\idx{glossarystyle}. Instead I could just use the \catattr{glossdesc}
\idx{categoryattribute} to perform the \idx{casechange}. Remember that the first change
to make is to replace \sty{glossaries} with
\sty{glossaries-extra}:
\begin{codebox}
\cmd{usepackage}\oarg{\optval{style}{\glostyle{long3colheader}},\strong{\opt{postdot},\opt{stylemods}},
            \optval{counter}{\ctr{equation}}}\marg{\strong{glossaries-extra}}
\end{codebox}
The entries are now all defined so that the description starts with
a lowercase letter (except for the descriptions that start with a
proper noun). For example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\gloskeyval{description}{\strong{g}amma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
The \catattr{glossdesc} \idx{categoryattribute} needs setting:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossdesc}}\marg{firstuc}
\end{codebox}
This means that I can now use \gls{glsdesc} instead of \gls{glslink}.

It's a bit cumbersome typing \code{\oarg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}}
for each primary reference, but \sty{glossaries-extra} provides a
convenient way of having a third modifier for commands like \gls{gls}
and \gls{glstext}. This needs to be a single punctuation character
(but not \code{*} or \code{+} which are already in use). For
example:
\begin{codebox}
\gls{GlsXtrSetAltModifier}\marg{\strong{!}}\marg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}
\end{codebox}
Now \code{\gls{glsdesc}\strong{!}\marg{Gamma}} is equivalent to:
\begin{codebox}
\gls{glsdesc}\oarg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}\marg{Gamma}
\end{codebox}
So the text at the start of the \qt{Gamma Functions} chapter is now
just:
\begin{codebox}
The \gls{glsdesc}!\marg{Gamma} is defined as
\end{codebox}
which is much more compact. Similar changes can be made for the
other instance of \gls{glslink} where the \idx{linktext} is just
the description:
\begin{codebox}
The \gls{glsdesc}!\marg{erf} is defined as
\end{codebox}

There are three other instances of \gls{glslink}, such as:
\begin{codebox}
\gls{glslink}\marg{Gamma}\marg{\cmd{Gamma}(x+1)}
\end{codebox}
If I just use \code{\gls{gls}\marg{Gamma}} then I would get $\Gamma(z)$ as the
\idx{linktext}. For entries like this that represent functions with
variable parameters it would be more convenient (and help with
consistency) if a command was available to easily replace the
parameters.

With the base \sty{glossaries} package, one simple solution that
works for this example is to save just the function symbol in the 
\gloskey{symbol} field, for example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\strong{\gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{Gamma}}},}
\gloskeyval{description}{gamma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
and then use:
\begin{codebox}
\strong{\gls{glssymbol}}\marg{Gamma}\strong[(\cmd{Gamma}(x+1))\strong]
\end{codebox}
(which includes the function parameter inside the \idx{linktext}) or just:
\begin{codebox}
\gls{glssymbol}\marg{Gamma}(\cmd{Gamma}(x+1))
\end{codebox}
(which has the function parameter after the \idx{linktext}).
This is a convenient approach where the extra material can simply
follow the symbol, and it can also be used with \sty{glossaries-extra}.

The \sty{glossaries-extra} package provides another possibility. It
requires a command that takes a single argument, for example:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{Gammafunction}}[1]\marg{\cmd{Gamma}(\#1)}
\end{codebox}
The control sequence name (the command name without the leading
backslash) is stored in the field identified by the command \gls{GlsXtrFmtField}
(this should be the internal field name not the key name, see \tableref{tab:fieldmap}). The
default is \glosfield{useri} which corresponds to the \gloskey{user1}
key. This means that the \qt{Gamma} entry would need to be
defined with \gloskeyval{user1}{Gammafunction}. With this approach, each
function entry would need a separate associated command.

Another approach is to store the parameterless function in the
\gloskey{symbol} key (as earlier) and have a more generic command that uses this
symbol. This requires the entry label, which can be obtained with
\gls{glslabel} within the \idx{linktext}:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{entryfunc}}[1]\marg{\gls{glsentrysymbol}\marg{\gls{glslabel}}(\#1)}
\end{codebox}
(Obviously, this command can't be used outside of the \idx{linktext}
or post-link hooks since it uses \gls{glslabel}.)

So the entry now needs the parameterless function in 
\gloskey{symbol} and the control sequence name of this generic
command in \gloskey{user1}. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\strong{\gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{Gamma}}},\gloskeyval{user1}{entryfunc},}
\gloskeyval{description}{gamma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
(This doesn't need to be done for the \qt{C} and \qt{G}
entries since they're constants not functions.)

You may want to consider providing helper commands to make the
functions easier to define. For example:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{func}}[2]\marg{\#1(\#2)}
\cmd{newcommand}\marg{\cmd{entryfunc}}[1]\marg{\cmd{func}\marg{\gls{glsentrysymbol}\marg{\gls{glslabel}}}\marg{\#1}}
\cmd{newcommand}\marg{\cmd{newfunc}}[5][]\marg{\comment{}
 \gls{newglossaryentry}\marg{\#2}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{func}\marg{\#3}\marg{\#4}}},
   \gloskeyval{symbol}{\#3},
   \gloskeyval{user1}{entryfunc},
   \gloskeyval{description}{\#5},
   \gloskeyval{sort}{\#2},\#1
 }\comment{}
}
\end{codebox}
The entries can now be defined using this custom \csfmt{newfunc}
command. For example:
\begin{codebox}
\cmd{newfunc}\marg{Gamma}\marg{\cmd{Gamma}}\marg{z}\marg{gamma function}
\cmd{newfunc}[\gloskeyval{sort}{gamma1}]\marg{gamma}\marg{\cmd{gamma}}\marg{\cmd{alpha},x}\marg{lower 
  incomplete gamma function}
\cmd{newfunc}[\gloskeyval{sort}{Gamma2}]\marg{iGamma}\marg{\cmd{Gamma}}\marg{\cmd{alpha},x}\marg{upper 
  incomplete gamma function}
\end{codebox}

Note that in \csfmt{newfunc} the \gloskey{symbol} key doesn't have its value
encapsulated with \gls{ensuremath} so \gls{glssymbol} will need to explicitly be
placed in \idx{mathmode}. If you switch to a \idx{glossarystyle} that displays
the symbol, you will either need to adjust the definition of
\csfmt{newfunc} to use \gls{ensuremath} in the \gloskey{symbol} field
or you can add the encapsulation with the \catattr{glosssymbolfont}
\idx{categoryattribute}.

Now \code{\gls{glslink}\marg{Znu}\marg{Z\_\cmd{nu}}} can simply be replaced with
\code{\gls{glssymbol}\marg{Znu}} (no parameter is required in
this case). For the other cases, where the parameter is different
from that given in the \gloskey{text} field (which is obtained from
the \gloskey{name}), you can use \gls{glsxtrfmt}. For example, 
\code{\gls{glslink}\marg{Gamma}\marg{\cmd{Gamma}(x+1)}} can now be replaced with:
\begin{codebox}
\gls{glsxtrfmt}\marg{Gamma}\marg{x+1}
\end{codebox}
This effectively works like \gls{glslink} but omits the post-link hook.
(See the \sty{glossaries-extra} user manual for further details.)

\begin{important}
Don't use \gls{glsxtrfmt} within the argument of another \gls{glsxtrfmt} command
(or inside any other \idx{linktext}).
\end{important}

Similarly \code{\gls{glslink}\marg{Gamma}\marg{\cmd{Gamma}(\cmd{alpha})}}
can now be replaced with:
\begin{codebox}
\gls{glsxtrfmt}\marg{Gamma}\marg{\cmd{alpha}}
\end{codebox}
Note that it's still possible to use:
\begin{codebox}
\gls{glssymbol}\marg{Gamma}[(\cmd{alpha})]
\end{codebox}
You may prefer to define a helper command that makes it easier to
switch between your preferred method. For example:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{Fn}}[3][]\marg{\gls{glssymbol}\oarg{\#1}\marg{\#2}[(\#3)]}
\end{codebox}
or:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{Fn}}[3][]\marg{\gls{glsxtrfmt}\oarg{\#1}\marg{\#2}\marg{\#3}}
\end{codebox}

\bibglsnote
If you want to convert this example so that it works with \app{bib2gls}, first
convert it to use \sty{glossaries-extra} (as described above), and
then follow the instructions from \samplefile{Eq}. The
\app{convertgls2bib} application recognises \csfmt{newcommand} so it
will be able to parse the custom \csfmt{newfunc} commands.

Note that \app{bib2gls} allows you to separate the \locations\ in
the \idx{numberlist} into different groups according to the
\idxc{locationcounter}{counter} used for the location. This can be
done with the \resourceopt{loc-counters} resource option. It's also
possible to identify primary \idxc{locationencap}{formats} (such as
\encap{hyperbf} used in this example) using the
\resourceopt{primary-location-formats} option. The primary
\locations\ can then be given a more prominent position in the
\idx{numberlist}.  See the \app{bib2gls} user manual for further
details.

\filedef{sampleSec.tex}
This document also illustrates how to change the \location\ to something other than the
page number. In this case, the \ctr{section} counter is used.
This example adds the \idx{glossary} to the \idx{tableofcontents}, so an extra
\LaTeX\ run is required:
\begin{terminal}
pdflatex sampleSec
makeglossaries sampleSec
pdflatex sampleSec
pdflatex sampleSec
\end{terminal}
Note that there are conflicting \idxpl{locationformat}, 
which trigger a warning from \app{makeindex}:
\begin{terminal}
\#\# Warning (input = sampleSec.glo, line = 6; output = sampleSec.gls, line = 9):
   -- Conflicting entries: \idxpl{multipleencap} for the same page under same key.
\codepar
\#\# Warning (input = sampleSec.glo, line = 2; output = sampleSec.gls, line = 10):
   -- Conflicting entries: \idxpl{multipleencap} for the same page under same key.
\end{terminal}
This is the result of \idx{indexing} an entry multiple times for the same
\location\ with different values of the \glsopt{format} key (\idxpl{encap}). 
(\app{makeindex} assumes that the \location\ is a page number)

In this case, it's caused by three references to the \qt{ident} entry in section~2.1:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\encap{hyperit}}}\marg{ident}
\gls{glspl}\marg{ident} \comment{default \glsoptval{format}{\encap{glsnumberformat}}}
\gls{gls}*\oarg{\glsoptval{format}{\encap{hyperbf}}}\marg{ident}
\end{codebox}

If you use the \app{makeglossaries} Perl script it will detect the warnings in the
\app{makeindex} transcript file and attempt to fix the conflict by
removing entries from the \ext{glo} file:
\begin{transcript}
\Idxpl{multipleencap} detected. Attempting to remedy.
Reading sampleSec.glo...
Writing sampleSec.glo...
Retrying
\end{transcript}
(Range formats have highest precedence. The default \encap{glsnumberformat}
has the lowest precedence.)

If you use \app{makeglossaries-lite} or call
\app{makeindex} directly then the problem won't be fixed and the
\idx{glossary} will end up with the rather odd \idx{numberlist} for the
identity matrix entry consisting of three references to section 2.1:
the first in the default font, followed by bold (\encap{hyperbf})
and then italic (\encap{hyperit}), which results in 2.1,
\textbf{2.1}, \textit{2.1}.  If you use \app{makeglossaries} then
only the bold entry (\textbf{2.1}) will be present.  However, 
if you don't want the problem corrected, call
\app{makeglossaries} with the \mkglsopt{e} switch.

If you switch to \app{xindy}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{xindy}},\optval{style}{\glostyle{altlist}},\opt{toc},\optval{counter}{\ctr{section}}]\marg{glossaries}
\end{codebox}
then the conflict will be resolved using the number format \idxc{xindyattr}{attribute}
list order of priority. In this case, \encap{glsnumberformat} has
the highest priority. This means that only the upright medium weight entry
(2.1) will be present. The simplest way of altering this is to
provide your own custom format. For example:
\begin{codebox}
\cmd{newcommand}*\marg{\strong{\cmd{primary}}}[1]\marg{\gls{hyperit}\marg{\#1}}
\gls{GlsAddXdyAttribute}\marg{\strong{primary}}
\end{codebox}
and change \code{\gls{gls}\oarg{\glsoptval{format}{hyperit}}} to
\code{\gls{gls}\oarg{\glsoptval{format}{\strong{primary}}}} etc.
This will give \glsoptval{format}{primary} the highest priority.
(It's also better practice to provide this kind of semantic command.)

With \app{bib2gls}, you can supply rules to deal with 
\idx{locationformat} conflicts, as illustrated below.

\bibglsnote
In order to switch to \app{bib2gls}, first replace
\sty{glossaries} with \sty{glossaries-extra}, and add the \opt{record} 
package option. Remember that \sty{glossaries-extra} has a different
set of defaults and you may also want to patch the predefined base styles.
For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{altlist}},\strong{\opt{postdot},\opt{stylemods}},\optval{counter}{\ctr{section}}]
\marg{\strong{glossaries-extra}}
\end{codebox}

The entry definitions now need to be converted into \app{bib2gls}
format and saved in a \ext{bib} file (say, \filefmt{entries.bib}). You can use 
\app{convertgls2bib}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampleSec.tex entries.bib
\end{terminal} 

Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
and remove all the \gls{newglossaryentry} commands.

Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.
The document build is now:
\begin{terminal}
pdflatex sampleSec
bib2gls sampleSec
pdflatex sampleSec
\end{terminal}
As with the original example, there's still a location format
conflict, which \app{bib2gls} warns about:
\begin{transcript}
Warning: Entry location conflict for formats: \encap{hyperbf} and \encap{hyperit}
Discarding: \marg{ident}\marg{}\marg{\ctr{section}}\marg{\encap{hyperbf}}\marg{2.1}
Conflicts with: \marg{ident}\marg{}\marg{\ctr{section}}\marg{\encap{hyperit}}\marg{2.1}
\end{transcript}
This means that it has discarded the bold location and kept the
italic one. (As with \app{makeglossaries}, range formats have the
highest priority and \encap{glsnumberformat} has the lowest.)

It would be better if the conflict could be merged into
a single location that was both bold and italic. To achieve this,
it's first necessary to define a command that produces this effect:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{hyperbfit}}[1]\marg{\cmd{textbf}\marg{\gls{hyperit}\marg{\#1}}}
\end{codebox}
Now \app{bib2gls} needs to be invoked with the appropriate mapping
with the \switch{map-format} or \bibglsopt{m} switch:
\begin{terminal}
bib2gls \bibglsopt{m} \glsquote{hyperbf:hyperbfit,hyperit:hyperbfit} sampleSec
\end{terminal}
If you are using \app{arara} the directive should be:
\begin{codebox}
\araraline{bib2gls: \marg{ mapformats: [ [hyperbf, hyperbfit],
\araracont [hyperit, hyperbfit] ] }}
\end{codebox}

If you try out this example, notice the difference between
\optval{record}{only} and \optval{record}{nameref}. If you use the
latter, the \locations\ will now be the section titles rather than the
section numbers. If you use the \optval{record}{nameref} setting you can customize the
\location\ by defining the command:
\begin{codebox}
\gls{glsxtrcounterlocfmt}\margm{location}\margm{title}
\end{codebox}

In this case the counter is \ctr{section}, so the command should be 
\glsxtrcounterlocfmt{section}. It takes two arguments: the first is the
location and the second is the title. For example:
\begin{codebox*}
\cmd{newcommand}*\marg{\glsxtrcounterlocfmt{section}}[2]\marg{\gls{S}\#1 \#2}
\end{codebox*}
(The only command of this type that is defined by default is the one
for the \ctr{equation} counter, \glsxtrcounterlocfmt{equation}.) Make sure 
that you have at least version 1.42 of \sty{glossaries-extra}.

\section{Multiple Glossaries}
\label{sec:samplestype}

See also \samplefile{Sort} in \sectionref{sec:samplessort}, which
has three glossaries.

\filedef{sampleNtn.tex}
This document illustrates how to create an additional \idx{glossary}
type. This example adds the \idx{glossary} to the
\idx{tableofcontents}, so an extra \LaTeX\ run is required:
\begin{terminal}
pdflatex sampleNtn
makeglossaries sampleNtn
pdflatex sampleNtn
pdflatex sampleNtn
\end{terminal}
Note that if you want to call \app{makeindex} explicitly instead of
using the \app{makeglossaries} or \app{makeglossaries-lite}
scripts then you need to call \app{makeindex} twice:
\begin{enumerate}
\item Create the \glostype{main} glossary (all on one line):
\begin{terminal}
makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
\end{terminal}
\item Create the secondary glossary (all on one line):
\begin{terminal}
makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.not sampleNtn.ntn
\end{terminal}
\end{enumerate}
This document creates a new glossary using:
\begin{codebox}
\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Notation}
\end{codebox}
This defines a \idx{glossary} that can be identified with the label
\qt{notation} with the default title \qt{Notation}. The other
arguments are the file extensions required with \options{mkidx,xdy}. For those
two options, the \sty{glossaries} package needs to know the input
and output files required by \app{makeindex} or \app{xindy}. 

(The optional argument is the file extension of the \idx{indexing}
transcript file, which \sty{glossaries} doesn't need to know about
(unless \opt{automake} is used), but it writes the information to
the \ext{aux} file for the benefit of \app{makeglossaries} and
\app{makeglossaries-lite}.)

If you switch to a different \idx{indexing} option then these file extensions
aren't required, in which case it's simpler to use the starred form:
\begin{codebox}
\gls{newglossary*}\marg{notation}\marg{Notation}
\end{codebox}

This example uses a label prefixing system to differentiate
between the different types of entries.  (If you use
\sty{babel} with a language that makes 
\idx{colon} active you will need to change the prefix.)
For example, the term
\qt{set} is defined as:
\begin{codebox}
\gls{newglossaryentry}\marg{gls:set}\marg{\gloskeyval{name}{set},
\gloskeyval{description}{A collection of distinct objects}}
\end{codebox}
and the set notation is defined as:
\begin{codebox}
\gls{newglossaryentry}\marg{not:set}\marg{\gloskeyval{type}{notation},
\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
\gloskeyval{description}{A \gls{gls}\marg{gls:set}},\gloskeyval{sort}{S}}
\end{codebox}
Notice that the latter description contains \gls{gls}. This means
you shouldn't use \gls{glsdesc} with this entry otherwise you will
end up with nested links.

\glsxtrnote
The \sty{glossaries-extra} package provides a command for use in
within field values to prevent nested \idx{linktext}:
\begin{codebox}
\gls{glsxtrp}\margm{field}\margm{label}
\end{codebox}
There are convenient shortcuts for common fields:
\code{\gls{glsps}\margm{label}} (for the \gloskey{short} field) and 
\code{\gls{glspt}\margm{label}} (for the \gloskey{text}
field). So the set notation definition can be modified:
\begin{codebox}
\gls{newglossaryentry}\marg{not:set}\marg{\gloskeyval{type}{notation},
\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
\gloskeyval{description}{A \strong{\gls{glspt}\marg{gls:set}}},\gloskeyval{sort}{S}}
\end{codebox}
This will stop the inner reference from causing interference if you use \gls{glsdesc}.
It will also suppress \idx{indexing} within the \idx{glossary} but will have a
\idx{hyperlink} (if \sty{hyperref} is used).

The \sty{glossaries-extra} package provides a way of defining
commands like \gls{gls} that automatically insert a prefix. For
example:
\begin{codebox}
\gls{glsxtrnewgls}\marg{not:}\marg{\cmd{sym}}
\gls{glsxtrnewglslike}\marg{gls:}\marg{\cmd{term}}\marg{\cmd{termpl}}\marg{\cmd{Term}}\marg{\cmd{Termpl}}
\end{codebox}
(there's no point providing commands for plural or \casechanging\
with symbols).  Now \code{\gls{gls}\marg{not:set}} can be replaced
with \code{\cmd{sym}\marg{set}} and \code{\gls{gls}\marg{gls:set}}
can be replaced with \code{\cmd{term}\marg{set}}.

\bibglsnote
These two commands are primarily provided for the benefit of \app{bib2gls} as
the information is written to the \ext{aux} file. This allows
\app{bib2gls} to recognise the custom commands if they have been
used in the \ext{bib} files. When combined with
\resourceopt{label-prefix} and \resourceopt{ext-prefixes} (see
below) this makes it much simpler to change the prefixes if
necessary.

If you want to convert this document to use \app{bib2gls}, remember
that you need the \opt{record} or \optval{record}{nameref}
option. For example:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},}\opt{postdot},\opt{stylemods}]\marg{glossaries-extra}
\end{codebox}
As with earlier examples, \app{convertgls2bib} can be used to
convert the entry definitions into the required \ext{bib} format.
You may prefer to split the entries into separate files according to
type. (Requires at least \app{bib2gls} v2.0.) This is useful 
if you want to reuse a large database of
entries across multiple documents as it doesn't lock you into using
a specific glossary.  For example:
\begin{terminal}
convertgls2bib \switch{split-on-type} \switch{preamble-only} sampleNtn.tex entries.bib
\end{terminal}
This will create a file called \filefmt{entries.bib} that contains
the entries that didn't have a \gloskey{type} assigned in the original
file, such as:
\begin{codebox}
\atentry{entry}\marg{gls:set,
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of distinct objects}
}
\end{codebox}
It will also create a file called \filefmt{notation.bib} that
contains the entries that had the \gloskey{type} set to
\qt{notation} in the original file, such as:
\begin{codebox}
\atentry{entry}\marg{not:set,
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
  \gloskeyval{description}{A \gls{glspt}\marg{gls:set}}
}
\end{codebox}
Note that the \gloskey{type} field has been removed. The above entry
in the \filefmt{notation.bib} file references a term in the
\filefmt{entries.bib} file. It's possible to strip all the
prefixes from the \ext{bib} files and get \app{bib2gls} to
automatically insert them. In which case, this cross-reference needs
adjusting to indicate that it's referring to an entry in another
file. This can be done with one of the special
\xtroptfmt{ext\meta{n}.}\ prefixes:
\begin{codebox}
\atentry{entry}\marg{\strong{set},
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
  \gloskeyval{description}{A \gls{glspt}\marg{\strong{\xtrfmt{ext1.}}set}}
}
\end{codebox}
The corresponding term in the \filefmt{entries.bib} file is now:
\begin{codebox}
\atentry{entry}\marg{\strong{set},
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of distinct objects}
}
\end{codebox}

Now you can replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\strong{\resourceoptvalm{label-prefix}{gls:}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{notation},\resourceoptval{type}{notation},
 \strong{\resourceoptvalm{label-prefix}{not:},\resourceoptvalm{ext-prefixes}{gls:}}}
\end{codebox}
Remove all the \gls{newglossaryentry} definitions and replace 
\gls{printglossaries} with \gls{printunsrtglossaries}.

Regardless of how many resource sets the document contains, only one
\app{bib2gls} call is required:
\begin{terminal}
pdflatex sampleNtn
bib2gls sampleNtn
pdflatex sampleNtn
\end{terminal}

You may notice that the ordering in the notations list has changed
from the original. This is because the \gloskey{sort} field was
automatically removed by \app{convertgls2bib}, so the entries are
now sorted according to the \gloskey{name} field (since they are
defined with \atentry{entry}). You can use your text editor's search
and replace function to replace all instances of \atentry{entry}
with \atentry{symbol} in the \filefmt{notations.bib} file so that,
for example, the \qt{set} definition becomes:
\begin{codebox}
\strong{\atentry{symbol}}\marg{set,
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
  \gloskeyval{description}{A \gls{glspt}\marg{\xtrfmt{ext1.}set}}
}
\end{codebox}
Now these \atentry{symbol} entries will be sorted according to their
label. (The original label in the \ext{bib} file, not the
prefixed label.) This will put them in the same order as the original
document. (See the \qt{Examples} chapter of
the \app{bib2gls} user manual for examples of varying the sorting
and also \bibglsgallery{sorting}.)

\filedef{sample-dual.tex}
This document illustrates how to define an entry that both appears in the list of
acronyms and in the \glostype{main} glossary. To create the document do:
\begin{terminal}
pdflatex sample-dual
makeglossaries sample-dual
pdflatex sample-dual
\end{terminal}
This defines a custom command \gls{newdualentry} that defines two \idxpl{entry} 
at once (a normal \idx{entry} and an \idx{acronym}). It uses \gls{glsadd} to ensure
that if one is used then the other is automatically \indexed:
\begin{codebox}
\cmd{newcommand}*\marg{\gls{newdualentry}}[5][]\marg{\comment{}
  \comment{main entry:}
  \gls{newglossaryentry}\marg{main-\#2}\marg{\gloskeyval{name}{\#4},\comment{}
  \gloskeyval{text}{\#3\gls{glsadd}\marg{\#2}},\comment{}
  \gloskeyval{description}{\#5},\comment{}
  \#1\comment{additional options for main entry}
  }\comment{}
  \comment{\idx{acronym}:}
  \gls{newacronym}\marg{\#2}\marg{\#3\gls{glsadd}\marg{main-\#2}}\marg{\#4}\comment{}
}
\end{codebox}
A sample dual entry is defined with this command:
\begin{codebox}
\gls{newdualentry}\marg{svm}\comment{label}
  \marg{SVM}\comment{short form}
  \marg{support vector machine}\comment{long form}
  \marg{Statistical pattern recognition technique}\comment{description}
\end{codebox}
This defines an \idx{acronym} with the label \qt{svm} that can be
referenced with \code{\gls{gls}\marg{svm}} but it also defines an
\idx{entry} with the label \qt{main-svm}. This isn't used in the document with
\gls{gls} but it's automatically added from the
\code{\gls{glsadd}\marg{main-svm}} code in the short form of
\qt{svm}.

For this trivial document, this kind of dual entry is redundant and
unnecessarily leads the reader down a trail, first to the list of
acronyms and from there the reader then has to go to the \glostype{main}
glossary to look up the description. It's better to simply include
the description in the list of acronyms.

There are, however, uses for repeating \idxpl{entry} across multiple lists.
For example, this user manual defines all described commands (such
as \gls{gls}) as \idxpl{glossaryentry}. They appear in the 
\hyperref[cmdsummary]{command summary} (where the syntax is given
with a brief description and the principle \location\ in the document
where the command is described) and they also appear in the
\hyperref[index]{index} (where just the name and \idx{locationlist}
is shown).

\bibglsnote
If you want to switch over to \app{bib2gls}, first change to
\sty{glossaries-extra}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next, the definition needs to be converted to the \ext{bib}
format required by \app{bib2gls}. If you do:
\begin{terminal}
convertgls2bib \switch{preamble-only} sample-dual.tex entries.bib
\end{terminal}
then \app{convertgls2bib} will report the following:
\begin{transcript}
Overriding default definition of \gls{newdualentry} with custom 
definition. (Change \csfmt{newcommand} to \gls{providecommand} if you want 
\gls{newdualentry}\oarg{options}\marg{label}\marg{short}\marg{long}\marg{description}
converted to \atentry{dualabbreviationentry}.)
\end{transcript}
This is because \app{convertgls2bib} has its own internal definition
of \gls{newdualentry}, but if it encounters a new definition that
will override its default. If you want to retain
\app{convertgls2bib}['s] definition (recommended) then just replace
\csfmt{newcommand} with \csfmt{providecommand} in the document source and
rerun \app{convertgls2bib}.

With \csfmt{providecommand}, the new \filefmt{entries.bib} file
created by \app{convertgls2bib} contains:
\begin{codebox}
\atentry{dualabbreviationentry}\marg{svm,
  \gloskeyval{short}{SVM},
  \gloskeyval{description}{Statistical pattern recognition technique},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
If \csfmt{newcommand} is retained, it will instead contain:
\begin{codebox}
\atentry{entry}\marg{main-svm,
  \gloskeyval{name}{support vector machine},
  \gloskeyval{description}{Statistical pattern recognition technique},
  \gloskeyval{text}{SVM\gls{glsadd}\marg{svm}}
}
\codepar
\atentry{acronym}\marg{svm,
  \gloskeyval{short}{SVM\gls{glsadd}\marg{main-svm}},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
In the first case, \app{bib2gls} creates two linked entries using
its primary-dual mechanism. In the second case, \app{bib2gls}
creates two entries that simply reference each other.

Assuming that your \filefmt{entries.bib} file just contains
\atentry{dualabbreviationentry}, 
now replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{entries.bib}
  \resourceoptval{type}{\glostype{acronym}},\resourceoptval{dual-type}{\glostype{main}},\resourceoptvalm{dual-prefix}{main-}}
\end{codebox}

Then remove the definition of \gls{newdualentry} and the entry
definition. Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}.
The document build is:
\begin{terminal}
pdflatex sample-dual
bib2gls sample-dual
pdflatex sample-dual
\end{terminal}

If, instead, your \filefmt{entries.bib} file contains separate
\atentry{entry} and \atentry{acronym}, then you need:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
If you need \idxpl{numberlist}, the document build is now
\begin{terminal}
pdflatex sample-dual
bib2gls sample-dual
pdflatex sample-dual
bib2gls sample-dual
pdflatex sample-dual
\end{terminal}
and this time \app{bib2gls} complains about the use of \gls{glsadd}
within the \gloskey{short} and \gloskey{text} fields as this can be
problematic. (The extra \app{bib2gls} and \LaTeX\ calls are
to ensure the \idx{numberlist} is up to date for the
\qt{main-svm} entry, which can only be \indexed\ with \gls{glsadd}
after \qt{svm} has been defined.)

Dual entries make much more sense when one \idx{entry} is for a \idx{glossary}
with the description displayed but no \idx{numberlist} (or just a
primary \location), and the other is for the index without the
description but with a \idx{numberlist}. This can be created by
replacing \atentry{dualabbreviationentry} with
\atentry{dualindexabbreviation}:
\begin{codebox}
\atentry{dualindexabbreviation}\marg{svm,
  \gloskeyval{description}{Statistical pattern recognition technique},
  \gloskeyval{short}{SVM},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
This can be mixed with \atentry{index} terms for example:
\begin{codebox}
\atentry{index}\marg{machlearn,
   \gloskeyval{name}{machine learning}
}
\end{codebox}
The document needs modifying:
\begin{codebox*}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[\opt{record},\opt{postdot},
 \opt{nostyles},\optval{stylemods}{\xtroptfmt{bookindex},list},\comment{only want \glostyle{bookindex} and \glostyle{list} styles}
 acronym]\marg{glossaries-extra}
\codepar
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-desc}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{entries.bib}
 \resourceoptval{dual-type}{\glostype{acronym}},
 \resourceoptvalm{label-prefix}{\strong{idx.}},\resourceoptvalm{dual-prefix}{},
 \resourceoptvalm{combine-dual-locations}{primary}}
\codepar
\gls{glsxtrnewglslike}\marg{\strong{idx.}}\marg{\strong{\cmd{idx}}}\marg{\cmd{idxpl}}\marg{\cmd{Idx}}\marg{\cmd{Idxpl}}
\codepar
\cbeg{document}
\gls{gls}\marg{svm} and \strong{\cmd{idx}}\marg{machlearn}.
\codepar
\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}},\printglossoptval{style}{\glostyle{altlist}}}
\gls{printunsrtglossary}\oarg{\printglossoptval{style}{\glostyle{bookindex}},\printglossoptvalm{title}{Index}}
\cend{document}
\end{codebox*}
See the \app{bib2gls} manual for further details.

\filedef{sample-langdict.tex}
This document illustrates how to use the \sty{glossaries} package to create English
to French and French to English dictionaries. To create the document
do:
\begin{terminal}
pdflatex sample-langdict
makeglossaries sample-langdict
pdflatex sample-langdict
\end{terminal}
This example uses the \opt{nomain} package option to prevent the
creation of the \glostype{main} glossary. This means that the document
must provide its own \idxpl{glossary}:
\begin{codebox}
\gls{newglossary}\oarg{glg}\marg{english}\marg{gls}\marg{glo}\marg{English to French}
\gls{newglossary}\oarg{flg}\marg{french}\marg{flx}\marg{flo}\marg{French to English}
\end{codebox}
This means that if you want to call \app{makeindex} explicitly
you need to take these new extensions into account:
\begin{terminal}
makeindex -s sample-langdict.ist -t sample-langdict.glg -o sample-langdict.gls sample-langdict.glo
makeindex -s sample-langdict.ist -t sample-langdict.flg -o sample-langdict.flx sample-langdict.flo
\end{terminal}
As with the previous example, this document provides a custom
command that defines two related entries:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newword}}[4]\marg{\comment{}
  \gls{newglossaryentry}\marg{en-\#1}\marg{\gloskeyval{type}{english},\gloskeyval{name}{\#2},\gloskeyval{description}{\#3 \#4}}\comment{}
  \gls{newglossaryentry}\marg{fr-\#1}\marg{\gloskeyval{type}{french},\gloskeyval{name}{\#3 \#4},\gloskeyval{text}{\#4},\gloskeyval{sort}{\#4},
    \gloskeyval{description}{\#2}}\comment{}
}
\end{codebox}
This has the syntax:
\begin{codebox}
\cmd{newword}\margm{label}\margm{english}\margm{determiner}\margm{french}
\end{codebox}
(Note that this trivial example doesn't take plurals into account.)
This custom command will define two terms with labels \code{en-\meta{label}} (for
the English term) and \code{fr-\meta{label}} (for the French term).
So
\begin{codebox}
\cmd{newword}\marg{cat}\marg{cat}\marg{le}\marg{chat}
\end{codebox}
is equivalent to:
\begin{codebox}
\gls{newglossaryentry}\marg{en-cat}\marg{\gloskeyval{type}{english},\gloskeyval{name}{cat},\gloskeyval{description}{le chat}}
\gls{newglossaryentry}\marg{fr-cat}\marg{\gloskeyval{type}{french},\gloskeyval{name}{le
chat},\gloskeyval{sort}{chat},
  \gloskeyval{description}{cat}}
\end{codebox}

Unlike the previous example (\samplefile{-dual}), there's no link
between these two entries. If the document only uses
\code{\gls{gls}\marg{en-cat}}, then the \qt{en-cat} entry will appear in the
\optfmt{english} glossary but the \qt{fr-cat} entry won't
appear in the \optfmt{french} one.

\bibglsnote
If you want to switch to \app{bib2gls} then you first need to
convert the document so that it uses \sty{glossaries-extra}, but
include the \opt{prefix} option to ensure that
\sty{glossaries-prefix} is also loaded:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},\opt{prefix}},\opt{postdot},\opt{stylemods},\opt{nomain}]\marg{\strong{glossaries-extra}}
\end{codebox}
You don't need to worry about file extensions now, so it's simpler
to use the starred \gls{newglossary*}:
\begin{codebox}
\glslink{newglossary*}{\csfmt{newglossary}\strong{*}}\marg{english}\marg{English to French}
\glslink{newglossary*}{\csfmt{newglossary}\strong{*}}\marg{french}\marg{French to English}
\end{codebox}
Next the entries need to be converted to the \ext{bib} format
required by \app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} \switch{ignore-type} sample-langdict.tex entries.bib
\end{terminal}
This creates the file \filefmt{entries.bib} that contains entries
defined like:
\begin{codebox}
\atentry{entry}\marg{en-cat,
  \gloskeyval{name}{cat},
  \gloskeyval{description}{le chat}
}
\codepar
\atentry{entry}\marg{fr-cat,
  \gloskeyval{name}{le chat},
  \gloskeyval{description}{cat},
  \gloskeyval{text}{chat}
}
\end{codebox}
(Note that the \gloskey{sort} and \gloskey{type} fields have been omitted.)

This would be more flexible, and much briefer, if these entries were
defined using \app{bib2gls}['s] dual entry system combined with the
\sty{glossaries-prefix} package:
\begin{codebox}
\atentry{dualentry}\marg{cat,
  \gloskeyval{name}{chat},
  \gloskeyval{description}{cat},
  \gloskeyval{prefix}{le},
  \gloskeyval{prefixplural}{les}
}
\end{codebox}
Similarly for the \qt{chair} entry:
\begin{codebox}
\atentry{dualentry}\marg{chair,
  \gloskeyval{name}{chaise},
  \gloskeyval{description}{chair},
  \gloskeyval{prefix}{la},
  \gloskeyval{prefixplural}{les}
}
\end{codebox}

With \atentry{dualentry}, the English and French terms are now
automatically linked from \app{bib2gls}['s] point of view. If only one
is referenced in the document, the other will also be added by default.

Now that the determiner has been moved out of the description, it
won't show in the \idx{glossary}. However, it's possible to include it by
providing a command to encapsulate the description (which can also
apply the language change as well).

\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{entries.bib}
 \resourceoptvalm{append-prefix-field}{space},
 \resourceoptvalm{category}{same as type},\resourceoptvalm{dual-category}{same as type},
 \resourceoptvalm{label-prefix}{en-},\resourceoptvalm{dual-prefix}{fr-},
 \resourceoptval{type}{english},\resourceoptval{dual-type}{french},
 \resourceoptval{sort}{en},\resourceoptval{dual-sort}{fr}}
\codepar
\cmd{newcommand}\marg{\cmd{FrEncap}}[1]\marg{\comment{}
 \gls{foreignlanguage}\marg{french}\marg{\gls{glsentryprefix}\marg{\gls{glscurrententrylabel}}\#1}}
\cmd{newcommand}\marg{\cmd{EnEncap}}[1]\marg{\gls{foreignlanguage}\marg{english}\marg{\#1}}
\codepar
\gls{glssetcategoryattribute}\marg{english}\marg{\catattr{glossnamefont}}\marg{EnEncap}
\gls{glssetcategoryattribute}\marg{english}\marg{\catattr{glossdescfont}}\marg{FrEncap}
\gls{glssetcategoryattribute}\marg{french}\marg{\catattr{glossnamefont}}\marg{FrEncap}
\gls{glssetcategoryattribute}\marg{french}\marg{\catattr{glossdescfont}}\marg{EnEncap}
\end{codebox*}

Remember to remove \gls{makeglossaries}, the definition of \csfmt{newword} and
the entry definitions from the \idxf{documentpreamble}, and 
replace \gls{printglossary} with:
\begin{codebox}
\gls{printunsrtglossary}
\end{codebox}

Other refinements that you might like to make include using
\gls{glsxtrnewglslike} so you don't have to worry about the label
prefix (\qt{en-} and \qt{fr-}). See the \sty{glossaries-extra}
manual for further details.

\filedef{sample-index.tex}
This document uses the \sty{glossaries} package to create both a
glossary and an index. This requires two \app{makeglossaries} (or
\app{makeglossaries-lite}) calls to ensure the document is up to
date:
\begin{terminal}
pdflatex sample-index
makeglossaries sample-index
pdflatex sample-index
makeglossaries sample-index
pdflatex sample-index
\end{terminal}

\section{Sorting}
\label{sec:samplessort}

\filedef{samplePeople.tex}
This document illustrates how you can hook into the
standard sort mechanism to adjust the way the sort key is set. This
requires an additional run to ensure the \idx{tableofcontents} is
up-to-date:
\begin{terminal}
pdflatex samplePeople
makeglossaries samplePeople
pdflatex samplePeople
pdflatex samplePeople
\end{terminal}
This provides two commands for typesetting a name:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{sortname}}[2]\marg{\#2, \#1}
\cmd{newcommand}\marg{\cmd{textname}}[2]\marg{\#1 \#2}
\end{codebox}
where the first argument contains the forenames and the second is the
surname. The first command is the one required for sorting the name
and the second is the one required for displaying the name in the
document. A synonym is then defined:
\begin{codebox}
\cmd{let}\cmd{name}\cmd{textname}
\end{codebox}
This command defaults to the display name command (\csfmt{textname})
but is temporarily redefined to the sort name command (\csfmt{sortname})
within the \gloskey{sort} field assignment hook:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
 \strong{\cmd{let}\cmd{name}\cmd{sortname}}
 \cmd{edef}\#1\marg{\cmd{expandafter}\cmd{expandonce}\cmd{expandafter}\marg{\#1}}\comment{}
 \strong{\cmd{let}\cmd{name}\cmd{textname}}
 \gls{glsdosanitizesort}
}
\end{codebox}
The people are defined using the custom \csfmt{name} command:
\begin{codebox}
\gls{newglossaryentry}\marg{joebloggs}\marg{\gloskeyval{name}{\strong{\cmd{name}}\marg{Joe}\marg{Bloggs}},
 \gloskeyval{description}{\gls{nopostdesc}}}
\end{codebox}
Since \csfmt{name} is temporarily changed while the \gloskey{sort} key
is being assigned, the sort value for this entry ends up as
\qt{Bloggs, Joe}, but the name appears in the document as \qt{Joe Bloggs}.

\bibglsnote
If you want to use \app{bib2gls}, you first need to convert the
document to use \sty{glossaries-extra} but make sure you include the
\opt{record} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{stylemods},\optval{style}{\glostyle{listgroup}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next it's necessary to convert the entry definitions to the
\ext{bib} format required by \app{bib2gls}. You can simply do:
\begin{terminal}
convertgls2bib \switch{preamble-only} samplePeople people.bib
\end{terminal}
which will create a file called \filefmt{people.bib} that contains
definitions like:
\begin{codebox}
\atentry{entry}\marg{joebloggs,
  \gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}},
  \gloskeyval{description}{\gls{nopostdesc}}
}
\end{codebox}
However, you may prefer to use the \switch{index-conversion}
(\switch{i}) switch:
\begin{terminal}
convertgls2bib \switch{i} \switch{preamble-only} samplePeople people.bib
\end{terminal}
This will discard the \gloskey{description} field and use
\atentry{index} instead of \atentry{entry} if the
\gloskey{description} is either empty or simply set to \gls{nopostdesc} or
\gls{glsxtrnopostpunc}. The \filefmt{people.bib} file now
contains definitions like:
\begin{codebox}
\atentry{index}\marg{joebloggs,
  \gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}}
}
\end{codebox}
Regardless of which approach you used to create the \ext{bib}
file, you now need to edit it to provide a definition of the custom
\csfmt{name} command for \app{bib2gls}['s] use:
\begin{codebox*}
\atentry{preamble}\marg{"\strong{\gls{providecommand}}\marg{\cmd{name}}[2]\marg{\#2, \#1}"}
\end{codebox*}
Note the use of \gls{providecommand} instead of \csfmt{newcommand}.

In the document (\file{samplePeople.tex}) you now need to
delete \gls{makeglossaries}, the definitions of \csfmt{sortname},
\csfmt{textname}, \csfmt{name}, \gls{glsprestandardsort}, and all the entry
definitions. Then add the following to the \idxf{documentpreamble}:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{name}}[2]\marg{\#1 \#2}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{people}}
\end{codebox}
Next, use your text editor's search and replace function to
substitute all instances of \gls{glsentrytext} in the chapter
headings with \gls{glsfmttext}. For example:
\begin{codebox*}
\gls{chapter}\marg{\strong{\gls{glsfmttext}}\marg{joebloggs}}
\end{codebox*}
Finally, replace \gls{printglossaries} with:
\begin{codebox}
\gls{printunsrtglossaries}
\end{codebox}
The document build is now:
\begin{terminal}
pdflatex samplePeople
bib2gls samplePeople
pdflatex samplePeople
pdflatex samplePeople
\end{terminal}
The third \LaTeX\ call is required to ensure that the \idxpl{PDFbookmark}
are up to date, as the entries aren't defined until after the
\app{bib2gls} run (which is why you have to use \gls{glsfmttext}
instead of \gls{glsentrytext}).

This again leads to a list sorted by surname. The reason this works
is because \app{bib2gls} only sees the definition of \csfmt{name}
provided in \atentry{preamble}, but the document uses the definition
of \csfmt{name} provided before \gls{GlsXtrLoadResources}. The use of
\gls{providecommand} in \atentry{preamble} prevents \csfmt{name} from 
being redefined within the document.

See also the \qt{Examples} chapter of the \app{bib2gls} user manual,
which provides another \qt{people} example and
\gallerypage{aliases}{Aliases}.

\filedef{sampleSort.tex}
This is another document that illustrates how to hook
into the standard sort mechanism. An additional run is required to
ensure the \idx{tableofcontents} is up-to-date:
\begin{terminal}
pdflatex sampleSort
makeglossaries sampleSort
pdflatex sampleSort
pdflatex sampleSort
\end{terminal}
This document has three glossaries (\glostype{main}, \glostype{acronym}
and a custom \glostypefmt{notation}), so if you want to use
\app{makeindex} explicitly you will need to have three
\app{makeindex} calls with the appropriate file extensions:
\begin{terminal}
pdflatex sampleSort
makeindex -s sampleSort.ist -t sampleSort.alg -o sampleSort.acr sampleSort.acn
makeindex -s sampleSort.ist -t sampleSort.glg -o sampleSort.gls sampleSort.glo
makeindex -s sampleSort.ist -t sampleSort.nlg -o sampleSort.not sampleSort.ntn
pdflatex sampleSort
pdflatex sampleSort
\end{terminal}
It's much simpler to just use \app{makeglossaries} or \app{makeglossaries-lite}.

In this example, the sort hook is adjusted to ensure the list of
notation is sorted according to the order of definition. A new
counter is defined to keep track of the entry number:
\begin{codebox}
\cmd{newcounter}\marg{sortcount}
\end{codebox}
The sort hook is then redefined to increment this counter and assign
the sort key to that numerical value, but only for the
\glostypefmt{notation} glossary. The other two \idxpl{glossary} have their sort
keys assigned as normal:
\begin{codebox*}
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]{\comment{}
  \cmd{ifdefstring}\marg{\#2}\marg{notation}\comment{}
  \marg{\comment{}
     \cmd{stepcounter}\marg{sortcount}\comment{}
     \cmd{edef}\#1\marg{\gls{glssortnumberfmt}\marg{\gls{arabic}\marg{sortcount}}}\comment{}
  }\comment{}
  \marg{\comment{}
     \gls{glsdosanitizesort}
  }\comment{}
}
\end{codebox*}
This means that \app{makeindex} will sort the notation in numerical order.

\glsxtrnote
If you want to convert this document to use \sty{glossaries-extra},
a much simpler approach is available with its hybrid method. First
change the package loading line to:
\begin{codebox}
\cmd{usepackage}[\opt{postdot},\opt{stylemods},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
Either remove \gls{setacronymstyle} and replace all instances of
\gls{newacronym} with \gls{newabbreviation} or replace:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\end{codebox}

The custom counter and redefinition of \gls{glsprestandardsort} can now
be removed. The file extensions for the custom \glostylefmt{notation}
glossary are no longer relevant so the \idx{glossary} definition can be
changed to:
\begin{codebox}
\glslink{newglossary*}{\csfmt{newglossary\strong{*}}}\marg{notation}\marg{Notation}
\end{codebox}
The \gls{makeglossaries} command now needs to be adjusted to
indicate which \idxpl{glossary} need to be processed by \app{makeindex}:
\begin{codebox}
\gls{makeglossaries}\strong{[\glostype{main},\glostype{acronym}]}
\end{codebox}
Finally, \gls{printglossaries} needs to be replaced with:
\begin{codebox}
\gls{printglossary}
\gls{printacronyms}
\glslink{printnoidxglossary}{\csfmt{print\strong{noidx}glossary}}\oarg{\printglossoptval{type}{notation}\strong{,\printglossoptval{sort}{def}}}
\end{codebox}
Note that the \glostylefmt{notation} glossary, which hasn't been listed in the optional
argument of \gls{makeglossaries}, must be displayed with \gls{printnoidxglossary}.

This means that \app{makeindex} only needs to process the
\glostype{main} and \glostype{acronym} glossaries. No actual sorting is
performed for the \glostypefmt{notation} glossary because, when used with
\printglossoptval{sort}{def}, \gls{printnoidxglossary} simply
iterates over the list of entries that have been indexed.

The document build doesn't need the third \LaTeX\ call now (since
none of the \idxpl{glossary} extend beyond a page break):
\begin{terminal}
pdflatex sampleSort
makeglossaries sampleSort
pdflatex sampleSort
\end{terminal}
This time \app{makeglossaries} will include the message:
\begin{transcript}
only processing subset '\glostype{main},\glostype{acronym}'
\end{transcript}
This means that although \app{makeglossaries} has noticed the
\glostypefmt{notation} glossary, it will be skipped.

If you are explicitly calling \app{makeindex} then you need to drop the call
for the \glostypefmt{notation} glossary:
\begin{terminal}
pdflatex sampleSort
makeindex -s sampleSort.ist -t sampleSort.alg -o sampleSort.acr sampleSort.acn
makeindex -s sampleSort.ist -t sampleSort.glg -o sampleSort.gls sampleSort.glo
pdflatex sampleSort
\end{terminal}

\bibglsnote
If you prefer to use \app{bib2gls}, the package loading line needs
to be changed to:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next the entry definitions need to be convert to the \ext{bib}
format required by \app{bib2gls}.

For this example, it's simpler to split the entries into different files according
to the glossary type. This can be done with the
\switch{split-on-type} or \switch{t} switch:
\begin{terminal}
convertgls2bib \switch{t} \switch{preamble-only} sampleSort.tex entries.bib
\end{terminal}
This will create three files:
\begin{deflist}
\itemtitle{\filefmt{entries.bib}}
\begin{itemdesc}
This contains the entries that were
defined with \gls{newglossaryentry}. For example:
\begin{codebox}
\atentry{entry}\marg{gls:set,
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of distinct objects}
}
\end{codebox}
\end{itemdesc}

\itemtitle{\filefmt{abbreviations.bib}}
\begin{itemdesc}
This contains the entries that
were defined with \gls{newacronym}. For example:
\begin{codebox}
\atentry{acronym}\marg{zfc,
  \gloskeyval{short}{ZFC},
  \gloskeyval{long}{Zermelo-Fraenkel set theory}
}
\end{codebox}
If you changed \gls{newacronym} to \gls{newabbreviation} then
\atentry{abbreviation} will be used instead:
\begin{codebox}
\atentry{abbreviation}\marg{zfc,
  \gloskeyval{short}{ZFC},
  \gloskeyval{long}{Zermelo-Fraenkel set theory}
}
\end{codebox}
\end{itemdesc}

\itemtitle{\filefmt{notation.bib}}
\begin{itemdesc}
This contains the entries that were
defined with \gloskeyval{type}{notation}. For example:
\begin{codebox}
\atentry{entry}\marg{not:set,
  \gloskeyval{name}{\$\cmd{mathcal}\marg{S}\$},
  \gloskeyval{description}{A set},
  \gloskeyval{text}{\cmd{mathcal}\marg{S}}
}
\end{codebox}
You may prefer to replace \atentry{entry} with \atentry{symbol}
in this file.
\end{itemdesc}
\end{deflist}
\emph{After} the definition of the \glostypefmt{notation} glossary
(\gls{newglossary}), add:
\begin{codebox}
\comment{\idx{abbrvstyle} must be set first:}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries,abbreviations}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{notation},\comment{notation.bib}
 \strong{\resourceoptval{type}{notation}},\resourceoptval{sort}{\strong{unsrt}}}
\end{codebox}
Delete the remainder of the \idxf{documentpreamble} (\gls{makeglossaries} and entry
definitions).

Finally, replace the lines that display the \idxpl{glossary} with:
\begin{codebox}
\gls{printunsrtglossaries}
\end{codebox}
The build process is now:
\begin{terminal}
pdflatex sampleSort
bib2gls sampleSort
pdflatex sampleSort
\end{terminal}

In this case, I have one resource command that processes two
glossaries (\glostype{main} and \glostype{acronym}) at the same time.
The entries in these glossaries are ordered alphabetically.
The second resource command processes the \glostypefmt{notation} glossary but
the entries in this glossary aren't sorted (and so will appear in
the order of definition within the \ext{bib} file).

See also \samplefile{Ntn}, \bibglsgallery{sorting} and the \app{bib2gls} user manual
for more examples.

\section{Child Entries}
\label{sec:samplesparent}

\filedef{sample.tex}
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
\idx{tableofcontents} and it also uses \gls{glsrefentry}, so an extra \LaTeX\ 
run is required:
\begin{terminal}
pdflatex sample
makeglossaries sample
pdflatex sample
pdflatex sample
\end{terminal}
You can see the difference between word and letter ordering if you
add the package option \optval{order}{letter}. (Note
that this will only have an effect if you use
\app{makeglossaries} or \app{makeglossaries-lite}.
If you use \app{makeindex} explicitly, you will need to use the
\mkidxopt{l} switch to indicate letter ordering.)

One of the entries has its name encapsulated with a semantic command:
\begin{codebox}
\cmd{newcommand}\marg{\strong{\cmd{scriptlang}}}[1]\marg{\cmd{textsf}\marg{\#1}}
\codepar
\gls{newglossaryentry}\marg{Perl}\marg{\gloskeyval{name}{\strong{\cmd{scriptlang}}\marg{Perl}},\strong{\gloskeyval{sort}{Perl},}
\gloskeyval{description}{A scripting language}}
\end{codebox}
This means that this entry needs to have the \gloskey{sort} key set
otherwise \app{makeindex} will assign it to the \qt{symbol} 
\idx{group}, since it starts with a backslash (which \app{makeindex}
simply treats as punctuation).

The homograph entries \qt{glossary} and \qt{bravo} are defined as
sub-entries that inherit the name from the parent entry. The parent
entry doesn't have a description, but with the default
\optval{nopostdot}{false} setting this will lead to a spurious dot.
This can be removed by adding \gls{nopostdesc} to the description,
which suppresses the post-description hook for that entry.

Since the child entries have the same name as the parent, this means
that the child entries will have duplicate sort values unless the
default is changed with the \gloskey{sort} key:
\begin{codebox}
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
 \gloskeyval{description}{\strong{\gls{nopostdesc}}},\gloskeyval{plural}{glossaries}}
\codepar
\gls{newglossaryentry}\marg{glossarycol}\marg{
 \gloskeyval{description}{collection of glosses},
 \strong{\gloskeyval{sort}{2},}
 \gloskeyval{parent}{glossary}\comment{parent \emph{label}}
}
\codepar
\gls{newglossaryentry}\marg{glossarylist}\marg{
 \gloskeyval{description}{list of technical words},
 \strong{\gloskeyval{sort}{1},}
 \gloskeyval{parent}{glossary}\comment{parent \emph{label}}
}
\end{codebox} 
(Remember that the entries are sorted hierarchically.) This will
place \qt{glossarylist} before \qt{glossarycol}, but both
will come immediately after their parent \qt{glossary} entry.

\glsxtrnote
If you switch to using \sty{glossaries-extra}, remember that the
default package options are different:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{postdot},\opt{stylemods}},\optval{style}{\glostyle{treenonamegroup}},\optval{order}{word},
  \opt{subentrycounter}]\marg{\strong{glossaries-extra}}
\end{codebox}

You may now want to consider replacing \gls{nopostdesc} in the
descriptions with \gls{glsxtrnopostpunc} (using your
text editor's search and replace function). This suppresses the
post-description punctuation but not the category post-description
hook.

You may have noticed that some of the descriptions include the
plural form, but it's not done very consistently. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},
  \gloskeyval{plural}{cows},\comment{not required as this is the default}
  \gloskeyval{user1}{kine},
  \gloskeyval{description}{(\cmd{emph}\marg{pl.}\gls{cs.sp}cows, \cmd{emph}\marg{archaic} kine) an adult
female of any bovine animal} 
}
\end{codebox}
which has the parenthetical material at the start of the
description with emphasis,
\begin{codebox}
\gls{newglossaryentry}\marg{bravocry}\marg{
  \gloskeyval{description}{cry of approval (pl.\gls{cs.sp}bravos)},
  \gloskeyval{sort}{1},
  \gloskeyval{parent}{bravo}
}
\end{codebox}
which has the parenthetical material at the end of the
description without emphasis even though it's a regular plural,
\begin{codebox}
\gls{newglossaryentry}\marg{bravoruffian}\marg{
  \gloskeyval{description}{hired ruffian or killer (pl.\gls{cs.sp}bravoes)},
  \gloskeyval{sort}{2},
  \gloskeyval{plural}{bravoes},
  \gloskeyval{parent}{bravo}}
\end{codebox}
which has the parenthetical material at the end of the
description without emphasis, and
\begin{codebox}
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
  \gloskeyval{description}{\gls{nopostdesc}},
  \gloskeyval{plural}{glossaries}}
\end{codebox}
which doesn't show the plural in the description.

With \sty{glossaries-extra}, you can remove this parenthetical
material and implement it using the category post-description hook instead. 
For example, the above definitions become:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},
  \gloskeyval{user1}{kine},
  \gloskeyval{description}{an adult female of any bovine animal} 
}
\codepar
\gls{newglossaryentry}\marg{bravocry}\marg{
  \gloskeyval{description}{cry of approval},
  \gloskeyval{sort}{1},
  \gloskeyval{parent}{bravo}
}
\codepar
\gls{newglossaryentry}\marg{bravoruffian}\marg{
  \gloskeyval{description}{hired ruffian or killer},
  \gloskeyval{sort}{2},
  \gloskeyval{plural}{bravoes},
  \gloskeyval{parent}{bravo}}
\codepar
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
  \gloskeyval{description}{\strong{\gls{glsxtrnopostpunc}}},
  \gloskeyval{plural}{glossaries}}
\end{codebox}
The post-description hook for the \cat{general} category can now be
set:
\begin{codebox*}
\gls{glsdefpostdesc}\marg{general}\marg{\comment{}
\comment{Has the \gloskey{user1} key been set?}
  \gls{glsxtrifhasfield}\marg{\glosfield{useri}}\marg{\gls{glscurrententrylabel}}\comment{}
  \marg{\gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}},
    \cmd{emph}\marg{archaic} \gls{glscurrentfieldvalue})\comment{}
  }\comment{}
  \marg{\comment{}
\comment{The \gloskey{user1} key hasn't been set. Is the plural the same as the}
\comment{singular form with the plural suffix appended?}
    \gls{GlsXtrIfXpFieldEqXpStr}\marg{\gloskey{plural}}\marg{\gls{glscurrententrylabel}}\comment{}
    \marg{\gls{glsentrytext}\marg{\gls{glscurrententrylabel}}\gls{glspluralsuffix}}\comment{}
    \marg{\comment{}
\comment{Sibling check with \app{bib2gls} (see below)}
    }\comment{}
    \marg{\comment{}
\comment{The plural isn't the default. Does this entry have a parent?}
      \gls{ifglshasparent}\marg{\gls{glscurrententrylabel}}%
      \marg{\comment{}
\comment{This entry has a parent.}
\comment{Are the plurals for the child and parent the same?}
        \gls{GlsXtrIfXpFieldEqXpStr}\marg{\gloskey{plural}}\marg{\gls{glscurrententrylabel}}\comment{}
        \marg{\gls{glsentryplural}\marg{\gls{glsentryparent}\marg{\gls{glscurrententrylabel}}}}\comment{}
        \marg{}\comment{child and parent plurals the same}
        \marg{\comment{}
          \gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}})\comment{}
        }\comment{}
      }%
      \marg{\gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}})}\comment{}
    }\comment{}
  }\comment{}
}
\end{codebox*}
(If you try this example out, notice the difference for the
\qt{glossary} entry if you use \gls{nopostdesc} and then
replace it with \gls{glsxtrnopostpunc}.)
See the \sty{glossaries-extra} user manual for further details and
also \bibglsbegin.

The \qt{bravo} homographs are an oddity where the singular form is
identical but the plural is different (\qt{bravos} and
\qt{bravoes}). In the original, both descriptions included the
plural term. The above modifications drop the display of the regular
\qt{bravos} plural (for the \qt{bravocry} term) and only show 
the \qt{bravoes} plural (for the \qt{bravoruffian} term). In this
particular case it might be useful to show the regular plural in
order to highlight the difference.

While it's straightforward to access an entry's parent label (with
\gls{glsentryparent}) it's much harder to access entry's children or
siblings. The \gls{ifglshaschildren} command has to iterate over all
entries to determine if any have a parent that matches the given
label. This is obviously very time-consuming if you have a large
database of entries. It also doesn't provide a way of determining
whether or not the child entries have been indexed.

With \app{bib2gls}, it's possible to save this information with the
\resourceopt{save-child-count} and \resourceopt{save-sibling-count},
which not only save the total but also save the child or sibling
labels in an \sty{etoolbox} internal list. This makes the
information much faster to access and also only includes the labels of
those entries that have actually been indexed.

In the above, the comment line:
\begin{codebox}
\comment{Sibling check with \app{bib2gls} (see below)}
\end{codebox}
indicates where to put the extra code. If you switch to
\app{bib2gls} and make sure to use \resourceopt{save-sibling-count}
then you can insert the following code in the block above where that
comment is:
\begin{codebox*}
\gls{GlsXtrIfFieldNonZero}\marg{\glosfield{siblingcount}}\marg{\gls{glscurrententrylabel}}\%
\marg{\comment{\glosfield{siblingcount} field value non-zero}
 \gls{glsxtrfieldforlistloop} \comment{iterate over internal list}
 \marg{\gls{glscurrententrylabel}} \comment{entry label}
 \marg{\glosfield{siblinglist}} \comment{label of field containing list}
 \marg{\cmd{siblinghandler}} \comment{loop handler}
}\comment{}
\marg{}\comment{\glosfield{siblingcount} field value 0 or empty or missing}
\end{codebox*}
This uses a custom handler that's defined as follows:
\begin{codebox*}
\cmd{newcommand}\marg{\cmd{siblinghandler}}[1]\marg{\comment{}
  \gls{GlsXtrIfXpFieldEqXpStr}*\marg{\gloskey{plural}}\marg{\gls{glscurrententrylabel}}\comment{}
  \marg{\gls{glsentryplural}\marg{\#1}}\comment{}
  \marg{}\comment{current entry's plural same as sibling's plural}
  \marg{\comment{}
    \gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}})\comment{}
    \gls{listbreak}
  }\comment{}
}
\end{codebox*}
The \gls{listbreak} command is provided by \sty{etoolbox} and is used
for prematurely exiting a loop. The handler tests if the sibling's
\gloskey{plural} field is identical to the current entry's \gloskey{plural}
field. If they are the same, it does nothing. If they are different,
it displays the current entry's plural and breaks the loop.

Note that this assumes that the parent entry hasn't had the plural
form explicitly set to \qt{bravoes} instead of the default
\qt{bravos}. In that case, the parent entry would show the plural
but the \qt{bravoruffian} child entry wouldn't show the plural (since
this case would led to the empty code block identified with the
comment \qt{child and parent plurals the same}). The \qt{bravoes}
plural form would instead be shown for the parent, which wouldn't
look right.

If you don't use \app{bib2gls} or if you use it without the
\resourceopt{save-sibling-count} resource option then the sibling
information won't be available.

\bibglsnote
In order to switch to using \app{bib2gls}, it's first necessary to
switch to using \sty{glossaries-extra} (as above). Remember that the
\opt{record} option is required:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},}\opt{postdot},\opt{stylemods},\optval{style}{\glostyle{treenonamegroup}},
\opt{subentrycounter}]\marg{glossaries-extra}
\end{codebox}
Next the entry definitions need to be converted to the
\ext{bib} format required by \app{bib2gls}. This can be done
with \app{convertgls2bib}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sample.tex entries.
\end{terminal}
The semantic command may be moved to the \ext{bib} file's \idx{bibpreamble} to
ensure it's defined:
\begin{codebox}
\atentry{preamble}\marg{"\gls{providecommand}\marg{\cmd{scriptlang}}[1]\marg{\cmd{textsf}\marg{\#1}}"}
\end{codebox}

The \gloskey{sort} field typically shouldn't be set when using
\app{bib2gls}, so \app{convertgls2bib} strips it. 
If the \gloskey{sort} field is missing, \app{bib2gls} will obtain it
from the sort fallback for that entry type. In this case,
\atentry{entry} has the \gloskey{name} field as the sort fallback.
If this is also missing then its value is obtained from the parent's
\gloskey{name} field (see \bibglsgallery{sorting} for other examples).

Therefore the \qt{Perl} entry is simply defined as:
\begin{codebox}
\atentry{entry}\marg{Perl,
  \gloskeyval{name}{\cmd{scriptlang}\marg{Perl}},
  \gloskeyval{description}{A scripting language}
}
\end{codebox}
This isn't a problem for \app{bib2gls}. In this case, the command
has been provided in the \atentry{preamble}, but \app{bib2gls}
strips font information so the sort value becomes \qt{Perl}. 
If the definition isn't placed in \atentry{preamble} then
\app{bib2gls} will simply ignore the command (as \app{xindy} does)
so the sort value will still end up as \qt{Perl}.

The homograph entries have also had their \gloskey{sort} fields omitted:
\begin{codebox}
\atentry{entry}\marg{glossarycol,
  \gloskeyval{parent}{glossary},
  \gloskeyval{description}{collection of glosses}
}
\codepar
\atentry{entry}\marg{glossarylist,
  \gloskeyval{parent}{glossary},
  \gloskeyval{description}{list of technical words}
}
\end{codebox}

This means that the sort value for both these child entries is
\qt{glossary}. When \app{bib2gls} encounters identical sort values
it acts according to its \resourceopt{identical-sort-action} setting.
The default action is to sort by the label using a simple string
comparison. In this case, it would put \qt{glossarycol} before
\qt{glossarylist}. In the original document, the \gloskey{sort}
value was manually chosen to ensure that the entries are ordered
according to \idx{firstuse}.  This ordering can easily be obtained
by changing \app{bib2gls}['s] identical sort action (requires at
least \app{bib2gls} v2.0):
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\strong{\resourceoptval{identical-sort-action}{use}}}
\end{codebox}
This command should replace \gls{makeglossaries}. If you want the
sibling information (see earlier), then you need to remember to add
\resourceopt{save-sibling-count} to the list of options.

Note that this is a better solution than in the original example. If
I edit the document so that \qt{glossarycol} is used first, then
the ordering will be updated accordingly, but with the original
example, the \gloskey{sort} keys would need to be manually changed.

The remainder of the \idxf{documentpreamble} (that is, the definition of
\csfmt{scriptlang} and all the entry definitions) should now be
removed.

Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.
The document build is now:
\begin{terminal}
pdflatex sample
bib2gls \switch{group} sample
pdflatex sample
pdflatex sample
\end{terminal}
Note use of the \switch{group} (or \bibglsopt{g}) switch, which is needed
to support the \glostyle{treenonamegroup} style. The third \LaTeX\
call is needed because the document contains \gls{glsrefentry}.

Note that you can't use the \optval{order}{letter} package option
with \app{bib2gls}. Instead use the \resourceoptval{break-at}{none}
resource option:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\resourceoptval{identical-sort-action}{use},
  \strong{\resourceoptval{break-at}{none}}
}
\end{codebox}

\filedef{sample-inline.tex}
This document is like \file{sample.tex}, above, but uses the \glostyle{inline}
glossary style to put the \idx{glossary} in a footnote. The document build
is:
\begin{terminal}
pdflatex sample-inline
makeglossaries sample-inline
pdflatex sample-inline
pdflatex sample-inline
\end{terminal}
If you want to convert this document to \sty{glossaries-extra},
follow the same procedure as above. If you want to use \app{bib2gls}
then you don't need the \switch{group} switch since no letter
groups are required.

\filedef{sampletree.tex}
This document illustrates a \hierarchical\ glossary structure where 
child entries have different names to their corresponding parent entry. 
To create the document do:
\begin{terminal}
pdflatex sampletree
makeglossaries sampletree
pdflatex sampletree
\end{terminal}
The document uses the \glostyle{alttreehypergroup} glossary style,
which needs to know the widest name for each \idx{hierarchicallevel}.
This has been assigned manually in the \idxf{documentpreamble} with
\gls{glssetwidest}:
\begin{codebox}
\gls{glssetwidest}\marg{Roman letters} \comment{level 0 widest name}
\gls{glssetwidest}\oarg{1}\marg{Sigma}      \comment{level 1 widest name}
\end{codebox}
(Level~0 is the top-most level. That is, entries that don't have a
parent.) It's possible to get \sty{glossaries} to compute the
widest top-level entry with \gls{glsfindwidesttoplevelname} but this
will iterate over all top-level entries, regardless of whether or
not they appear in the \idx{glossary}. If you have a large database of
entries, this will firstly take time and secondly the width may be
too large due to an unindexed entry with a big name.

This sample document doesn't require any of the tabular styles so I've
prevented those packages from being loaded with \opt{nolong} and
\opt{nosuper}. The reduces the overall package loading and reduces 
the potential of package conflict.
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{alttreehypergroup}},\strong{\opt{nolong},\opt{nosuper}}]
\marg{glossaries}
\end{codebox}
(This example glossary is actually better suited for one of the
topic styles provided with \sty{glossary-topic}, see below.)

This is obviously a contrived example since it's strange to have the
symbol names (such as \qt{Sigma}) in the glossary. The purpose is to
demonstrate the \glostyle{alttreehypergroup} with an entry that's
noticeably wider than the others in the same \idx{hierarchicallevel}. A
more sensible document would have the symbol in the \gloskey{name}
key.

\glsxtrnote
If you want to switch to \sty{glossaries-extra}, then you can
instead use a combination of \opt{nostyles} and
\opt{stylemods}:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{alttreehypergroup}},\opt{postdot},\strong{\opt{nostyles},
\optval{stylemods}{tree}}]\marg{\strong{glossaries-extra}}
\end{codebox}
The \opt{stylemods} package not only patches the original styles
provided by the base \sty{glossaries} package (such as
\sty{glossary-tree} used in this example) but also provides extra
helper commands. In this case, it provides additional commands to
calculate the widest name. For example, instead of manually setting
the widest entry with \gls{glssetwidest}, you could add the
following before the glossary:
\begin{codebox*}
\gls{glsFindWidestUsedTopLevelName}
\gls{glsFindWidestUsedLevelTwo}
\end{codebox*}
This will only take into account the entries that have actually been
used in the document, but it can still be time-consuming if you have
a large number of entries.

\begin{important}
Note that the glossary must be at the end of the document (after all
required entries have been used) with this method. The alternative
is to perform the calculation at the end of the document and save
the results in the \ext{aux} file for the next run.
\end{important}

This example document is using top-level entries for topics without
descriptions. This means that the descriptions simply contain
\gls{nopostdesc} to prevent the post-description punctuation from
being automatically inserted. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{greekletter}\marg{\gloskeyval{name}{Greek letters},
\gloskeyval{text}{Greek letter},
\gloskeyval{description}{\gls{nopostdesc}}}
\end{codebox}
With \sty{glossaries-extra}, you can convert this to
\gls{glsxtrnopostpunc} which will prevent the post-description
punctuation without interfering with the category post-description
hook.

In order to distinguish between the child entries, which are
symbols, and the parent entries, which are topics, it's useful to
give these two different types of entries different categories. The
topics can use the default \cat{general} category, but the symbol
entries can be assigned to a different category. The value of the
\gloskey{category} key must be a label. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{C}\marg{\gloskeyval{name}{C},
\gloskeyval{description}{Euler's constant},
\strong{\gloskeyval{category}{\cat{symbol}},}
\gloskeyval{parent}{romanletter}}
\end{codebox}

There is some redundancy caused by a parenthetical note after 
the \idx{firstuse} in some of the symbol entries. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{pi}\marg{\gloskeyval{name}{pi},
\gloskeyval{text}{\gls{ensuremath}\marg{\cmd{pi}}},
\gloskeyval{first}{\gls{ensuremath}\marg{\cmd{pi}} (lowercase pi)},
\gloskeyval{description}{Transcendental number},
\gloskeyval{parent}{greekletter}}
\end{codebox}
With \sty{glossaries-extra} this can be dealt with through the category post-link hook:
\begin{codebox}
\gls{glsdefpostlink}\marg{symbol}\marg{\comment{}
  \gls{glsxtrifwasfirstuse}
  \marg{\comment{first use}
    \gls{glsxtrifhasfield}\marg{\glosfield{useri}}\marg{\gls{glslabel}}\comment{}
    \marg{ (\gls{glscurrentfieldvalue})}\marg{}\comment{}
  }\comment{} 
  \marg{}\comment{not first use}
}
\end{codebox}
The parenthetical material is now stored in the \gloskey{user1} key.
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sigma}\marg{\gloskeyval{name}{Sigma},
\gloskeyval{text}{\gls{ensuremath}{\cmd{Sigma}}},
\strong{\gloskeyval{user1}{uppercase sigma},}
\gloskeyval{description}{Used to indicate summation},
\gloskeyval{parent}{greekletter}}
\end{codebox}
The category post-description link is also set to ensure that the symbol is
displayed after the description in the glossary:
\begin{codebox}
\gls{glsdefpostdesc}\marg{symbol}\marg{\gls{space}
  (\$\gls{glsentrytext}\marg{\gls{glscurrententrylabel}}\$)}
\end{codebox}
These modifications only affect entries with the
\gloskey{category} set to \cat{symbol}.

With \sty{glossaries-extra}, it's now possible to use the topic
styles provided with the \sty{glossary-topic} package:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\strong{\glostyle{topic}}},\opt{postdot},\strong{\opt{nostyles}},\optvalm{stylemods}{tree\strong{,topic}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
The \glostyle{topic} style is designed for this kind of hierarchy
where all the top-level entries don't have descriptions. This means
that the \gls{nopostdesc} and \gls{glsxtrnopostpunc} commands aren't
required. The top-level entries can simply be defined as:
\begin{codebox}
\gls{newglossaryentry}\marg{greekletter}\marg{\gloskeyval{name}{Greek letters},
\gloskeyval{text}{Greek letter}, \gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{romanletter}\marg{\gloskeyval{name}{Roman letters},
\gloskeyval{text}{Roman letter}, \gloskeyval{description}{}}
\end{codebox}
I've now loaded both the \sty{glossary-tree} and
\sty{glossary-topic} packages
(via \optvalm{stylemods}{tree\dcomma topic}). The
\sty{glossary-topic} package can be used without
\sty{glossary-tree}, in which case it will behave more like the
normal \glostyle{tree} rather than \glostyle{alttree} styles (but
with different indentation and no description in the top-level).
However, if you use \gls{glssetwidest} (provided by
\sty{glossary-tree}) then the \glostyle{topic} style will behave
more like \glostyle{alttree}.

Since there's no description for the top-level entries, the
\glostyle{topic} style ignores the widest name setting for the
top-level, so I can just have the level~1 setting:
\begin{codebox}
\gls{glssetwidest}\oarg{1}{Sigma}
\end{codebox}

\bibglsnote
If you want to convert this document so that it uses \app{bib2gls},
you first need to convert it to using \sty{glossaries-extra}, as
described above, but remember that you now need the \opt{record}
option.
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},}\optval{style}{\glostyle{topic}},\opt{postdot},\opt{nostyles},\optvalm{stylemods}{tree,topic}]
\marg{\strong{glossaries-extra}}
\end{codebox}
Next convert the entries to the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampletree.tex entries.bib
\end{terminal}
Now replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\strong{\resourceopt{set-widest}}}
\end{codebox}
I've used the \resourceopt{set-widest} option here to get
\app{bib2gls} to compute the widest name. (Obviously, it can only do
this if it can correctly interpret any commands contained in the
\gloskey{name} field.)

This means that the \gls{glssetwidest} commands can now be removed
completely. All the \gls{newglossaryentry} commands also need to be removed from
the \idxf{documentpreamble}. Finally, \gls{printglossaries} needs to be
replaced with \gls{printunsrtglossaries}. The document build is now:
\begin{terminal}
pdflatex sampletree
bib2gls sampletree
pdflatex sampletree
\end{terminal}

This produces the same result as with just \sty{glossaries-extra}
and \app{makeglossaries}. However, there are some modifications that
can be made to the \ext{bib} file to make it neater. 

The top-level entries are defined as:
\begin{codebox}
\atentry{entry}\marg{greekletter,
  \gloskeyval{name}{Greek letters},
  \gloskeyval{description}{},
  \gloskeyval{text}{Greek letter}
}
\codepar
\atentry{entry}\marg{romanletter,
  \gloskeyval{name}{Roman letters},
  \gloskeyval{description}{},
  \gloskeyval{text}{Roman letter}
}
\end{codebox}
This is a direct translation from the \gls{newglossaryentry} commands
(after switching to the \glostyle{topic} style). There's a more
appropriate entry type:
\begin{codebox}
\atentry{indexplural}\marg{greekletter,
  \gloskeyval{text}{Greek letter}
}
\codepar
\atentry{indexplural}\marg{romanletter,
  \gloskeyval{text}{Roman letter}
}
\end{codebox}
The \atentry{indexplural} entry type doesn't require the
\gloskey{description} and will set the \gloskey{name} field to the
same as the \gloskey{plural} field. Since the \gloskey{plural} field
hasn't been set it's obtained by appending \qt{s} to the
\gloskey{text} field.

Now let's assume that the symbol entries are defined in a more
rational manner, with the actual symbol in the \gloskey{name} field.
For example:
\begin{codebox}
\atentry{entry}\marg{sigma,
  \gloskeyval{user1}{uppercase sigma},
  \gloskeyval{parent}{greekletter},
  \gloskeyval{description}{Used to indicate summation},
  \strong{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Sigma}}}},
  \gloskeyval{category}{\cat{symbol}}
}
\codepar
\atentry{entry}\marg{C,
  \gloskeyval{parent}{romanletter},
  \gloskeyval{name}{\gls{ensuremath}\marg{C}},
  \gloskeyval{description}{Euler's constant},
  \gloskeyval{category}{\cat{symbol}}
}
\end{codebox}
The category post-description hook (provided with
\gls{glsdefpostdesc}) should now be removed from the document.

If you make these changes and rebuild the document, you'll find that
the order has changed. Now the \qt{sigma} entry is before the
\qt{pi} entry. This is because \app{bib2gls} is obtaining the
sort values from the \gloskey{name} field, which is the sort
fallback for \atentry{entry}. This means that the sort values end up
as $\Sigma$ and $\pi$ (\app{bib2gls} recognises the commands
\csfmt{Sigma} and \csfmt{pi} and converts them to the Unicode characters
0x1D6F4 and 0x1D70B).

If you change \atentry{entry} to \atentry{symbol} then you will once
again get the order from the original example (\qt{pi} before
\qt{Sigma}). This is because the sort fallback for
\atentry{symbol} is the label not the \gloskey{name}. (Remember that
the sort fallback is only used if the \gloskey{sort} field isn't
set. If you explicitly set the \gloskey{sort} field then no fallback
is required. See \bibglsgallery{sorting}.)

You can further tidy the \ext{bib} file by removing the
\gloskey{category} fields. For example:
\begin{codebox}
\atentry{symbol}\marg{sigma,
  \gloskeyval{user1}{uppercase sigma},
  \gloskeyval{parent}{greekletter},
  \gloskeyval{description}{Used to indicate summation},
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Sigma}}}
}
\end{codebox}
You can then assign the \gloskey{category} in the resource set:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceopt{set-widest},\strong{\resourceoptvalm{category}{same as entry}}}
\end{codebox}
This means that all the entries defined with \atentry{symbol} will
have the \gloskey{category} set to \cat{symbol} and all the
entries defined with \atentry{indexplural} will have the
\gloskey{category} set to \catfmt{indexplural}. (Only the
\cat{symbol} category is significant in this example.)

You can make the \ext{bib} files even more flexible by
introducing field and entry aliases with \resourceopt{field-aliases}
and \resourceopt{entry-type-aliases}. See the \app{bib2gls} manual
for further details.

\section{Cross-Referencing}
\label{sec:samplescrossref}

\filedef{sample-crossref.tex}
This document illustrates how to cross-reference entries in the
glossary.
\begin{terminal}
pdflatex sample-crossref
makeglossaries sample-crossref
pdflatex sample-crossref
\end{terminal}
The document provides a command \gls{alsoname} to produce some fixed text, which can be
changed as appropriate (usually within a language hook):
\begin{codebox}
\gls{providecommand}\marg{\gls{alsoname}}\marg{see also}
\end{codebox}
I've used \gls{providecommand} as some packages define this command.
This is used to create a \qt{see also} cross-reference with the
\gloskey{see} key:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{firm, round fruit},
\gloskeyval{see}{[\gls{alsoname}]\marg{pear}}}
\codepar
\gls{newglossaryentry}\marg{marrow}\marg{\gloskeyval{name}{marrow},
 \gloskeyval{description}{long vegetable with thin green skin and white flesh},
 \gloskeyval{see}{[\gls{alsoname}]courgette}}
\end{codebox}

Note that \qt{marrow} is included in the glossary even though it
hasn't been referenced in the text. This is because the
\gloskey{see} key automatically triggers \gls{glssee} which indexes
the term. This behaviour is intended for documents where only the
terms that are actually required in the document are defined. It's
not suitable for a large database of terms shared across multiple
documents that may or may not be used in a particular document. In
that case, you may want to consider using \sty{glossaries-extra}
(see below).

\glsxtrnote
This example is quite simple to convert to \sty{glossaries-extra}.
If you want the dot after the description, you need the
\optval{nopostdot}{false} or \opt{postdot} package option. You
may also want to consider using the \opt{stylemods} option.

In order to prevent the \qt{marrow} entry from being automatically
being added to the glossary as a result of the cross-reference, you
can use \optval{autoseeindex}{false} to prevent the automatic
indexing triggered by the \gloskey{see} key (or the
\gloskey{seealso} key provided by \sty{glossaries-extra}).

\begin{codebox}
\cmd{usepackage}[\strong{\optval{autoseeindex}{false}},\opt{postdot},\opt{stylemods}]\marg{glossaries-extra}
\end{codebox}
The document build is the same, but now the \qt{marrow} and
\qt{zucchini} entries aren't present in the document.

Note that the \qt{fruit} entry is still included even though it
hasn't been used in the document. This is because it was explicitly
indexed with \gls{glssee} not via the \gloskey{see} key.

The entries that contains \gloskey{see}{[\gls{alsoname}\meta{xr-label}]}
can be converted to use the \gloskey{seealso} key:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{firm, round fruit},
\strong{\gloskeyval{seealso}{pear}}}
\codepar
\gls{newglossaryentry}\marg{marrow}\marg{\gloskeyval{name}{marrow},
 \gloskeyval{description}{long vegetable with thin green skin and white flesh},
 \strong{\gloskeyval{seealso}{courgette}}}
\end{codebox}
(The provided \gls{alsoname} definition may be removed.)

The original example redefines the cross-referencing format to use
\idx{smallcaps}:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsseeitemformat}}[1]\marg{\gls{textsc}\marg{\gls{glsentryname}\marg{\#1}}}
\end{codebox}
This will still produce the desired effect with \sty{glossaries-extra} for 
this simple example but, as with \samplefile{AcrDesc},
this redefinition isn't necessary if you have at least
\sty{glossaries-extra} v1.42.

\bibglsnote
If you want to switch to \app{bib2gls} then you first need to switch
to \sty{glossaries-extra}, as described above, but you now need the
\opt{record} option but no longer need the
\optval{autoseeindex}{false} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods}]\marg{glossaries-extra}
\end{codebox}
Next the entry definitions need to be converted to the
\ext{bib} format required by \app{bib2gls}.
\begin{terminal}
convertgls2bib sample-crossref.tex entries.bib
\end{terminal}
If you have at least v2.0 then \app{convertgls2bib} will absorb the
cross-referencing information supplied by:
\begin{codebox}
\gls{glssee}\marg{fruit}\marg{pear,apple,banana}
\end{codebox}
into the \qt{fruit} definition:
\begin{codebox}
\atentry{entry}\marg{fruit,
  \gloskeyval{see}{pear,apple,banana},
  \gloskeyval{name}{fruit},
  \gloskeyval{description}{sweet, fleshy product of plant containing seed}
}
\end{codebox}
Now remove \gls{makeglossaries} and all the entry definition commands
(including \gls{glssee} from the \idxf{documentpreamble}) and add:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}. The document build is now:
\begin{terminal}
pdflatex sample-crossref
bib2gls sample-crossref
pdflatex sample-crossref
\end{terminal}
The glossary now contains: apple, banana, courgette and pear. Note
that it doesn't contain fruit, zucchini or marrow.

Now change the selection criteria:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
 \strong{\resourceoptvalm{selection}{recorded and deps and see}}}
\end{codebox}
The glossary now includes fruit, zucchini and marrow.

The fruit and zucchini use the \gloskey{see} key which is a simple
redirection for the reader. There's no \idx{numberlist} for either
of these entries. Whereas marrow uses the \gloskey{seealso} key,
which is typically intended as a supplement to a \idx{numberlist}
but in this case there are no \locations\ as marrow hasn't been used
in the text.

With at least v2.0, there's an alternative:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
 \resourceoptvalm{selection}{recorded and deps and see\strong{ not also}}}
\end{codebox}
In this case, the glossary includes fruit and zucchini but not marrow.

\section{Custom Keys}
\label{sec:samplescustomkeys}

\filedef{sample-newkeys.tex}
This document illustrates how add custom keys
(using \gls{glsaddkey}). There are two custom keys \csoptfmt{ed}, where
the default value is the \gloskey{text} field with \qt{ed} appended,
and \csoptfmt{ing}, where the default value is the \gloskey{text}
field with \qt{ing} appended. Since the default value in both cases
references the \gloskey{text} field, the starred version
\starredcs{glsaddkey} is required to ensure that the 
default value is expanded on definition if no alternative has been provided.

The entries are then defined as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{jump}\marg{\gloskeyval{name}{jump},\gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{run}\marg{\gloskeyval{name}{run},
 ed=\marg{ran},
 ing=\marg{running},
 \gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{waddle}\marg{name={waddle},
 ed=\marg{waddled},
 ing=\marg{waddling},
 \gloskeyval{description}{}}
\end{codebox}

Each custom key is provided a set of commands analogous to
\gls{glsentrytext}, that allows the key value to be accessed, and
\gls{glstext} that allows the key value to be access with indexing
and hyperlinking (where applicable).

If you find yourself wanting to create a lot of custom keys that
produce minor variations of existing keys (such as different tenses)
you may find it simpler to just use \gls{glsdisp}. When editing the
document source, it's usually simpler to read:
\begin{codebox}
The dog \gls{glsdisp}\marg{jump}\marg{jumped} over the duck.
\end{codebox}
than
\begin{codebox}
The dog \cmd{glsed}\marg{jump} over the duck.
\end{codebox}

\bibglsnote
If you want to convert this document to use \app{bib2gls}, you first
need to switch to \sty{glossaries-extra}, but remember that you need
the \opt{record} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next convert the entry definitions to the \ext{bib} format
required by \app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{index-conversion} \switch{preamble-only} sample-newkeys.tex entries.bib
\end{terminal}
The \switch{index-conversion} switch requires at least v2.0 and
will convert entries without a description (or where the description
is simply \gls{nopostdesc} or \gls{glsxtrnopostpunc}) to
\atentry{index} instead of \atentry{entry}. This means that the
new \filefmt{entries.bib} file will contain:
\begin{codebox}
\atentry{index}\marg{jump,
  \gloskeyval{name}{jump}
}
\codepar
\atentry{index}\marg{run,
  ing = \marg{running},
  \gloskeyval{name}{run},
  ed = \marg{ran}
}
\codepar
\atentry{index}\marg{waddle,
  ing = \marg{waddling},
  \gloskeyval{name}{waddle},
  ed = \marg{waddled}
}
\end{codebox}
Now replace \gls{makeglossaries} with
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and delete the \gls{newglossaryentry} commands. Finally replace
\gls{printglossaries} with \gls{printunsrtglossaries}.

The document build is now:
\begin{terminal}
pdflatex sample-newkeys
bib2gls sample-newkeys
pdflatex sample-newkeys
\end{terminal}
Note that there's no need for the \opt{nonumberlist} package
option when you don't use \app{bib2gls}['s] \switch{group}
switch.
 
\filedef{sample-storage-abbr.tex}
This document illustrates how add custom
storage keys (using \gls{glsaddstoragekey}). The document build is:
\begin{terminal}
pdflatex sample-storage-abbr
makeglossaries sample-storage-abbr
pdflatex sample-storage-abbr
\end{terminal}

The custom storage key is called \csoptfmt{abbrtype} which defaults
to \qt{word} if not explicitly set. Its value can be accessed
with the provided custom command \csfmt{abbrtype}.
\begin{codebox}
\gls{glsaddstoragekey}\marg{abbrtype}\marg{word}\marg{\cmd{abbrtype}}
\end{codebox}
A custom \idx{acronymstyle} is then defined that checks the value of
this key and makes certain adjustments depending on whether or not
its value is the default \qt{word}.

This essentially forms a very similar function to the
\sty{glossaries-extra} package's \gloskey{category} key, which is
also defined as a storage key:
\begin{codebox*}
\gls{glsaddstoragekey}\marg{\gloskey{category}}\marg{\cat{general}}\marg{\gls{glscategory}}
\end{codebox*}

\glsxtrnote
This document is much simpler with the \sty{glossaries-extra}
package:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\opt{postdot}]\marg{\strong{glossaries-extra}}
\gls{makeglossaries}
\gls{setabbreviationstyle}\oarg{\strong{\cat{acronym}}}\marg{\abbrstyle{short-long}}
\gls{newacronym}\marg{radar}\marg{radar}\marg{radio detecting and ranging}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\gls{newacronym}\marg{scuba}\marg{scuba}\marg{self-contained underwater breathing
apparatus}
\codepar
\gls{newabbreviation}\marg{dsp}\marg{DSP}\marg{digital signal processing}
\gls{newabbreviation}\marg{atm}\marg{ATM}\marg{automated teller machine}
\codepar
\cbeg{document}
First use: \gls{gls}\marg{radar}, \gls{gls}\marg{laser}, \gls{gls}\marg{scuba}, \gls{gls}\marg{dsp},
\gls{gls}\marg{atm}.
\codepar
Next use: \gls{gls}\marg{radar}, \gls{gls}\marg{laser}, \gls{gls}\marg{scuba}, \gls{gls}\marg{dsp},
\gls{gls}\marg{atm}.
\codepar
\gls{printglossaries}
\cend{document}
\end{codebox}

\filedef{sample-storage-abbr-desc.tex}
An extension of the previous example
where the user needs to provide a~description.

\filedef{sample-chap-hyperfirst.tex}
This document illustrates how to add
a~custom key using \gls{glsaddstoragekey} and hook into the \gls{glslike}
and \gls{glstextlike} mechanism used to determine whether or not to
\idx+{hyperlink} an \idx{entry}.
The document build is:
\begin{terminal}
pdflatex sample-chap-hyperfirst
makeglossaries sample-chap-hyperfirst
pdflatex sample-chap-hyperfirst
\end{terminal}
This example creates a storage key called \qt{chapter} used to store the chapter 
number.
\begin{codebox}
\gls{glsaddstoragekey}\marg{\strong{chapter}}\marg{0}\marg{\strong{\cmd{glschapnum}}}
\end{codebox}
It's initialised to 0 and the \gls{glslinkpostsetkeys} hook is used
to check this value against the current chapter number. If the
values are the same then the \idx{hyperlink} is switched off, otherwise
the key value is updated unless the \idx{hyperlink} has been switched off
(through the optional argument of commands like \gls{gls} and \gls{glstext}).
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkpostsetkeys}}\marg{\comment{}
 \cmd{edef}\cmd{currentchap}\marg{\gls{arabic}\marg{chapter}}\comment{}
 \cmd{ifnum}\cmd{currentchap}=\strong{\cmd{glschapnum}}\marg{\gls{glslabel}}\cmd{relax}
  \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\comment{}
 \cmd{else}
  \gls{glsifhyperon}\marg{\gls{glsfieldxdef}\marg{\gls{glslabel}}\marg{\strong{chapter}}\marg{\cmd{currentchap}}}\marg{}\comment{}
 \cmd{fi}
}
\end{codebox}
Since this key isn't intended for use when the \idx{entry} is being
defined, it would be more appropriate to simply use an internal
field that doesn't have an associated key or helper command, but
\gls{glsfieldxdef} requires the existence of the field. The
\sty{glossaries-extra} package provides utility commands designed to
work on internal fields that don't have an associated key and may
not have had a value assigned.

\glsxtrnote
If you want to switch to \sty{glossaries-extra} you need to change
the package loading line:
\begin{codebox}
\cmd{usepackage}[\opt{postdot}]\marg{\strong{glossaries-extra}}
\end{codebox}
The custom storage key (provided with \gls{glsaddstoragekey}) can be
removed, and the \gls{glslinkpostsetkeys} hook can be changed to:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkpostsetkeys}}\marg{\comment{}
 \cmd{edef}\cmd{currentchap}\marg{\gls{arabic}\marg{chapter}}\comment{}
 \strong{\gls{GlsXtrIfFieldEqNum}*}\marg{\strong{chapter}}\marg{\gls{glslabel}}\marg{\cmd{currentchap}}
 \marg{\comment{}
   \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\comment{}
 }\comment{}
 \marg{\comment{}
   \gls{glsifhyperon}\marg{\strong{\gls{xGlsXtrSetField}}\marg{\gls{glslabel}}\marg{\strong{chapter}}\marg{\cmd{currentchap}}}\marg{}\comment{}
 }\comment{}
}
\end{codebox}
The field name is still called \qt{chapter} but there's no
longer an associated key or command.

\section{Xindy (Option \glsfmttext{idx.opt.xdy})}
\label{sec:samplesxindy}

Most of the earlier \app{makeindex} sample files can be adapted to
use \app{xindy} instead by adding the \opt{xindy} package option.
Situations that you need to be careful about are when the sort value
(obtained from the \gloskey{name} if the \gloskey{sort} key is
omitted) contains commands (such as \gloskeyval{name}{\csfmt{pi}}) or is identical 
to another value (or is identical after \app{xindy} has stripped all
commands and braces). This section describes sample documents that
use features which are unavailable with \app{makeindex}.

\filedef{samplexdy.tex}
The document uses \idx{utf8} \idx{encoding} (with the
\sty{inputenc} package). This is information that needs to be passed
to \app{xindy}, so the \idx{encoding} is picked up by \app{makeglossaries}
from the \ext{aux} file.

This document has an exotic numbering system which requires the
package option \optval{esclocations}{true}. Before \sty{glossaries}
v4.50, this was the default setting, but the default is now
\optval{esclocations}{false}, so this package option now needs to be
set explicitly.

By default, this document will create a \app{xindy} style file called 
\filefmt{samplexdy.xdy}, but if you uncomment the lines
\begin{codebox*}
\gls{setStyleFile}\marg{samplexdy-mc}
\gls{noist}
\gls{GlsSetXdyLanguage}\marg{}
\end{codebox*}
it will set the style file to \filefmt{samplexdy-mc.xdy} instead.
This provides an additional \idx{lettergroup} for entries starting with
\qt{Mc} or \qt{Mac}. If you use \app{makeglossaries} or
\app{makeglossaries-lite}, 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
\filefmt{samplexdy-mc.xdy} you must also specify \gls{noist},
otherwise the \sty{glossaries} package will overwrite
\filefmt{samplexdy-mc.xdy} and you will lose the \qt{Mc} 
\idx{lettergroup}.

To create the document do:
\begin{terminal}
pdflatex samplexdy
makeglossaries samplexdy
pdflatex samplexdy
\end{terminal}
If you don't have Perl installed then you can't use 
\app{makeglossaries}, but you also can't use \app{xindy}!
However, if for some reason you want to call 
\app{xindy} explicitly instead of using \app{makeglossaries} (or
\app{makeglossaries-lite}):
\begin{itemize}
\item if you are using the default style file \filefmt{samplexdy.xdy}, then
do (no line breaks):
\begin{terminal}
xindy \xdyopt{L} english \xdyopt{C} utf8 \xdyopt{I} xindy \xdyopt{M} samplexdy \xdyopt{t} samplexdy.glg \xdyopt{o} samplexdy.gls samplexdy.glo
\end{terminal}
\item if you are using \filefmt{samplexdy-mc.xdy}, then do
(no line breaks):
\begin{terminal}
xindy \xdyopt{I} xindy \xdyopt{M} samplexdy-mc \xdyopt{t} samplexdy.glg \xdyopt{o} samplexdy.gls samplexdy.glo
\end{terminal}
\end{itemize}

This document creates a new command to use with the
\glsopt{format} key in the optional argument of commands
like \gls{gls} to format the \location\ in the \idx{numberlist}.
The usual type of definition when a hyperlinked location is required
should use one of the \csmetafmt{hyper}{xx}{} commands listed in
\tableref{tab:hyperxx}:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{hyperbfit}}[1]\marg{\cmd{textit}\marg{\gls{hyperbf}\marg{\#1}}}
\end{codebox}
Unfortunately, this definition doesn't work for this particular
document and some adjustments are needed (see below). As a result of
the adjustments, this command doesn't actually get used by \TeX,
even though \code{hyperbfit} is used in the
\glsopt{format} key. It does, however, need to be
identified as an \idxc{xindyattr}{attribute} so that \app{xindy} can recognise it:
\begin{codebox*}
\gls{GlsAddXdyAttribute}\marg{hyperbfit}
\end{codebox*}
This will add information to the \ext{xdy} file when it's
created by \gls{makeglossaries}. If you prevent the creation of this
file with \gls{noist} then you will need to add the \idxc{xindyattr}{attribute} to
your custom \ext{xdy} file (see the provided
\filefmt{samplexdy-mc.xdy} file).

In order to illustrate unusual location formats, this sample
document provides a command called \csfmt{tallynum}\margm{n} that represents its
numerical argument with a die or dice where the dots add up to \meta{n}:
\begin{codebox}
\cmd{newrobustcmd}*\marg{\cmd{tallynum}}[1]\marg{\comment{}
 \cmd{ifnum}\cmd{number}\#1<7
  \$\cmd{csname} dice\cmd{romannumeral}\#1\cmd{endcsname}\$\comment{}
 \cmd{else}
  \$\cmd{dicevi}\$\comment{}
  \cmd{expandafter}\cmd{tallynum}\cmd{expandafter}\marg{\cmd{numexpr}\#1-6}\comment{}
 \cmd{fi}
}
\end{codebox}
This command needs to be robust to prevent it from being expanded
when it's written to any of the auxiliary files. The \gls{dicei},
\ldots, \csfmt{dicevi} commands are provided by the \sty{stix}
package, so that needs to be loaded.

An associated command \csfmt{tally}\margm{counter} is defined that
formats the value of the named \meta{counter} according to
\csfmt{tallynum}:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{tally}}[1]\marg{\cmd{tallynum}\marg{\gls{arabic}\marg{\#1}}}
\end{codebox}
(This shouldn't be robust as it needs the counter value to expand.)
The page numbers are altered to use this format (by redefining \gls{thepage}).

This custom location format also needs to be identified in the
\ext{xdy} file so that \app{xindy} can recognise it and
determine how to form ranges if required.
\begin{codebox*}
\gls{GlsAddXdyLocation}\marg{tally}\marg{\comment{tally location format}
 :sep "\cmd{string}\cmd{tallynum}\gls{space}\gls{glsopenbrace}"
 "arabic-numbers" 
 :sep "\gls{glsclosebrace}"
}
\end{codebox*}
Again this information is written to the \ext{xdy} file by
\gls{makeglossaries} so if you use \gls{noist} then you need to
manually add it to your custom \ext{xdy} file.

When \app{xindy} creates the associated \idxpl{indexingfile}, the
\locations\ will be written using: 
\begin{codebox*}
\gls{glsXcounterXformat}\margm{hyper-prefix}\margm{location}
\end{codebox*}
In this case:
\begin{codebox}
\glsXcounterXformat{page}{glsnumberformat}\marg{}\marg{\cmd{tallynum}\margm{number}}
\end{codebox}
or
\begin{codebox}
\glsXcounterXformat{page}{hyperbfit}\marg{}\marg{\cmd{tallynum}\margm{number}}
\end{codebox}
This means that although \gls{hyperbf} is designed to create
hyperlinked locations, the presence of \csfmt{tallynum} interferes with
it.
In order to make the \idxpl{hyperlink} work correctly, the definitions of
\glsXcounterXformat{page}{hyperbfit} need to be redefined in order to grab the
number part in order to work out the location's numeric value. If
the value of \csfmt{tally} is changed so that it expands differently
then these modifications won't work.

Remember that in both cases, the second argument \verb|#2| is in the
form \code{\csfmt{tally}\margm{n}}:
\begin{codebox}
\cmd{renewcommand}\marg{\glsXcounterXformat{page}{glsnumberformat}}[2]\marg{\comment{}
 \cmd{linkpagenumber}\#2\comment{}
}
\cmd{renewcommand}\marg{\glsXcounterXformat{page}{hyperbfit}}[2]\marg{\comment{}
 \cmd{textbf}\marg{\cmd{em}\cmd{linkpagenumber}\#2}\comment{}
}
\end{codebox}
These need a command that can grab the actual number and correctly encapsulate
it:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[2]\marg{\gls{hyperlink}\marg{page.\#2}\marg{\#1\marg{\#2}}}
\end{codebox}

If you want to try out the \filefmt{samplexdy-mc.xdy} file, the
entries starting with \qt{Mac} or \qt{Mc} will be placed in their
own \qt{Mc} \idx{lettergroup}. Ideally it should be possible to do
this simply with \gls{GlsAddLetterGroup} (and not require a custom
\ext{xdy} file) but unfortunately the \qt{M} \idx{lettergroup} will
have already been defined and take precedence over \qt{Mc}, which is
why a custom file is required and the normal language module must be
suppressed:
\begin{codebox}
\gls{setStyleFile}\marg{samplexdy-mc}
\gls{noist}
\gls{GlsSetXdyLanguage}\marg{}
\end{codebox}

This \qt{Mc} \idx{group} is suitable for names like
\qt{Maclaurin} but not for \qt{Mach}. To prevent this, the
\gloskey{sort} key for that value is set to lower case:
\begin{codebox}
\gls{newglossaryentry}\marg{mach}\marg{\gloskeyval{name}{Mach, Ernst},
\gloskeyval{first}{Ernst Mach},\gloskeyval{text}{Mach},
\gloskeyval{sort}{mach, Ernst},
\gloskeyval{description}{Czech/Austrian physicist and philosopher}}
\end{codebox}

\bibglsnote
If you want to convert this document so that it uses \app{bib2gls},
you first need to switch to \sty{glossaries-extra} and use the
\opt{record} package option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot}]\marg{\strong{glossaries-extra}}
\end{codebox}
The \app{xindy}-only commands can now all be removed
(\idxc{xindyattr}{attribute} \gls{GlsAddXdyAttribute}, location \gls{GlsAddXdyLocation},
language \gls{GlsSetXdyLanguage}, \idxpl{locationencap} 
\gls{glsXcounterXformat} and the custom helper \csfmt{linkpagenumber}).
Also \gls{noist} and \gls{setStyleFile} aren't relevant with
\app{bib2gls} and so should be removed.

The definitions of \csfmt{hyperbfit} should be retained (as well as
\csfmt{tallynum}, \csfmt{tally} and the redefinition of \gls{thepage}).

The entries all need to be converted to the \ext{bib} format
required by \app{bib2gls}.
\begin{terminal}
convertgls2bib \switch{preamble-only} samplexdy.tex entries.bib
\end{terminal}
Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and remove all the entry definitions from the \idxf{documentpreamble}. Use the
search and replace function on your text editor to replace all
instances of \gls{glsentryfirst} with \gls{glsfmtfirst}, and all
instances of \gls{glsentryname} with \gls{glsfmtname}.

Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.
The document build is now:
\begin{terminal}
pdflatex samplexdy
bib2gls \switch{group} samplexdy
pdflatex samplexdy
\end{terminal}

This results in a slightly different ordering from the original
document (without the \qt{Mc} \idx{lettergroup}). In the original
example, \qt{Mach number} was listed before \qt{Mach, Ernest}. The
modified document now has \qt{Mach, Ernest} before \qt{Mach number}.
This difference is due to \app{bib2gls}['s] default
\resourceoptval{break-at}{word} setting, which marks word boundaries
with the \idx{pipe} character, so the sort values for
\app{bib2gls} are \code{Mach|Earnest|} and \code{Mach|number|}.
See the \app{bib2gls} manual for further details of this option, and
also see the examples chapter of that manual for alternative
approaches when creating entries that contain people's names.

If you want the \qt{Mc} \idx{lettergroup}, it can be obtained by
providing a custom sort rule:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
   \resourceoptval{sort}{\strong{custom}},
   \strong{\resourceoptvalm{sort-rule}}{\gls{glsxtrGeneralInitRules}
   <\gls{glsxtrGeneralLatinAtoGrules}
   <h,H<i,I<j,J<k,K<l,L\strong{<Mc=Mac}<m,M
   <\gls{glsxtrGeneralLatinNtoZrules}
   }
}
\end{codebox}
Unfortunately, as with \app{xindy}, this puts \qt{Mach} into the
\qt{Mc} \idx{lettergroup}. (See the \sty{glossaries-extra} manual for
details about the sort rule commands.)

One way to get around this problem is to define a custom command to
help identify genuine \qt{Mc}/\qt{Mac} prefixes with names that
happen to start with \qt{Mac}. For example:
\begin{codebox}
\atentry{entry}\marg{mcadam,
  \gloskeyval{name}{\strong{\cmd{Mac}\marg{Mc}}Adam, John Loudon},
  \gloskeyval{description}{Scottish engineer},
  \gloskeyval{text}{McAdam},
  \gloskeyval{first}{John Loudon McAdam}
}
\codepar
\atentry{entry}\marg{maclaurin,
  \gloskeyval{name}{\strong{\cmd{Mac}\marg{Mac}}laurin, Colin},
  \gloskeyval{description}{Scottish mathematician best known for the
\gls{gls}\marg{maclaurinseries}},
  \gloskeyval{text}{Maclaurin},
  \gloskeyval{first}{Colin Maclaurin}
}
\end{codebox}
but not for \qt{Mach}:
\begin{codebox}
\atentry{entry}\marg{mach,
  \gloskeyval{name}{Mach, Ernst},
  \gloskeyval{description}{Czech/Austrian physicist and philosopher},
  \gloskeyval{text}{Mach},
  \gloskeyval{first}{Ernst Mach}
}
\end{codebox}
With \LaTeX, this command should simply do its argument:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{Mac}}[1]\marg{\#1}
\end{codebox}
However, when \app{bib2gls} works out the \gloskey{sort} value, it
needs to be defined with something unique that won't happen to occur
at the start of another term. For example:
\begin{codebox}
\cmd{providecommand}\marg{\cmd{Mac}}[1]\marg{MC}
\end{codebox}
(Remember that \resourceoptval{break-at}{word} will strip spaces
and punctuation so don't include them unless you switch to
\resourceoptval{break-at}{none}.)

So add the first definition of \csfmt{Mac} to the \ext{tex} file and modify
\filefmt{entries.bib} so that it includes the second definition:
\begin{codebox}
\atentry{preamble}\marg{"\gls{providecommand}\marg{\cmd{Mac}}[1]\marg{MC}"}
\end{codebox}
Then modify the \qt{Mc}/\qt{Mac} entries as appropriate (see the
above \qt{McAdam} and \qt{Maclaurin} examples).

The custom sort rule needs to be modified:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
   \strong{\resourceoptval{write-preamble}{false},}
   \resourceoptval{sort}{custom},
   \resourceoptval{sort-rule}{\gls{glsxtrGeneralInitRules}
   <\gls{glsxtrGeneralLatinAtoGrules}
   <h,H<i,I<j,J<k,K<l,L\strong{<MC}<m,M
   <\gls{glsxtrGeneralLatinNtoZrules}
   }
}
\end{codebox*}
This will create a \qt{Mc} \idx{lettergroup} that only includes the names
that start with the custom \csfmt{Mac} command.

Other alternatives include moving \atentry{preamble} into a separate
\ext{bib} file, so that you can choose whether or not to
include it. See the \qt{Examples} chapter of the \app{bib2gls} user
manual for further examples.

\filedef{samplexdy2.tex}
This document illustrates how to use the \sty{glossaries} package where the 
\location\ numbers don't follow a standard syntax. This example won't work
with \app{makeindex}, which only accepts a limited set of location syntax. 
To create the document do:
\begin{terminal}
pdflatex samplexdy2
makeglossaries samplexdy2
pdflatex samplexdy2
\end{terminal}
The explicit \app{xindy} call is:
\begin{terminal}
xindy -L english -C utf8 -I xindy -M samplexdy2 -t samplexdy2.glg -o samplexdy2.gls samplexdy2.glo
\end{terminal}
This example uses the \ctr{section} counter with \app{xindy}:
\begin{codebox}
\cmd{usepackage}[\opt{xindy},\optval{counter}{section}]\marg{glossaries}
\end{codebox}
The document employs an eccentric section numbering system for
illustrative purposes. The section numbers are prefixed by the
chapter number in square brackets:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{section}}\marg{[\thecounter{chapter}]\gls{arabic}\marg{section}}
\end{codebox}
Parts use Roman numerals:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{part}}\marg{\gls{Roman}\marg{part}}
\end{codebox}
The section \idx{hyperlink} name includes the part:
\begin{codebox}
\cmd{renewcommand}*\marg{\theHcounter{section}}\marg{\thecounter{part}.\thecounter{section}}
\end{codebox}
This custom numbering scheme needs to be identified in the
\ext{xdy} file:
\begin{codebox}
\gls{GlsAddXdyLocation}\oarg{"roman-numbers-uppercase"}\marg{section}\marg{:sep "["
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
If the part is 0 then \thecounter{part} will be \idxc{emptylocation}{empty} 
(there isn't a zero Roman numeral). An extra case is needed to catch this:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{zero.section}\marg{:sep "["
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
Note that this will stop \app{xindy} giving a warning, but the \location\
hyperlinks will be invalid if no \gls{part} is used.

\bibglsnote
If you want to switch to \app{bib2gls}, you first need to switch to
\sty{glossaries-extra} but remember to use \opt{record} instead
of \opt{xindy}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\optval{counter}{section}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next remove the \gls{GlsAddXdyLocation} commands and convert the
entry definitions to the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} samplexdy2.tex entries.bib
\end{terminal}
Now replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and remove the \gls{newglossaryentry} commands.
Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.

The document build is:
\begin{terminal}
pdflatex samplexdy2
bib2gls samplexdy2
pdflatex samplexdy2
\end{terminal}

With unusual numbering systems, it's sometimes better to use \optval{record}{nameref}:
\begin{codebox}
\cmd{usepackage}[\strong{\optval{record}{nameref}},\optval{counter}{section}]\marg{\strong{glossaries-extra}}
\end{codebox}
In this case, the locations will be the actual section headings,
rather than the section number. In order to make the number appear
instead you need to define:
\begin{codebox*}
\cmd{newcommand}*\marg{\glsxtrcounterlocfmt{section}}[2]\marg{\#1}
\end{codebox*}
(Make sure you have at least v1.42 of \sty{glossaries-extra}.) See
also the earlier \samplefile{Sec}. 

\filedef{samplexdy3.tex}
This document is very similar to 
\samplefile{xdy} but uses the command \gls{Numberstring} from the
\sty{fmtcount} package to format the page numbers instead of the
\csfmt{tally} command from the earlier example.

\filedef{sampleutf8.tex}
This is another example that uses \app{xindy}. Unlike \app{makeindex},
\app{xindy} recognises \idxpl{nonlatinchar} (provided the correct 
\idx{encoding} is passed to \app{xindy} via the \xdyopt{C} switch). This
document uses \idx{utf8} \idx{encoding}. To create the document do:
\begin{terminal}
pdflatex sampleutf8
makeglossaries sampleutf8
pdflatex sampleutf8
\end{terminal}
The explicit \app{xindy} call is
(no line breaks):
\begin{terminal}
xindy -L english -C utf8 -I xindy -M sampleutf8 -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
\end{terminal}

If you remove the \opt{xindy} option from \file{sampleutf8.tex} 
and do:
\begin{terminal}
pdflatex sampleutf8
makeglossaries sampleutf8
pdflatex sampleutf8
\end{terminal}
or
\begin{terminal}
pdflatex sampleutf8
makeglossaries-lite sampleutf8
pdflatex sampleutf8
\end{terminal}
you will see that the entries that start with an \idx{exlatinchar}
now appear in the symbols \idx{group}, and the word \qt{man\oe uvre} is now 
after \qt{manor} instead of before it. If you want to explicitly
call \app{makeindex} (no line breaks):
\begin{terminal}
makeindex -s sampleutf8.ist -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
\end{terminal}

\bibglsnote
If you want to switch to \app{bib2gls}, you first need to switch to
\sty{glossaries-extra} but replace \opt{xindy} with
\opt{record}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods},\optval{style}{\glostyle{listgroup}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Note that you don't need the \opt{nonumberlist} option with
\app{bib2gls}. You can instruct \app{bib2gls} to simply not save the
\idxpl{numberlist}, but in this case there won't be any locations as
there's no actual \idx{indexing}.

The entries need to be converted to the \ext{bib} format
required by \app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} \switch{texenc} UTF-8 \switch{bibenc} UTF-8 sampleutf8.tex entries.bib
\end{terminal}
Note the first line of the \filefmt{entries.bib} file:
\begin{codebox}
\comment{Encoding: UTF-8}
\end{codebox}
This is the \idx{encoding} of the \ext{bib} file. It doesn't have to
match the \idx{encoding} of the \ext{tex} file, but it's generally
better to be consistent. When \app{bib2gls} parses this file, it
will look for this \idx{encoding} line.
(If the \switch{texenc} and \switch{bibenc} switches aren't
used, \app{convertgls2bib} will assume your Java default
\idx{encoding}. See the \app{bib2gls} manual for further details.)

Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{\strong{all}}}
\end{codebox}
and remove all the \gls{newglossaryentry} commands.

Iterative commands like \gls{glsaddall} don't work with
\app{bib2gls}.  Instead, you can select all entries using the
\resourceoptval{selection}{all} option.
This is actually better than \gls{glsaddall}, which enforces
the selection of all entries by \idx{indexing} each entry. As a result,
with \app{makeindex} and \app{xindy} (and \option{noidx}), every entry will
have the same location (which is the location of the \gls{glsaddall}
command, in this case page~1). With \resourceoptval{selection}{all},
\app{bib2gls} will automatically selection all entries even if they
don't have any records (\idx{indexing} information) so in this case there
are no \idxpl{numberlist}.

Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}. The build process is now:
\begin{terminal}
pdflatex sampleutf8
bib2gls \switch{group} sampleutf8
pdflatex sampleutf8
\end{terminal}
\app{bib2gls} picks up the \idx{encoding} of the \ext{tex} file from
the \ext{aux} file:
\begin{codebox}
\gls{glsxtr@texencoding}\marg{utf8}
\end{codebox}
If you experience any \idx{encoding} issues, check the \ext{aux} file for
this command and check the \ext{bib} file for the \idx{encoding}
comment line. Also check \app{bib2gls}['s] \ext{glg} transcript file
for \idx{encoding} messages, which should look like:
\begin{transcript}
TeX character encoding: UTF-8
\end{transcript}

The document language, if it has been set, is also added to the \ext{aux} file when
the \opt{record} option is used. In this case, no language
package has been used, so \app{bib2gls} will fallback on the system's default
locale. If no sort method is set, the entries will be sorted
according to the document language, if set, or the default locale.
You can specify a specific locale using the \resourceopt{sort} key
with a locale tag identifier. For example:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{\strong{all}},\strong{\resourceoptval{sort}{de-CH-1996}}}
\end{codebox}
(Swiss German new orthography) or:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{\strong{all}},\strong{\resourceoptval{sort}{is}}}
\end{codebox}
(Icelandic).

\section{No Indexing Application (Option \glsfmttext{idx.opt.noidx})}
\label{sec:samplesnoidx}

\filedef{sample-noidxapp.tex}
This document illustrates how to use the
\sty{glossaries} package without an external \idx{indexingapp} (\option{noidx}).
To create the complete document, you need to do:
\begin{terminal}
pdflatex sample-noidxapp
pdflatex sample-noidxapp
\end{terminal}
With old \LaTeX\ kernels and old versions of \sty{mfirstuc}, it was necessary to
group the accent command that occurs at the start
of the \gloskey{name}:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{\comment{}
  name=\marg{\strong{\marg{\gls{cs.apos}e}}lite},\comment{\sty{mfirstuc} v2.07}
  description=\marg{select group of people}
}
\end{codebox}
This used to be necessary to allow the term to work with \gls{Gls}. With a new
kernel and latest versions of \sty{glossaries} and \sty{mfirstuc}, this should
no longer be necessary.
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{\comment{}
  name=\marg{\strong{\gls{cs.apos}e}lite},\comment{\sty{mfirstuc} v2.08}
  description=\marg{select group of people}
}
\end{codebox}

Notice also how the \idxpl{numberlist} can't be compacted into
ranges. For example, the list \qt{1, 2, 3} would be converted to
\qt{1--3} with a proper indexing application (\optionsor{mkidx,xdy} or, with
\sty{glossaries-extra}, \option{b2g}).

The larger the list of entries, the longer the document build time.
This method is very inefficient for large glossaries. See
\galleryref{glossaries-performance.shtml}{Gallery: glossaries performance} for a comparison.

\filedef{sample-noidxapp-utf8.tex}
As the previous example, except that it uses the \sty{inputenc} package.
In this case, the \gloskey{sort} key is used for the entries with 
\idx{utf8} characters in the names.
To create the complete document, you need to do:
\begin{terminal}
pdflatex sample-noidxapp-utf8
pdflatex sample-noidxapp-utf8
\end{terminal}
This method is unsuitable for sorting languages with
\idxpl{exlatinalph} or \idxpl{nonlatinalph}. Use \optionsor{xdy,b2g} instead.

\section{Other}
\label{sec:samplesother}

\filedef{sample4col.tex}
This document illustrates a four column \idx{glossary} where the 
entries have a symbol in addition to the name and description. 
To create the complete document, you need to do:
\begin{terminal}
pdflatex sample4col
makeglossaries sample4col
pdflatex sample4col
\end{terminal}
or
\begin{terminal}
pdflatex sample4col
makeglossaries-lite sample4col
pdflatex sample4col
\end{terminal}
The vertical gap between entries is the gap created at the start of
each \idx{lettergroup}.  This can be suppressed using the
\opt{nogroupskip} package option. (If you switch to \app{bib2gls},
simply omit the \switch{group} command line option.)

This example uses the \glostyle{long4colheaderborder}. This style
doesn't allow multi-line descriptions. You may prefer to use
\glostyle{altlong4colheaderborder} with long descriptions. However,
in either case a style that uses \sty{booktabs} is preferable. For
example, \glostyle{long4col-booktabs} or
\glostyle{altlongragged4col-booktabs}. Note that this requires
\sty{glossary-longbooktabs}, which needs to be explicitly loaded.
The style can only be set once this package has been loaded:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-longbooktabs}
\gls{setglossarystyle}\marg{\glostyle{altlongragged4col-booktabs}}
\end{codebox}

\glsxtrnote
The \sty{glossaries-extra} package provides a more compact way of
doing this with the \opt{stylemods} option:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{altlongragged4col-booktabs}},\optval{stylemods}{\strong{longbooktabs}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
The \sty{glossaries-extra} package provides additional styles,
including more \qt{long} styles with the \sty{glossary-longextra}
package. For example, the \glostyle{long-name-desc-sym-loc}
style:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\strong{\glostyle{long-name-desc-sym-loc}}},\optval{stylemods}{\strong{longextra}}]
\marg{glossaries-extra}
\end{codebox}
If you use the \opt{stylemods} option with an argument, you may
prefer to use it with \opt{nostyles} to prevent unwanted styles
from being automatically loaded. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long-name-desc-sym-loc}},\strong{\opt{nostyles},}\optval{stylemods}{longextra}]
\marg{glossaries-extra}
\end{codebox}
See also the
\galleryref{glossaries-styles/}{gallery of predefined styles}.

\filedef{sample-numberlist.tex}
This document illustrates how to reference the
\idx{numberlist} in the document text. This requires an additional
\LaTeX\ run:
\begin{terminal}
pdflatex sample-numberlist
makeglossaries sample-numberlist
pdflatex sample-numberlist
pdflatex sample-numberlist
\end{terminal}
This uses the \opt{savenumberlist} package option, which enables 
\gls{glsentrynumberlist} and \gls{glsdisplaynumberlist}
(with limitations).  The location counter is set to
\ctr{chapter}, so the \idx{numberlist} refers to the chapter
numbers.
\begin{codebox}
\cmd{usepackage}[\opt{savenumberlist},\optval{counter}{\ctr{chapter}}]\marg{glossaries}
\end{codebox}
The \idx{numberlist} can't be obtained until \app{makeindex} (or
\app{xindy}) has created the \idx{indexingfile}. The \idx{numberlist} is
picked up when this file is input by \gls{printglossary} and is then
saved in the \ext{aux} file so that it's available on the next
\LaTeX\ run.

This document contains both commands:
\begin{codebox*}
This is a \gls{gls}\marg{sample} document. \gls{Glspl}\marg{sample}
are discussed in chapters~\strong{\gls{glsdisplaynumberlist}}\marg{sample}
(or \strong{\gls{glsentrynumberlist}}\marg{sample}).
\end{codebox*}
Without \sty{hyperref}, the first list shows as \qt{1--3, 5 \& 6}
and the second list shows as \qt{1--3, 5, 6}.

Note that you can't use \gls{glsdisplaynumberlist} with
\sty{hyperref} and \optionsor{mkidx,xdy}. If you do, you will get the warning:
\begin{transcript}
Package glossaries Warning: \gls{glsdisplaynumberlist} doesn't work with hyperref.
Using \gls{glsentrynumberlist} instead
\end{transcript}
Now both lists show as \qt{1--3, 5, 6}.

If you switch to \option{noidx} (replace \gls{makeglossaries} with
\gls{makenoidxglossaries} and replace \gls{printglossaries} with
\gls{printnoidxglossaries}), then the document build is simply:
\begin{terminal}
pdflatex sample-numberlist
pdflatex sample-numberlist
\end{terminal}
Now \gls{glsdisplaynumberlist} works with \sty{hyperref},
however there are no ranges, so the first list shows as \qt{1,
2, 3, 5, \& 6} and the second list shows as \qt{1, 2, 3, 4, 5, 6}.

\bibglsnote
If you want to switch to \app{bib2gls}, you first need to switch to
\sty{glossaries-extra} (at least v1.42) but remember to include the \opt{record}
option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\optval{counter}{\ctr{chapter}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Note that the \opt{savenumberlist} option is no longer required.
Next convert the entry to the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib sample-numberlist.tex entries.bib
\end{terminal}
Replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and remove the \gls{newglossaryentry} command from the 
\idxf{documentpreamble}. Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}. The build process is now:
\begin{terminal}
pdflatex sample-numberlist
bib2gls sample-numberlist
pdflatex sample-numberlist
\end{terminal}
Now both ranges and \idxpl{hyperlink} work. The first list shows \qt{1--3,
5, \& 6} and the second list shows \qt{1--3, 5, 6}. You can also
use:
\begin{codebox}
\gls{glsxtrfieldformatlist}\marg{sample}\marg{loclist}
\end{codebox}
which will show the complete list without ranges \qt{1, 2, 3, 5 \&
6}.

This method works much better than using the \opt{savenumberlist}
option because \app{bib2gls} saves the formatted \idx{numberlist} in the
\gloskey{location} field (which is provided by
\sty{glossaries-extra} for the benefit of \app{bib2gls}) and the
unformatted \idx{numberlist} in the \glosfield{loclist} internal field (which is
also used by \option{noidx}).

With \options{mkidx,xdy}, both \app{makeindex} and \app{xindy} simply create a
file containing the commands to typeset the glossary, which is input
by \gls{printglossary}. This means that it's quite hard to gather
information obtained by the \idx{indexingapp}.

\app{bib2gls}, on the other hand, doesn't write a file containing
the \idx{glossary}. It writes a file containing the entry definitions and
uses internal fields to save the \idx{indexing} information. The \idx{glossary} is
then displayed with \gls{printunsrtglossary}, which simply iterates
over all defined entries and fetches the required information from
those internal fields.

The \gls{glsdisplaynumberlist} and \gls{glsentrynumberlist} commands
are redefined by \sty{glossaries-extra-bib2gls} to simply access the
\gloskey{location} field.
However, if you want a complete list without ranges you can use:
\begin{codebox}
\gls{glsxtrfieldformatlist}\marg{sample}\marg{loclist}
\end{codebox}
In this example, this produces \qt{1, 2, 3, 5 \& 6}. 

Note the difference if you use the \optval{record}{nameref} package
option instead of just \opt{record}.

\filedef{sample-nomathhyper.tex}
This document illustrates how to selectively
enable and disable entry \idxpl{hyperlink} in \gls{glsentryfmt}. The
document build is:
\begin{terminal}
pdflatex sample-nomathhyper
makeglossaries sample-nomathhyper
pdflatex sample-nomathhyper
\end{terminal}
This disables the \idxpl{hyperlink} for the \glostype{main} glossary with:
\begin{codebox}
\gls{GlsDeclareNoHyperList}\marg{\glostype{main}}
\end{codebox}
and then redefines \gls{glsentryfmt} so that it adds a \idx{hyperlink} if
not in maths mode and the \idxpl{hyperlink} haven't been forced off (with
the \glsoptval{hyper}{false} key).

\glsxtrnote
If you want to switch to \sty{glossaries-extra}, then you can
instead use the hook that comes before the keys are set. The
\idx{documentpreamble} is much simpler:
\begin{codebox}
\cmd{usepackage}\marg{\strong{glossaries-extra}}
\codepar
\gls{makeglossaries}
\codepar
\cmd{renewcommand}\marg{\strong{\gls{glslinkpresetkeys}}}\marg{\comment{}
 \cmd{ifmmode} \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\cmd{fi}
}
\codepar
\comment{entry definition}
\end{codebox}

\filedef{sample-entryfmt.tex}
This document illustrates how to change the
way an entry is displayed in the text. (This is just a test
document. For a real document, I recommend you use the \sty{siunitx}
package to typeset units.) The document build is:
\begin{terminal}
pdflatex sample-entryfmt
makeglossaries sample-entryfmt
pdflatex sample-entryfmt
\end{terminal}
This redefines \gls{glsentryfmt} to add the symbol on
\idx{firstuse}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space} (\strong{\gls{glsentrysymbol}}\marg{\gls{glslabel}})}\comment{}
}
\end{codebox}
Note the use of \gls{glsentrysymbol} \emph{not} \gls{glssymbol} (which
would result in nested \idx{linktext}).

\glsxtrnote
If you want to switch to the \sty{glossaries-extra} package, you can
make use of the category post-link hook instead:
\begin{codebox}
\cmd{usepackage}[\opt{stylemods},\optval{style}{tree}]\marg{\strong{glossaries-extra}}
\codepar
\gls{makeglossaries}
\codepar
\gls{glsdefpostlink}\marg{\strong{unit}}\marg{\gls{glsxtrpostlinkAddSymbolOnFirstUse}}
\codepar
\gls{newglossaryentry}\marg{distance}\marg{
\gloskeyval{category}{\strong{unit}},
\gloskeyval{name}{distance},
\gloskeyval{description}{The length between two points},
\gloskeyval{symbol}{km}}
\end{codebox}
Note that in this case the symbol is now outside of the \idx{hyperlink}.

\filedef{sample-prefix.tex}
This document illustrates the use of the
\sty{glossaries-prefix} package. An additional run is required to
ensure the \idx{tableofcontents} is up-to-date:
\begin{terminal}
pdflatex sample-prefix
makeglossaries sample-prefix
pdflatex sample-prefix
pdflatex sample-prefix
\end{terminal}
Remember that the default separator between the prefix and \gls{gls}
(or one of its variants) is empty, so if a space is required it must
be inserted at the end of the prefix. However, the \sty{xkeyval}
package (which is used to parse the \keyval\ lists) trims leading 
and trailing space from the values, so an
ordinary space character will be lost.
\begin{codebox*}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},
  \gloskeyval{description}{an example},
  \gloskeyval{prefix}{a\strong{\sym{nbsp}}},
  \gloskeyval{prefixplural}{the\strong{\gls{space}}}%
}
\codepar
\gls{newglossaryentry}\marg{oeil}\marg{\gloskeyval{name}{oeil},
  \gloskeyval{plural}{yeux},
  \gloskeyval{description}{eye},
  \gloskeyval{prefix}{l'},
  \gloskeyval{prefixplural}{les\strong{\gls{space}}}}
\end{codebox*}

\glsxtrnote
If you want to convert this example to use \sty{glossaries-extra},
then (as from v1.42) you can use the \opt{prefix} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{prefix}},\opt{postdot},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
(Alternatively load \sty{glossaries-prefix} after
\sty{glossaries-extra}.) The rest of the document is the same as for
the base \sty{glossaries} package, unless you want to switch to
using \app{bib2gls}.

\bibglsnote
If you want to switch to \app{bib2gls}, first switch to
\sty{glossaries-extra} (as above) but make sure you include the
\opt{record} package option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{prefix},\opt{postdot},\opt{acronym}]\marg{glossaries-extra}
\end{codebox}
Next convert the entries into the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sample-prefix.tex entries.bib
\end{terminal}
Replace \gls{makeglossaries} with
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
remove the entry definitions from the \idxf{documentpreamble}, and replace
\begin{codebox}
\gls{printglossary}\oarg{\printglossoptval{style}{plist}}
\gls{printacronyms}
\end{codebox}
with
\begin{codebox}
\gls{printunsrtglossary}\oarg{\printglossoptval{style}{plist}}
\gls{printunsrtacronyms}
\end{codebox}
The document build is now:
\begin{terminal}
pdflatex sample-prefix
bib2gls sample-prefix
pdflatex sample-prefix
\end{terminal}

With \app{bib2gls} v2.0+, you don't need to manually insert the spaces at
the end of the prefixes. Instead you can instruct \app{bib2gls} to
insert them. To try this out, remove the trailing \gls{space} and 
\idx{nbsp} from the \filefmt{entries.bib} file:
\begin{codebox}
\atentry{entry}\marg{sample,
  \gloskeyval{prefix}{a},
  \gloskeyval{name}{sample},
  \gloskeyval{description}{an example},
  \gloskeyval{prefixplural}{the}
}
\codepar
\atentry{entry}\marg{oeil,
  \gloskeyval{plural}{yeux},
  \gloskeyval{prefix}{l'},
  \gloskeyval{name}{oeil},
  \gloskeyval{description}{eye},
  \gloskeyval{prefixplural}{les}
}
\codepar
\atentry{acronym}\marg{svm,
  \gloskeyval{prefixfirst}{a},
  \gloskeyval{prefix}{an},
  \gloskeyval{short}{SVM},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
Now add the \resourceoptvalm{append-prefix-field}{space or nbsp}
resource option:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\strong{\resourceoptvalm{append-prefix-field}{space or nbsp}}}
\end{codebox}
See the \app{bib2gls} manual for further details.

\filedef{sampleaccsupp.tex}
This document uses the \sty{glossaries-accsupp} package 
(see \sectionref{sec:accsupp}). That package automatically loads
\sty{glossaries} and passes all options to the base package. So
you can load both packages at once with just:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries-accsupp}
\end{codebox}
This provides additional keys that aren't available with just the
base package, which may be used to provide replacement text. The
replacement text is inserted using \sty{accsupp}['s]
\gls{BeginAccSupp} and \gls{EndAccSupp} commands. See the
\sty{accsupp} package for further details of those commands.

Note that this example document is provided to demonstrate
\sty{glossaries-accsupp} as succinctly as possible. The resulting
document isn't fully accessible as it's not tagged. See the
\sty{accessibility} and \sty{tagpdf} packages for further
information about tagging documents.

It's not essential to use \sty{glossaries-accsupp}. 
You can simply insert the replacement
text directly into the field values. For example:
\begin{codebox*}
\gls{newglossaryentry}\marg{Drive}\marg{
 \gloskeyval{name}{\gls{BeginAccSupp}\marg{Actual=Drive}Dr.\gls{EndAccSupp}\marg{}},
 \gloskeyval{description}{Drive}
}
\gls{newglossaryentry}\marg{image}\marg{\gloskeyval{name}{sample image},
 \gloskeyval{description}{an example image},
 \gloskeyval{user1}{\cmd{protect}\gls{BeginAccSupp}\marg{Alt=\marg{a boilerplate image used in
  examples}}\cmd{protect}\gls{includegraphics}
  \oarg{height=20pt}\marg{example-image}\cmd{protect}\gls{EndAccSupp}\marg{}}
}
\end{codebox*}
However, this can cause interference (especially with
\casechanging). With \sty{glossaries-accsupp} it's possible to
obtain the field values without the accessibility information if
required. (If in the future \gls{includegraphics} is given extra
options to provide replacement text then the image example here
won't be necessary. However, the example can be adapted for images
created with \TeX\ code.)

The \idx{acronymstyle} is set using:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
The first \idx{acronym} is straightforward:
\begin{codebox}
\gls{newacronym}\marg{eg}\marg{e.g.}\marg{for example}
\end{codebox}
The \gloskey{shortaccess} replacement text is automatically set to
the long form. The next \idx{acronym} is awkward as the long form contains
formatting commands which can't be included in the replacement text.
This means that the \gloskey{shortaccess} key must be supplied:
\begin{codebox}
\gls{newacronym}\oarg{\strong{\gloskey{shortaccess}}=\marg{TiKZ ist kein Zeichenprogramm}}
\marg{tikz}\marg{Ti\cmd{emph}\marg{k}Z}\marg{Ti\cmd{emph}\marg{k}Z ist \cmd{emph}\marg{kein} Zeichenprogramm}
\end{codebox}
In the above two cases, the short form obtained in \gls{gls} will use
the \qt{E} \idx{PDFelement}.

By way of comparison, there are some entries that are technically 
abbreviations but are defined using \gls{newglossaryentry} instead
of \gls{newacronym}. The replacement text is provided in the
\gloskey{access} key:
\begin{codebox}
\gls{newglossaryentry}\marg{Doctor}\marg{\gloskeyval{name}{Dr},\gloskeyval{description}{Doctor},\strong{\gloskey{access}}=\marg{Doctor}}
\gls{newglossaryentry}\marg{Drive}\marg{\gloskeyval{name}{Dr.},\gloskeyval{plural}{Drvs},\gloskeyval{description}{Drive},
  \strong{\gloskey{access}}=\marg{Drive}}
\end{codebox}
These will use the \qt{ActualText} \idx{PDFelement} (not \qt{E}).

The next \idx{entry} is a symbol (the integration symbol $\int$). This
could be defined simply as:
\begin{codebox}
\gls{newglossaryentry}\marg{int}\marg{\gloskeyval{name}{int},\gloskeyval{description}{integral},
 \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{int}}}}
\end{codebox}
and then referenced in the text like this:
\begin{codebox}
Symbol: \gls{gls}\marg{int} (\gls{glssymbol}\marg{int}).
\end{codebox}
This results in the text \qt{Symbol: integral ($\int$).} However if you
copy and paste this from the \idx{PDF} you will find the resulting text is
\qt{Symbol: int (R).} This is what's actually read out by the
text-to-speech system.

It would be better if the actual text was the Unicode character
0x222B. This would not only assist the text-to-speech system but
also make it easier to copy and paste the text. The simplest method
is to identify the character by its hexadecimal code, but in order
to do this the \gls{BeginAccSupp} command needs to have the options adjusted.

In order to determine whether to use \qt{E}, \qt{ActualText} or \qt{Alt} for a
particular field, \sty{glossaries-accsupp} will check if the command
\gls{glsfield-labelaccsupp} exists (where \meta{field-label} is the
\idx{internalfieldlabel}, see \tableref{tab:fieldmap}). Only two of these
commands are predefined: \gls{glsshortaccsupp} and \gls{glsshortplaccsupp},
which is why the \gloskey{shortaccess} field uses \qt{E}. If the given command
doesn't exist then the generic \gls{glsaccsupp} command is used instead.

This means that in order to simply set \gloskey{symbolaccess} to the
hexadecimal character code, I need to provide a command called
\glsfieldlabelaccsupp{symbol}:
\begin{codebox}
\cmd{newcommand}\marg{\glsfieldlabelaccsupp{\strong{symbol}}}[2]\marg{\comment{}
 \gls{glsaccessibility}\oarg{\strong{method=hex,unicode}}\marg{\strong{ActualText}}\marg{\#1}\marg{\#2}\comment{}
}
\end{codebox} 
Now I can adjust the definition of the \qt{int} \idx{entry}:
\begin{codebox}
\gls{newglossaryentry}\marg{int}\marg{\gloskeyval{name}{int},\gloskeyval{description}{integral},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{int}}},\strong{\gloskeyval{symbolaccess}{222B}}
}
\end{codebox}

The final \idx{entry} has an image stored in the \gloskey{user1} key. (The
image file is provided with the \sty{mwe} package.) This should use
\qt{Alt} instead of \qt{ActualText} so I need to define
\glsfieldlabelaccsupp{useri}:
\begin{codebox}
\cmd{newcommand}\marg{\glsfieldlabelaccsupp{\strong{useri}}}[2]\marg{\comment{}
  \gls{glsaccessibility}\marg{\strong{Alt}}\marg{\#1}\marg{\#2}\comment{}
}
\end{codebox}
The image description is provided in the \gloskey{user1access} key:
\begin{codebox}
\cmd{newglossaryentry}\marg{sampleimage}\marg{\gloskeyval{name}{sample image},
 \gloskeyval{description}{an example image},
 \gloskeyval{user1}{\cmd{protect}\gls{includegraphics}\oarg{height=20pt}\marg{example-image}},
 \strong{\gloskey{user1access}}=\marg{a boilerplate image used in examples}
}
\end{codebox}
(Note the need to protect the fragile \gls{includegraphics}. The alternative is
to use \gls{glsnoexpandfields} before defining the command. See
\sectionref{sec:expansion}.)

The \idx{PDF} can be inspected either by
uncompressing the file and viewing it in a text editor or you can use
a tool such as the PDFDebugger provided with 
\href{https://pdfbox.apache.org/}{PDFBox}. If you do this you will find
content like:
\begin{verbatim}
/Span << /ActualText (Doctor) >> BDC
  BT
    /F8 9.9626 Tf
    73.102 697.123 Td
    [ (Dr) ] TJ
  ET
EMC
\end{verbatim}
This shows that \qt{ActualText} was used for \code{\gls{gls}\marg{Doctor}}.
The integral symbol ($\int$) created with \code{\gls{glssymbol}\marg{int}} is:
\begin{verbatim}
/Span << /ActualText (\376\377"+) >> BDC
  BT
    /F1 9.9626 Tf
    97.732 650.382 Td
    [ (R) ] TJ
  ET
EMC
\end{verbatim} 
Again, \qt{ActualText} has been used, but the character code has
been supplied. The image created with \code{\gls{glsuseri}\marg{sampleimage}} is:
\begin{verbatim}
/Span << /Alt (a boilerplate image used in examples) >> BDC
  1 0 0 1 106.588 618.391 cm
  q
    0.08301 0 0 0.08301 0 0 cm
    q
      1 0 0 1 0 0 cm
      /Im1 Do
    Q
  Q
EMC
\end{verbatim}
This shows that \qt{Alt} has been used.

The first use of \code{\gls{gls}\marg{eg}} produces the long form (not
reproduced here) followed by the short form:
\begin{verbatim}
/Span << /E (for example) >> BDC
  BT
    /F8 9.9626 Tf
    161.687 563.624 Td
    [ (e.g.) ] TJ
  ET
EMC
\end{verbatim}
The subsequent use also has the \qt{E} element:
\begin{verbatim}
/Span << /E (for example) >> BDC
  BT
    /F8 9.9626 Tf
    118.543 551.669 Td
    [ (e.g.) ] TJ
  ET
EMC
\end{verbatim}
Similarly for \code{\gls{acrshort}\marg{eg}}. You can also use the
\opteqvalref{debug}{showaccsupp} package option. This will show the
replacement text in the document, but note that this is the content before
it's processed by \gls{BeginAccSupp}.

If the \gls{setacronymstyle} command is removed (or commented out)
then the result would be different. The \idx{firstuse} of \gls{gls} uses \qt{E} for
the short form but the subsequent use has \qt{ActualText} instead.
This is because without \gls{setacronymstyle} the original acronym
mechanism is used, which is less sophisticated than the newer
acronym mechanism that's triggered with \gls{setacronymstyle}.

\begin{important}
If you want to convert this example so that it uses
\sty{glossaries-extra}, make sure you have at least version 1.42 of
the extension package.
\end{important}

\glsxtrnote
If you want to convert this example so that it uses
\sty{glossaries-extra}, you need to replace the explicit loading of
\sty{glossaries-accsupp} with an implicit load through the
\opt{accsupp} package option:
\begin{codebox}
\cmd{usepackage}[\opt{abbreviations},\strong{\opt{accsupp}}]\marg{\strong{glossaries-extra}}
\end{codebox}
I'm switching from \gls{newacronym} to \gls{newabbreviation}, which
means that the default category is \cat{abbreviation} and also the
file extensions are different. If you are using \app{makeglossaries}
or \app{makeglossaries-lite} you don't need to worry about it.
However, if you're not using those helper scripts then you will need
to adjust the file extensions in your document build process.

The style command \code{\gls{setacronymstyle}\marg{\acrstyle{long-short}}} needs
to be replaced with:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}
\end{codebox}
This is actually the default so you can simply delete the
\gls{setacronymstyle} line. Substitute the two instances of
\gls{newacronym} with \gls{newabbreviation}. For example:
\begin{codebox}
\strong{\gls{newabbreviation}}\marg{eg}\marg{e.g.}\marg{for example}
\end{codebox}
Note that for the \qt{tikz} entry you can now remove the explicit assignment of
\gloskey{shortaccess} with \sty{glossaries-extra} v1.42 as it will
strip formatting commands like \csfmt{emph}: 
\begin{codebox}
\gls{newabbreviation}
 \marg{tikz}\marg{Ti\cmd{emph}\marg{k}Z}\marg{Ti\cmd{emph}\marg{k}Z ist \cmd{emph}\marg{kein} Zeichenprogramm}
\end{codebox}
It's also necessary to replace \gls{acrshort}, \gls{acrlong} and \gls{acrfull} with
\gls{glsxtrshort}, \gls{glsxtrlong} and \gls{glsxtrfull}.

You may notice a slight difference from the original example if you use a
version of \sty{glossaries-extra} between 1.42 and 1.48. The
\gloskey{shortaccess} field shows \meta{long} (\meta{short}) instead of just
\meta{long}. This is because \sty{glossaries-extra} v1.42 redefined
\gls{glsdefaultshortaccess} to include the short form.  The original definition
was restored in \sty{glossaries} v1.49.

Now that the extension package is being used, there are some other
modifications that would tidy up the code and fix a few issues.

The \qt{Doctor} and \qt{Drive} entries should really be defined as
\idxpl{abbreviation} but they shouldn't be expanded on \idx{firstuse}. The
\abbrstyle{short-nolong} style can achieve this and it happens to be
the default style for the \cat{acronym} category. This means that
you can simply replace the \qt{Doctor} definition with:
\begin{codebox}
\gls{newacronym}\marg{Doctor}\marg{Dr}\marg{Doctor}
\end{codebox}
The \idx{firstuse} of \code{\gls{gls}\marg{Doctor}} is just \qt{Dr}.  This
means that the \qt{E} \idx{PDFelement} will be used instead of \qt{ActualText}.
Now I don't need to supply the accessibility text as its obtained
from the long form.

The \qt{Drive} \idx{entry} can be similarly defined but it has the awkward
terminating full stop. This means that I had to omit the end of
sentence terminator in:
\begin{codebox}
\gls{gls}\marg{Doctor} Smith lives at 2, Blueberry \gls{gls}\marg{Drive}
\end{codebox}
This looks odd when reading the document source and it's easy to
forgot. This is very similar to the situation in the
\samplefile{-dot-abbr} example. I can again use the
\catattr{discardperiod} \idx{categoryattribute}, but I need to assign a different
category so that it doesn't interfere with the \qt{Doctor}
\idx{entry}.

The category is simply a label that's used in the construction of
some internal command names. This means that it must be fully
expandable, but I can choose whatever label I like (\cat{general},
\cat{abbreviation}, \cat{acronym}, \cat{index}, \cat{symbol} and
\cat{number} are used by various commands provided by
\sty{glossaries-extra}).

In this case, I've decided to have a category called \catfmt{shortdotted} 
to indicate an \idx{abbreviation} that ends with a
dot but only the short form is shown on \idx{firstuse}:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{shortdotted}\marg{\abbrstyle{short-nolong-noreg}}
\gls{glssetcategoryattribute}\marg{shortdotted}\marg{\catattr{discardperiod}}\marg{true}
\gls{newabbreviation}\oarg{\gloskeyval{category}{shortdotted}}\marg{Drive}\marg{Dr.\gls{cs.at}}\marg{Drive}
\end{codebox*}
In the \samplefile{-dot-abbr} example, I also used the
\catattr{insertdots} \idxc{categoryattribute}{attribute} to automatically insert the dots and add
the space factor (which is adjusted if \catattr{discardperiod} discards
a period). In this case I'm inserting the dot manually so I've also
added the space factor with \gls{cs.at} in case the \idx{abbreviation} is used
mid-sentence. For example:
\begin{codebox}
\gls{gls}\marg{Doctor} Smith lives at 2, Blueberry \gls{gls}\marg{Drive}. Next sentence.
\codepar
\gls{gls}\marg{Doctor} Smith lives at 2, Blueberry \gls{gls}\marg{Drive} end of sentence.
\end{codebox}
(The spacing is more noticeable if you first switch to a monospaced
font with \cmd{ttfamily}.)

The \qt{e.g.}\ \idx{abbreviation} similarly ends with a dot. It's not
usual to write \qt{for example (e.g.)}\ in a document, so it really
ought to have the same \catfmt{shortdotted} category, but it has a
long-short form for illustrative purposes in this test document. In
this case I need to choose another category so that I can apply a
different style. For example:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{longshortdotted}\marg{\abbrstyle{long-short}}
\gls{glssetcategoryattribute}\marg{longshortdotted}\marg{\catattr{discardperiod}}\marg{true}
\gls{newabbreviation}\oarg{\gloskeyval{category}{longshortdotted}}\marg{e.g.}\marg{e.g.\gls{cs.at}}\marg{for example}
\end{codebox}

To further illustrate categories, let's suppose the symbol and image should be
in the \gloskey{name} field instead of the \gloskey{symbol} and \gloskey{user1}
fields. Now the \glsfieldlabelaccsupp{symbol} and \glsfieldlabelaccsupp{useri}
commands won't be used. I can't deal with both cases if I just provide
\glsfieldlabelaccsupp{name}. 

I could provide category+field versions, such as
\glsxtrcategoryfieldaccsupp{symbolname}, but remember that this only covers
accessing the \gloskey{name} field, which is typically only done in
the glossary. I would also need similar commands for the
\gloskey{first}, \gloskey{firstplural}, \gloskey{text} and
\gloskey{plural} keys. This is quite complicated, but since I don't
need to worry about any of the other fields it's simpler to just
provide the \gls{glsxtrcategoryaccsupp} version:
\begin{codebox}
\cmd{newcommand}\marg{\glsxtrcategoryaccsupp{\strong{symbol}}}[2]\marg{\comment{}
 \gls{glsaccessibility}\oarg{method=hex,unicode}\marg{ActualText}\marg{\#1}\marg{\#2}\comment{}
}
\cmd{newcommand}\marg{\glsxtrcategoryaccsupp{\strong{image}}}[2]\marg{\comment{}
  \gls{glsaccessibility}\marg{Alt}\marg{\#1}\marg{\#2}\comment{}
}
\codepar
\gls{newglossaryentry}\marg{int}\marg{\strong{\gloskeyval{category}{\cat{symbol}}},
  \strong{\gloskey{name}}=\marg{\gls{ensuremath}\marg{\cmd{int}}},\strong{\gloskey{access}}=\marg{222B},
  \gloskeyval{description}{integral}
}
\codepar
\gls{newglossaryentry}\marg{sampleimage}\marg{\strong{\gloskeyval{category}{image}},
 \gloskeyval{description}{an example image},
 \strong{\gloskey{name}}=\marg{\cmd{protect}\gls{includegraphics}\oarg{height=20pt}\marg{example-image}},
 \strong{\gloskey{access}}=\marg{a boilerplate image used in examples}
}
\end{codebox}
If it's necessary to provide support for additional fields, then the
category+field command \gls{glsxtrcategoryfieldaccsupp} could be used to
override the more general category command \gls{glsxtrcategoryaccsupp}.

\filedef{sample-ignored.tex}
This document defines an \idx{ignoredglossary} for
common terms that don't need a definition. The document build is:
\begin{terminal}
pdflatex sample-ignored
makeglossaries sample-ignored
pdflatex sample-ignored
\end{terminal}
A new \idx{ignoredglossary} is defined with:
\begin{codebox}
\gls{newignoredglossary}\marg{common}
\end{codebox}
There are no associated files with an \idx{ignoredglossary}. An entry is defined with 
this as its \idx{glossary} type:
\begin{codebox}
\gls{newglossaryentry}\marg{commonex}\marg{\gloskeyval{type}{common},\gloskeyval{name}{common term}}
\end{codebox}
Note that the \gloskey{description} key isn't required. This term
may be referenced with \gls{gls} (which is useful for consistent
formatting) but it won't be indexed.

\filedef{sample-entrycount.tex}
This document uses \gls{glsenableentrycount}
and \gls{cgls} (described in \sectionref{sec:enableentrycount})
so that acronyms only used once don't appear in the list of
acronyms. The document build is:
\begin{terminal}
pdflatex sample-entrycount
pdflatex sample-entrycount
makeglossaries sample-entrycount
pdflatex sample-entrycount
\end{terminal}
Note the need to call \LaTeX\ twice before \app{makeglossaries}, and
then a final \LaTeX\ call is required at the end.

\begin{xtr}
The \sty{glossaries-extra} package has additions that extend this
mechanism and comes with some other sample files related to entry counting.
\end{xtr}

\begin{bib2gls}
If you switch to \app{bib2gls} you can use record counting instead.
See the \app{bib2gls} manual for further details.
\end{bib2gls}

\chapter{Troubleshooting}
\label{sec:trouble}

In addition to the sample files listed in \sectionref{sec:samples}, 
the \sty{glossaries} package comes with some minimal example
files, \file{minimalgls.tex}, \file{mwe-gls.tex},
\file{mwe-acr.tex} and \file{mwe-acr-desc.tex}, which can be
used for testing. These should be located in the \filefmt{samples}
subdirectory (folder) of the \sty{glossaries} documentation
directory. The location varies according to your operating system
and \TeX\ installation.  For example, on Linux it may
be in \filefmt{/usr/local/texlive/2022/texmf-dist/doc/latex/glossaries/}.
The \app{makeglossariesgui} application can also be used to test for
various problems.
Further information on debugging \LaTeX\ code is available at
\url{http://www.dickimaw-books.com/latex/minexample/}.

If you have any problems, please first consult the 
\faqspkg{glossaries}. If that
doesn't help, try posting your query to somewhere like the
\texttt{comp.text.tex} newsgroup, the 
\urlfootref{https://latex.org/forum/}{\LaTeX\ Community Forum} or 
\urlfootref{https://tex.stackexchange.com/}{\TeX\ on StackExchange}. 
Bug reports can be submitted via 
\urlfootref{https://www.dickimaw-books.com/bug-report.html}{my package bug report form}. 


\part{Summaries and Index}
\label{summaries}
\backmatter
\printterms[title={Terms}]
\printcommonoptions[label=sec:gloskeys]{idx.gloskey}
\printcommonoptions{idx.glsopt}
\printcommonoptions{idx.printglossopt}
\printcommonoptions{idx.acronymstyle}
\printcommonoptions{idx.glossarystyle}
\printsummary
    
\printuserguideindex

\end{document}