# Strange MathJax quirk, and why it happened

I just encountered the following when editing a question:

This is how I ended up with what I had:

• Start with $sin(t), 0<=t<=pi$ (without the quotes that I obviously have in my source text, so it actually renders the math)
• Add a backslash before pi
• Use the arrow keys and backslash to remove the rightmost <=, and replace it with \leq
• Do the same with the left <=. Remember to add a space after this \leq, since \leqt isn't a command

It took me a couple of minutes of testing to see what had actually happened. As I type the second \leq, for a brief moment it says \let\leq\pi. This effect persists even after the command has vanished. I can't believe I haven't encountered it before, but there it is.

I don't know whether the \let command is meant to persist after it has been removed, but it sounds strange to me. What do you think?

• I don't know why MathJax gets in these weird states, but when this happens, I select everything, copy, then refresh the page. If my edit gets mangled in the refresh, I just select everything and paste. This almost always clears things up. – robjohn Dec 16 '16 at 13:37
• @robjohn A refresh did clear out the \let command, yes. – Arthur Dec 16 '16 at 13:59
• The problem is related to a problem that showed up in the past regarding duplicate equation labels. Once defined, MathJax keeps the macro in its internal state (so that it can use it in later equations). I'll check with our lead developer whether we can provide StackOverflow with some code to reset macros during editing. – Peter Krautzberger Dec 16 '16 at 14:58
• While you're at it, I hope you remembered to change $sin(t)$ to $\sin(t)$ or $\sin t$. – Michael Hardy Dec 16 '16 at 22:06
• This is weird. After I changed the second \leq to \le, the \leqt was still rendered as $\pi$. – Michael Hardy Dec 16 '16 at 22:09
• @MichaelHardy Of course I remembered the $\sin(t)$ as well. It's just that nothinig exciting happened to that one. – Arthur Dec 20 '16 at 16:15