This turns out to be an interaction between StackExchange's Markdown processor and MathJax. Here's what's going on: in the editor, the preview code has to remove the mathematics before it is processed by Markdown (so that the mathematics isn't changed by Markdown) and then puts it back in the text of the post. It does that by looking for the math delimiters, which includes $...$
, $$...$$
, and \begin{...}...\end{...}
. Since \begin\{eqnarray}...\end{eqnarray}
does not match any of these (because of the \{
rather than {
), it is not removed from the document as math, and instead is processed directly by Markdown. Markdown uses the backslash as an escape character that prevents the usual Markdown action of the following character. In doing so, the backslash is removed (but apparently only when it actually prevents a Markdown action), so \{
becomes {
and \,
becomes ,
(but \b
stays \b
and \e
stays \e
since these are not preventing any Markdown action).
That means that
\begin\{eqnarray}
\int\frac1x\,\mathrm dx
\end{eqnarray}
becomes
\begin{eqnarray}
\int\frac1x,\mathrm dx
\end{eqnarray}
in the actual HTML for the preview. When MathJax runs on the result, it now does match as a math delimiter (since the \{
has been turned into {
by markdown), and the math is processed. Because \,
has been turned into ,
by Markdown, you see the comma rather than the space that \,
would have produced.
When the final post is created, it is processed on the server to do the Markdown formatting. Originally, the server-side code and the preview code were the same, but over time, the server-side code has been updated, and it appears that it no longer does exactly what the preview code does. I suspect that the Markdown processing is slightly different, and that while \{
is being converted to {
, the \,
is not being changed. The ,
is not really a Markdown command, so \,
its not escaping a markdown function, and so it shouldn't be altered, just as \b
and \e
aren't. I suspect that the in-browser Markdown processor is just treating \
followed by any non-letter as an escape, whereas the server-side one is more discerning. I don't know that for sure, but that is what it looks like.
As for error messages, MathJax only reports errors on things that it recognizes as math, and since \begin\{
doesn't look like \begin{...}
, MathJax doesn't recognize it as a math delimiter, and doesn't process it (including not reporting any errors). If you used \begin\{
inside other math delimiters (e.g., $$\begin\{array}{c} a \end{array}$$
, MathJax would report an error.
\,
wasn't working... $\endgroup$