0

I want to have the bibliographies at end of each chapter and still have the cross-reference on the reference list stating "Cited on pages:" using natbib and chapterbib packages.

To compile the document I am using a .bat file as postprocessor as instructed here: "References by Chapter". Please also use the referred process or

pdflatex Sample.tex
bibtex Sample.tex
bibtex chp01
bibtex chp02
[...]
pdflatex Sample.tex
pdflatex Sample.tex

to compile the PDF.

Please see the example files below.

Sample.tex

\documentclass[a4paper,12pt,twoside,openright]{scrreprt}
\usepackage{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{chp01.tex}
    \blinddocument

    \cite{lamport94}
    \cite{knuth84}

    \begingroup
    \let\chapter\section
    \cleardoublepage
    \phantomsection
    \addcontentsline{toc}{section}{References}
    \bibliographystyle{unsrt}
    \bibliography{sample}
    \endgroup
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{chp02.tex}
    \blinddocument

    \cite{knuth84}

    \begingroup
    \let\chapter\section
    \cleardoublepage
    \phantomsection
    \addcontentsline{toc}{section}{References} 
    \bibliographystyle{unsrt}
    \bibliography{sample}
    \endgroup
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{sample.bib}
    @book{knuth84,
        author    = {{D}onald {E}. {K}nuth},
        title     = {{T}he \TeX book},
        year      = {1984},
        series    = {{C}omputers and typesetting},
        volume    = {A},
        publisher = {{A}ddison-{W}esley}
    }

    @book{lamport94,
        author    = {{L}eslie {L}amport},
        title     = {\LaTeX\ -- {A} {D}ocument {P}reparation {S}ystem},
        year      = {1994},
        publisher = {{A}ddison-{W}esley},
        edition   = {{S}econd}
    }
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\usepackage[square,comma,numbers,sort,sectionbib]{natbib}
\usepackage[sectionbib]{chapterbib} 
\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage[hyperindex,pagebackref=true,pdfusetitle,pdfa=true]{hyperref}
\hypersetup{plainpages=false,colorlinks,breaklinks,linktocpage,hypertexnames=true,naturalnames=false}
\hypersetup{linkcolor=red,citecolor=blue,filecolor=blue,urlcolor=blue} 

%%%%%%% Backref
\renewcommand*{\backrefsep}{, }
\renewcommand*{\backreflastsep}{ and~}
\renewcommand*{\backreftwosep}{ and~}
\renewcommand*{\backref}[1]{}   % empty definition for \backrefalt to be used, i.e. disable standard 
\renewcommand*{\backrefalt}[4]{%

\vspace{-1.0mm}
    \scriptsize\itshape\mbox{
        \ifnum#1=1 %
         \\(Cited on page~%
        \else
            \\(Cited on pages~%
        \fi
        #2)
        }}

\begin{document}
    \include{chp01}
    \include{chp02}
\end{document}

The file is beeing compiled, but the reference page links of "Cited on pages:" are missing (see the figure below).

Is it possible a patch or workaround to fix that?

enter image description here

marked as duplicate by user36296, Mensch, Sean Allred, Claudio Fiandrino, Zarko Aug 27 '16 at 12:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

The answer from the post

Is it possible to have back references after each chapter with a single main.bib file?

solved my problem. It shows how to use packages natbib, chapterbib, hyperref, and backref to back reference the pages where citations appeared.

Also, the commands should be

pdflatex Sample.tex
bibtex chp01
bibtex chp02
[...]
pdflatex Sample.tex
pdflatex Sample.tex

When I did bibtex Sample.tex, it didn't work.

Not the answer you're looking for? Browse other questions tagged or ask your own question.