Debian Codegraph @

texmf-dist/doc/support/bib2gls/examples/sample-chemical.tex

raw
1 % This file is public domain. See the "Examples" chapter
2 % in the bib2gls user manual for a more detailed description
3 % of this file.
4
5 \documentclass[a4paper]{article}
6
7 \usepackage[T1]{fontenc}
8 \usepackage[version=4]{mhchem}
9 \usepackage[record,% use bib2gls
10 nostyles,% don't load default styles
11 stylemods={tree},% load glossary-tree and patch styles
12 style=alttreegroup]{glossaries-extra}
13
14 \GlsXtrLoadResources[
15 src={chemicalformula},% definitions in chemicalformula.bib
16 entry-type-aliases={chemical=symbol},
17 field-aliases={formula=name,chemicalname=description},
18 symbol-sort-fallback=name,% use name field as fallback for sort
19 sort=letternumber-case,% case-sensitive letter-number sort
20 set-widest,% needed for alttree styles
21 save-locations=false% don't create location lists
22 ]
23
24 \renewcommand*{\glstreenamefmt}[1]{#1}
25 \renewcommand*{\glstreegroupheaderfmt}[1]{\textbf{#1}}
26
27 \begin{document}
28 \section{Sample}
29
30 Reference Entries: \gls{Al2SO43}, \gls{H2O}, \gls{C6H12O6},
31 \gls{CH3CH2OH}, \gls{CH2O}, \gls{OF2}, \gls{O2F2}, \gls{SO42-},
32 \gls{H3O+}, \gls{OH-}, \gls{O2}, \gls{AlF3}, \gls{O},
33 \gls{Al2CoO4}, \gls{As4S4}, \gls{C10H10O4}, \gls{C5H4NCOOH},
34 \gls{C8H10N4O2}, \gls{SO2}, \gls{S2O72-}, \gls{SbBr3},
35 \gls{Sc2O3}, \gls{Zr3PO44}, \gls{ZnF2}.
36
37 \printunsrtglossary
38 \end{document}