1

The AMS suggests to remove a TOC entry from an amsart document by suppressing the entry just before it is to be added to the TOC.

Their solution works without the biblatex package loaded. However, when I load the biblatex package, it fails, and that TOC entry is still printed even with the skip command. Please see the below MWE demonstrating the problem.

\documentclass{amsart}
% \usepackage{biblatex} %uncomment to see difference
\DeclareRobustCommand{\SkipTocEntry}[4]{}
\begin{document}
\tableofcontents
\addtocontents{toc}{\SkipTocEntry}
\section{First}
\end{document}

Notice that it is not necessary to use biber in the compilation to demonstrate the issue. Using pdflatex on the document alone shows the difference.

3
  • 1
    If you load biblatex you need to gobble more in the .toc file, since biblatex writes some commands to that file. \DeclareRobustCommand{\SkipTocEntry}[8]{} works.
    – moewe
    Jan 5, 2020 at 17:45
  • 1
  • @moewe, that led me to the solution. Gobbling more of the TOC line did exactly what I needed. Would you like to write up the answer so that I can credit you for it? Jan 5, 2020 at 18:14

1 Answer 1

3

As discussed at length in Why does biblatex produce `defcounter` lines in .toc?, biblatex adds additional content to the .toc file. So when you load it you get

\defcounter {refsection}{0}\relax 
\contentsline {section}{\tocsection {}{1}{First}}{1}%

instead of just

\contentsline {section}{\tocsection {}{1}{First}}{1}%

Hence, if you want to gobble the line, you need to gobble more.

\documentclass{amsart}
\usepackage{biblatex} %uncomment to see difference
\DeclareRobustCommand{\SkipTocEntry}[8]{}
\begin{document}
\tableofcontents
\addtocontents{toc}{\SkipTocEntry}
\section{First}
\end{document}

If you load hyperref you need to gobble even more, because the argument structure changes.

\DeclareRobustCommand{\SkipTocEntry}[9]{}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.