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
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd-->
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)" />
<meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)" />
<!-- xhtml,fn-in,css-in,uni-html4,utf8 -->
<meta name="src" content="glossariesbegin.tex" />
<style type="text/css">
<!--
/* start css.sty */
.cmr-17{font-size:170%;}
.cmr-12{font-size:120%;}
.cmr-8{font-size:80%;}
.cmtt-12{font-size:120%;font-family: monospace;}
.cmtt-12{font-family: monospace;}
.cmtt-12{font-family: monospace;}
.cmtt-12{font-family: monospace;}
.cmr-9{font-size:90%;}
.cmbx-9{font-size:90%; font-weight: bold;}
.cmbx-9{ font-weight: bold;}
.cmss-9{font-size:90%; font-family: sans-serif;}
.cmss-9{ font-family: sans-serif;}
.cmss-9{ font-family: sans-serif;}
.cmtt-10{font-family: monospace;}
.cmtt-10{font-family: monospace;}
.cmtt-10{font-family: monospace;}
.cmtt-10{font-family: monospace;}
.cmss-10{ font-family: sans-serif;}
.cmss-10{ font-family: sans-serif;}
.cmss-10{ font-family: sans-serif;}
.cmti-10{ font-style: italic;}
.cmtt-9{font-size:90%;font-family: monospace;}
.cmtt-9{font-family: monospace;}
.cmtt-9{font-family: monospace;}
.cmtt-9{font-family: monospace;}
.cmitt-10{font-family: monospace; font-style: italic;}
.cmbx-10{ font-weight: bold;}
.cmbx-10{ font-weight: bold;}
.cmsy-9{font-size:90%;}
.cmss-8{font-size:80%; font-family: sans-serif;}
.cmss-8{ font-family: sans-serif;}
.cmss-8{ font-family: sans-serif;}
.small-caps{font-variant: small-caps; }
p.noindent { text-indent: 0em }
td p.noindent { text-indent: 0em; margin-top:0em; }
p.nopar { text-indent: 0em; }
p.indent{ text-indent: 1.5em }
@media print {div.crosslinks {visibility:hidden;}}
a img { border-top: 0; border-left: 0; border-right: 0; }
center { margin-top:1em; margin-bottom:1em; }
td center { margin-top:0em; margin-bottom:0em; }
.Canvas { position:relative; }
img.math{vertical-align:middle;}
li p.indent { text-indent: 0em }
li p:first-child{ margin-top:0em; }
li p:last-child, li div:last-child { margin-bottom:0.5em; }
li p~ul:last-child, li p~ol:last-child{ margin-bottom:0.5em; }
.enumerate1 {list-style-type:decimal;}
.enumerate2 {list-style-type:lower-alpha;}
.enumerate3 {list-style-type:lower-roman;}
.enumerate4 {list-style-type:upper-alpha;}
div.newtheorem { margin-bottom: 2em; margin-top: 2em;}
.obeylines-h,.obeylines-v {white-space: nowrap; }
div.obeylines-v p { margin-top:0; margin-bottom:0; }
.overline{ text-decoration:overline; }
.overline img{ border-top: 1px solid black; }
td.displaylines {text-align:center; white-space:nowrap;}
.centerline {text-align:center;}
.rightline {text-align:right;}
div.verbatim {font-family: monospace; white-space: nowrap; text-align:left; clear:both; }
.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
div.fbox {display:table}
div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
div.minipage{width:100%;}
div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;}
div.center div {text-align: left;}
div.flushright, div.flushright div.flushright {text-align: right;}
div.flushright div {text-align: left;}
div.flushleft {text-align: left;}
.underline{ text-decoration:underline; }
.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; }
.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
.framebox-c {text-align:center;}
.framebox-l {text-align:left;}
.framebox-r {text-align:right;}
span.thank-mark{ vertical-align: super }
span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; }
div.footnotes{border-top:solid 1px black; border-bottom:solid 1px black; padding-bottom:1ex; padding-top:0.5ex; margin-right:15%; margin-top:2ex; font-style:italic; font-size:85%;}
div.footnotes p{margin-top:0; margin-bottom:0; text-indent:0;}
div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; }
table.tabular td p{margin-top:0em;}
table.tabular {margin-left: auto; margin-right: auto;}
td p:first-child{ margin-top:0em; }
td p:last-child{ margin-bottom:0em; }
div.td00{ margin-left:0pt; margin-right:0pt; }
div.td01{ margin-left:0pt; margin-right:5pt; }
div.td10{ margin-left:5pt; margin-right:0pt; }
div.td11{ margin-left:5pt; margin-right:5pt; }
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
td.td00{ padding-left:0pt; padding-right:0pt; }
td.td01{ padding-left:0pt; padding-right:5pt; }
td.td10{ padding-left:5pt; padding-right:0pt; }
td.td11{ padding-left:5pt; padding-right:5pt; }
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
.hline hr, .cline hr{ height : 1px; margin:0px; }
.tabbing-right {text-align:right;}
span.TEX {letter-spacing: -0.125em; }
span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;}
a span.TEX span.E {text-decoration: none; }
span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;}
span.LATEX span.TEX{ position:relative; left: -0.4em; }
div.float, div.figure {margin-left: auto; margin-right: auto;}
div.float img {text-align:center;}
div.figure img {text-align:center;}
.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;}
.marginpar p{margin-top:0.4em; margin-bottom:0.4em;}
table.equation {width:100%;}
.equation td{text-align:center; }
td.equation { margin-top:1em; margin-bottom:1em; }
td.equation-label { width:5%; text-align:center; }
td.eqnarray4 { width:5%; white-space: normal; }
td.eqnarray2 { width:5%; }
table.eqnarray-star, table.eqnarray {width:100%;}
div.eqnarray{text-align:center;}
div.array {text-align:center;}
div.pmatrix {text-align:center;}
table.pmatrix {width:100%;}
span.pmatrix img{vertical-align:middle;}
div.pmatrix {text-align:center;}
table.pmatrix {width:100%;}
span.bar-css {text-decoration:overline;}
img.cdots{vertical-align:middle;}
.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;}
.index-item, .index-subitem, .index-subsubitem {display:block}
div.caption {text-indent:-2em; margin-left:3em; margin-right:1em; text-align:left;}
div.caption span.id{font-weight: bold; white-space: nowrap; }
h1.partHead{text-align: center}
p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;}
.subparagraphHead, .likesubparagraphHead { font-weight: bold;}
.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; margin-right:1em; text-align:justify;}
.verse{white-space:nowrap; margin-left:2em}
div.maketitle {text-align:center;}
h2.titleHead{text-align:center;}
div.maketitle{ margin-bottom: 2em; }
div.author, div.date {text-align:center;}
div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; }
.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; }
.abstract p {margin-left:5%; margin-right:5%;}
div.abstract {width:100%;}
.alltt P { margin-bottom : 0em; margin-top : 0em; }
.alltt { margin-bottom : 1em; margin-top : 1em; }
div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; }
table.tabular td p{margin-top:0em;}
table.tabular {margin-left: auto; margin-right: auto;}
td p:first-child{ margin-top:0em; }
td p:last-child{ margin-bottom:0em; }
div.td00{ margin-left:0pt; margin-right:0pt; }
div.td01{ margin-left:0pt; margin-right:5pt; }
div.td10{ margin-left:5pt; margin-right:0pt; }
div.td11{ margin-left:5pt; margin-right:5pt; }
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
td.td00{ padding-left:0pt; padding-right:0pt; }
td.td01{ padding-left:0pt; padding-right:5pt; }
td.td10{ padding-left:5pt; padding-right:0pt; }
td.td11{ padding-left:5pt; padding-right:5pt; }
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
.hline hr, .cline hr{ height : 1px; margin:0px; }
div.array {text-align:center;}
.equation td{text-align:center; }
.equation-star td{text-align:center; }
table.equation-star { width:100%; }
table.equation { width:100%; }
table.align, table.alignat, table.xalignat, table.xxalignat, table.flalign {width:95%; margin-left:5%; white-space: nowrap;}
table.align-star, table.alignat-star, table.xalignat-star, table.flalign-star {margin-left:auto; margin-right:auto; white-space: nowrap;}
td.align-label { width:5%; text-align:center; }
td.align-odd { text-align:right; padding-right:0.3em;}
td.align-even { text-align:left; padding-right:0.6em;}
table.multline, table.multline-star {width:100%;}
td.gather {text-align:center; }
table.gather {width:100%;}
div.gather-star {text-align:center;}
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
div.longtable{text-align:center;}
.supertabular {text-align:center}
div.important { border : solid red; }
div.verbatim { font-family: monospace; white-space: nowrap; text-align:left; clear:both; padding-top: 2ex; padding-bottom: 2ex;}
span#textcolor1{color:#00FF00}
span#textcolor2{color:#00FF00}
span#textcolor3{color:#00FF00}
span#textcolor4{color:#FF0000}
span#textcolor5{color:#00FF00}
span#textcolor6{color:#FF0000}
span#textcolor7{color:#FF0000}
span#textcolor8{color:#FF0000}
span#textcolor9{color:#00FF00}
span#textcolor10{color:#00FF00}
span#textcolor11{color:#FF0000}
span#textcolor12{color:#00FF00}
span#textcolor13{color:#00FF00}
span#textcolor14{color:#00FF00}
span#textcolor15{color:#00FF00}
span#textcolor16{color:#FF0000}
span#textcolor17{color:#FF0000}
span#textcolor18{color:#FF0000}
span#textcolor19{color:#00FF00}
span#textcolor20{color:#00FF00}
span#textcolor21{color:#FF0000}
span#textcolor22{color:#00FF00}
span#textcolor23{color:#00FF00}
span#textcolor24{color:#00FF00}
span#textcolor25{color:#00FF00}
span#textcolor26{color:#FF0000}
span#textcolor27{color:#FF0000}
span#textcolor28{color:#00FF00}
span#textcolor29{color:#FF0000}
span#textcolor30{color:#FF0000}
span#textcolor31{color:#FF0000}
span#textcolor32{color:#00FF00}
span#textcolor33{color:#FF0000}
span#textcolor34{color:#00FF00}
span#textcolor35{color:#00FF00}
span#textcolor36{color:#00FF00}
span#textcolor37{color:#00FF00}
span#textcolor38{color:#FF0000}
span#textcolor39{color:#00FF00}
span#textcolor40{color:#00FF00}
/* end css.sty */
-->
</style>
</head><body
>
<!--l. 55--><p class="noindent" ><a
id="top"></a>
</p><!--l. 55--><p class="indent" >
</p><!--l. 55--><p class="indent" >
</p>
<div class="center"
>
<!--l. 55--><p class="noindent" >
</p><!--l. 55--><p class="noindent" ><span
class="cmr-17">The glossaries package v4.36: a guide for</span>
<span
class="cmr-17">beginners</span>
</p>
<div class="tabular"> <table id="TBL-1" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-1-1g"><col
id="TBL-1-1" /></colgroup><tr
style="vertical-align:baseline;" id="TBL-1-1-"><td style="white-space:nowrap; text-align:center;" id="TBL-1-1-1"
class="td11"> <span
class="cmr-12">Nicola L.C. Talbot </span></td></tr></table>
</div>
<!--l. 55--><p class="noindent" ><span
class="cmr-12">2018-03-07</span></p></div>
<div
class="abstract"
>
<div class="center"
>
<!--l. 57--><p class="noindent" >
</p><!--l. 57--><p class="noindent" ><span
class="cmbx-9">Abstract</span></p></div>
<!--l. 58--><p class="indent" > <span
class="cmr-9">The </span><span
class="cmss-9">glossaries </span><span
class="cmr-9">package is very flexible, but this means that it has a</span><span
class="cmr-9"> lot</span>
<span
class="cmr-9">of options, and since a user guide is supposed to provide a complete list</span>
<span
class="cmr-9">of all the high-level user commands, the main user manual is quite big.</span>
<span
class="cmr-9">This can be rather daunting for beginners, so this document is a brief</span>
<span
class="cmr-9">introduction just to help get you started. If you find yourself saying, “Yeah,</span>
<span
class="cmr-9">but how can I do</span><span
class="cmr-9">…?” then it’s time to move on to the </span><a
href="glossaries-user.html" ><span
class="cmr-9">main user manual</span></a><span
class="cmr-9">.</span>
</p><!--l. 67--><p class="indent" > <span
class="cmr-9">I’ve made some statements in this document that don’t actually tell</span>
<span
class="cmr-9">you the full truth, but it would clutter the document and cause confusion</span>
<span
class="cmr-9">if I keep writing “except when </span><span
class="cmr-9">…” or “but you can also do this, that or</span>
<span
class="cmr-9">the other” or “you can do it this way but you can also do it that way, but</span>
<span
class="cmr-9">that way may cause complications under certain circumstances”.</span>
</p>
</div>
<h3 class="likesectionHead"><a
id="x1-1000"></a>Contents</h3>
<div class="tableofcontents">
<span class="sectionToc" >1 <a
href="#sec:start" id="QQ2-1-2">Getting Started</a></span>
<br /> <span class="sectionToc" >2 <a
href="#sec:defterm" id="QQ2-1-3">Defining Terms</a></span>
<br /> <span class="sectionToc" >3 <a
href="#sec:useterm" id="QQ2-1-4">Using Entries</a></span>
<br /> <span class="sectionToc" >4 <a
href="#sec:printglossaries" id="QQ2-1-5">Displaying a List of Entries</a></span>
<br /> <span class="sectionToc" >5 <a
href="#sec:glosstyle" id="QQ2-1-7">Customising the Glossary</a></span>
<br /> <span class="sectionToc" >6 <a
href="#sec:multigloss" id="QQ2-1-8">Multiple Glossaries</a></span>
<br /> <span class="sectionToc" >7 <a
href="#sec:hyperref" id="QQ2-1-9">glossaries and hyperref</a></span>
<br /> <span class="sectionToc" >8 <a
href="#sec:xr" id="QQ2-1-10">Cross-References</a></span>
<br /> <span class="sectionToc" >9 <a
href="#sec:moreinfo" id="QQ2-1-11">Further Information</a></span>
</div>
<!--l. 77--><p class="noindent" >
</p>
<!--l. 77--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">1 </span> <a
id="sec:start"></a>Getting Started</h3>
<!--l. 80--><p class="noindent" >As with all packages, you need to load <span
class="cmss-10">glossaries </span>with <span
class="cmtt-10">\usepackage</span>, but
there are certain packages that must be loaded before <span
class="cmss-10">glossaries</span>, <span
class="cmti-10">if </span>they are
required: <span
class="cmss-10">hyperref</span><a
id="dx1-2001"></a>, <span
class="cmss-10">babel</span><a
id="dx1-2002"></a>, <span
class="cmss-10">polyglossia</span><a
id="dx1-2003"></a>, <span
class="cmss-10">inputenc</span><a
id="dx1-2004"></a> and <span
class="cmss-10">fontenc</span><a
id="dx1-2005"></a>. (You don’t have
to load these packages, but if you want them, you must load them before
<span
class="cmss-10">glossaries</span>.)
</p><!--l. 87--><p class="indent" > <div class="important" title="Important Note"> If you require multilingual support you must also install the relevant
language module. Each language module is called <span
class="cmtt-10">glossaries-</span>⟨<span
class="cmti-10">language</span>⟩, where
⟨<span
class="cmti-10">language</span>⟩ is the root language name. For example, <span
class="cmtt-10">glossaries-french </span>or
<span
class="cmtt-10">glossaries-german</span>. If a language module is required, the <span
class="cmss-10">glossaries </span>package will
automatically try to load it and will give a warning if the module isn’t found.
</div>
</p><!--l. 95--><p class="noindent" >
</p><!--l. 97--><p class="indent" > Once you have loaded <span
class="cmss-10">glossaries</span>, you need to define your terms in the
preamble and then you can use them throughout the document. Here’s a simple
example:
</p>
<div class="verbatim" id="verbatim-1">
 \documentclass{article}
 <br /> \usepackage{glossaries}
 <br /> \newglossaryentry{ex}{name={sample},description={an example}}
 <br /> \begin{document}
 <br /> Here's my \gls{ex} term.
 <br /> \end{document}
</div>
<!--l. 110--><p class="nopar" > This produces:
</p><div class="quote">
<!--l. 113--><p class="noindent" >Here’s my sample term.</p></div>
<!--l. 115--><p class="noindent" >Here’s another example:
</p>
<div class="verbatim" id="verbatim-2">
 \documentclass{article}
 <br /> \usepackage{glossaries}
 <br /> \setacronymstyle{long-short}
 <br /> \newacronym{svm}{SVM}{support vector machine}
 <br /> \begin{document}
 <br /> First use: \gls{svm}. Second use: \gls{svm}.
 <br /> \end{document}
</div>
<!--l. 128--><p class="nopar" > This produces:
</p><div class="quote">
<!--l. 131--><p class="noindent" >First use: support vector machine (SVM). Second use: SVM.</p></div>
<!--l. 133--><p class="noindent" >In this case, the text produced by <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\gls{svm}</span></span></span> changed after the first use. The first use
produced the long form followed by the short form in parentheses because I set the
acronym style to <span
class="cmtt-10">long-short</span>. I suggest you try the above two examples to
make sure you have the package correctly installed. If you get an <span
class="cmtt-10">undefined</span>
<span
class="cmtt-10">control sequence </span>error, check that the version number at the top of this
document matches the version you have installed. (Open the <span
class="cmtt-10">.log </span>file and search
for the line that starts with <span
class="cmtt-10">Package: glossaries </span>followed by a date and
version.)
</p><!--l. 144--><p class="indent" > Abbreviations are slightly different if you use the extension package <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2006"></a>
(which needs to be installed separately):
</p>
<div class="verbatim" id="verbatim-3">
 \documentclass{article}
 <br /> \usepackage{glossaries-extra}
 <br /> \setabbreviationstyle{long-short}% glossaries-extra.sty
 <br /> \newabbreviation{svm}{SVM}{support vector machine}% glossaries-extra.sty
 <br /> \begin{document}
 <br /> First use: \gls{svm}. Second use: \gls{svm}.
 <br /> \end{document}
</div>
<!--l. 158--><p class="nopar" > If you still want to use <span
class="cmtt-10">\newacronym </span>(rather than <span
class="cmtt-10">\newabbreviation</span>) then you need
the optional argument of <span
class="cmtt-10">\setabbreviationstyle</span>:
</p>
<div class="verbatim" id="verbatim-4">
 \documentclass{article}
 <br /> \usepackage{glossaries-extra}
 <br /> \setabbreviationstyle[acronym]{long-short}% glossaries-extra.sty only
 <br /> \newacronym{svm}{SVM}{support vector machine}
 <br /> \begin{document}
 <br /> First use: \gls{svm}. Second use: \gls{svm}.
 <br /> \end{document}
</div>
<!--l. 174--><p class="nopar" >
</p><!--l. 175--><p class="indent" > <div class="important" title="Important Note"> You can’t use <span
class="cmtt-10">\setacronymstyle </span>with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2007"></a>. </div>
</p><!--l. 177--><p class="noindent" >
</p><!--l. 179--><p class="indent" > If you like, you can put all your definitions in another file (for example,
<span
class="cmtt-10">defns.tex</span>) and load that file in the preamble using <span
class="cmtt-10">\loadglsentries </span>with the
filename as the argument. For example:
</p>
<div class="verbatim" id="verbatim-5">
\loadglsentries{defns}
</div>
<!--l. 184--><p class="nopar" > If you find you have a really large number of definitions that are hard to manage in a
<span
class="cmtt-10">.tex </span>file, you might want to have a look at <span
class="cmtt-10">bib2gls</span><a
id="dx1-2008"></a> (installed separately) which
requires a <span
class="cmtt-10">.bib </span>format instead that can be managed by an application such as
JabRef.
</p><!--l. 191--><p class="indent" > Don’t try inserting formatting commands into the definitions as they can interfere
with the underlying mechanism. Instead, the formatting should be done by the
style. For example, suppose I want to replace <span
class="cmtt-10">SVM </span>with <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\textsc{svm}</span></span></span>, then
I need to select a style that uses <span
class="cmtt-10">\textsc</span>, like this (for the base <span
class="cmss-10">glossaries</span>
style):
</p>
<div class="verbatim" id="verbatim-6">
 \documentclass{article}
 <br /> \usepackage{glossaries}
 <br /> \setacronymstyle{long-sc-short}
 <br /> \newacronym{svm}{svm}{support vector machine}
 <br /> \begin{document}
 <br /> First use: \gls{svm}. Second use: \gls{svm}.
 <br /> \end{document}
</div>
<!--l. 209--><p class="nopar" > The abbreviation styles have a different naming scheme with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2009"></a>:
</p>
<div class="verbatim" id="verbatim-7">
 \documentclass{article}
 <br /> \usepackage{glossaries-extra}
 <br /> \setabbreviationstyle{long-short-sc}% glossaries-extra.sty
 <br /> \newabbreviation{svm}{svm}{support vector machine}% glossaries-extra.sty
 <br /> \begin{document}
 <br /> First use: \gls{svm}. Second use: \gls{svm}.
 <br /> \end{document}
</div>
<!--l. 224--><p class="nopar" > With <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2010"></a> you can have multiple abbreviation styles for different
categories. Many of these styles have their own associated formatting commands that
can be redefined for minor adjustments. For example:
</p>
<div class="verbatim" id="verbatim-8">
 \documentclass{article}
 <br /> \usepackage{glossaries-extra}
 <br /> \setabbreviationstyle[statistical]{long-short-sc}
 <br /> \setabbreviationstyle[bacteria]{long-only-short-only}
 <br /> % Formatting commands used by 'long-only-short-only' style:
 <br /> \renewcommand*{\glsabbrvonlyfont}[1]{\emph{#1}}
 <br /> \renewcommand*{\glslongonlyfont}[1]{\emph{#1}}
 <br /> % Formatting command used by 'long-short-sc' style:
 <br /> % (make sure abbreviation is converted to lower case)
 <br /> \renewcommand*{\glsabbrvscfont}[1]{\textsc{\MakeLowercase{#1}}}
 <br /> \newabbreviation
 <br />  [
 <br />    category={statistical}% glossaries-extra.sty key
 <br />  ]
 <br />  {svm}{SVM}{support vector machine}
 <br /> \newabbreviation
 <br />  [
 <br />    category={bacteria}% glossaries-extra.sty key
 <br />  ]
 <br />  {cbot}{C.~botulinum}{Clostridium botulinum}
 <br /> \begin{document}
 <br /> First use: \gls{svm}, \gls{cbot}.
 <br /> Next use: \gls{svm}, \gls{cbot}.
 <br /> \end{document}
</div>
<!--l. 262--><p class="nopar" > This produces:
</p><div class="quote">
<!--l. 265--><p class="noindent" >First use: support vector machine (<span
class="cmcsc-10"><span
class="small-caps">s</span><span
class="small-caps">v</span><span
class="small-caps">m</span></span>), <span
class="cmti-10">Clostridium botulinum</span>.
</p><!--l. 268--><p class="noindent" >Next use: <span
class="cmcsc-10"><span
class="small-caps">s</span><span
class="small-caps">v</span><span
class="small-caps">m</span></span>, <span
class="cmti-10">C.</span><span
class="cmti-10"> botulinum</span>.</p></div>
<!--l. 271--><p class="indent" > As you can hopefully see from the above examples, there are two main ways of
defining a term: as a general entry (<span
class="cmtt-10">\newglossaryentry</span>) or as an abbreviation
(<span
class="cmtt-10">\newacronym </span>or, with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2011"></a>, <span
class="cmtt-10">\newabbreviation</span>).
</p><!--l. 276--><p class="indent" > Regardless of the method of defining a term, the term is always given a label. In
the first example, the label was <span
class="cmtt-10">ex </span>and in the other examples the label was <span
class="cmtt-10">svm </span>(and
<span
class="cmtt-10">cbot </span>in the last example). The label is used to uniquely identify the term (like the
standard <span
class="cmtt-10">\label</span>/<span
class="cmtt-10">\ref </span>or <span
class="cmtt-10">\cite </span>mechanism). It’s best to just use the following
alphanumerics in the labels: <span
class="cmtt-10">a</span>, …, <span
class="cmtt-10">z</span>, <span
class="cmtt-10">A</span>, …, <span
class="cmtt-10">Z</span>, <span
class="cmtt-10">0</span>, …, <span
class="cmtt-10">9</span>. Sometimes you can also use
punctuation characters but not if another package (such as <span
class="cmss-10">babel</span><a
id="dx1-2012"></a>) meddles with
them. Don’t try using any characters outside of the basic Latin set with
<span
class="cmss-10">inputenc</span><a
id="dx1-2013"></a> (for example, é or ß) or things will go horribly wrong. This warning
only applies to the label. It doesn’t apply to the text that appears in the
document.
</p><!--l. 291--><p class="indent" > <div class="important" title="Important Note"> Don’t use <span
class="cmtt-10">\gls </span>in chapter or section headings as it can have some unpleasant
side-effects. Instead use <span
class="cmtt-10">\glsentrytext </span>for regular entries and one of <span
class="cmtt-10">\glsentryshort</span>,
<span
class="cmtt-10">\glsentrylong </span>or <span
class="cmtt-10">\glsentryfull </span>for acronyms. Alternatively use <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2014"></a>
which provides special commands for use in section headings, such as <span
class="cmtt-10">\glsfmtshort</span>
<span
class="cmtt-10">{</span>⟨<span
class="cmti-10">label</span>⟩<span
class="cmtt-10">}</span>. </div>
</p><!--l. 298--><p class="noindent" >
</p><!--l. 300--><p class="indent" > The above examples are reasonably straightforward. The difficulty comes if you
want to display a <span
class="cmti-10">sorted </span>list of all the entries you have used in the document. The
<span
class="cmss-10">glossaries-extra</span><a
id="dx1-2015"></a> package provides a really easy way of listing all the defined
entries:
</p>
<div class="verbatim" id="verbatim-9">
 \documentclass{article}
 <br /> \usepackage[sort=none]{glossaries-extra}
 <br /> \newglossaryentry{potato}{name={potato},plural={potatoes},
 <br />  description={starchy tuber}}
 <br /> \newglossaryentry{cabbage}{name={cabbage},
 <br />  description={vegetable with thick green or purple leaves}}
 <br /> \newglossaryentry{turnip}{name={turnip},
 <br />  description={round pale root vegetable}}
 <br /> \newglossaryentry{carrot}{name={carrot},
 <br />  description={orange root}}
 <br /> \begin{document}
 <br /> Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}.
 <br /> \printunsrtglossaries % list all entries
 <br /> \end{document}
</div>
<!--l. 326--><p class="nopar" > However this method doesn’t sort the entries (they’re listed in order of definition)
and it will display all the defined entries, regardless of whether or not you’ve used
them all in the document, so “turnip” appears in the glossary even though there’s no
<span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\gls{turnip}</span></span></span> (or similar) in the document.
</p><!--l. 333--><p class="indent" > The <span
class="cmss-10">sort=none</span><a
id="dx1-2016"></a> option isn’t essential in this case (there’s no other sort option
available for this document), but it prevents the automatic construction of the sort
value and so slightly improves the document build time.
</p><!--l. 338--><p class="indent" > Note that this example document uses the same command (<span
class="cmtt-10">\printunsrtglossaries</span>)
that’s used with <span
class="cmtt-10">bib2gls</span><a
id="dx1-2017"></a> (<a
href="#option4">Option 4</a>) but with <span
class="cmtt-10">bib2gls</span><a
id="dx1-2018"></a> you instead need to use the
<span
class="cmss-10">record</span><a
id="dx1-2019"></a> package option and one or more instances of <span
class="cmtt-10">\GlsXtrLoadResources </span>in the
preamble (see below).
</p><!--l. 344--><p class="indent" > Most users prefer to have an automatically sorted list that only contains entries
that have been used in the document. The <span
class="cmss-10">glossaries </span>package provides three options:
use <span class="TEX">T<span
class="E">E</span>X</span> to perform the sorting (<a
href="#option1">Option 1</a>); use <span
class="cmtt-10">makeindex</span><a
id="dx1-2020"></a> to perform
the sorting (<a
href="#option2">Option 2</a>); use <span
class="cmtt-10">xindy</span><a
id="dx1-2021"></a> to perform the sorting (<a
href="#option3">Option 3</a>). The
extension package <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2022"></a> provides a fourth method: use <span
class="cmtt-10">bib2gls</span><a
id="dx1-2023"></a>
(<a
href="#option4">Option 4</a>).
</p><!--l. 352--><p class="indent" > The first option (using <span class="TEX">T<span
class="E">E</span>X</span>) is the simplest method, as it doesn’t require an
external tool, but it’s very inefficient and the sorting is done according to the English
alphabet. To use this method, add <span
class="cmtt-10">\makenoidxglossaries </span>to the preamble and put
<span
class="cmtt-10">\printnoidxglossaries </span>at the place where you want your glossary. For
example:
</p>
<div class="verbatim" id="verbatim-10">
 \documentclass{article}
 <br /> \usepackage{glossaries}
 <br /> \makenoidxglossaries % use TeX to sort
 <br /> \newglossaryentry{potato}{name={potato},plural={potatoes},
 <br />  description={starchy tuber}}
 <br /> \newglossaryentry{cabbage}{name={cabbage},
 <br />  description={vegetable with thick green or purple leaves}}
 <br /> \newglossaryentry{turnip}{name={turnip},
 <br />  description={round pale root vegetable}}
 <br /> \newglossaryentry{carrot}{name={carrot},
 <br />  description={orange root}}
 <br /> \begin{document}
 <br /> Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}.
 <br /> \printnoidxglossaries
 <br /> \end{document}
</div>
<!--l. 382--><p class="nopar" >
</p><!--l. 384--><p class="indent" > <div class="important" title="Important Note"> The <span
class="cmtt-10">\makenoidxglossaries </span>method is very slow, uses an ASCII comparator and
often breaks if there are commands in the <span
class="cmtt-10">name </span>key. </div>
</p><!--l. 388--><p class="noindent" >
</p><!--l. 390--><p class="indent" > Try this out and run <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> (or pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span>) <span
class="cmti-10">twice</span>. The first run won’t show the
glossary. It will only appear on the second run. This doesn’t include “turnip” in the
glossary because that term hasn’t been used (with commands like <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\gls{turnip}</span></span></span>) in
the document.
</p><!--l. 395--><p class="indent" > The glossary has a vertical gap between the “carrot” term and the “potato” term.
This is because the entries in the glossaries are grouped according to their
first letter. If you don’t want this gap, just add <span
class="cmss-10">nogroupskip</span><a
id="dx1-2024"></a> to the package
options:
</p>
<div class="verbatim" id="verbatim-11">
\usepackage[nogroupskip]{glossaries}
</div>
<!--l. 401--><p class="nopar" > or you may want to try out a style that shows the group headings:
</p>
<div class="verbatim" id="verbatim-12">
\usepackage[style=indexgroup]{glossaries}
</div>
<!--l. 405--><p class="nopar" > If you try out this example you may also notice that the description is followed by a
full stop (period) and a number. The number is the location in the document where
the entry was used (page 1 in this case), so you can lookup the term in the glossary
and be directed to the relevant pages. It may be that you don’t want this
back-reference, in which case you can suppress it using the <span
class="cmss-10">nonumberlist</span><a
id="dx1-2025"></a> package
option:
</p>
<div class="verbatim" id="verbatim-13">
\usepackage[nonumberlist]{glossaries}
</div>
<!--l. 415--><p class="nopar" > If you don’t like the terminating full stop, you can suppress that with the <span
class="cmss-10">nopostdot</span><a
id="dx1-2026"></a>
package option:
</p>
<div class="verbatim" id="verbatim-14">
\usepackage[nopostdot]{glossaries}
</div>
<!--l. 420--><p class="nopar" >
</p><!--l. 422--><p class="indent" > If you tried out the previous example with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2027"></a> and <span
class="cmtt-10">\printunsrtglossaries</span>
the terminating full stop is missing and there are no number lists. You can add the
full stop back with
</p>
<div class="verbatim" id="verbatim-15">
\usepackage[nopostdot=false]{glossaries-extra}
</div>
<!--l. 427--><p class="nopar" > or
</p>
<div class="verbatim" id="verbatim-16">
\usepackage[postdot]{glossaries-extra}
</div>
<!--l. 431--><p class="nopar" > If you want the number lists then you need to use an indexing option.
</p><!--l. 435--><p class="indent" > You may have noticed that I’ve used another command in the above example:
<span
class="cmtt-10">\glspl</span>. This displays the plural form. By default, this is just the singular form with
the letter “s” appended, but in the case of “potato” I had to specify the correct
plural using the <span
class="cmtt-10">plural </span>key.
</p><!--l. 441--><p class="indent" > As I mentioned earlier, using <span class="TEX">T<span
class="E">E</span>X</span> to sort the entries is the simplest but least
efficient method. If you have a large glossary or if your terms contain non-Latin or
extended Latin characters, then you will have a much faster build time if you use
<span
class="cmtt-10">makeindex</span><a
id="dx1-2028"></a> (<a
href="#option2">Option 2</a>) or <span
class="cmtt-10">xindy</span><a
id="dx1-2029"></a> (<a
href="#option3">Option 3</a>) or <span
class="cmtt-10">bib2gls</span><a
id="dx1-2030"></a> (<a
href="#option4">Option 4</a>). If you are using
extended Latin or non-Latin characters, then <span
class="cmtt-10">xindy</span><a
id="dx1-2031"></a> or <span
class="cmtt-10">bib2gls</span><a
id="dx1-2032"></a> are the
recommended methods. These methods are described in more detail in <a
href="#sec:printglossaries"><span
class="cmsy-10">§</span>4 </a><a
href="#sec:printglossaries">Displaying
a List of Entries<!--tex4ht:ref: sec:printglossaries --></a>.
</p><!--l. 451--><p class="indent" > The rest of this document briefly describes the main commands provided by the
<span
class="cmss-10">glossaries </span>package. (Most of these are also available with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-2033"></a> but may
behave slightly differently.)
</p><!--l. 456--><p class="noindent" >
</p>
<!--l. 456--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">2 </span> <a
id="sec:defterm"></a>Defining Terms</h3>
<!--l. 459--><p class="noindent" >When you use the <span
class="cmss-10">glossaries</span><a
id="dx1-3001"></a> package, you need to define glossary entries in the
document preamble. These entries could be a word, phrase, abbreviation or symbol.
They’re usually accompanied by a description, which could be a short sentence or an
in-depth explanation that spans multiple paragraphs. The simplest method of
defining an entry is to use:
</p><!--l. 466--><p class="indent" > <hr><div title="Definition"></p><div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10">\newglossaryentry{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}</span>
<br /><span class="verb"><span
class="cmtt-10">{</span></span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name={</span>⟨<span
class="cmitt-10">name</span>⟩<span
class="cmtt-10">},</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> description={</span>⟨<span
class="cmitt-10">description</span>⟩<span
class="cmtt-10">},</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> </span>⟨<span
class="cmitt-10">other</span><span
class="cmitt-10"> options</span>⟩
<br /><span class="verb"><span
class="cmtt-10">}</span></span>
</div>
</div> </div><hr>
<!--l. 474--><p class="noindent" >
where ⟨<span
class="cmti-10">label</span>⟩ is a unique label that identifies this entry. (Don’t include the angle
brackets ⟨ ⟩. They just indicate the parts of the code you need to change when you use
this command in your document.) The ⟨<span
class="cmti-10">name</span>⟩ is the word, phrase or symbol
you are defining, and ⟨<span
class="cmti-10">description</span>⟩ is the description to be displayed in the
glossary.
</p><!--l. 482--><p class="indent" > This command is a “short” command, which means that ⟨<span
class="cmti-10">description</span>⟩ can’t
contain a paragraph break. If you have a long description, you can instead
use:
</p><!--l. 486--><p class="indent" > <hr><div title="Definition"></p><div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10">\longnewglossaryentry{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}</span>
<br /><span class="verb"><span
class="cmtt-10">{</span></span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name={</span>⟨<span
class="cmitt-10">name</span>⟩<span
class="cmtt-10">},</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> </span>⟨<span
class="cmitt-10">other</span><span
class="cmitt-10"> options</span>⟩
<br /><span class="verb"><span
class="cmtt-10">}</span></span>
<br /><span
class="cmtt-10">{</span>⟨<span
class="cmitt-10">description</span>⟩<span
class="cmtt-10">}</span>
</div>
</div> </div><hr>
<!--l. 494--><p class="noindent" >
</p><!--l. 496--><p class="indent" > Examples:
</p><ol class="enumerate1" >
<li
class="enumerate" id="x1-3003x1">Define the term “set” with the label <span
class="cmtt-10">set</span>:
<div class="verbatim" id="verbatim-17">
\newglossaryentry{set}
 <br />{
 <br />  name={set},
 <br />  description={a collection of objects}
 <br />}
</div>
<!--l. 505--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-3005x2">Define the symbol <span
class="cmsy-10">∅ </span>with the label <span
class="cmtt-10">emptyset</span>:
<div class="verbatim" id="verbatim-18">
\newglossaryentry{emptyset}
 <br />{
 <br />  name={\ensuremath{\emptyset}},
 <br />  description={the empty set}
 <br />}
</div>
<!--l. 515--><p class="nopar" > (This will also need a <span
class="cmtt-10">sort </span>key if you use Options <a
href="#option1">1</a> or <a
href="#option3">3</a>, see below.)
</p></li>
<li
class="enumerate" id="x1-3007x3">Define the phrase “Fish Age” with the label <span
class="cmtt-10">fishage</span>:
<div class="verbatim" id="verbatim-19">
\longnewglossaryentry{fishage}
 <br />{name={Fish Age}}
 <br />{%
 <br />  A common name for the Devonian geologic period
 <br />  spanning from the end of the Silurian Period to
 <br />  the beginning of the Carboniferous Period.
 <br />  This age was known for its remarkable variety of
 <br />  fish species.
 <br />}
</div>
<!--l. 532--><p class="nopar" > (The percent character discards the end of line character that would otherwise
cause an unwanted space to appear at the start of the description.)
</p></li>
<li
class="enumerate" id="x1-3009x4">Take care if the first letter is an extended Latin or non-Latin character (either
specified via a command such as <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\’e</span></span></span> or explicitly via the <span
class="cmss-10">inputenc</span><a
id="dx1-3010"></a> package such
as <span
class="cmtt-10">é</span>). This first letter must be placed in a group:
<div class="verbatim" id="verbatim-20">
\newglossaryentry{elite}
 <br />{
 <br />  name={{\'e}lite},
 <br />  description={select group or class}
 <br />}
</div>
<!--l. 548--><p class="nopar" > or </p><div class="alltt">
<div class="obeylines-v">
<span class="verb"><span
class="cmtt-10">\newglossaryentry{elite}</span></span>
<br /><span class="verb"><span
class="cmtt-10">{</span></span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name=</span><span class="verb"><span
class="cmtt-10">{{</span></span><span
class="cmtt-10">é</span><span class="verb"><span
class="cmtt-10">}lite}</span></span><span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> description=</span><span class="verb"><span
class="cmtt-10">{select</span><span
class="cmtt-10"> group</span><span
class="cmtt-10"> or</span><span
class="cmtt-10"> class}</span></span>
<br /><span class="verb"><span
class="cmtt-10">}</span></span>
</div>
</div></li></ol>
<!--l. 558--><p class="noindent" >(For further details, see the section “UTF-8” of the <a
href="https://ctan.org/pkg/mfirstuc" ><span
class="cmss-10">mfirstuc</span></a> user manual.)
</p><!--l. 561--><p class="indent" > If you use <span
class="cmtt-10">bib2gls</span><a
id="dx1-3011"></a> with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-3012"></a> then the terms must be defined in a <span
class="cmtt-10">.bib</span>
file. For example: </p><div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10">%</span><span
class="cmtt-10"> Encoding:</span><span
class="cmtt-10"> UTF-8</span>
<br />
<br /><span
class="cmtt-10">@entry</span><span
class="cmsy-10">{</span><span
class="cmtt-10">set,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">set</span><span
class="cmsy-10">}</span><span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> description=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">a</span><span
class="cmtt-10"> collection</span><span
class="cmtt-10"> of</span><span
class="cmtt-10"> objects</span><span
class="cmsy-10">}</span>
<br /><span
class="cmsy-10">}</span>
<br />
<br /><span
class="cmtt-10">@entry</span><span
class="cmsy-10">{</span><span
class="cmtt-10">emptyset,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name=</span><span class="verb"><span
class="cmtt-10">{\ensuremath{\emptyset}}</span></span><span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> description=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">the</span><span
class="cmtt-10"> empty</span><span
class="cmtt-10"> set</span><span
class="cmsy-10">}</span>
<br /><span
class="cmsy-10">}</span>
<br />
<br /><span
class="cmtt-10">@entry</span><span
class="cmsy-10">{</span><span
class="cmtt-10">fishage,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">Fish</span><span
class="cmtt-10"> Age</span><span
class="cmsy-10">}</span><span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> description=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">A</span><span
class="cmtt-10"> common</span><span
class="cmtt-10"> name</span><span
class="cmtt-10"> for</span><span
class="cmtt-10"> the</span><span
class="cmtt-10"> Devonian</span><span
class="cmtt-10"> geologic</span><span
class="cmtt-10"> period</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> spanning</span><span
class="cmtt-10"> from</span><span
class="cmtt-10"> the</span><span
class="cmtt-10"> end</span><span
class="cmtt-10"> of</span><span
class="cmtt-10"> the</span><span
class="cmtt-10"> Silurian</span><span
class="cmtt-10"> Period</span><span
class="cmtt-10"> to</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> the</span><span
class="cmtt-10"> beginning</span><span
class="cmtt-10"> of</span><span
class="cmtt-10"> the</span><span
class="cmtt-10"> Carboniferous</span><span
class="cmtt-10"> Period.</span>
<br />
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> This</span><span
class="cmtt-10"> age</span><span
class="cmtt-10"> was</span><span
class="cmtt-10"> known</span><span
class="cmtt-10"> for</span><span
class="cmtt-10"> its</span><span
class="cmtt-10"> remarkable</span><span
class="cmtt-10"> variety</span><span
class="cmtt-10"> of</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> fish</span><span
class="cmtt-10"> species.</span><span
class="cmsy-10">}</span>
<br /><span
class="cmsy-10">}</span>
<br />
<br /><span
class="cmtt-10">@entry</span><span
class="cmsy-10">{</span><span
class="cmtt-10">elite,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name=</span><span class="verb"><span
class="cmtt-10">{{</span></span><span
class="cmtt-10">é</span><span class="verb"><span
class="cmtt-10">}lite}</span></span><span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> description=</span><span class="verb"><span
class="cmtt-10">{select</span><span
class="cmtt-10"> group</span><span
class="cmtt-10"> or</span><span
class="cmtt-10"> class}</span></span>
<br /><span
class="cmsy-10">}</span>
</div>
</div> (The <span
class="cmtt-10">.bib </span>format doesn’t allow spaces in labels so you can’t have <span
class="cmtt-10">fish age </span>as the
label, but you can have <span
class="cmtt-10">fish-age</span>.) This method requires the <span
class="cmss-10">glossaries-extra</span><a
id="dx1-3013"></a>’s <span
class="cmss-10">record</span><a
id="dx1-3014"></a>
package option:
<div class="verbatim" id="verbatim-21">
\usepackage[record]{glossaries-extra}
</div>
<!--l. 598--><p class="nopar" > and the <span
class="cmtt-10">.bib </span>file is specified in the resource command. For example, if the
<span
class="cmtt-10">.bib </span>file is called <span
class="cmtt-10">entries.bib </span>then put the following line in the document
preamble:
</p>
<div class="verbatim" id="verbatim-22">
\GlsXtrLoadResources[src={entries}]
</div>
<!--l. 604--><p class="nopar" > You can have a comma-separated list. For example, if you also have entries defined
in the file <span
class="cmtt-10">entries2.bib</span>:
</p>
<div class="verbatim" id="verbatim-23">
\GlsXtrLoadResources[src={entries,entries2.bib}]
</div>
<!--l. 609--><p class="nopar" >
</p><!--l. 611--><p class="indent" > There are other keys you can use when you define an entry. For example, the <span
class="cmtt-10">name</span>
key indicates how the term should appear in the list of entries (glossary), but if the
term should appear differently when you reference it with <span
class="cmtt-10">\gls{</span>⟨<span
class="cmti-10">label</span>⟩<span
class="cmtt-10">} </span>in the
document, you need to use the <span
class="cmtt-10">text </span>key as well.
</p><!--l. 617--><p class="indent" > For example:
</p>
<div class="verbatim" id="verbatim-24">
\newglossaryentry{latinalph}
 <br />{
 <br />  name={Latin Alphabet},
 <br />  text={Latin alphabet},
 <br />  description={alphabet consisting of the letters
 <br />  a, \ldots, z, A, \ldots, Z}
 <br />}
</div>
<!--l. 626--><p class="nopar" > This will appear in the text as “Latin alphabet” but will be listed in the glossary
as “Latin Alphabet”. With <span
class="cmtt-10">bib2gls</span><a
id="dx1-3015"></a> this entry is defined in the <span
class="cmtt-10">.bib </span>file
as:
</p>
<div class="verbatim" id="verbatim-25">
@entry{latinalph,
 <br />  name={Latin Alphabet},
 <br />  text={Latin alphabet},
 <br />  description={alphabet consisting of the letters
 <br />  a, \ldots, z, A, \ldots, Z}
 <br />}
</div>
<!--l. 638--><p class="nopar" >
</p><!--l. 640--><p class="indent" > Another commonly used key is <span
class="cmtt-10">plural </span>for specifying the plural of the term. This
defaults to the value of the <span
class="cmtt-10">text </span>key with an “s” appended, but if this is incorrect,
just use the <span
class="cmtt-10">plural </span>key to override it:
</p>
<div class="verbatim" id="verbatim-26">
\newglossaryentry{oesophagus}
 <br />{
 <br />  name={{\oe}sophagus},
 <br />  plural={{\oe}sophagi},
 <br />  description={canal from mouth to stomach}
 <br />}
</div>
<!--l. 651--><p class="nopar" > (Remember from earlier that the initial ligature <span
class="cmtt-10">\oe </span>needs to be grouped.)
</p><!--l. 655--><p class="indent" > Abbreviations can be defined using
</p><!--l. 657--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\newacronym[</span>⟨<span
class="cmitt-10">options</span>⟩<span
class="cmtt-10">]{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">short</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">long</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 658--><p class="noindent" >
where ⟨<span
class="cmti-10">label</span>⟩ is the label (as per <span
class="cmtt-10">\newglossaryentry</span>), ⟨<span
class="cmti-10">short</span>⟩ is the short form and
⟨<span
class="cmti-10">long</span>⟩ is the long form. For example, the following defines an abbreviation:
</p>
<div class="verbatim" id="verbatim-27">
\newacronym{svm}{SVM}{support vector machine}
</div>
<!--l. 665--><p class="nopar" > This internally uses <span
class="cmtt-10">\newglossaryentry </span>to define an entry with the label <span
class="cmtt-10">svm</span>. By
default, the <span
class="cmtt-10">name </span>key is set to ⟨<span
class="cmti-10">short</span>⟩ (“SVM” in the above example) and the
<span
class="cmtt-10">description </span>key is set to ⟨<span
class="cmti-10">long</span>⟩ (“support vector machine” in the above example). If,
instead, you want to be able to specify your own description you can do this using
the optional argument:
</p>
<div class="verbatim" id="verbatim-28">
\newacronym
 <br /> [description={statistical pattern recognition technique}]
 <br /> {svm}{SVM}{support vector machine}
</div>
<!--l. 677--><p class="nopar" >
</p><!--l. 679--><p class="indent" > Before you define your acronyms (or other types of abbreviations), you need to
specify which style to use with
</p><!--l. 682--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\setacronymstyle{</span>⟨<span
class="cmitt-10">style name</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 683--><p class="noindent" >
where ⟨<span
class="cmti-10">style name</span>⟩ is the name of the style. There are a number of predefined styles,
such as: <span
class="cmtt-10">long-short </span>(on first use display the long form with the short form in
parentheses); <span
class="cmtt-10">short-long </span>(on first use display the short form with the long form in
parentheses); <span
class="cmtt-10">long-short-desc </span>(like <span
class="cmtt-10">long-short </span>but you need to specify the
description); or <span
class="cmtt-10">short-long-desc </span>(like <span
class="cmtt-10">short-long </span>but you need to specify the
description). There are some other styles as well that use <span
class="cmtt-10">\textsc </span>to typeset the
acronym or that use a footnote on first use. See the main user guide for further
details.
</p><!--l. 695--><p class="indent" > The <span
class="cmss-10">glossaries-extra</span><a
id="dx1-3016"></a> package provides improved abbreviation handling with <a
href="http://www.dickimaw-books.com/gallery/sample-abbr-styles.shtml" >a lot
more predefined styles</a>. With this extension package, abbreviations are defined
using:
</p><!--l. 699--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\newabbreviation[</span>⟨<span
class="cmitt-10">options</span>⟩<span
class="cmtt-10">]{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">short</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">long</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 700--><p class="noindent" >
You can still use <span
class="cmtt-10">\newacronym </span>but it’s redefined to use the new abbreviation
interface. The style must now be set using:
</p><!--l. 704--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\setabbreviationstyle[</span>⟨<span
class="cmitt-10">category</span>⟩<span
class="cmtt-10">]{</span>⟨<span
class="cmitt-10">style name</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 705--><p class="noindent" >
The default ⟨<span
class="cmti-10">category</span>⟩ is <span
class="cmtt-10">abbreviation</span>. If you use <span
class="cmtt-10">\newacronym </span>the category is
<span
class="cmtt-10">acronym</span>, which is why you need to use the optional argument if you define
abbreviations with <span
class="cmtt-10">\newacronym </span>when <span
class="cmss-10">glossaries-extra</span><a
id="dx1-3017"></a> has been loaded: </p><div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10">\setabbreviationstyle[acronym]{</span>⟨<span
class="cmitt-10">style</span><span
class="cmitt-10"> name</span>⟩<span
class="cmtt-10">}</span>
</div>
</div> If you use <span
class="cmtt-10">bib2gls</span><a
id="dx1-3018"></a> then abbreviations are defined in the <span
class="cmtt-10">.bib </span>file in the format:
<div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10">@abbreviation</span><span
class="cmsy-10">{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> long={</span>⟨<span
class="cmitt-10">long</span><span
class="cmitt-10"> form</span>⟩<span
class="cmtt-10">},</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> short={</span>⟨<span
class="cmitt-10">short</span><span
class="cmitt-10"> form</span>⟩<span
class="cmtt-10">}</span>
<br /><span
class="cmsy-10">}</span>
</div>
</div>
<!--l. 722--><p class="indent" > The plural forms for abbreviations can be specified using the <span
class="cmtt-10">longplural </span>and
<span
class="cmtt-10">shortplural </span>keys. For example:
</p>
<div class="verbatim" id="verbatim-29">
\newacronym
 <br /> [longplural={diagonal matrices}]
 <br /> {dm}{DM}{diagonal matrix}
</div>
<!--l. 728--><p class="nopar" > or (with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-3019"></a>):
</p>
<div class="verbatim" id="verbatim-30">
\newabbreviation % glossaries-extra.sty
 <br /> [longplural={diagonal matrices}]
 <br /> {dm}{DM}{diagonal matrix}
</div>
<!--l. 734--><p class="nopar" > If omitted, the defaults are again obtained by appending an “s” to the singular
versions. With <span
class="cmtt-10">bib2gls</span><a
id="dx1-3020"></a>, the definition in the <span
class="cmtt-10">.bib </span>file is:
</p>
<div class="verbatim" id="verbatim-31">
@abbreviation{dm,
 <br />  short={DM},
 <br />  long={diagonal matrix},
 <br />  longplural={diagonal matrices}
 <br />}
</div>
<!--l. 744--><p class="nopar" >
</p><!--l. 746--><p class="indent" > It’s also possible to have both a name and a corresponding symbol.
Just use the <span
class="cmtt-10">name </span>key for the name and the <span
class="cmtt-10">symbol </span>key for the symbol. For
example:
</p>
<div class="verbatim" id="verbatim-32">
\newglossaryentry{emptyset}
 <br />{
 <br />  name={empty set},
 <br />  symbol={\ensuremath{\emptyset}},
 <br />  description={the set containing no elements}
 <br />}
</div>
<!--l. 756--><p class="nopar" > or with <span
class="cmtt-10">bib2gls</span><a
id="dx1-3021"></a> the definition in the <span
class="cmtt-10">.bib </span>file is:
</p>
<div class="verbatim" id="verbatim-33">
@entry{emptyset,
 <br />  name={empty set},
 <br />  symbol={\ensuremath{\emptyset}},
 <br />  description={the set containing no elements}
 <br />}
</div>
<!--l. 764--><p class="nopar" >
</p><!--l. 766--><p class="indent" > If you want the symbol in the <span
class="cmtt-10">name </span>field then you must supply a <span
class="cmtt-10">sort </span>value with
Options <a
href="#option1">1</a> and <a
href="#option3">3</a> otherwise you’ll end up with errors from <span class="TEX">T<span
class="E">E</span>X</span> or <span
class="cmtt-10">xindy</span><a
id="dx1-3022"></a>. With
<a
href="#option2">Option 2</a> (<span
class="cmtt-10">makeindex</span><a
id="dx1-3023"></a>) it’s not quite so important but you may find the resulting
order is a little odd. For example:
</p>
<div class="verbatim" id="verbatim-34">
\newglossaryentry{emptyset}
 <br />{
 <br />  name={\ensuremath{\emptyset}},
 <br />  sort={empty set},
 <br />  description={the set containing no elements}
 <br />}
</div>
<!--l. 778--><p class="nopar" > This displays the symbol as <span
class="cmsy-10">∅ </span>but sorts according to “empty set”. You
may want to consider using <span
class="cmss-10">glossaries-extra</span><a
id="dx1-3024"></a>’s <span
class="cmss-10">symbols</span><a
id="dx1-3025"></a> package option which
provides
</p><!--l. 784--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\glsxtrnewsymbol[</span>⟨<span
class="cmitt-10">options</span>⟩<span
class="cmtt-10">]{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">symbol</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 785--><p class="noindent" >
This internally uses <span
class="cmtt-10">\newglossaryentry </span>but automatically sets the <span
class="cmtt-10">sort </span>key to the
⟨<span
class="cmti-10">label</span>⟩. For example:
</p>
<div class="verbatim" id="verbatim-35">
\documentclass{article}
 <br />\usepackage[symbols]{glossaries-extra}
 <br />\makeglossaries
 <br />\glsxtrnewsymbol % requires glossaries-extra.sty 'symbols' option
 <br /> [description={the set containing no elements}]
 <br /> {emptyset}% label (and sort value)
 <br /> {\ensuremath{\emptyset}}% symbol
 <br />\begin{document}
 <br />\gls{emptyset}
 <br />\printglossaries
 <br />\end{document}
</div>
<!--l. 805--><p class="nopar" > Now the sort value is “emptyset” rather than the previous “empty set”.
</p><!--l. 809--><p class="indent" > With <span
class="cmtt-10">bib2gls</span><a
id="dx1-3026"></a> you can define this in the <span
class="cmtt-10">.bib </span>file as
</p>
<div class="verbatim" id="verbatim-36">
@entry{emptyset,
 <br />  name={\ensuremath{\emptyset}},
 <br />  description={the set containing no elements}
 <br />}
</div>
<!--l. 816--><p class="nopar" > in which case <span
class="cmtt-10">bib2gls</span><a
id="dx1-3027"></a> will try to interpret the <span
class="cmtt-10">name </span>field to determine the sort
value. Alternatively you can use:
</p>
<div class="verbatim" id="verbatim-37">
@symbol{emptyset,
 <br />  name={\ensuremath{\emptyset}},
 <br />  description={the set containing no elements}
 <br />}
</div>
<!--l. 824--><p class="nopar" > which will use the label (<span
class="cmtt-10">emptyset</span>) as the sort value. (You don’t need the <span
class="cmss-10">symbols</span><a
id="dx1-3028"></a>
package option in this case, unless you want a separate symbols list.) The
corresponding document (where the definition is in the file <span
class="cmtt-10">entries.bib</span>) is
now:
</p>
<div class="verbatim" id="verbatim-38">
\documentclass{article}
 <br />\usepackage[record]{glossaries-extra}
 <br />\GlsXtrLoadResources[src=entries]
 <br />\begin{document}
 <br />\gls{emptyset}
 <br />\printunsrtglossaries
 <br />\end{document}
</div>
<!--l. 841--><p class="nopar" >
</p><!--l. 843--><p class="noindent" >
</p>
<!--l. 843--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">3 </span> <a
id="sec:useterm"></a>Using Entries</h3>
<!--l. 846--><p class="noindent" >Once you have defined your entries, as described above, you can reference them in
your document. There are a number of commands to do this, but the most common
one is:
</p><!--l. 850--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\gls{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 851--><p class="noindent" >
where ⟨<span
class="cmti-10">label</span>⟩ is the label you assigned to the entry when you defined it. For example,
<span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\gls{fishage}</span></span></span> will display “Fish Age” in the text (given the definition from the
previous section). If you are using <span
class="cmtt-10">bib2gls</span><a
id="dx1-4001"></a> then this will display ?? (like
<span
class="cmtt-10">\ref </span>and <span
class="cmtt-10">\cite</span>) until <span
class="cmtt-10">bib2gls</span><a
id="dx1-4002"></a> has created the relevant files and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> is
rerun.
</p><!--l. 859--><p class="indent" > If you are using the <span
class="cmss-10">hyperref</span><a
id="dx1-4003"></a> package (remember to load it before <span
class="cmss-10">glossaries</span>) <span
class="cmtt-10">\gls</span>
will create a hyperlink to the corresponding entry in the glossary. If you want to
suppress the hyperlink for a particular instance, use the starred form <span
class="cmtt-10">\gls* </span>for
example, <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\gls*{fishage}</span></span></span>. The other commands described in this section all have a
similar starred form.
</p><!--l. 866--><p class="indent" > If the entry was defined as an acronym (using <span
class="cmtt-10">\newacronym </span>with <span
class="cmss-10">glossaries</span>
described above) or an abbreviation (using <span
class="cmtt-10">\newabbreviation </span>with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-4004"></a>),
then <span
class="cmtt-10">\gls </span>will display the full form the first time it’s used and just the
short form on subsequent use. For example, if the style is set to <span
class="cmtt-10">long-short</span>,
then <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\gls{svm}</span></span></span> will display “support vector machine (SVM)” the first time
it’s used, but the next occurrence of <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\gls{svm}</span></span></span> will just display “SVM”.
(If you use <span
class="cmtt-10">\newacronym </span>with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-4005"></a> the default doesn’t show the
long form on first use. You’ll need to change the style first, as described
earlier.)
</p><!--l. 878--><p class="indent" > If you want the plural form, you can use:
</p><!--l. 880--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\glspl{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 881--><p class="noindent" >
instead of <span
class="cmtt-10">\gls{</span>⟨<span
class="cmti-10">label</span>⟩<span
class="cmtt-10">}</span>. For example, <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\glspl{set}</span></span></span> displays “sets”.
</p><!--l. 885--><p class="indent" > If the term appears at the start of a sentence, you can convert the first letter to
upper case using:
</p><!--l. 888--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\Gls{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 889--><p class="noindent" >
for the singular form or
</p><!--l. 892--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\Glspl{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 893--><p class="noindent" >
for the plural form. For example:
</p>
<div class="verbatim" id="verbatim-39">
\Glspl{set} are collections.
</div>
<!--l. 897--><p class="nopar" > produces “Sets are collections”.
</p><!--l. 900--><p class="indent" > If you’ve specified a symbol using the <span
class="cmtt-10">symbol </span>key, you can display it
using:
</p><!--l. 903--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\glssymbol{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 904--><p class="noindent" >
</p><!--l. 906--><p class="noindent" >
</p>
<!--l. 906--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">4 </span> <a
id="sec:printglossaries"></a>Displaying a List of Entries</h3>
<!--l. 909--><p class="noindent" >In <a
href="#sec:start"><span
class="cmsy-10">§</span>1 </a><a
href="#sec:start">Getting Started<!--tex4ht:ref: sec:start --></a>, I mentioned that there are three options you can choose from
to create an automatically sorted glossary with the base <span
class="cmss-10">glossaries </span>package. These are
also available with the extension package <span
class="cmss-10">glossaries-extra </span>along with a fourth option.
These four options are listed below in a little more detail. <a
href="#x1-50011">Table 1</a> summarises the
main advantages and disadvantages. (There’s a more detailed summary in the main
<span
class="cmss-10">glossaries </span>user manual.)
</p>
<div class="table">
<!--l. 918--><p class="indent" > <a
id="x1-50011"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Table 1: </span><span
class="content">Comparison of Glossary Options</span></div><!--tex4ht:label?: x1-50011 -->
<div class="tabular"> <table id="TBL-2" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-2-1g"><col
id="TBL-2-1" /><col
id="TBL-2-2" /><col
id="TBL-2-3" /><col
id="TBL-2-4" /><col
id="TBL-2-5" /></colgroup><tr
style="vertical-align:baseline;" id="TBL-2-1-"><td style="white-space:wrap; text-align:left;" id="TBL-2-1-1"
class="td11"> <!--l. 924--><p class="noindent" > </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-2"
class="td11"> <a
href="#option1"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 1</span></a> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-3"
class="td11"> <a
href="#option2"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 2</span></a> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-4"
class="td11"> <a
href="#option3"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 3</span></a> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-5"
class="td11"> <a
href="#option4"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 4</span></a> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-2-"><td style="white-space:wrap; text-align:left;" id="TBL-2-2-1"
class="td11"> <!--l. 926--><p class="noindent" >Requires
<span
class="cmss-10">glossaries-extra</span><a
id="dx1-5002"></a>? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-2-2"
class="td11"> <span id="textcolor1"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-2-3"
class="td11"> <span id="textcolor2"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-2-4"
class="td11"> <span id="textcolor3"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-2-5"
class="td11"> <span id="textcolor4"><span
class="pzdr-">✔</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-3-"><td style="white-space:wrap; text-align:left;" id="TBL-2-3-1"
class="td11"> <!--l. 928--><p class="noindent" >Requires
an
external
application? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-3-2"
class="td11"> <span id="textcolor5"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-3-3"
class="td11"> <span id="textcolor6"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-3-4"
class="td11"> <span id="textcolor7"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-3-5"
class="td11"> <span id="textcolor8"><span
class="pzdr-">✔</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-4-"><td style="white-space:wrap; text-align:left;" id="TBL-2-4-1"
class="td11"> <!--l. 930--><p class="noindent" >Requires
Perl? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-4-2"
class="td11"> <span id="textcolor9"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-4-3"
class="td11"> <span id="textcolor10"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-4-4"
class="td11"> <span id="textcolor11"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-4-5"
class="td11"> <span id="textcolor12"><span
class="pzdr-">✘</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-5-"><td style="white-space:wrap; text-align:left;" id="TBL-2-5-1"
class="td11"> <!--l. 932--><p class="noindent" >Requires
Java? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-5-2"
class="td11"> <span id="textcolor13"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-5-3"
class="td11"> <span id="textcolor14"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-5-4"
class="td11"> <span id="textcolor15"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-5-5"
class="td11"> <span id="textcolor16"><span
class="pzdr-">✔</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-6-"><td style="white-space:wrap; text-align:left;" id="TBL-2-6-1"
class="td11"> <!--l. 934--><p class="noindent" >Can
sort
extended
Latin
or
non-Latin
alphabets? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-6-2"
class="td11"> <span id="textcolor17"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-6-3"
class="td11"> <span id="textcolor18"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-6-4"
class="td11"> <span id="textcolor19"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-6-5"
class="td11"> <span id="textcolor20"><span
class="pzdr-">✔</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-7-"><td style="white-space:wrap; text-align:left;" id="TBL-2-7-1"
class="td11"> <!--l. 937--><p class="noindent" >Efficient
sort
algorithm? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-7-2"
class="td11"> <span id="textcolor21"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-7-3"
class="td11"> <span id="textcolor22"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-7-4"
class="td11"> <span id="textcolor23"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-7-5"
class="td11"> <span id="textcolor24"><span
class="pzdr-">✔</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-8-"><td style="white-space:wrap; text-align:left;" id="TBL-2-8-1"
class="td11"> <!--l. 939--><p class="noindent" >Can
use
different
sort
methods
for
each
glossary? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-8-2"
class="td11"> <span id="textcolor25"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-8-3"
class="td11"> <span id="textcolor26"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-8-4"
class="td11"> <span id="textcolor27"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-8-5"
class="td11"> <span id="textcolor28"><span
class="pzdr-">✔</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-9-"><td style="white-space:wrap; text-align:left;" id="TBL-2-9-1"
class="td11"> <!--l. 941--><p class="noindent" >Any
problematic
sort
values? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-9-2"
class="td11"> <span id="textcolor29"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-9-3"
class="td11"> <span id="textcolor30"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-9-4"
class="td11"> <span id="textcolor31"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-9-5"
class="td11"> <span id="textcolor32"><span
class="pzdr-">✘</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-10-"><td style="white-space:wrap; text-align:left;" id="TBL-2-10-1"
class="td11"> <!--l. 943--><p class="noindent" >Can
form
ranges
in
the
location
lists? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-10-2"
class="td11"> <span id="textcolor33"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-10-3"
class="td11"> <span id="textcolor34"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-10-4"
class="td11"> <span id="textcolor35"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-10-5"
class="td11"> <span id="textcolor36"><span
class="pzdr-">✔</span></span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-11-"><td style="white-space:wrap; text-align:left;" id="TBL-2-11-1"
class="td11"> <!--l. 945--><p class="noindent" >Can
have
non-standard
locations? </p></td><td style="white-space:nowrap; text-align:center;" id="TBL-2-11-2"
class="td11"> <span id="textcolor37"><span
class="pzdr-">✔</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-11-3"
class="td11"> <span id="textcolor38"><span
class="pzdr-">✘</span></span> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-11-4"
class="td11"> <span id="textcolor39"><span
class="pzdr-">✔</span></span><sup class="textsuperscript"><span
class="cmsy-9">†</span></sup> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-11-5"
class="td11"> <span id="textcolor40"><span
class="pzdr-">✔</span></span> </td>
</tr></table></div>
<!--l. 948--><p class="noindent" ><sup class="textsuperscript"><span
class="cmsy-9">†</span></sup> <span
class="cmr-8">Requires some setting up.</span>
</p>
</div><hr class="endfloat" />
</div>
<dl class="description"><dt class="description">
</dt><dd
class="description"><a
id="option1"></a><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 1</span>:
<!--l. 955--><p class="noindent" >This is the simplest option but it’s slow and if you want a sorted
list, it doesn’t work for non-Latin alphabets. The <span
class="cmtt-10">name </span>mustn’t contain
commands (or, if it does, the <span
class="cmtt-10">sort </span>value must be supplied) unless you
have the package option <span
class="cmss-10">sanitizesort</span><a
id="dx1-5003"></a> or <span
class="cmss-10">sort=def</span><a
id="dx1-5004"></a> or <span
class="cmss-10">sort=use</span><a
id="dx1-5005"></a>.
</p><ol class="enumerate1" >
<li
class="enumerate" id="x1-5007x1">Add <span
class="cmtt-10">\makenoidxglossaries </span>to your preamble (before you start
defining your entries, as described in <a
href="#sec:defterm"><span
class="cmsy-10">§</span>2 </a><a
href="#sec:defterm">Defining Terms<!--tex4ht:ref: sec:defterm --></a>).
</li>
<li
class="enumerate" id="x1-5009x2">Put
<!--l. 969--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printnoidxglossary[sort=</span>⟨<span
class="cmitt-10">order</span>⟩<span
class="cmtt-10">,</span>⟨<span
class="cmitt-10">other options</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 970--><p class="noindent" >
where you want your list of entries to appear. The sort ⟨<span
class="cmti-10">order</span>⟩ may be one
of: <span
class="cmtt-10">word </span>(word ordering), <span
class="cmtt-10">letter </span>(letter ordering), <span
class="cmtt-10">case </span>(case-sensitive
letter ordering), <span
class="cmtt-10">def </span>(in order of definition) or <span
class="cmtt-10">use </span>(in order of use).
Alternatively, use
</p><!--l. 977--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printnoidxglossaries </span></div><hr>
</p><!--l. 978--><p class="noindent" >
to display all your glossaries (if you have more than one). This command
doesn’t have any arguments.
</p><!--l. 982--><p class="noindent" >This option allows you to have different sort methods. For example:
</p>
<div class="verbatim" id="verbatim-40">
\printnoidxglossary[sort=word]% main glossary
 <br />\printnoidxglossary[type=symbols,sort=use]% symbols glossary
</div>
<!--l. 987--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5011x3">Run <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> twice on your document. (As you would do to make a table
of contents appear.) For example, click twice on the “typeset” or “build”
or “PDF<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span>” button in your editor.</li></ol>
<!--l. 993--><p class="noindent" >Here’s a complete document (<span
class="cmtt-10">myDoc.tex</span>):
</p>
<div class="verbatim" id="verbatim-41">
\documentclass{article}
 <br />\usepackage{glossaries}
 <br />\makenoidxglossaries % use TeX to sort
 <br />\newglossaryentry{sample}{name={sample},
 <br />  description={an example}}
 <br />\begin{document}
 <br />A \gls{sample}.
 <br />\printnoidxglossaries % iterate over all indexed entries
 <br />\end{document}
</div>
<!--l. 1009--><p class="nopar" > Document build:
</p>
<div class="verbatim" id="verbatim-42">
pdflatex myDoc
 <br />pdflatex myDoc
</div>
<!--l. 1014--><p class="nopar" >
</p></dd><dt class="description">
</dt><dd
class="description"><a
id="option2"></a><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 2</span>:
<!--l. 1018--><p class="noindent" >This option uses an application called <span
class="cmtt-10">makeindex</span><a
id="dx1-5012"></a> to sort the entries. This
application comes with all modern <span class="TEX">T<span
class="E">E</span>X</span> distributions, but it’s hard-coded for
the non-extended Latin alphabet. This process involves making <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> write
the glossary information to a temporary file which <span
class="cmtt-10">makeindex</span><a
id="dx1-5013"></a> reads.
Then <span
class="cmtt-10">makeindex</span><a
id="dx1-5014"></a> writes a new file containing the code to typeset the
glossary. <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> then reads this file on the next run. The <span
class="cmtt-10">makeindex</span><a
id="dx1-5015"></a>
application is automatically invoked by the helper <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5016"></a>
script, which works out all the appropriate settings from the <span
class="cmtt-10">.aux</span>
file.
</p><ol class="enumerate1" >
<li
class="enumerate" id="x1-5018x1">If you are using <span
class="cmss-10">ngerman</span><a
id="dx1-5019"></a><span class="footnote-mark"><a
href="#fn1x0" id="fn1x0-bk"><sup class="textsuperscript">1</sup></a></span><a
id="x1-5020f1"></a>
or some other package that makes the double-quote character <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">"</span></span></span> a
shorthand, then use <span
class="cmtt-10">\GlsSetQuote </span>to change this to some other character.
For example:
<div class="verbatim" id="verbatim-43">
\GlsSetQuote{+}
</div>
<!--l. 1037--><p class="nopar" > Use this as soon as possible after you’ve loaded the <span
class="cmss-10">glossaries</span>
package.
</p></li>
<li
class="enumerate" id="x1-5023x2">Add <span
class="cmtt-10">\makeglossaries </span>to your preamble (before you start defining your
entries).
</li>
<li
class="enumerate" id="x1-5025x3">Put
<!--l. 1046--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printglossary[</span>⟨<span
class="cmitt-10">options</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 1047--><p class="noindent" >
where you want your list of entries (glossary) to appear. (The <span
class="cmtt-10">sort </span>key
isn’t available in ⟨<span
class="cmti-10">options</span>⟩.) Alternatively, use
</p><!--l. 1052--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printglossaries </span></div><hr>
</p><!--l. 1053--><p class="noindent" >
which will display all glossaries (if you have more than one). This
command doesn’t have any arguments.
</p><!--l. 1057--><p class="noindent" ><div class="important" title="Important Note"> All glossaries are sorted using the same method which may be identified
with one of the package options: <span
class="cmss-10">sort=standard</span><a
id="dx1-5026"></a> (default), <span
class="cmss-10">sort=use</span><a
id="dx1-5027"></a> or
<span
class="cmss-10">sort=def</span><a
id="dx1-5028"></a>. </div>
</p><!--l. 1062--><p class="noindent" >
</p></li>
<li
class="enumerate" id="x1-5030x4">Run <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> on your document. This creates files with the extensions
<span
class="cmtt-10">.glo </span>and <span
class="cmtt-10">.ist </span>(for example, if your <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> document is called
<span
class="cmtt-10">myDoc.tex</span>, then you’ll have two extra files called <span
class="cmtt-10">myDoc.glo </span>and
<span
class="cmtt-10">myDoc.ist</span>). If you look at your document at this point, you won’t see the
glossary as it hasn’t been created yet.
</li>
<li
class="enumerate" id="x1-5032x5">Run <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5033"></a> with the base name of your document (without the
<span
class="cmtt-10">.tex</span>) extension. If you have access to a terminal or a command prompt
(for example, the MSDOS command prompt for Windows users or
the bash console for Unix-like users) then you need to run the
command:
<div class="verbatim" id="verbatim-44">
makeglossaries myDoc
</div>
<!--l. 1078--><p class="nopar" > (Replace <span
class="cmtt-10">myDoc </span>with the base name of your <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> document file
without the <span
class="cmtt-10">.tex </span>extension. Avoid spaces in the file name.) If you don’t
have Perl installed use <span
class="cmtt-10">makeglossaries-lite</span><a
id="dx1-5034"></a> instead:
</p>
<div class="verbatim" id="verbatim-45">
makeglossaries-lite myDoc
</div>
<!--l. 1085--><p class="nopar" >
</p><!--l. 1087--><p class="noindent" ><div class="important" title="Important Note"> Some beginners get confused by <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5035"></a> the application (run as
a system command) and <span
class="cmtt-10">\makeglossaries </span>the <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> command
which should be typed in the document preamble. These are two
different concepts that happen to have similar looking names.
</div>
</p><!--l. 1093--><p class="noindent" >
</p><!--l. 1095--><p class="noindent" >If you don’t know how to use the command prompt, then you can
probably configure your text editor to add <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5036"></a> (or
<span
class="cmtt-10">makeglossaries-lite</span><a
id="dx1-5037"></a>) as a build tool, but each editor has a different
method of doing this, so I can’t give a general description. You will have
to check your editor’s manual. If you still have problems, try adding the
<span
class="cmss-10">automake</span><a
id="dx1-5038"></a> package option:
</p>
<div class="verbatim" id="verbatim-46">
\usepackage[automake]{glossaries}
</div>
<!--l. 1105--><p class="nopar" >
</p><!--l. 1107--><p class="noindent" >The default sort is word order (“sea lion” comes before “seal”). If you
want letter ordering you need to add the <span
class="cmss-10">order=letter</span><a
id="dx1-5039"></a> package
option
</p>
<div class="verbatim" id="verbatim-47">
\usepackage[order=letter]{glossaries}
</div>
<!--l. 1112--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5041x6">Once you have successfully completed the previous step, you can now run
<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> on your document again.</li></ol>
<!--l. 1117--><p class="noindent" >Here’s a complete document (<span
class="cmtt-10">myDoc.tex</span>):
</p>
<div class="verbatim" id="verbatim-48">
\documentclass{article}
 <br />\usepackage{glossaries}
 <br />\makeglossaries % create makeindex files
 <br />\newglossaryentry{sample}{name={sample},
 <br />  description={an example}}
 <br />\begin{document}
 <br />A \gls{sample}.
 <br />\printglossaries % input files created by makeindex
 <br />\end{document}
</div>
<!--l. 1133--><p class="nopar" > Document build:
</p>
<div class="verbatim" id="verbatim-49">
pdflatex myDoc
 <br />makeglossaries myDoc
 <br />pdflatex myDoc
</div>
<!--l. 1139--><p class="nopar" > or
</p>
<div class="verbatim" id="verbatim-50">
pdflatex myDoc
 <br />makeglossaries-lite myDoc
 <br />pdflatex myDoc
</div>
<!--l. 1145--><p class="nopar" >
</p></dd><dt class="description">
</dt><dd
class="description"><a
id="option3"></a><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 3</span>:
<!--l. 1150--><p class="noindent" >This option uses an application called <span
class="cmtt-10">xindy</span><a
id="dx1-5042"></a> to sort the entries. This
application is more flexible than <span
class="cmtt-10">makeindex</span><a
id="dx1-5043"></a> and is able to sort extended Latin
or non-Latin alphabets. It comes with both <span class="TEX">T<span
class="E">E</span>X</span> Live and MiK<span class="TEX">T<span
class="E">E</span>X</span>.
Since <span
class="cmtt-10">xindy</span><a
id="dx1-5044"></a> is a Perl script, you will also need to ensure that Perl is
installed. In a similar way to <a
href="#option2">Option 2</a>, this option involves making
<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> write the glossary information to a temporary file which <span
class="cmtt-10">xindy</span><a
id="dx1-5045"></a>
reads. Then <span
class="cmtt-10">xindy</span><a
id="dx1-5046"></a> writes a new file containing the code to typeset
the glossary. <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> then reads this file on the next run. The <span
class="cmtt-10">xindy</span><a
id="dx1-5047"></a>
application is automatically invoked by the helper <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5048"></a>
script, which works out all the appropriate settings from the <span
class="cmtt-10">.aux</span>
file.
</p><ol class="enumerate1" >
<li
class="enumerate" id="x1-5050x1">Add the <span
class="cmss-10">xindy</span><a
id="dx1-5051"></a> option to the <span
class="cmss-10">glossaries</span><a
id="dx1-5052"></a> package option list:
<div class="verbatim" id="verbatim-51">
\usepackage[xindy]{glossaries}
</div>
<!--l. 1169--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5054x2">Add <span
class="cmtt-10">\makeglossaries </span>to your preamble (before you start defining your
entries).
</li>
<li
class="enumerate" id="x1-5056x3">Put
<!--l. 1176--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printglossary[</span>⟨<span
class="cmitt-10">options</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 1177--><p class="noindent" >
where you want your list of entries (glossary) to appear. (The <span
class="cmtt-10">sort </span>key
isn’t available in ⟨<span
class="cmti-10">options</span>⟩.) Alternatively, use
</p><!--l. 1182--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printglossaries </span></div><hr>
</p><!--l. 1183--><p class="noindent" >
</p><!--l. 1185--><p class="noindent" ><div class="important" title="Important Note"> All glossaries are sorted using the same method which may be identified
with one of the package options: <span
class="cmss-10">sort=standard</span><a
id="dx1-5057"></a> (default), <span
class="cmss-10">sort=use</span><a
id="dx1-5058"></a> or
<span
class="cmss-10">sort=def</span><a
id="dx1-5059"></a>. </div>
</p><!--l. 1190--><p class="noindent" >
</p></li>
<li
class="enumerate" id="x1-5061x4">Run <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> on your document. This creates files with the extensions
<span
class="cmtt-10">.glo </span>and <span
class="cmtt-10">.xdy </span>(for example, if your <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> document is called
<span
class="cmtt-10">myDoc.tex</span>, then you’ll have two extra files called <span
class="cmtt-10">myDoc.glo </span>and
<span
class="cmtt-10">myDoc.xdy</span>). If you look at your document at this point, you won’t see the
glossary as it hasn’t been created yet.
</li>
<li
class="enumerate" id="x1-5063x5">Run <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5064"></a> with the base name of the document (omitting the
<span
class="cmtt-10">.tex </span>extension). If you have access to a terminal or a command prompt
(for example, the MSDOS command prompt for Windows users or
the bash console for Unix-like users) then you need to run the
command:
<div class="verbatim" id="verbatim-52">
makeglossaries myDoc
</div>
<!--l. 1206--><p class="nopar" > (Replace <span
class="cmtt-10">myDoc </span>with the base name of your <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> document file
without the <span
class="cmtt-10">.tex </span>extension. Avoid spaces in the file name. If you don’t
know how to use the command prompt, then as mentioned above, you may
be able to configure your text editor to add <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5065"></a> as a build
tool.
</p><!--l. 1214--><p class="noindent" >The default sort is word order (“sea lion” comes before “seal”). If you
want letter ordering you need to add the <span
class="cmtt-10">order=letter </span>package
option:
</p>
<div class="verbatim" id="verbatim-53">
\usepackage[xindy,order=letter]{glossaries}
</div>
<!--l. 1220--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5067x6">Once you have successfully completed the previous step, you can now run
<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> on your document again.
</li></ol>
<!--l. 1226--><p class="noindent" >Here’s a complete document (<span
class="cmtt-10">myDoc.tex</span>):
</p>
<div class="verbatim" id="verbatim-54">
\documentclass{article}
 <br />\usepackage[xindy]{glossaries}
 <br />\makeglossaries % create xindy files
 <br />\newglossaryentry{sample}{name={sample},
 <br />  description={an example}}
 <br />\begin{document}
 <br />A \gls{sample}.
 <br />\printglossaries % input files created by xindy
 <br />\end{document}
</div>
<!--l. 1242--><p class="nopar" > Document build:
</p>
<div class="verbatim" id="verbatim-55">
pdflatex myDoc
 <br />makeglossaries myDoc
 <br />pdflatex myDoc
</div>
<!--l. 1248--><p class="nopar" >
</p></dd><dt class="description">
</dt><dd
class="description"><a
id="option4"></a><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 4</span>:
<!--l. 1252--><p class="noindent" >This requires the extension package <span
class="cmss-10">glossaries-extra</span><a
id="dx1-5068"></a> and an application called
<span
class="cmtt-10">bib2gls</span><a
id="dx1-5069"></a>. This application is able to sort extended Latin or non-Latin
alphabets. It comes with both <span class="TEX">T<span
class="E">E</span>X</span> Live and MiK<span class="TEX">T<span
class="E">E</span>X</span> but requires at least
Java 7. This method works differently to Options <a
href="#option2">2</a> and <a
href="#option3">3</a>. Instead of
creating a file containing the code to typeset the glossary it creates a
<span
class="cmtt-10">.glstex </span>file containing the entry definitions fetched from the <span
class="cmtt-10">.bib </span>file (or
files), but only those entries that are required in the document are
defined and they are defined in the order obtained from the chosen sort
method. This means that you can just use <span
class="cmtt-10">\printunsrtglossary </span>to
display each glossary (or <span
class="cmtt-10">\printunsrtglossaries </span>to display them
all).
</p><ol class="enumerate1" >
<li
class="enumerate" id="x1-5071x1">Add the <span
class="cmss-10">record</span><a
id="dx1-5072"></a> option to the <span
class="cmss-10">glossaries-extra</span><a
id="dx1-5073"></a> package option list:
<div class="verbatim" id="verbatim-56">
\usepackage[record]{glossaries-extra}
</div>
<!--l. 1271--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5075x2">Add one or more
<!--l. 1275--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\GlsXtrLoadResources[src={</span>⟨<span
class="cmitt-10">bib list</span>⟩<span
class="cmtt-10">},</span>⟨<span
class="cmitt-10">options</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 1276--><p class="noindent" >
to your preamble where ⟨<span
class="cmti-10">bib list</span>⟩ is the list of <span
class="cmtt-10">.bib </span>files containing the
entries. You may use different sort methods for each resource set. For
example:
</p>
<div class="verbatim" id="verbatim-57">
\usepackage[record,% using bib2gls
 <br /> abbreviations,
 <br /> symbols,
 <br /> numbers
 <br />]{glossaries-extra}
 <br />\GlsXtrLoadResources[
 <br />  src={terms},% entries in terms.bib
 <br />  type=main,% put these entries in the 'main' (default) list
 <br />  sort={de-CH-1996}% sort according to this locale
 <br />]
 <br />\GlsXtrLoadResources[
 <br />  src={abbrvs},% entries in abbrvs.bib
 <br />  type=abbreviations,% put these entries in the 'abbreviations' list
 <br />  sort={letter-case}% case-sensitive letter (non-locale) sort
 <br />]
 <br />\GlsXtrLoadResources[
 <br />  src={syms},% entries in syms.bib
 <br />  type=symbols,% put these entries in the 'symbols' list
 <br />  sort={use}% sort according to first use in the document
 <br />]
 <br />\GlsXtrLoadResources[
 <br />  src={constants},% entries in constants.bib
 <br />  type=numbers,% put these entries in the 'numbers' list
 <br />  sort-field={user1},% sort according to this field
 <br />  sort={double}% double-precision sort
 <br />]
</div>
<!--l. 1308--><p class="nopar" > The last resource set assumes that the entries defined in the file
<span
class="cmtt-10">constants.bib </span>have a number stored in the <span
class="cmtt-10">user1 </span>field. For
example:
</p>
<div class="verbatim" id="verbatim-58">
@number{pi,
 <br />  name={\ensuremath{\pi}},
 <br />  description={pi},
 <br />  user1={3.141592654}
 <br />}
</div>
<!--l. 1318--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5077x3">Put
<!--l. 1322--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printunsrtglossary[type={</span>⟨<span
class="cmitt-10">type</span>⟩<span
class="cmtt-10">},</span>⟨<span
class="cmitt-10">options</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 1323--><p class="noindent" >
where you want your list of entries (glossary) to appear. (The <span
class="cmtt-10">sort </span>key
isn’t available in ⟨<span
class="cmti-10">options</span>⟩. It needs to be used in <span
class="cmtt-10">\GlsXtrLoadResources</span>
instead.) Alternatively, use
</p><!--l. 1329--><p class="noindent" ><hr><div title="Definition"><span
class="cmtt-10">\printunsrtglossaries </span></div><hr>
</p><!--l. 1330--><p class="noindent" >
</p></li>
<li
class="enumerate" id="x1-5079x4">Run <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> on your document. The <span
class="cmss-10">record</span><a
id="dx1-5080"></a> option adds information to
the <span
class="cmtt-10">.aux </span>file that provides <span
class="cmtt-10">bib2gls</span><a
id="dx1-5081"></a> with all required details for each
resource set. For example, if the file is called <span
class="cmtt-10">myDoc.tex</span>:
<div class="verbatim" id="verbatim-59">
pdflatex myDoc
</div>
<!--l. 1338--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5083x5">Run <span
class="cmtt-10">bib2gls</span><a
id="dx1-5084"></a>
<div class="verbatim" id="verbatim-60">
bib2gls myDoc
</div>
<!--l. 1343--><p class="nopar" > or (if you need letter groups)
</p>
<div class="verbatim" id="verbatim-61">
bib2gls --group myDoc
</div>
<!--l. 1347--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-5086x6">Run <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> again.</li></ol>
<!--l. 1351--><p class="noindent" >Here’s a complete document (<span
class="cmtt-10">myDoc.tex</span>):
</p>
<div class="verbatim" id="verbatim-62">
\documentclass{article}
 <br />\usepackage[record]{glossaries-extra}
 <br />\GlsXtrLoadResources % input file created by bib2gls
 <br /> [% instructions to bib2gls:
 <br />   src={entries}, % terms defined in entries.bib
 <br />   sort={en-GB}% sort according to this locale
 <br /> ]
 <br />\newglossaryentry{sample}{name={sample},
 <br />  description={an example}}
 <br />\begin{document}
 <br />A \gls{sample}.
 <br />\printunsrtglossaries % iterate over all defined entries
 <br />\end{document}
</div>
<!--l. 1371--><p class="nopar" > The accompanying <span
class="cmtt-10">entries.bib </span>file:
</p>
<div class="verbatim" id="verbatim-63">
@entry{sample,
 <br />  name = {sample},
 <br />  description = {an example}
 <br />}
</div>
<!--l. 1378--><p class="nopar" > Document build:
</p>
<div class="verbatim" id="verbatim-64">
pdflatex myDoc
 <br />bib2gls myDoc
 <br />pdflatex myDoc
</div>
<!--l. 1384--><p class="nopar" >
</p>
</dd></dl>
<!--l. 1388--><p class="indent" > If you are having difficulty integrating <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5087"></a> into your document build
process, you may want to consider using <span
class="cmtt-10">arara</span><a
id="dx1-5088"></a>, which is a Java application that
searches the document for special comment lines that tell <span
class="cmtt-10">arara</span><a
id="dx1-5089"></a> which applications
to run. For example, the file <span
class="cmtt-10">myDoc.tex </span>might start with:
</p>
<div class="verbatim" id="verbatim-65">
 % arara: pdflatex
 <br /> % arara: makeglossaries
 <br /> % arara: pdflatex
 <br /> \documentclass{article}
 <br /> \usepackage{glossaries}
 <br /> \makeglossaries
</div>
<!--l. 1401--><p class="nopar" > then to build the document you just need the single system call:
</p>
<div class="verbatim" id="verbatim-66">
 arara myDoc
</div>
<!--l. 1405--><p class="nopar" > (The currently pending version 4.0 of <span
class="cmtt-10">arara</span><a
id="dx1-5090"></a> has directives for <span
class="cmtt-10">makeglossaries-lite</span><a
id="dx1-5091"></a>
and <span
class="cmtt-10">bib2gls</span><a
id="dx1-5092"></a>. These aren’t available in earlier versions, but you could try copying
and adapting the <span
class="cmtt-10">makeglossaries.yaml </span>file and replace <span
class="cmtt-10">makeglossaries</span><a
id="dx1-5093"></a> as
appropriate.)
</p><!--l. 1412--><p class="indent" > When sorting the entries, the string comparisons are made according to each
entry’s <span
class="cmtt-10">sort </span>key. If this is omitted, the <span
class="cmtt-10">name </span>key is used. For example, recall the
earlier definition:
</p>
<div class="verbatim" id="verbatim-67">
 \newglossaryentry{elite}
 <br /> {
 <br />   name={{\'e}lite},
 <br />   description={select group or class}
 <br /> }
</div>
<!--l. 1422--><p class="nopar" > No <span
class="cmtt-10">sort </span>key was used, so it’s set to the same as the <span
class="cmtt-10">name </span>key: <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">{\’e}lite</span></span></span>. How this
is interpreted depends on which option you have used:
</p><dl class="description"><dt class="description">
<a
href="#option1"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 1</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description">By default, the accent command will be stripped so the sort value
will be <span
class="cmtt-10">elite</span>. This will put the entry in the “E” letter group. However
if you use the <span
class="cmss-10">sanitizesort=true</span><a
id="dx1-5094"></a> package option, the sort value will be
interpreted as the sequence of characters: <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">{</span></span></span> <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\</span></span></span> <span
class="cmtt-10">’ e </span><span class="obeylines-h"><span class="verb"><span
class="cmtt-10">}</span></span></span> <span
class="cmtt-10">l i t </span>and <span
class="cmtt-10">e</span>. This will
place this entry in the “symbols” group since it starts with a symbol.
</dd><dt class="description">
<a
href="#option2"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 2</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description">The sort key will be interpreted the sequence of characters: <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">{</span></span></span> <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\</span></span></span> <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">’</span></span></span> <span
class="cmtt-10">e</span>
<span class="obeylines-h"><span class="verb"><span
class="cmtt-10">}</span></span></span><span
class="cmtt-10">lit </span>and <span
class="cmtt-10">e</span>. The first character is an opening curly brace <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">{</span></span></span> so <span
class="cmtt-10">makeindex</span><a
id="dx1-5095"></a>
will put this entry in the “symbols” group.
</dd><dt class="description">
<a
href="#option3"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 3</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description"><span
class="cmtt-10">xindy</span><a
id="dx1-5096"></a> disregards <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> commands so it sorts on <span
class="cmtt-10">elite</span>, which puts
this entry in the “E” group. If stripping all commands leads to an empty string
(such as <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\ensuremath{\emptyset}</span></span></span>) then <span
class="cmtt-10">xindy</span><a
id="dx1-5097"></a> will fail, so in these
situations you need to provide an appropriate <span
class="cmtt-10">sort </span>value that <span
class="cmtt-10">xindy</span><a
id="dx1-5098"></a> will
accept.
<!--l. 1448--><p class="noindent" ><div class="important" title="Important Note"> <span
class="cmtt-10">xindy</span><a
id="dx1-5099"></a> merges entries with duplicate sort values. <span
class="cmtt-10">xindy</span><a
id="dx1-5100"></a> forbids empty sort
values. A sort value may degrade into an empty or duplicate value once <span
class="cmtt-10">xindy</span><a
id="dx1-5101"></a>
has stripped all commands and braces. </div>
</p><!--l. 1453--><p class="noindent" >
</p></dd><dt class="description">
<a
href="#option4"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 4</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description"><span
class="cmtt-10">bib2gls</span><a
id="dx1-5102"></a> has a primitive <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> parser that recognises a limited set of
commands, which includes the standard accent commands and some maths
commands, so it can convert <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">{\’e}lite</span></span></span> to <span
class="cmtt-10">é</span><span
class="cmtt-10">lite</span>. It disregards unknown
commands. This may lead to an empty sort value, but <span
class="cmtt-10">bib2gls</span><a
id="dx1-5103"></a> doesn’t mind
that.
<!--l. 1462--><p class="noindent" >Note that even if the name is given as <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">{\’e}lite</span></span></span>, the letter group heading
(if the <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">--group</span></span></span> switch is used) may end up with the character É
depending on the locale used by the sort comparator. In this case you
will need to ensure the document can support this character either
with <span
class="cmss-10">inputenc</span><a
id="dx1-5104"></a> or by switching to a <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> engine with native UTF-8
support.
</p>
</dd></dl>
<!--l. 1472--><p class="indent" > If the <span
class="cmss-10">inputenc</span><a
id="dx1-5105"></a> package is used:
</p>
<div class="verbatim" id="verbatim-68">
 \usepackage[utf8]{inputenc}
</div>
<!--l. 1475--><p class="nopar" > and the entry is defined as: </p><div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10"> </span><span class="verb"><span
class="cmtt-10">\newglossaryentry{elite}</span></span>
<br /><span
class="cmtt-10"> </span><span class="verb"><span
class="cmtt-10">{</span></span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> </span><span
class="cmtt-10"> name=</span><span class="verb"><span
class="cmtt-10">{{</span></span><span
class="cmtt-10">é</span><span class="verb"><span
class="cmtt-10">}lite},</span></span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> </span><span
class="cmtt-10"> description=</span><span class="verb"><span
class="cmtt-10">{select</span><span
class="cmtt-10"> group</span><span
class="cmtt-10"> or</span><span
class="cmtt-10"> class}</span></span>
<br /><span
class="cmtt-10"> </span><span class="verb"><span
class="cmtt-10">}</span></span>
</div>
</div> then:
<dl class="description"><dt class="description">
<a
href="#option1"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 1</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description">By default the sort value will be interpreted as <span
class="cmtt-10">elite </span>so the entry
will be put in the “E” letter group. If you use the <span
class="cmss-10">sanitizesort=true</span><a
id="dx1-5106"></a> package
option, the sort value will be interpreted as <span
class="cmtt-10">é</span><span
class="cmtt-10">lite </span>where é has been
sanitized (so it’s no longer an active character and is in fact seen as two
octets 0xC3 0xA9) which will put this entry before the “A” letter group.
(The group is determined by the first octet 0xC3.)
</dd><dt class="description">
<a
href="#option2"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 2</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description"><span
class="cmtt-10">makeindex</span><a
id="dx1-5107"></a> sees <span
class="cmtt-10">é</span> as two octets (0xC3 0xA9) rather than a single
character so it tries to put <span
class="cmtt-10">é</span><span
class="cmtt-10">lite </span>in the 0xC3 (“Ô) letter group (which,
in this case, comes after “Z”).
</dd><dt class="description">
<a
href="#option3"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 3</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description"><span
class="cmtt-10">xindy</span><a
id="dx1-5108"></a> will correctly recognise the sort value <span
class="cmtt-10">é</span><span
class="cmtt-10">lite </span>and will place
it in whatever letter group is appropriate for the given language setting.
(In English, this would just be the “E” letter group, but another language
might put it in the “É” letter group.)
</dd><dt class="description">
<a
href="#option4"><span
class="cmbx-10">Option</span><span
class="cmbx-10"> 4</span></a><span
class="cmbx-10">:</span> </dt><dd
class="description">The <span
class="cmss-10">inputenc</span><a
id="dx1-5109"></a> package doesn’t affect the encoding used with <span
class="cmtt-10">.bib </span>entry
definitions, since these are dependent on the encoding used to save the <span
class="cmtt-10">.bib </span>file
(although the labels must still be ASCII). You can help <span
class="cmtt-10">bib2gls</span><a
id="dx1-5110"></a> (and
JabRef) by putting an encoding comment at the start of the <span
class="cmtt-10">.bib </span>file:
<div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10">%</span><span
class="cmtt-10"> Encoding:</span><span
class="cmtt-10"> UTF-8</span>
</div>
</div>
<!--l. 1515--><p class="noindent" >With the correct encoding set up, <span
class="cmtt-10">bib2gls</span><a
id="dx1-5111"></a> will determine that the sort value is
<span
class="cmtt-10">é</span><span
class="cmtt-10">lite </span>and will place it in whatever letter group is appropriate for the given
sort rule. For example, <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">sort=en-GB</span></span></span> (or just <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">sort=en</span></span></span>) will put <span
class="cmtt-10">é</span><span
class="cmtt-10">lite </span>in the
“E” letter group, but another language might put it in the “É” letter
group.
</p>
</dd></dl>
<!--l. 1524--><p class="indent" > Therefore if you have extended Latin or non-Latin characters, your best option is
to use either <span
class="cmtt-10">xindy</span><a
id="dx1-5112"></a> (<a
href="#option3">Option 3</a>) or <span
class="cmtt-10">bib2gls</span><a
id="dx1-5113"></a> (<a
href="#option4">Option 4</a>) with the <span
class="cmss-10">inputenc</span><a
id="dx1-5114"></a> or <span
class="cmss-10">fontspec</span><a
id="dx1-5115"></a>
package. If you use <span
class="cmtt-10">makeindex</span><a
id="dx1-5116"></a> (<a
href="#option2">Option 2</a>) you need to specify the <span
class="cmtt-10">sort </span>key like
this:
</p>
<div class="verbatim" id="verbatim-69">
\newglossaryentry{elite}
 <br />{
 <br />  name={{\'e}lite},
 <br />  sort={elite},
 <br />  description={select group or class}
 <br />}
</div>
<!--l. 1536--><p class="nopar" > or </p><div class="alltt">
<div class="obeylines-v">
<span
class="cmtt-10">\newglossaryentry</span><span
class="cmsy-10">{</span><span
class="cmtt-10">elite</span><span
class="cmsy-10">}</span>
<br /><span
class="cmsy-10">{</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> name=</span><span
class="cmsy-10">{{</span><span
class="cmtt-10">é</span><span
class="cmsy-10">}</span><span
class="cmtt-10">lite</span><span
class="cmsy-10">}</span><span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> sort=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">elite</span><span
class="cmsy-10">}</span><span
class="cmtt-10">,</span>
<br /><span
class="cmtt-10"> </span><span
class="cmtt-10"> description=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">select</span><span
class="cmtt-10"> group</span><span
class="cmtt-10"> or</span><span
class="cmtt-10"> class</span><span
class="cmsy-10">}</span>
<br /><span
class="cmsy-10">}</span>
</div>
</div> If you use <a
href="#option1">Option 1</a>, you may or may not need to use the <span
class="cmtt-10">sort </span>key, but you will
need to be careful about fragile commands in the <span
class="cmtt-10">name </span>key if you don’t set the <span
class="cmtt-10">sort</span>
key.
<!--l. 1550--><p class="indent" > If you use <a
href="#option3">Option 3</a> and the <span
class="cmtt-10">name </span>only contains a command or commands (such
as <span
class="cmtt-10">\P </span>or <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">\ensuremath{\pi}</span></span></span>) you must add the <span
class="cmtt-10">sort </span>key. This is also advisable
for the other options (except <a
href="#option4">Option 4</a>), but is essential for <a
href="#option3">Option 3</a>. For
example:
</p>
<div class="verbatim" id="verbatim-70">
 \newglossaryentry{P}{name={\P},sort={P},
 <br />  description={paragraph symbol}}
</div>
<!--l. 1557--><p class="nopar" >
</p>
<!--l. 1559--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">5 </span> <a
id="sec:glosstyle"></a>Customising the Glossary</h3>
<!--l. 1562--><p class="noindent" >The default glossary style uses the <span
class="cmss-10">description</span><a
id="dx1-6001"></a><a
id="dx1-6002"></a> environment to display the entry list.
Each entry name is set in the optional argument of <span
class="cmtt-10">\item </span>which means that it will
typically be displayed in bold. You can switch to medium weight by redefining
<span
class="cmtt-10">\glsnamefont</span>:
</p>
<div class="verbatim" id="verbatim-71">
\renewcommand*{\glsnamefont}[1]{\textmd{#1}}
</div>
<!--l. 1569--><p class="nopar" > Some classes and packages redefine the <span
class="cmss-10">description</span><a
id="dx1-6003"></a><a
id="dx1-6004"></a> environment in such as way that’s
incompatible with the <span
class="cmss-10">glossaries </span>package. In which case you’ll need to select a
different glossary style (see below).
</p><!--l. 1575--><p class="indent" > By default, a full stop is appended to the description (unless you use
<span
class="cmss-10">glossaries-extra</span><a
id="dx1-6005"></a>). To prevent this from happening use the <span
class="cmss-10">nopostdot</span><a
id="dx1-6006"></a> package
option:
</p>
<div class="verbatim" id="verbatim-72">
\usepackage[nopostdot]{glossaries}
</div>
<!--l. 1580--><p class="nopar" > or to add it with <span
class="cmss-10">glossaries-extra</span>:
</p>
<div class="verbatim" id="verbatim-73">
\usepackage[postdot]{glossaries-extra}
</div>
<!--l. 1584--><p class="nopar" >
</p><!--l. 1586--><p class="indent" > By default, a location list is displayed for each entry (unless you use
<span
class="cmtt-10">\printunsrtglossary </span>without <span
class="cmtt-10">bib2gls</span><a
id="dx1-6007"></a>). This refers to the document locations (for
example, the page number) where the entry has been referenced. If you use
Options <a
href="#option2">2</a> or <a
href="#option3">3</a> described in <a
href="#sec:printglossaries"><span
class="cmsy-10">§</span>4 </a><a
href="#sec:printglossaries">Displaying a List of Entries<!--tex4ht:ref: sec:printglossaries --></a> or <a
href="#option4">Option 4</a> (with
<span
class="cmtt-10">bib2gls</span><a
id="dx1-6008"></a> and <span
class="cmss-10">glossaries-extra</span><a
id="dx1-6009"></a>) then location ranges will be compressed. For example, if
an entry was used on pages 1, 2 and 3, with Options <a
href="#option2">2</a> or <a
href="#option3">3</a> or <a
href="#option4">Option 4</a> the
location list will appear as 1–3, but with <a
href="#option1">Option 1</a> it will appear as 1, 2, 3. If you
don’t want the locations displayed you can hide them using the <span
class="cmss-10">nonumberlist</span><a
id="dx1-6010"></a> package
option:
</p>
<div class="verbatim" id="verbatim-74">
\usepackage[nonumberlist]{glossaries}
</div>
<!--l. 1598--><p class="nopar" > or with <span
class="cmtt-10">bib2gls</span><a
id="dx1-6011"></a> use <span
class="cmtt-10">save-locations=false </span>in the optional argument of the
appropriate <span
class="cmtt-10">\GlsXtrLoadResources </span>(it’s possible to have some resource sets with
locations and some without).
</p><!--l. 1604--><p class="indent" > Entries are grouped according to the first letter of each entry’s <span
class="cmtt-10">sort </span>key. By
default a vertical gap is placed between letter groups. You can suppress this with the
<span
class="cmss-10">nogroupskip</span><a
id="dx1-6012"></a> package option:
</p>
<div class="verbatim" id="verbatim-75">
\usepackage[nogroupskip]{glossaries}
</div>
<!--l. 1610--><p class="nopar" >
</p><!--l. 1612--><p class="indent" > If the default style doesn’t suit your document, you can change the style
using:
</p><!--l. 1615--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\setglossarystyle{</span>⟨<span
class="cmitt-10">style name</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 1616--><p class="noindent" >
<a
href="http://www.dickimaw-books.com/gallery/glossaries-styles/" >There are a number of predefined styles.</a> Glossaries can vary from a list of symbols
with a terse description to a list of words or phrases with descriptions that span
multiple paragraphs, so there’s no “one style fits all” solution. You need to choose
a style that suits your document. For example:
</p>
<div class="verbatim" id="verbatim-76">
\setglossarystyle{index}
</div>
<!--l. 1624--><p class="nopar" > You can also use the <span
class="cmss-10">style</span><a
id="dx1-6013"></a> package option for the preloaded styles. For example:
</p>
<div class="verbatim" id="verbatim-77">
\usepackage[style=index]{glossaries}
</div>
<!--l. 1629--><p class="nopar" >
</p><!--l. 1631--><p class="indent" > Examples:
</p><ol class="enumerate1" >
<li
class="enumerate" id="x1-6015x1">You have entries where the name is a symbol and the description is a brief
phrase or short sentence. Try one of the “mcol” styles defined in the
<span
class="cmss-10">glossary-mcols</span><a
id="dx1-6016"></a> package. For example:
<div class="verbatim" id="verbatim-78">
\usepackage[nopostdot]{glossaries}
 <br />\usepackage{glossary-mcols}
 <br />\setglossarystyle{mcolindex}
</div>
<!--l. 1640--><p class="nopar" > or
</p>
<div class="verbatim" id="verbatim-79">
\usepackage[stylemods={mcols},style=mcolindex]{glossaries-extra}
</div>
<!--l. 1644--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-6018x2">You have entries where the name is a word or phrase and the description spans
multiple paragraphs. Try one of the “altlist” styles. For example:
<div class="verbatim" id="verbatim-80">
\usepackage[nopostdot]{glossaries}
 <br />\setglossarystyle{altlist}
</div>
<!--l. 1652--><p class="nopar" > or
</p>
<div class="verbatim" id="verbatim-81">
\usepackage[stylemods,style=altlist]{glossaries-extra}
</div>
<!--l. 1656--><p class="nopar" >
</p></li>
<li
class="enumerate" id="x1-6020x3">You have entries where the name is a single word, the description is
brief, and an associated symbol has been set. Use one of the styles that
display the symbol (not all of them do). For example, one of the tabular
styles:
<div class="verbatim" id="verbatim-82">
\usepackage[nopostdot,nonumberlist]{glossaries}
 <br />\setglossarystyle{long4col}
</div>
<!--l. 1665--><p class="nopar" > or one of the “tree” styles:
</p>
<div class="verbatim" id="verbatim-83">
\usepackage[nopostdot,nonumberlist]{glossaries}
 <br />\setglossarystyle{tree}
</div>
<!--l. 1670--><p class="nopar" ></p></li></ol>
<!--l. 1673--><p class="indent" > If your glossary consists of a list of abbreviations and you also want to specify
a description as well as the long form, then you need to use an abbreviation style
that will suit the glossary style. For example, use the <span
class="cmtt-10">long-short-desc </span>acronym
style:
</p>
<div class="verbatim" id="verbatim-84">
\setacronymstyle{long-short-desc}
</div>
<!--l. 1679--><p class="nopar" > Define the acronyms with a description:
</p>
<div class="verbatim" id="verbatim-85">
\newacronym
 <br /> [description={statistical pattern recognition technique}]
 <br /> {svm}{SVM}{support vector machine}
</div>
<!--l. 1685--><p class="nopar" > Alternatively with <span
class="cmss-10">glossaries-extra</span><a
id="dx1-6021"></a>:
</p>
<div class="verbatim" id="verbatim-86">
\setabbreviationstyle{long-short-desc}
 <br />\newabbreviation
 <br /> [description={statistical pattern recognition technique}]
 <br /> {svm}{SVM}{support vector machine}
</div>
<!--l. 1693--><p class="nopar" >
</p><!--l. 1695--><p class="indent" > Choose a glossary style that suits wide entry names. For example:
</p>
<div class="verbatim" id="verbatim-87">
\setglossarystyle{altlist}
</div>
<!--l. 1698--><p class="nopar" >
</p><!--l. 1700--><p class="noindent" >
</p>
<!--l. 1700--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">6 </span> <a
id="sec:multigloss"></a>Multiple Glossaries</h3>
<!--l. 1703--><p class="noindent" >The <span
class="cmss-10">glossaries</span><a
id="dx1-7001"></a> package predefines a default <span
class="cmtt-10">main </span>glossary. When you define an entry
(using one of the commands described in <a
href="#sec:defterm"><span
class="cmsy-10">§</span>2 </a><a
href="#sec:defterm">Defining Terms<!--tex4ht:ref: sec:defterm --></a>), that entry is
automatically assigned to the default glossary, unless you indicate otherwise using the
<span
class="cmtt-10">type </span>key. However you first need to make sure the desired glossary has been defined.
This is done using:
</p><!--l. 1710--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\newglossary[</span>⟨<span
class="cmitt-10">glg</span>⟩<span
class="cmtt-10">]{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">gls</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">glo</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">title</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 1711--><p class="noindent" >
The ⟨<span
class="cmti-10">label</span>⟩ is a label that uniquely identifies this new glossary. As with other types of
identifying labels, be careful not to use active characters in ⟨<span
class="cmti-10">label</span>⟩. The final
argument ⟨<span
class="cmti-10">title</span>⟩ is the section or chapter heading used by <span
class="cmtt-10">\printglossary </span>or
<span
class="cmtt-10">\printnoidxglossary</span>. The other arguments indicate the file extensions used by
<span
class="cmtt-10">makeindex</span><a
id="dx1-7002"></a>/<span
class="cmtt-10">xindy</span><a
id="dx1-7003"></a> (described in <a
href="#sec:printglossaries"><span
class="cmsy-10">§</span>4 </a><a
href="#sec:printglossaries">Displaying a List of Entries<!--tex4ht:ref: sec:printglossaries --></a>). If you use <a
href="#option1">Option 1</a>
described above (or <span
class="cmtt-10">bib2gls</span><a
id="dx1-7004"></a> and <span
class="cmtt-10">\printunsrtglossaries</span>), then the ⟨<span
class="cmti-10">glg</span>⟩, ⟨<span
class="cmti-10">gls</span>⟩ and ⟨<span
class="cmti-10">glo</span>⟩
arguments are ignored, in which case you may prefer to use the starred version where
you don’t specify the extensions:
</p><!--l. 1725--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\newglossary*{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}{</span>⟨<span
class="cmitt-10">title</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 1726--><p class="noindent" >
</p><!--l. 1728--><p class="indent" > In the case of Options <a
href="#option2">2</a> or <a
href="#option3">3</a>, all glossary definitions must come before
<span
class="cmtt-10">\makeglossaries</span>. (Entries definitions should come after <span
class="cmtt-10">\makeglossaries</span>.) In the case
of <a
href="#option4">Option 4</a>, all glossary definitions must come before any <span
class="cmtt-10">\GlsXtrLoadResources</span>
that requires them.
</p><!--l. 1733--><p class="indent" > Since it’s quite common for documents to have both a list of terms and a list of
abbreviations, the <span
class="cmss-10">glossaries</span><a
id="dx1-7005"></a> package provides the package option <span
class="cmss-10">acronym</span><a
id="dx1-7006"></a> (or
<span
class="cmss-10">acronyms</span><a
id="dx1-7007"></a>), which is a convenient shortcut for
</p>
<div class="verbatim" id="verbatim-88">
\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
</div>
<!--l. 1739--><p class="nopar" > The option also changes the behaviour of <span
class="cmtt-10">\newacronym </span>so that acronyms are
automatically put in the list of acronyms instead of the main glossary. The
<span
class="cmss-10">glossaries-extra</span><a
id="dx1-7008"></a> package also provides this option for abbreviations defined using
<span
class="cmtt-10">\newacronym </span>but additionally has the package option <span
class="cmss-10">abbreviations</span><a
id="dx1-7009"></a> to create a list of
abbreviations for <span
class="cmtt-10">\newabbreviation</span>.
</p><!--l. 1747--><p class="indent" > There are some other package options for creating commonly used lists: <span
class="cmss-10">symbols</span><a
id="dx1-7010"></a>
(lists of symbols), <span
class="cmss-10">numbers</span><a
id="dx1-7011"></a> (lists of numbers), <span
class="cmss-10">index</span><a
id="dx1-7012"></a> (index of terms without
descriptions defined with <span
class="cmtt-10">\newterm[</span>⟨<span
class="cmti-10">options</span>⟩<span
class="cmtt-10">]{</span>⟨<span
class="cmti-10">label</span>⟩<span
class="cmtt-10">}</span>).
</p><!--l. 1752--><p class="indent" > For example, suppose you want a main glossary for terms, a list of acronyms and
a list of notation:
</p>
<div class="verbatim" id="verbatim-89">
 \usepackage[acronyms]{glossaries}
 <br /> \newglossary[nlg]{notation}{not}{ntn}{Notation}
</div>
<!--l. 1757--><p class="nopar" > After <span
class="cmtt-10">\makeglossaries </span>(or <span
class="cmtt-10">\makenoidxglossaries</span>) you can define the entries in
the preamble. For example:
</p>
<div class="verbatim" id="verbatim-90">
 \newglossaryentry{gls:set}
 <br /> {% This entry goes in the `main' glossary
 <br />   name=set,
 <br />   description={A collection of distinct objects}
 <br /> }
 <br /> % This entry goes in the `acronym' glossary:
 <br /> \newacronym{svm}{svm}{support vector machine}
 <br /> \newglossaryentry{not:set}
 <br /> {% This entry goes in the `notation' glossary:
 <br />   type=notation,
 <br />   name={\ensuremath{\mathcal{S}}},
 <br />   description={A set},
 <br />   sort={S}}
</div>
<!--l. 1776--><p class="nopar" > or if you don’t like using <span
class="cmtt-10">\ensuremath</span>:
</p>
<div class="verbatim" id="verbatim-91">
 \newglossaryentry{not:set}
 <br /> {% This entry goes in the `notation' glossary:
 <br />   type=notation,
 <br />   name={$\mathcal{S}$},
 <br />   text={\mathcal{S}},
 <br />   description={A set},
 <br />   sort={S}}
</div>
<!--l. 1786--><p class="nopar" >
</p><!--l. 1788--><p class="indent" > Each glossary is displayed using:
</p><!--l. 1790--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\printnoidxglossary[type=</span>⟨<span
class="cmitt-10">type</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 1791--><p class="noindent" >
(<a
href="#option1">Option 1</a>) or
</p><!--l. 1794--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\printglossary[type=</span>⟨<span
class="cmitt-10">type</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 1795--><p class="noindent" >
(Options <a
href="#option2">2</a> and <a
href="#option3">3</a>). Where ⟨<span
class="cmti-10">type</span>⟩ is the glossary label. If the type is omitted the
default <span
class="cmtt-10">main </span>glossary is assumed.
</p><!--l. 1799--><p class="indent" > If you’re using <span
class="cmtt-10">bib2gls</span><a
id="dx1-7013"></a> then each glossary is displayed using:
</p><!--l. 1802--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\printunsrtglossary[type=</span>⟨<span
class="cmitt-10">type</span>⟩<span
class="cmtt-10">] </span></div><hr>
</p><!--l. 1803--><p class="noindent" >
With this method you don’t use <span
class="cmtt-10">\makeglossaries </span>or <span
class="cmtt-10">\makenoidxglossaries</span>.
Instead you can assign the entry type with the resource command. For example:
</p>
<div class="verbatim" id="verbatim-92">
 \usepackage[record,abbreviations,symbols]{glossaries-extra}
 <br /> \GlsXtrLoadResources[
 <br />  src={terms}, % entries defined in terms.bib
 <br />  type={main}% put in main glossary
 <br /> ]
 <br /> \GlsXtrLoadResources[
 <br />  src={abbrvs}, % entries defined in abbrvs.bib
 <br />  type={abbreviations}% put in abbreviations glossary
 <br /> ]
 <br /> \GlsXtrLoadResources[
 <br />  src={syms}, % entries defined in syms.bib
 <br />  type={symbols}% put in symbols glossary
 <br /> ]
</div>
<!--l. 1822--><p class="nopar" > Later in the document:
</p>
<div class="verbatim" id="verbatim-93">
 \printunsrtglossary % main
 <br /> \printunsrtglossary[type=abbreviations]
 <br /> \printunsrtglossary[type=symbols]
</div>
<!--l. 1828--><p class="nopar" >
</p><!--l. 1830--><p class="indent" > There’s a convenient shortcut that will display all the defined glossaries
depending on the indexing method:
</p><!--l. 1833--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\printnoidxglossaries </span></div><hr>
</p><!--l. 1834--><p class="noindent" >
(<a
href="#option1">Option 1</a>) or
</p><!--l. 1837--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\printglossaries </span></div><hr>
</p><!--l. 1838--><p class="noindent" >
(Options <a
href="#option2">2</a> and <a
href="#option3">3</a>) or (<span
class="cmss-10">glossaries-extra</span><a
id="dx1-7014"></a> only)
</p><!--l. 1841--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\printunsrtglossaries </span></div><hr>
</p><!--l. 1842--><p class="noindent" >
</p><!--l. 1844--><p class="indent" > If you use <a
href="#option1">Option 1</a>, you don’t need to do anything else. If you use Options <a
href="#option2">2</a>
or <a
href="#option3">3</a> with the <span
class="cmtt-10">makeglossaries</span><a
id="dx1-7015"></a> Perl script or the <span
class="cmtt-10">makeglossaries-lite</span><a
id="dx1-7016"></a> Lua script,
you similarly don’t need to do anything else. If you use Options <a
href="#option2">2</a> or <a
href="#option3">3</a> without the
<span
class="cmtt-10">makeglossaries</span><a
id="dx1-7017"></a> Perl script then you need to make sure you run <span
class="cmtt-10">makeindex</span><a
id="dx1-7018"></a>/<span
class="cmtt-10">xindy</span><a
id="dx1-7019"></a>
<span
class="cmti-10">for each defined glossary</span>. The ⟨<span
class="cmti-10">gls</span>⟩ and ⟨<span
class="cmti-10">glo</span>⟩ arguments of <span
class="cmtt-10">\newglossary </span>specify the file
extensions to use instead of <span
class="cmtt-10">.gls </span>and <span
class="cmtt-10">.glo</span>. The optional argument ⟨<span
class="cmti-10">glg</span>⟩ is the file
extension for the transcript file. This should be different for each glossary in
case you need to check for <span
class="cmtt-10">makeindex</span><a
id="dx1-7020"></a>/<span
class="cmtt-10">xindy</span><a
id="dx1-7021"></a> errors or warnings if things go
wrong.
</p><!--l. 1858--><p class="indent" > For example, suppose you have three glossaries in your document (<span
class="cmtt-10">main</span>, <span
class="cmtt-10">acronym</span>
and <span
class="cmtt-10">notation</span>), specified using:
</p>
<div class="verbatim" id="verbatim-94">
\usepackage[acronyms]{glossaries}
 <br />\newglossary[nlg]{notation}{not}{ntn}{Notation}
</div>
<!--l. 1864--><p class="nopar" > Then (assuming your <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> document is in a file called <span
class="cmtt-10">myDoc.tex</span>):
</p><!--l. 1868--><p class="indent" >
</p><dl class="description"><dt class="description">
</dt><dd
class="description"><a
href="#option2">Option 2</a> Either use one <span
class="cmtt-10">makeglossaries</span><a
id="dx1-7022"></a> or <span
class="cmtt-10">makeglossaries-lite</span><a
id="dx1-7023"></a> call:
<div class="verbatim" id="verbatim-95">
makeglossaries myDoc
</div>
<!--l. 1874--><p class="nopar" > or
</p>
<div class="verbatim" id="verbatim-96">
makeglossaries-lite myDoc
</div>
<!--l. 1878--><p class="nopar" > Or you need to run <span
class="cmtt-10">makeindex</span><a
id="dx1-7024"></a> three times:
</p>
<div class="verbatim" id="verbatim-97">
makeindex -t myDoc.glg -s myDoc.ist -o myDoc.gls myDoc.glo
 <br />makeindex -t myDoc.alg -s myDoc.ist -o myDoc.acr myDoc.acn
 <br />makeindex -t myDoc.nlg -s myDoc.ist -o myDoc.not myDoc.ntn
</div>
<!--l. 1884--><p class="nopar" >
</p></dd><dt class="description">
</dt><dd
class="description"><a
href="#option3">Option 3</a> Either use one <span
class="cmtt-10">makeglossaries</span><a
id="dx1-7025"></a> call:
<div class="verbatim" id="verbatim-98">
makeglossaries myDoc
</div>
<!--l. 1890--><p class="nopar" > Or you need to run <span
class="cmtt-10">xindy</span><a
id="dx1-7026"></a> three times (be careful not to insert line breaks
where the line has wrapped.)
</p>
<div class="verbatim" id="verbatim-99">
xindy  -L english -C utf8 -I xindy -M myDoc -t myDoc.glg
 <br />-o myDoc.gls myDoc.glo
 <br />xindy  -L english -C utf8 -I xindy -M myDoc -t myDoc.alg
 <br />-o myDoc.acr myDoc.acn
 <br />xindy  -L english -C utf8 -I xindy -M myDoc -t myDoc.nlg
 <br />-o myDoc.not myDoc.ntn
</div>
<!--l. 1900--><p class="nopar" >
</p></dd><dt class="description">
</dt><dd
class="description"><a
href="#option4">Option 4</a> With <span
class="cmtt-10">bib2gls</span><a
id="dx1-7027"></a> only one call is required:
<div class="verbatim" id="verbatim-100">
pdflatex myDoc
 <br />bib2gls --group myDoc
 <br />pdflatex myDoc
</div>
<!--l. 1908--><p class="nopar" > (Omit <span class="obeylines-h"><span class="verb"><span
class="cmtt-10">--group</span></span></span> if you don’t need letter groups.)</p></dd></dl>
<!--l. 1913--><p class="noindent" >
</p>
<!--l. 1913--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">7 </span> <a
id="sec:hyperref"></a><span
class="cmss-10">glossaries </span>and <span
class="cmss-10">hyperref</span></h3>
<!--l. 1916--><p class="noindent" >Take care if you use the <span
class="cmss-10">glossaries</span><a
id="dx1-8001"></a> package with <span
class="cmss-10">hyperref</span><a
id="dx1-8002"></a>. Contrary to the usual advice
that <span
class="cmss-10">hyperref</span><a
id="dx1-8003"></a> should be loaded last, <span
class="cmss-10">glossaries</span><a
id="dx1-8004"></a> (and <span
class="cmss-10">glossaries-extra</span><a
id="dx1-8005"></a>) must be loaded
<span
class="cmti-10">after </span><span
class="cmss-10">hyperref</span><a
id="dx1-8006"></a>:
</p>
<div class="verbatim" id="verbatim-101">
\usepackage[colorlinks]{hyperref}
 <br />\usepackage{glossaries}
</div>
<!--l. 1923--><p class="nopar" > If you use <span
class="cmss-10">hyperref</span><a
id="dx1-8007"></a> make sure you use PDF<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> rather than the <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> to DVI
engine. The DVI format can’t break hyperlinks across a line so long glossary entries
(such as the full form of acronyms) won’t line wrap with the DVI engine.
Also, hyperlinks in sub- or superscripts aren’t correctly sized with the DVI
format.
</p><!--l. 1930--><p class="indent" > By default, if the <span
class="cmss-10">hyperref</span><a
id="dx1-8008"></a> package has been loaded, commands like <span
class="cmtt-10">\gls </span>will form
a hyperlink to the relevant entry in the glossary. If you to disable this for <span
class="cmti-10">all </span>your
glossaries, then use
</p><!--l. 1935--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\glsdisablehyper </span></div><hr>
</p><!--l. 1936--><p class="noindent" >
If you want hyperlinks suppressed for entries in specific glossaries, then use the
<span
class="cmss-10">nohypertypes</span><a
id="dx1-8009"></a> package option. For example, if you don’t want hyperlinks for entries in
the <span
class="cmtt-10">acronym </span>and <span
class="cmtt-10">notation </span>glossaries but you do want them for entries in the <span
class="cmtt-10">main</span>
glossary, then do:
</p>
<div class="verbatim" id="verbatim-102">
\usepackage[colorlinks]{hyperref}
 <br />\usepackage[acronym,nohypertypes={acronym,notation}]{glossaries}
 <br />\newglossary[nlg]{notation}{not}{ntn}{Notation}
</div>
<!--l. 1946--><p class="nopar" >
</p><!--l. 1948--><p class="indent" > If you want the hyperlinks suppressed the first time an entry is used, but you
want hyperlinks for subsequence references then use the <span
class="cmss-10">hyperfirst=false</span><a
id="dx1-8010"></a> package
option:
</p>
<div class="verbatim" id="verbatim-103">
\usepackage[colorlinks]{hyperref}
 <br />\usepackage[hyperfirst=false]{glossaries}
</div>
<!--l. 1954--><p class="nopar" >
</p><!--l. 1956--><p class="indent" > Take care not to use non-expandable commands in PDF bookmarks. This isn’t
specific to the <span
class="cmss-10">glossaries</span><a
id="dx1-8011"></a> package but is a limitation of PDF bookmarks.
Non-expandable commands include commands like <span
class="cmtt-10">\gls</span>, <span
class="cmtt-10">\glspl</span>, <span
class="cmtt-10">\Gls </span>and <span
class="cmtt-10">\Glspl</span>.
The <span
class="cmss-10">hyperref</span><a
id="dx1-8012"></a> package provides a way of specifying alternative text for the PDF
bookmarks via <span
class="cmtt-10">\texorpdfstring</span>. For example:
</p>
<div class="verbatim" id="verbatim-104">
\section{The \texorpdfstring{\gls{fishage}}{Fish Age}}
</div>
<!--l. 1964--><p class="nopar" > However, it’s not a good idea to use commands like <span
class="cmtt-10">\gls </span>in a section heading as
you’ll end up with the table of contents in your location list. Instead you can
use
</p><!--l. 1969--><p class="indent" > <hr><div title="Definition"><span
class="cmtt-10">\glsentrytext{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">} </span></div><hr>
</p><!--l. 1970--><p class="noindent" >
This is expandable provided that the <span
class="cmtt-10">text </span>key doesn’t contain non-expandable code.
For example, the following works:
</p>
<div class="verbatim" id="verbatim-105">
\section{The \glsentrytext{fishage}}
</div>
<!--l. 1975--><p class="nopar" > and it doesn’t put the table of contents in the location list.
</p><!--l. 1978--><p class="indent" > If you use <span
class="cmss-10">glossaries-extra</span><a
id="dx1-8013"></a> then use the commands that are provided specifically for
use in section headers. For example:
</p>
<div class="verbatim" id="verbatim-106">
\section{The \glsfmttext{fishage}}
</div>
<!--l. 1982--><p class="nopar" >
</p><!--l. 1984--><p class="noindent" >
</p>
<!--l. 1984--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">8 </span> <a
id="sec:xr"></a>Cross-References</h3>
<!--l. 1987--><p class="noindent" >You can add a reference to another entry in a location list using the <span
class="cmtt-10">see={</span>⟨<span
class="cmti-10">label list</span>⟩<span
class="cmtt-10">}</span>
key when you define an entry. The referenced entry (or entries) must also be
defined.
</p><!--l. 1991--><p class="indent" > For example:
</p>
<div class="verbatim" id="verbatim-107">
\longnewglossaryentry{devonian}{name={Devonian}}%
 <br />{%
 <br />  The geologic period spanning from the end of the
 <br />  Silurian Period to the beginning of the Carboniferous Period.
 <br />  This age was known for its remarkable variety of
 <br />  fish species.
 <br />}
 <br />\newglossaryentry{fishage}
 <br />{
 <br />  name={Fish Age},
 <br />  description={Common name for the Devonian period},
 <br />  see={devonian}
 <br />}
</div>
<!--l. 2008--><p class="nopar" > The cross-reference will appear as “<span
class="cmti-10">see </span>Devonian”. You can change the “see” tag
using the format <span
class="cmtt-10">see=[</span>⟨<span
class="cmti-10">tag</span>⟩<span
class="cmtt-10">]</span>⟨<span
class="cmti-10">label</span>⟩. For example:
</p>
<div class="verbatim" id="verbatim-108">
\newglossaryentry{latinalph}
 <br />{
 <br />  name={Latin alphabet},
 <br />  description={alphabet consisting of the letters
 <br />  a, \ldots, z, A, \ldots, Z},
 <br />  see=[see also]{exlatinalph}
 <br />}
 <br />\newglossaryentry{exlatinalph}
 <br />{
 <br />   name={extended Latin alphabet},
 <br />   description={The Latin alphabet extended to include
 <br />   other letters such as ligatures or diacritics.}
 <br />}
</div>
<!--l. 2026--><p class="nopar" > If you use the <span
class="cmtt-10">see </span>key in the optional argument of <span
class="cmtt-10">\newacronym</span>, make sure you
enclose the value in braces. For example:
</p>
<div class="verbatim" id="verbatim-109">
\newacronym{ksvm}{ksvm}{kernel support vector machine}
 <br />\newacronym
 <br /> [see={[see also]{ksvm}}]
 <br /> {svm}{svm}{support vector machine}
</div>
<!--l. 2035--><p class="nopar" > The <span
class="cmss-10">glossaries-extra</span><a
id="dx1-9001"></a> package provides a <span
class="cmtt-10">seealso </span>key. This doesn’t allow a tag but
behaves much like <span
class="cmtt-10">see=</span><span
class="cmsy-10">{</span><span
class="cmtt-10">[\seealsoname]{</span>⟨<span
class="cmitt-10">label</span>⟩<span
class="cmtt-10">}</span><span
class="cmsy-10">}</span>. For example:
</p>
<div class="verbatim" id="verbatim-110">
\newabbreviation{ksvm}{ksvm}{kernel support vector machine}
 <br />\newabbreviation
 <br /> [seealso={ksvm}]
 <br /> {svm}{svm}{support vector machine}
</div>
<!--l. 2044--><p class="nopar" >
</p><!--l. 2046--><p class="indent" > Since the cross-reference appears in the location list, if you suppress the
location list using the <span
class="cmss-10">nonumberlist</span><a
id="dx1-9002"></a> package option, then the cross-reference
will also be suppressed. With <span
class="cmtt-10">bib2gls</span><a
id="dx1-9003"></a>, don’t use the <span
class="cmss-10">nonumberlist</span><a
id="dx1-9004"></a> package
option. Instead use the <span
class="cmtt-10">save-locations=false </span>in the resource options. For
example:
</p>
<div class="verbatim" id="verbatim-111">
\usepackage[record,abbreviations,symbols]{glossaries-extra}
 <br />\GlsXtrLoadResources[
 <br /> src={terms}, % entries defined in terms.bib
 <br /> type={main}% put in main glossary
 <br />]
 <br />\GlsXtrLoadResources[
 <br /> src={abbrvs}, % entries defined in abbrvs.bib
 <br /> type={abbreviations},% put in abbreviations glossary
 <br /> save-locations=false% no number list for these entries
 <br />]
 <br />\GlsXtrLoadResources[
 <br /> src={syms}, % entries defined in syms.bib
 <br /> type={symbols}% put in symbols glossary
 <br />]
</div>
<!--l. 2068--><p class="nopar" >
</p><!--l. 2070--><p class="noindent" >
</p>
<!--l. 2070--><p class="noindent" ><a
href="#top">Top</a><h2 class="sectionHead"></p><h3 class="sectionHead"><span class="titlemark">9 </span> <a
id="sec:moreinfo"></a>Further Information</h3>
<!--l. 2073--><p class="noindent" >Further information can be found in the main <span
class="cmss-10">glossaries</span><a
id="dx1-10001"></a> <a
href="glossaries-user.html" >user manual</a> or in the
<a
href="http://www.dickimaw-books.com/faqs/glossariesfaq.html" >glossaries FAQ</a>. See also the <span
class="cmss-10">glossaries-extra</span><a
id="dx1-10002"></a> package and the <span
class="cmtt-10">bib2gls</span><a
id="dx1-10003"></a> document, both
of which can be found on CTAN (<a
href="http://ctan.org/pkg/glossaries-extra" class="url" ><span
class="cmtt-10">http://ctan.org/pkg/glossaries-extra</span></a> and
<a
href="http://ctan.org/pkg/bib2gls" class="url" ><span
class="cmtt-10">http://ctan.org/pkg/bib2gls</span></a>). There is also an <a
href="http://www.latex-community.org/index.php?option=com_content&view=article&id=263:glossaries-nomenclature-lists-of-symbols-and-acronyms&catid=55:latex-general&Itemid=114" >article on the glossaries and
glossaries-extra packages</a> on the <a
href="http://www.latex-community.org/" ><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> Community’s</a> Know How section and
a chapter on the <span
class="cmss-10">glossaries</span><a
id="dx1-10004"></a> package in <a
href="http://www.dickimaw-books.com/latex/thesis/" >Using <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
class="E">E</span>X</span></span> to Write a PhD Thesis</a>.
</p><div class="footnotes"><!--l. 1031--><p class="noindent" ><span class="footnote-mark"><a
href="#fn1x0-bk" id="fn1x0"><sup class="textsuperscript">1</sup></a></span><span
class="cmr-8">deprecated, use </span><span
class="cmss-8">babel</span><a
id="dx1-5021"></a> <span
class="cmr-8">instead</span></p> </div>
</body></html>
|