Latex section starting from 0.1 not 1.1

latex

I am using document class as report in latex and I dont want to use article. Now the problem is when I use section in my document, it begins with 0.0 0.1 0.2 etc instead I want it as 1.0 Abstract 1.1 Introduction etc and subsection should be 1.0.0 1.0.1 etc and same should be reflected to table of contents.
Anyone please help me with me this. Thank You

Best Answer

There's no real need to use report (or book) if you don't use any \chapters. Here's a way to do it though:

enter image description here

\documentclass{report}

% Subtract 1 from counters that are used
\renewcommand{\thesection}{\thechapter.\number\numexpr\value{section}-1\relax}
\renewcommand{\thesubsection}{\thesection.\number\numexpr\value{subsection}-1\relax}
\renewcommand{\thesubsubsection}{\thesubsection.\number\numexpr\value{subsubsection}-1\relax}
\setcounter{secnumdepth}{3}

\setcounter{chapter}{1}% Not using chapters, but they're used in the counters
\begin{document}

\tableofcontents

\section{First section}
\subsection{First subsection}
\subsubsection{First subsubsection}
\subsubsection{Second subsubsection}
\subsection{Second subsection}

\section{Second section}
\subsection{First subsection}
\subsubsection{First subsubsection}

\end{document}
Related Topic