2

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).

2 Answers 2

2

The solution you proffer is just a little too complicated than it needs to be. You can just use \label on the second equation, e.g.,

\documentclass{article}

\usepackage{amsmath}
\usepackage{hyperref}

\begin{document}

\begin{equation}
  \label{first}
  1+1=2
\end{equation}

\newpage % to make hyperref jump more obvious

\begin{equation}
  \label{second}
  1+1=2
  \tag{\ref{first}}
\end{equation}

\eqref{first} or \eqref{second}

\end{document}
1
  • This is of course much cleaner, thanks! :-)
    – Eike P.
    Oct 28, 2021 at 13:16
2

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

You must log in to answer this question.

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