Put separate bibliographies in each chapter
July 13, 2013
Mark Senn

First, thanks to Michael Pargett for the missing \endlist bug fix.

To convert from a single bibligraphy at the end of your thesis to separate bibliographies in each chapter do the following;

### thesis.tex file changes

1. Define \chapterbib and revised bibliography environment.
Insert the following immediatelly before your \begin{document}. If you are using a \documentclass option to choose a different bibliography style, use that option name in the \bibliographystyle command below. If your bibliographic database file is not named all.bib, use the correct name in the \bibliography command below.

\usepackage{chapterbib}

\newcommand{\chapterbib}{
\bibliographystyle{unsrt}
\bibliography{all}
}

\makeatletter
\renewenvironment{thebibliography}[1]
{
\section{References}
\list
{\@biblabel{\arabic{enumiv}}}%
{%
\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\if@openbib
\itemindent -\bibindent
\listparindent \itemindent
\parsep \z@
\fi
\@@thebibliographyparsep
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand{\theenumiv}{\arabic{enumiv}}%
\baselineskip=12pt
}%
\if@openbib
\renewcommand{\newblock}{\par}
\else
\renewcommand{\newblock}{\hskip .11em \@plus.33em \@minus.07em}%
\fi
\sloppy\clubpenalty4000\widowpenalty4000%
\sfcode\.=\@m
}
{%
\endlist
}
\makeatother
`
1. Put each chapter in a separate file.
Put each chapter in a separate file and include it using
\include{...}

2. Don't produce a bibliography for the entire thesis.
Change
\include{bibliography}
to
%%\include{bibliography}

### chapter file changes

1. Put a bibliography in each chapter.
Put a blank line followed by
\chapterbib
at the end of each chapter.

2. BibTeX each chapter separately.
BibTeX each chapter separately, don't BibTeX your whole thesis.