1

In my memoir document, I have a preface, which is defined as an unnumbered chapter, that contains a brief bibliography but I do not want that bibliography to show up in the table of contents.

When using biblatex, how can I control on a chapter basis, whether the bibliography shows up in the table of contents? (Before switching to biblatex, the printing of the bibliography and adding an entry to the table of contents was separate, so easy to control selectively.)

MWE:

\documentclass{memoir}

\usepackage{filecontents} \usepackage{biblatex} \addbibresource{refs.bib}

\begin{filecontents}{refs.bib} @book{somebook, author={some author}, title={some title}, date={2021} } \end{filecontents}

\begin{document}

\tableofcontents*

\chapter{A section} \begin{refsection} \textcite{somebook} showed that... \printbibliography[heading=subbibliography] \end{refsection}

\chapter{A section} \begin{refsection} \textcite{somebook} showed that... \printbibliography[heading=subbibliography] \end{refsection}

\end{document}

user1362373
  • 2,859
  • 4
    Look at this: https://tex.stackexchange.com/a/142412/231952 You need \nobibintoc before \printbibliography – Ivan Jan 15 '21 at 19:15

1 Answers1

3

For the "big three" (the standard classes, KOMA-Script classes and memoir) biblatex tries to interface with the class as much as possible for the formatting of the bibliography heading.

For memoir that means that biblatex responds to \nobibintoc and \bibintoc. So as Ivan said in the comments, you can just say \nobibintoc before the bibliography you want to hide in the ToC. If you do this inside a refsection you won't even have to restore \bibintoc afterwards, because the effect of these commands is local.

\documentclass{memoir}

\usepackage{biblatex} \addbibresource{biblatex-examples.bib}

\begin{document}

\tableofcontents*

\chapter{A section} \begin{refsection} \textcite{sigfridsson} showed that\dots \nobibintoc \printbibliography[heading=subbibliography] \end{refsection}

\chapter{A section} \begin{refsection} \textcite{sigfridsson} showed that\dots \printbibliography[heading=subbibliography] \end{refsection}

\end{document}

ToC showing only one bibliography.

If all or most of your bibliographies are subbibliographys you can save yourself some typing with \DeclarePrintbibliographyDefaults (which was added in biblatex v3.13 from 2019-08-17).

\documentclass{memoir}

\usepackage{biblatex}

\DeclarePrintbibliographyDefaults{heading=subbibliography}

\addbibresource{biblatex-examples.bib}

\begin{document}

\tableofcontents*

\chapter{A section} \begin{refsection} \textcite{sigfridsson} showed that\dots \nobibintoc \printbibliography \end{refsection}

\chapter{A section} \begin{refsection} \textcite{sigfridsson} showed that\dots \printbibliography \end{refsection}

\end{document}


With a standard class heading=subbibliography does not go to the ToC, so you would use heading=subbibliography if you don't want the bibliography to go to the ToC and heading=subbibintoc if you want it in the ToC.

\documentclass{article}

\usepackage{biblatex} \addbibresource{biblatex-examples.bib}

\begin{document}

\tableofcontents*

\chapter{A section} \begin{refsection} \textcite{sigfridsson} showed that\dots \nobibintoc \printbibliography[heading=subbibliography] \end{refsection}

\chapter{A section} \begin{refsection} \textcite{sigfridsson} showed that\dots \printbibliography[heading=subbibintoc] \end{refsection}

\end{document}


It is always possible to define a new bibliography heading to give you full control over what happens, e.g.

\defbibheading{mybib}[\refname]{%
  \section*{#1}}
moewe
  • 175,683