[Tex/LaTex] Extending the document structure hierarchy for a report

sectioning

For a 11 pt. report document class which I am using for my thesis, I can only get the following heading levels on a per chapter basis:

\chapter

\section

\subsection

\subsubsection

I am not including the paragraph sections above, as they do not pertain to headings.

My question is: is there a way to extend the above limited hierarchy to include more heading levels? Alternatively, is there a package which provides such an extension?

For example in the following MWE:

\documentclass[11pt]{report}
\begin{document}
\tableofcontents
\part{This is a part}
\chapter{This is a chapter}
\section{This is a section}
\subsection{This is a subsection}
\subsubsection{This is a subsubsection}
\paragraph{This is a paragraph}
\subparagraph{This is a subparagraph}
\end{document}

There is no numbering generated for the paragraph or the subparagraph….so these would not be captured in TOC. I need to create a numbered hierarchy with more depth than that allowed by above. My actual need is to have another level above the \section{} to form a generic heading for the discussion that follows in the section and the subsections. Is there a way to do this in such a way that it is sequentially numbered automatically, and captured in TOC as well?

TIA

Vinod

Best Answer

The next heading levels are \paragraph and \subparagraph they do pertain to headings they are defined using \@startsection almost exactly the same as \section, but at levels 4 and 5.

The source of these commands in report.cls is below:

\newcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries}}
\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries}}
\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries}}
\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                    {-1em}%
                                    {\normalfont\normalsize\bfseries}}
\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
                                       {3.25ex \@plus1ex \@minus .2ex}%
                                       {-1em}%
                                      {\normalfont\normalsize\bfseries}}

enter image description here

\documentclass[11pt]{report}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\begin{document}
\tableofcontents
\part{This is a part}
\chapter{This is a chapter}
\section{This is a section}
\subsection{This is a subsection}
\subsubsection{This is a subsubsection}
\paragraph{This is a paragraph}
\subparagraph{This is a subparagraph}
\end{document}
Related Question