# How to put \hyperdef{category}{name}{} at the same position as \label{name}?

I am using the hyperref package that comes without the destlabel option (I tried to use the most recent version of hyperref, but it doesn't work with my LaTeX version).

So to be able to create named destinations in my PDF whose names are fixed, I use \hyperdef{cat}{name}{}. However, it is placed at a different location than a corresponding \label{name}. The following illustrates my problem

\subsection{General Introduction}
\label{foo}\hyperdef{bar}{foo}{}


The end result I get is (sorry for the ASCII art)

{Here is the \label destination in the PDF}
7.9.5 General Introduction
{Here is the \hyperdef destination in the PDF}


I would like to have the \hyperdef to be at the position that the \label takes. How can I make this happen?

-

You could use option destlabel of hyperref 2012/07/28 v6.82u or later. Then hyperref uses the first label name for the anchor name and you would not need an additional \hyperdef.

-
The OP stated that he uses an older version of hyperref. (Maybe the "correct" answer is that he should upgrade or install the current version locally.) – lockstep Nov 22 '12 at 12:56
i tried that. See my initial note "I am using the hyperref package that comes without the destlabel option (I tried to use the most recent version of hyperref, but it doesn't work with my LaTeX version)" :) I am really lost :/ – Johannes Schaub - litb Nov 22 '12 at 13:08
I wonder whether i could just apply a patch that just adds "destlabel" without anything else? – Johannes Schaub - litb Nov 22 '12 at 13:48
If you want to have a feature that an older version does not provide, but a newer version supports, then update. – Heiko Oberdiek Nov 22 '12 at 14:11
hmm fair game. i guess i have to go that route :( – Johannes Schaub - litb Nov 22 '12 at 14:34

does it like this:

\hyperdef{bar}{foo}{\subsection{General introduction}}\label{bar}

-