<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%
% This file differs from the 'by section' example in that the
% citation labels are assigned globally. They are not local to the
% 'refsegment' environments.
%
\documentclass[a4paper,oneside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear,backend=biber]{biblatex-ms}
\usepackage{hyperref}
\usepackage{nameref}
\addbibresource{biblatex-examples.bib}
\defbibheading{subbibliography}{%
  \section*{%
    Chapter \therefsegment:
    \nameref{refsegment:\therefsection\therefsegment}}}
\begin{document}

\chapter{Title of first chapter}
\begin{refsegment}
This is just filler text \parencite{westfahl:space}.
This is just filler text \parencite{nietzsche:ksa}.
\end{refsegment}

\chapter{Title of second chapter}
\begin{refsegment}
This is just filler text \parencite{nietzsche:historie}.
This is just filler text \parencite{westfahl:frontier}.
\end{refsegment}

\chapter{Title of third chapter}
\begin{refsegment}
This is just filler text \parencite{aristotle:anima}.
This is just filler text \parencite{averroes/bland}.
\end{refsegment}

\printbibheading
\bibbysegment[heading=subbibliography]
%
% \bibbysegment is a shorthand for:
%
% \printbibliography[segment=1]
% \printbibliography[segment=2]
% \printbibliography[segment=3]
% ...

\end{document}
</pre></body></html>