0

In this example:

\documentclass{article}

\usepackage{amsmath}
\usepackage{hyperref}

% https://tex.stackexchange.com/a/412381:
\makeatletter
\newcommand{\linkdest}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
\makeatother

\begin{document}

\begin{subequations}
    \begin{align}
        1 + 1 &= 2 \text{.} \linkdest{htar:target1}{\tag{T1}} \\
        2 + 2 &= 4 \text{.} \label{eq:equation1}
    \end{align}
\end{subequations}

\noindent eq.~\hyperlink{htar:target1}{T1}.

\noindent eq.~\ref{eq:equation1}.

\end{document}

hyperlink 1a points to the beginning of the equation tag, as in the following picture. Unfortunately, link T1 created for an equation with manual tag points to the end of the equation and not to the actual tag. The destinations of hyperlinks can be tested, e.g., by clicking the links in zoomed-in PDF viewer.

Actual result

How can anchors of such links pointing to custom tags be corrected to achieve results like in the image below?

Desired result

1 Answer 1

1

Put the target inside the tag:

\documentclass{article}

\usepackage{amsmath}
\usepackage{hyperref}

% https://tex.stackexchange.com/a/412381:
\makeatletter
\newcommand{\linkdest}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
\makeatother

\begin{document}

\begin{subequations}
    \begin{align}
        1 + 1 &= 2 \text{.} \tag{\linkdest{htar:target1}{T1}} \\
        2 + 2 &= 4 \text{.} \label{eq:equation1}
    \end{align}
\end{subequations}

\noindent eq.~\hyperlink{htar:target1}{T1}.

\noindent eq.~\ref{eq:equation1}.

\end{document}

You must log in to answer this question.

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