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

Stueker, Dirk dirk.stueker at volkswagen.de
Mon Dec 17 17:09:46 CET 2001


> 
> \documentclass{article}
> \usepackage{showkeys}
> \usepackage{hyperref}
> \makeatletter
> \@ifpackageloaded{showkeys}{%
>   \@ifundefined{SK@@label}{}{%
>     \newcommand*{\ORGautoref}{}
>     \let\ORGautoref\autoref
>     \def\autoref#1{%
>       \ORGautoref{#1}\llap{\ref{#1}}%
>     }
>   }
> }{}
> \makeatother
> \begin{document}
> \section{Hello World}\label{hello}
> \section{foo bar}\label{foo}
> See \ref{hello} and \autoref{foo}.
> \end{document}
> 
> This test file above works for me.

The file works for me as well and with a similar code hypertargets
are visible as well:

\makeatletter
\@ifpackageloaded{showkeys}{%
  \@ifundefined{SK@@label}{}{%
    \newcommand*{\ORGhypertarget}{}
    \let\ORGhypertarget\hypertarget
    \def\hypertarget#1{%
      \ORGhypertarget{#1}{\label{#1}}%
    }
  }
}{} \makeatother

It just has to be mentioned that as a sideeffect a label with the
same name as the hypertarget is created - but this is ok for me.
Perhaps one could use this for a new definition of \hyperref.

Cheers again!
Dirk



More information about the pdftex mailing list