LaTeX Equations

Overview

LaTex’s greatest strength over other typesetting systems is its ability to efficiently and cleanly handle the insertion of high-quality equations into documents. This can be done rather easily using the equation environment.

Simple Equation

\begin{equation}
   \label{eq:pythagorean}
   a_1^2 + b_1^2 = c_1^2 
\end{equation}
../_images/equation.png

Inline Equation

LaTeX's strength is once again displayed here ($a_1^2 + b_1^2 = c_1^2$) when trying to insert an equation
inline with existing body text. This is done by enclosing the inline equation with a \$.
../_images/equation_inline.png

Creating Matrices

\begin{equation}
   \begin{matrix} 
   a_{11} & a_{12} & a_{13}  \\
   a_{21} & a_{22} & a_{23}  \\
   a_{31} & a_{32} & a_{33}  \\
   \end{matrix} 
\end{equation}
../_images/equation_matrix.png
\begin{equation}
   \begin{Bmatrix} 
   a_{11} & a_{12} & a_{13}  \\
   a_{21} & a_{22} & a_{23}  \\
   a_{31} & a_{32} & a_{33}  \\
   \end{Bmatrix} 
\end{equation}
../_images/equation_matrix_braces.png
\begin{equation}
   \begin{bmatrix} 
   a_{11} & a_{12} & a_{13}  \\
   a_{21} & a_{22} & a_{23}  \\
   a_{31} & a_{32} & a_{33}  \\
   \end{bmatrix} 
\end{equation}
../_images/equation_matrix_bracket.png
\begin{equation}
   \begin{vmatrix} 
   a_{11} & a_{12} & a_{13}  \\
   a_{21} & a_{22} & a_{23}  \\
   a_{31} & a_{32} & a_{33}  \\
   \end{vmatrix} 
\end{equation}
../_images/equation_matrix_line.png
\begin{equation}
   \begin{Vmatrix} 
   a_{11} & a_{12} & a_{13}  \\
   a_{21} & a_{22} & a_{23}  \\
   a_{31} & a_{32} & a_{33}  \\
   \end{Vmatrix} 
\end{equation}
../_images/equation_matrix_double_line.png
\begin{equation}
   \begin{pmatrix} 
   a_{11} & a_{12} & a_{13}  \\
   a_{21} & a_{22} & a_{23}  \\
   a_{31} & a_{32} & a_{33}  \\
   \end{pmatrix} 
\end{equation}
../_images/equation_matrix_parentheses.png
\begin{equation}
   \begin{smallmatrix} 
   a_{11} & a_{12} & a_{13}  \\
   a_{21} & a_{22} & a_{23}  \\
   a_{31} & a_{32} & a_{33}  \\
   \end{smallmatrix} 
\end{equation}
../_images/equation_matrix_small.png

Aligning Multiple Equations

Multiple equations may be aligned using the split environment where the & symbol is used to define where the alignment is to take place. This can be very useful for proofs and stepping through derivations.

\begin{equation}
   \begin{split}
   a^2 + b^2 &= c^2 \\
   a^2 &= c^2 - b^2\\
   a &= \sqrt{c^2 - b^2}\\ 
   \end{split}
\end{equation}
../_images/equation_alignment.png

Referencing Equations

The example below highlights how the \label command is used to define a unique label to this specific equation and how it can be referenced within the text of the document using the \ref command.

\begin{equation}
   \label{eq:pythagorean}
   a_1^2 + b_1^2 = c_1^2 
\end{equation}

An example table can be seen in \ref{eq:pythagorean}.
Also note how the "Equation" prefix is automatically added within the document text whenever the reference is called.
../_images/equation_reference.png

Referencing Range of Equations

The example below highlights how the \refrange command can be used to reference a range of equations.

\begin{equation}
   \label{eq:pythagorean}
   a_1^2 + b_1^2 = c_1^2 
\end{equation}

\begin{equation}
   \label{eq:integral}
   f(x) = \int^a_b \frac{1}{3}x^3
\end{equation}

\begin{equation}
   \label{eq:einstein}
   E = mc^2
\end{equation}

We can reference a range of tables as seen here: \refrange{eq:pythagorean}{eq:einstein}.
Also note how the "Equations" prefix is automatically added within the document text whenever the range reference is called.
../_images/equation_reference_range.png