summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries/samples/sample-entryfmt.tex
blob: a057805db1ac7289b7e12178df157e6637170071 (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
 % 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[colorlinks]{hyperref}
\usepackage[style=tree]{glossaries}

\makeglossaries

\renewcommand*{\glsentryfmt}{%
  \glsgenentryfmt
  \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}%
}

\newglossaryentry{distance}{name=distance,
description={The length between two points},
symbol={km}}

\begin{document}

First use: \gls{distance}. Next use: \gls{distance}.

\printglossaries

\end{document}