summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries/samples/sample-dual.tex
blob: 4a1fc9a953901805920ed32022f4eafad2908258 (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
% This file is public domain
% If you want to use arara, you need the following directives:
% arara: pdflatex: { synctex: on }
% arara: makeglossaries
% arara: pdflatex: { synctex: on }
\documentclass{article}

\usepackage[acronym]{glossaries}

% \newdualentry[main options]{label}{short}{long}{description}

\newcommand*{\newdualentry}[5][]{%
  % main entry:
  \newglossaryentry{main-#2}{name={#4},%
  text={#3\glsadd{#2}},%
  description={#5},%
  #1% additional options for main entry
  }%
  % abbreviation:
  \newacronym{#2}{#3\glsadd{main-#2}}{#4}%
}

\newdualentry{svm}% label
  {SVM}% abbreviation
  {support vector machine}% long form
  {Statistical pattern recognition technique}% description

\makeglossaries

\begin{document}

\gls{svm}.

\printglossaries
\end{document}