[Tex/LaTex] Biblatex bibliography section changes chapter name in header

biblatexheader-footerkoma-script

I'm putting together my thesis, using the Koma script book class and biblatex to create separate reference lists for each chapter. I'm putting the name of the chapter in the header of each left page, using the chapterprefix=on option to scrbook. I'm also using the [header=subbibintoc] option to the \printbibliography command to get the bibliography as an unnumbered section in the table of contents. However, from the reference section and through to the end of each chapter, the chapter name in the heading is changed to "Bibliography". How do I get the header to print the chapter name throughout the bibliography section in each chapter?

Using [header=subbibliography] almost gives me what I want, except the bibliography does not appear in the table of contents. Using [header=subbibnumbered] also almost gets me what I want, except the bibliography is numbered.

I've included a minimal working example below that illustrates my problem. Note that on page two of the compiled document, the header correctly prints the chapter name, while on page 4, it erroneously prints "Bibliography".

\documentclass[chapterprefix=on]{scrbook}

\usepackage[
    backend=biber,
    style=authoryear-comp,
    refsection=chapter,
]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @misc{A01,
        author = {Author, A.},
        year = {2001},
        title = {Alpha},
    }
\end{filecontents}
\addbibresource{\jobname.bib}

\usepackage{appendix}

\usepackage{lipsum}

\begin{document}

    \tableofcontents

\mainmatter

\chapter{Test}

\lipsum \lipsum \lipsum \autocite{A01}.

\printbibliography[heading=subbibintoc]

\begin{subappendices}

\section{An appendix}

\lipsum

\end{subappendices}

\end{document}

Best Answer

ORIGINAL ANSWER: While the refsection=chapter option will assure that "all cited works are assigned labels which are local to the environment" (biblatex manual, section 3.6.4), it does not modify the sectioning level of the bibliographies created with \printbibliography. Your "reference section" in the MWE is actually an unnumbered chapter (the default for the scrbook class), as should be obvious from the forced page break. For an unnumbered section, you must issue \printbibliography[heading=subbibliography] -- this will produce the correct layout, including headers.

UPDATE: (I'm assuming that the problematic header is actually at p. 6 in your MWE, while p. 4 is fine.) You seem to have stumbled upon a bug in the biblatex interface to scrbook. With this class, heading=subbibintoc uses the \addsec command which produces an unnumbered section with ToC entry and (with the help of \markright) headers. For whatever reason, biblatex adds a \markboth -- removing this command from the subbibintoc definition produces correct headers.

\documentclass[chapterprefix=on]{scrbook}

\usepackage[
    backend=biber,
    style=authoryear-comp,
    refsection=chapter,
]{biblatex}

\defbibheading{subbibintoc}[\refname]{%
  \addsec{#1}%
%   \markboth{#1}{#1}}% DELETED
  }% NEW

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
    @misc{A01,
        author = {Author, A.},
        year = {2001},
        title = {Alpha},
    }
\end{filecontents}

\addbibresource{\jobname.bib}

\usepackage{appendix}

\usepackage{lipsum}

\begin{document}

\tableofcontents

\mainmatter

\chapter{Test}

\lipsum \lipsum \lipsum \autocite{A01}.

\printbibliography[heading=subbibintoc]

\begin{subappendices}

\section{An appendix}

\lipsum

\end{subappendices}

\end{document}