Debian Codegraph @

texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual-examples/glossaries-extra-manual-example132.tex

raw
1 % This file is embedded in glossaries-extra-manual.pdf
2 % Example 132 Multi-entries: skipping elements (prefix and post-link hooks)
3 % Label: "ex:multientryskipprefixpostlink"
4 % arara: pdflatex
5 % arara: makeglossaries
6 % arara: pdflatex
7 % arara: pdfcrop
8 \documentclass[12pt]{article}
9 \pagestyle{empty}
10 \usepackage[T1]{fontenc}
11 \usepackage[colorlinks]{hyperref}
12 \usepackage[stylemods,style=long]{glossaries-extra}
13
14
15 \makeglossaries
16
17
18 \setabbreviationstyle{long-postshort-sc-user}
19
20
21 \newabbreviation{ssi}{ssi}{server-side includes}
22 \newabbreviation{html}{html}{hypertext markup language}
23
24
25 \newrobustcmd{\combinedpre}[1]{\glsps{#1}}
26 \newrobustcmd{\combinedpost}[1]{\glsps{#1}}
27
28
29 \newabbreviation{shtml}{shtml}
30 {{}\combinedpre{ssi} enabled \combinedpost{html}}
31
32
33 \glssetcategoryattribute{combinedabbrv}{multioptions}
34 {%
35 mpostlinkelement=main,
36 usedskipothers
37 }
38
39
40 \multiglossaryentry
41 [category=combinedabbrv]
42 {shtml}[shtml]{ssi,shtml,html}
43
44
45 \mglsdefcategoryprefix{combinedabbrv}{%
46 \renewcommand{\combinedpre}[1]{\ignorespaces}%
47 \renewcommand{\combinedpost}[1]{\unskip}%
48 }
49 \begin{document}
50 Individual elements first use: \gls{ssi} and \gls{html}.
51
52
53 Individual elements next use: \gls{ssi} and \gls{html}.
54
55
56 Multi-entry first use: \mgls{shtml}.
57
58
59 Multi-entry next use: \mgls{shtml}.
60
61
62 Individual entry first use: \gls{shtml}.
63
64
65 Resetting all\glsresetall\mglsresetall:
66
67
68 Multi-entry first use: \mgls{shtml}.
69
70
71 Multi-entry next use: \mgls{shtml}.
72
73
74 Individual elements: \gls{ssi} and \gls{html}.
75
76
77 Resetting all\glsresetall\mglsresetall:
78
79
80 Individual entry first use: \gls{shtml}.
81
82
83 Multi-entry first use: \mgls{shtml}. (Wrong!)
84
85
86 \printglossaries
87 \end{document}