I'm fairly new to LaTeX and need to create a subsubsubsection in a document. After looking around I found that it could be done with titlesec
. I've followed all instructions I've been able to find but it stil doesn't work as I desire.
The subsubsubsection shows up in the table of contents and the counter does work when using the \setcounter{}{}
and it's also reset every subsubsection, but for some reason the counter does not increase with new subsubsubsections nor is thesubsubsubsection
displayed in the table of contents or the text.
Below is the code and the document. In the end the table of contents will probably just display 2 levels, so I don't really care about the looks there at the moment. It is just included to show that the subsubsubsection is recognised in some way.
\documentclass[11pt,twoside,a4paper]{article}
\usepackage{titlesec}
\titleclass{\subsubsubsection}{straight}[\subsubsection]
\newcounter{subsubsubsection}[subsubsection]
\renewcommand{\thesubsubsubsection}{\thesubsubsection.\arabic{subsubsubsection}}
\titlespacing*{\subsubsubsection}{0mm}{0mm}{0mm}[0mm]
\titleformat{\subsubsubsection}{\small}{\thesubsubsubsection}{1em}{}
\begin{document}
\tableofcontents
\section{Section one}
\subsection{Subsection one}
\subsubsection{Subsubsection one}
\subsubsubsection{Subsubsubsection one}
\thesubsubsubsection\\
\setcounter{subsubsubsection}{3}
\thesubsubsubsection
\subsubsection{Subsubsection two}
\subsubsubsection{Subsubsubsection one}
\thesubsubsubsection\\
\end{document}
\setcounter{secnumdepth}{4}
to get it work – koleygr Mar 29 '19 at 21:43\paragraph
and\subparagraph
– David Carlisle Mar 29 '19 at 22:18