orsharir / github-mathjax

Chrome extension for rendering LaTeX equations in GitHub with MathJax
Other
154 stars 49 forks source link

Multiple label definition #28

Open GiulioRomualdi opened 5 years ago

GiulioRomualdi commented 5 years ago

Hi @orsharir, I have an issue when I add the command \label{} to the environment equation. In details when I create an equation as follows, I retrive the error Label 'eq:test' multiply defined.

\begin{equation}
\label{eq:test}
sin^2(x) + cos^2(x) = 1
\end{equation}

\begin{equation} \label{eq:test} sin^2(x) + cos^2(x) = 1 \end{equation}

Unfortunately, I notice that the problem happens when the equation is cited by using the command \eqref{} e.g. \eqref{eq:test} Do you know why this is happening? Do you have any suggestions to fix the problem?

muzimuzhi commented 5 years ago

I can re-produce your problem when referring to any label by \ref or \eqref.

This may relates to the following "feature" of MathJax

If you are using automatic equation numbering and modifying the page dynamically, you can run into problems due to duplicate labels. See Reset Automatic Equation Numbering for how to address this.

ref: http://docs.mathjax.org/en/latest/tex.html#automatic-equation-numbering