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}.
- 7,787
- 37
2 Answers
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.
just to add in to the answer to Dorian and the example which is very helpful: 1. Use the example as given. 2. For selective references chapter wise make chapter wise .bib files and put them in the main folder ( not in the chapters folder where from you input or include) 3. Run pdfLatex + chapterwise (bibtex) + main (bibtex) + pdfLatex + PdfLatex.
To change the title of bibliography chapter wise or in main use \renewcommand{\bibname}{Bibliography} command or \renewcommand{\refname}{Bibliography}. 4. I dont think two styles one for chapter wise and one for global bibliography can be used so use one style for both because it might confuse the reader even if its possible to have two styles of citations.
- 37
\nocitecommand? – Dorian Oct 11 '16 at 10:14\includecan not be nested. butchapterbibneeds\include, when every chapter is composed of several sections, what i should do? – Vector Aug 09 '20 at 05:03