2

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}.

4

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.

  • Thanks Dorian. Its working now but is there any way that only those which are cited can be printed at the end of each chapter or for each chapter the bib file would be different, because I am getting all the references at the end of each chapter. – hermatician Oct 11 '16 at 9:44
  • 2
    It strange, because this example is supposed to act as you want. Don't you use any \nocite command? – Dorian Oct 11 '16 at 10:14
  • Dear Dorian, could you kindly elaborate on \nocite command. No I did not use it. How can it help? – hermatician Oct 11 '16 at 11:12
  • Can anyone help with \nocite command usage for selective bibliography printing at the end of each chapter? I used \nocite{*} but its not working. even a link which explains the feature would help and I strongly suggest in this forum to keep biblatex and bibtex items separate. It has wasted much of my time. Thanks in advance. – hermatician Oct 11 '16 at 13:02
  • Ok I tried it and instead of \citep I used \nocite and its working. I shall have to change all the citep to nocite now. but is it possible to change the heading "bibliography" to "references "? – hermatician Oct 12 '16 at 6:02
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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