\documentclass[12pt,a4paper]{report}
is my document class.
Chapters’ are usually numbered 1
, 2
, 3
, …
Subsections’ numbers are, thus, usually 1.1
, 1.2
, 2.1
, 2.2
, 2.3
, …
Following this pattern, subsubsections’ numbers are usually 1.1.1
, 1.1.2
, …
Now, I have the following problem: There is a chapter with only one subsection. Therefore, I do not want it to be numbered and just wrote:
\subsection*{Title}
\addcontentsline{toc}{subsection}{Title}
Let’s say this is within chapter 2
. If I now use \subsection{Step 1}
, this subsection will be numbered as 2.0.1
. But I do not want it to be numbered that way nor to be numbered as 2.1
. I would prefer it to be numbered as 1
, 2
, …
How can I do that?
Edit: My full code:
\documentclass[12pt,a4paper]{report}
\usepackage[british]{babel}
\usepackage[T3,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\DisableLigatures[f]{encoding = T1}
\microtypecontext{spacing=nonfrench}
\usepackage{geometry}
\geometry{
left=2cm,
right=2cm,
top=2cm,
bottom=2cm,
bindingoffset=0mm
}
\addto\captionsbritish{% Replace "english" with the language you use
\renewcommand{\contentsname}%
{Table of contents}%
}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\begin{document}
\begin{titlepage}
\vspace*{2cm}
\centering
{\scshape\LARGE Titlepage \par}
\end{titlepage}
\cleardoublepage
\pagenumbering{Roman}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}
\chapter{One}
This is chapter one.
\section{One dot one}
This is the first section of chapter one.
\subsection{One dot one dot one}
This is the first subsection of chapter one.
\subsection{One dot one dot two}
This is the second subsection of chapter one.
\subsubsection{One dot one dot two dot one}
This is the first subsection of 1.2.
\subsubsection{One dot one dot two dot two}
This is the second subsection of 1.2.
\section{One dot two}
This is the second section of chapter one.
\chapter{Two}
This is chapter two.
\section{Two dot one}
This is the first section of chapter two.
\subsection*{Subsection of chapter two}
\addcontentsline{toc}{subsection}{Subsection of chapter two}
This is the only subsection of chapter two. It, thus, does not have any numbering. But it contains two subsections which I do not want to be numbered in the way as described above.
\subsubsection{Step 1}
This is the first subsection (= subsubsection) of “Subsection of chapter two”.
\subsubsection{Step 2}
This is the second subsection (= subsubsection) of “Subsection of chapter two”.
\section{Two dot two}
This is the second section of chapter two.
\end{document}
Note that I am also using
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
Now, I also see another aesthetical problem, but I do not necessarily need this to be solved. The Subsection of chapter two
is left aligned with Two dot one
in the table of contents. Maybe it would be better to indent the Subsection of chapter two
a bit so that it is aligned with the beginning of the number of the subsubsections.
\begingroup\refstepcounter{subsection}\renewcommand{\thesubsection}{\arabic{subsection}}\subsection*{Title}\addcontentsline{toc}{subsection}{Title}}\endgroup