From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 .../glossaries-extra/samples/sample-onelink.tex    | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 macros/latex/contrib/glossaries-extra/samples/sample-onelink.tex

(limited to 'macros/latex/contrib/glossaries-extra/samples/sample-onelink.tex')

diff --git a/macros/latex/contrib/glossaries-extra/samples/sample-onelink.tex b/macros/latex/contrib/glossaries-extra/samples/sample-onelink.tex
new file mode 100644
index 0000000000..1d9a71876c
--- /dev/null
+++ b/macros/latex/contrib/glossaries-extra/samples/sample-onelink.tex
@@ -0,0 +1,49 @@
+% arara: pdflatex
+% arara: makeglossaries
+% arara: pdflatex
+\documentclass{article}
+
+\usepackage{lipsum}
+\usepackage[colorlinks]{hyperref}
+\usepackage{glossaries-extra}
+
+\makeglossaries
+
+\GlsXtrEnableEntryUnitCounting{general}{0}{page}
+
+\newglossaryentry{sample}{name={sample},description={an example}}
+\newglossaryentry{sample2}{name={another sample},description={another example}}
+
+\renewcommand*{\glslinkcheckfirsthyperhook}{%
+  \ifnum\glsentrycurrcount\glslabel>0
+   \setkeys{glslink}{hyper=false}%
+  \fi
+}
+
+\begin{document}
+
+A \gls{sample} entry. \Gls{sample2}.
+Next use: \gls{sample}, \gls{sample2}.
+
+\lipsum[1]
+
+\Gls{sample} and more \glspl{sample}.
+\Gls{sample2} and \gls{sample2}.
+
+\newpage
+
+Next page: \gls{sample} and \gls{sample2}.
+
+Again: \gls{sample} and \gls{sample2}.
+
+\lipsum[2-5]
+
+Now for a \gls{sample} paragraph that spans the page break.
+\lipsum*[6-7] The entry in the final sentence in this \gls{sample} paragraph
+is incrementing and testing the count from the previous page.
+
+Another \gls{sample} paragraph.
+
+\printglossaries
+
+\end{document}
-- 
cgit v1.2.3

