TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to omit a single specific subsection from the table of contents, while keeping it numbered as usual within the main body, and keeping other subsections listed?

(I am using the amsart class.)

share|improve this question
Why would you want to do that? Just curious... – vonbrand Mar 2 '13 at 1:17
up vote 4 down vote accepted

The following code provides the an \addsubsection macro that works similar to \subsection (starred version, optional argument) that uses the \qrr@gobblenexttocentry macro to suppress the content that gets written to the .toc file.

When the hyperref package is used this line consists of five parameters, hence the \ifcsname check.

This won’t work if between the to-be-hidden subsection and its predecessor is not a single character. (But why would one do this?)




%\usepackage{hyperref}% works with or without hyperref

\ifcsname phantomsection\endcsname

\section{section name}
\subsection{I'm here.}
\addsubsection{I'm gone.}
\subsection{I'm there.}


enter image description here

share|improve this answer

In the following code, whatever is put between \ignorethis...\endignorethis is ignored, and \TOCstop with \TOCstart simply write these two commands into the .toc file.






share|improve this answer

Your Answer


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.