summaryrefslogtreecommitdiff
path: root/support/bib2gls/examples/sample-chemical.tex
blob: 95330491460c8798f0c14f5ca0fed3770dcffa90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% This file is public domain. See the "Examples" chapter
% in the bib2gls user manual for a more detailed description
% of this file.

\documentclass[a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage[version=4]{mhchem}
\usepackage[record,% use bib2gls
 nostyles,% don't load default styles
 stylemods={tree},% load glossary-tree and patch styles
 style=alttreegroup]{glossaries-extra}

\GlsXtrLoadResources[
 src={chemicalformula},% definitions in chemicalformula.bib
 entry-type-aliases={chemical=symbol},
 field-aliases={formula=name,chemicalname=description},
 symbol-sort-fallback=name,% use name field as fallback for sort
 sort=letternumber-case,% case-sensitive letter-number sort
 set-widest,% needed for alttree styles
 save-locations=false% don't create location lists
]

\renewcommand*{\glstreenamefmt}[1]{#1}
\renewcommand*{\glstreegroupheaderfmt}[1]{\textbf{#1}}

\begin{document}
\section{Sample}

Reference Entries: \gls{Al2SO43}, \gls{H2O}, \gls{C6H12O6},
\gls{CH3CH2OH}, \gls{CH2O}, \gls{OF2}, \gls{O2F2}, \gls{SO42-},
\gls{H3O+}, \gls{OH-}, \gls{O2}, \gls{AlF3}, \gls{O}, 
\gls{Al2CoO4}, \gls{As4S4}, \gls{C10H10O4}, \gls{C5H4NCOOH}, 
\gls{C8H10N4O2}, \gls{SO2}, \gls{S2O72-}, \gls{SbBr3}, 
\gls{Sc2O3}, \gls{Zr3PO44}, \gls{ZnF2}.

\printunsrtglossary
\end{document}