summaryrefslogtreecommitdiff
path: root/support/bib2gls/examples/sample-bacteria.tex
blob: 7acd01f4ec9324f20ac12ff060a61936f038e23c (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[12pt,a4paper]{article}

\usepackage[T1]{fontenc}

\usepackage[record,% use bib2gls
 nostyles,% don't load default styles
% load glossary-bookindex.sty and patch styles:
 stylemods={bookindex},
 style=bookindex]{glossaries-extra}

% abbreviation style must be set before \GlsXtrLoadResources
\setabbreviationstyle[bacteria]{long-only-short-only}

\GlsXtrLoadResources[
 src=bacteria,% data in bacteria.bib
 category=bacteria,
 abbreviation-sort-fallback=long
]

\newcommand{\bacteriafont}[1]{\emph{#1}}

\glssetcategoryattribute{bacteria}{textformat}{bacteriafont}
\glssetcategoryattribute{bacteria}{glossnamefont}{bacteriafont}

\renewcommand*{\glsxtrbookindexname}[1]{%
 \glsifcategory{#1}{bacteria}
 {\glossentrynameother{#1}{long}}%
 {\glossentryname{#1}}%
}

\begin{document}
\section{First Use}

\gls{cbotulinum}, \gls{pputida}, \gls{cperfringens},
\gls{bsubtilis}, \gls{ctetani}, \gls{pcomposti},
\gls{pfimeticola}, \gls{cburnetii}, \gls{raustralis},
\gls{rrickettsii}.

\section{Next Use}

\gls{cbotulinum}, \gls{pputida}, \gls{cperfringens},
\gls{bsubtilis}, \gls{ctetani}, \gls{pcomposti},
\gls{pfimeticola}, \gls{cburnetii}, \gls{raustralis},
\gls{rrickettsii}.

\printunsrtglossary[title={Bacteria Index}]
\end{document}