LaTeX: Numbering subsubsection and showing it in Table of Contents

By default, the \subsubsection heading has no numbering and it is also not shown in the Table of Contents. To put numbering and to show the subsubsection in table of contents, we need to define the counter value of tocdepth and secnumdepth in the preamble of your LaTeX document using \setcounter.

Here is the sample LaTeX document code:


\documentclass{report}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

% For dummy lipsum text
\usepackage{lipsum}

\begin{document}

\tableofcontents
\clearpage

\chapter{Introduction}
\lipsum[1]

\section{Overview}
\lipsum[2]

\section{My Section}

\subsection{My Sub Section}

\subsubsection{My Sub Sub Section}

\end{document}