summaryrefslogtreecommitdiff
path: root/support/bib2gls/examples/sample-maths.tex
blob: 677c3bea122d4e21bcb799359e69c20d257c0fb9 (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
% This file is public domain. See the "Examples" chapter
% in the bib2gls user manual for a more detailed description
% of this file.

\documentclass[a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage{amssymb}

\usepackage[colorlinks]{hyperref}
\usepackage[record,% using bib2gls
 nostyles,% don't load default styles
 postdot,% append a dot after descriptions
 stylemods={mcols},% load glossary-mcols.sty and patch
 style=mcolalttree]{glossaries-extra}

\GlsXtrLoadResources[
   src={no-interpret-preamble},
   interpret-preamble=false
]

\GlsXtrLoadResources[
  src={interpret-preamble,bigmathsymbols,mathsobjects},
  sort-field={category},
  identical-sort-action={description},
  field-aliases={identifier=category,format=user1},
  replicate-fields={category=group},
  set-widest,
  save-locations=false
]

\renewcommand{\GlsXtrFmtDefaultOptions}{}

% requires glossaries-extra.sty v1.23+
\newcommand{\set}[2][]{\glsxtrfmt*[#1]{set}{#2}}
\newcommand{\nlset}[1]{\glsxtrentryfmt{set}{#1}}
\newcommand*{\setcontents}[2][]{\glsxtrfmt*[#1]{setcontents}{#2}}
\newcommand*{\setmembership}[2]{\glsxtrfmt*{setmembership}{{#1}{#2}}}
\newcommand*{\setcard}[2][]{\glsxtrfmt*[#1]{setcard}{#2}}
\newcommand*{\nlsetcard}[1]{\glsxtrentryfmt{setcard}{#1}}
\newcommand*{\transpose}[2][]{\glsxtrfmt*[#1]{transpose}{#2}}
\newcommand*{\nltranspose}[1]{\glsxtrentryfmt{transpose}{#1}}
\newcommand*{\inv}[2][]{\glsxtrfmt*[#1]{inverse}{#2}}
\newcommand*{\nlinv}[1]{\glsxtrentryfmt{inverse}{#1}}
\newcommand*{\Vtr}[2][]{\glsxtrfmt[#1]{vector}{#2}}
\newcommand*{\nlVtr}[1]{\glsxtrentryfmt{vector}{#1}}
\newcommand*{\Mtx}[2][]{\glsxtrfmt[#1]{matrix}{#2}}
\newcommand*{\nlMtx}[1]{\glsxtrentryfmt{matrix}{#1}}

\begin{document}
\section{Sets}
The universal set ($\gls{universalset}$) contains everything.
The empty set ($\gls{emptyset}$) contains nothing.
Some assignments:
\[
 \set{B}[_1] = \setcontents{1, 3, 5, 7},\quad
 \set{B}[_2] = \setcontents{2, 4, 6, 8},\quad
 \set{B}[_3] = \setcontents{9, 10}
\]
Define:
\[\set{A} = \gls{bigcup}[_{i=1}^3] \set{B}[_i] 
= \setcontents{1, \ldots, 10} \]
The cardinality of a set \gls{set} is denoted \gls{setcard}
and is the number of elements in the set.
\[
 \setcard{\nlset{B}_1} = 4,\quad
 \setcard{\nlset{B}_2} = 4,\quad
 \setcard{\nlset{B}_3} = 2,\quad
 \setcard{\nlset{B}_1\cup\nlset{B}_2} = 8,\quad
 \nlsetcard{\gls{emptyset}} = 0
\]

\section{Spaces}
A number space (denoted $\gls{numberspace}$) is characterised
by a set of entities with a set of axioms. For example:
\begin{align*}
\gls{naturalnumbers} 
 &= \setmembership{x}{x\text{ is positive integer}}\\
\gls{integernumbers} 
 &= \setmembership{x}{x\text{ is an integer}}\\
\gls{realnumbers} 
 &= \setmembership{x}{x\text{ is a real number}}
\end{align*}

\section{Vectors and Matrices}

A matrix (denoted \gls{matrix}) is a rectangular array of values.
A vector (denoted \gls{vector}) is a column or row of values (that
is a one-dimensional matrix).
\[
  \gls{identitymatrix}\Vtr{x} = \Vtr{x},\quad
  \Mtx{A}\inv{\nlMtx{A}} = \gls{identitymatrix},\quad
  \inv{\nlVtr{x}}\gls{1vec} = \gls{sum}[_i] x_i
\]

\printunsrtglossaries
\end{document}