5

Possible Duplicate:
Multiple bibliographies

I'm trying to write a book with references in each chapter and I would like to use chapterbib and natbib packages.

I can't really understand how to make things work.

My book is organized as follows:

  • settings.tex which contains all the packages, commands etc that I use in my document (among the others: \usepackage{natbib}, \usepackage{chapterbib})

  • Chapter_01.tex (in which I'd like the references stored in references_01.bib)

  • Chapter_02.tex (in which I'd like the references stored in references_02.bib).

I then have a Book.tex file that is made like this:

\input{settings_pdf.tex}

\begin{document}

\include{Chapter_01.tex}

\include{Chapter_02.tex}

\end{document}

What should I put at the end of each chapter in order to get the references and how should I compile the document to produce a pdf document?

  • @lockstep: using natbib or not is not the same ... –  Sep 28 '12 at 15:21
  • @Herbert Comparing Gonzalo's and your answer the only difference is that you also recommend bibtex <file>. Maybe the linked question could be rewritten to be more general. – lockstep Sep 28 '12 at 15:24

1 Answers1

3

your structure is correct. You have to run bibtex for the document and each chapter:

pdflatex <file>
bibtex <file>
bibtex Chapter_01
bibtex Chapter_02
[...]
pdflatex <file>
pdflatex <file>

The first bibtex run will report an error multiple bibdata commands, which is not of interest, ignore it.

  • Herbert thanks, can you tell me how to include the specific bibliography at the end of each chapter? I think that I make some mistakes there, because I use bibtex separately for each chapter... – lucacerone Sep 28 '12 at 15:27
  • Here you'll find example documents: http://mirrors.ctan.org/info/examples/LaTeX-Bib/02-03-1.ltx2 and also 02-03-2.ltx2 and 02-03-2.ltx3 –  Sep 28 '12 at 15:33
  • It's TexStudio's problem. I found that this hack lets TexStudio run bibtex on each included file: https://tex.stackexchange.com/questions/297430/how-to-run-bibtex-in-texstudio-or-otherwise-on-included-files – Yan King Yin Nov 27 '17 at 04:00