# Add hyperref links at the end of bib items pointing back to the pages where the citation occurred

Is there a way to "link back" the bib elements to the page(s) were they are cited in bibtex?

Let's say I have three bib items. I cite the first in pages 5, 10; the second in pages 7, 11, 20; the third in page 15.

I would like to have a bibliography like this:

Bibliography:
[1] Item1; pages: [5], [10]
[1] Item1; pages: [7], [11], [20]
[1] Item1; pages: [15]


Where the [pag] are clickable, and produced automatically, not by hand.

I'm using a bibtex like:

\bibliographystyle{bibstyle}
\bibliography{bib_here}


and the biblio_here bib is simply a list of entries like:

@article{bib_1,
author = "Author1_Here",
title = "{Title1_here}",
...
}


EDIT: I followed a comment below, although I modified the backref command to make it more verbose, I didn't like the mere list of links to the pages. I took inspiration from tex.stackexchange.com/questions/183702/…, but I end up with a larger spacing between the end of the citation and the list of backreferences. The code I use now is:

\usepackage[pagebackref=true]{hyperref}
\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{
\ifcase #1 Not cited.%
\or(cited on page~#2)%
\else(cited on pages #2)%
\fi%
}


But I get a larger spacing between the period at the end of the citation and the parentheses I added: How can I make it normally spaced?

• You may be interested in \usepackage[backref=page]{hyperref} (see the hyperref docs (mirrors.ctan.org/macros/latex/contrib/hyperref/doc/…) for other option values) or \usepackage[pagebackref]{hyperref}. Have a look at §5.26 for customisations of the output Jul 10 at 12:45
• Many thanks! I am using this approach, although I modified the backref command to make it more verbose, I didn't like the mere list of links to the pages. I took inspiration from tex.stackexchange.com/questions/183702/…, but I end up with a larger spacing between the end of the citation and the list of backreferences. I am updating the original question to show the effects and the code. Jul 11 at 17:02
• @kingworld Could you not use \hspace with a negative value e.g. \hspace{-0.1cm} after the \or and \else and trial and error it until you like the appearance? Sorry if this doesn't help or explain the original reason for the extra space. Jul 11 at 17:35
• There should be a % in the definition of \backrefalt: gist.github.com/moewew/73f47a0ee48650c9ca2dd9da83bcddb9. This explains part of the space. The remaining space is explained by the backref code inserting \newblock Jul 11 at 18:25

I require a similar thing for my thesis and the code I use is below. Also works by changing backend=biber which is what I use. You need to change the [FULLPATH] to whatever path your .bib file is located in.

The code:

\documentclass[oneside]{memoir}

\usepackage[abbreviate=false,   % Gets rid of abbreviations in things like cited (cit. was default)
backend=bibtex,         % Required to use biber in arrow drop down
backref=true,           % Prints back references e.g (cit. pp. 1)
backrefstyle=none,      % How to sequence page numbers in back references
hyperref=true,          % Enables hyperref
indexing=true,          % Enables indexing
natbib=true,            % Enables natbib
]{biblatex}

\usepackage{hyperref}

\addbibresource{C:/[FULLPATH]/TestingZ.bib} % Sets bibliography .bib path

\begin{document}

\cite{Hak20}

\printbibliography

\end{document}


The TestingZ.bib:

@article{Hak20,
title = {An immobilized invertase enzyme for the selective determination of sucrose in fruit juices},
volume = {611},
issn = {0003-2697},
url = {https://www.sciencedirect.com/science/article/pii/S0003269720305327},
doi = {https://doi.org/10.1016/j.ab.2020.114000},
abstract = {Poly(N-vinylpyrrolidone-co-butylacrylate-co-N-hydroxymethylacrylamide) has been synthesized by free radical polymerization at 70 °C. Copolymer were characterized by {FT}-{IR}, elemental analysis and viscometric methods. Invertase was immobilized onto poly(N-vinyl pyrrolidone-co-butyl acrylate-co-N-hydroxymethyl acrylamide) by entrapment method. Optimum parameters ({pH}, temperature, substrate concentration, amount of polymer) for immobilization to obtain maximum activity were investigated. Kinetic parameters, Km and Vmax, of the free and immobilized invertases were also assayed. Results showed that immobilization enhanced the enzyme stability against changes of {pH} and temperature and immobilized enzyme showed lower Km value than free enzyme. One of the most interesting results is that the optimum operational temperature of the immobilized enzyme was 15 °C higher than that of the free enzyme. The next is the activity of the immobilized enzyme at the optimum temperature (70 °C) was approximately the same as the activity of the free enzyme at its optimum temperature (55 °C). Finally, immobilized invertase were used for determination of sucrose in commercial fruit juices. A new method and equation based on immobilized invertase were derived for determination of sucrose in commercial cheryy and pomegranate juices.},
pages = {114000},
journaltitle = {Analytical Biochemistry},
author = {Hakkoymaz, Orhun and Mazi, Hidayet},
date = {2020},
keywords = {Enzyme, Immobilization, Invertase, Juice, Method, Sucrose},
}


Hope this helps, any questions just let me know.

Edit: Just to show it works with multiple page numbers too:

Just add this code to before \printbibliography to see it work in the example code I gave:

\cite{Hak20}
\newpage
\cite{Hak20}
\newpage
\cite{Hak20}
\newpage
\cite{Hak20}
\newpage


I am sure it can be customised to give the exact layout you desire but I am still learning LaTeX too so I cannot help you with the layout at the minute.

• Many thanks for the hints! Although, I am not using biblatex, and it seems that converting my bibtex code to it would be more painful than adopting other solution, mainly when it comes to a quite-finely-tuned bibstyle I'm using. Anyhow, many thanks! Jul 11 at 17:05