20
$\begingroup$

I'd like to number multiline equations and reference them, à la MathJax's Align and Gather environments. Can this be accomplished? If so, how?

$\endgroup$
25
$\begingroup$

In the align environment, I use \tag to number. \label is also supported by MathJax. \ref can be used to reference a line using \label and \tag.

For example: $$ \int_{-\infty}^\infty e^{-\pi x^2}\,\mathrm{d}x=1\label{a}\tag{1} $$ and reference it here: $\ref{a}$

$\endgroup$
  • $\begingroup$ Thank you. Why is it that when I use \label in the align environment, the equations don't display but rather the underlying mathjax code? $\endgroup$ – Evan Aad Apr 8 '14 at 21:32
  • 4
    $\begingroup$ @EvanAad: There seems to be a problem when editing. I find that when I save the edit and reload the page, things look okay. The same thing happened while I was editing my answer. $\endgroup$ – robjohn Apr 8 '14 at 21:33
  • 1
    $\begingroup$ See this post for some details about why that is the case. Also, see the SOUP script for workarounds to this and many other small issues . $\endgroup$ – Davide Cervone Apr 8 '14 at 23:05
  • 1
    $\begingroup$ But how was this done? I can't edit this answer, so I can't see the source code. $\endgroup$ – Daniel Martin Dec 2 '17 at 15:11
  • 1
    $\begingroup$ @DanielMartin: I think that even if you can't edit an answer, you can right-click on a MathJax rendered formula and a pop-up will appear allowing you to choose "Show Math As > TeX Commands". $\endgroup$ – robjohn Dec 2 '17 at 15:27
0
$\begingroup$

In order to see the tags during edit, the following trick can be used.

$$ \begin{aligned} a & = b & (1) \\ c & = d & (2) \end{aligned} $$

But now the equations cannot be hyperlinked to.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .