[Tex/LaTex] Enclosing Page Numbers using the `Backref=Pages` Extension of `Hyperref`

back-referencingbibliographiesformattinghyperref

I'm using the backref=pages extension of the hyperref package, as I'd like to have a list of back-reference pages after my bibliographic items. Is there a way to enclose these page numbers in brackets like "[2]" instead of just having the number (without enclosure)?

For example, I'd like for a bibitem to appear as

[1] Witten, E., The Theory of Everything, Any Journal, Volume, Pages
(Year) [pg. 1], [pg. 2]

Best Answer

The command responsible for typesetting the back references is \backrefxxx, so

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

will do. This will make all of "backref page #" a link. If you want only the page number to be a link, do

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

Other variations are possible.

Related Question