Debian Codegraph @

texmf-dist/doc/support/bib2gls/examples/sample-constants.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[12pt,a4paper]{article}
6
7 \usepackage[T1]{fontenc}
8 \usepackage{upgreek}
9
10 \usepackage[record,% use bib2gls
11 nostyles,% don't load default styles
12 postdot,% add dot after descriptions
13 % load glossary-tree.sty and patch styles:
14 stylemods={tree},
15 style=alttree]{glossaries-extra}
16
17 \GlsXtrLoadResources[
18 src={constants},% data in constants.bib
19 % make @constant behave like @number
20 entry-type-aliases={constant=number},
21 field-aliases={
22 identifier=category,
23 constantsymbol=name,
24 constantname=description,
25 value=user1,
26 definition=user2,
27 alternative=user3
28 },
29 type=main,
30 set-widest,
31 sort-field=user1,
32 missing-sort-fallback=name,
33 sort=double,
34 selection=all
35 ]
36
37 \newcommand{\glsxtrpostdescconstant}{%
38 \glsxtrifhasfield{useriii}{\glscurrententrylabel}%
39 { (also denoted \glscurrentfieldvalue
40 \glsxtrifhasfield{useri}{\glscurrententrylabel}%
41 {, approximately \glscurrentfieldvalue}%
42 {}%
43 )%
44 }%
45 {%
46 \glsxtrifhasfield{useri}{\glscurrententrylabel}%
47 { (approximately \glscurrentfieldvalue)}%
48 {}%
49 }%
50 \glsxtrifhasfield{userii}{\glscurrententrylabel}%
51 {: \glscurrentfieldvalue}%
52 {}%
53 }
54
55 \begin{document}
56 \printunsrtglossary[title={Constants}]
57 \end{document}