2

I'm trying to get the subsubsection into the table of contents, but I can't get the numbering on the side of the subsubsection title.

enter image description here

\documentclass{toptesi}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

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

\begin{document}
\tableofcontents
\chapter{chapter 1}
\section{section 1}
\subsection{subsection 1}
\subsubsection{subsubsection 1}
\end{document}
3
  • I can't compile your document, even with the .sty that you provided, since \documentclass expects toptesi.cls. Can you please provide the appropriate setup to replicate your current issue?
    – Werner
    Commented Mar 2, 2018 at 17:27
  • @Werner I've edited the post with the .cls file Commented Mar 2, 2018 at 19:00
  • I see, you're using the standard toptesi bundle. In that regard, since it's on CTAN, there's actually no need to post the links.
    – Werner
    Commented Mar 2, 2018 at 19:21

1 Answer 1

2

The toptesi class uses within \AtBeginDocument \frontmatter, the latter restricting to secnumdepth to 2. You need an explicit

\mainmatter\setcounter{secnumdepth}{3} after that.

\documentclass{toptesi}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

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

\usepackage{blindtext}

\begin{document}
\tableofcontents

\mainmatter
\setcounter{secnumdepth}{4}

\chapter{chapter 1}
\section{section 1}
\subsection{subsection 1}
\subsubsection{subsubsection 1}

\blindtext
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .