# Using “found” code to typeset augmented matrices, want [] instead of ()

Here's a minimal example of what I'm doing presently:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{arydshln}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother

\begin{document}
$\begin{pmatrix}[ccc:c] 1&2&3&0 \\ 4&5&6&0 \\ 7&8&9&0 \\ \end{pmatrix}$
\end{document}


Here's what the output looks like:

I'd prefer if the left and right brackets on the matrix were square brackets instead of parentheses.

Is there an easy way to make such a change?

Easy. Change pmatrix to bmatrix:
See amsmath documentation for other kinds of matrices, like vmatrix, Vmatrix, etc
• or look at mathmode.pdf (26.6 Matrix environments) with texdoc mathmode.pdf – Alain Matthes Nov 21 '11 at 17:42