summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.tex')
-rw-r--r--Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.tex77
1 files changed, 77 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.tex b/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.tex
new file mode 100644
index 00000000000..42adeda7df4
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.tex
@@ -0,0 +1,77 @@
+% 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}. (The last one isn't considered first use by
+the hook that determines whether or not to hyperlink on first use.)
+
+\printglossaries
+
+\end{document}