I have a document:


That's how I produce the title and ToC:


I have a section


for which I do not want a listing in the ToC and no numbering. The star disables the numbering but still it appears in the ToC:

enter image description here

I googled at lot and read many threads in this forum but didn't find the solution. Other answers suggest that the star would already do the trick but as you can see in my screenshot it doesn't.

  • Did you find this answer to a similar question?
    – alchemist
    Mar 30, 2023 at 23:03
  • One possibility is, immediately before the instruction \section*{Acknowledgment} to issue the instruction \addtocontents{toc}{\makeatletter \def\@toclevel{0} \makeatother}, and after the section is set, restore the previous \@toclevel value. Mar 31, 2023 at 0:14
  • @barbarabeeton So what is the command after \section*{Acknowledgment}? Mar 31, 2023 at 6:31
  • Following \section* insert the line \addtocontents{toc}{\setcounter{secnumdepth}{3}}. But I should add that the answer by @Οὖτις was developed at AMS and should work unless hyperref is used. If hyperref is used, a modification is necessary; see tex.stackexchange.com/a/131719 from which that answer was "stolen". (That answer may render this question a duplicate.) Mar 31, 2023 at 13:35

1 Answer 1


The idea was shamelessly stolen from this answer.

\usepackage{lipsum} % just to have some blindtext

\DeclareRobustCommand{\SkipTocEntry}[4]{} % stolen from https://tex.stackexchange.com/a/131719/237192
\newcommand{\hiddensection}[1]{\addtocontents{toc}{\SkipTocEntry}\section*{#1}} % easier version

    \section{Introduction} % not hidden from toc
    \addtocontents{toc}{\SkipTocEntry} % hidden from toc using original command combination

    \hiddensection{Another hidden section} % hidden from toc using shorthand

    \section{Next visible section}


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .