summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/samples/sample-postlink.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/glossaries-extra/samples/sample-postlink.tex')
-rw-r--r--macros/latex/contrib/glossaries-extra/samples/sample-postlink.tex76
1 files changed, 76 insertions, 0 deletions
diff --git a/macros/latex/contrib/glossaries-extra/samples/sample-postlink.tex b/macros/latex/contrib/glossaries-extra/samples/sample-postlink.tex
new file mode 100644
index 0000000000..5993302b7c
--- /dev/null
+++ b/macros/latex/contrib/glossaries-extra/samples/sample-postlink.tex
@@ -0,0 +1,76 @@
+% arara: pdflatex
+% arara: makeglossaries
+% arara: pdflatex
+\documentclass{article}
+
+\usepackage[colorlinks]{hyperref}
+\usepackage[style=tree]{glossaries-extra}
+
+\makeglossaries
+
+% Append the description in parentheses on first use
+% for entries with the "describe" category:
+
+\glssetregularcategory{describe}
+
+\newcommand*{\glsxtrpostlinkdescribe}{%
+ \glsxtrpostlinkAddDescOnFirstUse
+}
+
+\newglossaryentry{sample1}{name={sample1},
+ category=describe,
+ description={the first sample entry}}
+
+% Append the symbol in parentheses on first use for
+% entries with the "symbol" category:
+
+\glssetregularcategory{symbol}
+
+\newcommand*{\glsxtrpostlinksymbol}{%
+ \glsxtrifwasfirstuse
+ {%
+ \space (denoted: \glsentrysymbol{\glslabel})%
+ }%
+ {}%
+}
+
+\newglossaryentry{sample2}{name={sample2},
+ symbol={\ensuremath{\mathcal{S}_2}},
+ category=symbol,
+ description={the second sample entry}}
+
+% Append the description as a footnote for general entries
+% on first use:
+
+%\newcommand*{\glsxtrpostlinkgeneral}{%
+% \glsxtrifwasfirstuse{\footnote{\glsentrydesc{\glslabel}}}{}%
+%}
+
+% or (defer footnote mark until after any following punctuation):
+
+\newcommand*{\glsxtrpostlinkgeneral}{%
+ \glsxtrifwasfirstuse
+ {\glsxtrdopostpunc{\footnote{\glsentrydesc{\glslabel}}}}%
+ {}%
+}
+
+% Disable hyperlink of first use for those entries in the "general"
+% category:
+
+\glssetcategoryattribute{general}{nohyperfirst}{true}
+
+\newglossaryentry{sample3}{name={sample3},
+ description={the third sample entry}}
+
+\begin{document}
+
+First use: \gls{sample1}, \gls{sample2} and \gls{sample3}.
+
+Next use: \gls{sample1}, \gls{sample2} and \gls{sample3}.
+
+Value of first field (post-link hook is still used): \glsfirst{sample1}, \glsfirst{sample2}
+and \glsfirst{sample3}.
+
+\printglossaries
+
+\end{document}