[Tex/LaTex] How to remove “zero” preceding section number

numberingsectioningsections-paragraphstable of contents


\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

Best Answer

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.