# Adding the fourth level of section

I am using overleaf and I want to go to the fourth section. I am using \chapter, \section \subsection and \subsubsection. I want the (1.1.1.1 desired) mark. I tried using \paragraph but it is not showing up as a numbered heading in the table of content.

1. Text

1.1. Text

1.1.1. Text

1.1.1.1 Desired?

• Welcome to TeX SX! You can define a number for \paragraphs using titlesec. – Bernard Nov 19 '19 at 11:18
• Numbered paragraph both in text and table of contents are achieved with \setcounter{secnumdepth}{4}\setcounter{tocdepth}{4}. – campa Nov 19 '19 at 12:23

## 1 Answer

Once I wanted to do exactly the same thing, and information about that is all over the internet in small bits. So this was my method:

\documentclass{report}
\usepackage{titlesec}

\begin{document}
\titleclass{\subsubsubsection}{straight}[\subsection]

\newcounter{subsubsubsection}[subsubsection]
\renewcommand\thesubsubsubsection{\thesubsubsection.\arabic{subsubsubsection}}

\titleformat{\subsubsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsubsection}{1em}{}
\titlespacing*{\subsubsubsection}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\makeatletter
\def\toclevel@subsubsubsection{4}
\def\l@subsubsubsection{\@dottedtocline{4}{7em}{4em}}
\makeatother
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\chapter{This is a chapter}
\section{This is a section}
\subsection{This is a subsection}
\subsubsection{This is a subsubsection}
\subsubsubsection{This is a subsubsubsection}
\end{document}


• Thank you so much. But can I configure this to keep subsubsection unnumbered and still use subsubsubsection to achieve 1.1.1.1? – Staph Nov 19 '19 at 11:58
• Oh and how to remove the subsubsection to not come in table of content as well. I just need the this is subsubsubsection to appear in my table of content and subsubsection to remain how it is by default. I am really grateful for your help already – Staph Nov 20 '19 at 9:19