0

In the introduction of a chapter, I define an equation. Several pages later, I then recall that equation before proceeding to do things with it. I want to assign it the same label in both instances, because it is the same equation, and I know that this can be achieved using \tag{\ref{eq:first-label}} (see MWE below). My problem is this: I would still like to be able to provide specific links to the two different instances of the equation: when referencing that equation in the introduction, I of course want to link to the first instance of the equation. Later in the chapter, I do not want the link to go to the first instance in the introduction, but to the second instance (which is much more recent in the text).

0

It took me a bit of tinkering to figure this out, so I thought I'd share my solution in case it's useful for someone else. Here's a MWE that does what I want, using the \hypertarget and \hyperlink commands provided by hyperref.

\documentclass{article}

\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{hyperref}

\begin{document}

\begin{equation}
    a+b=c
    \label{eq:first-instance}
\end{equation}

\lipsum[1-3]

This should link to the first instance of the equation: \eqref{eq:first-instance}.

\begin{equation}
    \hypertarget{eq:second-instance}{a+b=c}
    \tag{\ref{eq:first-instance}}
\end{equation}

This links to the second instance of the equation: (\hyperlink{eq:second-instance}{\ref*{eq:first-instance}}).

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.