Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

?

share|improve this question
9  
\section*{SN}\addcontentsline{toc}{section}{SN} –  Gonzalo Medina Sep 6 '12 at 13:04
add comment

1 Answer

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}
share|improve this answer
    
Keep attention, please. I asked about sectiON, not sectionS. I need only specific sections disnumbered. –  klm123 Sep 6 '12 at 20:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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