46

I would like to change the way the back references are shown in the bibliography, such that they are all shown within parentheses. So I would like to see

(page x, y, z)

after my bibitems. This is what I think could be a starting point...

\usepackage[backref=page]{hyperref}
\renewcommand{\backrefxxx}[3]{(page \hyperlink{page.#1}{#1})}

But obviously this yields

(page x), (page y), (page z)

lockstep
  • 250,273
D.Roepo
  • 3,347
  • For those looking for how to create back-references without hyperref, consider using the package citeref (listed among the suggestions here, see also this discussion, in particular the comments about licensing). – 0 _ Dec 14 '17 at 21:14

1 Answers1

55

Here's a solution using biblatex:

\documentclass{article}

\usepackage[backref=true]{biblatex}

\usepackage{hyperref}

\DefineBibliographyStrings{english}{%
  backrefpage = {page},% originally "cited on page"
  backrefpages = {pages},% originally "cited on pages"
}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text \autocite{A01,B02}.

\clearpage

Some more text \autocite{A01}.

\printbibliography

\end{document}

enter image description here

And a brute-force solution for natbib/backref:

\documentclass{article}

\usepackage[numbers]{natbib}

\usepackage[backref=page]{hyperref}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\BR@backref}{\newblock}{\newblock(page~}{}{}
\patchcmd{\BR@backref}{\par}{)\par}{}{}
\makeatother

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\begin{document}

Some text \citep{A01,B02}.

\clearpage

Some more text \citep{A01}.

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

enter image description here

lockstep
  • 250,273
  • 1
    Nice, that solution works. Unfortunately am I using the natbib package (and would like to keep it that way) and that clashes with biblatex... – D.Roepo Nov 27 '11 at 16:59
  • In (pages 1, 2), is it possible to replace the round brackets with square brackets? – pluton Apr 27 '12 at 01:34
  • 4
    @pluton \usepackage{xpatch}\xpatchbibmacro{pageref}{parens}{brackets}{}{} – lockstep Apr 27 '12 at 02:57
  • Does the backref link refer to the exact position of citation or to the whole page of citation? – Orion Jul 14 '13 at 19:13
  • And... what about using BibTeX and pagebackreff from hyperref? – Andrestand Jun 07 '14 at 16:01
  • 3
    The more recent question “Formatting back references in bibliography (BibTeX)” gives some bibtex/hyperref-based options (no biblatex required). – Peter LeFanu Lumsdaine Oct 24 '14 at 11:29
  • Hurray, I got reputation of 50 and can ask long-awaited question: @lockstep, how can I delete an extra space before numbers if I removed the word "pages" from my backref. (Now I have “A. Author. Alpha, 2001. [ 1,2]”, I want to remove space before 1.) – homo_loquens Feb 22 '15 at 07:53
  • 3
    @homo_loquens You could have asked a separate (follow-up) question. ;-) Here's the answer: \renewbibmacro*{pageref}{\iflistundef{pageref}{}{\printtext[parens]{\printlist[‌​pageref][-\value{listtotal}]{pageref}}}}. You may replace parens with brackets. – lockstep Feb 22 '15 at 10:23
  • 1
    I would rather use the default \DefineBibliographyStrings{english} just like that. Which gives (Cited on pages 1, 2). Not redefining backrefpage and backrefpages as (page 1, 2), since that might give the impression you are referring to pages in the referenced work, whereas you are referring to page locations in your own document. – Magne Nov 19 '19 at 16:01