| 1 |
% This file is embedded in glossaries-extra-manual.pdf |
| 2 |
% Example 157 Using bib2gls: sub-blocks |
| 3 |
% Label: "ex:bib2glssubblocks" |
| 4 |
% arara: pdflatex |
| 5 |
% arara: bib2gls: { group: on } |
| 6 |
% arara: pdflatex |
| 7 |
% arara: pdfcrop |
| 8 |
\documentclass[12pt]{article} |
| 9 |
\pagestyle{empty} |
| 10 |
\begin{filecontents*}{terms.bib} |
| 11 |
@entry{bird, |
| 12 |
name={bird}, |
| 13 |
description={feathered animal}, |
| 14 |
seealso={duck,goose} |
| 15 |
} |
| 16 |
|
| 17 |
@entry{duck, |
| 18 |
name={duck}, |
| 19 |
description={a waterbird with short legs} |
| 20 |
} |
| 21 |
|
| 22 |
@entry{goose, |
| 23 |
name = "goose", |
| 24 |
plural = "geese", |
| 25 |
description={a waterbird with a long neck} |
| 26 |
} |
| 27 |
|
| 28 |
@index{example} |
| 29 |
\end{filecontents*} |
| 30 |
\begin{filecontents*}{abbrvs.bib} |
| 31 |
@string{ssi={server-side includes}} |
| 32 |
@string{html={hypertext markup language}} |
| 33 |
|
| 34 |
@abbreviation{shtml, |
| 35 |
short="shtml", |
| 36 |
fulllong = ssi # " enabled " # html, |
| 37 |
nestedlong = "\glsps{ssi} enabled \glsps{html}", |
| 38 |
description={a combination of \gls{html} and \gls{ssi}} |
| 39 |
} |
| 40 |
|
| 41 |
@abbreviation{html, |
| 42 |
short ="html", |
| 43 |
long = html, |
| 44 |
description={a markup language for creating web pages} |
| 45 |
} |
| 46 |
|
| 47 |
@abbreviation{ssi, |
| 48 |
short="ssi", |
| 49 |
long = ssi, |
| 50 |
description={a simple interpreted server-side scripting language} |
| 51 |
} |
| 52 |
|
| 53 |
@abbreviation{xml, |
| 54 |
short={xml}, |
| 55 |
long={extensible markup language}, |
| 56 |
description={a simple text-base format for representing structured information} |
| 57 |
} |
| 58 |
|
| 59 |
@abbreviation{mathml, |
| 60 |
short={m\BibGlsNoCaseChange{ath}ml}, |
| 61 |
long={mathematical markup language}, |
| 62 |
description={an \gls{xml}-based language for describing mathematical notation} |
| 63 |
} |
| 64 |
\end{filecontents*} |
| 65 |
\begin{filecontents*}{symbols.bib} |
| 66 |
@preamble{"\providecommand{\mtx}[1]{\boldsymbol{#1}}"} |
| 67 |
|
| 68 |
@symbol{M, |
| 69 |
name={\ensuremath{\mtx{M}}}, |
| 70 |
description={a matrix} |
| 71 |
} |
| 72 |
|
| 73 |
@symbol{v, |
| 74 |
name={\ensuremath{\vec{v}}}, |
| 75 |
description={a vector} |
| 76 |
} |
| 77 |
|
| 78 |
@symbol{S, |
| 79 |
name={\ensuremath{\mathcal{S}}}, |
| 80 |
description={a set} |
| 81 |
} |
| 82 |
\end{filecontents*} |
| 83 |
\usepackage[T1]{fontenc} |
| 84 |
\usepackage[record,style=indexgroup]{glossaries-extra} |
| 85 |
|
| 86 |
\renewcommand\GlsXtrDefaultResourceOptions{ |
| 87 |
description-case-change=firstuc, |
| 88 |
post-description-dot=all |
| 89 |
} |
| 90 |
|
| 91 |
\setabbreviationstyle{long-short-sc-desc} |
| 92 |
|
| 93 |
\GlsXtrLoadResources |
| 94 |
[src={abbrvs},sort=letter-nocase,type=main, |
| 95 |
field-aliases={fulllong=long}, |
| 96 |
group={abbreviations}] |
| 97 |
\glsxtrsetgrouptitle{abbreviations}{Abbreviations} |
| 98 |
|
| 99 |
\GlsXtrLoadResources |
| 100 |
[src={symbols},sort=use,type=main,group=symbols] |
| 101 |
\glsxtrsetgrouptitle{symbols}{Symbols} |
| 102 |
|
| 103 |
\GlsXtrLoadResources[src={terms},sort=en-GB,type=main] |
| 104 |
\begin{document} |
| 105 |
\gls{bird} |
| 106 |
|
| 107 |
\gls{shtml} |
| 108 |
|
| 109 |
\gls{M} |
| 110 |
|
| 111 |
\GlsXtrSetDefaultNumberFormat{glsignore} |
| 112 |
\printunsrtglossaries |
| 113 |
\end{document} |