1

Suppose I have the following in document A:

\documentclass{article}

\usepackage[destlabel]{hyperref}

\begin{document}
\section{First Section}\newpage
\section{Link Section}\label{mylabel}
\end{document}

and the following in document B:

\documentclass{article}

\usepackage{hyperref}

\begin{document}
Link 1: Please see \href{docA.pdf#mylabel}{this section}.

Link 2: Please see \hyperref{docA.pdf}{section}{2}{this section}.
\end{document}

Link 1 works when I have the destlabel option set and link 2 works when I don't set this option. How can I make both links work?

The reason that I want both of these methods to work simultaneously is that I do not want to use absolute references myself (because of sections that get inserted or deleted later on), but I do want to allow people from the outside to link to (sections in) my PDF's without them having to know the new destination names that were replaced by the destlabel option. Is this possible?

The documentation of hyperref did not clarify it. In fact, I thought the following bit of text in the documentation implied that both should work simultaneously:

The renaming is done by a redefinition of \HyperDestNameFilter. That leaves the old destination names intact.

  • 1
    Don't show only a few snippets, make complete test documents. – Ulrike Fischer Jun 13 '18 at 15:15
  • Related: tex.stackexchange.com/a/321671/134641 – Coby Viner Jun 13 '18 at 15:57
  • 1
    I added an MWE to my question instead of the snippets. I did read related articles on my problem, but that's just what they are: related, not duplicates. Unfortunately, they didn't help much. – Ivo Jun 14 '18 at 19:14

Your Answer

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

Browse other questions tagged or ask your own question.