# Adding unnumbered sections to TOC

I have many unnumbered sections in my report (more than 100), all created with:

\section*{section name}

I want to find an way to easily add all them to the TOC (specifically to a minitoc), since I use the * to remove the numbering they won't appear in TOC. I found out in minitoc documentation that I should use:

\addcontentsline{toc}{section}{repeat here section title}


However, I don't want to have a duplicated title in every section, or even to change all the involved files to add those already written sections to the TOC. How to add those section's names to the minitoc without using the addcontentsline command? Is it possible?

Thanks in advance!

-
add comment

## 1 Answer

The easiest way to do this is to use \section but to change secnumdepth so that they don't get numbered.

\documentclass{article}
\setcounter{secnumdepth}{0}
\begin{document}
\tableofcontents
\section{ADSF}
\section{Foo}
\end{document}

-
Thanks, it worked like a charm! It's easier to remove the * from each section than duplicate all their names! And I could even use the \setcounter{secnumdepth}{0} after some chapters, keeping the numbering on the previous ones! –  Weslei Feb 21 '11 at 19:33
add comment