Debian Codegraph @

texmf-dist/doc/latex/acro/examples/acro.example.units.tex

raw
1 \documentclass{scrartcl}
2 \usepackage[T1]{fontenc}
3 \usepackage[ngerman]{babel}
4 \usepackage[version=3]{acro}
5
6 \acsetup{ list/display = all , pages/display = all}
7
8 \usepackage{longtable,siunitx}
9
10 \DeclareAcronym{ecm}{
11 short = ECM ,
12 long = Electro Chemical Machining ,
13 extra = Elektrochemisches Abtragen
14 }
15 \DeclareAcronym{adc}{
16 short = ADC ,
17 long = Analog-to-Digital-Converter
18 }
19 \DeclareAcronym{edm}{
20 short = EDM ,
21 long = Electro Discharge Machining
22 }
23 \DeclareAcronym{ecdm}{
24 short = ECDM ,
25 long = Electro Chemical Discharge Machining ,
26 extra = Kombination aus \acs*{ecm} und \acs*{edm}
27 }
28
29 \DeclareAcroProperty{unit}
30
31 % "Acronyme" (tatsächlich physikalische Größen) einer speziellen Klasse:
32 \DeclareAcronym{f}{
33 short = \ensuremath{f} ,
34 long = Frequenz ,
35 unit = \si{\hertz} ,
36 tag = physics
37 }
38 \DeclareAcronym{A}{
39 short = \ensuremath{A} ,
40 long = Fläche ,
41 unit = \si{\metre^2} ,
42 tag = physics
43 }
44 \DeclareAcronym{C}{
45 short = \ensuremath{C} ,
46 long = Kapazität ,
47 unit = \si{\farad} ,
48 tag = physics
49 }
50 \DeclareAcronym{F}{
51 short = \ensuremath{F} ,
52 long = Kraft ,
53 unit = \si{\newton} ,
54 tag = physics
55 }
56
57 \NewAcroTemplate[list]{physics}{%
58 \acronymsmapT{%
59 \AcroAddRow{%
60 \acrowrite{short}%
61 &
62 \acrowrite{unit}%
63 &
64 \acrowrite{list}%
65 &
66 \acropages
67 {\acrotranslate{page}\nobreakspace}%
68 {\acrotranslate{pages}\nobreakspace}%
69 \tabularnewline
70 }%
71 }%
72 \acroheading
73 \acropreamble
74 \par\noindent
75 \setlength\LTleft{0pt}%
76 \setlength\LTright{0pt}%
77 \begin{longtable}{@{}lll@{\extracolsep{\fill}}l@{}}
78 \AcronymTable
79 \end{longtable}
80 }
81
82 \begin{document}
83
84 erstes Mal: \ac{ecm}
85
86 zweites Mal: \ac{ecm}
87
88 \ac{F}
89
90 % % alle außer der Klasse 'physics' auflisten:
91 \printacronyms[exclude=physics]%, name=Abkürzungsverzeichnis]
92
93 % nur die Klasse 'physics' auflisten:
94 \printacronyms[template=physics, include=physics]%, name=Formelverzeichnis]
95
96 \end{document}