<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% This file is embedded in glossaries-extra-manual.pdf 
% Example 124 Enabling unit counting to hook into hyperlink setting
% Label: "ex:unitentrycounthyper"
% arara: pdflatex
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries-extra}


\makeglossaries


\GlsXtrEnableEntryUnitCounting{general}{0}{page}


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


\renewcommand*{\glslinkcheckfirsthyperhook}{%
 \ifnum\glsentrycurrcount{\glslabel}&gt;0
 \setupglslink{hyper=false}%
 \fi
} 
\begin{document}
A \gls{sample} entry. Next use: \gls{sample}. 

\newpage
Next page: \gls{sample}. Again: \gls{sample}. 

\printglossaries 
\end{document}
</pre></body></html>