11
$\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$
  • 1
    $\begingroup$ A suboptimal fix might be putting the whole post into $\begingroup$ ... $\endgroup$ $\endgroup$ – Tobias Kienzler Oct 24 '13 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$ – Davide Cervone Oct 24 '13 at 11:30
  • 3
    $\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$ – Davide Cervone Oct 24 '13 at 11:33
  • $\begingroup$ @DavideCervone Nice workaround, thanks! I hope it'll be fixed though... $\endgroup$ – Tobias Kienzler Oct 25 '13 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$ – Davide Cervone Apr 8 '16 at 23:35
  • 1
    $\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$ – Davide Cervone Apr 29 '16 at 19:47
  • $\begingroup$ @DavideCervone Looks great, there also seems to be no more delay for reprogressing changed TeX $\endgroup$ – Tobias Kienzler May 2 '16 at 8:21

You must log in to answer this question.

Browse other questions tagged .