blob: da1d582ca5407b9fec7ef2a026f2329d9023a8fa (
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
|
% This file is embedded in glossaries-extra-manual.pdf
% Example 119 Storing a formatting command in a field
% Label: "ex:glsxtrfmt"
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\usepackage[postdot,style=index]{glossaries-extra}
\makeglossaries
\newcommand*{\mtx}[1]{\boldsymbol{#1}}
\newcommand*{\mtxinv}[1]{\mtx{#1}\sp{-1}}
\newglossaryentry{matrix}{%
name={matrix},
symbol={\ensuremath{\mtx{M}}},
plural={matrices},
user1={mtx},
description={rectangular array of values}
}
\newglossaryentry{identitymatrix}{%
name={identity matrix},
symbol={\ensuremath{\mtx{I}}},
plural={identity matrices},
description={a diagonal matrix with all diagonal elements equal to
1 and all other elements equal to 0}
}
\newglossaryentry{matrixinv}{%
name={matrix inverse},
symbol={\ensuremath{\mtxinv{M}}},
user1={mtxinv},
description={a square \gls{matrix} such that
$\mtx{M}\mtxinv{M}=\glssymbol{identitymatrix}$}
}
\begin{document}
A \gls{matrix} is denoted \glssymbol{matrix}.
The inverse is denoted \glssymbol{matrixinv}.
\[
\glsxtrfmt{matrix}{A}
\glsxtrfmt{matrixinv}{A}
=
\glssymbol{identitymatrix}
\]
Compare $\glsxtrfmt{matrix}{A}[_0]$
with $\glsxtrfmt*{matrix}{A}[_0]$. \printglossaries
\end{document}
|