[Tex/LaTex] Modifying backreference page numbers in references

back-referencinghyperref

One can use the optional in hyperref package \usepackage[pagebackref=true]{hyperref} so that at the end of the each reference in the list of references there is something like 2 appended if that reference is cited on page 2 etc.

In a paper I saw on the archiv, there was a very nice style where all the page numbers that appeared at the end of the citation in the references were preceded by a single 'upward-pointing-arrow' (something like $\uparrow$). I was hoping to do something like this with my paper but I was hoping not to have to go through biblio.bbl modifying this for each citation, since I have an aweful lot of citations. Anyone know how such a thing could be done with little pain?

Best Answer

Package backref (loaded by hyperref) uses \backrefxxx to format one location entry. There are three arguments, the first is the page number, the second the section number and the third the anchor. Then the macro can be redefined the following way:

\renewcommand\backrefxxx[3]{%
  \hyperlink{page.#1}{$\uparrow$#1}%
}

page.#1 is the page anchor link name, automatically set by hyperref.

Full example:

\documentclass{article}
\usepackage[
  pagebackref=true,
  colorlinks,
]{hyperref}

\renewcommand\backrefxxx[3]{%
  \hyperlink{page.#1}{$\uparrow$#1}%
}

\begin{document}
\cite{a}
\newpage
\cite{b,d}
\newpage
\cite{a,b}
\newpage
\cite{a,b}
\newpage
\begin{thebibliography}{9}
\bibitem{a} Item a.

\bibitem{b} Item b.

\bibitem{c} Item c.

\bibitem{d} Item d.

\end{thebibliography}
\end{document}

Result