| 1 |
% arara: pdflatex |
| 2 |
% arara: makeglossaries |
| 3 |
% arara: pdflatex |
| 4 |
\documentclass{article} |
| 5 |
|
| 6 |
\usepackage{lipsum} |
| 7 |
\usepackage[colorlinks]{hyperref} |
| 8 |
\usepackage{glossaries-extra} |
| 9 |
|
| 10 |
\makeglossaries |
| 11 |
|
| 12 |
\GlsXtrEnableEntryUnitCounting{general}{0}{page} |
| 13 |
|
| 14 |
\newglossaryentry{sample}{name={sample},description={an example}} |
| 15 |
\newglossaryentry{sample2}{name={another sample},description={another example}} |
| 16 |
|
| 17 |
\renewcommand*{\glslinkcheckfirsthyperhook}{% |
| 18 |
\ifnum\glsentrycurrcount\glslabel>0 |
| 19 |
\setkeys{glslink}{hyper=false}% |
| 20 |
\fi |
| 21 |
} |
| 22 |
|
| 23 |
\begin{document} |
| 24 |
|
| 25 |
A \gls{sample} entry. \Gls{sample2}. |
| 26 |
Next use: \gls{sample}, \gls{sample2}. |
| 27 |
|
| 28 |
\lipsum[1] |
| 29 |
|
| 30 |
\Gls{sample} and more \glspl{sample}. |
| 31 |
\Gls{sample2} and \gls{sample2}. |
| 32 |
|
| 33 |
\newpage |
| 34 |
|
| 35 |
Next page: \gls{sample} and \gls{sample2}. |
| 36 |
|
| 37 |
Again: \gls{sample} and \gls{sample2}. |
| 38 |
|
| 39 |
\lipsum[2-5] |
| 40 |
|
| 41 |
Now for a \gls{sample} paragraph that spans the page break. |
| 42 |
\lipsum*[6-7] The entry in the final sentence in this \gls{sample} paragraph |
| 43 |
is incrementing and testing the count from the previous page. |
| 44 |
|
| 45 |
Another \gls{sample} paragraph. |
| 46 |
|
| 47 |
\printglossaries |
| 48 |
|
| 49 |
\end{document} |