Debian Codegraph @

texmf-dist/doc/latex/glossaries/glossaries-user-examples/glossaries-user-example010.tex

raw
1 % This file is embedded in glossaries-user.pdf
2 % Example 10 UTF-8 and bib2gls
3 % Label: "ex:bib2glsutf8"
4 % arara: pdflatex
5 % arara: bib2gls
6 % arara: pdflatex
7 % arara: pdfcrop
8 \documentclass[12pt]{article}
9 \pagestyle{empty}
10 \begin{filecontents*}{sample-utf8-en.bib}
11 % Encoding: UTF-8
12
13
14 @entry{élite,
15 name={élite},
16 description={select group or class}
17 }
18
19 @entry{elephant,
20 name={elephant},
21 description={large animal with trunk and tusks}
22 }
23
24 @entry{elk,
25 name={elk},
26 description={large deer}
27 }
28 \end{filecontents*}
29 \begin{filecontents*}{sample-utf8-pt.bib}
30 % Encoding: UTF-8
31
32
33 @entry{água,
34 name={água},
35 description={water}
36 }
37
38 @entry{árvore,
39 name={árvore},
40 description={tree}
41 }
42
43 @entry{ano,
44 name={ano},
45 description={year}
46 }
47 \end{filecontents*}
48 \usepackage[T1]{fontenc}
49 \usepackage[main=english,brazilian]{babel}
50 \usepackage[record]{glossaries-extra}
51 \newglossary*{dictionary}{\glossaryname}
52 \GlsXtrLoadResources[
53 sort=en,% sort according to English language rules
54 src={sample-utf8-en}% data in sample-utf8-en.bib
55 ]
56 \GlsXtrLoadResources[
57 sort=pt-BR,% sort according to pt-BR language rules
58 src={sample-utf8-pt},% data in sample-utf8-pt.bib
59 type=dictionary
60 ]
61 \begin{document}
62 \section{English}
63 An \gls{elk} and an \gls{elephant} belonged to an \gls{élite} group.
64
65 \printunsrtglossary
66
67 \selectlanguage{brazilian}
68 \section{Brasileiro}
69 A \gls{árvore} tive \gls{água} este \gls{ano}.
70
71 \printunsrtglossary[type=dictionary]
72 \end{document}