summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/acro/examples/acro.example.units.tex
blob: 7a3ff0b3512e73bf613194d4fa8754280e6f1b9b (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
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[version=3]{acro}

\acsetup{ list/display = all , pages/display = all}

\usepackage{longtable,siunitx}

\DeclareAcronym{ecm}{
  short = ECM ,
  long  = Electro Chemical Machining ,
  extra = Elektrochemisches Abtragen
}
\DeclareAcronym{adc}{
  short = ADC ,
  long  = Analog-to-Digital-Converter
}
\DeclareAcronym{edm}{
  short = EDM ,
  long  = Electro Discharge Machining
}
\DeclareAcronym{ecdm}{
  short = ECDM ,
  long  = Electro Chemical Discharge Machining ,
  extra = Kombination aus \acs*{ecm} und \acs*{edm}
}

\DeclareAcroProperty{unit}

% "Acronyme" (tatsächlich physikalische Größen) einer speziellen Klasse:
\DeclareAcronym{f}{
  short = \ensuremath{f} ,
  long  = Frequenz ,
  unit  = \si{\hertz} ,
  class = physics
}
\DeclareAcronym{A}{
  short = \ensuremath{A} ,
  long  = Fläche ,
  unit  = \si{\metre^2} ,
  class = physics
}
\DeclareAcronym{C}{
  short = \ensuremath{C} ,
  long  = Kapazität ,
  unit  = \si{\farad} ,
  class = physics
}
\DeclareAcronym{F}{
  short = \ensuremath{F} ,
  long  = Kraft ,
  unit  = \si{\newton} ,
  class = physics
}

\NewAcroTemplate[list]{physics}{%
  \def\TableCode{}%
  \acronymsmapT{%
    \AcroPutRight\TableCode{%
      \def\AcronymID{##1}%
      \acrowrite{short}%
      &
      \def\AcronymID{##1}%
      \acrowrite{unit}%
      &
      \def\AcronymID{##1}%
      \acrowrite{long}%
      &
      \def\AcronymID{##1}%
      \acroifpagesT{\acropages{S. }{S. }}%
      \tabularnewline
    }%
  }%
  \acroheading
  \acropreamble
  \par\noindent
  \setlength\LTleft{0pt}%
  \setlength\LTright{0pt}%
  \begin{longtable}{@{}lll@{\extracolsep{\fill}}l@{}}
    \TableCode
  \end{longtable}
}

\begin{document}

erstes Mal: \ac{ecm}

zweites Mal: \ac{ecm}

\ac{F}

% % alle außer der Klasse 'physics' auflisten:
\printacronyms[exclude=physics]%, name=Abkürzungsverzeichnis]

% nur die Klasse 'physics' auflisten:
\printacronyms[template=physics, include=physics]%, name=Formelverzeichnis]

\end{document}