# Vertical line in matrix using LaTeXiT [duplicate]

Possible Duplicate:
What's the best way make an “augmented” coefficient matrix?

I am trying to make a vertical line in a matrix in LaTeXiT. I have read that it should be possible using the following:

\begin{bmatrix}{cccc|c}
1 & 0 & 3 & -1 & 0 \\
0 & 1 & 1 & -1 & 0 \\
0 & 0 & 0 & 0 & 0 \\
\end{bmatrix}


But when doing so, this is my output:

-

## marked as duplicate by Andrew Stacey, Torbjørn T., Joseph Wright♦Nov 30 '11 at 12:46

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]$

-
 Possibly adding @{} at the sides: @{}cccc|c@{}, so as to give a similar result to bmatrix. – egreg Nov 3 '11 at 9:33 Thank you very much. The output of this is just like a bmatrix. – SimonBS Nov 3 '11 at 9:43 @egreg: Could you explain how the @{} works? I see that it has the effect of reducing the whitespace between the [ and ] and the matrix contents. – user001 Mar 13 '12 at 17:30 With @{...} you tell LaTeX to put ... in place of the default intercolumn space, which is applied also at the start and end of the tabular. – egreg Mar 13 '12 at 17:37

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{bmatrix}[cccc|c] 1 & 0 & 3 & -1 & 0 \\ 0 & 1 & 1 & -1 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ \end{bmatrix}$$
\end{document}


-
@barbarabeeton This would be a nice addition for amsmath, wouldn't it? – egreg Nov 3 '11 at 9:36