evaluation of nested { { } } incorrect/ (matrix/array in block of textstyle) seems to be buggy

I tried to nest textattributes and matrices and this seems to be a bug.
An array, assumed to be in mathfrac is in the curly brackets:

In principle: \mathfrac { TEXT array{ TEXT,TEXT,... } TEXT }
comes out to be

$\small \mathfrak { ABC \begin{bmatrix} \text{this is mathfrak} & \text{this should be mathfrak} \\ \text{this should be mathfrak} & \text{this should be mathfrak} \\ \text{this should be mathfrak} & \text{ it should be up to here!} \\ \end{bmatrix} \text{ surprise: here it is mathfrak again!} }$

I have just tried something similar on my local $\LaTeX$ distribution (MiKTeX). I gave it this:

$$\mathfrak{ mathematical \quad \begin{bmatrix} this & is \\ in & mathfrak \end{bmatrix} \quad fraktur}$$


and it came out like this: $$\mathfrak{ mathematical} \quad \begin{bmatrix} this & is \\ in & mathfrak \end{bmatrix} \quad \mathfrak{fraktur}$$ which differs from MathJax's handling of it: $$\mathfrak{ mathematical \quad \begin{bmatrix} this & is \\ in & mathfrak \end{bmatrix} \quad fraktur}$$

I have no idea how $\LaTeX$ is supposed to handle this sort of construction, but it might be that certain math environments are designed to override the current (math-)fonts with a neutral form. (I would be interested to hear if any $\LaTeX$ distributions handle this differently.)

At any rate, though there is a discrepancy in the way this construction is handled — and it also doesn't match what you expected to happen — I don't think there is much that can be done about it here on SE. Perhaps mention it at the MathJax issues forum.

• The MathJax developers follow this site, so it's half-fine. (See you tomorrow, by the way) – Asaf Karagila Nov 11 '12 at 11:31
• Thanks @Asaf: you learn something everyday, I guess. (If you're braving the cold weather tomorrow, I'll be around the Archive.) – user642796 Nov 11 '12 at 11:44
• (Here it's a bit cold, but a lot windy and full of dust. I suppose plain cold is a slight improvement) – Asaf Karagila Nov 11 '12 at 11:45
• (Well, dusty and full of grad missiles. Not to be confused with grad students, which are also abundant.) – Asaf Karagila Nov 11 '12 at 12:27