# Unusual behavior of \\ in pmatrix environment

I found an unusual behavior of pmatrix environment when editing a post.

Basically, when editing this question $A=\begin{pmatrix} 0&9 \cr -1&0 \end{pmatrix}$ renders correctly, but $A=\begin{pmatrix} 0&9 \\ -1&0 \end{pmatrix}$ does not. The only difference is that in one case I use \cr to make new line, in the other case I use \\.

As you can see, both versions render correctly here:
$A=\begin{pmatrix} 0&9 \cr -1&0 \end{pmatrix}$ and $A=\begin{pmatrix} 0&9 \\ -1&0 \end{pmatrix}$.

However, here is screenshot showing what the matrix/question looked like when I used version with \\ instead of \cr:

I don't think it's a big deal, but it I'm curious why the same code behaves differently in that question. And also it might be useful to know, in case something similar might manifest elsewhere.

EDIT: Now I am confused even more. At the moment the question renders ok with \ (at least I see it rendered correctly). But when I click on edit, the preview show the strange version with the exclamation mark.

## 1 Answer

The answer to that question contains the definition $\def\\#1{\frac1{#1!}}$ which spills over to the preview, but not to the question. (Owing to the order of script execution, I assume).

• @AsafKaragila As we all know, $\int \sin(x)\;dx = -\cos(x)$. :) – apnorton Dec 1 '14 at 23:45