The math mode of LaTex.
Table of Contents
Documentation and Reference
- LaTex
- LaTeX graphs
- LaTeX math mode document
- LaTeX math mode reference
- KaTeX Supported Functions
- KaTeX Support Symbols
- mathurl.com to help build your formulas
First, there are three ways to declare math mode in LaTeX,
- In-line mode using $
- Block mode using $$
- Block mode using begin{equation} ... end{equation}
Einstein's equation
$E=mc^2$
represent energy is equal to matter multiplied by the speed of light squared.
Einstein's equation
$$
E=mc^2
$$
\begin{equation}
E=mc^2
\end{equation}
There are two main ways to format multiple equations in LaTeX math mode,
begin{aligned}...end{aligned}
- Will align on an ampersandbegin{gathered}...end{gathered}
- Every equation centered
Block mode (using aligned)
$$
\begin{aligned}
a&=b+c \\
d+e&=f
\end{aligned}
$$
Block mode (using gathered)
$$
\begin{gathered}
a=b+c \\
d+e=f
\end{gathered}
$$
For brevity, the dollar sign delimiters are not shown.
Einsteins famous equation
E=mc^2
Pythagorean Theorem
x^n + y^n = z^n
Pythagorean theorem (add numbers)
\qquad \qquad
x^n + y^n = z^n
\qquad \qquad (4)
Square root
\sqrt[3]{x}
Multiple equations (gathered)
\begin{gathered}
a=b+c \\
d+e=f
\end{gathered}
Multiple equations (aligned on ampersand &)
\begin{aligned}
a&=b+c \\
d+e&=f
\end{aligned}
Alignment and spacing (on equal sign)
\begin{aligned}
f(x) =& x^2\! +3x\! +2 \\
f(x) =& x^2+3x+2 \\
f(x) =& x^2\, +3x\, +2 \\
f(x) =& x^2\: +3x\: +2 \\
f(x) =& x^2\; +3x\; +2 \\
f(x) =& x^2\ +3x\ +2 \\
f(x) =& x^2\quad +3x\quad +2 \\
f(x) =& x^2\qquad +3x\qquad +2
\end{aligned}
An integral
\int_{a}^{b} x^2 dx
Limits
\lim_{x\to\infty} f(x)
Some trigonometry
\sin(a + b ) = \sin(a)\cos(b) + \cos(a)\sin(b)
Fractions (binomial coefficients)
\binom{n}{k} = \frac{n!}{k!(n-k)!}
Brackets
\left( \frac{x}{y} \right)
Bracket array
\left(
\begin{array}{ccc}
1 & 2 & 3\\
4 & 4 & 9\\
1 & -8 & 2
\end{array}
\right)
Arrays in Brackets with spacing (\qquad)
\left(
\begin{array}{ccc}
1 & 2 & 3\\
4 & 5 & 9\\
1 & -8 & 2
\end{array}
\right)
\qquad
\left[
\begin{array}{ccc}
1 & 5 & 8\\
0 & 2 & 4\\
3 & 3 & -8
\end{array}
\right]
Some cool arrows
A
\xleftarrow[]{
\text{this way} }
B
\xrightarrow[]{
\text{or that way}}
C
Cases
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1 & \text{if } x < 0
\end{cases}
Getting fancy
\begin{align*}
E_1 & = \frac{e_{1max}}{\sqrt{2}}\\
& = \frac{N_1.{\phi}_m.w}{\sqrt{2}}\\
& = \frac{N_1{\phi}_m.2\pi.f}{\sqrt{2}}\\
\\
E_1 & = 4.44 N_1.{\phi}_m.f \\
\\
E_1 &= \boxed{4.44 N_1.B_m.A.f}
\end{align*}
Some big text
\huge\text{Hello Jeff}