summaryrefslogtreecommitdiff
path: root/support/bib2gls/examples/sample-units2.tex
blob: d4bba821f1d2f1959eccca934422f5aaa73c94c7 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
% This file is public domain. See the "Examples" chapter
% in the bib2gls user manual for a more detailed description
% of this file.

\documentclass[a4paper]{report}

\usepackage{siunitx}
\usepackage[record,% use bib2gls
 nomain,% don't define 'main' glossary
 section,% use \section* for glossary headings
 nostyles,% don't load default styles
 stylemods={mcols},% load glossary-mcols.sty and patch
 style=mcolindex]{glossaries-extra}

\newglossary*{baseunits}{Base Units}
\newglossary*{derivedunits}{Derived Units}

\GlsXtrLoadResources[
  src={baseunits},
  type=baseunits,
  % make @unit act like @symbol:
  entry-type-aliases={unit=symbol},
  field-aliases={
   unitname=name,
   unitsymbol=symbol,
   measurement=description
  },
  symbol-sort-fallback=name,
  selection={all}
]

\GlsXtrLoadResources[
  src={derivedunits},
  type=derivedunits,
  % make @measurement act like @symbol:
  entry-type-aliases={measurement=symbol},
  field-aliases={
   unitname=name,
   unitsymbol=symbol,
   measurement=description
  },
  symbol-sort-fallback=name,
  selection={all}
]

\begin{document}
\chapter*{Glossaries}

\printunsrtglossary[type=baseunits,nogroupskip]
\printunsrtglossary[type=derivedunits,style=indexgroup]
\end{document}