Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How many nested subsections can I create using article class in LaTeX? E.g. for first level I use \subsection, for second level I use \subsubsection. My question is how deep can I go?

share|improve this question
3  
More than the level it starts to make no sense to human readers. –  percusse Mar 4 at 17:42

2 Answers 2

up vote 6 down vote accepted

By default the article supports only the

  • \part
  • \section
  • \subsection
  • \subsubsection

as well as \paragraph and \subparagraph. It is possible to add additional sections but you should check if it's not easier to switch the class. Here's an example how it may look like (taken from my blog post, uses the KomaScript scrartcl class):

\documentclass{scrartcl}
\setlength{\parindent}{0pt}

\makeatletter
\renewcommand*\l@paragraph{\@dottedtocline{5}{7.0em}{4.1em}}
\renewcommand*\l@subparagraph{\@dottedtocline{6}{10em}{5em}}
\makeatother

\usepackage{titlesec}
\usepackage{titletoc}

\titlecontents{subsubsubsection}[9em]{}{\contentslabel{3.9em}}%
{\hspace*{-1.2em}}{\titlerule*[0.675pc]{.}\contentspage}

\makeatletter
\newcounter{subsubsubsection}[subsubsection]
\setcounter{subsubsubsection}{1}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\renewcommand{\thesubsubsubsection}{\thesubsubsection.\@arabic\c@subsubsubsection}

\titleclass{\subsubsubsection}{straight}[\subsubsection]
\titleformat{\subsubsubsection}{\sf}{\thetitle}{0.9em}{}[]                       
\titlespacing{\subsubsubsection}{0pt}{3.25ex plus 1ex minus 0.2ex}{1.5ex plus 0.2ex}

\renewcommand\paragraph{\@startsection{paragraph}{5}%
    {\z@}%
    {3.25ex \@plus1ex \@minus.2ex}%
    {-1em}%
    {\normalfont\normalsize\bfseries}%
}
\renewcommand\subparagraph{\@startsection{subparagraph}{6}%
    {\parindent}%
    {3.25ex \@plus1ex \@minus .2ex}%
    {-1em}%
    {\normalfont\normalsize\bfseries}%
}
\makeatother

\usepackage{hyperref}
\makeatletter
\newcommand*{\toclevel@subsubsubsection}{4}%
\renewcommand*{\toclevel@paragraph}{5}%
\renewcommand*{\toclevel@subparagraph}{6}%
\makeatother

\begin{document}

\tableofcontents

\section{Hier die Section}
\subsection{Hier die eine Sub-Section}
\subsubsection{Hier die SubSub-Section}
\subsubsubsection{Hier die neue SubSubSub-Section} Hallo Welt
\paragraph{Hier der Paragraph} Hallo Welt
\subparagraph{Hier der Sub-Paragraph} Hallo Welt

\section{Hier die Section}
\subsection{Hier die eine Sub-Section}
\subsubsection{Hier die SubSub-Section}
\subsubsubsection{Hier die neue SubSubSub-Section} Hallo Welt
\paragraph{Hier der Paragraph} Hallo Welt
\subparagraph{Hier der Sub-Paragraph} Hallo Welt
\end{document}

As you see lots of definitions needed to be made and I am not 100\% sure I got them all.

share|improve this answer

The default article provides the following levels of sectioning

  • \part (level 0)
  • \section (level 1)
  • \subsection (level 2)
  • \subsubsection (level 3)
  • \paragraph (level 4)
  • \subparagraph (level 5)

If you wish to add levels below this, see How to add an extra level of sections with headings below \subsubsection.

Note that more levels are rarely required, since one can always default to lists to provide nested/deeper levels of enumeration.

share|improve this answer
    
I believe part and chapter are book only? –  vonbrand Mar 5 at 2:52
    
@vonbrand: \chapter is book and report only, but \part is also available in article. –  Werner Mar 5 at 5:18
    
thanks a lot for the reply and for your link to the post. The problem I had using that approach was that paragraph was not showing in ToC –  MSB Mar 7 at 0:51
    
@user3166042: For this you need to adjust tocdepth. See How to show \subsections and \subsubsections in ToC? –  Werner Mar 7 at 2:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.