| 1 |
% arara: pdflatex |
| 2 |
% arara: makeglossaries |
| 3 |
% arara: pdflatex |
| 4 |
\documentclass{article} |
| 5 |
|
| 6 |
\usepackage[colorlinks]{hyperref} |
| 7 |
\usepackage{glossaries-extra} |
| 8 |
|
| 9 |
\makeglossaries |
| 10 |
|
| 11 |
\renewcommand*{\glslinkpostsetkeys}{% |
| 12 |
\ifnum\GlsXtrLinkCounterValue{\glslabel}>1 |
| 13 |
\setkeys{glslink}{hyper=false}% |
| 14 |
\fi |
| 15 |
} |
| 16 |
|
| 17 |
%\GlsXtrEnableLinkCounting[section]{general} |
| 18 |
\GlsXtrEnableLinkCounting{general} |
| 19 |
|
| 20 |
\newglossaryentry{sample1}{name={sample1},description={an example}} |
| 21 |
\newglossaryentry{sample2}{name={sample2},description={another example}} |
| 22 |
|
| 23 |
\newabbreviation{ex}{ex}{example} |
| 24 |
|
| 25 |
\begin{document} |
| 26 |
|
| 27 |
\section{Sample Section} |
| 28 |
|
| 29 |
\Gls{sample1}, \gls{sample2} and \gls{ex}. |
| 30 |
\Glstext{sample1} and \gls{ex} again. |
| 31 |
Link count: \GlsXtrTheLinkCounter{sample1} (sample1), |
| 32 |
\GlsXtrTheLinkCounter{sample2} (sample2) and |
| 33 |
\GlsXtrTheLinkCounter{ex} (ex). |
| 34 |
|
| 35 |
\section{Another Sample Section} |
| 36 |
|
| 37 |
\Gls{sample1}, \gls{sample2} and \gls{ex}. |
| 38 |
Link count: \GlsXtrTheLinkCounter{sample1} (sample1), |
| 39 |
\GlsXtrTheLinkCounter{sample2} (sample2) and |
| 40 |
\GlsXtrTheLinkCounter{ex} (ex). |
| 41 |
|
| 42 |
\printglossaries |
| 43 |
|
| 44 |
\end{document} |