LaTeX Math Reference
Share
Explore

# BasicsBasics

Math expressions, supported within Coda using the LaTeX::Math() formula, are constructed with an intuitive typesetting markup language, i.e., written in plain text. The LaTeX program takes the input expression and outputs an image, automatically generating reproducible content that can be displayed as an image in a doc or printed onto a book.
For example, a polynomial would be written in LaTeX as such:
10x^2 + 3x + 5
This would produce the following output when provided into the LaTeX typesetting program:
This example makes use of two operators: exponentiation (^) and addition (+). These operators are part of LaTeX's glossary of commands, which can be used to render operators, symbols, and other mathematical constructs. Commands in general begin with a backslash (\), though some of the most common commands are represented using standalone characters (such as + and *).

# Operators

Here are some of the most common operators in LaTeX:
1
+
2
-
subtraction
3
\times
multiplication
4
\cdot
multiplication (dot)
5
\div
division
6
/
division (slash)
7
\pm
plus/minus
8
x^n
exponentiation
There are no rows in this table

# Symbols

LaTeX offers a plethora of various mathematical symbols; see for reference.

# Constructs

LaTeX provides a number of commands to generate common mathematical constructs. For example:
1
1,2,3,\ldots
sequence
2
1+2+3+\cdots
sequence
3
\frac{a}{b}
fraction
4
\sqrt{x}
square root

# Environments

Environments in LaTeX allow defining a special block of content, usually one that spans multiple lines. These are started using the \begin{envname} command and terminated using \end{envname}, where envname is the name of the environment.
For instance, a piecewise function might be defined as such:
1
|x| = \begin{cases} x & x\ge 0\\ -x & x<0 \end{cases}

# Text formatting

When writing math in LaTeX, text is italicized by default as it is meant to be part of the expression. To add explicit text (such as for a unit or label), use the \text command. For instance:
1000 \text{rows} \times 5 \text{tables}
Text commands include:
1
\text{normal text}
2
\textbf{bold text}
3
\textit{italic text}
4
\texttt{monospace text}
5
{\color{red} \text{colored text}}
There are no rows in this table

# Spacing

By default, LaTeX ignores spaces in math markup and automatically adds spacing to make the output look great. To override spacing, use the following four commands:
1
\;
thick space
2
\:
medium space
3
\,
thin space
4
\!
negative thin space
There are no rows in this table

# Sizing

In some cases delimiters such as parentheses might come out too small by default. For instance:
(n \cdot \frac{x^2}{y+c})
To resize these, employ the \left, \right, and \middle commands:
\left(n \cdot \frac{x^2}{y+c}\right)
Much better!