# Hyperlinks to repeated & variant equations with \tag{} don't work

Suppose I have the following equation (42), a variant version of it (42ᵇⁱˢ), and then a repeated version of (42). Here is how I would express them in my document:

Original equation:

$$\label{eq:42} R=-4\pi E^2h.$$


A variant of it:

$$\label{eq:42bis} R=4\pi E^2h,\tag{\ref{eq:42}^\mathrm{bis}}$$


A repetition of (42) later in the document:

$$\label{eq:42b} R=-4\pi E^2h,\tag{\ref{eq:42}}$$


Why does the hyperref package make the links of \ref{eq:42bis} and \ref{eq:42b} both point to the same equation with \label{eq:42}?

Does a \ref{} inside a \tag{} override the \label{} of the equation environment?

thanks

The problem here is that you're technically overlaying hyperlinks, and the one pointing to the first equation wins, making it seem like all hyperlinks point to the same destination. You need to use \ref* in the \tags, which removes the actual hyperlink:

\documentclass{article}
\usepackage{amsmath,hyperref}% http://ctan.org/pkg/{amsmath,hyperref}
\begin{document}

$$\label{eq:42} R=-4\pi E^2h.$$
$$\label{eq:42bis} R=4\pi E^2h,\tag{\ref*{eq:42}^\mathrm{bis}}$$
$$\label{eq:42b} R=-4\pi E^2h,\tag{\ref*{eq:42}}$$
See~\eqref{eq:42},~\eqref{eq:42bis} and~\eqref{eq:42b}.
\end{document}

• Hmm… using \ref*{} instead didn't change anything for me, besides removing links. In fact, I would like all the refs to be links, that way someone can click (1ᵇⁱˢ) and get to (1). thanks – Geremia Sep 19 '13 at 6:52
• @Geremia Werner's answer works perfectly for me. This solution links the labels to exactly where one would expect. Do you want all the labels in the example above to point to the first (1) instead? That would be not very intuitive. Obviously, so is the double overlay thing. – moewe Sep 19 '13 at 9:28
• @Geremia: You used my exact example and all references were removed? That's not possible. You must be doing something different. – Werner Sep 19 '13 at 14:09
• @Werner: Your example works perfectly fine, so there must be some other issue going on when I use it in my working document, which uses a custom style sheet, etc. Perhaps it's my publisher's custom style sheet changing things. thanks again – Geremia Sep 19 '13 at 17:40
• @Geremia: Sure. Until that information is available, there's not much more we can do here. – Werner Sep 19 '13 at 17:41