]> gitweb.michael.orlitzky.com - mjotex.git/blob - mjo-common.tex
mjo-set: adopt \set and \setc from mjo-common.
[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 \ifx\mathbb\undefined
8 \usepackage{amsfonts}
9 \fi
10
11 % Place the argument in matching left/right parentheses.
12 \newcommand*{\of}[1]{ \left({#1}\right) }
13
14 % Group terms using parentheses.
15 \newcommand*{\qty}[1]{ \left({#1}\right) }
16
17 % Group terms using square brackets.
18 \newcommand*{\sqty}[1]{ \left[{#1}\right] }
19
20 % A pair of things.
21 \newcommand*{\pair}[2]{ \left({#1},{#2}\right) }
22
23 % A triple of things.
24 \newcommand*{\triple}[3]{ \left({#1},{#2},{#3}\right) }
25
26 % A four-tuple of things.
27 \newcommand*{\quadruple}[4]{ \left({#1},{#2},{#3},{#4}\right) }
28
29 % A five-tuple of things.
30 \newcommand*{\quintuple}[5]{ \left({#1},{#2},{#3},{#4},{#5}\right) }
31
32 % A six-tuple of things.
33 \newcommand*{\sextuple}[6]{ \left({#1},{#2},{#3},{#4},{#5},{#6}\right) }
34
35 % A seven-tuple of things.
36 \newcommand*{\septuple}[7]{ \left({#1},{#2},{#3},{#4},{#5},{#6},{#7}\right) }
37
38 % The direct sum of two things.
39 \newcommand*{\directsum}[2]{ {#1}\oplus{#2} }
40
41 % The direct sum of three things.
42 \newcommand*{\directsumthree}[3]{ \directsum{#1}{\directsum{#2}{#3}} }
43
44 % The factorial operator.
45 \newcommand*{\factorial}[1]{ {#1}! }
46
47 %
48 % Product spaces
49 %
50 % All of the product spaces (for example, R^n) that follow default to
51 % an exponent of ``n'', but that exponent can be changed by providing
52 % it as an optional argument. If the exponent given is ``1'', then it
53 % will be omitted entirely.
54 %
55
56 % The natural n-space, N x N x N x ... x N.
57 \newcommand*{\Nn}[1][n]{
58 \mathbb{N}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
59 }
60
61 \ifdefined\newglossaryentry
62 \newglossaryentry{N}{
63 name={\ensuremath{\Nn[1]}},
64 description={the set of natural numbers},
65 sort=N
66 }
67 \fi
68
69 % The integral n-space, Z x Z x Z x ... x Z.
70 \newcommand*{\Zn}[1][n]{
71 \mathbb{Z}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
72 }
73
74 \ifdefined\newglossaryentry
75 \newglossaryentry{Z}{
76 name={\ensuremath{\Zn[1]}},
77 description={the ring of integers},
78 sort=Z
79 }
80 \fi
81
82 % The rational n-space, Q x Q x Q x ... x Q.
83 \newcommand*{\Qn}[1][n]{
84 \mathbb{Q}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
85 }
86
87 \ifdefined\newglossaryentry
88 \newglossaryentry{Q}{
89 name={\ensuremath{\Qn[1]}},
90 description={the field of rational numbers},
91 sort=Q
92 }
93 \fi
94
95 % The real n-space, R x R x R x ... x R.
96 \newcommand*{\Rn}[1][n]{
97 \mathbb{R}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
98 }
99
100 \ifdefined\newglossaryentry
101 \newglossaryentry{R}{
102 name={\ensuremath{\Rn[1]}},
103 description={the field of real numbers},
104 sort=R
105 }
106 \fi
107
108
109 % The complex n-space, C x C x C x ... x C.
110 \newcommand*{\Cn}[1][n]{
111 \mathbb{C}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
112 }
113
114 \ifdefined\newglossaryentry
115 \newglossaryentry{C}{
116 name={\ensuremath{\Cn[1]}},
117 description={the field of complex numbers},
118 sort=C
119 }
120 \fi
121
122
123 % An indexed arbitrary binary operation such as the union or
124 % intersection of an infinite number of sets. The first argument is
125 % the operator symbol to use, such as \cup for a union. The second
126 % argument is the lower index, for example k=1. The third argument is
127 % the upper index, such as \infty. Finally the fourth argument should
128 % contain the things (e.g. indexed sets) to be operated on.
129 \newcommand*{\binopmany}[4]{
130 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
131 { {#1}_{#2}^{#3}{#4} }
132 { {#1}_{#2}^{#3}{#4} }
133 { {#1}_{#2}^{#3}{#4} }
134 }
135
136
137 \newcommand*{\directsummany}[3]{ \binopmany{\bigoplus}{#1}{#2}{#3} }
138
139
140 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
141 % the real line.
142 \newcommand*{\intervaloo}[2]{ \left({#1},{#2}\right) } % open-open
143 \newcommand*{\intervaloc}[2]{ \left({#1},{#2}\right] } % open-closed
144 \newcommand*{\intervalco}[2]{ \left[{#1},{#2}\right) } % closed-open
145 \newcommand*{\intervalcc}[2]{ \left[{#1},{#2}\right] } % closed-closed
146
147
148 \fi