11
$\begingroup$

I just encountered the following when editing a question:

WTF?

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?

$\endgroup$
6
  • 3
    $\begingroup$ 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. $\endgroup$
    – robjohn Mod
    Dec 16, 2016 at 13:37
  • $\begingroup$ @robjohn A refresh did clear out the \let command, yes. $\endgroup$
    – Arthur
    Dec 16, 2016 at 13:59
  • 3
    $\begingroup$ 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. $\endgroup$ Dec 16, 2016 at 14:58
  • 3
    $\begingroup$ While you're at it, I hope you remembered to change $sin(t)$ to $\sin(t)$ or $\sin t$. $\endgroup$ Dec 16, 2016 at 22:06
  • $\begingroup$ This is weird. After I changed the second \leq to \le, the \leqt was still rendered as $\pi$. $\endgroup$ Dec 16, 2016 at 22:09
  • $\begingroup$ @MichaelHardy Of course I remembered the $\sin(t)$ as well. It's just that nothinig exciting happened to that one. $\endgroup$
    – Arthur
    Dec 20, 2016 at 16:15

0

You must log in to answer this question.

Browse other questions tagged .