I'm using \tableofcontents. I'd like to hide some, but not all, subsections from the contents, but I don't want to lose the subsection numbering within the document itself. (So I can't use \subsection*{}.) Is there an easy way to do this? If not, could someone provide a clever solution?

In my case, if I want to suppress a single subsection within a section, then I want to suppress all the subsections in that section. I don't need the flexibility to both suppress and incorporate subsections within a single section.

Here's a MWE:




\subsection{To be included in TOC}
\subsection{Also to be included in TOC}

\section{Another Section}
\subsection{Not to be included in TOC}

\section{Another Section Redux}
\subsection{Not to be included in TOC}


Browse other questions tagged or ask your own question.