Closed Sophanatprime closed 1 year ago
The code interrupts links in the header and footer (to avoid that they are part of links broken over pages, see e.g. https://tex.stackexchange.com/a/578405/2388).
You can reenable them like this:
\DocumentMetadata{uncompress}% {backend=xdvipdfmx}
\documentclass{article}
\usepackage{hyperref}
\makeatletter\ExplSyntaxOn
\def\@oddhead{\pdfannot_link_on: \hyperlink{foo.anchor.1}{HEAD} \pdfannot_link_off: \hfil}
\let\@evenhead\@oddhead
\makeatother\ExplSyntaxOff
\begin{document}
Hello. \hypertarget{foo.anchor.1}{}
\hyperlink{foo.anchor.1}{TEXT}
\end{document}
That's very helpful!
MWE:
When using xelatex and
\DocumentMetadata
, the hyperlink in head does not work. Removing\DocumentMetadata
, the code works fine.log: demo.log