-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmath.tex
98 lines (90 loc) · 2.91 KB
/
math.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
\chapter{Mathematics}
\label{math}
\LaTeX{} excels at typesetting mathematics, both inside body text
($x_n^2+y_n^2=r^2$) and on their own lines:
\[\sum_{n=0}^{\infty} \frac{f^{(n)} (a)}{n!} (x - a)^n\]
The former is typed inside \verb|$...$| or \verb|\(...\)|,
and the latter within \verb|\[...\]|.
In these math environments, the rules of \LaTeX{} change:
\begin{itemize}
\item Most spaces and line breaks are ignored.
Spacing decisions are made for you based on
typographical conventions for mathematics.
\verb|$x+y+z$| and \verb|$x + y + z$| both give you $x+y+z$.
\item Empty lines are not allowed---each formula occupies a single
``paragraph''\quotekern.
\item Letters are automatically italicized, as they are assumed to be variables.
\end{itemize}
To return to normal ``text mode'' inside a formula, use the \verb|\text| command
and friends.
Standard formatting commands work in these blocks.
From
\begin{leftfigure}
\begin{lstlisting}
\[ \text{fake formulas} = \textbf{annoyed mathematicians} \]
\end{lstlisting}
\end{leftfigure}
we get
\[ \text{\lm fake formulas} = \textbf{\lm annoyed mathematicians} \]
\section{Examples}
Math typesetting is the raison d'être of
\LaTeX,\punckern\footnote{Well, \TeX} but we could
take dozens of pages to just cover the basics.
Given the breadth of modern mathematics,
there are \emph{many} different commands and environments.
You owe it to yourself to find some real references and learn what \LaTeX{}
is capable of.
But before moving on, let's see some examples of what it can do.
\begin{enumerate}
\item \verb|x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}|
\[x = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2a} \]
\item \verb|e^{j \theta} = \cos(\theta) + j \sin(\theta)|
\[e^{j \theta} = \cos(\theta) + j \sin(\theta)\]
\item
\begin{verbatim}
\begin{bmatrix}
x' \\
y'
\end{bmatrix} =
\begin{bmatrix}
\cos \theta & -\sin\theta \\
\sin \theta & \cos \theta
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
\end{verbatim}
\[
\begin{bmatrix}
x' \\
y'
\end{bmatrix} =
\begin{bmatrix}
\cos \theta & -\sin\theta \\
\sin \theta & \cos \theta
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
\]
\item
\begin{verbatim}
\oint_{\partial \Sigma} \mathbf{E} \cdot
\mathrm{d}\boldsymbol{\ell}
= - \frac{\mathrm{d}}{\mathrm{d}t}
\iint_{\Sigma} \mathbf{B} \cdot \mathrm{d}\mathbf{S}
\end{verbatim}
\[\oint_{\partial \Sigma} \mathbf{E} \cdot \mathrm{d}\boldsymbol{\ell} = - \frac{\mathrm{d}}{\mathrm{d}t} \iint_{\Sigma} \mathbf{B} \cdot \mathrm{d}\mathbf{S}\]
\end{enumerate}
\exercises{}
\begin{itemize}
\item Number equations for later reference with the \texttt{equaiton} environment.
\item Automatically size parenthesis and braces to fit their contents
with \verb|\left| and \verb|\right|.
\item Learn some of the many helpful features of the \texttt{amsmath}
package from the American Mathematical Society,
such as the \texttt{align} environment for lining up
equivalent equations.
\end{itemize}