If you want to include \subsubsection
in the numbering, you have to change the depth of numbering this way:
\setcounter{secnumdepth}{3}
in the preamble, and... that's it, since 3 is the level of the subsubsection.
The subsubsubsection
counter is reset at subsubsection
. In your example the subsubsection
counter never changed. (It remains always at zero.)
(More precisely, the reset command is only triggered when \stepcounter
or \refstepcounter
is called on the parent counter. As no \subsubsection
command was ever issued, the counter is never step-increased, and the reset command never called.)
You can see the problem even without defining your own new section level. If you compile the following MWE:
\documentclass{article}
\begin{document}
\section{Test}
\subsubsection{test2}
\section{test3}
\subsubsection{test4}
\subsection{test 5}
\subsubsection{test6}
\end{document}
You will see that test2
is labeled 1.0.1
and test4
is labeled 2.0.2
. But once you increment the subsection
counter (when I put in test 5
), the counter now behaves properly: test6
is 2.1.1
.
This doesn't happen just with sectioning commands, by the way. If you use the \numberwithin
command from the AMS packages to set the level for equations, or use the amsthm
commands to tie theorem numbering to section levels, you should never tie the resetting to a counter that cannot be reliably incremented.
A possible work-around is given here: in your preamble add
\makeatletter
\@addtoreset{subsubsubsection}{section}
\@addtoreset{subsubsubsection}{subsection}
\makeatother
this will make increasing sections and subsections both also trigger the reset code.
Best Answer
\subsubsubsection
doesn't exist but, instead, you can use\paragraph
and\subparagraph
, which will generate something like 1.1.1.1 and 1.1.1.1.1. .To include this in your table of contents, you have to declare
\setcounter{tocdepth}{4}
and\setcounter{secnumdepth}{4}
. For subparagraph, use{5}
.There are 7 levels of sections (depending on the document)
\part{part}
\chapter{chapter}
\section{section}
\subsection{subsection}
\subsubsection{subsubsection}
\paragraph{paragraph}
\subparagraph{subparagraph}
\part
and\chapter
are only available inreport
andbook
.