Debian Codegraph @

texmf-dist/doc/latex/glossaries-extra/samples/sample-record-nameref.tex

raw
1 % arara: pdflatex
2 % arara: bib2gls
3 % arara: pdflatex
4 \documentclass{article}
5
6 \usepackage{amsmath}
7 \usepackage[colorlinks]{hyperref}
8 \usepackage[record=nameref,% use bib2gls with nameref information (requires bib2gls v1.8+)
9 equations,% switch to equation counter in numbered equations
10 floats,% switch to corresponding counter when in a float
11 counter=section,% use section as the default record counter
12 stylemods,% load glossaries-extra-stylemods.sty
13 style=index]{glossaries-extra}
14
15 \GlsXtrLoadResources[
16 % entries defined in example-glossaries-brief.bib and
17 % example-glossaries-symbols:
18 src={example-glossaries-brief,example-glossaries-symbols},
19 sort={en-GB},% sort according to en-GB locale
20 %selection=all,% select all entries provided in the .bib file
21 loc-suffix% add default suffix (full stop) for location list
22 ]
23
24 \begin{document}
25
26 \Gls[counter=page]{dolor}.
27
28 \section{Sample Section}
29
30 \gls{dolor}, \gls{amet}.
31
32 See \url{https://ctan.org/pkg/bib2gls} for converting
33 \texttt{.bib} to \texttt{.glstex} files.
34
35 \section{Another Section}
36
37 \glspl{lorem}, \gls{amet}.
38
39 `Lorem' unused or undefined? \GlsXtrIfUnusedOrUndefined{lorem}{yes}{no}.
40
41 \begin{figure}[hb]
42 \centering
43 X
44 \caption{Sample Figure \glsfmttext{lorem}}
45 \end{figure}
46
47 \gls{lorem} again.
48
49 \section{Yet Another Section}
50
51 \Gls{lorem}, \gls{amet}, \gls{alpha}.
52
53 \begin{equation}
54 \glssymbol{alpha} = 2\glssymbol[counter=page]{beta}
55 \end{equation}
56
57 \gls{beta}.
58
59 \begin{align}
60 \glssymbol{alpha} &= 2\glssymbol{beta}\\
61 \glssymbol{gamma} &= \glssymbol{beta}[^2] = \frac{1}{4}\glssymbol{alpha}[^2]
62 \end{align}
63
64 \newpage
65
66 \Gls{lorem} and \gls[counter=page]{dolor}.
67
68 \section{Section about \glsfmttext{lorem}}
69
70 \Gls{lorem}.
71
72 \printunsrtglossary
73
74 \end{document}