## Issue

By the reason on layouting, sometimes there is "somestuff" I should write in a heading command such as \section. It is also shown in the table of contents by \addcontentsline used by \section. But "somestuff" should be enabled only on the heading, not the table of contents. How can I solve that?

## Solution

In the document preemble (or style file):
\makeatletter

\makeatother
\section{foobar\dontaddcontentsline{\\}baz}