# How can I include a bibliography at the end of each part of a book?

I'm trying to write a book divided into two parts. I'd like to insert a bibliography at the end of each part (several chapters each) but, since it will be one volume, I want the page number to keep growing. Is there a way to do it? I'm currently arguing with chapterbib, but I had no luck up to now. Any suggestion?

-
Welcome to TeX.SX. Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Claudio Fiandrino Dec 16 '12 at 18:34
Welcome. I think you should look at this solution to a similar question. –  Andrew Swann Dec 16 '12 at 19:01
My problem is a bit different: I have inserted citation throughout all the chapters but I need bibliography just at the end of the last. Furthermore I tried using \usepackage[gather]{chapterbib} but it makes me a page of reference for every chapter. I'm just looking for an environment like \thebibliography but where page number keeps growing after it. –  Lorenzo Dec 16 '12 at 19:15
Would you be willing to use biblatex to create your bibliographies? –  Gonzalo Medina Dec 16 '12 at 20:02
@egreg The solution in Multiple bibliographies does not work if one has multiple \includes (e.g., one for each chapter) but not the same number of bibliographies. –  Guido Dec 16 '12 at 20:47

bibunits (use texdoc bibunits for the manual) provides an alternative to chapterbib.

Here is a possible template for your use

\documentclass{book}
\usepackage{bibunits}
\begin{document}
\defaultbibliographystyle{plain}

\begin{bibunit}
\include{chapter1}
...
\include{chapterN}
\putbib[bibliography1]
\end{bibunit}

\begin{bibunit}
\include{chapterN}
...
\include{chapterN+M}
\putbib[bibliography2]
\end{bibunit}
\end{document}


Then run

latex file
bibtex bu1
bibtex bu2
latex file
latex file


where file is the name of your master .tex file

-
I was trying exactly your solution but as soon as I latex the file the second time (I tried with just 1 bu) I get the error: "Can only be used in the preamble" making reference to \bibcite{citation}{1}. Any idea? –  Lorenzo Dec 16 '12 at 21:25
@Lorenzo No, I don't get errors. –  Guido Dec 16 '12 at 21:40
The example works fine to me but in my file i get the error. I'm using both babel and hyperref do you know any issue? –  Lorenzo Dec 16 '12 at 21:54
babel and hyperref work for me (they might be problems with hyperref if a citation appears in both bibliography. Otherwise, no problems. Have you removed existing auxiliary files? –  Guido Dec 16 '12 at 22:04
Ok, I tried to load bibunits as the last package and now it give me no errors BUT where there should be the bibliography there are just [1] ... [6] (I have 18 references). I'm getting out for the blue... –  Lorenzo Dec 16 '12 at 23:01