[Tex/LaTex] How to use chapterbib package: syntax

bibliographies

I have read the documentation but I need a complete syntax for using chapterbib for global and chapterwise bibliography (not sectionwise) . It's very confusing at different posts and it does not work for me. It will be a great help if someone can tell me the complete steps to use it. Like \usepackage {chapterbib}.

Best Answer

Chapterbib works on the \include commands. Here's a MWE:

Master file (e.g. Master.tex):

\documentclass{report}
\usepackage{chapterbib}

%% Hack to build a MWE
\usepackage{filecontents}
\begin{filecontents}{Biblio.bib}
@article{greenwade93,
    author  = "George D. Greenwade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351"
}
@book{goossens93,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The LaTeX Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}
\end{filecontents}
%% End of hack


\begin{document}
    \include{Chapter1}
    \include{Chapter2}
\end{document}

Content of Chapter1.tex:

One may cite \cite{greenwade93}.
\bibliographystyle{alpha}
\bibliography{Biblio} 

Content of Chapter2.tex:

As detailed in~\cite{goossens93}...
\bibliographystyle{alpha}
\bibliography{Biblio} 

Compiling

Since a bibliography is generated for each chapter, one may compile each one of them with bibtex. In our case:

pdflatex Master
bibtex Chapter1
bibtex Chapter2
pdflatex Master
pdflatex Master

Overall bibliography

If you want to sum up all entries used in the document, you need to add the following lines in your Master file:

\bibliographystyle{alpha}

and

\bibliography{Biblio}

Note that the first need to be called before any \include command. In addition, you need to compile the Master file with bibtex as well.

Note: the hack is taken from this example.