I want my LaTeX code to number sections and subsections like (FYI: I'm using article
not chapter
or book
):
0 Introduction (section)
1 A (section)
1.01 A1 (subsection)
1.02 A2 (subsection)
...
1.10 A10
1.11 A11
2 B
However, this is spitting out:
0 Introduction (section)
1 A (section)
1.01 A1 (subsection)
1.02 A2 (subsection)
...
1.010 A10
1.011 A11
2 B
Somehow, my if/else statements aren't kicking in. Anyone knows why?
Code below:
\documentclass[a4paper, 12pt]{article}
\setcounter{section}{-1}
\renewcommand{\thesection}{Module \arabic{section}}
\ifnum\value{subsection}<10
\renewcommand\thesubsection{\thesection.0\arabic{subsection}}
\else
\ifnum\value{subsection}<100
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\fi
\fi
\begin{document}
\title{Notes}
\author{}
\date{}
\maketitle
\section{Introduction}
\section{A}
\subsection{A1}
\subsection{A2}
\subsection{A3}
\subsection{A4}
\subsection{A5}
\subsection{A6}
\subsection{A7}
\subsection{A8}
\subsection{A9}
\subsection{A10}
\subsection{A11}
\section{B}
\subsection{B1}
\subsection{B2}
\section{C}
\section{D}
\section{E}
\end{document}