[Tex/LaTex] \subsubsection in a report style document

reportsectioningtable of contents

I am trying to make a subsubsection in a report document. It does this successfully, however it removes the subsection from the contents section of the document.

Is there anyway to rectify this?

I tried using, for example,

\addcontentsline{toc}{subsubsection}{Photoelectric Effect}

but this does not work. Nothing shows up.

Best Answer

The default depth of the ToC in report is 2 (contained within the counter tocdepth). This means that sectional units up to and including this level will be included in the ToC. Here are the levels based on the standard document classes:

  • \part = -1
  • \chapter = 0
  • \section = 1
  • \subsection = 2
  • \subsubsection = 3
  • \paragraph = 4
  • \subparagraph = 5

If you wish for your subsubsections to be included, add

\setcounter{tocdepth}{3}% Include \subsubsection in ToC

to your document preamble. Here's a MWE showing the resulting output:

enter image description here

\documentclass{report}
\setcounter{tocdepth}{3}% Include \subsubsection in ToC
\begin{document}
\tableofcontents
\chapter{A chapter}
\section{A section}
\subsection{A subsection}
\subsubsection{A subsubsection}
\end{document}

Note that \subsubsections are not numbered by default. If you wish to have them numbered (in the ToC as well), then you also need to include

\setcounter{secnumdepth}{3}% Number \subsubsection

in the preamble also. The default, just like tocdepth is 2. Here's an view with the update:

enter image description here

Related Question