summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/glossaries-extra-manual-examples/glossaries-extra-manual-example159.tex
blob: 2a63e1d063b42d6f08015ab7d7e352454f2903f6 (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
% This file is embedded in glossaries-extra-manual.pdf
% Example 159 Using bib2gls: dual entry label prefixes
% Label: "ex:bib2glsduallabelprefixes"
% arara: pdflatex
% arara: bib2gls
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{filecontents*}{\jobname.bib}
@index{duck}
@dualindexabbreviation{svm,
 short={SVM},
 long={support vector machine}
}
 @dualindexsymbol{pi,
 symbol={\ensuremath{\pi}},
 description={ratio of a circle's circumference to its diameter}
}
\end{filecontents*}
\usepackage{hyperref}
\usepackage[record,abbreviations,symbols]{glossaries-extra} 

\newcommand{\bibglsnewdualindexsymbolsecondary}[5]{%
 \longnewglossaryentry*{#1}{name={#3},category={symbol},
 type={symbols},symbol={#4},#2}{#5}%
} 

\GlsXtrLoadResources[src=\jobname,
 combine-dual-locations=primary]
\glsxtraddlabelprefix{dual.}
\glsxtraddlabelprefix{} 
\begin{document}
First use: \dgls{duck}, \dgls{svm}, \dgls{pi}.
Next use: \dgls{duck}, \dgls{svm}, \dgls{pi}.
\printunsrtglossaries 
\end{document}