Debian Codegraph @

texmf-dist/doc/latex/glossaries-extra/samples/sample-postlink.tex

raw
1 % arara: pdflatex
2 % arara: makeglossaries
3 % arara: pdflatex
4 \documentclass{article}
5
6 \usepackage[colorlinks]{hyperref}
7 \usepackage[style=tree]{glossaries-extra}
8
9 \makeglossaries
10
11 % Append the description in parentheses on first use
12 % for entries with the "describe" category:
13
14 \glssetregularcategory{describe}
15
16 \newcommand*{\glsxtrpostlinkdescribe}{%
17 \glsxtrpostlinkAddDescOnFirstUse
18 }
19
20 \newglossaryentry{sample1}{name={sample1},
21 category=describe,
22 description={the first sample entry}}
23
24 % Append the symbol in parentheses on first use for
25 % entries with the "symbol" category:
26
27 \glssetregularcategory{symbol}
28
29 \newcommand*{\glsxtrpostlinksymbol}{%
30 \glsxtrifwasfirstuse
31 {%
32 \space (denoted: \glsentrysymbol{\glslabel})%
33 }%
34 {}%
35 }
36
37 \newglossaryentry{sample2}{name={sample2},
38 symbol={\ensuremath{\mathcal{S}_2}},
39 category=symbol,
40 description={the second sample entry}}
41
42 % Append the description as a footnote for general entries
43 % on first use:
44
45 %\newcommand*{\glsxtrpostlinkgeneral}{%
46 % \glsxtrifwasfirstuse{\footnote{\glsentrydesc{\glslabel}}}{}%
47 %}
48
49 % or (defer footnote mark until after any following punctuation):
50
51 \newcommand*{\glsxtrpostlinkgeneral}{%
52 \glsxtrifwasfirstuse
53 {\glsxtrdopostpunc{\footnote{\glsentrydesc{\glslabel}}}}%
54 {}%
55 }
56
57 % Disable hyperlink of first use for those entries in the "general"
58 % category:
59
60 \glssetcategoryattribute{general}{nohyperfirst}{true}
61
62 \newglossaryentry{sample3}{name={sample3},
63 description={the third sample entry}}
64
65 \begin{document}
66
67 First use: \gls{sample1}, \gls{sample2} and \gls{sample3}.
68
69 Next use: \gls{sample1}, \gls{sample2} and \gls{sample3}.
70
71 Value of first field (post-link hook is still used): \glsfirst{sample1}, \glsfirst{sample2}
72 and \glsfirst{sample3}.
73
74 \printglossaries
75
76 \end{document}