TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

\section{Section One}
\subsection{Subsection One}
\subsection{Subsection Two}
\section{Section Two}
\subsection{Subsection One}
\subsection{Subsection Two}

Now it has a preceding zero in front of the section numbers. How can I get rid of zero. For reference I am attaching an image as well. enter image description here

share|improve this question
up vote 9 down vote accepted

this will get rid of the zero and period in both the toc and the body of the document:

  \ifnum\c@chapter<1 \@arabic\c@section
  \else \thechapter.\@arabic\c@section

this assumes that the chapter counter is already properly defined, as it is in the book and report classes.

share|improve this answer
It worked great, thanks – Aku Feb 20 '12 at 17:01

Add this to your preamble:


This line above removes the chapter number from the section number. Unchanged, this would look something like


The changed output:

screenshot 1


screenshot 2

share|improve this answer
it worked as well, thank you – Aku Feb 20 '12 at 17:01

Your Answer


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.