0

I'm writing a long document in which I put chapters into separate files and each chapter has a separate bibliography, for which I use chapterbib and natbib.

I would like to customise the pagebackref capability of hyperref, which I do as shown in this question. This works fine as long as everything is in one file, e.g.,

\documentclass{report}

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

\bibliographystyle{chicago}    

\begin{document}

\chapter{Some stuff}
\cite{jdoe,jdough} 

\chapter{Some stuff}
\cite{jdoe}

\bibliography{refs} 

\end{document}

However, once I structure my document into separate files, I run into the following problem:

  • If I include the customisation of \backref and \backrefalt, the page numbers in the references always come out as "(Not cited.)".
  • If I comment out the customisation, the page numbers appear correctly.

Here's the MWE:

\documentclass{report}

\usepackage{chapterbib}
\usepackage[sectionbib]{natbib}
\usepackage[pdftex,backref,pagebackref]{hyperref}
\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{%
\ifcase #1
  (Not cited.)%
\or 
  (Cited on page~#2.)%
\else
  (Cited on pages~#2.)%
\fi} 

\begin{document}

\include{chap1}
\include{chap2}

\end{document}

with chap1.tex:

\bibliographystyle{chicago}    
\chapter{Some stuff}
\cite{jdoe,jdough} 
\bibliography{refs} 

and chap2.tex:

\bibliographystyle{chicago}    
\chapter{Some stuff}
\cite{jdoe}
\bibliography{refs}

Am I doing something wrong? Is this due to an incompatibility or a bug?

3
  • try the patch mentioned here: github.com/latex3/hyperref/issues/132#issuecomment-603299318 (untested, I'm only guessing). Apr 19, 2020 at 12:24
  • @UlrikeFischer: Makes no difference. So I take it that this is a bug? Who should I report it to? Apr 19, 2020 at 15:05
  • I have no idea if it is a bug. It could be simply missing support. I haven't looked, and I don't have the time to look now. Beside this I haven't use chapterbib for years, I would always use biblatex for this now, where backref works out of the box. Apr 19, 2020 at 15:22

0

You must log in to answer this question.

Browse other questions tagged .