# Avoiding pdfbookmark with amsbook

I am using the amsbook class. I want a subsection with a title different from the ToC entry as in the example below

\documentclass{amsbook}
\usepackage{hyperref}

\DeclareRobustCommand{\SkipTocEntry}[5]{} %modifica l'indice

\begin{document}

\tableofcontents

\addtocontents{toc}{\SkipTocEntry}
\subsection{title}
\addcontentsline{toc}{subsection}{\tocsubsection{}{\thesubsection}{toc entry}}

\end{document}


However, this produces two pdfbookmarks, since both \subsection and \addcontentsline produce a pdfbookmark. What can I do to get rid of one of them?

• Out of curiosity, why do you not use the "short title" optional argument of \subsection? – jub0bs Apr 21 '13 at 13:57
• With amsbook the short title does not change the entry in the table of content, but only the entry in the page header – user29372 Apr 21 '13 at 13:58

## 1 Answer

You can use a not very known feature of the AMS classes:

\documentclass{amsbook}
\usepackage{hyperref}

\begin{document}

\frontmatter
\tableofcontents

\mainmatter

\chapter{Foo}
\section{\except{toc}{title}\for{toc}{toctitle}}

\end{document}


One can use the following predefined strings as the first argument of \for and \except:

• runhead
• toc
• lof
• lot