LaTeX forum ⇒ GeneralAugmented pmatrix Topic is solved

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

Augmented pmatrix

Postby Plato » Sat Jan 03, 2015 1:29 am

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
  1. \left[\begin{array}{rrrrr|r}
  2. -3 & 6 & -1 & 1 & -7 \\
  3. 1 & -2 & 2 & 3 & -1 \\
  4. 2 & -4 & 5 & 8 & -4
  5. \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.
Reason: code marked

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8979
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jan 04, 2015 1:52 pm

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.

  1. \documentclass{article}
  2. \usepackage{amsmath}
  3. \makeatletter
  4. \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
  5. \hskip -\arraycolsep
  6. \let\@ifnextchar\new@ifnextchar
  7. \array{#1}}
  8. \makeatother
  9. \begin{document}
  10. \[
  11. \begin{pmatrix}[rrrr|r]
  12. -3 & 6 & -1 & 1 & -7 \\
  13. 1 & -2 & 2 & 3 & -1 \\
  14. 2 & -4 & 5 & 8 & -4
  15. \end{pmatrix}
  16. \]
  17. \end{document}


Stefan
Site admin

Plato
Posts: 6
Joined: Wed Nov 19, 2014 7:08 pm

Postby Plato » Mon Jan 05, 2015 1:28 am

Thanks, that worked! Could you please help me with my other question too? viewtopic.php?f=5&t=25477

User avatar
Stefan Kottwitz
Site Admin
Posts: 8979
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Jan 05, 2015 2:00 pm

Sure, I will take a look.

Stefan
Site admin


Return to “General”

Who is online

Users browsing this forum: No registered users and 10 guests