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.
\vrule
is 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}