[Tex/LaTex] Create new \subsubsubsection in custom class file

documentclass-writingsectioningsections-paragraphstable of contents

I've copied the default article.cls file and made some very minor alterations mainly to the \listoftables and \listoffigures titles, which is not connected to my question.

I'd like to add 1 extra level in between \subsubsection and \paragraph. This new section would push down \paragraph and \subparagraph down one level to make room for the new \subsubsubsection to be insert at level 4.

Microsoft Word comes with 9 headings which aren't inline headings, whilst I don't require that many at the moment, I do require the first 4 to not be inline headings and additional two headings as paragraph inline heading should be sufficient for my needs.

This section would appear fairly similar to \subsubsection in that it would be a heading on it's own line and not how the \paragraph command works with having the content on the same line as the heading.

I'm not using \paragraph or \subparagraph in my report for that reason. But am needing a 1.1.1.1 Section in my report and on my contents page.

There is a solution on this site that looked like what I was trying to achieve, but I was unable to get it to work from within my custom class file.

Best Answer

enter image description here

Just use \paragraph but style paragraph to be a display rather than a run-in header. That is far easier than implementing a whole new section level:

\documentclass{article}

\makeatletter
%same as \subsubsection but level 4
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries}}
% number \paragraph
\setcounter{secnumdepth}{4}

\makeatother

\begin{document}

\section{zzz}
\subsection{zzz}
\subsubsection{zzz}
\paragraph{zzz}
aaa
\end{document}