12

Is it possible to create a link to a particular bibliography item?

I'm hoping for something like:

This \hyperref[MyKey]{link} takes you to the same place as \cite{MyKey}.

A full (non-working) MWE:

\documentclass{article}
\usepackage[colorlinks,allcolors=red]{hyperref}

\begin{document}
This \hyperref[MyKey]{link} takes you to the same place as \cite{MyKey} does.

\begin{thebibliography}{9}

\bibitem{MyKey} Anne Author, Thoughts, 3001.

\end{thebibliography}
\end{document}
0

3 Answers 3

9

A simple solution is to set a \hypertarget in the bibliography item. The syntax is quite simple: Create the target with

\hypertarget{MyTargetKey}{}

and create a link to the target with

\hyperlink{MyTargetKey}{link text}

Everything put together:

\documentclass{article}
\usepackage[colorlinks,allcolors=red]{hyperref}

\begin{document}
This \hyperlink{MyTargetKey}{link} takes you to the same 
place as \cite{MyKey} does.

\begin{thebibliography}{9}

\bibitem{MyKey} \hypertarget{MyTargetKey}{} Anne Author, Thoughts, 3001.

\end{thebibliography}
\end{document}

If you work e.g. with BibLaTeX, this gets even more hackish, but still works. You can set the target in the author field.

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
    @BOOK{MyKey,
        AUTHOR    = {Author, \hypertarget{MyKeyH}{Anne}},
        TITLE     = {Thoughts},
        YEAR      = {3001},
    }
\end{filecontents*}

\documentclass{article}
\usepackage[colorlinks,allcolors=red]{hyperref}
\usepackage[backend=biber]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}
This \hyperlink{MyKeyH}{link} takes you to the same place as \cite{MyKey} does.

\printbibliography

\end{document}

This is not a particularly nice solution, but I am not aware of a direct, elegant way.

2
5

I have hyperref and I use BibTeX with keys like:

@BOOK{MyKey,
     AUTHOR    = {theName, theFirstName},
     TITLE     = {Thoughts},
     YEAR      = {3001},
}

In my template at least, \hyperlink{cite.MyKey}{link} is enough to make a link work.

I might make a MWE later, but in the meantime maybe this can help someone.

3
  • 4
    I tried your idea inside a command I was defining: \hyperlink{cite.#2}{\citeyear{#2}} but the link took me to the first page rather than the bibliography entry. I really don't want to use \hypertarget, how can I fix this?
    – Felipe
    Apr 27, 2020 at 18:19
  • 2
    This worked for me.
    – b-fg
    May 6, 2020 at 11:06
  • Worked for me too.
    – marnix
    Jun 19, 2021 at 20:47
1

\usepackage{hyperref}

makes links work in the introductory example like magic ("\cite{dirac}" becomes a link).

\documentclass{article}
\usepackage{hyperref}
\usepackage{biblatex}
\addbibresource{sample.bib}
\begin{document}
Einstein's journal paper \cite{einstein} and Dirac's
book \cite{dirac} are physics-related items. 
\clearpage
\printbibliography 
\end{document}

This all works with the default sample.bib file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .