Debian Codegraph @

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

raw
1 % This file is embedded in glossaries-extra-manual.pdf
2 % Example 160 Using bib2gls: unit record counting
3 % Label: "ex:bib2glsunitrecordcounting"
4 % arara: pdflatex
5 % arara: bib2gls: { recordcountunit: on }
6 % arara: pdflatex
7 % arara: pdfcrop
8 \documentclass[12pt]{scrreport}
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{kpfonts}
47 \usepackage[colorlinks]{hyperref}
48 \usepackage[record,postdot]{glossaries-extra}
49
50 \renewcommand{\chapterpagestyle}{empty}% to assist cropping
51 \setabbreviationstyle{long-short-sc-desc}
52
53 \GlsXtrLoadResources[src={abbrvs},
54 field-aliases={fulllong=long}
55 ]
56
57 \preto{\chapter}{\glsresetall}
58 \glsxtrenablerecordcount
59 \GlsXtrSetRecordCountAttribute{abbreviation}{1}
60
61 \renewcommand{\glslinkpresetkeys}{%
62 \glsadd[format=glsignore,counter=chapter]{\glslabel}}
63
64 \renewcommand*{\glsxtrrecordtriggervalue}[1]{%
65 \GlsXtrLocationRecordCount{#1}{chapter}{\theHchapter}%
66 }
67 \begin{document}
68 \chapter{First} \gls{html}. \gls{html}. \gls{html}. \gls{ssi}.
69
70 \chapter{Second} \gls{html}. \gls{ssi}. \gls{ssi}. \gls{xml}.
71
72 \renewcommand*{\printunsrtglossaryentryprocesshook}[1]{%
73 \glsxtrifhasfield*{location}{#1}{}{\printunsrtglossaryskipentry}%
74 }
75 \printunsrtglossaries
76 \end{document}