Using LaTeX, how can I have a list of references at the end of each section?

djq picture djq · Mar 23, 2010 · Viewed 25.7k times · Source

I want to generate the bibliography for each section, and have it at the end of the section. When I do this at the moment it generates the full bibliography and places it after each section.

Is there a way that this can be done?

The advice here says

"The chapterbib package provides an option sectionbib that puts the bibliography in a \section* instead of \chapter*, something that makes sense if there is a bibliography in each chapter. This option will not work when natbib is also loaded; instead, add the option to natbib. "

I don't understand what this means, and I've tried experimenting with what I thought the options are. Specifically, what does "add the option to natbib" mean?

My subsequent question (which evolved after my first one was solved) is to not have pagebreaks between the references, and the next section.

Thank you for your help.

Answer

Norman Ramsey picture Norman Ramsey · Mar 23, 2010

In addition to

\usepackage[sectionbib]{natbib}
\usepackage{chapterbib}

You will have to put each section in a separate .tex file which you then \include. You will have to run bibtex on each .tex file separately.

N.B. Using \input rather than \include avoids unwanted page breaks, but it will not create the .aux file that BibTeX needs to do its work. I looked at the definition of \include, and I don't see how to disable the page-breaking function except by disabling \clearpage entirely. You could try

\let\originalclearpage=\clearpage
\def\clearpage{\relax}

right after your \begin{document}, but you may have to put some \originalclearpage in by hand.