Vertical line in matrix using LaTeXiT

The bmatrix environment does not provide this facility (see section 4.1 of the amsmath package documentation). You can use the array environment instead.

\[
\left[
\begin{array}{cccc|c}
1 & 0 & 3 & -1 & 0 \\
0 & 1 & 1 & -1 & 0 \\
0 & 0 & 0 & 0 & 0 \\
\end{array}
\right]
\]

That won't work with the matrix environment from amsmath, however Stefan Kottwitz wrote about a workaround for this on his blog.

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
  \hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{#1}}
\makeatother
\begin{document}
\begin{equation}
  \begin{bmatrix}[cccc|c]
   1 & 0 & 3 & -1 & 0 \\
   0 & 1 & 1 & -1 & 0 \\
   0 & 0 & 0 & 0 & 0 \\
\end{bmatrix}
\end{equation}
\end{document}

enter image description here

Tags:

Matrices