Quick Guide to Typing Math in LaTeX\LaTeX

Where to Use It


Table of Contents:
SymbolsScriptsFractionsFencesRadicalsGreekFunctionsCalculusGeometryMiscellaneous

Additional Resources:


Symbols

While some operators, such as addition + and subtraction -, and some comparators, such as equals =, greater than >, and less than <, require no special input, many do require a little formatting.

Input Result
\div ÷\div
\cdot \cdot
\ast \ast
\pm ±\pm
\neq \neq
\approx \approx
\leq \leq
\geq \geq

Scripts

Superscripts, like exponents, can be achieved with ^, and subscripts can be achieved with _. If the argument is more than one character, it must be wrapped in curly braces {}.

Input Result
x^4 x4x^4
a_5 a5a_5
5^{2x} 52x5^{2x}

Fractions

Fractions can be written in multiple ways, depending on the desired formatting. Inline fractions can be done with \frac{num}{den}, and if more space is desired, \dfrac{num}{den} can be used. For very simple fractions, a single / may be sufficient.

Input Result
\frac{5}{x-1} 5x1\frac{5}{x-1}
\dfrac{2x}{x^2-8} 2xx28\dfrac{2x}{x^2-8}
5/3 5/35/3

Fences

Parentheses () and brackets [] are the most common fences for grouping mathematical objects, and generally work as expected. To use curly braces, they must be prepended with backslashes \{\}.

Fences do not automatically grow to be the correct height, such as when putting fractions between parentheses. This can be fixed by prepending the fences with \left and \right as appropriate.

Input Result
(2x+5)(x-1) (2x+5)(x1)(2x+5)(x-1)
\left(\dfrac{3}{x+5}\right) (3x+5)\left(\dfrac{3}{x+5}\right)
\left[\dfrac{8}{x^2}\right]_{0}^{2} [8x2]02\left[\dfrac{8}{x^2}\right]_{0}^{2}

Radicals

Despite the name seeming to only be for square roots, all radicals can be expressed with \sqrt[n]{rad}, where n is the index of the radical (if omitted, it is not drawn, and the result is a square root).

Input Result
\sqrt{3x} 3x\sqrt{3x}
\sqrt[4]{\dfrac{5}{2x^2}} 52x24\sqrt[4]{\dfrac{5}{2x^2}}

Greek

The Greek alphabet is accessed by typing the name of the letter prepended by a backslash \. If the first letter is capitalized, then the Greek letter will be capitalized.

Input Result
\pi π\pi
\Delta Δ\Delta
\theta θ\theta
\Sigma Σ\Sigma

Functions

In order for special function names to stand out from variables, they must be prepended with a backslash \. These functions include trigonometric functions (such as \sin), plus the inverse (\arccos) and hyperbolic (\tanh) forms, and logarithmic functions (\log and \ln). You can see some examples in the next section.

Calculus

Three unique functions are limits \lim, summations \sum, and integrals \int. Bounds can be included using scripts, and \limits can be added prior to the bounds to ensure they placed below and above the symbols.

Input Result
\int_{0}^{\infty}{f(x)dx} 0f(x)dx\int_{0}^{\infty}{f(x)dx}
\sum\limits_{i=1}^{n}i=\dfrac{n(n+1)}{2} i=1ni=n(n+1)2\sum\limits_{i=1}^{n}i=\dfrac{n(n+1)}{2}
\lim\limits_{x\to{0}}{\dfrac{\ln(1-x)-\sin{x}}{1-\cos^{2}{x}}} limx0ln(1x)sinx1cos2x\lim\limits_{x\to{0}}{\dfrac{\ln(1-x)-\sin{x}}{1-\cos^{2}{x}}}

Note the use of \infty for the infinity symbol, and \to to create an arrow to the right.

Geometry

There are several unique symbols and markings used in geometry. The table below lists several examples.

Input Result
m\angle{Q}=40^\circ mQ=40m\angle{Q}=40^\circ
\angle{ABC}\cong\angle{DEF} ABCDEF\angle{ABC}\cong\angle{DEF}
\Delta PQR\sim\Delta LMN ΔPQRΔLMN\Delta PQR\sim\Delta LMN
\overline{XY}\perp\overline{YZ} XYYZ\overline{XY}\perp\overline{YZ}
\overleftrightarrow{RS}\parallel\overleftrightarrow{UV} RSundefinedUVundefined\overleftrightarrow{RS}\parallel\overleftrightarrow{UV}

Miscellaneous

Plain text can be inserted into math equations with \text.

Input Result
\sin\theta=\dfrac{\text{opposite side}}{\text{hypotenuse}} sinθ=opposite sidehypotenuse\sin\theta=\dfrac{\text{opposite side}}{\text{hypotenuse}}

If additional space between parts of an equation are needed, it can be achieved with various inputs, depending on the amount of space. To add a small amount of space, use \, \: or \; (each slightly larger than the previous). Space can be subtracted with \! and larger amounts of space can be added with \quad or \qquad.

Input Result
(a,\!b) (a, ⁣b)(a,\!b)
(a,b) (a,b)(a,b)
(a,\,b) (a,b)(a,\,b)
(a,\:b) (a,b)(a,\:b)
(a,\;b) (a,  b)(a,\;b)
(a,\quad b) (a,b)(a,\quad b)
(a,\qquad b) (a,b)(a,\qquad b)