Sign up ×
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.

\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

2 Answers 2

up vote 8 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.