[pdftex] showkeys-package vs. autoref / hyperref / hypertarge t

Heiko Oberdiek oberdiek at ruf.uni-freiburg.de
Tue Dec 18 13:51:28 CET 2001

On Tue, 18 Dec 2001, Stueker, Dirk wrote:

> So here is my last piece of code to make hyperlinks visible:
> \makeatletter
> \@ifpackageloaded{showkeys}{%
>   \@ifundefined{SK@@label}{}{%
>     \newcommand*{\ORGhyperlink}{}
>     \let\ORGhyperlink\hyperlink
>     \def\hyperlink#1#2{%
>       \ORGhyperlink{#1}{#2}\llap{\ref{#1}}%
>     }
>   }
> }{} \makeatother
> The only problem is that the \ref command generates an output
> string which overlaps the hyperlink. Perhaps somebody knows how
> to make this part "invisible"!?

Quick and dirty, using the macros of showkeys:


    \let\SK at hypertarget\hypertarget
      \SK at hypertarget{#1}%
    \ifx\SK at ref\@empty
        \SK at def\hyperlink#1#2{\SK@\SK@@ref{#1}\SK at hyperlink{#1}{#2}}%

Target: \hypertarget{abc}{TARGET}
Link: \hyperlink{abc}{LINK}.

Viele Gruesse
  Heiko <oberdiek at uni-freiburg.de>

More information about the pdftex mailing list