Debian Codegraph @

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

raw
1 % This file is embedded in glossaries-extra-manual.pdf
2 % Example 154 Using bib2gls: gathering dependencies from field values
3 % Label: "ex:bib2glsgatherdeps"
4 % arara: pdflatex
5 % arara: bib2gls
6 % arara: pdflatex
7 % arara: pdfcrop
8 \documentclass[12pt]{article}
9 \pagestyle{empty}
10 \begin{filecontents*}{abbrvs.bib}
11 @string{ssi={server-side includes}}
12 @string{html={hypertext markup language}}
13
14 @abbreviation{shtml,
15 short="shtml",
16 fulllong = ssi # " enabled " # html,
17 nestedlong = "\glsps{ssi} enabled \glsps{html}",
18 description={a combination of \gls{html} and \gls{ssi}}
19 }
20
21 @abbreviation{html,
22 short ="html",
23 long = html,
24 description={a markup language for creating web pages}
25 }
26
27 @abbreviation{ssi,
28 short="ssi",
29 long = ssi,
30 description={a simple interpreted server-side scripting language}
31 }
32
33 @abbreviation{xml,
34 short={xml},
35 long={extensible markup language},
36 description={a simple text-base format for representing structured information}
37 }
38
39 @abbreviation{mathml,
40 short={m\BibGlsNoCaseChange{ath}ml},
41 long={mathematical markup language},
42 description={an \gls{xml}-based language for describing mathematical notation}
43 }
44 \end{filecontents*}
45 \usepackage[T1]{fontenc}
46 \usepackage{relsize}
47 \usepackage[colorlinks]{hyperref}
48 \usepackage[record=nameref]{glossaries-extra}
49
50 \BibGlsOptions{mfirstuc-protection={long}}
51
52 \setabbreviationstyle{long-short-sc}
53 \newcommand{\BibGlsNoCaseChange}[1]{\textsmaller{#1}}
54
55 \GlsXtrLoadResources[
56 src={abbrvs},
57 field-aliases={fulllong=long},
58 % The following require bib2gls v4.1+
59 omit-fields={"description"},
60 gather-parsed-dependencies
61 ]
62
63
64 \begin{document}
65 \tableofcontents
66 \section{\Glsfmtlong{shtml}}
67 First use: \gls{shtml}, \gls{html}, \gls{ssi}, \gls{mathml}.
68
69 Next use: \gls{shtml}, \gls{html}, \gls{ssi}, \gls{mathml}. All caps: \GLS{mathml}.
70
71 \printunsrtglossaries
72 \end{document}