# Inconsistent preview and output of maths in spoiler blocks

I was writing an answer to a question on the main site, and using spoiler blocks as part of the answer. Several of the spoiler blocks include MathJaX with  and the align environment. In the editor preview, all the maths is shifted off to the left. In the rendered output, it's centre-aligned as maths in  usually is. Here's a screenshot showing the difference:

Here's the source for that block (all squashed onto a single line for the needs of spoiler formatting):

>!\begin{align*}I\mathbf{x} &= \mathbf{x} \\H\mathbf{x} &= \alpha\left(\mathbf{n} \times \mathbf{x}\right) \\H^2\mathbf{x} &= \alpha\left(\mathbf{n} \times \alpha\left(\mathbf{n} \times \mathbf{x}\right)\right) \\&= \alpha^2 \left(\mathbf{n} \times \left(\mathbf{n} \times \mathbf{x}\right)\right) \\H^3\mathbf{x} &= -\alpha^3 \left(\mathbf{n} \times \mathbf{x}\right) \\H^4\mathbf{x} &= -\alpha^4 \left(\mathbf{n} \times \left(\mathbf{n} \times \mathbf{x}\right)\right)\end{align*}


I would expect the two renders to match; i.e., for it to be centre-aligned in the preview.

I'm using Safari 8.0.3 on the latest build of OS X Yosemite.

• @anorton: Oops, I forgot to copy the definitions over. I've updated the snippet so that you don't need those definitions. Thanks for pointing it out. – alexwlchan Jan 1 '15 at 18:30
• Maybe you know or maybe you don't, but \vec is a pre-existing command. It's usually not a great idea to overwrite those, since it can mess up with other people's answers on the page (depending on the order of the answers, for example). – Asaf Karagila Jan 1 '15 at 18:52
• @AsafKaragila: I did know that, but didn't consider it when writing that answer. I've swapped it out for \myvec instead. – alexwlchan Jan 1 '15 at 19:00