Debian Codegraph @

texmf-dist/doc/support/bib2gls/examples/sample-maths.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[a4paper]{article}
6
7 \usepackage[T1]{fontenc}
8 \usepackage{amssymb}
9
10 \usepackage[colorlinks]{hyperref}
11 \usepackage[record,% using bib2gls
12 nostyles,% don't load default styles
13 postdot,% append a dot after descriptions
14 stylemods={mcols},% load glossary-mcols.sty and patch
15 style=mcolalttree]{glossaries-extra}
16
17 \GlsXtrLoadResources[
18 src={no-interpret-preamble},
19 interpret-preamble=false
20 ]
21
22 \GlsXtrLoadResources[
23 src={interpret-preamble,bigmathsymbols,mathsobjects},
24 sort-field={category},
25 identical-sort-action={description},
26 field-aliases={identifier=category,format=user1},
27 replicate-fields={category=group},
28 set-widest,
29 save-locations=false
30 ]
31
32 \renewcommand{\GlsXtrFmtDefaultOptions}{}
33
34 % requires glossaries-extra.sty v1.23+
35 \newcommand{\set}[2][]{\glsxtrfmt*[#1]{set}{#2}}
36 \newcommand{\nlset}[1]{\glsxtrentryfmt{set}{#1}}
37 \newcommand*{\setcontents}[2][]{\glsxtrfmt*[#1]{setcontents}{#2}}
38 \newcommand*{\setmembership}[2]{\glsxtrfmt*{setmembership}{{#1}{#2}}}
39 \newcommand*{\setcard}[2][]{\glsxtrfmt*[#1]{setcard}{#2}}
40 \newcommand*{\nlsetcard}[1]{\glsxtrentryfmt{setcard}{#1}}
41 \newcommand*{\transpose}[2][]{\glsxtrfmt*[#1]{transpose}{#2}}
42 \newcommand*{\nltranspose}[1]{\glsxtrentryfmt{transpose}{#1}}
43 \newcommand*{\inv}[2][]{\glsxtrfmt*[#1]{inverse}{#2}}
44 \newcommand*{\nlinv}[1]{\glsxtrentryfmt{inverse}{#1}}
45 \newcommand*{\Vtr}[2][]{\glsxtrfmt[#1]{vector}{#2}}
46 \newcommand*{\nlVtr}[1]{\glsxtrentryfmt{vector}{#1}}
47 \newcommand*{\Mtx}[2][]{\glsxtrfmt[#1]{matrix}{#2}}
48 \newcommand*{\nlMtx}[1]{\glsxtrentryfmt{matrix}{#1}}
49
50 \begin{document}
51 \section{Sets}
52 The universal set ($\gls{universalset}$) contains everything.
53 The empty set ($\gls{emptyset}$) contains nothing.
54 Some assignments:
55 \[
56 \set{B}[_1] = \setcontents{1, 3, 5, 7},\quad
57 \set{B}[_2] = \setcontents{2, 4, 6, 8},\quad
58 \set{B}[_3] = \setcontents{9, 10}
59 \]
60 Define:
61 \[\set{A} = \gls{bigcup}[_{i=1}^3] \set{B}[_i]
62 = \setcontents{1, \ldots, 10} \]
63 The cardinality of a set \gls{set} is denoted \gls{setcard}
64 and is the number of elements in the set.
65 \[
66 \setcard{\nlset{B}_1} = 4,\quad
67 \setcard{\nlset{B}_2} = 4,\quad
68 \setcard{\nlset{B}_3} = 2,\quad
69 \setcard{\nlset{B}_1\cup\nlset{B}_2} = 8,\quad
70 \nlsetcard{\gls{emptyset}} = 0
71 \]
72
73 \section{Spaces}
74 A number space (denoted $\gls{numberspace}$) is characterised
75 by a set of entities with a set of axioms. For example:
76 \begin{align*}
77 \gls{naturalnumbers}
78 &= \setmembership{x}{x\text{ is positive integer}}\\
79 \gls{integernumbers}
80 &= \setmembership{x}{x\text{ is an integer}}\\
81 \gls{realnumbers}
82 &= \setmembership{x}{x\text{ is a real number}}
83 \end{align*}
84
85 \section{Vectors and Matrices}
86
87 A matrix (denoted \gls{matrix}) is a rectangular array of values.
88 A vector (denoted \gls{vector}) is a column or row of values (that
89 is a one-dimensional matrix).
90 \[
91 \gls{identitymatrix}\Vtr{x} = \Vtr{x},\quad
92 \Mtx{A}\inv{\nlMtx{A}} = \gls{identitymatrix},\quad
93 \inv{\nlVtr{x}}\gls{1vec} = \gls{sum}[_i] x_i
94 \]
95
96 \printunsrtglossaries
97 \end{document}