+-------------------------------------------------------------------+
| LaTeX Note 007
[email protected] |
| Equations 3/2/2014 |
| v0.05 |
+-------------------------------------------------------------------+
Let's just dive in and pick it up as we go. The inline notation to
start math mode is
$ ... $
anything in between that will get typeset as an equation.
$ a + b = c $
To make a fraction
\frac{a}{b}
If you need a percent sign, you need to escape it; LaTeX uses % as a
comment delimiter.
\%
To add subscripts
$ a_1 + b_2 = c_3 $
Superscripts
$ a^2 + b^2 = c^2 $
If you need more than one expression, or more than one digit for that
matter, in your subscripts or superscripts surround them with braces
$ a^{n-1} + b^27 = n $
If you would like to be able to typeset the notation for the statement
"x is an element of the set of real numbers", you can use
$x \in \mathbb{R}$
The \mathbb (blackboard) uses the amsfont package which is called in
the amsmath package
Square roots are easy!
$\sqrt{x}$
So are cube roots (and n!)
$\sqrt[n]{x}$
Topology Stuff
Closure
In your preamble define
\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}
Then $\overbar{\mathbb{R}}$ is the closure of the reals.
Interior
$\mathring{A}$
Boundary
$\partial{S}$
Analysis Stuff
Integral Spacing
Be sure to do integrals with the proper spacing using a \, to add just
a bit of space after the dt.
$\in_0^1 f(t) \, dt$
Function names when using function names in equations be sure to ask
LaTeX to typset them correctly by prefacing the function name with \
$\sin(x)$ looks substantially better than $sin(x)$
Misc. Symbols
ellipsis \cdot
right arrow \rightarrow
implication arrow \Rightarrow
Page Elements
Beyond the basics of setting the mathematical type, which is mostly just
a matter of getting to know TeX, there is also the issue of how your
mathematics will fit into the rest of the page. Equations can be
inline, by using $$ as shown above, but if you need to write more than
one line, then you will want to use different markup.
Aligned equations
Without numbering
\begin{align*}
x &= y^2\\
\sqrt{x} &= y
\end{align*}
With numbering (a (1) after the first line, (2) after the second)
\begin{align}
x &= y^2\\
\sqrt{x} &= y
\end{align}
With numbering on one line only (\notag after end of line you
don't want numbered)
\begin{align}
x &= y^2 \notag\\
\sqrt{x} &= y
\end{align}
Piecewise Function
The key to this is the combination of the \left\{ (remember the
backslash before the {) and the array enviroment.
\begin{align*}
f(x, y)= \left\{
\begin{array}{rr}
\frac{4 x^2 y}{x^4 + y^2}&: x^2+y^2 \neq 0\\
0&: x^2+y^2=0
\end{array}
\right.
\end{align*}