]> gitweb.michael.orlitzky.com - mjotex.git/blob - mjo-common.tex
Begin adding glossary entries, and display them in the example PDF.
[mjotex.git] / mjo-common.tex
1 %
2 % Only the most commonly-used macros. Needed by everything else.
3 %
4 \ifx\havemjocommon\undefined
5 \def\havemjocommon{1}
6
7
8 \ifx\mathbb\undefined
9 \usepackage{amsfonts}
10 \fi
11
12 \ifx\bigtimes\undefined
13 \usepackage{mathtools}
14 \fi
15
16 % Place the argument in matching left/right parentheses.
17 \newcommand*{\of}[1]{ \left({#1}\right) }
18
19 % Group terms using parentheses.
20 \newcommand*{\qty}[1]{ \left({#1}\right) }
21
22 % Group terms using square brackets.
23 \newcommand*{\sqty}[1]{ \left[{#1}\right] }
24
25 % Create a set from the given elements
26 \newcommand*{\set}[1]{\left\lbrace{#1}\right\rbrace}
27
28 % A set comprehension, where the ``such that...'' bar is added
29 % automatically. The bar was chosen over a colon to avoid ambiguity
30 % with the L : V -> V notation. We can't leverage \set here because \middle
31 % needs \left and \right present.
32 \newcommand*{\setc}[2]{\left\lbrace{#1}\ \middle|\ {#2} \right\rbrace}
33
34 % A pair of things.
35 \newcommand*{\pair}[2]{ \left({#1},{#2}\right) }
36
37 % A triple of things.
38 \newcommand*{\triple}[3]{ \left({#1},{#2},{#3}\right) }
39
40 % The Cartesian product of two things.
41 \newcommand*{\cartprod}[2]{ {#1}\times{#2} }
42
43 % The Cartesian product of three things.
44 \newcommand*{\cartprodthree}[3]{ \cartprod{{#1}}{\cartprod{{#2}}{{#3}}} }
45
46 % The direct sum of two things.
47 \newcommand*{\directsum}[2]{ {#1}\oplus{#2} }
48
49 % The direct sum of three things.
50 \newcommand*{\directsumthree}[3]{ \directsum{#1}{\directsum{#2}{#3}} }
51
52 % The factorial operator.
53 \newcommand*{\factorial}[1]{ {#1}! }
54
55 %
56 % Product spaces
57 %
58 % All of the product spaces (for example, R^n) that follow default to
59 % an exponent of ``n'', but that exponent can be changed by providing
60 % it as an optional argument. If the exponent given is ``1'', then it
61 % will be omitted entirely.
62 %
63
64 % The natural n-space, N x N x N x ... x N.
65 \newcommand*{\Nn}[1][n]{
66 \mathbb{N}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
67 }
68
69 \ifdefined\newglossaryentry
70 \newglossaryentry{N}{
71 name={\ensuremath{\Nn[1]}},
72 description={the set of natural numbers},
73 sort=N
74 }
75 \fi
76
77 % The integral n-space, Z x Z x Z x ... x Z.
78 \newcommand*{\Zn}[1][n]{
79 \mathbb{Z}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
80 }
81
82 \ifdefined\newglossaryentry
83 \newglossaryentry{Z}{
84 name={\ensuremath{\Zn[1]}},
85 description={the ring of integers},
86 sort=Z
87 }
88 \fi
89
90 % The rational n-space, Q x Q x Q x ... x Q.
91 \newcommand*{\Qn}[1][n]{
92 \mathbb{Q}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
93 }
94
95 \ifdefined\newglossaryentry
96 \newglossaryentry{Q}{
97 name={\ensuremath{\Qn[1]}},
98 description={the field of rational numbers},
99 sort=Q
100 }
101 \fi
102
103 % The real n-space, R x R x R x ... x R.
104 \newcommand*{\Rn}[1][n]{
105 \mathbb{R}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
106 }
107
108 \ifdefined\newglossaryentry
109 \newglossaryentry{R}{
110 name={\ensuremath{\Rn[1]}},
111 description={the field of real numbers},
112 sort=R
113 }
114 \fi
115
116
117 % The complex n-space, C x C x C x ... x C.
118 \newcommand*{\Cn}[1][n]{
119 \mathbb{C}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
120 }
121
122 \ifdefined\newglossaryentry
123 \newglossaryentry{C}{
124 name={\ensuremath{\Cn[1]}},
125 description={the field of complex numbers},
126 sort=C
127 }
128 \fi
129
130
131 % The space of real symmetric n-by-n matrices.
132 \newcommand*{\Sn}[1][n]{
133 \mathcal{S}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
134 }
135
136 \ifdefined\newglossaryentry
137 \newglossaryentry{Sn}{
138 name={\ensuremath{\Sn}},
139 description={the set of $n$-by-$n$ real symmetric matrices},
140 sort=Sn
141 }
142 \fi
143
144 % The space of complex Hermitian n-by-n matrices.
145 \newcommand*{\Hn}[1][n]{
146 \mathcal{H}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
147 }
148
149 \ifdefined\newglossaryentry
150 \newglossaryentry{Hn}{
151 name={\ensuremath{\Hn}},
152 description={the set of $n$-by-$n$ complex Hermitian matrices},
153 sort=Hn
154 }
155 \fi
156
157 %
158 % Basic set operations
159 %
160
161 % The union of its two arguments.
162 \newcommand*{\union}[2]{ {#1}\cup{#2} }
163
164 % A three-argument union.
165 \newcommand*{\unionthree}[3]{ \union{\union{#1}{#2}}{#3} }
166
167 % The intersection of its two arguments.
168 \newcommand*{\intersect}[2]{ {#1}\cap{#2} }
169
170 % A three-argument intersection.
171 \newcommand*{\intersectthree}[3]{ \intersect{\intersect{#1}{#2}}{#3} }
172
173 % An indexed arbitrary binary operation such as the union or
174 % intersection of an infinite number of sets. The first argument is
175 % the operator symbol to use, such as \cup for a union. The second
176 % argument is the lower index, for example k=1. The third argument is
177 % the upper index, such as \infty. Finally the fourth argument should
178 % contain the things (e.g. indexed sets) to be operated on.
179 \newcommand*{\binopmany}[4]{
180 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
181 { {#1}_{#2}^{#3}{#4} }
182 { {#1}_{#2}^{#3}{#4} }
183 { {#1}_{#2}^{#3}{#4} }
184 }
185
186 \newcommand*{\intersectmany}[3]{ \binopmany{\bigcap}{#1}{#2}{#3} }
187 \newcommand*{\cartprodmany}[3]{ \binopmany{\bigtimes}{#1}{#2}{#3} }
188 \newcommand*{\directsummany}[3]{ \binopmany{\bigoplus}{#1}{#2}{#3} }
189 \newcommand*{\unionmany}[3]{ \binopmany{\bigcup}{#1}{#2}{#3} }
190
191
192 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
193 % the real line.
194 \newcommand*{\intervaloo}[2]{ \left({#1},{#2}\right) } % open-open
195 \newcommand*{\intervaloc}[2]{ \left({#1},{#2}\right] } % open-closed
196 \newcommand*{\intervalco}[2]{ \left[{#1},{#2}\right) } % closed-open
197 \newcommand*{\intervalcc}[2]{ \left[{#1},{#2}\right] } % closed-closed
198
199
200 \fi