summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/sample-alias.tex
blob: dd14470fbcfab1a7480ae6abbe5c47d302958d4c (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
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

\usepackage[colorlinks]{hyperref}
\usepackage{glossaries-extra}

\makeglossaries

\newglossaryentry{numberlist}{name={number list},
 description={\nopostdesc},
 alias={locationlist}}

\newglossaryentry{locationlist}{name={location list},
 description={list of locations}
}

\renewcommand{\glsxtrsetaliasnoindex}{%
 \ifglshasfield{alias}{\glslabel}%
 {%
   \setkeys{glslink}{noindex}%
   \glsxtrindexaliased
 }%
 {}%
}

\newglossaryentry{sample}{name={sample},
description={an example}}

\newglossaryentry{sample-alias}{name={sample-alias},
description={\nopostdesc},
alias={sample}
}

\begin{document}

\gls{numberlist} or \gls{locationlist}.

\gls{sample} or \gls{sample-alias}.

\newpage
\gls{numberlist}

\gls{sample-alias}
\newpage
\printglossaries
\end{document}