Debian Codegraph @

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

raw
1 % This file is embedded in glossaries-extra-manual.pdf
2 % Example 153 Using bib2gls: smallcap abbreviations
3 % Label: "ex:bib2glsscabbrvs"
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}}% requires bib2gls v4.0+
51
52
53 \setabbreviationstyle{long-short-sc} \newcommand{\BibGlsNoCaseChange}[1]{\textsmaller{#1}}
54
55 \GlsXtrLoadResources[
56 src={abbrvs},
57 field-aliases={nestedlong=long},
58 ignore-fields={description}
59 ]
60
61
62 \begin{document}
63 \tableofcontents
64 \section{\Glsfmtlong{shtml}}
65 First use: \gls{shtml}, \gls{html}, \gls{ssi}, \gls{mathml}.
66
67 Next use: \gls{shtml}, \gls{html}, \gls{ssi}, \gls{mathml}. All caps: \GLS{mathml}.
68
69 \printunsrtglossaries
70 \end{document}