TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to visualize some matrix operations like that:

enter image description here

How can I do that (preferably something that also works for mathjax)?

share|improve this question
A non-LaTeX related remark: By inspection, I can see what the first transformation is meant to do, and I can sort-of guess what the second one is going to do. But that's because I'm familiar enough with linear algebra that I'd also be able to guess reasonably well if all you had written were the matrices with a squiggly arrow between them. Unless you expect your readers to be reading and writing these diagrams, communicating in the same notation with other people, for enough years into the future that this shorthand remains permanently useful to them, I suggest something easier to render. – Niel de Beaudrap Jan 6 '12 at 17:38
Well, first of all this is not my image. I've searched for it. And I am currenctly writing some blogposts for math students in the first term. They should do the calculations and learn how to use Gaussian elimination. So I want to explain it step by step. As soon as I am covering more advanced topics, I'll simply provide the solution of the Gaussian elimination. – Martin Thoma Jan 6 '12 at 18:11
A fairly common way to represent row operations is something along the lines of R2 - t \cdot R1, or -R3, to show what's being changed between the matrices, in a format not unlike this answer to a related question. – Niel de Beaudrap Jan 6 '12 at 19:30
Also have a look at the examples on this link. – percusse Jan 7 '12 at 2:19
@percusse: Thanks for sharing this link. tikz is amazing, but in this case it seems not like it would provide what I've been looking for. – Martin Thoma Jan 7 '12 at 13:48
up vote 20 down vote accepted

Can't say about MathJax, but the gauss package does this.

enter image description here

 1 & 2 & 3 \\
 4 & 5 & 6 \\
 7 & 8 & 9
 \mult{0}{\cdot 7}
share|improve this answer
This is great! It looks exactly like what I've been looking for. But it doesn't work with MathJax. I gave your answer +1 and I'll accept it in a week if nobody has a solution that works with MathJax. – Martin Thoma Jan 6 '12 at 18:07
I suppose this explains where the notation came from. Is this common many places, outside of users of this package? I've never seen it before. – Niel de Beaudrap Jan 6 '12 at 19:20
Another common notation is just writing the matricies with a arrow between them. Such like – N3buchadnezzar Jan 6 '12 at 19:29
I've just found this list with Latex features supported by MathJax: mathjax.org/docs/1.1/tex.html – Martin Thoma Feb 10 '12 at 16:17

I'm used to the following notation:


You can use the following LaTex Code in MathJax (The code looks a little bit messy because I'm not used to MathJax):

        &II-I \\
        &III-2\cdot I\
share|improve this answer
Nice workaround, but not what I've searched for: +1 – Martin Thoma Jan 8 '12 at 14:37

Since TikZ or PsTricks are not supported in Math JaX getting those back pointing arrows or proper placement of symbols are not possible as far as I know. This is the closest that I can come up within the limitations of Math JaX.

 1 & 1 & 1\\ 
 t & 2t & 2\\ 
t+1 & 0 & 2t
 \end{pmatrix}\ \hookleftarrow\stackrel{-t}{+}%
 1 & 1 & 1\\ 
 0 & t & 2-t\\ 
0 & -t-1 & t-1

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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