summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/glossaries-extra-manual-examples/glossaries-extra-manual-example131.tex
blob: 96558df7110267fc97cb6f83cef2c38f173b0b83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
% This file is embedded in glossaries-extra-manual.pdf
% Example 131 Multi-entries: skipping elements (prefix and post-link hooks)
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[colorlinks]{hyperref}
\usepackage[stylemods,style=long]{glossaries-extra}


\makeglossaries


\setabbreviationstyle{long-postshort-sc-user}


\newabbreviation{ssi}{ssi}{server-side includes}
\newabbreviation{html}{html}{hypertext markup language}


\newrobustcmd{\combinedpre}[1]{\glsps{#1}}
\newrobustcmd{\combinedpost}[1]{\glsps{#1}}


\newabbreviation{shtml}{shtml}
{{}\combinedpre{ssi} enabled \combinedpost{html}}


\glssetcategoryattribute{combinedabbrv}{multioptions}
 {%
 mpostlinkelement=main,
 usedskipothers
 }


\multiglossaryentry
 [category=combinedabbrv]
 {shtml}[shtml]{ssi,shtml,html}


\mglsdefcategoryprefix{combinedabbrv}{%
 \renewcommand{\combinedpre}[1]{\ignorespaces}%
 \renewcommand{\combinedpost}[1]{\unskip}%
} 
\begin{document}
Individual elements first use: \gls{ssi} and \gls{html}.


Individual elements next use: \gls{ssi} and \gls{html}.


Multi-entry first use: \mgls{shtml}.


Multi-entry next use: \mgls{shtml}.


Individual entry first use: \gls{shtml}.


Resetting all\glsresetall\mglsresetall:


Multi-entry first use: \mgls{shtml}.


Multi-entry next use: \mgls{shtml}.


Individual elements: \gls{ssi} and \gls{html}.


Resetting all\glsresetall\mglsresetall:


Individual entry first use: \gls{shtml}.


Multi-entry first use: \mgls{shtml}. (Wrong!)


\printglossaries 
\end{document}