# Multiple equations in square bracket matrix [duplicate]

When solving many equations you usually stuff them in matrices and solve them using Gauss-Jordan elimination. Where I come from, we write it like this and this is what should appear in my document:

The gray parts of image are there for clarity and are not part of what I need. I just need (n+1) x n matrix with separation line. I will also need to display multiple of the matrices next to each other to show the GEM process:

How can I do it?

## marked as duplicate by barbara beeton, Werner math-mode StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 25 '15 at 17:04

• That's really interesting, thanks. I'll try to figure out how to make the brackers square. – Tomáš Zato Apr 25 '15 at 16:39
• If you want to use gauss, there's a way for using square brackets. Just do \begin{gmatrix}[b] instead of \begin{gmatrix}[p] – egreg Apr 25 '15 at 16:45
• The documentation for the gauss package on page 8 explains how to change the delimiters texdoc.net/texmf-dist/doc/latex/gauss/gauss-doc.pdf – R. Schumacher Apr 25 '15 at 16:46

Taken from Stefan's answer in https://tex.stackexchange.com/a/2244/46716

\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}[*3c|c] 2 & 5 & 0 & 7 \\ 3 & 0 & 4 & 2 \\ 4 & 2 & 6 & 3 \\ \end{bmatrix} \Rightarrow \begin{bmatrix}[*3c|c] 2 & 2 & 2 & 6 \\ 3 & 0 & 4 & 6 \\ 5 & 2 & 6 & 6 \\ \end{bmatrix}$

\end{document}