# Manual citation link with hyperref and natbib

When one want to do a manual hyperlink to a \label target one can use \hyperref[label]{text}.

But what if one want to create a link pointing to an item in the bibliography, with a user defined text and the same color as \cite

I would rather not have to use \citealias all over the place (which might be the right answer, but we are a bit late for that in this project)

Any ideas?

-

The hyperref anchor for key is named cite.key. It is an anchor, not a label, so you have to use \hyperlink instead of \hyperref, but that doesn't use the correct link border color etc. In the following, I have instead provided \hyperlinkcite for that, for which you just supply the cite key and the link text as arguments:

\documentclass{article}

\usepackage{natbib}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@Book{test1,
author    = {Goossens, Michel and Mittelbach,
Frank and Samarin, Alexander},
title     = {The LaTeX Companion},
year      = {1994},
}
\end{filecontents}
\bibliographystyle{plainnat}

\makeatletter
\makeatother

\begin{document}

(example bib file borrowed from elsewhere!)
Be sure that the citation actually gets \cited properly somewhere (or \nocited etc), or it may not show up in the bibliography.
Slight modification, then it works: \newcommand*{\hyperlinkcite}[1]{\hyper@link{cite}{cite.#1\@extra@b@citeb}}, thanks. Without the \@extra@b@citeb, I did get the color right, but the target was wrong –  daleif Dec 12 '12 at 14:51
Thanks @daleif. As you say, it does seem to be needed if using certain styles, but I am not entirely confident about the appropriate time to expand \@extra@b@citeb (to ensure it expands to the same thing as it did when the anchor was set). Therefore, I will not yet incorporate it into the answer, but assume that anyone for whom the above doesn't work will see your comment! –  cyberSingularity Dec 12 '12 at 15:05