4

How do I rid of number of a section in the way that it still would be in the table of contents.

If I use

...
\section{SN1}
...

then I see this section name in table of contents as

 1 SN1
 2 SN2
 3 SN3
 ...

If I use

\section*{SN}

I don't see it in the content:

 1 SN2
 2 SN3

How to get in content just

 SN1
 1 SN2
 2 SN3

?

  • 10
    \section*{SN}\addcontentsline{toc}{section}{SN} – Gonzalo Medina Sep 6 '12 at 13:04
  • Bright and working solution found here – A.Ametov May 16 at 22:33
4

In case you want to suppress the numbering of sections (and subsections, etc) globally in the body of the document but still have them show up in the Table of Contents automatically, the easiest way to do so is to issue the command

\setcounter{secnumdepth}{0}

in the document's preamble. (The depth of a section-level command is "1", that of a subsection is "2", etc.) The following MWE illustrates how this would work; the two section-level and two subsection-level headers are unnumbered in the body of the text but show up automatically in the ToC:

\documentclass[a4paper]{article}
\setcounter{secnumdepth}{0}
\begin{document}
\tableofcontents

\section{Hello}
\subsection{Good morning}
\subsection{Good evening}
\section{Good-bye}
\end{document}
  • Keep attention, please. I asked about sectiON, not sectionS. I need only specific sections disnumbered. – klm123 Sep 6 '12 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.