Skip to main content

Matrices

The amsmath package provides commands for typesetting matrices with different delimiters. Once you load \usepackage{amsmath} in the preamble, you can use the following environments in mathematical contexts.

Quick Reference:

\begin{matrix}
1 & 2 & 3\\
a & b & c
\end{matrix}

\begin{pmatrix}
1 & 2 & 3\\
a & b & c
\end{pmatrix}

\begin{bmatrix}
1 & 2 & 3\\
a & b & c
\end{bmatrix}

\begin{Bmatrix}
1 & 2 & 3\\
a & b & c
\end{Bmatrix}

\begin{vmatrix}
1 & 2 & 3\\
a & b & c
\end{vmatrix}

\begin{Vmatrix}
1 & 2 & 3\\
a & b & c
\end{Vmatrix}

\left\lceil
\begin{matrix}
1 & 2 & 3\\
a & b & c
\end{matrix}
\right\rceil

\left\langle
\begin{matrix}
1 & 2 & 3\\
a & b & c
\end{matrix}
\right\rvert

\left\langle
\begin{matrix}
1 & 2 & 3\\
a & b & c
\end{matrix}
\right\rangle

Inline Matrices​

When typesetting inline mathematics, the regular matrix environments above may appear too large. In such cases, using smallmatrix might be better, although you need to provide your own delimiters.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent Trying to typeset an inline matrix here:
$\begin{pmatrix}
a & b\\
c & d
\end{pmatrix}$,
but it looks too big, so let's try
$\big(\begin{smallmatrix}
a & b\\
c & d
\end{smallmatrix}\big)$
instead.
\end{document}