1

I have a document where each chapter acts as a refsection and resets the references counter. I know I can print the individual bibliographies at the end of each chapter, but I'd like to have them all at the end of the document instead. For example if I have three chapters A,B,C, I'd like the document to look like:

Chapter A

...

Chapter B

...

Chapter C

...

Bibliography

Chapter A

[1]

[2]

...

Chapter B

[1]

[2]

...

Chapter C

[1]

[2]

...

My LaTeX document looks something like this

\usepackage[style=numeric,backend=biber,refsection=chapter]{biblatex}
\addbibresource{mydocument.bib}

\begin{document}

\chapter{A}
... some text here and some \cite{} commands...
\chapter{B}
... some text here and some \cite{} commands...
\chapter{C}
... some text here and some \cite{} commands...

% This will only produce the bibliography for chapter C
% What I'd like to have here is something that will produce
% Bibliography
% Chapter A
% ...
% Chapter B
% ...
% Chapter B
% ...
\printbibliography 

\end{document}

Any ideas?

2

biblatex has you covered. You can use:

\bibbysection

The documentation describes it as:

This command automatically loops over all reference sections. This is equivalent to giving one \printbibliography command for every section but has the additional benefit of automatically skipping sections without references.

By what you described, it is probable that you also want option defernumbers=true, but it is hard to say more in the absence of compilable code.

To get specific titles per bibliography's chapter, as requested in the comments, you'll have to be verbose:

\documentclass{book}

\usepackage[style=numeric,backend=biber,refsection=chapter,defernumbers=true]{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}

\chapter{A}

\cite{herrmann}
\cite{kastenholz}

\chapter{B}

\cite{sigfridsson}

\chapter{C}

\cite{massa}

\printbibheading
\printbibliography[section=1,heading=subbibliography,title={References for chapter A}]
\printbibliography[section=2,heading=subbibliography,title={References for chapter B}]
\printbibliography[section=3,heading=subbibliography,title={References for chapter C}]

\end{document}

enter image description here

A more automated and shorter alternative to the same purpose would be (courtesy of @moewe):

\documentclass{book}

\usepackage[style=numeric,backend=biber,refsection=chapter,defernumbers=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\defbibheading{bibbysubsect}{\section*{References for Chapter \ref{blx:refsection\therefsection}}}

\begin{document}

\chapter{A}
\label{blx:refsection\therefsection}

\cite{herrmann}
\cite{kastenholz}

\chapter{B}
\label{blx:refsection\therefsection}

\cite{sigfridsson}

\chapter{C}
\label{blx:refsection\therefsection}

\cite{massa}

\printbibheading
\bibbysection[heading=bibbysubsect]

\end{document}
  • Hey, thank you for this. I feel that I am really close. The final thing is that \bibbysection labels all section as "References", so I get a string of References instead of Chapter 1, Chapter 2, Chapter 3. Is there an option to tell it to use the chapter names or numbers instead? I tried the heading option but no luck. – Jenny Nov 22 '18 at 18:16
  • @Jenny Take a look a the edit. I think that's what you are looking for. – gusbrs Nov 22 '18 at 18:44
  • 1
    You could try something like \defbibheading{bibbysubsect}{\section*{References for Chapter \ref{blx:refsection\therefsection}}} with \bibbysection[heading=bibbysubsect] where you would have to manually add \label{blx:refsection\therefsection} after each \chapter. – moewe Nov 22 '18 at 18:53
  • @moewe You're right as usual! Rolled back. Thanks again. – gusbrs Nov 22 '18 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.