[Tex/LaTex] Excluding chapters from ToC in amsbook

amsbooktable of contents

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?

Best Answer

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}}