-
Notifications
You must be signed in to change notification settings - Fork 1
/
amsmath.tex
395 lines (338 loc) · 11.7 KB
/
amsmath.tex
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% Align text to left
\raggedright
% Headings
\usepackage{titlesec}
\titleformat{\section}[display]
{\large\sffamily\bfseries}{\thesection}{1cm}{}
% Font settings
\usepackage[tracking]{microtype}
\usepackage[sc,osf]{mathpazo}
\linespread{1.025}
\usepackage[euler-digits,small]{eulervm}
\AtBeginDocument{\renewcommand{\hbar}{\hslash}}
% Landscape orientation
\usepackage[margin=2cm, landscape]{geometry}
% Multi-column document
\usepackage{multicol}
% No page numbering
\pagenumbering{gobble}
% Less vertical spacing
\raggedcolumns
% Coding environment
\usepackage{listings}
\lstset{basicstyle=\small\ttfamily}
\lstMakeShortInline|
% Math packages (AmS)
\usepackage{amsmath}
\usepackage{amssymb}
% Additional symbols
\usepackage{bbm}
% For examples
\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\usepackage{bm}
\begin{document}
% Title
{\centering \textsc{\huge \AmS-\LaTeX\ Quick Reference} \par}
\vspace{1mm}
\rule{\textwidth}{0.2mm}
\begin{multicols*}{3}
\section*{Packages}
The main package to load is |amsmath|.
More symbols are included in |amssymb|.
\section*{Typeset}
For text style (inline) math, use: |$| \dots\ |$| \\
For display style math, which breaks the paragraph: \\
|\begin{equation}| \dots\ |\end{equation}| (numbered) or |\[| \dots\ |\]| (non-numbered).
\section*{Greek letters}
\begin{tabular}{clclcl}
$\alpha$ & |\alpha| & $\beta$ & |\beta| & $\gamma$ & |\gamma| \\
$\delta$ & |\delta| & $\epsilon$ & |\epsilon| & $\varepsilon$ & |\varepsilon| \\
$\zeta$ & |\zeta| & $\eta$ & |\eta| & $\theta$ & |\theta| \\
$\vartheta$ & |\vartheta| & $\iota$ & |\iota| & $\kappa$ & |\kappa| \\
$\lambda$ & |\lambda| & $\mu$ & |\mu| & $\nu$ & |\nu| \\
$\xi$ & |\xi| & $\pi$ & |\pi| & $\varpi$ & |\varpi| \\
$\rho$ & |\rho| & $\varrho$ & |\varrho| & $\sigma$ & |\sigma| \\
$\tau$ & |\tau| & $\upsilon$ & |\upsilon| & $\phi$ & |\phi| \\
$\varphi$ & |\varphi| & $\chi$ & |\chi| & $\psi$ & |\psi| \\
$\omega$ & |\omega| \\
$\Gamma$ & |\Gamma| & $\Delta$ & |\Delta| & $\Theta$ & |\Theta| \\
$\Lambda$ & |\Lambda| & $\Xi$ & |\Xi| & $\Pi$ & |\Pi| \\
$\Sigma$ & |\Sigma| & $\Upsilon$ & |\Upsilon| & $\Phi$ & |\Phi| \\
$\Psi$ & |\Psi| & $\Omega$ & |\Omega|
\end{tabular}\\
\vspace{2mm}
To ensure a consistent style throughout the document: \\
\vspace{1mm}
|\renewcommand{\epsilon}{\varepsilon}| \\
|\renewcommand{\theta}{\vartheta}| \\
|\renewcommand{\rho}{\varrho}| \\
|\renewcommand{\phi}{\varphi}|
\section*{Mathematical font}
$\mathcal{A} \, \mathcal{B} \, \mathcal{C} \, \mathcal{D} \, \mathcal{E} \, \mathcal{F} \, \mathcal{G} \, \mathcal{H} \, \mathcal{I} \, \mathcal{J} \, \mathcal{K} \, \mathcal{L} \, \mathcal{M} \, \mathcal{N} \, \mathcal{O} \, \mathcal{P} \, \mathcal{Q} \, \mathcal{R} \, \mathcal{S} \, \mathcal{T} \, \mathcal{U} \, \mathcal{V} \, \mathcal{W} \, \mathcal{X} \, \mathcal{Y} \, \mathcal{Z}$ \\
\vspace{1mm}
|\mathcal{| \emph{letter} |}|
\section*{Superscript \& Subscript}
\begin{tabular}{clccl}
$x^y$ & |x^y| & $\quad$ & $x^{a+b}$ & |x^{a+b}| \\
$x_y$ & |x_y| & $\quad$ & $x_{a+b}$ & |x_{a+b}|
\end{tabular}
\section*{Root}
\begin{tabular}{rcl}
Square root & $\sqrt{x}$ & |\sqrt{x}| \\
N-th root & $\sqrt[N]{x}$ & |\sqrt[N]{x}|
\end{tabular}
\section*{Dots}
\begin{tabular}{rcl}
Multiplication dot & $\cdot$ & |\cdot| \\
Three centered dots & $\cdots$ & |\cdots| \\
Three baseline dots & $\ldots$ & |\ldots| \\
Three diagonal dots & $\ddots$ & |\ddots| \\
Three vertical dots & $\vdots$ & |\vdots|
\end{tabular}
\section*{Spaces}
\begin{tabular}{rl}
Negative space & |\!| \\
Thinnest space & |\,| \\
Thin space & |\:| \\
Medium space & |\;| \\
1em space & |\quad| \\
2em space & |\qquad|
\end{tabular}
\section*{Braces}
|\overbrace{| \dots\ |}^{| \emph{text over brace} |}| \\
|\underbrace{| \dots\ |}_{| \emph{text under brace} |}|
\section*{Accents}
\begin{tabular}{clclcl}
$\hat{a}$ & |\hat{a}| & $\bar{a}$ & |\bar{a}| & $\mathring{a}$ & |\mathring{a}| \\
$\check{a}$ & |\check{a}| & $\dot{a}$ & |\dot{a}| & $\vec{a}$ & |\vec{a}| \\
$\tilde{a}$ & |\tilde{a}| & $\ddot{a}$ & |\ddot{a}| & $\widehat{AAA}$ & |\widehat{AAA}|
\end{tabular}
\section*{Operators}
\begin{tabular}{lllll}
|\sin| & |\cos| & |\arcsin| & |\arccos| & |\sinh| \\
|\cosh| & |\tan| & |\arctan| & |\log| & |\ln|\\
|\max| & |\min| & |\sup| & |\inf| & |\tanh|\\
|\cot| & |\sec| & |\csc| & |\det|
\end{tabular}\\
\vspace{2mm}
To define a custom operator:\\
|\DeclareMathOperator{\argmax}{argmax}|
\section*{Modulo}
\begin{tabular}{rl}
$a \bmod b$ & |a \bmod b| \\
$a \equiv b \pmod{m}$ & |a \equiv b \pmod{m}|
\end{tabular}
\section*{Fractions}
|\frac{| \dots\ |}{| \dots\ |}|
\section*{Symbol stacking}
|\overset{| \dots\ |}{| \dots\ |}| $\qquad$ |\underset{| \dots\ |}{| \dots\ |}| \\
\vspace{1mm}
First argument is the main symbol, second argument is the symbol to put over or under the main symbol.
\section*{Big operators}
\bgroup
\def\arraystretch{2.3}
\begin{tabular}{clcl}
$\displaystyle \int_{a}^{b}$ & |\int_{a}^{b}| & $\displaystyle \sum_{k=0}^{n}$ & |\sum_{k=0}^{n}| \\
$\displaystyle \prod_{k=0}^{n}$ & |\prod_{k=0}^{n}| & $\displaystyle \lim_{x \to 0}$ & |\lim_{x \to 0}|
\end{tabular}
\egroup
\vspace{3mm}
For multiple integrals: $\iint$ |\iint| $\,\, \iiint$ |\iiint| etc.
Closed path integral: $\oint$ |\oint|
\section*{Delimiter size}
Change the delimiter size by adding one of these modifiers immediately before the delimiter itself: \\
|\big \Big \bigg \Bigg|\\
\vspace{2mm}
Let \LaTeX\ determine the correct size using |\left| and |\right| immediately before the opening and closing delimiters, respectively.
\section*{Absolute value \& Norm}
\begin{tabular}{cl}
$\lvert x \rvert$ & |\lvert x \rvert| \\
$\lVert x \rVert$ & |\lVert x \rVert|
\end{tabular}
\vspace{3mm}
The same can be achieved by defining: \\
\vspace{1mm}
|\usepackage{mathtools}| \\
|\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}| \\
|\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}| \\
\vspace{3mm}
Use starred variants |\abs*| and |\norm*| to produce the correct delimiter height for any kind of equation.
\vspace{3mm}
\bgroup
\def\arraystretch{1.2}
\begin{tabular}{clcl}
$\abs{x}$ & |\abs{x}| & $\abs*{\frac{a}{b}}$ & |\abs*{\frac{a}{b}}| \\
$\norm{x}$ & |\norm{x}|& $\norm*{\frac{a}{b}}$ & |\norm*{\frac{a}{b}}|
\end{tabular}
\egroup
\section*{Arrows}
\begin{tabular}{clclcl}
$\uparrow$ & |\uparrow| & $\downarrow$ & |\downarrow| & $\updownarrow$ & |\updownarrow| \\
$\Uparrow$ & |\Uparrow| & $\Downarrow$ & |\Downarrow| & $\Updownarrow$ & |\Updownarrow|
\end{tabular}
\begin{tabular}{clcl}
$\leftarrow$ & |\leftarrow| or |\gets| & $\rightarrow$ & |\rightarrow| or |\to| \\
$\leftrightarrow$ & |\leftrightarrow| & $\Leftarrow$ & |\Leftarrow| \\
$\Rightarrow$ & |\Rightarrow| & $\Leftrightarrow$ & |\Leftrightarrow| \\
$\mapsto$ & |\mapsto|
\end{tabular}
{\centering
\begin{tabular}{cl}
$\longleftarrow$ & |\longleftarrow| \\
$\longrightarrow$ & |\longrightarrow| \\
$\longleftrightarrow$ & |\longleftrightarrow| \\
$\Longleftarrow$ & |\Longleftarrow| \\
$\Longrightarrow$ & |\Longrightarrow| \\
$\Longleftrightarrow$ & |\Longleftrightarrow| \\
$\longmapsto$ & |\longmapsto|
\end{tabular}
\par}
\section*{Binary relations}
\begin{tabular}{clclclcl}
$\ne$ & |\ne| & $\le$ & |\le| & $\ge$ & |\ge| \\
$\equiv$ & |\equiv| & $\ll$ & |\ll| & $\gg$ & |\gg| \\
$\doteq$ & |\doteq| & $\sim$ & |\sim| & $\simeq$ & |\simeq| \\
$\subset$ & |\subset| & $\supset$ & |\supset| & $\approx$ & |\approx| \\
$\subseteq$ & |\subseteq| & $\supseteq$ & |\supseteq| & $\cong$ & |\cong| \\
$\in$ & |\in| & $\ni$ & |\ni| & $\propto$ & |\propto| \\
$\mid$ & |\mid| & $\parallel$ & |\parallel| & $\perp$ & |\perp|
\end{tabular}
\vspace{3mm}
It's possible to negate these symbols by prefixing them with |\not| (for example: $\not\equiv$ |\not\equiv|)
\section*{Binary operators}
\begin{tabular}{clclcl}
$\pm$ & |\pm| & $\mp$ & |\mp| & $\cdot$ & |\cdot| \\
$\div$ & |\div| & $\times$ & |\times| & $\setminus$ & |\setminus| \\
$\star$ & |\star| & $\cup$ & |\cup| & $\cap$ & |\cap| \\
$\ast$ & |\ast| & $\circ$ & |\circ| & $\bullet$ & |\bullet| \\
$\oplus$ & |\oplus| & $\ominus$ & |\ominus| & $\odot$ & |\odot| \\
$\oslash$ & |\oslash| & $\otimes$ & |\otimes| & $\smallsetminus$ & |\smallsetminus|
\end{tabular}
\section*{Logic symbols}
\begin{tabular}{clclcl}
$\lor$ & |\lor| & $\land$ & |\land| & $\neg$ & |\neg| \\
$\exists$ & |\exists| & $\nexists$ & |\nexists| & $\forall$ & |\forall| \\
$\implies$ & |\implies| & $\iff$ & |\iff| & $\models$ & |\models|
\end{tabular}
\section*{Other symbols}
\begin{tabular}{rcl}
Infinity & $\infty$ & |\infty| \\
Partial derivative & $\partial$ & |\partial| \\
Empty set & $\emptyset$ & |\emptyset| \\
Nabla & $\nabla$ & |\nabla| \\
Angle brackets & $\langle x \rangle$ & |\langle x \rangle|
\end{tabular}
\section*{Multi line equations}
Use the |multline| environment: \\
|\begin{multline}| \dots\ |\end{multline}| \\
\vspace{2mm}
To align equations, use the |align| environment. Specify the alignment position with |&| and separate equations with |\\|: \\
\vspace{1mm}
|\begin{align}| \\
\dots\ |&=| \dots |\\| \\
\dots\ |&=| \dots \\
|\end{align}|
\section*{Vectors}
\begin{tabular}{cl}
$\vec{x}$ & |\vec{x}| \\
$\bm{x}$ & |\bm{x}| (needs |bm| package)
\end{tabular}
\vspace{2mm}
Best practice to easily switch between types: \\
|\usepackage{bm}| \\
|\renewcommand{\vec}{\bm}|
\section*{Arrays}
Use the |array| environment. Use |\\| to separate rows, and |&| to separate elements of each row. To produce large delimiters around the array, use |\left| and |\right| followed by the desired delimiter. \\
\begin{center}
\begin{minipage}[c]{3cm}
$\left(
\begin{array}{lcr}
a & b & c \\
d & e & f \\
g & h & i
\end{array}
\right)$
\end{minipage}
\hspace{0.1cm}
\begin{minipage}[c]{2.5cm}
|\left(| \\
|\begin{array}{lcr}| \\
| a & b & c \\| \\
| d & e & f \\| \\
| g & h & i| \\
|\end{array}| \\
|\right)|
\end{minipage}
\end{center}
Each letter in the argument of the array represents a column: \\
\vspace{2mm}
\begin{tabular}{cl}
|l| & left aligned text \\
|c| & centered text \\
|r| & right aligned text
\end{tabular}
\section*{Cases}
Use the |cases| environment. Use |\\| to separate different cases, and |&| for correct alignment. \\
\vspace{3mm}
\begin{minipage}[c]{3cm}
$\quad
\begin{cases}
x & \text{if } x > 0 \\
0 & \text{if } x \le 0
\end{cases}$
\end{minipage}
\hspace{0.1cm}
\begin{minipage}[c]{2cm}
|\begin{cases}| \\
| x & \text{if } x > 0 \\| \\
| 0 & \text{if } x \le 0| \\
|\end{cases}|
\end{minipage}
\columnbreak
\section*{Matrices}
Use one of the following environments: \\
\vspace{2mm}
$\qquad$
\begin{tabular}{rl}
|matrix| & No delimiter \\
|pmatrix| & $($ delimiter \\
|bmatrix| & $[$ delimiter \\
|Bmatrix| & $\{$ delimiter \\
|vmatrix| & $\lvert$ delimiter \\
|Vmatrix| & $\lVert$ delimiter
\end{tabular}
\vspace{3mm}
Use |\\| to separate different rows, and |&| to separate elements of each row.
\begin{center}
\begin{minipage}[c]{3cm}
$\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
\end{bmatrix}$
\end{minipage}
\hspace{0.2cm}
\begin{minipage}[c]{3cm}
|\begin{bmatrix}| \\
| 1 & 2 & 3 \\| \\
| 4 & 5 & 6| \\
|\end{bmatrix}|
\end{minipage}
\end{center}
\vspace{1mm}
To produce a small matrix, useful for inline math, use the |smallmatrix| environment: $\left[\begin{smallmatrix} a & b \\ c & d \end{smallmatrix}\right]$.
\section*{Blackboard bold}
Include the package |bbm| for these symbols.
\begin{center}
\begin{tabular}{rcl}
Blackboard 1 & $\mathbb{1}$ & |\mathbb{1}|\\
Blackboard R & $\mathbb{R}$ & |\mathbb{R}|
\end{tabular}
\end{center}
All letters are supported.
\end{multicols*}
\end{document}