Is it possible just to generate a table of contents based on sections in asterisk mode, i.e., \section*? I basically just want the table of contents without section numbers. Like a list of headings and their associated pages.

The following doesn't generate a ToC:




\subsection*{Section 1}

\subsection*{Section 2}


4 Answers 4


You don't have numbered sections, do you? In this case the simplest arrangement is

\setcounter{secnumdepth}{0} % sections are level 1




No sectional unit below \section will be numbered, but sections and subsections will go anyway in the table of contents (as this depends on the value of the tocdepth counter, default 2).

  • 1
    Suppose I don't want numbering for headings at any level, how would I modify your solution? Keep in mind I do still want a table of contents, just without heading numbering...
    – ptrcao
    Commented Oct 2, 2011 at 12:40
  • 15
    \setcounter{secnumdepth}{-2} will remove the numbering also for parts (and all levels below).
    – egreg
    Commented Oct 2, 2011 at 12:41
  • 1
    This is a good solution - very minimal and unobtrusive, without any compromise. :)
    – ptrcao
    Commented Oct 3, 2011 at 10:03
  • 1
    For some reason this is not working for me. I still get the numbered sections and subsections. Could it be due to the fact that I use a template and a master file including chapter files? Do I have to insert \setcounter{secnumdepth}{0} in a special place? Commented Jan 22, 2014 at 18:26
  • 2
    @FrankEjbyPoulsen Try just after \begin{document}
    – egreg
    Commented Jan 22, 2014 at 20:56

The following is a manual way of adding entries to the table of contents by means of \addcontentsline:




\section*{Section 1}
\addcontentsline{toc}{section}{\protect\numberline{}Section 1}%
\section*{Section 2}
\addcontentsline{toc}{section}{\protect\numberline{}Section 2}%


Starred sections in ToC

The reason for using \numberline{} is to allow for the traditional numbered space in the table of contents. If you're not interested in this numeric alignment, then you can drop the \protect\numberline{}.

  • 4
    Thanks! The advantage of this approach is that it allows combining sections and section*s in a straightforward manner
    – Wouter
    Commented Jun 5, 2020 at 15:15

Adapting DevSolar's answer from this question (clearing out the definition of \thesection), and assuming you don't really care if you use \section*, you just want to remove numbers from the headings and ToC entries:

enter image description here

\section{A Section}
\section{Another Section}
  • Thanks Mike - this seems like a fairly succinct solution - and moreover it works, though would you mind explaining what is happening? I don't understand why/how this works.
    – ptrcao
    Commented Oct 2, 2011 at 4:37
  • 4
    In many cases, \theX is a macro that prints the number of the current document division (where 'X' is chapter, section, subsection, etc.) Clearing it out prevents it from being printed. However, on further examination, this doesn't suppress the space between the number and the division title, and the section headings get indented more than I'd like. So I'd go with egreg's version instead. Commented Oct 3, 2011 at 3:23
  • This is a nice option. However, in my case, it leaves a blank space where there was supposed to be the number of the section, subsection etc. How do I get rid of that? Commented Jan 22, 2014 at 17:54
  • As I'd indicated, I'd go with egreg's solution over mine. Commented Jan 23, 2014 at 17:52

what about using


instead of


  • 10
    Welcome to TeX.SX! Can you extend your answer a bit to explain what is the difference between the two commands? Also, the OP uses the article class, and I think \addsec is only available in the KOMA classes.
    – Tiuri
    Commented Nov 17, 2019 at 15:23
  • 1
    With the added info that \addsec needs a KOMA script class and ideally a short example document demonstrating its use and effects (based on the MWE in the question) this could be a great answer.
    – moewe
    Commented Nov 17, 2019 at 20:12

You must log in to answer this question.

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