1

This is a follow up question of this one: How to remove margin header in biblatex

Using the scrreprt document class in combination with biblatex leads to the undesired heading for the reference chapter. Using the solution from the link above, I am able to remove the undesired heading. Showing the references in the table of contents works as well, but unfortunately this particular chapter is no longer numbered. Below I have included a MWE as well as an example entry of the .bib file.

\documentclass[toc=listofnumbered]{scrreprt}
\RequirePackage[sorting=none,citestyle=numeric-comp,autocite=superscript]{biblatex}

\addbibresource{test.bib}
\defbibheading{myheading}[References]{\chapter*{#1} \addcontentsline{toc}{chapter}{#1}}

\begin{document}

\tableofcontents
\chapter{Test}
\cite{test}
\printbibliography[heading=myheading]

\end{document}


@article{test,
author = {Author, A. and Author B.},
journal = {itle of journal},
number = {8},
pages = {475--478},
volume = {294},
year = {1961}
}
3
  • Well, you added there a starred version of \chapter*, which removes the numbering.
    – gusbrs
    Jun 20, 2017 at 14:08
  • bibliography=totocnumered
    – Johannes_B
    Jun 20, 2017 at 14:25
  • @Johannes_B, you are right, there are better ways to do this (I changed my answer).
    – gusbrs
    Jun 20, 2017 at 14:44

2 Answers 2

2

To get a numbered version of the "References" chapter you could use:

\defbibheading{myheading}[References]{\chapter{#1}}

The starred version of \chapter* removes the numbering. It also removes the entry from TOC, that's why you had to add it manually latter. Just using the regular version of \chapter sorts both things.

Testing your MWE, with the scrreprt documentclass, this definition, as far as I can see, reaches your desired results. In a class such as book you would probably have to set the heading manually, e.g. by adding \markboth{}{} to the definition.

11
  • This is great. I wasn't aware that one can use "heading=" multiple times
    – leandriis
    Jun 20, 2017 at 14:49
  • 2
    I don't think it makes sense to use heading multiple times. Only the last heading takes effect.\printbibliography[title=References, heading=bibnumbered] will have exactly the same effect.
    – moewe
    Jun 21, 2017 at 6:32
  • @gusbrs I was finally able to test the solution you suggested. For me it leads to the chapter being numbered correctly and listed in the toc. Unfortunately, the undesired heading on the second page of the bibliography remains.
    – leandriis
    Jun 21, 2017 at 10:44
  • @leandriis, I didn't grasp this from my initial read of the original post. I though you meant all the way the chapter/section heading. Do you mean also the page heading? Did your original approach succeed in removing that heading for you? (I can revert to the first answer I gave if it is what works).
    – gusbrs
    Jun 21, 2017 at 11:41
  • 1
    If \chapter is what the OP wants, they should simply use the option bibliography=totocnumbered to scrreprt as Johannes suggested. Then there is no need to redefine anything (except for \refname/\bibname, but that can be done with title=\refname as well).
    – moewe
    Jun 21, 2017 at 13:46
2

Following Johannes_B initial suggestion, reinforced and elaborated by moewe, you should use scrreprt's class option bibliography=totocnumered. Like this:

\documentclass[toc=listofnumbered,bibliography=totocnumbered]{scrreprt}
\usepackage[sorting=none,citestyle=numeric-comp,autocite=superscript]{biblatex}

\addbibresource{biblatex-examples.bib}

\begin{document}

\tableofcontents

\chapter{Test}

\nocite{*}
\printbibliography[title=\refname]
\end{document}
2
  • @leandriis, if this indeed works for you (as I believe it does), I recommend that you accept this one as the answer to the question. Of course, I recommend that you use it too. If a direct option is available for your purpose, it is in general preferable to use it, rather than go about redefining macros and so on.
    – gusbrs
    Jun 21, 2017 at 19:58
  • Thanks again for your time and answers. Unfortunately this solution does not work for my original document while defining an new bibheading does. It seems that I have forgotten an important part of the code while trying to create an MWE. I will have a closer look on my code later and see if I can find out what causes this strange behaviour in my original document.
    – leandriis
    Jun 21, 2017 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .