GeneralAugmented pmatrix

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Plato
Posts: 6
Joined: Wed Nov 19, 2014 7:08 pm

Augmented pmatrix

Post by Plato »

Hello, I'm using TeXnicCenter, and I wish to have pmatrices in augmented form (with a vertical line).

I know how to get an augmented matrix with square brackets, by using the code

Code: Select all

\left[\begin{array}{rrrrr|r}
  -3 & 6 & -1 & 1 & -7 \\
   1 & -2 & 2 & 3 & -1 \\
   2 & -4 & 5 & 8 & -4
\end{array}\right]
But I want augmented matrices with normal (round) parentheses. I tried using the code: \begin{pmatrix}[ccc|c] but it didn't work.
Please help anyone?
Last edited by Stefan Kottwitz on Sun Jan 04, 2015 1:44 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Augmented pmatrix

Post by Stefan Kottwitz »

You could use \left( and \right) instead of \left[ and \right].

But there's a way to extend matrices, I posted it earlier here: Creating an Augmented matrix.

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
  \hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{#1}}
\makeatother
\begin{document}
\[
  \begin{pmatrix}[rrrr|r]
    -3 &  6 & -1 & 1 & -7 \\
     1 & -2 &  2 & 3 & -1 \\
     2 & -4 &  5 & 8 & -4
  \end{pmatrix}
\]
\end{document}
Stefan
LaTeX.org admin
Plato
Posts: 6
Joined: Wed Nov 19, 2014 7:08 pm

Re: Augmented pmatrix

Post by Plato »

Thanks, that worked! Could you please help me with my other question too? http://latex-community.org/forum/viewto ... =5&t=25477
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Augmented pmatrix

Post by Stefan Kottwitz »

Sure, I will take a look.

Stefan
LaTeX.org admin
Post Reply