Debian Codegraph @

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

raw
1 % This file is embedded in glossaries-extra-manual.pdf
2 % Example 158 Using bib2gls: one resource set but four lists
3 % Label: "ex:bib2gls1set4lists"
4 % arara: pdflatex
5 % arara: bib2gls
6 % arara: pdflatex
7 % arara: bib2gls
8 % arara: pdflatex
9 % arara: pdfcrop
10 \documentclass[11pt]{article}
11 \pagestyle{empty}
12 \begin{filecontents*}{terms.bib}
13 @entry{bird,
14 name={bird},
15 description={feathered animal},
16 seealso={duck,goose}
17 }
18
19 @entry{duck,
20 name={duck},
21 description={a waterbird with short legs}
22 }
23
24 @entry{goose,
25 name = "goose",
26 plural = "geese",
27 description={a waterbird with a long neck}
28 }
29
30 @index{example}
31 \end{filecontents*}
32 \begin{filecontents*}{abbrvs.bib}
33 @string{ssi={server-side includes}}
34 @string{html={hypertext markup language}}
35
36 @abbreviation{shtml,
37 short="shtml",
38 fulllong = ssi # " enabled " # html,
39 nestedlong = "\glsps{ssi} enabled \glsps{html}",
40 description={a combination of \gls{html} and \gls{ssi}}
41 }
42
43 @abbreviation{html,
44 short ="html",
45 long = html,
46 description={a markup language for creating web pages}
47 }
48
49 @abbreviation{ssi,
50 short="ssi",
51 long = ssi,
52 description={a simple interpreted server-side scripting language}
53 }
54
55 @abbreviation{xml,
56 short={xml},
57 long={extensible markup language},
58 description={a simple text-base format for representing structured information}
59 }
60
61 @abbreviation{mathml,
62 short={m\BibGlsNoCaseChange{ath}ml},
63 long={mathematical markup language},
64 description={an \gls{xml}-based language for describing mathematical notation}
65 }
66 \end{filecontents*}
67 \begin{filecontents*}{symbols.bib}
68 @preamble{"\providecommand{\mtx}[1]{\boldsymbol{#1}}"}
69
70 @symbol{M,
71 name={\ensuremath{\mtx{M}}},
72 description={a matrix}
73 }
74
75 @symbol{v,
76 name={\ensuremath{\vec{v}}},
77 description={a vector}
78 }
79
80 @symbol{S,
81 name={\ensuremath{\mathcal{S}}},
82 description={a set}
83 }
84 \end{filecontents*}
85 \usepackage[T1]{fontenc}
86 \usepackage[colorlinks]{hyperref}
87 \usepackage[record,nostyles,stylemods={topic,tree,bookindex},style=tree,
88 abbreviations,symbols,index]{glossaries-extra}
89
90 \renewcommand{\glstarget}{\glsxtrtarget}
91
92 \setabbreviationstyle{long-short-sc-desc}
93
94 \GlsXtrLoadResources[src={terms,abbrvs,symbols},
95 assign-fields = {
96 type = "symbols" [ entrytype->actual = "symbol" ],
97 type = "index" [ entrytype->actual = "index" ]
98 },
99 sort={en-GB},
100 symbol-sort-fallback=name,
101 abbreviation-sort-fallback=long,
102 field-aliases={fulllong=long},
103 copy-to-glossary={"index"},
104 description-case-change=firstuc,
105 post-description-dot=all
106 ]
107
108 \newcommand{\primaryfmt}[1]{\hyperbf{#1}}
109 \begin{document}
110 \gls{bird} \gls{example}.
111
112 \gls{shtml}
113
114 \gls{M}
115
116 \newpage
117
118 \renewcommand*{\glsextrapostnamehook}[1]{\glsadd[format=primaryfmt]{#1}}%
119 \printunsrtglossary*[nonumberlist]
120 {\glssetcategoryattribute{general}{glossname}{firstuc}}
121 \printunsrtabbreviations[nonumberlist,style=topic]
122 \printunsrtsymbols[nonumberlist]
123
124 \renewcommand*{\glsextrapostnamehook}[1]{}%
125 \printunsrtindex[style=bookindex]
126 \end{document}