# Hide subsection numbering in body, but not in TOC

Is there an easy way to use numbering for subsections in the TOC, but to hide the subsection numbers in the document body?

I could use \subsection*{Title} but then the entries are gone from the TOC.

• Does it make sense? I mean, what's the purpose of a number in the TOC when the number doesn't really exist? – egreg Dec 3 '13 at 17:28
• The TOC looks nicer with the numbers, the hierarchy is clearer. But in the body itself, it can be distracting when there are many, but short subsections. – Danilo Bargen Dec 3 '13 at 17:35
• @DaniloBargen You run the risk of confusing your reader, though. Proceed with caution. – jub0bs Dec 3 '13 at 18:16

Assuming that you have a good reason to do that, here's how you can do.

Put, just after each unnumbered subsection, the lines

\stepcounter{subsection}


where <name> is the name of the subsection.

Note that I've used \stepcounter instead of \refstepcounter voluntarily, hoping you don't have to reference these subsections...

MWE:

\documentclass{article}

\usepackage{lipsum}

\begin{document}

\tableofcontents

\section{Testing subsections}

\subsection*{First unnumbered subsection}
\stepcounter{subsection}
\lipsum[1-2]

\subsection{Numbered subsection}
\lipsum[1]

\subsection*{Second unnumbered subsection}
\stepcounter{subsection}