The matrix environments are matrix, bmatrix, Bmatrix, pmatrix, vmatrix, Vmatrix, and smallmatrix. Each provides a table for expressions, aligned in rows and columns. The main difference between the various types of matrix is the kind of delimeters that surround them.

Each row of a matrix ends with two backslashes (\\). Each column ends with an ampersand (&).

The `array`

environment has a required parameter that gives column specifications. Each column is represented by one letter which says whether the column is left-, center-, or right-aligned. In addition, vertical bars may be included in this specification to render vertical lines in the array.

The `smallmatrix`

environment may be used inline so that the flow of text is not completely disrupted.

If horizontal or vertical lines inside the matrix or tighter control over column alignment are needed, the array environment can be used.

LaTeX markup... | ...results in: | ...is used for: |
---|---|---|

`\begin{matrix}`
| plain matrix | |

`\begin{bmatrix}`
| bracketed matrix; typically represents the matrix itself | |

`\begin{Bmatrix}`
| braced matrix | |

`\begin{pmatrix}`
| parenthesized matrix | |

`\begin{vmatrix}`
| vertical bar matrix; typically represents the determinant | |

`\begin{Vmatrix}`
| double-vertical bar matrix | |

`\begin{smallmatrix}`
| small matrix; can be used inline |