1. Introduction

LaTeX is a high-quality typesetting system commonly used to create scientific and technical documents. One commonly used feature in LaTeX is its support for handling bibliographies. We can add references, and create and style bibliographies to make documents look professional and consistent.

Handling bibliographies can become difficult when dealing with large documents, especially those with multiple chapters. In such cases, having separate bibliographies per chapter is a way to maintain clarity and relevance. Per-chapter bibliographies enhance the document’s organization allowing better segmentation and easier navigation through chapters and their references.

In this tutorial, we’ll learn how to add a bibliography per chapter in LaTeX.

We’ll use the report document class, generally used to write long reports in LaTeX. All the packages described in this tutorial except the biblatex package require an external tool, BibTex, to structure citations and build the bibliography.

2. Using the BibLaTeX Package

The BibLaTeX package is a complete reimplementation of bibliographic features provided by LaTeX. This package supports multiple bibliographies within one document allowing per-chapter or per-section bibliographies within a document.

Let’s first create a sample.bib file with the references that we can use throughout this tutorial:

% ------- sample.bib file -------
@book{tex,
  title={TEX for Scientific Documentation: Second European Conference, Strasbourg, France, June 19-21, 1986. Proceedings},
  author={D{\'e}sarm{\'e}nien, Jacques},
  volume={236},
  year={1986},
  publisher={Springer Science \& Business Media}
}

@article{pythontex,
  title={PythonTeX: reproducible documents with LaTeX, Python, and more},
  author={Poore, Geoffrey M},
  journal={Computational Science \& Discovery},
  volume={8},
  number={1},
  pages={014010},
  year={2015},
  publisher={IOP Publishing}
}

@article{bibtex,
  title={BIBTEX 101},
  author={Patashnik, Oren},
  journal={TUGboat},
  volume={15},
  pages={269--273},
  year={1984}
}

@article{latex,
  title={LATEX and the different bibliography styles},
  author={Garcia, Federico},
  journal={The PracTEX Journal},
  volume={2},
  pages={2007--2},
  year={2007}
}

We can use refsection environment to separate bibliographies within a document:

% ------- main.tex file -------%
\documentclass{report}

\usepackage{biblatex}
\addbibresource{sample.bib}

\begin{document}
\chapter{Introduction}
\begin{refsection}
Reference to some work \cite{tex} that is of the most scientific interest.
The work is based on the previous work \cite{pythontex}.

\printbibliography[heading=subbibliography]
\end{refsection}

\chapter{The end}
\begin{refsection}
\section{First section}
A new section with a new bibliography \cite{latex} at the end.

\section{Another section}
We can add all the scientific complexity any human could have \cite{bibtex}.

\printbibliography[heading=subbibliography]
\end{refsection}
\end{document}

This results in:

Per-Chapter bibliography with BibLaTeX package

The \addbibresource command adds the file with bibliographies and should be invoked in the preamble, i.e., before\begin{document}.

The \printbibliography command prints the bibliography and if used inside a refsection environment, it automatically restricts the scope of the list of references to the enclosing refsection environment. Additionally, the [heading=subbibliography] option ensures the bibliography appears as a part of the current chapter rather than as a separate, unnumbered section.

3. Using the bibunits Package

The bibunits package provides the functionalities to create the bibliographies for different units of the text, in our case, chapters. We can encapsulate different parts of the document within a separate bibunit environment to create bibliographies per separated unit.

Let’s use a main.tex file to demonstrate the usage of the bibunit environment:

\documentclass{report}

\usepackage{bibunits}
\defaultbibliography{sample}

\begin{document}

\begin{bibunit}
\chapter{Introduction}
Reference to some work \cite{tex} that is of the most scientific interest.
The work is based on the previous work \cite{pythontex}.
\putbib
\end{bibunit}

\begin{bibunit}
\chapter{The End}
\section{First section}
A new section with a new bibliography \cite{latex} at the end.
\section{Another section}
We can add all the scientific complexity any human could have \cite{bibtex}.
\putbib
\end{bibunit}
\end{document}

This results in a document with 2 chapters having separate bibliographies:

Per-Chapter bibliography with bibunits package

Note that, unlike with the BibLaTeX package, the bibliography starts on a new page. The \defaultbibliography command specifies the default BibTeX file. Optionally, we can specify the bibliography style while initiating the bibunit environment. Here, we use the default bibliography style, i.e., plain. The \putbib command dictates the location of a bibliography within a bibunit environment.

Another way of separating bibliographies per chapter is to use the command \bibliographyunit[\chapter] instead of using the bibunit environment. The \bibliographyunit[\chapter] command has to be issued after \begin{document}. Moreover, we must invoke the bibunit package with the sectionbib option, i.e., \usepackage[sectionbib]{bibunit}, useful for chapters as bibliography units.

4. Using the chapterbib Package

The chapterbib package is designed in such a way that it creates bibliographies for each included (\include) file. So, we can create a separate bibliography for each section, subsection, or chapter.

Let’s create the main.tex file:

% ------- main.tex file -------%
\documentclass{report}

\usepackage{chapterbib}

\begin{document}

\include{chap1}
\include{chap2}

\end{document}

Here, we used the \include command to include two separate .tex files, i.e., chap1.tex and chap2.tex.

% ------- chap1.tex file -------%
\chapter{Introduction}

Reference to some work \cite{tex} that is of the most scientific interest.
The work is based on the previous work \cite{pythontex}.

\bibliographystyle{plain}
\bibliography{sample}

Similarly, the chap2.tex file:

% ------- chap2.tex file -------%
\chapter{The End} 
\section{First section}
A new section with a new bibliography \cite{latex} at the end.

\section{Another section}
We can add all the scientific complexity any human could have \cite{bibtex}.

\bibliographystyle{plainnat}
\bibliography{sample}

This produces a PDF document with two chapters, each having its bibliography:

Per-Chapter bibliography with chapterbib package

We used two different bibliography styles, plain and plainnat, one for each chapter. We must add the \bibliographystyle and the \bibliography commands at the end of each included file.

By default, the report and book document classes consider the bibliography an unnumbered chapter. With the sectionbib option from chapterbib (\usepackage[sectionbib]{chapterbib}), we can change this behavior to have the bibliography appear as a section within the respective chapter. This allows the bibliography to be included in the table of contents.

5. Using the multibib Package

The multibib package is designed to create multiple bibliographies based on different topics within the same document. One key feature of this package is that we can create multiple bibliographies even for the same section or chapter.

The \newcites command is the key to creating multiple bibliographies using multibib. The \newcites command takes two arguments: suffix and heading. The suffix defines a new set of commands for citations and the bibliography, and the heading specifies the title of the bibliography section.

Let’s use the \newcites command for creating per-chapter bibliographies:

%----- main.tex file -----%
\documentclass{report}

\usepackage{multibib}
\newcites{intro}{Chapter 1 References}
\newcites{end}{Chapter 2 References}

\begin{document}

\chapter{Intro}
Reference to some work \citeintro{tex} that is of the most scientific interest.
The work is based on the previous work \citeintro{pythontex}.

\bibliographystyleintro{plain}
\bibliographyintro{sample}

\chapter{The end}
\section{First section}
A new section with a new bibliography \citeend{latex} at the end.

\section{Another section}
We can add all the scientific complexity any human could have \citeend{bibtex}.

\bibliographystyleend{plainnat}
\bibliographyend{sample}
\end{document}

Produces a document with 4 pages, one for each chapter and one for their separate bibliography.

Per-Chapter bibliography with multibib package

Let’s understand the set of commands defined by the \newcites command with the suffix x:

  • \citex inserts a reference within the text
  • \bibliographystylex sets the bibliography style
  • \bibliographyx imports the specified bibliography file (.bib)

Furthermore, we can also use the \nocite command similarly with an already defined suffix, i.e., intro and end. The \nocite command includes references in the bibliography without explicitly citing them in the text.

Additionally, we can combine multiple \newcites commands by providing a list of suffixes and headings separated by commas. For instance, we can replace the two \newcites commands above with \newcites{intro,end}{Chapter 1 References,Chapter 2 References} and get the same results.

6. Conclusion

In this article, we learned different ways to create per-chapter bibliographies in LaTeX.

First, we explored bibunits and biblatex packages, which use separate environments to create individual bibliographies for each chapter. Then, we used chapterbib to generate a bibliography for each included file. Finally, we looked at the \newcites command provided by the multibib package, which allows us to create custom citation commands and bibliographies with specific headings for different sections of our document.