\begin{equation}\label{eq1}
0 = a x^2 + b x + c
\end{equation}
will make a numbered equation (with the number automatically assigned)
and define "eq1" as a name that can be used to refer to that
equation. So \eqref{eq1} would translate to whatever equation number
that equation had.
But
\begin{equation}\tag{1}
0 = a x^2 + b x + c
\end{equation}
says don't automatically number this equation, instead use "1" as the
equation number. This equation is outside of the normal numbering
sequence because you have forced a tag for the equation (usually you
don't use numbers for tags, but things like stars or bullets or other
symbols). So the first automatically numbered equation also is marked
with a "1". Later, you use \tag{2} which marks that equation with a
"2" even though there has already been one tagged with a "2".
This is entirely consistent with actual LaTeX usage. Here is your
code run through LaTeX:
Also, you have left out the </span> for these spans.
Davide
You are allowed to force an equation to be tagged by whatever you
want, including a tag that has already been used, or will be used
later, as you have done here.If you want the equations to be numbered 1 through 5, but want to be
able to refer to the first and last of them, you want to use \label
not \tag.Hope that clears things up.
Davide
On Mar 14, 2012, at 9:33 AM, Pia Jensen wrote:
<h2> <span class="mw-headline" id="Problem_with_automatic_equation_numbering">Problem with automatic equation numbering</span></h2> <p>First, an equation with a given label (written with <span class="tex2jax_ignore"><code>\begin{equation}\label{labelname...} math... \end{equation}</code></span>) </p><p><span id="Eq-1"/>\begin{equation}\tag{1} 0 = a x^2 + b x + c \end{equation} </p><p>then a couple of equations without labels (but because of AMS autonumbering, they still get numbers) (written with <span class="tex2jax_ignore"><code>\begin{equation} math... \end{equation}</code></span>) </p><p>\begin{equation} a + b + c \end{equation} </p><p>\begin{equation} k^2 - c^2 \end{equation} </p><p>\begin{equation} 4 + 1 + 5 \end{equation} </p><p>and then finally an equation with a label again: </p><p><span id="Eq-2"/>\begin{equation}\tag{2} 1 = k_1 x^2 + k_2 x + k_3 \end{equation}
/**
* MathJax_parser_stage2(&$parser, &$text, &$strip_state)
*
* The stage 2 math parser will "strip" (replace by place holders) all math
* environments, adding them to the $strip_state->nowiki ReplacementArray.
* Additionally we register the \label{}, if present, of the math environment and
* replace it by an auto numbered \tag{} and then replace all occurrences of
* \eqref{} by the correct formula number. Existing \tag{} commands are also
* registered such that they can be referenced using \eqref{}.
A quick look atshows that the extension is messing with your labels and tags:/** * MathJax_parser_stage2(&$parser, &$text, &$strip_state) * * The stage 2 math parser will "strip" (replace by place holders) all math * environments, adding them to the $strip_state->nowiki ReplacementArray. * Additionally we register the \label{}, if present, of the math environment and * replace it by an auto numbered \tag{} and then replace all occurrences of * \eqref{} by the correct formula number. Existing \tag{} commands are also * registered such that they can be referenced using \eqref{}.
So you would need to modify the MathJax extension to disable this if you want MathJax to handle the labels and references. MathJax is properly handling the TeX that it receives, but that TeX has been modified from what you typed by the MediaWiki MathJax extension.Davide
Missing argument for \tag |
Should I modify my MathJax configuration in order to use v2.1 correctly?
instead. This uses a combined configuration file which will mean that MathJax won't have to make so many network requests, and also means that you are sure that the extensions are loaded properly. :-)
Davide