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
|
% arara: pdflatex
% arara: pdflatex
% --------------------------------------------------------------------------
% the ACRO package
%
% Typeset Acronyms
%
% --------------------------------------------------------------------------
% Clemens Niederberger
% Web: https://github.com/cgnieder/acro/
% E-Mail: contact@mychemistry.eu
% --------------------------------------------------------------------------
% Copyright 2011--2021 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008/05/04 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
\PassOptionsToPackage{ngerman,latin,english}{babel}
\PassOptionsToPackage{version=3,upgrade}{acro}
\documentclass{acro-manual}
\begin{filecontents}{\jobname.bib}
@online{NewYork,
author = {Wikipedia},
title = {New York City},
urldate = {2020-04-11},
url = {http://en.wikipedia.org/wiki/New_York_City},
year = {2020}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{cnltx.bib}
% declare example acronyms
\DeclareAcronym{cd}{
short = CD ,
long = compact disc
}
\DeclareAcronym{ctan}{
short = ctan ,
long = Comprehensive \TeX\ Archive Network ,
short-format = \scshape ,
pdfstring = CTAN ,
short-acc = CTAN ,
first-style = short-long ,
single-style = short
}
\DeclareAcronym{ecu}{
short = ECU ,
long = Steuergerät ,
foreign = Electronic Control Unit ,
foreign-babel = english ,
foreign-locale = englisch
}
\DeclareAcronym{eg}{
short = e.g\acdot ,
long = for example ,
foreign = exempli gratia ,
foreign-babel = latin ,
short-format = \textit ,
foreign-format = \textit
}
\DeclareAcronym{etc}{
short = etc\acdot ,
long = et cetera ,
format = \textit ,
first-style = long ,
plural =
}
\DeclareAcronym{hadopi}{
short = HADOPI ,
long = Haute Autorit\'{e} pour la diffusion des \oe uvres et la protection des
droits sur l’Internet ,
short-definite = l'\nospace ,
long-definite = la ,
}
\DeclareAcronym{id}{
short = id ,
long = identification string ,
short-format = \scshape ,
short-acc = ID ,
pdfstring = ID ,
first-style = short
}
\DeclareAcronym{jpg}{
short = JPEG ,
sort = jpeg ,
alt = JPG ,
long = Joint Photographic Experts Group
}
\DeclareAcronym{la}{
short = LA ,
long = Los Angeles,
plural = ,
tag = city
}
\DeclareAcronym{lppl}{
short = lppl ,
long = \unexpanded{\LaTeX} Project Public License ,
short-format = \scshape ,
pdfstring = LPPL ,
short-acc = LPPL
}
\DeclareAcronym{MP}{
short = MP ,
long = Member of Parliament ,
plural-form = Members of Parliament ,
long-possessive-form = Member's of Parliament
}
\DeclareAcronym{nato}{
short = nato ,
long = Organisation des Nordatlantikvertrags ,
foreign = North Atlantic Treaty Organization ,
foreign-babel = english ,
foreign-locale = englisch ,
short-format = \scshape
}
\DeclareAcronym{ny}{
short = NY ,
long = New York ,
plural = ,
tag = city ,
cite = NewYork
}
\DeclareAcronym{pdf}{
short = pdf ,
long = Portable Document Format ,
short-format = \scshape ,
pdfstring = PDF ,
short-acc = PDF
}
\DeclareAcronym{png}{
short = PNG ,
long = Portable Network Graphics ,
first-style = short-long ,
single-style = short
}
\DeclareAcronym{PU}{
short = PU ,
long = Polyurethan ,
long-plural = e
}
\DeclareAcronym{sw}{
short = SW ,
long = Sammelwerk ,
long-plural = e ,
tag = exclude
}
\DeclareAcronym{tex.sx}{
short = \TeX.sx ,
sort = TeX.sx ,
long = \TeX{} StackExchange
}
\DeclareAcronym{ufo}{
short = UFO ,
long = unidentified flying object ,
foreign = unbekanntes Flugobjekt ,
foreign-plural-form = unbekannte Flugobjekte ,
foreign-acc-plural-form = unbekannte Flugobjekte ,
foreign-babel = ngerman ,
long-indefinite = an
}
% declare glossary terms:
\DeclareAcronym{property}{
long = A \property*{property} is an option to the second argument of the
\cs*{DeclareAcroym} command. They are options of an individual acronym if
you will. ,
tag = glossary , no-index
}
\DeclareAcronym{option}{
long = {An \option*{option} is a package option of \acro\ which must set
with \cs*{acsetup}. It \emph{cannot} be set as option to \cs*{usepackage}.
Options usually also can be set in the optional argument of \cs*{ac} and
friends.} ,
tag = glossary , no-index
}
\DeclareAcronym{load-time option}{
long = {A load-time \option*{option} is a package option of \acro\ which
\emph{must} be set as option to
\cs*{usepackage}\oarg{options}\Marg{acro}.} ,
tag = glossary , no-index
}
\DeclareAcronym{template}{
long = {A template determines how different objects of \acro\ are printed.
This includes the acronyms themselves but also for example the list of
acronyms as a whole.} ,
tag = glossary , no-index
}
\DeclareAcronym{articles}{
long = {Articles are prefixes to acronyms, usually separated with a blank.
\emph{Different types of articles are mutually exclusive.}} ,
tag = glossary , no-index
}
\DeclareAcronym{endings}{
long = {Endings are postfixes to acronyms, usually not separated from the
acronym. \emph{Different types of endings are mutually exclusive.}} ,
tag = glossary , no-index
}
\DeclareAcronym{translations}{
long = {Localisation strings which can be modified.} ,
tag = glossary , no-index
}
\newcommand*\issues{\url{https://github.com/cgnieder/acro/issues}}
\newcommand*\latin[1]{\textit{#1}}
\begin{document}
\clearpage
\part{Get started with \acro}\label{part:get-started-with}
\section{Licence}\label{sec:licence}
\license
\section{Glossary}
\printacronyms[include=glossary,template=glossary]
\section{\acro\ for the impatient}\label{sec:acro-impatient}
Acronyms are defined in the preamble via the command
\begin{commands}
\command{DeclareAcronym}[\marg{id}\marg{properties}]
where \meta{id} is a unique string to identify the acronym and
\meta{properties} is a key\slash value list of acronym properties. These
include:
\end{commands}
\begin{properties}
%% short
\propval{short}{text}\Default!
The short form of the acronym. \emph{This property is required}: an
acronym must have a short form.
%% long
\propval{long}{text}\Default!
The long form of the acronym. \emph{This property is required}: an
acronym must have a description.
\end{properties}
\begin{bewareofthedog}
In its simplest form an acronym needs a short and a long form. Please note
that both properties \emph{must} be set.
\end{bewareofthedog}
In the document acronyms are used with these commands:
\begin{commands}
\command{ac}[\marg{id}\quad\cs{Ac}\marg{id}]
\cs{ac} prints the acronym \meta{id}, the first time with full description
and every subsequent use only the abbreviated form. \cs{Ac} does the same
but uppercases the first letter -- this may be needed at the beginning of
a sentence.
\command{acs}[\marg{id}\quad\cs{Acs}\marg{id}]
\cs{acs} prints the short form of the acronym \meta{id}. \cs{Acs} does the
same but uppercases the first letter.
\command{acl}[\marg{id}\quad\cs{Acl}\marg{id}]
\cs{acl} prints the long form of the acronym \meta{id}. \cs{Acl} does the
same but uppercases the first letter.
\command{acf}[\marg{id}\quad\cs{Acf}\marg{id}]
\cs{acf} prints the full form of the acronym \meta{id}. \cs{Acf} does the
same but uppercases the first letter.
\end{commands}
Let's say you defined \acs*{cd} as follows:
\begin{sourcecode}
\DeclareAcronym{cd}{
short = CD ,
long = compact disc
}
\end{sourcecode}
Then the usage is
\begin{example}[side-by-side]
\begin{tabular}{ll}
first & \ac{cd} \\
second & \ac{cd} \\
long & \acl{cd} \\
short & \acs{cd} \\
full & \acf{cd}
\end{tabular}
\end{example}
\section{Setting options}\label{sec:setting-options}
\subsection{Load-time options}\label{sec:load-time-options}
\acro\ knows only a small set of load-time options which can be used as
argument to \cs*{usepackage}:
\begin{options}
\keychoice{version}{2,3}\Default{3}
The option allows you to use the last version prior to the update to
version~3. This may help if you don't have the time to fix issues after
upgrading to the new version.
\keybool{upgrade}\Default{true}
When this option is used \acro\ tries to give as much helpful and
meaningful warning or error messages when a deprecated or removed command,
property, or option is used. This is especially useful if you are
upgrading from version~2. The option will initially be true for a few
months after the upgrade to version~3.
\end{options}
\subsection{Setup command}\label{sec:setup-command}
All options of \acro\ that have \emph{not} been mentioned in
section~\ref{sec:load-time-options} have to be set up either with this command
\begin{commands}
\command{acsetup}[\marg{options}]
or as option to other commands. If the latter is possible then it is
described when the corresponding commands are explained. Options usually
follow a key\slash value syntax and are always described in the following
way:
\end{commands}
\begin{options}
\opt*{option}
An option without a value. Those options are very rare if there are any.
\keyval*{option}{value}\Default{preset}
An option where a value can be given. The pre-set value is given to the
right.
\keychoice*{option}{\default{choiceA},choiceB,choiceC}\Default{choiceB}
An option with a determined set of choices. The underlined value is
chosen if the option is given without value.
\keybool*{option}
A boolean option with only the choices \code{true} and \code{false}.
\opt*{option}\Module{module}
An option at a deeper level belonging to the module \module*{module}.
\end{options}
All of the above is probably clear from an example (using real options):
\begin{sourcecode}
\acsetup{
make-links = true , % boolean
index , % boolean
format = \emph , % standard
list / local , % boolean option of the list module
list / display = all % choice option of the list module
}
\end{sourcecode}
\part{Comprehensive description of creation and usage of acronyms}\label{part:compr-descr-creat}
\section{Declaring acronyms and other abbreviations}\label{sec:decl-acronyms-other}
All acronyms have to be declared in the preamble with the following command in
order to be used in the document. Any usage of an acronym which has not been
declared leads to an error message.
\begin{commands}
\command{DeclareAcronym}[\marg{id}\marg{list of properties}]
The basic command for declaring an acronym where \meta{id} is a unique
string identifying the acronym. Per default this is case sensitive which
means \code{id} is different from \code{ID}, for example.
\end{commands}
The command understands a number of properties which are listed in the
following sections. This is a comprehensive overview over the existing
properties. Many properties are also explained in more detail in later
sections of this manual.
\begin{options}
\keybool{case-sensitive}\Default{false}
When this is set you can write the \ac{id} of the acronym upper- or lower-
or mixed case and it is recognized by \acro\ as the same. This might be
useful when the acronym appears in the page header, for example.
\end{options}
\begin{bewareofthedog}
In its simplest form an acronym needs a short and a long form. Please note
that both properties \emph{must} be set.
\end{bewareofthedog}
\subsection{Basic properties}\label{sec:basic-properties}
\begin{properties}
%% short
\propval{short}{text}\Default!
The short form of the acronym. \emph{This property is required}: an
acronym must have a short form.
\end{properties}
Maybe you mostly have simple acronyms where the \ac{id} and short form are
the same. In that case you can use
\begin{options}
\keybool{use-id-as-short}\Default{false}
to use the \ac{id} of the acronym as short form. For more complicated
cases this would still allow you to set the short form.
\end{options}
\begin{properties}
%% long
\propval{long}{text}\Default!
The long form of the acronym. \emph{This property is required}: an
acronym must have a description.
%% alt
\propval{alt}{text}\Default
Alternative short form.
%% extra
\propval{extra}{text}\Default
Extra information to be added in the list of acronyms.
%% foreign
\propval{foreign}{long form in foreign language}\Default
Can be useful when dealing with acronyms in foreign languages, see
section~\vref{sec:fore-lang-acronyms} for details.
%% long-post
\propval{long-post}{text}\Default
\meta{text} is appended to the long form of the acronym in the text but
not in the list of acronyms.
%% post
\propval{post}{text}\Default
\meta{text} is appended to the acronym in the text but not in the list of
acronyms.
%% single
\propval{single}{text}\Default={long}
If provided \meta{text} will be used instead of the long form if the
acronym is only used a single time \emph{and} the option
\option{single} has been set, see section~\vref{sec:single-appe-an}.
%% sort
\propval{sort}{text}\Default={short}
If used the acronym will be sorted according to this property instead of
its short form.
%% tag
\propval{tag}{csv list}\Default
The tag(s) of an acronym.
%% cite
\proplit-{cite}{\oarg{prenote}\oarg{postnote}\marg{citation keys}}\Default
A citation that is printed to the acronym according to an option explained
later.
%% before-citation
\propval{before-citation}{text}\Default
\meta{text} is prepended to the citation of the acronym when and where
the citation is printed.
%% index
\propval{index}{text}\Default
This property allows to overwrite the automatic index entry with an
arbitrary one. See section~\vref{sec:indexing} for details.
%% index-sort
\propval{index-sort}{text}\Default={sort}
If you use the option \option{index} every occurrence of an acronym is
recorded to the index and sorted by its short form or (if set) by the
value of the \property{sort} property. This property allows to set an
individual sorting option for the index. See section~\vref{sec:indexing}
for details.
%% index-cmd
\propval{index-cmd}{index command}\Default
This sets the indexing command for the acronym. If unused then the
command set by the corresponding option is used. See
section~\vref{sec:indexing} for details.
\end{properties}
\subsection{Properties related to plural and indefinite forms}\label{sec:prop-relat-plur}
\begin{properties}
%% short-plural
\propval{short-plural}{text}\Default{s}
The plural ending appended to the short form.
%% short-plural-form
\propval{short-plural-form}{text}\Default
The plural short form of the acronym; replaces the short form when used
instead of appending the plural ending.
%% long-plural
\propval{long-plural}{text}\Default{s}
The plural ending appended to the long form.
%% long-plural-form
\propval{long-plural-form}{text}\Default
Plural long form of the acronym; replaces the long form when used
instead of appending the plural ending.
%% alt-plural
\propval{alt-plural}{text}\Default{s}
The plural ending appended to the alternative form.
%% alt-plural-form
\propval{alt-plural-form}{text}\Default
The plural alternative form of the acronym; replaces the alternative form
when used instead of appending the plural ending.
%% foreign-plural
\propval{foreign-plural}{text}\Default{s}
The plural ending appended to the foreign form.
%% foreign-plural-form
\propval{foreign-plural-form}{text}\Default
Plural foreign form of the acronym; replaces the foreign form when used
instead of appending the plural ending.
%% short-indefinite
\propval{short-indefinite}{text}\Default{a}
Indefinite article for the short form.
%% long-indefinite
\propval{long-indefinite}{text}\Default{a}
Indefinite article for the long form.
%% alt-indefinite
\propval{alt-indefinite}{text}\Default{a}
Indefinite article for the alternative form.
\end{properties}
\subsection{Properties related to formatting}\label{sec:prop-relat-form}
\begin{properties}
\propval{format}{code}\Default
The format used for both short and long form of the acronym.
%% short-format
\propval{short-format}{code}\Default={format}
The format used for the short form of the acronym.
%% long-format
\propval{long-format}{code}\Default={format}
The format used for the long form of the acronym.
%% first-long-format
\propval{first-long-format}{code}\Default={long-format}
The format used for the first appearance of the long form of the acronym.
%% alt-format
\propval{alt-format}{code}\Default={short-format}
The format used for the alternative form of the acronym. If this is not
given the short format will be used.
%% extra-format
\propval{extra-format}{code}\Default
The format used for the additional information of the acronym.
%% foreign-format
\propval{foreign-format}{code}\Default
The format used for the foreign form of the acronym.
%% single-format
% \propval{single-format}{code}\Default={long-format}
% The format used for the acronym if the acronym is only used a single
% time.
%% list-format
\propval{list-format}{code}\Default={long-format}
The format used for the long form of the acronym in the list if the list
template supports it. All pre-defined list templates \emph{do} support
it.
%% first-style
\propchoice{first-style}{long-short,short-long,short,long,footnote}\Default
The style of the first appearance of the acronym, see also
section~\vref{sec:first-or-full}.
%% first-style
\propchoice{subsequent-style}{long-short,short-long,short,long,footnote}\Default
\sinceversion{3.4}The style of the appearance of the acronym after the
first time.
%% single-style
\propchoice{single-style}{long-short,short-long,short,long,footnote}\Default
The style of a single appearance of the acronym, see also
section~\vref{sec:single-appe-an}.
\end{properties}
\subsection{Properties related to the created \acs*{pdf} file}\label{sec:prop-relat-creat}
\begin{properties}
%% pdfstring
\propval{pdfstring}{pdfstring}\Default={short}
Used as \acs{pdf} string replacement in bookmarks when used together with
the \pkg{hyperref}~\cite{pkg:hyperref} or the \pkg{bookmark}
package~\cite{pkg:bookmark}.
%% pdfcomment
\propval{pdfcomment}{text}
Sets a tooltip description for an acronym. For actually getting
tooltips you also need an appropriate setting of the options
\option{pdfcomment/cmd} and \option{pdfcomment/use}, see also
section~\vref{sec:pdf-comments}.
%% short-acc
\propval{short-acc}{text}\Default={short}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the short form of the acronym.
%% long-acc
\propval{long-acc}{text}\Default={long}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the long form of the acronym.
%% alt-acc
\propval{alt-acc}{text}\Default={alt}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the alternative short form of the acronym.
%% foreign-acc
\propval{foreign-acc}{text}\Default={foreign}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the foreign form of the acronym.
%% extra-acc
\propval{extra-acc}{text}\Default={extra}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the extra information of the acronym.
%% single-acc
\propval{single-acc}{text}\Default={long-acc}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for a single appearance of the acronym.
%% list-acc
\propval{list-acc}{text}\Default={list}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the appearance in the list of acronyms.
\end{properties}
\subsection{Futher properties}\label{sec:futher-properties}
\begin{properties}
%% list
\propval{list}{text}\Default={long}
If specified this will be written in the list as description instead of
the long form if the corresponding list template supports it.
%% foreign-babel
\propval{foreign-babel}{language}\Default
The \pkg{babel}~\cite{pkg:babel} or
\pkg{polyglossia}~\cite{pkg:polyglossia} language of the foreign form.
This language is used to wrap the entry with
\cs*{foreignlanguage}\marg{language} if either \pkg{babel} or
\pkg{polyglossia} is loaded. You'll need to take care that the
corresponding language is loaded by \pkg{babel} or \pkg{polyglossia}.
%% foreign-locale
\propval{foreign-locale}{language}\Default
The language name that is output when the option
\module{locale}\code{/}\option{display} is used. If this property is not
set then the appropriate value might be derived from
\property{foreign-babel}. See section~\vref{sec:fore-lang-acronyms} for
details.
%% preset
\propval{preset}{set name}\Default
\sinceversion{3.5}Enables to load a set of properties that has been
defined earlier with \cs{NewAcroPreset}, siehe
section~\vref{sec:presets}.
%% uselist
\propval{uselist}{csv list of acronym ids}\Default
\sinceversion{3.5}If this property is given and all acronyms specified in
this property have been used before the first time the current acronym is
used it behaves as if it has been used before.
\end{properties}
\subsection{Presets}\label{sec:presets}
\sinceversion{3.5}Sometimes it can be useful to have different kinds of
acronyms or abbreviations or similar which share a common set of properties.
Such sets can be defined with these commands:
\begin{commands}
\command{NewAcroPreset}[\marg{set name}\marg{csv list of properties}]
Defines the property set \meta{set name}. Any valid property can be set
in \meta{csv list of properties}.
\command{RenewAcroPreset}[\marg{set name}\marg{csv list of properties}]
Redefines the property set \meta{set name}.
\command{DeclareAcroPreset}[\marg{set name}\marg{csv list of properties}]
Defines or redefines the property set \meta{set name} without checking.
\end{commands}
\section{Using acronyms}\label{sec:using-acronyms}
There are a number of commands to use acronyms with. Their names always follow
the same pattern which should make their usage intuitive immediately.
All of these commands have a starred form which means \enquote{don't count
this as usage}. All of these commands also have an optional argument that
allows to set options for that usage only.
\begin{commands}
\command*{acrocommand}[\sarg\oarg{options}\marg{id}]
This is the general syntax of all of the commands listed below. The star
and the optional argument is left way for the sake of readability.
\emph{A command \cs*{acrocommand} does not actually exist.}
\command{ac}[\marg{id}\quad\cs{Ac}\marg{id}\quad\cs{acp}\marg{id}\quad
\cs{Acp}\marg{id}\quad\cs{iac}\marg{id}\quad\cs{Iac}\marg{id}]
\cs{ac} prints the acronym \meta{id}, the first time with full description
and every subsequent use only the abbreviated form. \cs{Ac} does the same
but uppercases the first letter -- this may be needed at the beginning of
a sentence. The commands \cs{acp} and \cs{Acp}, resp., print the
corresponding plural forms. The commands \cs{iac} and \cs{Iac}, resp.,
print indefinite forms.
\command{acs}[\marg{id}\quad\cs{Acs}\marg{id}\quad\cs{acsp}\marg{id}\quad
\cs{Acsp}\marg{id}\quad\cs{iacs}\marg{id}\quad\cs{Iacs}\marg{id}]
\cs{acs} prints the short form of the acronym \meta{id}. \cs{Acs} does the
same but uppercases the first letter. The commands \cs{acsp} and
\cs{Acsp}, resp., print the corresponding plural forms. The commands
\cs{iacs} and \cs{Iacs}, resp., print indefinite forms.
\command{acl}[\marg{id}\quad\cs{Acl}\marg{id}\quad\cs{aclp}\marg{id}\quad
\cs{Aclp}\marg{id}\quad\cs{iacl}\marg{id}\quad\cs{Iacl}\marg{id}]
\cs{acl} prints the long form of the acronym \meta{id}. \cs{Acl} does the
same but uppercases the first letter. The commands \cs{aclp} and
\cs{Aclp}, resp., print the corresponding plural forms. The commands
\cs{iacl} and \cs{Iacl}, resp., print indefinite forms.
\command{aca}[\marg{id}\quad\cs{Aca}\marg{id}\quad\cs{acap}\marg{id}\quad
\cs{Acap}\marg{id}\quad\cs{iaca}\marg{id}\quad\cs{Iaca}\marg{id}]
\cs{aca} prints the alternative short form of the acronym \meta{id}.
\cs{Aca} does the same but uppercases the first letter. The commands
\cs{acap} and \cs{Acap}, resp., print the corresponding plural forms. The
commands \cs{iaca} and \cs{Iaca}, resp., print indefinite forms.
\command{acf}[\marg{id}\quad\cs{Acf}\marg{id}\quad\cs{acfp}\marg{id}\quad
\cs{Acfp}\marg{id}\quad\cs{iacf}\marg{id}\quad\cs{Iacf}\marg{id}]
\cs{acf} prints the full form of the acronym \meta{id}. \cs{Acf} does the
same but uppercases the first letter. The commands \cs{acfp} and
\cs{Acfp}, resp., print the corresponding plural forms. The commands
\cs{iacf} and \cs{Iacf}, resp., print indefinite forms.
\end{commands}
The usage should be clear. Let's assume you have defined an acronym
\acs*{ufo}\label{ufo} like this:
\begin{sourcecode}
\DeclareAcronym{ufo}{
short = UFO ,
long = unidentified flying object ,
foreign = unbekanntes Flugobjekt ,
foreign-plural-form = unbekannte Flugobjekte ,
foreign-babel = ngerman ,
long-indefinite = an
}
\end{sourcecode}
The typical outputs look like this:
\begin{example}
\ac{ufo} \\
\iac{ufo} \\
\iacl{ufo} \\
\Iacf{ufo} \\
\acfp{ufo}
\end{example}
\begin{bewareofthedog}
In a number of contexts all acronym commands act as if their starred form is
used: in the table of contents, in the list of figures, and in the list of
tables. The same is true for floats and the measuring phase of common
table environments like \env*{tabularx} or \env*{ltxtable}.
\end{bewareofthedog}
\section{Alternative short forms}\label{sec:altern-short-forms}
Sometimes expressions have two different short forms. And example might be
\acs*{jpg} which also often is \aca*{jpg}. This is what the property
\property{alt} is there for.
\begin{properties}
\propval{alt}{text}
Alternative short form.
\end{properties}
Let's define \acs*{jpg}:
\begin{sourcecode}
\DeclareAcronym{jpg}{
short = JPEG ,
sort = jpeg ,
alt = JPG ,
long = Joint Photographic Experts Group
}
\end{sourcecode}
And let's see how to use it:
\begin{example}
\ac{jpg} \\
\ac{jpg} \\
\aca{jpg}
\end{example}
As you can see the full form shows both short forms of the acronym. This could
be changed by altering the template for the full form, see
section~\vref{sec:templates} and section~\vref{sec:first-or-full}. The
alternative form is also printed in the list of acronyms, see
section~\vref{sec:acronyms}. This can also be changed by altering the
template for the list, again see section~\ref{sec:templates}.
\section{The first or full appearance}\label{sec:first-or-full}
If an acronym is used for the first time with \cs{ac} (after any number of
usages with the starred forms of the usage commands listed in
section~\vref{sec:using-acronyms}) or if an acronym is used \cs{acf}, then the
first or full appearance of the acronym is printed\footnote{This usually
requires at least two \LaTeX\ runs until it is stable.}.
The first or full appearance of an acronym is determined by this option:
\begin{options}
\keychoice{first-style}{long-short,short-long,short,long,footnote}\Default{long-short}
The style of the first appearance of the acronym. This options sets the
appearance for all acronyms. Available options in reality are the names
of all defined templates of the type \code{acronym}. All pre-defined
templates can be found in section~\vref{sec:pre-defin-templ}.
\keychoice{subsequent-style}{long-short,short-long,short,long,footnote}\Default{short}
\sinceversion{3.4}The style of the appearance of the acronym after the
first time. This options sets the appearance for all acronyms. Available
options in reality are the names of all defined templates of the type
\code{acronym}. All pre-defined templates can be found in
section~\vref{sec:pre-defin-templ}.
\end{options}
It might be desirable to set the first appearance of an acronym
individually. This is possible by setting the corresponding property:
\begin{properties}
\propchoice{first-style}{long-short,short-long,short,long,footnote}\Default
The style of the first appearance of the acronym.
\end{properties}
Let's again look at an example:
\begin{example}[side-by-side]
\acf[first-style=long-short]{cd} \\
\acf[first-style=short-long]{cd} \\
\acf[first-style=footnote]{cd} \\
\acf[first-style=long]{cd} \\
\acf[first-style=short]{cd}
\end{example}
This also demonstrates the use of the optional argument.
An example of an abbreviation that should have \code{long} as first appearance
might be \enquote{\acs*{etc}}, defined like this
\begin{sourcecode}
\DeclareAcronym{etc}{
short = etc\acdot ,
long = et cetera ,
format = \textit ,
first-style = long ,
plural =
}
\end{sourcecode}
and output like this:
\begin{example}[side-by-side]
\ac{etc}, \ac{etc} \ac{etc}.
\end{example}
The command \cs{acdot} is explained in section~\vref{sec:trailing-tokens}.
Basically it checks if a dot follows and outputs a dot if not.
\section{Single appearances of an acronym}\label{sec:single-appe-an}
If an acronym is used only once (not counting usages with the starred forms of
the usage commands listed in section~\vref{sec:using-acronyms}), then the
single appearance of the acronym is printed\footnote{This usually requires at
least two \LaTeX\ runs until it is stable.}.
The single appearance of an acronym is determined by this option:
\begin{options}
\keychoice{single}{\default{true},false,\meta{number}}\Default{false}
This option determines wether a single appearance of an acronym counts as
\emph{usage}. It might be desirable in such cases that an acronym is
simply printed as long form and not added to the list of acronym. This is
what this option does. With \meta{number} the minimal number of usages
can be given that needs to be exceeded. \keyis{single}{1} is the same as
\keyis{single}{true}.
\keychoice{single-style}{long-short,short-long,short,long,footnote}\Default{long}
The style of the single appearance of an acronym. Can be used to
determine how a single appearance is printed if the option \option{single}
has been set. This option sets the appearance for all acronyms.
Available options in reality are the names of all defined templates of the
type \code{acronym}. All pre-defined templates can be found in
section~\vref{sec:pre-defin-templ}.
\end{options}
If you like you can also set the single appearance of an acronym individually:
\begin{properties}
\propval{single}{text}\Default
If provided \meta{text} will be used instead of whatever template
(\enquote{style}) has been set for the single appearance if the acronym is
only used a single time \emph{and} the option \option{single} has been
set\footnote{Actually the template \template{single} is used which
typesets the \property{single} property.}.
% \propval{single-format}{code}\Default={long-format}
% The format used for the acronym if the acronym is only used a single
% time.
\propchoice{single-style}{long-short,short-long,short,long,footnote}\Default
The style of the single appearance of the acronym.
\end{properties}
Let's again look at an example. The acronym \acs*{png} is defined as follows:
\begin{sourcecode}
\DeclareAcronym{png}{
short = PNG ,
long = Portable Network Graphics ,
first-style = short-long ,
single-style = short
}
\end{sourcecode}
And it is used only once in this manual\footnote{You will find it in the list
of acronyms in section~\ref{sec:acronyms} nonetheless as this document does
\keyis{list/display}{all}.}:
\begin{example}[side-by-side]
\ac{png}
\end{example}
Please be aware that \cs{acf} would still print the full form, of course.
\section{Printing the list}\label{sec:printing-list}
\subsection{The main command and its options}\label{sec:main-list}
The main idea is simple: just place
\begin{commands}
\command{printacronyms}[\oarg{options}]
where you want the list to appear. It may require several (most times
two) \LaTeX\ runs for it to stabilize so look out for any warnings
from \acro\ requiring to re-run.
\end{commands}
The options controlling the list are these:
\begin{options}
\keychoice{template}{description,table,longtable,lof,toc}%
\Module{list}\Default{description}
Choose the template to create the list with. See more on this in
sections~\vref{sec:templates} and~\vref{sec:examples}.
\keybool{sort}\Module{list}\Default{true}
Decide wether to sort the list of acronyms alphabetically or to print it
in order of definition.
\keychoice{display}{all,used}\Module{list}\Default{used}
Decide wether to print only the acronyms actually used in the document or
all acronyms which have been declared in the preamble.
\keyval{exclude}{csv list of tags}\Module{list}\Default
Set a list of tags to exclude from the list. Only acronyms not
belonging to one of these tags will be included.
\keyval{include}{csv list of tags}\Module{list}\Default
Set a list of tags to include in the list. Only acronyms belonging to
one of these tags will be included.
\keybool{add}\Module{list}\Default
\sinceversion{3.4}Set a list of tags to include in the list. These
acronyms will be included in any case.
\keychoice{heading}{none,section,section*,chapter,chapter*}\Module{list}
Choose the heading template for the list of acronyms.
This only has an effect if the list template supports it. All pre-defined
templates \emph{do} support it.
\keyval{name}{text}\Module{list}\Default{\cs{acrotranslate}\Marg{list-name}}
Overwrites the text which is used in the heading.
This only has an effect if the list template supports heading templates
\emph{and} the heading templates support it. All pre-defined heading
templates \emph{do} support this.
\keyval{preamble}{text}\Module{list}\Default
Set a preamble to be placed between heading and actual list.
This only has an effect if the list template supports it. All pre-defined
templates \emph{do} support it.
\keybool{display}\Module{list,locale}\Default{false}
This options determines wether the language of the foreign form is printed
or not.
This only has an effect if the list template supports foreign forms. All
pre-defined templates \emph{do} support them.
\end{options}
All these options can be set with \cs{acsetup} globally or locally as options
to \cs{printacronyms}. In the latter case omit the leading
\module{list}:
\begin{sourcecode}
\acsetup{list/display=all,list/exclude=units}
or
\printacronyms[display=all,exclude=units]
\end{sourcecode}
\subsection{Add page numbers to the list}\label{sec:page-numbers}
If you want to include the page numbers where the acronyms have been used in
the list of acronym you can use these options:
\begin{options}
\keychoice{display}{first,all,none}\Module{pages}\Default{none}
Decide wether to include page numbers in the list of acroynms and wether
to add the first page or every page. When you choose \code{first} and
have \pkg{hyperref} loaded you will also get a backlink to that page.
\keybool{use}\Module{pages,seq}\Default{true}
Turns a two-page range into \meta{num}\,f.\ (\latin{sequens}) and a
three-page range into \meta{num}\,ff.\ (\latin{sequentes}) when set to
\code{true}.
\keyval{pre}{code}\Module{pages,seq}\Default{\cs*{,}}
\meta{code} is inserted between the page number and the sequens or
sequentes symbol.
\keyval{threshold}{num}\Module{pages,seq}\Default{3}
The threshold for a page range to be turned into \latin{sequentes}. A
page range above the threshold is still typeset as a range:
\meta{num1}--\meta{num2}.
\keyval{fill}{code}\Module{pages}\Default{\cs*{acrdotfill}}
This is the code that is placed between acronym description and actual
page numbers.
\keybool{name}\Module{pages}\Default{false}
If set to true the page numbers are preceded with p.\ or pp.
\end{options}
\begin{commands}
\command{acrodotfill}
\sinceversion{3.5}Creates a dotted line like those in the table of
contents. If the macro \cs*{cftdotfill} is defined it is equal to
\cs*{cftdotfill}\Marg{\cs*{cftdotsep}}.
\end{commands}
Additionally\sinceversion{3.3} to setting these options with \cs{acsetup} they
can be set as options to \cs{printacronyms}:
\begin{sourcecode}
\printacronyms[pages={display=all,seq/use=false}]
\end{sourcecode}
\subsection{Filter lists using tags}\label{sec:lists-tags}
With the property \property{tag} you can assign one or more tags to an
acronym. These tags can be used to filter the list of acronyms.
\begin{properties}
%% tag
\propval{tag}{csv list}\Default
The tag(s) of an acronym.
\end{properties}
\begin{options}
\keyval{exclude}{csv list of tags}\Module{list}\Default
Set a list of tags to exclude from the list. Only acronyms not
belonging to one of these tags will be included.
\keyval{include}{csv list of tags}\Module{list}\Default
Set a list of tags to include in the list. Only acronyms belonging to
one of these tags will be included.
\end{options}
Let's look at an example. This manual declares these two acronyms with the tag
\code{city}:
\begin{sourcecode}
\DeclareAcronym{la}{
short = LA ,
long = Los Angeles,
plural = ,
tag = city
}
\DeclareAcronym{ny}{
short = NY ,
long = New York ,
plural = ,
tag = city
}
\end{sourcecode}
We can now use this to either print a list \emph{without} these acronyms by
saying
\begin{sourcecode}
\printacronyms[exclude=city]
\end{sourcecode}
or print a list \emph{with only} these acronyms with
\begin{example}
\printacronyms[include=city,heading=none]
\end{example}
\begin{bewareofthedog}
If you use both \option{exclude} and \option{include} and list a tag in both
\option{exclude} takes precedence over \option{include}.
\begin{sourcecode}
\printacronyms[exclude={a,b},include={b,c}]
\end{sourcecode}
would only print acronyms with tag \code{c}.
\end{bewareofthedog}
\subsection{Local lists}\label{sec:local-lists}
Maybe you like a list of acronyms for each chapter in a book which only lists
the acronyms used within this chapter. You need to do three things: set
\begin{options}
\keybool{use}\Module{barriers}\Default{false}
this option to \code{true}, place
\end{options}
\begin{commands}
\command{acbarrier}
before a new chapter starts (this is not necessary for the first chapter),
and use \cs{printacronyms} with the option
\end{commands}
\begin{options}
\keybool{local}\Module{list}\Default{false}
or set this option once in the preamble with \cs{acsetup} so it is applied
to every list.
\end{options}
Please read more on barriers in section~\vref{sec:barriers}.
\begin{bewareofthedog}
Please don't use page numbers together with local lists for the time being.
If an acronym appears in more than one list both lists would contain the
\emph{same} page numbers anstead of only the ones local to barriers.
For the similar reasons please also don't use \option{make-links} together
with local lists.
This \emph{might} be resolved on day.
\end{bewareofthedog}
\section{Formatting}\label{sec:formatting}
\acro\ has a number of options and parameters which can be used to influence
the formatting of acronyms.
\begin{options}
\keyval{format}{code}\Default
Sets the format for both the short and the long form.
\keyval{short}{code}\Module{format}\Default
Sets the format for the short form.
\keyval{long}{code}\Module{format}\Default
Sets the format for the long form.
\keyval{first-long}{code}\Module{format}\Default
Sets the format for the first appearance of the long form.
\keyval{alt}{code}\Module{format}\Default
Sets the format for the alternative form.
\keyval{extra}{code}\Module{format}\Default
Sets the format for the extra information.
\keyval{foreign}{code}\Module{format}\Default
Sets the format for the foreign form.
\keyval{list}{code}\Module{format}\Default
Sets the format for the long form in the list form.
\end{options}
While this options influence the formatting of the acronyms globally you can
also give each acronym its own formatting individually:
\begin{properties}
\propval{format}{code}\Default
The format used for both short and long form of the acronym.
%% short-format
\propval{short-format}{code}\Default={format}
The format used for the short form of the acronym.
%% long-format
\propval{long-format}{code}\Default={format}
The format used for the long form of the acronym.
%% first-long-format
\propval{first-long-format}{code}\Default={long-format}
The format used for the first appearance of the long form of the acronym.
%% alt-format
\propval{alt-format}{code}\Default={short-format}
The format used for the alternative form of the acronym. If this is not
given the short format will be used.
%% extra-format
\propval{extra-format}{code}\Default
The format used for the additional information of the acronym.
%% foreign-format
\propval{foreign-format}{code}\Default
The format used for the foreign form of the acronym.
%% single-format
\propval{single-format}{code}\Default={long-format}
The format used for the acronym if the acronym is only used a single
time.
%% list-format
\propval{list-format}{code}\Default={long-format}
The format used for the long form of the acronym in the list if the list
template supports it. All pre-defined list templates \emph{do} support
it.
%% first-style
\propchoice{first-style}{long-short,short-long,short,long,footnote}\Default
The style of the first appearance of the acronym, see also
section~\vref{sec:first-or-full}.
%% single-style
\propchoice{single-style}{long-short,short-long,short,long,footnote}\Default
The style of a single appearance of the acronym, see also
section~\vref{sec:single-appe-an}.
\end{properties}
Per\changedversion{3.3} default the individual formatting instructions
\emph{replace} the global ones. This can be changed through the option
\begin{options}
\keybool{replace}\Module{format}\Default{true}
With this option active local options will \emph{replace} the global
ones.
\end{options}
Let's see an example:
\begin{sourcecode}
\DeclareAcronym{pdf}{
short = pdf ,
long = Portable Document Format ,
short-format = \scshape
}
\end{sourcecode}
\begin{example}
\acsetup{format = \itshape}
\acf{pdf} \par
\acsetup{format/replace=false}
\acf{pdf}
\end{example}
\section{Plural forms and other endings}\label{sec:plural-forms-other}
\subsection{The plural ending and the plural form}\label{sec:plural-ending-form}
Not in all languages plural forms are as easy as always appending an
\enquote{s}. Not even English. Sometimes there's other endings
instead\footnote{German is full of such examples.}. This is why \acro\ has
quite a number of different properties related to plural forms or endings:
\begin{properties}
%% short-plural
\propval{short-plural}{text}\Default{s}
The plural ending appended to the short form.
%% short-plural-form
\propval{short-plural-form}{text}\Default
The plural short form of the acronym; replaces the short form when used
instead of appending the plural ending.
%% long-plural
\propval{long-plural}{text}\Default{s}
The plural ending appended to the long form.
%% long-plural-form
\propval{long-plural-form}{text}\Default
Plural long form of the acronym; replaces the long form when used
instead of appending the plural ending.
%% alt-plural
\propval{alt-plural}{text}\Default{s}
The plural ending appended to the alternative form.
%% alt-plural-form
\propval{alt-plural-form}{text}\Default
The plural alternative form of the acronym; replaces the alternative form
when used instead of appending the plural ending.
%% foreign-plural
\propval{foreign-plural}{text}\Default{s}
The plural ending appended to the foreign form.
%% foreign-plural-form
\propval{foreign-plural-form}{text}\Default
Plural foreign form of the acronym; replaces the foreign form when used
instead of appending the plural ending.
\end{properties}
There are two options which allow to change the default values for the whole
document:
\begin{options}
\keyval{short-plural-ending}{text}\Default{s}
Defines the plural ending for the short forms to be \meta{text}.
\keyval{long-plural-ending}{text}\Default{s}
Defines the plural ending for the long forms to be \meta{text}.
\end{options}
Now let's see two simple examples demonstrating the two different kinds of plural
settings:
\begin{sourcecode}
\DeclareAcronym{sw}{
short = SW ,
long = Sammelwerk ,
long-plural = e
}
\DeclareAcronym{MP}{
short = MP ,
long = Member of Parliament ,
plural-form = Members of Parliament
}
\end{sourcecode}
The first one has another plural ending than the usual \enquote{s}. The second
one has a different plural form altogether because appending an \enquote{s}
would give a wrong form:
\begin{example}[side-by-side]
\acfp{sw} \par
\acfp{MP}
\end{example}
\subsection{Other endings}\label{sec:other-endings}
Besides plural endings there are other ones like the genitive case, for
example. This is why \acro\ generalized the concept.
Section~\vref{sec:endings} explains in detail how to define and use additional
endings.
\section{Articles}
\subsection{Indefinite forms}\label{sec:indefinite-forms}
Indefinite forms can be a problem if the short and the long form of acronyms
have different indefinite articles\footnote{This may very well be a language
specific issue.}.
\begin{example}[side-by-side]
\acreset{ufo}%
a \ac{ufo} \par
an \ac{ufo}
\end{example}
And what good would it be to use a package like \acro\ if you have to keep
track of first and second uses, anyway? This is why \acs{ufo} should be defined
like we did on page~\pageref{ufo}. We then can just use the dedicated
commands and let them decide for us:
\begin{example}[side-by-side]
\acreset{ufo}%
\iac{ufo} \par
\iac{ufo}
\end{example}
The commands which also output the indefinite article all start with an
\enquote{i} and have all been described in section~\vref{sec:using-acronyms}
already: \cs{iac}, \cs{Iac}, \cs{iacs}, \cs{Iacs}, \cs{iacl}, \cs{Iacl},
\cs{iaca}, \cs{Iaca}, \cs{iacf}, and \cs{Iacf}.
\subsection{Other articles}\label{sec:other-articles}
There might be cases -- most likely depending on your language -- when you
would like to have other articles behaving similar to the indefinite ones.
Section~\ref{sec:articles} explains in detail how to define and use additional
articles.
\section{Foreign language acronyms}\label{sec:fore-lang-acronyms}
Sometimes and in some fields more often than in others abbreviations are used
that are derived from another language. \acro\ provides a number of
properties for such cases:
\begin{properties}
%% foreign
\propval{foreign}{long form in foreign language}\Default
Can be useful when dealing with acronyms in foreign languages, see
section~\vref{sec:fore-lang-acronyms} for details.
%% foreign-plural
\propval{foreign-plural}{text}\Default{s}
The plural ending appended to the foreign form.
%% foreign-plural-form
\propval{foreign-plural-form}{text}\Default
Plural foreign form of the acronym; replaces the foreign form when used
instead of appending the plural ending.
%% foreign-format
\propval{foreign-format}{code}\Default
The format used for the foreign form of the acronym.
%% foreign-babel
\propval{foreign-babel}{language}\Default
The \pkg{babel} or \pkg{polyglossia} language of the foreign form. This
language is used to wrap the entry with
\cs*{foreignlanguage}\marg{language} if either \pkg{babel} or
\pkg{polyglossia} is loaded. You'll need to take care that the
corresponding language is loaded by \pkg{babel} or \pkg{polyglossia}.
%% foreign-locale
\propval{foreign-locale}{language}\Default
The language name that is output when the option
\module{locale}\code{/}\option{display} is used. If this property is not
set then the appropriate value might be derived from
\property{foreign-babel}.
\end{properties}
There are also some options:
\begin{options}
\keybool{display}\Module{foreign}\Default{true}
Determine wether to hide or display the foreign form.
\keybool{display}\Module{list,foreign}\Default{true}
\sinceversion{3.2}Determine wether to hide or display the foreign form in
the list of acronyms.
\keybool{display}\Module{locale}\Default{false}
This options determines wether the language of the foreign form is printed
or not when the full form of the acronym is printed.
\keybool{display}\Module{list,locale}\Default{false}
The same but for the list of acronyms.
\keyval{format}{code}\Module{locale}\Default{\cs*{em}\cs*{text\_titlecase\_first:n}}
Determines how said language is formatted when printed. The last command
in \meta{code} may take a mandatory argument.
\end{options}
Let's say you are writing a German document and are using the abbreviation
\acs*{ecu} for \acl*{ecu} which stems from the English \enquote{Electronic
Control Unit}. Then you can define it as follows:
\begin{sourcecode}
\DeclareAcronym{ecu}{
short = ECU ,
long = Steuergerät ,
foreign = Electronic Control Unit ,
foreign-babel = english ,
foreign-locale = englisch
}
\end{sourcecode}
Now the abbreviation is introduced so that everyone understands the confusion:
\begin{example}
\ac{ecu} \par
\acsetup{locale/display,locale/format=\emph}
\acf{ecu}
\end{example}
The property \property{foreign-babel} is used for ensuring correct hyphenation
as long as you use \pkg{babel} or \pkg{polyglossia} and load the corresponding
language, too. If you are writing your document in English then \acro\ is
able to deduce the language used for the \enquote{locale} field by itself:
\begin{sourcecode}
\DeclareAcronym{eg}{
short = e.g\acdot ,
long = for example ,
foreign = exempli gratia ,
foreign-babel = latin ,
short-format = \textit ,
foreign-format = \textit
}
\end{sourcecode}
\begin{example}
\acsetup{locale/display,first-style=short-long}
\acf{eg}
\end{example}
\section{Uppercasing}\label{sec:uppercasing}
Depending on the kind of abbreviations you have and depending on their
definition and maybe also depending on your language the long and sometimes
also the short forms need to start with an uppercase letter at the beginning
of a sentence while it starts with a lowercase letter otherwise.
For this \acro\ provides uppercase versions for all predefined acronym
commands listed in section~\ref{sec:using-acronyms}. The usage is
self-explaining:
\begin{example}
There was \iacl{ufo} hovering \dots \par
\Aclp{ufo} were hovering \dots
\end{example}
If you defined them with uppercase letters to begin with then these commands
have no effect, of course.
\begin{sourcecode}
\DeclareAcronym{ufo}{
short = UFO ,
long = Unidentified Flying Object
}
\end{sourcecode}
% \pagebreak
There are a number of options to control the uppercasing behavior:
\begin{options}
\opt{first}\Module{uppercase}
The default setting. Converts the first letter to uppercase.
\opt{title}\Module{uppercase}
This is just a synonym of \option{first}.
\opt{all}\Module{uppercase}
Converts \emph{all} letters to uppercase.
\opt{none}\Module{uppercase}
Converts \emph{all} letters to \emph{lowercase}
\keyval{cmd}{command}\Module{uppercase}
All of the above options just choose the right command using this option
internally. This means you can choose a different behavior altogether by
setting this option to something else. For example you could use
\cs*{capitalisewords} from the package
\pkg{mfirstuc}~\cite{pkg:mfirstuc}. The command needs to have one
mandatory argument.
\end{options}
There may be reasons to exclude short forms from being uppercased. This can
be controlled by this option:
\begin{options}
\keybool{short}\Module{uppercase}\Default{true}
It allows you to disable the mechanism for the \property{short} and
\property{alt} properties.
\end{options}
\section{Citing and indexing}\label{sec:citing-indexing}
\subsection{Citing}\label{sec:citing}
Acronyms can be given cite keys. This makes it possible to add a citation
reference automatically when the acronym is used for the first time.
Let's see an example first. \acs*{ny} has been defined like this:
\begin{sourcecode}
\DeclareAcronym{ny}{
short = NY ,
long = New York ,
plural = ,
tag = city ,
cite = NewYork
}
\end{sourcecode}
The property \property{cite} will now trigger \acro\ to input
\verbcode+\cite{NewYork}+ after the acronym:
\begin{example}[side-by-side]
\ac{ny}
\end{example}
Depending on the citation style (and probably other factors, too) it might be
desirable to add the citation rather inside the parentheses together with the
short form of the acronym and even cited with a different command. For cases
like these \acro\ offers a number of options:\acuse{ny}
\begin{options}
\keyval{cmd}{citation command}\Module{cite}\Default{\cs*{cite}}
Choose the command with which citations ar printed.
\keybool{group}\Module{cite}\Default{false}
Decide wether to group citations with the short form in the parentheses.
The template must support this. \acro's pre-defined templates \emph{do}
support it.
\keychoice{display}{first,all,none}\Module{cite}\Default{first}
Decide wether to output the citation in the first/full usage only or
always or never.
\keyval{pre}{text}\Module{cite}\Default{\cs*{nobreakspace}}
Arbitrary code directly output before the citation.
\keyval{cmd}{citation command}\Module{cite,group}\Default{\cs*{cite}}
Choose the command with which grouped citations are printed.
\keyval{pre}{text}\Module{cite,group}\Default{,\textvisiblespace}
Arbitrary code directly output before the citation in the grouped case.
\end{options}
If for example you use \pkg{biblatex}'s \code{authoryear}
style~\cite{pkg:biblatex} you might want to have settings like these:
\begin{sourcecode}
\acsetup{
cite/group = true ,
cite/cmd = \parencite ,
cite/group/cmd = \cite
}
\end{sourcecode}
\begin{cnltxcode}
\begin{lstlisting}[style=cnltx]
\acsetup{cite/display = all}
\acf{ny} \\
\ac{ny}
\end{lstlisting}
\tcblower
New York (NY, Wikipedia 2020) \\
NY (Wikipedia 2020)
\end{cnltxcode}
\subsection{Indexing}\label{sec:indexing}
Maybe you want to add your acronyms to an index. In that case it is probably
desirable to let \acro\ make this automatically. In the simplest case just
enable it:
\begin{options}
\keychoice{use}{\default{true},false,indexed}\Module{index}\Default{false}
\changedversion{3.5}Enable indexing. If \code{indexed} is chosen only the
acronyms for which the property \property{index} has been set are indexed.
With \code{true} \emph{all} acronyms are indexed.
\keyval{cmd}{index command}\Module{index}\Default{\cs*{index}}
Choose a command for indexing.
\keyval{disable}{code}\Module{index}\Default{\cs*{def}\cs*{@}\{\}}
Sometimes it is desirable to change the meaning of a command inside an
index entry. For the entries created by \acro\ this can be achieved with
this option.
\opt{clear}\Module{index}
This option clears the disable list.
\end{options}
While these options set global behavior there are also properties to set them
for an acronym individually.
\begin{properties}
%% index
\propval{index}{text}\Default
This property allows to overwrite the automatic index entry with an
arbitrary one.
%% index-sort
\propval{index-sort}{text}\Default={sort}
If you use the option \option{index} every occurrence of an acronym is
recorded to the index and sorted by its short form or (if set) by the
value of the \property{sort} property. This property allows to set an
individual sorting option for the index.
%% no-index
\propbool{no-index}\Default{true}
This property allows to exclude an acronym from being indexed.
\end{properties}
This manual is an example for the indexing feature. Each acronym from
section~\vref{sec:acronyms} that has been used in this manual is also listed
in the index.
%% TODO: document the label property
\section{Barriers}\label{sec:barriers}
The main purpose of the concept of barriers is to be able to have \emph{local}
lists of acronyms. This concept does a little bit more than that, though,
which should become clear from the following options:
\begin{options}
\keybool{use}\Module{barriers}\Default{false}
Activate usage of barriers. Otherwise the command \cs{acbarrier} just
does nothing except writing a warning in the log.
\keybool{reset}\Module{barriers}\Default{false}
When set to \code{true} the acronym usage is reset for all acronyms at a
barrier. The first use of \cs{ac} after a barrier will again look like
the \cs{acf}.
\keybool{single}\Module{barriers}\Default{false}
When set to \code{true} a single usage of an acronym between two barriers
with \cs{ac} will look according to the chosen style as explained in
section~\vref{sec:single-appe-an}. This option only has an effect when
the option \option{single} is used as well.
\end{options}
There are two natural barriers in a document: \beginenv*\Marg{document} and
\endenv*\Marg{document}. You can add an arbitrary number of additional
barriers with
\begin{commands}
\command{acbarrier}
For this command to have any effect you must set
\module{barriers}\code{/}\option{use} to \code{true}!
\end{commands}
\begin{bewareofthedog}
It usually takes two or even three \LaTeX\ runs until acronym usages
between barriers are properly counted.
\end{bewareofthedog}
\section{Trailing tokens}\label{sec:trailing-tokens}
\subsection{What is it about?}
\acro\ has the possibility to look ahead for certain tokens and switch a
boolean variable if it finds them. Per default \acro\ knows about three
tokens: the \enquote{\code{dot}} (\sym{.}), the \enquote{\code{dash}}
(\sym{-}) and the \enquote{\code{babel-hyphen}} (\cs*{babelhyphen}).
You have seen an example for this already:
\begin{sourcecode}
\DeclareAcronym{etc}{
short = etc\acdot ,
long = et cetera ,
format = \textit ,
first-style = long ,
plural =
}
\end{sourcecode}
The macro \cs{acdot} recognizes if a dot is directly following. It only prints
a dot if it doesn't.
\begin{example}[side-by-side]
\ac{etc} and \ac{etc}.
\end{example}
Another example: let's say you're a German scientist, you have
\begin{sourcecode}
\DeclareAcronym{PU}{
short = PU ,
long = Polyurethan ,
long-plural = e
}
\end{sourcecode}
and you use it the first time like this:
\begin{sourcecode}
\ac{PU}-Hartschaum
\end{sourcecode}
then according to German orthography and typesetting rules this should be
printed as
\begin{center}
\enquote{Polyurethan(PU)-Hartschaum}
\end{center}
\ie, with \emph{no} space between long and short form.
\begin{example}[side-by-side]
\acf{PU}-Hartschaum
\end{example}
This works because the template \code{long-short}\footnote{The template that
is used by default for the first appearance.} uses \cs{acspace} at the
appropriate place and the manual setup does
\begin{sourcecode}
\acsetup{trailing/activate = dash}
\end{sourcecode}
\cs{acspace} looks ahead for a trailing dash and adds a space it it doesn't
find it.
\subsection{How does it work?}
Tokens to look for can be defined and activated through the following options:
\begin{options}
\keylit-{define}{\meta{token}\marg{name}}\Module{trailing}
Defines token \meta{name} and tells \acro\ look for \meta{token} if
\meta{name} is activated.
\keyval{activate}{csv list of token names}\Module{trailing}
Tell \acro\ to look for trailing tokens. This is done by giving a csv
list of the internal \emph{names} of the tokens. Per default only
\code{dot} is activated.
\keyval{deactivate}{csv list of token names}\Module{trailing}
Tell \acro\ not to look for trailing tokens. This is done by giving a csv
list of the internal \emph{names} of the tokens.
\end{options}
The package itself does this:
\begin{sourcecode}
\acsetup{
trailing/define = . {dot} ,
trailing/define = {, {comma}} ,
trailing/define = - {dash}
trailing/define = \babelhyphen {babel-hyphen} ,
trailing/activate = {dot,comma}
}
\end{sourcecode}
In order to make use of this mechanism there is the following command:
\begin{commands}
\expandable\command{aciftrailing}[\marg{csv list of token
names}\marg{true}\marg{false}]
Check if one of the tokens listed in \meta{csv list of token names} is
following and either place \meta{true} or \meta{false} in the input
stream.
\end{commands}
This command is used to define the two commands you already know:
\begin{commands}
\expandable\command{acdot} Inserts \cs{abbrdot} if no \code{dot} follows.
\expandable\command{acspace} Inserts a \cs*{space} if no \code{dash} or
\code{babel-hyphen} follows.
\expandable\command{abbrdot} Inserts \sym{.}\cs*{@}
\end{commands}
The definitions are equivalent to the following code:
\begin{sourcecode}
\newcommand*\acdot{\aciftrailing{dot}{}{\abbrdot}}
\newcommand*\acspace{\aciftrailing{dash,babel-hyphen}{}{\space}}
\end{sourcecode}
You are of course free to redefine them according to your needs.
\section{Using or resetting acronyms}\label{sec:using-or-resetting}
Sometimes it is necessary to mark an acronym as used before it actually has
been used or to mark an acronym as unused even though it \emph{has} been
used. You have already seen one of the commands which make it possible:
\begin{commands}
\command{acuse}[\marg{csv list of acronym ids}]
Every acronym given in the list will be marked as used.
\command{acuseall}
Every acronym is marked as used.
\command{acreset}[\marg{csv list of acronym ids}]
Every acronym given in the list will be reset.
\command{acresetall}
Every acronym will be reset.
\end{commands}
\begin{bewareofthedog}
In a number of contexts all acronym commands act as if their starred form is
used: in the table of contents, in the list of figures, and in the list of
tables. The same is true for floats and the measuring phase of common
table environments like \env*{tabularx} or \env*{ltxtable}.
\end{bewareofthedog}
\section{Bookmarks, backlinks and accessibility support}\label{sec:pdf-properties}
\subsection{Backlinks}\label{sec:backlinks}
When \acro\ is used together with the package
\pkg{hyperref}~\cite{pkg:hyperref} then you can make use of the following
option:
\begin{options}
\keybool{make-links}\Default{false}
If this is activated then every short or alternative appearance of an
acronym will be linked to its description in the list of acronyms.
\keybool{link-only-first}\Default{false}
\sinceversion{3.5}If this is activated in addition to \option{make-links}
then \emph{only the first} short or alternative appearance of an acronym
will be linked to its description in the list of acronyms.
\end{options}
\begin{bewareofthedog}
This will fail miserably together with local lists if an acronym appears in
more than one list. This \emph{might} be resolved on day.
\end{bewareofthedog}
\subsection{Bookmarks}\label{sec:bookmarks}
Since bookmarks (which are created by the \pkg{hyperref} or the \pkg{bookmark}
packages~\cite{pkg:bookmark}) can only contain simple text \acro\ simplifies
the output of the acronym commands when they appear in a bookmark. Although
the output can be modified with a dedicated template-mechanism there is no
user interface at the moment. Contact me at \issues\ if you need it.
Acronyms have the property \property{pdfstring}:
\begin{properties}
%% pdfstring
\propval{pdfstring}{pdfstring}\Default={short}
Used as \acs{pdf} string replacement for the short form in bookmarks when
used together with the \pkg{hyperref}~\cite{pkg:hyperref} or the
\pkg{bookmark} package~\cite{pkg:bookmark}.
\end{properties}
This is for acronyms like
\begin{sourcecode}
\DeclareAcronym{pdf}{
short = pdf ,
long = Portable Document Format ,
short-format = \scshape ,
pdfstring = PDF
}
\end{sourcecode}
where the bookmark would write \enquote{pdf} instead of \enquote{\textsc{pdf}}
if the property where not set.
\subsection{\acs*{pdf} comments}\label{sec:pdf-comments}
Some people like see comments in the \ac{pdf} when they're hovering with the
mouse over the short form of an acronym. This can be achieved.
\begin{options}
\keybool{use}\Module{pdfcomments}\Default{false}
This enables the creation of \ac{pdf} comments.
\keyval{cmd}{code}\Module{pdfcomments}\Default{\cs*{pdftooltip}\Marg{\#1}\Marg{\#2}}
Chooses the command for actually creating the comment. You must refer to
the printed output in the \ac{pdf} with \code{\#1} and to the comment with
\code{\#2}. The default command \cs*{pdftooltip} is provided by the
package \pkg{pdfcomment}~\cite{pkg:pdfcomment}. You must load it in order
to use it.
\end{options}
Only acronyms where the corresponding property has been set will get comments:
\begin{properties}
%% pdfcomment
\propval{pdfcomment}{text}
Sets a tooltip description for an acronym.
\end{properties}
\subsection{Accessibility support}\label{sec:access-supp}
\acro\ supports the \pkg{accsupp} package~\cite{pkg:accsupp} when you
\emph{also load \pkg{hyperref}}. Then \acro\ uses
\begin{sourcecode}
\BeginAccSupp{ method = pdfstringdef , ActualText = {PDF} }
\textsc{pdf}%
\EndAccSupp{}%
\end{sourcecode}
for an acronym defined like this:
\begin{sourcecode}
\DeclareAcronym{pdf}{
short = pdf ,
long = Portable Document Format ,
short-format = \scshape ,
pdfstring = PDF ,
short-acc = PDF
}
\end{sourcecode}
Without accessibility support when a string like \enquote{\textsc{pdf}} is
copied from the \ac{pdf} and pasted you get \enquote{pdf}. If you don't care
about that simply don't load \pkg{accsupp} and ignore this section.
You have a few options to be able to manipulate what \acro\ does here but I
recommend to stay with the default settings:
\begin{options}
\keybool{use}\Module{accsupp}\Default{true}
When this is true and the package \pkg{accsupp} is loaded then
accessibility support is used.
\keyval{options}{text}\Module{accsupp}\Default
Additional option to be passed to \cs{BeginAccSupp}. See the
\pkg{accsupp} manual for possible settings.
\keyval{method}{method}\Module{accsupp}\Default{pdfstringdef}
The method used by \cs{BeginAccSupp}. See the
\pkg{accsupp} manual for possible values.
\end{options}
The \enquote{ActualText} that is used by \acro\ always defaults to the values
of the acronym properties themselves. You can choose these values
individually by setting the corresponding properties:
\begin{properties}
%% short-acc
\propval{short-acc}{text}\Default={short}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the short form of the acronym.
%% long-acc
\propval{long-acc}{text}\Default={long}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the long form of the acronym.
%% alt-acc
\propval{alt-acc}{text}\Default={alt}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the alternative short form of the acronym.
%% foreign-acc
\propval{foreign-acc}{text}\Default={foreign}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the foreign form of the acronym.
%% extra-acc
\propval{extra-acc}{text}\Default={extra}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the extra information of the acronym.
%% single-acc
\propval{single-acc}{text}\Default={long-acc}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for a single appearance of the acronym.
%% list-acc
\propval{list-acc}{text}\Default={list}
Sets the \code{ActualText} property as presented by the \pkg{accsupp}
package for the appearance in the list of acronyms.
\end{properties}
Extra care has to be taken for plural forms as these can not be picked up
automatically right now. You have to explicitly set them for the
accessibility support, too:
\begin{sourcecode}
\DeclareAcronym{ufo}{
short = UFO ,
long = unidentified flying object ,
foreign = unbekanntes Flugobjekt ,
foreign-plural-form = unbekannte Flugobjekte ,
foreign-acc-plural-form = unbekannte Flugobjekte ,
foreign-babel = ngerman ,
long-indefinite = an
}
\end{sourcecode}
\section{Localisation}\label{sec:localisation}
There are places when \acro\ uses text strings which depend on the language of
the document. In order to recognize the language from \pkg{babel} of
\pkg{polyglossia} and print the strings in the correct language \acro\ uses
the \pkg{translations}~\cite{pkg:translations}.
If the language is detected incorrectly or you want \acro\ to use another
language than it detects you can use the following option:
\begin{options}
\keychoice{language}{auto,\meta{language}}\Default{auto}
The default setting \code{auto} lets \acro\ detect the language setting
automatically. Valid choices are all language names known to the package
\pkg{translations}. Mostly just type your language and it should work.
\end{options}
\acro\ only provides support for a handful of languages. You can easily teach
\acro\ your language -- see section~\vref{sec:translations} -- if it isn't
supported, yet\footnote{If you like you can always open an issue at \issues\
and provide your translations so I can add them to \acro.}.
\begin{commands}
\expandable\command{acrotranslate}[\marg{key}]
This command fetches the translation of \meta{key} for the current
language. It is meant for usage in template definitions.
\end{commands}
Available keywords and their English, French, and German translations are
shown in table~\vref{tab:translations}.
\begin{table}
\centering
\begin{tabular}{llll}
\toprule
\bfseries Key & \bfseries English & \bfseries French & \bfseries German \\
\midrule
\translationtable
\bottomrule
\end{tabular}
\caption{Available translation keywords.}
\label{tab:translations}
\end{table}
\section{Patches}\label{sec:patches}
In several situations it can lead to wrong results if \acro\ marks an acronym
as used too early or at all. This is why it is possible to disable the
mechanism which is responsible:
\begin{commands}
\command{acswitchoff}
This disables the mechanism which marks acronyms as used. After this
command every acronym command like \cs{ac} acts like its starred version.
\command{acswitchon}
This command enables the mechanism again.
\end{commands}
In certain circumstances \acro\ uses these commands itself. For example it is
often preferable that acronyms are not counted as used in floats, the table of
contents or the lists of figures and tables. This is why \acro\ turns the
mechanism off in these places.
Certain table environments typeset their contents twice for measurement
purposes. \acro\ tries to disable the usage mechanism during these phases.
The same is true for single line captions from the \pkg{caption} package.
All these patches can be turned off:
\begin{options}
\keybool{floats}\Module{patch}\Default{true}
En-/disable the \option{floats} patch.
\keybool{lists}\Module{patch}\Default{true}
En-/disable the \option{lists} patch for the table of contents, the list
of figures and the list of tables.
\keybool{tabularx}\Module{patch}\Default{true}
En-/disable the \option{tabularx} patch.
\keybool{ltxtable}\Module{patch}\Default{true}
En-/disable the \option{ltxtable} patch.
\keybool{tabu}\Module{patch}\Default{true}
En-/disable the \option{tabu} patch.
\keybool{caption}\Module{patch}\Default{true}
En-/disable the \option{caption} patch.
\end{options}
\part{Extending \acro}\label{part:extending-acro}
\section{Background}\label{sec:background}
\subsection{Templates}
One of the core ideas of \acro\ version~3.0 is the use of \emph{templates}
which manage how different how anything is printed, from the output of \cs{ac}
and friends to the list of acronyms. \acro\ uses three types of templates:
\begin{description}
\item[acronym] These templates can be used to define \emph{acronym
commands}, see section~\vref{sec:own-acronym-commands}.
\item[list] These templates are used by the \cs{printacronyms} command.
\item[heading] These templates only make sense if a \emph{list} template
uses \cs{acroheading}. This command makes use of them.
\end{description}
How these templates are defined, which are available from the start and how
they are used is explained in section~\vref{sec:templates}.
\subsection{Objects}
\acro\ uses certain kinds of objects in some of its commands. It is possible
to defines own such objects:
\begin{description}
\item[articles] Per default only the \enquote{indefinite} article is
defined. But it is possible to define and add other articles to \acro.
This is explained in section~\vref{sec:other-articles}.
\item[endings] Per default only the ending \enquote{plural} is defined. But
it is possible to define and add other endings to \acro. This is
explained in section~\vref{sec:other-endings}.
\item[properties] You have already learned about properties. It is possible
to define and add further acronym properties to \acro. This is explained
in section~\vref{sec:new-properties}.
\item[translations] \acro\ uses localisation strings at a number of places.
It is possible to change these strings and add further strings. This is
explained in section~\vref{sec:localisation}.
\end{description}
\section{Templates}\label{sec:templates}
\subsection{Pre-defined templates}\label{sec:pre-defin-templ}
\subsubsection{Acronym templates}
\begin{templates}
\tmpl{alt}
Display the alternative form of an acronym.
\tmpl{first}
This is a \emph{pseudo} template which always displays what is
set through the option \option{first-style} or the property
\property{first-style}.
\tmpl{footnote}
A template for the first appearance where the long form is printed in a
footnote.
\tmpl{long}
Display the long form of an acronym.
\tmpl{long-short}
A template for the first appearance where the long form is printed and the
short form follows in parentheses.
\tmpl{short}
Display the short form of an acronym.
\tmpl{short-long}
A template for the first appearance where the short form is printed and the
long form follows in parentheses.
\tmpl{single}
A template which is used when the property \property{single} has been set
\emph{and} the option \option{single} has been set \emph{and} if the
acronym is only used a single time.
\tmpl{show}
A template which writes all properties of an acronym into the log file.
\end{templates}
\subsubsection{List templates}
\begin{templates}
\tmpl{description}
The default list style which places the short form in the item of a
\env*{description} environment and adds the all the rest as description of
the item.
\tmpl{lof}
A style which mimicks the list of figures. This style does not support
page ranges.
\tmpl{longtable}
A style that uses a \env*{longtable} environment for building the list.
This needs the \pkg{longtable} package~\cite{pkg:longtable} loaded.
\tmpl{longtabu}
A style that uses a \env*{longtabu} environment for building the
list. This needs the \pkg{longtable} package and the \pkg{tabu}
package~\cite{pkg:tabu} loaded\footnote{Please note that this package
currently is un-maintained and has a number of open bugs. For further
information refer to
\url{https://github.com/tabu-issues-for-future-maintainer/tabu}}.
\tmpl{supertabular}
A\sinceversion{3.2} style that uses a \env*{supertabular} environment for
building the list. This needs the \pkg{supertabular}
package~\cite{pkg:supertabular} loaded.
\tmpl{tabular}
A style that uses a \env*{tabular} environment for building the list.
Since a \env*{tabular} cannot break across pages this is only suited for
short lists.
\tmpl{toc}
A style which mimicks the table of contents. This style does not support
page ranges.
\end{templates}
\subsubsection{Heading templates}
\begin{templates}
\tmpl{addchap}
Only defined in a \KOMAScript\ class and if \cs*{chapter} is defined. Uses
\cs*{addchap} for the heading.
\tmpl{addsec}
Only defined in a \KOMAScript\ class. Uses \cs*{addsec} for the heading.
\tmpl{chapter}
Only defined if \cs*{chapter} is defined. Uses \cs*{chapter} for the heading.
\tmpl{chapter*}
Uses \cs*{chapter}\sarg\ for the heading.
\tmpl{none}
Displays nothing.
\tmpl{section}
Uses \cs*{section} for the heading.
\tmpl{section*}
Uses \cs*{section}\sarg\ for the heading.
\end{templates}
\subsection{Defining new templates}\label{sec:defin-new-templ}
For the definition of templates these commends are available:
\begin{commands}
\command{NewAcroTemplate}[\oarg{type}\marg{name}\marg{code}]
This defines a template of type \meta{type} with the name \meta{name}
which inserts \meta{code} when used. A template of type \meta{type} with
name \meta{name} must not exist. The default type is \code{acronym}.
\command{RenewAcroTemplate}[\oarg{type}\marg{name}\marg{code}]
This re-defines a template of type \meta{type} woth the name \meta{name}
which inserts \meta{code} when used. A template of type \meta{type} with
name \meta{name} must exist. The default type is \code{acronym}.
\command{SetupAcroTemplate}[\oarg{type}\marg{name}\marg{code}]
Adds\sinceversion{3.2} \meta{code} to the beginning of the template
\meta{name} of type \meta{type}. The default type is \code{acronym}.
\command{SetupNextAcroTemplate}[\oarg{type}\marg{name}\marg{code}]
Adds\sinceversion{3.2} \meta{code} to the beginning of \emph{the next use}
of the template \meta{name} of type \meta{type}. The default type is
\code{acronym}.
\expandable\command{AcroTemplateType}
Within a template this expands to the \meta{type} of the current
template.
\expandable\command{AcroTemplateName}
Within a template this expands to the \meta{name} of the current
template.
\end{commands}
How to use these commands is best explained by examples of how the existing
templates have been defined. The following sections will show several
examples for their usage.
\subsection{Commands to be used in template definitions}
\acro\ provides and uses a large number of commands that are meant to be used
in template definitions and that often are useless or will raise errors if
used outside. Depending on their purpose the commands can be used in
different types of templates or only in certain types of templates.
In the descriptions below a \expandablesymbol\ indicates a fully expandable
command when used in an \cs*{edef}, \cs*{write} or in \cs*{expanded}.
A \TF\ always refers to a \meta{true} and \meta{false} branch and indicates
that \emph{three} commands exist: one exactly as described, one with only the
\code{\textcolor{cs}{T}} and the \meta{true} branch, and one with only the
\code{\textcolor{cs}{F}} and the \meta{false} branch. So \cs{acroif\TF} means
there is \cs*{acroifTF}, \cs*{acroifT}, and \cs*{acroifF}, where \cs*{acroifT}
and \cs*{acroifF} each have an argument less than \cs*{acroifTF}.
\subsubsection{Commands for common uses}
\begin{commands}
\expandable\command{acrolistname}
Expands to whatever is currently set with
\module{list}\code{/}\option{name}.
\command{acrowrite}[\marg{property}]
Prints the property \meta{property} of the current acronym. Depending on
the circumstances this prints the property together with an article or an
ending either in uppercase or lowercase form. Default is the lowercase
form without ending or article. The actual outcome is determined by
switches which are explained in section~\vref{sec:own-acronym-commands}.
\command{acroformat}[\marg{type}\marg{text}]
This formats \meta{text} according to \meta{type} where \meta{type} has
either been set as property or as option from the \module{format} module.
Valid values are \code{short}, \code{long}, \code{alt}, \code{extra},
\code{foreign}, \code{list}, and \code{first-long}.
\command{acroshow}[\marg{property}]
For debugging puposes: writes the property \meta{property} of the current
acronym to the log file.
\command{acroif\TF}[\marg{property}\marg{true}\marg{false}]
Checks if the property \meta{property} has been set for the current
acronym and either leaves \meta{true} or \meta{false} in the input stream.
\command{acroifboolean\TF}[\marg{property}\marg{true}\marg{false}]
\sinceversion{3.1}Returns \meta{true} if the boolean property
\meta{property} has been set to \code{true} and \meta{false} otherwise.
\command{acroifall\TF}[\marg{properties}\marg{true}\marg{false}]
Checks if all properties in the csv list \meta{properties} have been set
for the current acronym and either leaves \meta{true} or \meta{false} in
the input stream.
\command{acroifany\TF}[\marg{properties}\marg{true}\marg{false}]
Checks if any of the properties in the csv list \meta{properties} has been
set for the current acronym and either leaves \meta{true} or \meta{false}
in the input stream.
\command{acroiftag\TF}[\marg{tag}\marg{true}\marg{false}]
Checks if the current acronym has been given the tag \meta{tag} and either
leaves \meta{true} or \meta{false} in the input stream.
\command{acroifstarred\TF}[\marg{true}\marg{false}]
\sinceversion{3.5}Checks if the current call of the acronym is a starred
command or not and either leaves \meta{true} or \meta{false} in the input
stream.
\command{AcroPropertiesMap}[\marg{code}]
Maps over all defined acronym properties. Within \meta{code} you can
refer to the current property with \code{\#1}.
\command{AcroAcronymsMap}[\marg{code}]
\sinceversion{3.5}Maps over all defined acronyms. Within \meta{code} you
can refer to the current property with \code{\#1} or with \cs{AcronymID}.
\command{AcroMapBreak}
\sinceversion{3.5}Stops the map \cs{AcroAcronymsMap} and is usually used
in combination with a boolean check.
\command{AcroPropertiesSet}[\marg{id}\marg{csv list of properties}]
\sinceversion{3.5}Allows the setting of properties of acronym \meta{id}
outside of \cs{declareAcronym}.
\end{commands}
\subsubsection{Commands for usage in acronym templates}
\begin{commands}
\expandable\command{acroifused\TF}[\marg{true}\marg{false}]
Checks if the current acronym has been used before and either leaves
\meta{true} or \meta{false} in the input stream.
\command{acroiffirst\TF}[\marg{true}\marg{false}]
Checks if the current usage of the current acronym is the first time and
either leaves \meta{true} or \meta{false} in the input stream.
\command{acroifsingle\TF}[\marg{true}\marg{false}]
Checks if the current acronym is used a single time and either leaves
\meta{true} or \meta{false} in the input stream.
\command{acrogroupcite}
\end{commands}
\subsubsection{Commands for usage in list templates}
\begin{commands}
\expandable\command{acroifchapter\TF}[\marg{true}\marg{false}]
This just check if \cs*{chapter} is defined. Used in the \template{toc}
template.
\expandable\command{acroifpages\TF}[\marg{true}\marg{false}]
This is \meta{true} if the option \module{pages}\code{/}\option{display}
is set, \emph{and} the current acronym is not single, \emph{and} has at
least one page number. \meta{false} otherwise.
\command{acropages}[\marg{first}\marg{range}]
If \cs{acroifpages\TF} would be \meta{false} this would do nothing.
Otherwise, if \module{pages}\code{/}\option{display} is \code{first} it
prints the first page number, preceded by \meta{first} if
\module{pages}\code{/}\option{name} is true. If
\module{pages}\code{/}\option{display} is \code{all} it prints the page
range, preceded by \meta{range} if \module{pages}\code{/}\option{name} is
true.
\command{acronopagerange}
This disables page ranges. Used in the \template{toc} and \template{lof}
templates.
\command{acroneedpages}
\sinceversion{3.4}This enables the page number displayed. Used in the
\template{toc} and \template{lof} templates.
\command{acropagefill}
If \cs{acroifpages\TF} would be \meta{false} this would do
nothing. Otherwise it prints whatever is set by
\module{pages}\code{/}\option{fill}.
\command{acronymsmap}[\marg{code}]
Maps over the acronyms in order of appearance in the list. Which acronyms
these are depends on settings. They might only have certain tags, be ones
local to barriers, \dots \par
Within \meta{code} \code{\#1} refers to the current \ac{id} of the
acronym. Also \cs{AcronymID} expands to the current \ac{id}. The latter
is important for all the commands that check or print properties of
acronyms.
\command{acronymsmap\TF}[\marg{code}\marg{true}\marg{false}]
This does the same as \cs{acronymsmap} and also leaves \meta{true} in the
input stream if the list is not empty and \meta{false} otherwise. This is
useful to trigger a rerun warning.
\command{AcronymTable}
This is an empty token list at the beginning of a list template.
\command{AcroAddRow}[\marg{code}]
Adds \meta{code} to the right of \cs{AcronymTable} and ensures that
\cs{AcronymID} has the correct global definition for this code. With this
the code for the \template{tabular} template and other table templates can
be built in a comfortable way.
\command{AcroNeedPackage}[\marg{package}]
Checks if the package \meta{package} is loaded and throws an error
otherwise.
\command{AcroRerun}
Triggers \acro\ to throw an \enquote{empty list} rerun warning.
\end{commands}
\subsection{New acronym templates}\label{sec:new-acronym-templ}
Some templates are quite short and self-explaining:
\begin{sourcecode}
\NewAcroTemplate{short}{\acrowrite{short}}
\end{sourcecode}
Some are a little bit more elaborate:
\begin{sourcecode}
\NewAcroTemplate{alt}{%
\acroifTF{alt}
{\acrowrite{alt}}
{\acrowrite{short}}%
}
\end{sourcecode}
And some templates need to do a lot more:
\begin{sourcecode}
\NewAcroTemplate{long-short}{%
\acroiffirstTF{%
\acrowrite{long}%
\acspace(%
\acroifT{foreign}{\acrowrite{foreign}, }%
\acrowrite{short}%
\acroifT{alt}{ \acrotranslate{or} \acrowrite{alt}}%
\acrogroupcite
)%
}%
{\acrowrite{short}}%
}
\end{sourcecode}
\subsection{New list templates}\label{sec:new-list-templates}
This section shows the definition of three templates: \template{description},
\template{tabular}, and \template{toc}.
First the \template{description} template:
\begin{sourcecode}
\NewAcroTemplate[list]{description}{%
\acroheading
\acropreamble
\begin{description}
\acronymsmapF{%
\item[\acrowrite{short}\acroifT{alt}{/\acrowrite{alt}}]
\acrowrite{list}%
\acroifanyT{foreign,extra}{ (}%
\acroifT{foreign}{\acrowrite{foreign}\acroifT{extra}{, }}%
\acroifT{extra}{\acrowrite{extra}}%
\acroifanyT{foreign,extra}{)}%
\acropagefill
\acropages
{\acrotranslate{page}\nobreakspace}
{\acrotranslate{pages}\nobreakspace}%
}
{\item\AcroRerun}
\end{description}
}
\end{sourcecode}
The following shows how to define templates using some kind of table
environment. Special care is necessary due to the way \LaTeX\ tables work:
first the table body is built and only then the table itself is printed:
\begin{sourcecode}
\NewAcroTemplate[list]{tabular}{%
\AcroNeedPackage{array}%
\acronymsmapF{%
\AcroAddRow{
\acrowrite{short}%
\acroifT{alt}{/\acrowrite{alt}}
&
\acrowrite{list}%
\acroifanyT{foreign,extra}{ (}%
\acroifT{foreign}{\acrowrite{foreign}\acroifT{extra}{, }}%
\acroifT{extra}{\acrowrite{extra}}%
\acroifanyT{foreign,extra}{)}%
\acropagefill
\acropages
{\acrotranslate{page}\nobreakspace}
{\acrotranslate{pages}\nobreakspace}%
\tabularnewline
}%
}
{\AcroRerun}%
\acroheading
\acropreamble
\par\noindent
\begin{tabular}{>{\bfseries}lp{.7\linewidth}}
\AcronymTable
\end{tabular}
}
\end{sourcecode}
\begin{sourcecode}
\NewAcroTemplate[list]{toc}{%
\acroheading
\acropreamble
\acronopagerange
\acronymsmapF{%
\contentsline{\acroifchapterTF{chapter}{section}}
{\acrowrite{short}\acroifT{alt}{/\acrowrite{alt}}}
{}{}%
\contentsline{\acroifchapterF{sub}section}
{
\acrowrite{list}%
\acroifT{foreign}{\acrowrite{foreign}\acroifT{extra}{, }}%
\acroifT{extra}{\acrowrite{extra}}%
\acroifanyT{foreign,extra}{)}%
}
{\acropages{}{}}
{}%
}
{\AcroRerun}
}
\end{sourcecode}
\subsection{New heading templates}\label{sec:new-head-templ}
Let's take a look at the two templates \template{section} and
\template{section*} which should give you enough information to build your
own:
\begin{sourcecode}
\NewAcroTemplate[heading]{section} {\section {\acrolistname}}
\NewAcroTemplate[heading]{section*}{\section*{\acrolistname}}
\end{sourcecode}
\section{Endings}\label{sec:endings}
Referring to section~\vref{sec:other-endings} this section explains how to
define and use additional endings.
\begin{commands}
\command{DeclareAcroEnding}[\marg{name}\marg{short default}\marg{long default}]
This command can be used to define properties and options analoguous to
the plural endings which have been defined this way:
\end{commands}
\begin{sourcecode}
\DeclareAcroEnding{plural}{s}{s}
\end{sourcecode}
In general \cs{DeclareAcroEnding}\marg{foo}\marg{x}\marg{y} defines these
options
\begin{options}
\keyval*{short-\meta{foo}-ending}{value}\Default*{\meta{x}}
\keyval*{long-\meta{foo}-ending}{value}\Default*{\meta{y}}
\end{options}
and these properties
\begin{properties}
\propval*{short-\meta{foo}}{value}\Default*{\meta{x}}
\propval*{short-\meta{foo}-form}{value}\Default*
\propval*{alt-\meta{foo}}{value}\Default*{\meta{x}}
\propval*{alt-\meta{foo}-form}{value}\Default*
\propval*{long-\meta{foo}}{value}\Default*{\meta{y}}
\propval*{long-\meta{foo}-form}{value}\Default*
\propval*{foreign-\meta{foo}}{value}\Default*{\meta{y}}
\propval*{foreign-\meta{foo}-form}{value}\Default*
\propval*{single-\meta{foo}}{value}\Default*{\meta{y}}
\propval*{single-\meta{foo}-form}{value}\Default*
\propval*{extra-\meta{foo}}{value}\Default*{\meta{y}}
\propval*{extra-\meta{foo}-form}{value}\Default*
\end{properties}
In addition another command is defined which is meant to be used in
template definitions.
\begin{commands}
\command*{acro\meta{foo}}
This command tells the template that the ending \meta{foo} should be
used.
\end{commands}
Section~\vref{sec:own-acronym-commands} has an example of how this can be used
to define a possessive ending and commands that make use of them like this:
\begin{example}[side-by-side]
\acfg{MP}
\end{example}
\section{Articles}\label{sec:articles}
Referring to section~\vref{sec:other-articles} this section explains how to
define and use additional articles.
\begin{commands}
\command{DeclareAcroArticle}[\marg{name}\marg{default}]
This command can be used to define properties and options analoguous to
the indefinite article which have been defined this way:
\end{commands}
\begin{sourcecode}
\DeclareAcroArticle{indefinite}{a}
\end{sourcecode}
In general \cs{DeclareAcroArticle}\marg{foo}\marg{x} defines the
option
\begin{options}
\keyval*{\meta{foo}}{value}\Default*{\meta{x}}
\end{options}
and these properties
\begin{properties}
\propval*{short-\meta{foo}}{value}\Default*{\meta{x}}
\propval*{alt-\meta{foo}}{value}\Default*{\meta{x}}
\propval*{long-\meta{foo}}{value}\Default*{\meta{x}}
\propval*{foreign-\meta{foo}}{value}\Default*{\meta{x}}
\propval*{single-\meta{foo}}{value}\Default*{\meta{x}}
\propval*{extra-\meta{foo}}{value}\Default*{\meta{x}}
\end{properties}
In addition another command is defined which is meant to be used in
template definitions.
\begin{commands}
\command*{acro\meta{foo}}
This command tells the template that the article \meta{foo} should be
used.
\end{commands}
Section~\vref{sec:own-acronym-commands} has examples of how this can be used
to define definite articles and commands that make use of them like this:
\begin{example}
\dacs{hadopi} \par
\dacl{hadopi}
\end{example}
\section{Translations}\label{sec:translations}
For adding additional keywords, or for adding translations to existing
keywords, or for changing existing translations \acro\ uses this command:
\begin{commands}
\command{DeclareAcroTranslation}[\marg{key}\marg{language=translation list}]
With this command new translations keywords can be added and translations
for existing keywords can be changed.
\command{AddAcroTranslations}[\marg{key}\marg{language=translation list}]
Basically the same but this time per language rather than per keyword.
\end{commands}
As an example this is how \acro\ declares translations for the \code{pages}
keyword:
\begin{sourcecode}
\DeclareAcroTranslation{pages}{
Fallback = pp\abbrdot ,
English = pp\abbrdot ,
French = pp\abbrdot ,
German = S\abbrdot ,
Portuguese = pp\abbrdot
}
\end{sourcecode}
Translations for a language could be added this way\footnote{\acro\ already
has the translations for Italian.}:
\begin{sourcecode}
\AddAcroTranslations{Italian}{
list-name = Acronimi ,
page = p\abbrdot ,
pages = pp\abbrdot ,
sequens = s\abbrdot ,
sequentes = ss\abbrdot ,
also = anche ,
and = e ,
or = o
}
\end{sourcecode}
The existing keywords had been shown in table~\vref{tab:translations}.
\section{Properties}\label{sec:new-properties}
As you know from section~\ref{sec:decl-acronyms-other} \acro\ comes with quite
a number of predefined properties which control various aspects of
acronyms. However, there are cases when additional properties would be nice to
have and to use. It can be done with the following command:
\begin{commands}
\command{DeclareAcroProperty}[\sarg\arg{?}\arg{!}\arg{|}\arg{>}\marg{name}]
This defines the new property \meta{name}. The command has five optional
arguments most of which you probably never need. \par
The optional star \sym{*} ensures that each acronym gets a \emph{unique}
value for the property. \par
The optional question mark \sym{?} creates a \emph{boolean} property.
That is a property that only can get the values \code{true} or
\code{false} and when it is used without value (not an empty value!) then
\code{true} is assumed. \par
The optional exclamation mark \sym{!} creates a \emph{mandatory}
property. An error is raised if an acronym does not set it. \par
The optional pipe \sym{|} creates a \emph{static} property which means
its value is written to an auxiliary file and read in again at begin
document. Once set the value is the same throughout the document. \par
The optional greater as symbol\sinceversion{3.2} \sym{>} creates a
\emph{display} property. This additionally defines the two boolean
options \meta{name}\code{/}\option{display} and
\module{list}\code{/}\meta{name}\code{/}\option{display}, both initially
set to true. If these options are set to false the acronym commands or
the list act as if the property \meta{name} has not been set. The
\property{foreign} property is an example.
\command{DeclareAcroPropertyAlias}[\sarg\arg{?}\arg{!}\arg{|}\arg{>}\marg{name1}\marg{name2}]
This newly declares property \meta{name1} and makes it an alias of
property \meta{name2}. This means that \meta{name1} gets the same value
that \meta{name2} has unless it is set explicitly. Property \meta{name2}
must exist.
\command{MakeAcroPropertyAlias}[\marg{name1}\marg{name2}]
This makes property \meta{name1} and makes it an alias of property
\meta{name2}. Both properties must exist.
\end{commands}
Exmaples for defining and using new properties are shown in
section~\ref{sec:examples}, \ac*{eg}, examples~\ref{example:texsx-505891}
or~\ref{example:texsx-507726}.
\section{Own acronym commands}\label{sec:own-acronym-commands}
\subsection{Background}
You can define own acronym commands or redefine the existing ones with
commands similar to \cs*{NewDocumentCommand} from the \pkg{xparse}
package~\cite{pkg:xparse}.
\begin{commands}
\command{NewAcroCommand}[\marg{command}\marg{arg. spec.}\marg{code}]
This creates the new command \meta{command} with the argument
specification\footnote{in the sense of an \pkg{xparse}
command.} \code{so\meta{arg. spec.}} and replacement text \meta{code}.
There are significant differences to \cs*{NewDocumentCommand}: the new
command always has two additional arguments: an optional star and an
optional argument for options. You can ignore this fact in your
definition, though. However, the command \emph{must} at least have one
argument \emph{and} the first argument \emph{must} refer to the \ac{id}.
Everything else is up to you. \par
The new command has the suiting framework to recognize trailing tokens,
count usage, index, and add a citation if necessary.
\command{RenewAcroCommand}[\marg{command}\marg{arg. spec.}\marg{code}]
Like \cs{NewAcroCommand} but redefines an existing command.
\command{UseAcroTemplate}[\oarg{type}\marg{name}\oarg{argument number}\meta{arguments}]
The argument \meta{type} defaults to \code{acronym} and \meta{argument
number} defaults to \code{1}. The command must be followed by as many
mandatory arguments as you specify with \meta{argument number}. All
predefined acronym templates use the first argument as \ac{id} so they
must use one argument.
\end{commands}
Let's see an example. This is the definition of \cs{ac}:
\begin{sourcecode}
\NewAcroCommand\ac{m}{\UseAcroTemplate{first}{#1}}
\end{sourcecode}
Equivalent definitions would be:
\begin{sourcecode}
\NewAcroCommand\ac{m}{\UseAcroTemplate[acroynm]{first}{#1}}
\NewAcroCommand\ac{m}{\UseAcroTemplate[acroynm]{first}[1]{#1}}
\NewAcroCommand\ac{m}{\UseAcroTemplate{first}[1]{#1}}
\NewAcroCommand\ac{m}{\UseAcroTemplate{first}[2]{#1}{}}
\end{sourcecode}
There are a number of switch commands which determine a certain behavior.
They tell the following template how to interpret certain conditionals and how
to use \cs{acrowrite}.
\begin{commands}
\command{acrocite}
Tells \acro\ to output the citation.
\command{acrodonotuse}
Tells \acro\ to not count this as usage.
\command{acroplural}
Use plural form.
\command{acroindefinite}
Use indefinite article
\command{acroupper}
Use uppercase form.
\command{acrofull}
Use first or full form.
\end{commands}
Here is an example that makes use of them:
\begin{sourcecode}
\NewAcroCommand\Iacs{m}{%
\acroupper\acroindefinite\UseAcroTemplate{short}{#1}%
}
\end{sourcecode}
\subsection{Create commands for possessive endings}
Let's say you want to add an ending for the genitive case.
First you define the appropriate ending:
\begin{sourcecode}
\DeclareAcroEnding{possessive}{'s}{'s}
\end{sourcecode}
Then you define commands which make use of this ending:
\begin{sourcecode}
\NewAcroCommand\acg{m}{\acropossessive\UseAcroTemplate{first}{#1}}
\NewAcroCommand\acsg{m}{\acropossessive\UseAcroTemplate{short}{#1}}
\NewAcroCommand\aclg{m}{\acropossessive\UseAcroTemplate{long}{#1}}
\NewAcroCommand\acfg{m}{%
\acrofull
\acropossessive
\UseAcroTemplate{first}{#1}%
}
\NewAcroCommand\iacsg{m}{%
\acroindefinite
\acropossessive
\UseAcroTemplate{short}{#1}%
}
\end{sourcecode}
You maybe also define acronyms with corresponding properties\footnote{Bear
with me if this is incorrect: English is not my native language.}:
\begin{sourcecode}
\DeclareAcronym{MP}{
short = MP ,
long = Member of Parliament ,
plural-form = Members of Parliament ,
long-possessive-form = Member's of Parliament
}
\end{sourcecode}
Now you can use it like this:
\begin{example}
This is the \acg{MP} first day at work after \dots
\end{example}
\section{Own \acro\ style files}
When you want to use your definitions regarding \acro\ repeatedly then it
makes sense to put them in a file which you put somewhere in your local
\LaTeX\ tree. There are three options:
\begin{enumerate}
\item Put them in a simple \code{.tex} file in \cs*{input} it.
\item Put in in a \code{.sty} file and include it with \cs*{usepackage}
\emph{after} \acro.
\item Create a style file following this pattern decribed below.
\end{enumerate}
\begin{center}
\code{acro.style.\meta{name}.code.tex}
\end{center}
This file should start with
\begin{sourcecode}
\AcroStyle{name}
\end{sourcecode}
and input the file with \cs{acsetup} using the option
\begin{options}
\keyval{load-style}{name}
This is more or less the same as if you'd use the package variant but
naturally ensures that you load it after \acro\ and in the future might
provide other bells and whistles, too.
\end{options}
The command
\begin{commands}
\command{AcroStyle}[\sarg\marg{style}\oarg{details}]
has an optional star which switches to expl3 syntax. It also has an
optional argument \meta{details} with the same purpose and usage as
the one from \cs*{ProvidesPackage}. A typical usage would look like
\end{commands}
\begin{sourcecode}
\AcroStyle{abbrev}[2020/04/21 abbreviations with acro (CN)]
\NewDocumentCommand\newabbreviation{mmm}{%
\DeclareAcronym{#1}{ short = #2 , #3 , class = abbrev , no-index }%
}
\NewDocumentCommand\printabbreviations{O{}}{%
\printacronyms[#1,include=abbrev]%
}
\end{sourcecode}
\clearpage
\appendix
\part{Appendix}\label{part:appendix}
\section{Examples}\label{sec:examples}
\listexamplefiles
\printacronyms[
preamble = {\label{sec:acronyms}Below all abbreviations are listed which
have been defined for the manual.} ,
exclude = {exclude,glossary}
]
\printbibliography
\end{document}
|