13
$\begingroup$

One can use \tag, \label, \ref and \eqref the usual way in MathJax (including references turned into links), e.g.

$ a = b \tag{a}\label{a} $

and later

$ \eqref{a} $

$ a = b \tag{a}\label{a} $

and later

$ \eqref{a} $

but unfortunately the block containing the \label breaks once one further edits - this is probably due to the label being apparently "reused" for a "new" tag, as you can see in this screenshot:

screenshot

I guess a simple fix would be not parsing \label while editing a question, although an even better solution would of course be somehow letting MathJax know the previous instance of the label shall be discarded.

$\endgroup$
7
  • 1
    $\begingroup$ A suboptimal fix might be putting the whole post into $\begingroup$ ... $\endgroup$ $\endgroup$ Commented Oct 24, 2013 at 6:51
  • $\begingroup$ The preview code could use MathJax's ability to reset the labels in order to resolve this issue (the preview code was written before \label and \ref were available in MathJax). $\endgroup$ Commented Oct 24, 2013 at 11:30
  • 4
    $\begingroup$ As a temporary work-around, you could add $\def\label#1{}$ at the top of your question/answer while you are editing it, and remove it just before submitting the answer. $\endgroup$ Commented Oct 24, 2013 at 11:33
  • $\begingroup$ @DavideCervone Nice workaround, thanks! I hope it'll be fixed though... $\endgroup$ Commented Oct 25, 2013 at 8:04
  • 1
    $\begingroup$ See my post that includes a user-script to work around this issue until the editing code is updated. $\endgroup$ Commented Apr 8, 2016 at 23:35
  • 3
    $\begingroup$ The editing code has been updated, so the preview code should now process \label macros properly. You should no longer need to use the temporary work-arounds that were necessary before. $\endgroup$ Commented Apr 29, 2016 at 19:47
  • $\begingroup$ @DavideCervone Looks great, there also seems to be no more delay for reprogressing changed TeX $\endgroup$ Commented May 2, 2016 at 8:21

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.