I would like to typeset row operations on a augmented matrix, but the "gauss"-package does not seem to support the vertical line just before the last column, any way to do this?
Thanks!
I would like to typeset row operations on a augmented matrix, but the "gauss"-package does not seem to support the vertical line just before the last column, any way to do this?
Thanks!
The package can't support typing | somewhere like in arrays. But we can emulate it:
\documentclass{article}
\usepackage{amsmath}
\usepackage{gauss}
% patch gauss macros for doing their work in `align'
% and other amsmath environments; see
% http://tex.stackexchange.com/questions/146532/
\usepackage{etoolbox}
\makeatletter
\patchcmd\g@matrix
{\vbox\bgroup}
{\vbox\bgroup\normalbaselines}% restore the standard baselineskip
{}{}
\makeatother
\newcommand{\BAR}{%
\hspace{-\arraycolsep}%
\strut\vrule % the `\vrule` is as high and deep as a strut
\hspace{-\arraycolsep}%
}
\begin{document}
\[
\begin{gmatrix}[p]
1 & 2 & \BAR & 3 \\
4 & 5 & \BAR & 6 \\
7 & 8 & \BAR & 9
\rowops
\swap{0}{1}
\mult{0}{\cdot 7}
\add[5]{1}{2}
\end{gmatrix}
\]
\end{document}
In other words, I create a new column that takes no horizontal space, where I place a bar.

\documentclass[a4paper,twoside,12pt]{article}
\usepackage{gauss}
\newcommand{\BAR}{% \hspace{-\arraycolsep}% \strut\vrule % the
\vruleis as high and deep as a strut \hspace{-\arraycolsep}% }\begin{document} \begin{align} \begin{gmatrix}[p] -1 & 0 & 1 &\BAR& 1 \ 1 & 1 &-2 &\BAR& 0 \ 0 & 1 & -1&\BAR& 0 \rowops \add{0}{1} \mult{0}{\cdot -1} \end{gmatrix} \end{align} \end{document}
– msx Nov 24 '13 at 19:21gmatrixandalign: http://tex.stackexchange.com/questions/146532/gauss-package-gmatrix-not-equivalent-to-corresponding-amsmath-environment Try the workaround there and you should get what you're looking for. – egreg Nov 24 '13 at 20:05\BARlocal to thegmatrixenvironment, so I tried to put the definition inside\apptocmd{gmatrix}{\newcommand{\BAR}...}{}{}. Didn't work. Do you know how I might do that? – Matthew Leingang Feb 19 '17 at 02:55\pretocmd{gmatrix}{\newcommand{\BAR}...works fine. – Matthew Leingang Feb 19 '17 at 03:15