0

This question already has an answer here:

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:

image description

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:

image description

How can I do it?

marked as duplicate by barbara beeton, Werner math-mode Apr 25 '15 at 17:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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
  • 1
    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
1

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}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.