summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/glossaries-extra-manual-examples/glossaries-extra-manual-example156.tex
blob: 22427c089d9f0a5083458894aa8ed52714a7f21c (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
% This file is embedded in glossaries-extra-manual.pdf 
% Example 156 Using bib2gls: multiple resource sets
% Label: "ex:bib2glsmultiresources"
% arara: pdflatex
% arara: bib2gls
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{filecontents*}{terms.bib}
@entry{bird,
  name={bird},
  description={feathered animal},
  seealso={duck,goose}
} 

@entry{duck,
  name={duck},
  description={a waterbird with short legs}
} 

@entry{goose,
  name = "goose",
  plural = "geese",
  description={a waterbird with a long neck}
}

@index{example}
\end{filecontents*}
\begin{filecontents*}{abbrvs.bib}
@string{ssi={server-side includes}}
@string{html={hypertext markup language}} 

@abbreviation{shtml,
  short="shtml",
  fulllong = ssi # " enabled " # html,
  nestedlong = "\glsps{ssi} enabled \glsps{html}",
  description={a combination of \gls{html} and \gls{ssi}}
} 

@abbreviation{html,
  short ="html",
  long = html,
  description={a markup language for creating web pages}
} 

@abbreviation{ssi,
  short="ssi",
  long = ssi,
  description={a simple interpreted server-side scripting language}
}

@abbreviation{xml,
  short={xml},
  long={extensible markup language},
  description={a simple text-base format for representing structured information}
}

@abbreviation{mathml,
  short={m\BibGlsNoCaseChange{ath}ml},
  long={mathematical markup language},
  description={an \gls{xml}-based language for describing mathematical notation}
}
\end{filecontents*}
\begin{filecontents*}{symbols.bib}
@preamble{"\providecommand{\mtx}[1]{\boldsymbol{#1}}"} 

@symbol{M,
  name={\ensuremath{\mtx{M}}},
  description={a matrix}
} 

@symbol{v,
  name={\ensuremath{\vec{v}}},
  description={a vector}
} 

@symbol{S,
  name={\ensuremath{\mathcal{S}}},
  description={a set}
}
\end{filecontents*}
\usepackage[T1]{fontenc}
\usepackage[record,abbreviations,symbols]{glossaries-extra} 

\renewcommand\GlsXtrDefaultResourceOptions{
 description-case-change=firstuc,
 post-description-dot=all
} 

\setabbreviationstyle{long-short-sc-desc} 

\GlsXtrLoadResources[src=terms,sort=en-GB,type=main] 

\GlsXtrLoadResources [src=abbrvs,sort=letter-nocase, abbreviation-sort-fallback={long}, field-aliases={fulllong=long}, type=abbreviations] 

\GlsXtrLoadResources [src=symbols,sort=use,type=symbols] 
\begin{document}
\gls{bird} 

\gls{shtml} 

\gls{M} 

\GlsXtrSetDefaultNumberFormat{glsignore}
\printunsrtglossaries 
\end{document}