1

I am using the etoc package to print local ToCs on the scope of parts, but there is a problem: I have a global bibliography at the end of my document, which is not supposed to belong to the last part, but it does appear in the local ToC of the part. How can I remove the bibliography from the local ToC?

I found similar questions (here, and here), but the solutions don't work in my case, because I only want to remove the bibliography entry from the local, but not the global ToC.

Here is an MWE:

\documentclass{scrbook}
\usepackage{etoc}
\usepackage{biblatex}

% Set the style for chapter entries
\etocsetstyle{chapter}%
{\begingroup
 \parindent 0pt \parskip 0pt}%
{\leftskip 0pt}%
{\makebox[.5cm]{}%
 \hangindent=0.5cm
 \etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}%
 \hfill\makebox[5mm][l]{\etocpage}\nobreak%
\par}%
{\endgroup}%

% Set the style for section entries
\etocsetstyle{section}%
{\begingroup
 \parindent 20pt \parskip 0pt}%
{\leftskip 0pt}%
{\makebox[.5cm]{}%
 \hangindent=0.5cm
 \etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}%
 \hfill\makebox[5mm][l]{\etocpage}\nobreak%
 \par}%
{\endgroup}%

% Set the style for subsection entries
\etocsetstyle{subsection}%
{\begingroup
 \parindent 40pt \parskip 0pt}%
{\leftskip 0pt}%
{\makebox[.5cm]{}%
 \hangindent=0.5cm
 \etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}\hfill\nobreak%
 \par}%
{\endgroup}%

\begin{filecontents}{\jobname.bib}
    @misc{ABC01,
      author = {Author, A. and Buthor, B. and C},
      year   = {2001},
      title  = {Alpha},
    }
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\tableofcontents

\part{First Part}
\localtableofcontents
\chapter{Chapter 1}

    \section{Section 1}

    \section{Section 2}
        \cite{ABC01}

\printbibliography[heading=bibintoc]


\end{document}

1 Answer 1

1

This works:

\etocsetlocaltop.toc{part}
\printbibliography[heading=bibintoc]

but ideally you should instruct \printbibliography to use a part style entry in the global table of contents, as I believe this should help etoc know where the local TOC of last part before bibliography ends.

As it stands the bibliography entry in the global TOC is rendered as a chapter entery and thus gives impression it is part of Part. Screenshot of global TOC: global TOC

2
  • This works, thanks a lot! You're probably right about somehow changing the ToC entry style of the bibliography. Don't know how to do that either though.
    – mapf
    Apr 9, 2023 at 12:36
  • After some digging I tested \defbibheading{bibliography}[\bibname]{\addpart{#1}} before \begin{document} and then simply \printbibliography (with no optional argument). It does set the bibliography as an unnumbered part; etoc detects it and needs no further instructions. The global TOC looks good. Now the "Bibliography" rendering as part means title stands on its own page and references start on next one. For more, you should probably dig into biblatex + scrbook documents.
    – user691586
    Apr 9, 2023 at 15:55

You must log in to answer this question.

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