Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a book using the amsbook class, and I've included a page for acknowledgements using \chapter*{}, thinking it wouldn't show up in the ToC.

However, it does (and for some reason it's supposed to do so, according to the amsbook manual); so the question is, how do I get rid of it from the ToC?

share|improve this question
    
As for the reason amsbook (and other ams classes) do this: The intended use of this class is a technical volume. The prototypical use of a starred chapter in a technical volume is an executive summary. The executive summary goes in the table of contents. –  David Hammen Jun 12 '11 at 16:51

3 Answers 3

The amsmath FAQ has a solution. Here's a modification of it, in a complete example:

\documentclass{amsbook}
\DeclareRobustCommand{\gobblefour}[4]{}
\newcommand*{\SkipTocEntry}{\addtocontents{toc}{\gobblefour}}
\begin{document}
\tableofcontents
\SkipTocEntry\chapter*{Hidden chapter}
\chapter{Shown chapter}
\end{document}

Just place \SkipTocEntry before a TOC entry you would like to hide.

If you use hyperref, take one argument more:

\DeclareRobustCommand{\gobblefive}[5]{}
\newcommand*{\SkipTocEntry}{\addtocontents{toc}{\gobblefive}}
share|improve this answer
    
Many thanks, works like a charm! –  Anto Jun 12 '11 at 17:03
    
@Stefan Kottwitz: Also works for chapters without *, this is great! –  bkarpuz Mar 25 '13 at 8:27

You can change the value of the tocdepth counter just before the particular sectional unit which must not show in the ToC and then restore the original value:

\documentclass{amsbook}

\begin{document}
\tableofcontents
\addtocontents{toc}{\setcounter{tocdepth}{-1}}
\chapter*{Preface}
\addtocontents{toc}{\setcounter{tocdepth}{2}}

\end{document}
share|improve this answer

Renewal of \addtocontents to gobble it's arguments can also be used to remove its entry into the ToC:

\documentclass{amsbook}
\begin{document}
\tableofcontents
{\renewcommand{\addtocontents}[2]{}
\chapter*{Preface}}% Not included in ToC
\chapter*{Acknowledgements}% Included in ToC
\end{document}

Localization of the \renewcommand allows for it to work only within the group.

share|improve this answer
    
I like this solution, but unfortunately, it doesn't seem to work correctly for subsections (using amsart): it prevents the subsection name from printing at all, not just in ToC. For sections it works fine. I'm using hyperref if it at all matters. –  tomasz Jun 3 at 18:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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