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

share|improve this question
    
Out of curiosity, why do you not use the "short title" optional argument of \subsection? –  Jubobs 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
    
Thanks. I didn't know that. –  Jubobs Apr 21 '13 at 14:00
add comment

1 Answer

up vote 5 down vote accepted

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}

enter image description here

enter image description here

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

  • runhead
  • toc
  • lof
  • lot
share|improve this answer
add comment

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.