summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/acro/acro_en.tex
blob: 2c03279c280ebad16bd4467a2369af2ac9a3bdf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
% !arara: pdflatex: { action: nonstopmode }
% !arara: biber
% !arara: pdflatex: { action: nonstopmode }
% arara: pdflatex: { action: nonstopmode }
% arara: pdflatex: { action: nonstopmode }
% --------------------------------------------------------------------------
% the ACRO package
% 
%   Typeset Acronyms
% 
% --------------------------------------------------------------------------
% Clemens Niederberger
% Web:    http://www.mychemsitry.eu/forums/forum/acro/
% E-Mail: contact@mychemistry.eu
% --------------------------------------------------------------------------
% Copyright 2011--2018 Clemens Niederberger
% 
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% 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.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
% 
% This work has the LPPL maintenance status `maintained'.
% 
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
% The acro package consists of the files
%  - acro.sty, acro_en.tex, acro_en.pdf, README
% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
\documentclass[load-preamble+]{cnltx-doc}

\usepackage[utf8]{inputenc}
\usepackage[single,macros,accsupp,index]{acro}
\setcnltx{
  package  = {acro} ,
  info     = {Typeset Acronyms and other Abbreviations} ,
  authors  = Clemens Niederberger ,
  email    = contact@mychemistry.eu ,
  url      = https://bitbucket.org/cgnieder/acro/ ,
  abstract = {%
    \acro\ allows you to define and use abbreviations in a simple way.
    Abbreviations can be divided into different classes of abbreviations.
    Lists of abbreviations can be created (also of separate classes of
    abbreviations) and printed wherever you want the lists to appear.\par
    \acro\ provides an option \option{single} which ignores abbreviations that
    are used only once in the whole document.\par
    As an experimental feature \acro\ also offers the option \option{sort} which
    automatically sorts the list created by \cs{printacronyms}.\par
    \acro\ also has the feature of creating \emph{local} lists
  } ,
  add-cmds = {
    ac, Ac, aca, Aca, acap, Acap, acbarrier, acdot, acf, Acf, acflike, acg,
      acfp, Acfp, acfplike, aciftrailing, acl, Acl, aclp, Aclp, acp, Acp,
      AcroRegisterTrailing, acs, Acs, acsingle, Acsingle, acsp, Acsp, acspace,
      acreset, acresetall, acsetup,
    DeclareAcroCommand, DeclareAcronym, DeclareAcroExtraStyle,
      DeclareAcroFirstStyle, DeclareAcroListHeading, 
      DeclareAcroListStyle, DeclareAcroPageStyle, DeclarePseudoAcroCommand,
    iac, Iac, iaca, Iaca, iacs, Iacs, iacl, Iacl, iacf, Iacf, iacflike,
      Iacflike,
    NewAcroCommand, NewPseudoAcroCommand,
    printacronyms,
    ProvideAcroCommand, ProvideAcroEnding, ProvidePseudoAcroCommand,
    RenewAcroCommand, RenewPseudoAcroCommand
  } ,
  add-silent-cmds = {
    addcolon, DeclareInstance, babelhyphen, ExplSyntaxOff, ExplSyntaxOn, nato,
    NewDocumentCommand, newlist, ny, setlist
  } ,
  index-setup = { level = \section , headers={\indexname}{\indexname} }
}

\acsetup{
  use-barriers = true ,
  hyperref     = true ,
  log
}

\usepackage{varioref}

\defbibheading{bibliography}{\section{References}}

\usepackage{csquotes}

\usepackage[biblatex]{embrac}[2012/06/29]
\ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]

\usepackage{filecontents}

\addbibresource{\jobname.bib}
\begin{filecontents}{\jobname.bib}
@online{wikipedia,
  author   = {Wikipedia},
  title    = {Acronym and initialism},
  urldate  = {2012-06-21},
  url      = {http://en.wikipedia.org/wiki/Acronyms},
  year     = {2012}
}
@online{NewYork,
  author   = {Wikipedia},
  title    = {New York City},
  urldate  = {2012-09-27},
  url      = {http://en.wikipedia.org/wiki/New_York_City},
  year     = {2012}
}
@manual{interface3,
  author    = {{The \LaTeX3 Project Team}} ,
  shorthand = {L3P} ,
  sortname  = {LaTeX3 Project Team} ,
  title     = {The \LaTeX3 Interfaces} ,
  date      = {2015-09-06} ,
  url       = {http://mirrors.ctan.org/macros/latex/contrib/l3kernel/interface3.pdf}
}
\end{filecontents}

% additional packages:
\usepackage{longtable,array,booktabs,enumitem,amssymb}

\newcommand*\wikipedia{%\libertineGlyph{W.alt}\kern-.055em
\textsc{Wikipedia}}
\newcommand*\h[1]{\textcolor{cnltx}{\textbf{#1}}}

\ProvideAcroEnding {possessive} {'s} {'s}

% declare acronyms
\DeclareAcronym{cd}
  {
    short        = cd ,
    long         = Compact Disc ,
    short-format = \scshape
  }
\let\ctan\relax
\DeclareAcronym{ctan}
  {
    short     = ctan ,
    long      = Comprehensive \TeX\ Archive Network ,
    format    = \scshape ,
    pdfstring = CTAN ,
    accsupp   = CTAN
  }
\def\ctan{\acs{ctan}}
\DeclareAcronym{ecu}
  {
    short   = ECU ,
    long    = Steuerger\"at ,
    foreign = Electronic Control Unit ,
    foreign-lang = english
  }
\DeclareAcronym{id}
  {
    short        = id ,
    long         = identification string ,
    short-format = \scshape
  }
\DeclareAcronym{jpg}
  {
    short = JPEG ,
    sort  = jpeg ,
    alt   = JPG ,
    long  = Joint Photographic Experts Group
  }
\DeclareAcronym{la}
  {
    short        = LA ,
    short-plural = ,
    long         = Los Angeles,
    long-plural  = ,
    class        = city
  }
\let\lppl\relax
\DeclareAcronym{lppl}
  {
    short     = lppl ,
    long      = \LaTeX\ Project Public License ,
    format    = \scshape ,
    pdfstring = LPPL ,
    accsupp   = LPPL ,
    index-cmd = \csname @gobble\endcsname
  }
\def\lppl{\acs{lppl}}
\DeclareAcronym{MP}
  {
    short = MP ,
    long  = Member of Parliament ,
    long-plural-form = Members of Parliament
  }
\DeclareAcronym{nato}
  {
    short        = nato ,
    long         = North Atlantic Treaty Organization ,
    extra        = \emph{deutsch}: Organisation des Nordatlantikvertrags ,
    short-format = \scshape
  }
\DeclareAcronym{ny}
  {
    short        = NY ,
    short-plural = ,
    long         = New York ,
    long-plural  = ,
    class        = city ,
    cite         = NewYork
  }
\DeclareAcronym{ot}
  {
    short        = ot ,
    long         = Other Test ,
    short-format = \scshape
  }
\DeclareAcronym{pdf}
  {
    short     = pdf ,
    long      = Portable Document Format ,
    format    = \scshape ,
    pdfstring = PDF ,
    accsupp   = PDF
  }
\DeclareAcronym{sw}
  {
    short       = SW ,
    long        = Sammelwerk ,
    long-plural = e
  }
\DeclareAcronym{test}
  {
    short = ST ,
    long  = Some Test
  }
\DeclareAcronym{tex.sx}
  {
    short = \TeX.sx ,
    sort  = TeX.sx ,
    long  = \TeX{} StackExchange
  }
\DeclareAcronym{ufo}{
   short           = UFO ,
   long            = unidentified flying object ,
   long-indefinite = an
}


\makeatletter
\protected\def\@versionstar{\raisebox{-.25em}{*}}
\newcommand\versionstar{\texorpdfstring{\@versionstar}{*}}
\makeatother

\newcommand*\latin{\textit}

\makeatletter
\newcommand*\TF{\textcolor{red}{\uline{\code{\textcolor{cs}{\textit{TF}}}}}}
\renewenvironment{commands}
  {%
    \cnltx@set@catcode_{12}%
    \let\command\cnltx@command
    \cnltxlist
  }
  {\endcnltxlist}
\makeatother

\newcommand*\mailto[1]{\texttt{\href{mailto:#1}{#1}}}

\begin{document}
\section{Licence and Requirements}
\license

\acro\ loads and needs the following packages:
\pkg{expl3}\footnote{\CTANurl{l3kernel}}, \pkg{xparse}, \pkg{xtemplate},
\pkg{l3keys2e}\footnote{\CTANurl{l3packages}},
\pkg{zref-abspage}\footnote{\CTANurl{oberdiek}} and
\needpackage{translations}~\cite{pkg:translations}.

\section{Basics}
\subsection{Creating New Acronyms}
Acronyms are created with the command \cs{DeclareAcronym}.
\begin{commands}
  \command{DeclareAcronym}[\marg{id}\marg{list of keys}]
    The basic command for declaring an acronym.
\end{commands}
This command understands a number of keys which are listed below.  Some of
them are not described immediately but at appropriate places in the
documentation.
\begin{options}
  %% short
  \keyval{short}{text}\Default!
    The short form of the acronym.  This option is required: an acronym must
    have a short form.  If this is set it \emph{must} be set as first option!
    If another option is set first and notices the \option{short} option
    missing it assumes that the \acs{id} should be used as short version and
    sets it accordingly.  A warning will be written to the log then.
  %% long
  \keyval{long}{text}\Default!
    The long form of the acronym.  This option is required: an acronym must
    have a description.
  %% short-plural
  \keyval{short-plural}{text}\Default{s}
    The plural ending appended to the short form.
  %% short-plural-form
  \keyval{short-plural-form}{text}
    The\sinceversion{2.0} plural short form of the acronym; replaces the short
    form when used instead of appending the plural ending.
  %% long-plural
  \keyval{long-plural}{text}\Default{s}
    The plural ending appended to the long form.
  %% long-plural-form
  \keyval{long-plural-form}{text}
    Plural long form of the acronym; replaces the long form when used
    instead of appending the plural ending.
   %% alt-plural
  \keyval{alt-plural}{text}\Default{s}
    The\sinceversion{2.0} plural ending appended to the alternative form.
  %% alt-plural-form
  \keyval{alt-plural-form}{text}
    The\sinceversion{2.0} plural alternative form of the acronym; replaces the
    alternative form when used instead of appending the plural ending.
  %% list
  \keyval{list}{text}
    If specified this will be written in the list as description instead of
    the long form.
  %% short-indefinite
  \keyval{short-indefinite}{text}\Default{a}
    Indefinite article for the short form.
  %% long-indefinite
  \keyval{long-indefinite}{text}\Default{a}
    Indefinite article for the long form.
  %% long-pre
  \keyval{long-pre}{text}
    \meta{text} is prepended to the long form in the text but not in the list
    of acronyms.
  %% long-post
  \keyval{long-post}{text}
    \meta{text} is appended to the long form in the text but not in the list
    of acronyms.
  %% long-post
  \keyval{post}{text}
    \meta{text}\sinceversion{2.8} is appended to the acronym in the text but
    not in the list of acronyms.
  %% alt
  \keyval{alt}{text}
    Alternative short form.
  %% alt-indefinite
  \keyval{alt-indefinite}{text}\Default{a}
    Indefinite article for the alternative form.
  %% extra
  \keyval{extra}{text}
    Extra information to be added in the list of acronyms.
  %% foreign
  \keyval{foreign}{original long form}
    Can be useful when dealing with acronyms in foreign languages, see
    section~\vref{ssec:foreign} for details.
  %% foreign-lang
  \keyval{foreign-lang}{language}
    \sinceversion{2.3}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}.
  %% single
  \keyval{single}{text}
    \sinceversion{2.3}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
    \keyis{single}{true} is active.
  %% sort
  \keyval{sort}{text}
    If used the acronym will be sorted according to this key instead of its
    \acs{id}.
  %% class
  \keyval{class}{csv list}
    The\changedversion{2.4} class(es) the acronym belongs to.
  %% cite
  \keylit{cite}{\oarg{prenote}\oarg{postnote}\marg{citation keys}}
    A citation that is printed to the acronym according to an option explained
    later.
  %% short-format
  \keyval{short-format}{\TeX{} code}
    The format used for the short form of the acronym.
  %% long-format
  \keyval{long-format}{\TeX{} code}
    The format used for the long form of the acronym.
  %% first-long-format
  \keyval{first-long-format}{\TeX{} code}
    The format used for the first long form of the acronym as set with \cs{ac},
    \cs{acf} or \cs{acflike} and their uppercase, plural and indefinite forms.
  %% single-format
  \keyval{single-format}{\TeX{} code}
    \sinceversion{2.3}The format used for the acronym if the acronym is only
    used a single time.
  %% first-style
  \keychoice{first-style}{default,empty,square,short,long,reversed,footnote,sidenote,%
    footnote-reversed,sidenote-reversed}
    \sinceversion{2.3}The style of the first appearance of the acronym, see
    also section~\ref{sec:opti-regard-acronyms}.
  %% pdfstring
  \keylit{pdfstring}{\meta{text}/\meta{plural ending}}
    \changedversion{2.4b}Used as \acs{pdf} string replacement in bookmarks
    when used together with the \pkg{hyperref} package.  The appended plural
    ending is optional.  If you leave it (\emph{and} the \code{/}) the default
    ending is used.  \meta{text} is expanded before it is saved.
  %% accsupp
  \keyval{accsupp}{text}
    Sets the \code{ActualText} key as presented by the \pkg{accsupp} package
    for the acronym.
  %% tooltip
  \keyval{tooltip}{text}
    \sinceversion{2.1}Sets the tooltip description for an acronym.  For
    actually getting tooltips you also need an appropriate setting of the
    \option{tooltip-cmd} option or to set the package option
    \option{tooltip}.
  %% index-sort
  \keyval{index-sort}{text}
    If you use the package option \option{index} every occurrence of an
    acronym is recorded to the index and sorted by its \acs{id} or (if set) by
    the value of the \option{sort} key.  This key allows to set an individual
    sorting option for the index.  See section~\vref{ssec:index} for details.
  %% index
  \keyval{index}{text}
    This key allows to overwrite the automatic index entry with an arbitrary
    one.  See section~\vref{ssec:index} for details.
 %% index-cmd
  \keyval{index-cmd}{control sequence}
    This key let's you set an individual index creating command for this
    acronym.  It should be a command that takes one mandatory argument.  See
    section~\vref{ssec:index} for details. 
\end{options}

In its simplest form an acronym needs a short and a long form.  Please note
that both keys \emph{must} be set and that the \option{short} key \emph{must}
always be the \emph{first} key that is set.
\begin{sourcecode}
  % preamble:
  \DeclareAcronym{test}{
    short = ST ,
    long  = Some Test
  }
\end{sourcecode}
This creates the acronym ``\acs{test}'' with the \acs{id} ``test'' and the
long form ``\acl{test}.''

The \option{format} key allows you to choose a specific format for the short
form of an acronym:
\begin{sourcecode}
  % preamble:
  \DeclareAcronym{ot}{
    short        = ot ,
    long         = Other Test ,
    short-format = \scshape
  }
\end{sourcecode}
The short form now looks like this: \acs{ot}.

The \option{cite} key needs a bit explaining.  It expects arguments like the
standard \cs*{cite} command, \latin{i.e.}, two optional arguments setting the
\meta{prenote} and \meta{postnote} and one mandatory argument setting the
citation key.
\begin{sourcecode}
  % preamble:
  \DeclareAcronym{ny}{
    short        = NY ,
    short-plural = ,
    long         = New York ,
    long-plural  = ,
    cite         = {NewYork} 
  }
\end{sourcecode}

\begin{sourcecode}[sourcecode-options={style=cnltx-bibtex}]
  % bib file for use with biber/biblatex:
  @online{NewYork,
    author  = {Wikipedia},
    title   = {New York City},
    urldate = {2012-09-27},
    url     = {http://en.wikipedia.org/wiki/New_York_City},
    year    = {2012}
  }
\end{sourcecode}
The first appearance now looks as follows\footnote{The appearance of the
  citation of course depends on the citation style you're using.}: \acf{ny}.

\subsection{Logging of Acronyms}
When you activate \acro's option\sinceversion{2.5} \option{log} \acro' writes
information about the acronyms it defines to the log file.
\begin{options}
  \keychoice{log}{\default{true},false,silent,verbose}\Default{false}
    When set to \code{true}/\code{silent} \acro{} writes the main properties
    of an acronym to the log file.  When set to \code{verbose} \acro' writes
    \emph{all}  properties of an acronym to the log file.
\end{options}

This is an example of the logging info with \keyis{log}{true} or
\keyis{log}{silent}.
\begin{sourcecode}
  =================================================
  | acro info -- defining new acronym:
  |   ID = {jpg}
  |   short = {JPEG}
  |   long = {Joint Photographic Experts Group}
  |   alt = {JPG}
  |   sort = {jpeg}
  |   class = {}
  |   list = {}
  |   extra = {}
  |   foreign = {}
  |   pdfstring = {}
  |   cite = {}
  =================================================
\end{sourcecode}

\subsection{Using the Acronyms -- the Commands}\label{sec:using-acronyms-comm}
Acronyms are used with one of the following commands:
\begin{commands}
  \command{ac}[\sarg\marg{id}]
    basic command; the first output is different from subsequent ones.
  \command{Ac}[\sarg\marg{id}]
    same as \cs{ac} but capitalizes the first letter of the long form.
  \command{acs}[\sarg\marg{id}]
    \h{s}hort form; the actual acronym.
  \command{acl}[\sarg\marg{id}]
    \h{l}ong form; the meaning of the acronym.
  \command{Acl}[\sarg\marg{id}] 
    same as \cs{acl} but capitalizes first letter.
  \command{aca}[\sarg\marg{id}]
    \h{a}lternative short form as specified in the \option{alt} key of
    \cs{DeclareAcronym}; if it hasn't been specified this is identical to
    \cs{acs}.
  \command{acf}[\sarg\marg{id}]
    first form; output like the first time \cs{ac} is output.
  \command{Acf}[\sarg\marg{id}]
    same as \cs{acf} but capitalizes first letter of the long form.
  \command{acp}[\sarg\marg{id}]
    \h{p}lural form of \cs{ac};
  \command{Acp}[\sarg\marg{id}]
    same as \cs{acp} but capitalizes first letter of the long form.
  \command{acsp}[\sarg\marg{id}]
    plural form of \cs{acs};
  \command{aclp}[\sarg\marg{id}]
    plural form of \cs{acl};
  \command{Aclp}[\sarg\marg{id}]
    same as \cs{aclp} but capitalizes first letter.
  \command{acap}[\sarg\marg{id}]
    plural form of \cs{aca};
  \command{acfp}[\sarg\marg{id}]
    plural form of \cs{acf};
  \command{Acfp}[\sarg\marg{id}]
    same as \cs{acfp} but capitalizes first letter of the long form.
\end{commands}
If an acronym is used the first time with \cs{ac} its output is different from
subsequent uses.  To be clear on this: the first time!  If the acronym has
been used with \emph{any} of the output commands before it is \emph{not} the
first time any more.

If you use the starred variant an acronym will not be marked as used.  This
proves useful if an acronym is typeset in a section title, for example, since
then the appearance in the table of contents won't mark it as used.

\begin{example}[side-by-side]
  % preamble:
  % \DeclareAcronym{cd}{
  %   short        = cd ,
  %   long         = Compact Disc ,
  %   short-format = \scshape
  % }
  first time: \ac{cd} \\
  second time: \ac{cd} \\
  short: \acs{cd} \\
  alternative: \aca{cd} \\
  first again: \acf{cd} \\
  long: \acl{cd} \\
  short plural: \acsp{cd} \\
  long plural: \aclp{cd}
\end{example}

\subsection{Plural Forms}
If an acronym is defined in the standard way \acro\ uses an `s' that's appended
to both the short and the long form when one of the plural commands is used.
However, that is not always the best solution.  For one thing not all acronyms
may have a plural form.  Second, the plural form especially of the long forms
may be formed differently.  And third, other languages can have other plural
endings.

For these reasons \cs{DeclareAcronym} can get the following keys:
\begin{options}
  \keyval{short-plural}{text}\Default{s}
    The plural ending of the short form.
  \keyval{long-plural}{text}\Default{s}
    The plural ending of the long form.
  \keyval{long-plural-form}{text}
    An alternative plural form for the long form.
\end{options}
These keys are optional.  If they're not used, the default setting is
\code{s}.  If you use \option{long-plural-form} the long form will be replaced
by the specified plural form when necessary.

Suppose we define the following acronyms:
\begin{sourcecode}
  \DeclareAcronym{cd}{
    short        = cd ,
    long         = Compact Disc ,
    short-format = \scshape
  }
  \DeclareAcronym{ny}{
    short        = NY ,
    short-plural = ,
    long         = New York ,
    long-plural  =
  }
  \DeclareAcronym{sw}{
    short       = SW ,
    long        = Sammelwerk ,
    long-plural = e
  }
  \DeclareAcronym{MP}{
    short            = MP ,
    long             = Member of Parliament ,
    long-plural-form = Members of Parliament
  }
\end{sourcecode}
These acronyms now have the following plural appearances:
\begin{example}[side-by-side]
  \acsp{cd}, \aclp{cd} \\
  \acsp{ny}, \aclp{ny} \\
  \acsp{sw}, \aclp{sw} \\
  \acsp{MP}, \aclp{MP}
\end{example}

In the default setting the format of the long or short form is not extended to
the plural ending which might look strange if you choose bold weight as
format, for example.  In this case you can tell \acro\ to extend the format.
\begin{options}
  \keybool{format-include-endings}\Default{false}
    Tell\sinceversion{2.8} \acro\ to use the format of the base form for the
    endings, too.
\end{options}
For a more general view on endings please read section
\vref{sec:about-plural-forms}.

\subsection{Alternative Short Forms}
For some acronyms it might be useful to have alternative forms.  For this
\cs{DeclareAcronym} has another key:
\begin{options}
 \keyval{alt}{text}
   Alternative short form.
\end{options}
\begin{example}
  % preamble:
  % \DeclareAcronym{jpg}{
  %   short = JPEG ,
  %   sort  = jpeg ,
  %   alt   = JPG ,
  %   long  = Joint Photographic Experts Group
  % }
  default: \acs{jpg} \\
  alt.: \aca{jpg}
\end{example}
The alternative form uses the same plural ending as the default short form and
is formatted in the same way.

\subsection{Extra Information for the List Entry}
Of course you can print a list of acronyms where their meaning is explained.
Sometimes it can be useful to add additional information there.  This is done
with another key to \cs{DeclareAcronym}:
\begin{options}
  \keyval{extra}{text}
    Additional information for the list of acronyms.
\end{options}
These information will only be displayed in the list.  See
section~\vref{sec:print_lists} for the impact of the following example.

\begin{example}
  % preamble:
  % \DeclareAcronym{nato}{
  %   short        = nato ,
  %   long         = North Atlantic Treaty Organization ,
  %   extra        = \textit{deutsch}: Organisation des Nordatlantikvertrags ,
  %   short-format = \scshape
  % }
  The \ac{nato} is an intergovernmental military alliance based on the
  North Atlantic Treaty which was signed on 4~April 1949. \ac{nato}
  headquarters are in Brussels, Belgium, one of the 28 member states
  across North America and Europe, the newest of which, Albania and
  Croatia, joined in April 2009.
\end{example}

\subsection{Foreign Language Acronyms}\label{ssec:foreign}
I repeatedly read the wish for being able to add translations to acronyms when
the acronyms stem from another language than the document language,
\latin{i.e.}, something like the following in a German document:
\begin{example}[side-by-side]
  \ac{ecu}\\
  \ac{ecu}
\end{example}
That's why I decided to add the following properties:
\begin{options}
  \keyval{foreign}{original long form}
    A description for an acronym originating in another language than the
    document language.
  \keyval{foreign-lang}{language}
    \sinceversion{2.3}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}.
\end{options}

Here is the definition of the above mentioned \ac{ecu} acronym:
\begin{sourcecode}
  \DeclareAcronym{ecu}{
    short   = ECU ,
    long    = Steuerger\"at ,
    foreign = Electronic Control Unit ,
    foreign-lang = english
  }
\end{sourcecode}
As you have seen this adds the \option{foreign} entry to the first appearance
of an acronym.  It is also added in parentheses to the list of acronyms after
the \option{long} entry.  Actually the entry there is the argument to the
following command:
\begin{commands}
  \command{acroenparen}[\marg{argument}]
    Places \meta{argument} in parentheses: \cs{acroenparen}\Marg{example}:
    \acroenparen{example}.  See page~\pageref{key:list-foreign-format} for a
    way to customize this other than redefining it.
\end{commands}

\section{Additional Commands and Possibilities}
\subsection{Indefinite Forms}

Unlike many other languages\footnote{Let's better say: unlike the other
  languages where I know at least the basics.} in English the indefinite
article is not determined by the grammatical case, gender or number but by the
pronounciation of the following word.  This means that the short and the long
form of an acronym can have different indefinite articles.  For these cases
\acro\ offers the keys \option{short-indefinite}, \option{alt-indefinite} and
\option{long-indefinite} whose default is \code{a}.  For every lowercase
singular command two alternatives exist, preceded by \code{i} and \code{I},
respectively, which output the lowercase and uppercase version of the
corresponding indefinite article.

\begin{example}
  % preamble:
  % \DeclareAcronym{ufo}{
  %   short           = UFO ,
  %   long            = unidentified flying object ,
  %   long-indefinite = an
  % }
  \Iac{ufo}; \iacs{ufo}; \iacl{ufo}
\end{example}

\subsection{Uppercasing}
\begin{commands}
  \command{acfirstupper}[\marg{token list}]
     This command uppercases the first token in \meta{token list}.  The
     command is less powerful than \cs{makefirstuc} that is provided by the
     \pkg{mfirstuc} package~\cite{pkg:mfirstuc} but it is expandable.  Obvious
     downsides are for example that it does not uppercase accented letters.
\end{commands}

\subsection{Simulating the First Appearance}\label{sec:simul-first-appe}
Users told me\footnote{Well -- one, to be precise ;)} that there are cases
when it might be useful to have the the acronym typeset according to the
\option{first-style} but with another text than the long form.  For such cases
\acro\ offers the following commands.
\begin{commands}
  \command{acflike}[\sarg\marg{id}\marg{instead of long form}]
    Write some alternative long form for acronym with \acs{id} \meta{id} as if
    it were the first time the acronym was used.
  \command{acfplike}[\sarg\marg{id}\marg{instead of long form}]
    Plural form of \cs{acflike}.
\end{commands}

\begin{example}[side-by-side]
  \acsetup{first-style=footnote}
  \acflike{ny}{the big apple}
\end{example}

The plural ending in \cs{acfplike} is only appended to the short form.  It
makes no sense to append it to the text that is inserted manually anyway.
Note that whatever text you're inserting might be gobbled depending on the
\option{first-style} you're using.

\subsection{Fetching the Single Appearance}
There\sinceversion{2.3} are macros that fetch the \emph{single} appearance of
an acronym even if it has been used more than once and the \option{single}
option is active.
\begin{commands}
  \command{acsingle}[\sarg\marg{id}]
    Write acronym as if it were used only a single time.
  \command{Acsingle}[\sarg\marg{id}]
    Uppercase form of \cs{acsingle}.
\end{commands}

\begin{example}[side-by-side]
  \acsingle{ny}
\end{example}

\subsection{Using Classes}
The acronyms of \acro\ can be divided into different classes.  This doesn't
change the output but allows different acronym lists, see
section~\vref{sec:print_lists}.  For this \cs{DeclareAcronym} has an additional
key:
\begin{options}
  \keyval{class}{csv list}
    Associated\changedversion{2.4} class(es) for an acronym.
\end{options}

This might be useful if you can and want to divide your acronyms into
different types, technical and grammatical ones, say, that shall be listed in
different lists.  Since every acronym can get a list of associated classes
those classes can effectively be used like tags for filtering acronyms.

\begin{example}[side-by-side]
  % preamble:
  % \DeclareAcronym{la}{
  %   short        = LA ,
  %   short-plural = ,
  %   long         = Los Angeles ,
  %   long-plural  = ,
  %   class        = city
  % }
  % \DeclareAcronym{ny}{
  %   short        = NY ,
  %   short-plural = ,
  %   long         = New York ,
  %   long-plural  = ,
  %   class        = city ,
  %   cite         = NewYork
  % }
  \acl{la} (\acs{la}) \\
  \acl{ny} (\acs{ny})
\end{example}

\subsection{Reset or Mark as Used, Test if Acronym Has Been Used}

If you want for some reason to fool \acro\ into thinking that an acronym is
used for the first time you can call one of these commands:
\begin{commands}
  \command{acreset}[\marg{comma separated list of ids}]
    This will reset a used acronym such that the next use of \cs{ac} will
    again print it as if it were used the first time.  This will \emph{not}
    remove an acronym from being printed in the list if it actually \emph{has}
    been used before.
  \command{acresetall}
    Reset all acronyms.
  \command{acifused}[\marg{id}\marg{true}\marg{false}]
    This command tests if the acronym with \ac{id} \meta{id} has already been
    used and either puts \code{true} or \code{false} in the input stream.
  \command{aciffirst}[\marg{true}\marg{false}]
    To\sinceversion{2.8} be used inside of acronym definitions in order to
    test if we are inside the first instance of the acronym or not.
\end{commands}
\begin{example}[side-by-side]
  \acreset{ny}\ac{ny}
\end{example}
Beware that both commands act \emph{globally}!  There are also commands that
effectively do the opposite of \cs{acreset}, \latin{i.e.}, mark acronyms as
used:
\begin{commands}
  \command{acuse}[\marg{comma separated list of ids}]
    This has the same effect as if an acronym had been used twice, that is,
    further uses of \cs{ac} will print the short form and the acronym will in
    any case be printed in the list (as long as its class is not excluded).
  \command{acuseall}
    Mark all acronyms as used.
\end{commands}
Then there are two further commands related to using acronyms:
\begin{commands}
  \command{acswitchoff}
    This\sinceversion{2.6} command is for patching in certain situations.  For
    example some table environments like \env*{tabularx} or \env*{tabu} pass
    their content two or more times for determining the width of the table
    columns.  Those can be patched to add \cs{acswitchoff} to their trial
    phase.
  \command{acswitchon}
    Effectively\sinceversion{2.6} the opposite of \cs{acswitchoff} -- this
    command should probably never be needed.
\end{commands}

\subsection{\cs*{ac} and Friends in \acs*{pdf} Bookmarks, Accessibility
  Support, Tooltips}
\subsubsection{\acs*{pdf} Bookmarks}
\acro's commands usually are not expandable which means they'd leave unallowed
tokens in \acs{pdf} bookmarks.  \pkg{hyperref} offers \cs*{texorpdfstring} to
circumvent that issue manually but that isn't really a nice solution.  What's
the point of having macros to get output for you if you have to specify it
manually after all?

That is why \acro\ offers a preliminary solution for this.  In a bookmark
every \cs{ac} like command falls back to a simple text string typesetting what
\cs{acs} would do (or \cs{acsp} for plural forms).  These text strings both
can accessed manually and can be modified to an output reserved for \acs{pdf}
bookmarks.

\begin{commands}
  \command{acpdfstring}[\marg{id}]
    Access the text string used in \acs{pdf} bookmarks.
  \command{acpdfstringplural}[\marg{id}]
    Access the plural form of the text string used in \acs{pdf} bookmarks.
\end{commands}
\begin{options}
  \keylit{pdfstring}{\Marg{\meta{pdfstring}/\meta{plural ending}}}
    Key for \cs{DeclareAcronym} to declare a custom text string for \acs{pdf}
    bookmarks.  The plural ending can be set optionally.
\end{options}

For example the \acs{pdf} acronym used in the title for this section is defined
as follows:
\begin{sourcecode}
  \DeclareAcronym{pdf}{
    short     = pdf ,
    long      = Portable Document Format ,
    format    = \scshape ,
    pdfstring = PDF ,
    accsupp   = PDF
  }
\end{sourcecode}

\subsubsection{Accessibility Support}

The last example also demonstrates the \option{accsupp} key.  The idea is to
have something different visible in the \acs{pdf} file compared to what you
get when you select and copy the corresponding string.  In the example visible
string is a lowercase \code{pdf} in small caps while the string copied is an
uppercase \code{PDF}.

For this to work you need to use the \emph{package option} \option{accsupp},
too, which will load the package \pkg{accsupp} if it isn't loaded by the user
already.  Then the key \option{accsupp} will set the \code{ActualText}
property of \cs*{BeginAccSupp}.  Please refer to \pkg{accsupp}'s documentation
for details.  To see its effect copy \ac{pdf} and paste it into a text file.
You should get uppercase letters instead of lowercase ones.

\begin{options}
  \keyval{accsupp}{text}
    Key for \cs{DeclareAcronym} to set the \code{ActualText} property of
    \cs*{BeginAccSupp} (see \pkg{accsupp}'s documentation for details) to be
    used for an acronym.  It only has an effect when the package option
    \option{accsupp} is used, too.
\end{options}

\subsubsection{Tooltips}

The idea of a tooltip is to have some text shown when you hover with the
mouse over the short form of an acronym.  This is only available in some
\acs{pdf} viewers, though.  On possibility for such tooltips is loading the
\pkg{pdfcomment} package~\cite{pkg:pdfcomment} and using its \cs*{pdftooltip}
macro.

\begin{options}
  \keybool{tooltip}\Default{false}
    This\sinceversion{2.1} options loads the \pkg{pdfcomment} package and sets
    the command for creating tooltips to \cs*{pdftooltip}.
  \keyval{tooltip-cmd}{control sequence}\Default{\cs*{@firstoftwo}}
    This\sinceversion{2.1} allows users using another macro for tooltips --
    maybe one provided by another package or some own macro.  It needs to be a
    macro with two mandatory arguments, the first being the string typeset in
    the \acs{pdf}, the second being the tooltip description text.
\end{options}

For using this with acronyms they have a property \option{tooltip} which can
be used inside \cs{DeclareAcronym} for specifying the description text of the
tooltip.  If the \option{tooltip} package option is used but the property is
not set for an acronym then the \option{long} property is used instead.

If an acronym is used inside of another acronym then the tooltips of the
``inner'' acronyms are disabled.

\subsection{Adding Acronyms to the Index}\label{ssec:index}
\acro\ has the package option \option{index}.  If it is used an index entry
will be recorded every time an \emph{unstarred} acronym command is used.  The
index entry will be \code{\meta{id}@\meta{short}},
\code{\meta{sort}@\meta{short}} if the \option{sort} key has been set,
\code{\meta{index-sort}@\meta{short}} if the \option{index-sort} has been set,
or \meta{index} if the key \option{index} has been set for the specific
acronym.  The short versions appearing there are formatted according to the
chosen format of the corresponding acronym, of course.

This document demonstrates the feature.  You can find every acronym that has
been declared in the index.  In order to allow flexibility the indexing
command can be chosen both globally via package option and individually for
every acronym.  This would allow to add acronyms to a specific index if more
than one index is used, for example with help of the \pkg*{imakeidx} package.

I'm not yet convinced this is a feature many people if anyone needs and if
they do if it is flexible enough.  If you have any thoughts on this I'd
appreciate an email.

\section{Printing the List}\label{sec:print_lists}
Printing the whole list of acronyms is easy: just place \cs{printacronyms}
where ever you want the list to be.
\begin{commands}
  \command{printacronyms}[\oarg{options}]
    Print the list of acronyms.
\end{commands}
The commands takes a few options, namely the following ones:
\begin{options}
  \keyval{include-classes}{list of classes}
    Takes a comma-separated list of the classes of acronyms that should be in
    the list.
  \keyval{exclude-classes}{list of classes}
    Takes a comma-separated list of the classes of acronyms that should
    \emph{not} be in the list.  \emph{Note that this list overwrites any
      entries in \option{include-classes}!} If a class is both included and
    excluded then the corresponding acronyms will not be added to the list.
  \keyval{name}{name of the list}
    sets the name for the list.
  \keyval{heading}{sectioning command without leading backslash}%
    \Default{section*}
    Sets the sectioning command for the heading of the list.  A special value
    is \code{none} which suppresses the heading. 
  \keybool{sort}\Default{true}
    Set sorting for this list only.
  \keybool{local-to-barriers}\Default{false}
    This\sinceversion{2.4} option can be used to create a list of only the
    acronyms of the current \enquote{barrier group}, see
    section~\ref{sec:divid-your-docum}.
\end{options}
\begin{example}
  \acsetup{extra-style=comma}
  \printacronyms[exclude-classes=city]
 
  \printacronyms[include-classes=city,name={City Acronyms}]
\end{example}

You can see that the default layout is a \code{description} list with a
\cs*{section}\sarg\ title.  Both can be changed, see
section~\vref{sec:customization}.

The command \cs{printacronyms} needs two \LaTeX{} runs.  This is a precaution
to avoid error messages with a possibly empty list.  But since almost all
documents need at least two runs and often are compiled much more often than
that, this fact shouldn't cause too much inconvenience.

\section{Options and Customization}\label{sec:customization}
\subsection{General Options}
There are a few options which change the general behaviour of \acro.
\default{Underlined} values are used if no value is given.
\begin{options}
  %%
  % \keychoice{version}{0,1}\Default{1}
  %   Provide backwards compatibility for documents set with \acro\ in a version
  %   prior to v1.0.
  %%
  \keychoice{messages}{silent,loud}\Default{loud}
    Setting \keyis{messages}{silent} will turn all of \acro's error messages
    into warnings and all of \acro's warnings into info messages.  Be sure to
    check the log file carefully if you decide to set this option.
  \keybool{single}\Default{false}
    If set to \code{true} an acronym that's used only once (with \cs{ac}) in a
    document will only print the acronym in a specified form and will not be
    printed in the list.
  %%
  \keychoice{single-form}{long,short,alt,first}\Default{long}
    \sinceversion{2.0}Determines how a single appearance of an acronym is
    printed if \keyis{single}{true} has been chosen.
  %%
  \keybool{hyperref}\Default{false}
    If set to \code{true} the short forms of the acronyms will be linked to
    their list entry.
  %%
  \keybool{label}\Default{false}
    If set to \code{true} this option will place
    \cs*{label}\Marg{\meta{prefix}\meta{id}} the first time the acronym with
    \ac{id} \meta{id} is used. 
  %%
  \keyval{label-prefix}{text}\Default{ac:}
    The prefix for the \cs*{label} that is placed when option
    \keyis{label}{true} is used.
  %%
  \keybool{only-used}\Default{true}
    This option is \code{true} as default.  It means that only acronyms that
    are actually used in the document are printed in the list.  If
    \code{false}, all acronyms defined with \cs{DeclareAcronym} will be
    written to the list.
  %%
  \keychoice{mark-as-used}{first,any}\Default{any}
    This option determines wether an acronym is mark as used when the
    \emph{first} form is used the first time (with \cs{ac}, \cs{acf} or
    \cs{acflike} and their uppercase, plural and indefinite forms) or when any
    of the \cs{ac}-like commands is used.   
  %%
  \keybool{macros}\Default{false}
    If set to \code{true} this option will create a macro \cs*{\meta{id}} for
    each acronym as a shortcut for \cs{ac}\marg{id}.  Already existing macros
    will \emph{not} be overwritten.
  %%
  \keybool{xspace}\Default{false}
    If set to \code{true} this option will append \cs*{xspace} from the
    \pkg*{xspace} package to the commands created with the \option{macros}
    option.
  %%
  \keybool{strict}\Default{false}
    If set to \code{true} and the option \keyis{macros}{true} is in effect
    then already existing macros will be overwritten.
  %%
  \keybool{sort}\Default{true}
    If set to \code{true} the acronym list will be sorted automatically.  The
    entries are sorted by their \acs{id} ignoring upper and lower case.  This
    option needs the experimental package \pkg{l3sort} (from the
    \pkg{l3experimental} bundle) and can only be set in the preamble.
  %%
  \keychoice{cite}{\default{all},first,none}\Default{first}
    \changedversion{2.4b}This option decides whether citations that are added
    via \option{cite} are added to each first, every or no appearance of an
    acronym.  If \code{first} is chosen, the option \keyis{single}{true} is
    active and an acronym appears only once it still will get the citation.
  %%
  \keyval{cite-cmd}{control sequence}\Default{\cs*{cite}}
    This option determines which command is used for the citation.  Each
    citation command that takes the cite key as argument is valid, for example
    \pkg*{biblatex}'s \cs*{footcite}.
  %%
  \keyval{cite-connect}{code}\Default{\cs*{nobreakspace}}
    Depending on the citation command in use a space should be inserted before
    the citation or maybe not (e.g.\ \cs*{footcite}\ldots).  This option
    allows you to set this.  Actually it can be used to place arbitrary code
    right before the citation.
  %%
  \keybool{group-citation}\Default{false}
    \sinceversion{2.0}If set to true the short form (or the long form) and the
    citation of an acronym will be printed together in parentheses when an
    acronym is used the first time.
  %%
  \keyval{group-cite-cmd}{control sequence}\Default{\cs*{cite}}
    \sinceversion{2.0}This option determines which command is used for the
    citation when an acronym is used the first time \emph{and}
    \keyis{group-citation}{true}.  Each citation command that takes the cite
    key as argument is valid, for example \pkg*{biblatex}'s \cs*{footcite}.
  %%
  \keybool{index}\Default{false}
    If set to \code{true} an index entry will be recorded every time an
    \emph{unstarred} acronym command is used for the corresponding acronym.
  %%
  \keyval{index-cmd}{control sequence}\Default{\cs*{index}}
    Chooses the index command that is used when option \option{index} has been
    set to \code{true}.
  %%
  \keybool{accsupp}\Default{false}
    Activates the access support as provided by the \pkg{accsupp} package.
  %%
  \keybool{tooltip}\Default{false}
    \sinceversion{2.1}Activates tooltip support for \acro\ using the
    \pkg{pdfcomment} package.
  %%
  \keyval{tooltip-cmd}{control sequence}\Default{\cs*{@firstoftwo}}
    \sinceversion{2.1}A macro taking two mandatory arguments, the first being
    the short form of the acronym and the second being some tooltip
    description.
  %%
  \keyval{uc-cmd}{control sequence}\Default{\cs{acfirstupper}}
    The command that is used to capitalize the first word in the \cs{Ac} and
    the like commands.  You can change it to another one like for example
    \cs*{makefirstuc}\footnote{from the \pkg{mfirstuc} package} or
    \cs*{MakeTextUppercase}\footnote{from the \pkg*{textcase} package}.
\end{options}
 
All options of this and the following sections can be set up either as package
options or via the setup command:
\begin{commands}
  \command{acsetup}[\marg{options}]
   Set up \acro\ anywhere in the document.  Or separate package loading from
   setup.
\end{commands}

\begin{example}
  % with \acsetup{macros}
  we could have used these before: \nato, \ny
\end{example}

\subsection{Options Regarding Acronyms}\label{sec:opti-regard-acronyms}
The options described in this section all influence the layout of one of the
possible output forms of the acronyms.
\begin{options}
  %%
  \keyval{short-format}{format}\Default
    Sets a format for all short forms. For example
    \keyis{short-format}{\cs*{scshape}} would print all short forms in small
    caps.
  %%
  \keyval{long-format}{format}\Default
    The same for the long forms.
  %%
  \keyval{foreign-format}{format}\Default
    The format for the \option{foreign} entry when it appears as part of the
    first appearance of an acronym.
  %%
  \keyval{single-format}{format}\Default
    \sinceversion{2.3}%
    The format for the acronym when it is used only once.  If not specified
    the formatting according to \option{single-form} is used.
  %%
  \keyval{first-long-format}{format}\Default
    The format for the long form on first usage (with \cs{ac}, \cs{acf} or
    \cs{acflike} and their uppercase, plural and indefinite forms).
  %%
  \keyval{list-short-format}{format}\Default
    An extra format for the short entries in the list.  If not used this is
    the same as \option{short-format}.  Please be aware that a call of
    \option{short-format} after this one will overwrite it again.
  %%
  \keyval{list-short-width}{dim}\Default{3em}
    \sinceversion{2.1}This option controls the width reserved for the short
    forms of the acronyms in the \code{lof} list style.
  %%
  \keyval{list-long-format}{format}\Default
    An extra format for the long entries in the list.  If not used this is the
    same as \option{long-format}.  Please be aware that a call of
    \option{long-format} after this one will overwrite it again.
  %%
  \keyval{list-foreign-format}{format}\Default{\cs{acroenparen}}
    \label{key:list-foreign-format}The format for the \option{foreign} entry
    as it appears in the list.  This may be code that ends with a macro that
    takes a mandatory argument.
  %%
  \keyval{extra-format}{format}\Default
    The same for the extra information.
  %%
  \keychoice{first-style}{default,empty,square,short,long,reversed,footnote,sidenote,%
    footnote-reversed,sidenote-reversed}\Default{default}
    The basic style of the first appearance of an acronym.  The value
    \code{sidenote} needs the command \cs*{sidenote} to be defined (for
    example by the \pkg*{sidenotes} package).
  %%
  \keychoice{extra-style}{default,plain,comma,paren,bracket}\Default{default}
    Defines the way the extra information is printed in the list.
  %%
  \keylit{plural-ending}{\meta{short}/\meta{long}}\Default{s/s}
    \changedversion{2.4b}With this option the default plural ending can be
    set.  The appended \meta{long} ending is optional.  If you leave it
    (\emph{and} the \code{/}) the \meta{short} ending is used for both short
    and long versions.
\end{options}
 
\begin{example}[side-by-side]
  % (Keep in mind that we're in
  % a minipage here!)
  \acsetup{first-style=empty}
  empty: \acf{ny} \\
  \acsetup{first-style=footnote}
  footnote: \acf{ny} \\
  \acsetup{first-style=square}
  square: \acf{ny} \\
  \acsetup{first-style=short}
  short: \acf{ny} \\
  \acsetup{first-style=long}
  long: \acf{ny} \\
  \acsetup{first-style=reversed}
  reversed: \acf{ny} \\
  \acsetup{
    first-style = footnote-reversed
  }
  footnote-reversed: \acf{ny}
\end{example}

\subsection{Options Regarding the List}
\begin{options}
  %%
  \keychoice{page-style}{none,plain,comma,paren}\Default{none}
    If this option is set to a value other than \code{none} the page numbers
    of the an acronym appeared on are printed in the list.  Please note that
    this is an experimental feature and might fail in quite a number of cases.
    If you notice anything please send me an email!
  %%
  \keychoice{pages}{all,first}\Default{all}
    If the option \option{page-style} has any value other than \code{none}
    this option determines wether all usages of the acronyms are listed or
    only the first time.  Implicitly sets \keyis{label}{true}.
  %%
  \keyval{page-name}{page name}\Default{p.\cs*{@}\cs*{,}}
    The ``name'' of the page label.  This is automatically translated to the
    active language. However for the time being there are many translations
    missing, yet.  Please notify me if you find your language missing.
  %%
  \keyval{pages-name}{page name plural}\Default{pp.\cs*{@}\cs*{,}}
    The ``name'' of the page label when there are more than one page.  This is
    automatically translated to the active language.  However for the time
    being there are many translations missing, yet.  Please notify me if you
    find your language missing. 
  %%
  \keybool{following-page}\Default{false}
    If set to \code{true} a page range in the list of acronyms that consists
    of two pages will be written by the first page and an appended
    \code{f}. This depends on the option \option{next-page}. 
  %%
  \keybool{following-pages}\Default{false}
    If set to \code{true} a page range in the list of acronyms that set
    consists of more than two pages will be written by the first page and an
    appended \code{ff}. This depends on the option \option{next-pages}.
  %%
  \keybool{following-pages*}\Default{false}
    \sinceversion{2.5}If set to \code{true} this sets both options
    \keyis{following-page}{true} and \keyis{following-pages}{true}.
    \code{false} sets \keyis{following-page}{false} and
    \keyis{following-pages}{false}.
  %%
  \keyval{next-page}{text}\Default{\cs*{,}f.\cs*{@}}
    Appended to a page number when \option{following-page} is set to
    \code{true} and the range is only 2 pages long.  This is automatically
    translated to the active language.  However, for the time being there are
    many translations missing, yet.  Please notify me if you find your
    language missing.
  %%
  \keyval{next-pages}{text}\Default{\cs*{,}ff.\cs*{@}}
    Appended to a page number when \option{following-pages} is set to
    \code{true} and the range is more than 2 pages long.  This is
    automatically translated to the active language.  However, for the time 
    being there are many translations missing, yet.  Please notify me if you
    find your language missing.
  %%
  \keychoice{list-style}{description,lof,longtable,extra-longtable,%
    extra-longtable-rev,extra-tabular,extra-tabular-rev,tabular,toc}%
    \Default{description}
    \changedversion{2.2}Choose with which style the list of acronyms should be
    typeset.  If you choose \meta{longtable}, \code{extra-longtable} or
    \code{extra-longtable-rev} you have to load the
    \pkg{longtable}~\cite{pkg:longtable} package in your preamble.  The values
    \code{extra-\meta{something}} put the extra information in a column of it
    own.  \emph{Be aware that per default \emph{all} \code{extra-table} styles
      only use \code{l} columns.  Since acronym descriptions can easily get
      longer that a line you should probably define your own style if you want
      to use them.}  See section~\vref{sec:lists} for details.
  %%
  \keychoice{list-heading}{chapter,chapter*,section,section*,subsection,%
    subsection*,subsubsection,subsubsection*,addchap,addsec,none}%
  \Default{section*}
    \changedversion{2.0}The heading type of the list. The last two only work
    with a \KOMAScript{} class that also defines the appropriate command.  A
    special value is \code{none} which suppresses the heading.
  %%
  \keyval{list-name}{list name}\Default{Acronyms}
    The name of the list.  This is what's written in the list-heading.  This
    is automatically translated to the active language.  However, for the time
    being there are many translations missing, yet.  Please notify me if you
    find your language missing.
  %%
  \keybool{list-caps}\Default{false}
    Print the first letters of the long form capitalized.
\end{options}

\section{Trailing Tokens and Special Action}

\acro\ has the possibility\sinceversion{2.0} to look ahead for certain tokens
and switch a boolean if it finds them.  Per default \acro\ knows about three
tokens: the \enquote{\code{dot}} (\code{.}), the \enquote{\code{dash}}
(\code{-}) and the \enquote{\code{babel-hyphen}} (\cs*{babelhyphen}).

A token is made known to \acro\ with the following macro:
\begin{commands}
  \command{AcroRegisterTrailing}[\meta{token}\marg{name}]
    This registers the token \meta{token} so \acro\ looks if it follows
    directly after an acronym macro.  \meta{name} is the internal name for
    this token.
\end{commands}
The \acro\ package already registers the above mentioned tokens:
\begin{sourcecode}
  \AcroRegisterTrailing . {dot}
  \AcroRegisterTrailing - {dash}
  \AcroRegisterTrailing \babelhyphen {babel-hyphen}
\end{sourcecode}

If a token is registered it doesn't mean that \acro\ looks for it.  The token
must first be activated for this:
\begin{options}
  \keyval{activate-trailing-tokens}{csv list of token names}
    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-trailing-tokens}{csv list of token names}
    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}

All of the above on its own does nothing visible. However: inside of an
acronym, \ie, for example inside the long or the short form it can be tested
for those trailing tokens:
\begin{commands}
  \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}
\acro\ uses this to define to further macros:
\begin{commands}
  \command{acdot} Inserts a \code{.} if no \code{dot} follows.
  \command{acspace} Inserts a \cs*{space} if no \code{dash} or
    \code{babel-hyphen} follows.
\end{commands}
The definitions are equivalent\footnote{Not \emph{quite}: \acro's definitions
  are engine protected.} to the following code:
\begin{sourcecode}
  \newcommand*\acdot{\aciftrailing{dot}{}{.\@}}
  \newcommand*\acspace{\aciftrailing{dash,babel-hyphen}{}{\space}}
\end{sourcecode}

This could be used to define an acronym as follows:
\begin{sourcecode}
  \DeclareAcronym{etc}{
    short = {\textit{etc}\acdot} ,
    long  = {\textit{et cetera}} ,
    short-plural = , long-plural =
  }
\end{sourcecode}
If now you somewhere use
\begin{sourcecode}
  \ac{etc}.
\end{sourcecode}
there won't be two dots printed.

The command \cs{acspace} is used already in the definition of the first
appearance of a macro.  Let's say you're a German chemist and you have
\begin{sourcecode}
  \DeclareAcronym{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.  This is exactly what
happens it you say
\begin{sourcecode}
  \acsetup{activate-trailing-tokens = {dash,babel-hyphen}}
\end{sourcecode}
in the preamble.

\section{About Page Ranges}
If you enable the \option{page-style} option \acro\ adds page numbers to the list
of acronyms.  In version~0.\versionstar{} it would add a page reference for an
acronym in the list of acronyms that used \cs*{pageref} to refer to the first
appearance of an acronym.  This is retained using \keyis{pages}{first}.
Version~1.0 uses a different approach that doesn't use a label but instead
will list \emph{all} pages an acronym appeared on.  With \pkg{hyperref} the
pages are referenced using \cs*{hyperpage}.

There are some options that control how this list will be typeset, e.g.,
\option{following-page}, \option{next-pages} or the option \option{page-style}
itself.  It is important to mention that the page list will always take at
least two compilation runs until changes in the options or the actual page
numbers affect it.  This is due to the fact that the updated sequence is first
written to the \code{aux} file and only read in during the next run.

\section{Dividing Your Document Into Pieces -- Creating Local
  Lists}\label{sec:divid-your-docum}

\acro\sinceversion{2.4} introduces the concept of \emph{barriers} which can
divide the document into parts. It is possible to create lists of only those
acronyms used between two such barriers.
\begin{commands}
  \command{acbarrier}
    Sets a barrier at the point of use in the document.  The begin and the end
    of the document mark implicit barriers.
\end{commands}
\begin{options}
  \keybool{use-barriers}\Default{false}
    \sinceversion{2.5}If you want to use barriers and local lists you have to
    activate the feature first.  This should be set in the preamble in order
    to work reliably.  Make sure to watch out for log file messages asking you
    to rerun.
  \keybool{reset-at-barriers}\Default{false}
    If this option is set to \code{true} \cs{acbarrier} implicitly calls
    \cs{acresetall}.
  \keybool{local-to-barriers}\Default{false}
    This option can \emph{only} be used as option to the \cs{printacronyms}
    command. It then prints a list of only the acronyms of the current
    \enquote{barrier group}.
\end{options}

\begin{example}
  \acbarrier
  \printacronyms[local-to-barriers]
  \ac{ctan} and \ac{lppl}
  \acbarrier
\end{example}

\section{Language Support}
\acro\ detects if packages \pkg{babel}~\cite{pkg:babel} or
\pkg{polyglossia}~\cite{pkg:babel} are being loaded and tries to adapt certain
strings to match the chosen language.  However, due to my limited language
knowledge only a few translations are provided.  I'll show how the English
translations are defined so you can add the translations to your preamble if
needed.  Even better would be you'd send me a short email to
\mailto{contact@mychemistry.eu} with the appropriate translations for your
language and I'll add them to \acro.

\begin{sourcecode}
  \DeclareTranslation{English}{acronym-list-name}{Acronyms}
  \DeclareTranslation{English}{acronym-page-name}{p.}
  \DeclareTranslation{English}{acronym-pages-name}{pp.}
  \DeclareTranslation{English}{acronym-next-page}{f.}
  \DeclareTranslation{English}{acronym-next-pages}{ff.}
\end{sourcecode}

\section{hyperref Support}
The option \keyis{hyperref}{true} adds internal links from all short (or
alternative) forms to their respective list entries.  Of course this only
works if you have loaded the \pkg{hyperref} package in your preamble.  You
should use this option with care: if you don't use \cs{printacronyms} anywhere
this option will result in loads of \pkg{hyperref} warnings.  Also printing
several lists can result in warnings if don't clearly separate the lists into
different classes.  If an acronym appears in more than one list there will
also be more than one hypertarget for this acronym.

Using \pkg{hyperref} will also add \cs*{hyperpage} to the page numbers in the
list (provided they are displayed in the style chosen).  Like with an index
the references will thus not point to the acronyms directly but to the page
they're on.

\section{Defining Own Acronym Macros}\label{sec:defining-own-acronym}

The commands\sinceversion{2.0} explained in
section~\vref{sec:using-acronyms-comm} have all been defined with a dedicated
command -- there is a family of dedicated commands, actually:
\begin{commands}
  \command{NewAcroCommand}[\marg{cs}\marg{code}]
    Defines a new \acro\ acronym command \meta{cs}.  This sets up the
    necessary framework needed by acronym commands and defines \meta{cs} with
    an optional star argument and a mandatory argument for the acronym id
    using \pkg{xparse}'s \cs*{NewDocumentCommand}. Inside \meta{code} one can
    refer to the \acs{id} \meta{id} with \code{\#1}.
  \command{RenewAcroCommand}[\marg{cs}\marg{code}]
    Defines a new \acro\ acronym command \meta{cs}.  This sets up the
    necessary framework needed by acronym commands and defines \meta{cs} with
    an optional star argument and a mandatory argument for the acronym id
    using \pkg{xparse}'s \cs*{RenewDocumentCommand}. Inside \meta{code} one
    can refer to the \acs{id} \meta{id} with \code{\#1}.
  \command{DeclareAcroCommand}[\marg{cs}\marg{code}]
    Defines a new \acro\ acronym command \meta{cs}.  This sets up the
    necessary framework needed by acronym commands and defines \meta{cs} with
    an optional star argument and a mandatory argument for the acronym id
    using \pkg{xparse}'s \cs*{DeclareDocumentCommand}. Inside \meta{code} one
    can refer to the \acs{id} \meta{id} with \code{\#1}.
  \command{ProvideAcroCommand}[\marg{cs}\marg{code}]
    Defines a new \acro\ acronym command \meta{cs}.  This sets up the
    necessary framework needed by acronym commands and defines \meta{cs} with
    an optional star argument and a mandatory argument for the acronym id
    using \pkg{xparse}'s \cs*{ProvideDocumentCommand}. Inside \meta{code} one
    can refer to the \acs{id} \meta{id} with \code{\#1}.
\end{commands}

Inside these macros one can use a number of low-level expl3
commands\footnote{Which is why you need to use them inside an expl3
  programming environment.  This means in the preamble surround the
  definitions with \cs*{ExplSyntaxOn} and \cs*{ExplSyntaxOff}.}.

\paragraph{Acronym fetching commands}
\begin{commands}
  \command*{acro_use:n}[ \marg{id}]
    Fetches the acronym using either the first or the short form depending on
    earlier uses.
  \command*{acro_short:n}[ \marg{id}]
    Fetches the short form of the acronym.
  \command*{acro_long:n}[ \marg{id}]
    Fetches the long form of the acronym.
  \command*{acro_alt:n}[ \marg{id}]
    Fetches the alternative short form of the acronym.
  \command*{acro_foreign:n}[ \marg{id}]
    Fetches the foreign property of the acronym if available.
  \command*{acro_extra:n}[ \marg{id}]
    Fetches the extra property of the acronym if available.
\end{commands}

\paragraph{Acronym setup commands}
\begin{commands}
  \command*{acro_first_upper:}
    \acro\ setup command which tells the macros above that we want to
    uppercase the first letter of the long version.  Should be used
    \emph{before} one of the acronym fetching commands.
  \command*{acro_plural:}
    \acro\ setup command which tells the macros above that we want to use
    plural forms. Should be used \emph{before} one of the acronym fetching
    commands.
  \command*{acro_indefinite:}
    \acro\ setup command which tells the macros above that we want to add the
    indefinite article.  Should be used \emph{before} one of the acronym
    fetching commands.
  \command*{acro_cite:}
    \acro\ setup command which tells the macros above that we want to add the
    citation in any case independent of the option \option{cite}.  Should be
    used \emph{before} one of the acronym fetching commands.
  \command*{acro_no_cite:}
    \acro\ setup command which tells the macros above that we want to have no
    citation independent of the option \option{cite}.  Should be used
    \emph{before} one of the acronym fetching commands.
  \command*{acro_index:}
    \acro\ setup command which tells the macros above that we want to add an
    index entry in any case independent of the option \option{index}.  Should
    be used \emph{before} one of the acronym fetching commands.
  \command*{acro_reset_specials:}
    This\sinceversion{2.0b} macro is called implicitly by \cs{NewAcroCommand}
    and \cs{NewPseudoAcroCommand}.  If you plan to define an \acro\ command by
    yourself using \cs*{NewDocumentCommand} this should be the first macro
    after \verbcode+\acro_begin:+.  It ensures that in nested acronyms the
    inner acronyms don't inherit indefinite articles, uppercasing,
    endings\ldots
\end{commands}

\paragraph{Additional macros for further uses}
\begin{commands}
  \command*{acro_begin:}
    When an acronym macro is defined \enquote{by hand}, \ie, \emph{not using
    \cs{NewAcroCommand}} then this must be the first macro in the code.
    \emph{Must have a matching \cs*{acro_end:}}.
  \command*{acro_end:}
    When an acronym macro is defined \enquote{by hand}, \ie, \emph{not using 
    \cs{NewAcroCommand}} then this must be the last macro in the code.
    \emph{Must have a matching \cs*{acro_begin:}}.
  \command*{acro_check_and_mark_if:nn}[ \marg{boolean expression} \marg{id}]
    Checks if the acronym with the \acs{id}  \meta{id} exists and marks it as
    used when \meta{boolean} expression evaluates to \code{true}.  This macro
    is used inside \cs{NewAcroCommand} and friends implicitly.
  \command*{acro_check_acronym:nn}[ \marg{id} \Marg{true|false}]
    Checks if the acronym with the \acs{id} \meta{id} exists and marks it as
    used if \code{true} or doesn't.  This macro is used inside
    \cs*{acro_check_and_mark_if:nn}.
  \command*{acro_use_acronym:n}[ \Marg{true|false}]
    Tell \cs*{acro_use:n} and similar commands wether to mark the acronym as
    used or not.  This macro is used inside \cs*{acro_check_acronym:nn}.  If
    this macro is used explicitly it should be used before \cs*{acro_use:n}
    (or a similar command) otherwise it has no effect.  An acronym marked as
    used cannot be unmarked.
  \command*{acro_mark_as_used:n}[ \marg{id}]
    Explicitly use the acronym with the \acs{id} \meta{id}.  This is the expl3
    macro applied to all entries in \cs{acuse}.
  \expandable\command*{acro_if_acronym_used:n}[\TF\ \marg{id} \marg{true}
  \marg{false}]
    The code-level version of \cs{acifused}.  This macro is expandable.
  \command*{acro_for_all_acronyms_do:n}[ \marg{code}]
    Loops over all acronyms known when the macro is used.  Inside of
    \meta{code} you can refer to the \acs{id} \meta{id} of an acronym with
    \verbcode+#1+.
  \command*{acro_barrier:}
    The code-level version of \cs{acbarrier}.
  \command*{acro_switch_off:}
    The\sinceversion{2.6} expl3 version of \cs{acswitchoff}.
  \command*{acro_switch_on:}
    The\sinceversion{2.6} expl3 version of \cs{acswitchon}.
  \command*{acro_add_action:n}[ \marg{code}]
    Adds\sinceversion{2.7} code to \cs*{acro_get:n}.  Inside of \meta{code}
    you can refer to the \ac{id} of the acronym with \verbcode+#1+.
  \command*{acro_get_property:nn}[\TF\ \marg{id} \marg{property} \marg{true}
    \marg{false}]
    Fetches\sinceversion{2.7} the property \meta{property} of the acronym
    \meta{id} and stores it in a tokenlist variable
    \cs*{l__acro_\meta{property}_tl} where all dashes in the property names
    are replaced with underscores.  \meta{true} is placed in the input stream
    if the property had been set, \meta{false} otherwise.
  \command*{acro_get_property:nn}[\marg{id} \marg{property}]
    Like\sinceversion{2.7} \cs*{acro_get_property:nn}\TF, but without the
    \meta{true} and \meta{false} arguments.
  \command*{acro_if_property:nn}[\TF\ \marg{id} \marg{property} \marg{true}
    \marg{false}]
    Checks\sinceversion{2.7} if the property \meta{property} of the acronym
    \meta{id} is set and places \meta{true} is in the input stream if yes and
    \meta{false} otherwise.
\end{commands}

\paragraph{Examples}
The usage of above macros is best explained with a few examples.  The
following definition is done by \acro:
\begin{sourcecode}
  \NewAcroCommand \ac { \acro_use:n {#1} }
\end{sourcecode}
An equivalent definition for \cs{ac} would be
\begin{sourcecode}
  \NewDocumentCommand \ac {sm}
    {
      \acro_begin:
        \acro_reset_specials:
        \acro_check_and_mark_if:nn {#1} {#2}
        \acro_use:n {#2}
      \acro_end:
    }
\end{sourcecode}
which should explain what the actual framework is which \cs{NewAcroCommand}
adds.

Other definitions by \acro\ are for example the following ones:
\begin{sourcecode}
  \NewAcroCommand \Ac
    {
      \acro_first_upper:
      \acro_use:n {#1}
    }
  \NewAcroCommand \iac
    {
      \acro_indefinite:
      \acro_use:n {#1}
    }
  \NewAcroCommand \acp
    {
      \acro_plural:
      \acro_use:n {#1}
    }
  \NewAcroCommand \Acp
    {
      \acro_plural:
      \acro_first_upper:
      \acro_use:n {#1}
    }
  \NewAcroCommand \Aclp
    {
      \acro_plural:
      \acro_first_upper:
      \acro_long:n {#1}
    }
\end{sourcecode}

\section{About Plural Forms, Possessive Forms and Similar Constructs -- the
  Concept of Endings}\label{sec:about-plural-forms}

\acro\ has a concept of \emph{endings}.  All of \acro's plural options are
defined by saying
\begin{sourcecode}
  \ProvideAcroEnding {plural} {s} {s}
\end{sourcecode}
The command's syntax and what it does is as follows:
\begin{commands}
  \command{ProvideAcroEnding}[\marg{name}\marg{short default}\marg{long default}]
    This macro defines the options
    \begin{itemize}
      \item \option*{\meta{name}-ending},
      \item \option*{short-\meta{name}-ending},
      \item \option*{alt-\meta{name}-ending} and
      \item \option*{long-\meta{name}-ending}.
    \end{itemize}
    It also defines the acronym properties
    \begin{itemize}
      \item \option*{short-\meta{name}},
      \item \option*{short-\meta{name}-form},
      \item \option*{alt-\meta{name}},
      \item \option*{alt-\meta{name}-form},
      \item \option*{long-\meta{name}} and
      \item \option*{long-\meta{name}-form}.
    \end{itemize}
    Additionally it defines a setup macro as
    described in section~\vref{sec:defining-own-acronym},
    \cs*{acro_\meta{name}:}.  If \meta{name} contains a \code{-} (dash) it is
    replaced by \code{\_} before \cs*{acro_\meta{name}:} is built.  So if you
    choose \code{my-name} the corresponding macro is named
    \cs*{acro_my_name:}.  If you use any other non-letters you are on your
    own. \changedversion{2.4b}If you use the command with the same \meta{name}
    a second time the command only resets the defaults.

    Note that you \emph{must use \cs{ProvideAcroEnding} before any acronym
      definition}!
\end{commands}

This could be used together with the macros described in
section~\vref{sec:defining-own-acronym} for adding support for possessive
forms:
\begin{example}
  \ExplSyntaxOn
  % this now only works because I've used the same already in the preamble so
  % it does nothing here:
  \ProvideAcroEnding {possessive} {'s} {'s}

  \ProvideAcroCommand \acg
    {
      \acro_possessive:
      \acro_use:n {#1}
    }
  \ExplSyntaxOff
  The \acg{cd} booklet says\ldots
\end{example}

Please note that different endings are cumulative which you probably want to
avoid! Imagine a macro
\begin{sourcecode}
  \NewAcroCommand \acgp
    {
      \acro_possessive:
      \acro_plural:
      \acro_use:n {#1}
    }
\end{sourcecode}
This would give \enquote{\ac{cd}s's} instead of \enquote{\ac{cd}s'}.  To solve
this you might want to consider
\begin{sourcecode}
    \ProvideAcroEnding {possessive-singular} {'s} {'s}
    \ProvideAcroEnding {possessive-plural}   {s'} {s'}
\end{sourcecode}

\section{More on Customization}\label{sec:more-custom}
\subsection{Background Information}
Several of \acro's objects are customized using templates.  For each of these
objects it is possible to define own templates\footnote{This requires some
knowledge of \pkg{xtemplate} and expl3.  Plans are to provide a documented
interface for users of \acro{} in the future.}.  Possibly more interesting: it
is easily possible to define further instances of an object using a certain
template.  How this works is explained in the following sections. However, the
basics are always the same.  There is a command
\begin{commands}
  \command*{DeclareAcro\meta{object
      type}Style}[\marg{name}\marg{template}\marg{options}]
    which allows to define a new style (\ie, instance) for the object
    \meta{object type} using the template \marg{template}.
\end{commands}

\subsection{Lists}\label{sec:lists}
\subsubsection{Own List Style}

The different existing list styles are all built from four different
templates, \code{list}, \code{list-of}, \code{table} and \code{extra-table}.
Those templates are defined with the help of the \pkg{xtemplate}
package (from~\cite{bnd:l3packages}).  Each of these templates has a few
options which are described in table~\vref{tab:list-templates}.  New list
styles now are defined via the following macro:

\begin{commands}
  \command{DeclareAcroListStyle}[\marg{name}\marg{template}\marg{options}]
    Declares a new \acro\ list style \meta{name}.  \meta{name} will be the
    value which can be chosen in the option \option{list-style}.
    \meta{template} is the name of the template to be used by the style.
    Available templates are listed in table~\ref{tab:list-templates}.
    \meta{options} are the option settings for the corresponding template.
\end{commands}

\begin{table}[hbp]
  \centering
  \caption{Available List Templates and Their Options}\label{tab:list-templates}
  \begin{tabular}{*{4}{>{\ttfamily}l}}
    \toprule
      \normalfont\bfseries Template & \normalfont\bfseries Option &
      \normalfont\bfseries Option Type & \normalfont\bfseries Default \\
    \midrule
      list        & list        & tokenlist & description \\
                  & foreign-sep & tokenlist & \cs*{space} \\
                  & reverse     & boolean   & false \\
                  & before      & tokenlist \\
                  & after       & tokenlist \\
    \midrule
      list-of     & style       & tokenlist & toc \\
                  & foreign-sep & tokenlist & \cs*{space} \\
                  & reverse     & boolean   & false \\
                  & before      & tokenlist \\
                  & after       & tokenlist \\
    \midrule
      table       & table       & tokenlist & tabular \\
                  & table-spec  & tokenlist & lp\{.7\cs*{linewidth}\} \\
                  & foreign-sep & tokenlist & \cs*{space} \\
                  & reverse     & boolean   & false \\
                  & before      & tokenlist \\
                  & after       & tokenlist \\
    \midrule
      extra-table & table       & tokenlist & tabular \\
                  & table-spec  & tokenlist & llll \\
                  & foreign-sep & tokenlist & \cs*{space} \\
                  & reverse     & boolean   & false \\
                  & before      & tokenlist \\
                  & after       & tokenlist \\
    \bottomrule
  \end{tabular}
\end{table}

For defining new styles you need some information on what the different
templates and options do:
\begin{itemize}
  \item The option \code{list} of the \code{list} template sets the list
    environment.  This must be a classic \LaTeX\ list where items are listed
    with \cs*{item}.  In those lists short entries will always be fed as
    optional argument to \cs*{item}: \\
    \code{\cs*{item}[\meta{short}]\meta{long}\meta{extra}\meta{page}}
  \item The template \code{list-of} simulates a table of contents or a list of
    figures.  This can be chosen by setting the option \code{style} to either
    \code{toc} or \code{lof}.
  \item The template \code{table} typesets the list in a table with two
    columns: \\
    \code{\meta{short} \& \meta{long}\meta{extra}\meta{page}
      \cs*{tabularnewline}}
  \item The template \code{extra-table} typesets the list in a table with four
    columns: \\
    \code{\meta{short} \& \meta{long} \& \meta{extra} \& \meta{page}
      \cs*{tabularnewline}}
  \item The option \code{foreign-sep} is the code inserted between long form
    and foreign entry (if a foreign entry is present).
  \item The options \code{before} and \code{after} are inserted directly
    before and after the complete list.
  \item The option \code{reverse} switches the place of \meta{long} with
    \meta{extra}.
  \item The option \code{table-spec} sets the column types for the table
    templates.  It must correspond to the number of columns the corresponding
    template uses.
\end{itemize}

As an example let's define a style \code{longtabu} which uses the corresponding
table environment from the package \pkg{tabu}~\cite{pkg:tabu}:

\begin{sourcecode}
  \usepackage{tabu,longtable}
  \DeclareAcroListStyle{longtabu}{table}{
    table = longtabu ,
    table-spec = @{}>{\bfseries}lX@{}
  }
  \acsetup{list-style=longtabu}
\end{sourcecode}

As another example let's define a new list with the help of the \pkg{enumitem}
package~\cite{pkg:enumitem}:

\begin{sourcecode}
  % preamble:
  % \usepackage{enumitem}
  \newlist{acronyms}{description}{1}
  \newcommand*\addcolon[1]{#1:}
  \setlist[acronyms]{
    labelwidth = 3em,
    leftmargin = 3.5em,
    noitemsep,
    itemindent = 0pt,
    font=\addcolon}
  \DeclareAcroListStyle{mystyle}{list}{ list = acronyms }
  \acsetup{ list-style = mystyle }
\end{sourcecode}
This would look as follows:
\newlist{acronyms}{description}{1}
\newcommand*\addcolon[1]{#1:}
\setlist[acronyms]{
  labelwidth=3em,
  leftmargin=3.5em,
  noitemsep,
  itemindent=0pt,
  font=\addcolon}
\DeclareAcroListStyle{mystyle}{list}{ list = acronyms }
\acsetup{list-style=mystyle,hyperref=false}
\printacronyms

\subsubsection{Own List Heading Command}

With the option \option{list-heading} you can choose which command prints the
heading of the list.  If you need a different choice than what's already
provided you can use the following command to define a new option:
\begin{commands}
  \command{DeclareAcroListHeading}[\marg{name}\marg{control sequence}]
    Defines a new value \meta{name} for the option \option{list-heading}.
    \meta{control sequence} must be a control sequence which takes one
    mandatory argument.
\end{commands}
As an example here is how the value \code{section} is defined:
\begin{sourcecode}
  \DeclareAcroListHeading{section}{\section}
\end{sourcecode}

\subsection{First Styles}
The first styles define how an acronym is typeset when it is used for the
first time.  It is set with the option \option{first-style}.  Legal values for
this option are defined with the following command:
\begin{commands}
  \command{DeclareAcroFirstStyle}[\marg{name}\marg{template}\marg{options}]
    Declares a new \acro\ first style \meta{name}.  \meta{name} will be the
    value which can be chosen in the option \option{first-style}.
    \meta{template} is the name of the template to be used by the style.
    Available templates are listed in table~\ref{tab:first-templates}.
    \meta{options} are the option settings for the corresponding template.
\end{commands}

Here are two examples of the already available styles and how they are
defined:
\begin{sourcecode}
  \DeclareAcroFirstStyle{short}{inline}{
    only-short = true ,
    brackets   = false
  }
  \DeclareAcroFirstStyle{sidenote-reversed}{note}{
    note-command = \sidenote{#1} ,
    reversed     = true
  }
\end{sourcecode}

\begin{table}[hbp]
  \centering
  \caption{Available First Style Templates and Their Options}\label{tab:first-templates}
  \begin{tabular}{*{4}{>{\ttfamily}l}}
    \toprule
      \normalfont\bfseries Template & \normalfont\bfseries Option &
      \normalfont\bfseries Option Type & \normalfont\bfseries Default \\
    \midrule
      inline      & brackets      & boolean   & true \\
                  & brackets-type & tokenlist & () \\
                  & only-short    & boolean   & false \\
                  & only-long     & boolean   & false \\
                  & reversed      & boolean   & false \\
                  & between       & tokenlist \\
                  & foreign-sep   & tokenlist & ,\textasciitilde \\
    \midrule
      note        & use-note     & boolean   & true \\
                  & note-command & function  & \cs*{footnote}\Marg{\#1} \\
                  & reversed     & boolean   & false \\
                  & foreign-sep  & tokenlist & ,\textasciitilde \\
    \bottomrule
  \end{tabular}
\end{table}

\subsection{Extra Styles}
The extra styles define how the extra information of an acronym is typeset in
the list.  It is set with the option \option{extra-style}.  Legal values for
this option are defined with the following command:
\begin{commands}
  \command{DeclareAcroExtraStyle}[\marg{name}\marg{template}\marg{options}]
    Declares a new \acro\ extra style \meta{name}.  \meta{name} will be the
    value which can be chosen in the option \option{extra-style}.
    \meta{template} is the name of the template to be used by the style.
    Available templates are listed in table~\ref{tab:extra-templates}.
    \meta{options} are the option settings for the corresponding template.
\end{commands}

Here are two examples of the already available styles and how they are
defined:
\begin{sourcecode}
  \DeclareAcroExtraStyle{default}{inline}{
    brackets     = false ,
    punct        = true ,
    punct-symbol = .
  }
  \DeclareAcroExtraStyle{paren}{inline}{
    brackets     = true ,
    punct        = true ,
    punct-symbol =
  }
\end{sourcecode}

\begin{table}
  \centering
  \caption{Available Extra Style Templates and Their Options}\label{tab:extra-templates}
  \begin{tabular}{*{4}{>{\ttfamily}l}}
    \toprule
      \normalfont\bfseries Template & \normalfont\bfseries Option &
      \normalfont\bfseries Option Type & \normalfont\bfseries Default \\
    \midrule
      inline      & punct         & boolean   & true \\
                  & punct-symbol  & tokenlist & , \\
                  & brackets      & boolean   & true \\
                  & brackets-type & tokenlist & () \\
    \bottomrule
  \end{tabular}
\end{table}

\subsection{Page Number Styles}
The page number styles define how the page numbers where acronyms have been
used are typeset in the list.  It is set with the option \option{page-style}.
Legal values for this option are defined with the following command:
\begin{commands}
  \command{DeclareAcroPageStyle}[\marg{name}\marg{template}\marg{options}]
    Declares a new \acro\ extra style \meta{name}.  \meta{name} will be the
    value which can be chosen in the option \option{page-style}.
    \meta{template} is the name of the template to be used by the style.
    Available templates are listed in table~\ref{tab:page-templates}.
    \meta{options} are the option settings for the corresponding template.
\end{commands}

Here are two examples of the already available styles and how they are
defined:
\begin{sourcecode}
  \DeclareAcroPageStyle{default}{inline}{
    punct = true ,
    punct-symbol = .
  }
  \DeclareAcroPageStyle{paren}{inline}{
    brackets=true ,
    punct-symbol = ~
  }
\end{sourcecode}

\begin{table}[hbp]
  \centering
  \caption{Available Page Number Style Templates and Their
    Options}\label{tab:page-templates}
  \begin{tabular}{*{3}{>{\ttfamily}l}>{\ttfamily}p{.25\linewidth}}
    \toprule
      \normalfont\bfseries Template & \normalfont\bfseries Option &
      \normalfont\bfseries Option Type & \normalfont\bfseries Default \\
    \midrule
      inline & display       & boolean   & true \\
             & punct         & boolean   & false \\
             & punct-symbol  & tokenlist & , \\
             & brackets      & boolean   & false \\
             & brackets-type & tokenlist & () \\
             & space         & skip      & .333333em plus .166666em minus
                                           .111111em \\
    \bottomrule
  \end{tabular}
\end{table}

\subsection{Configuration Files}
If\sinceversion{2.2} you repeatedly have the same setup and definitions for
\acro\ in your preamble\footnote{For example defining new endings, \acro{}
  commands, list styles, \ldots} you might want to place those in a
configuration file.  If \acro\ finds a file named \code{acro.cfg} present it
inputs it at the end of the package.  The only thing to be aware of is that
this file is input like a package which means that \code{@} is treated as a
letter (category code~11).

\appendix

\acsetup{
  list-style       = description ,
  list-heading     = section ,
  list-name        = All Acronyms Used in this Documentation ,
  page-style       = comma ,
  following-pages* = true ,
  extra-style      = comma
}

\printacronyms

\end{document}