[Tex/LaTex] change position of Subsubsections and paragraphs and enumerate them

numberingsectioningsections-paragraphs

I am new to TeX. I have a document with subsubsections and paragraphs.

I don't wand the paragraphs inside the block, they should be bevor the block, like the subsubsection header bevor.

The other problem is, that subsubsections and paragraphs don't get enumerated and furthermore they're not listed inside ToC. Is there a possibility to solve this problem without doing it manually?

I use TeXmaker.

Best Answer

To number subsubsections and paragraphs, set the secnumdepth counter to 4 (the paragraph level); to get them into the ToC, change the tocdepth counter also to 4; to change the formatting for the paragraph headings, you can use the titlesec package; a little example:

\documentclass{article}
\usepackage{titlesec}
\usepackage{lipsum}

\titleformat{\paragraph}
  {\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
  {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\begin{document}

\tableofcontents
\section{Test section}
\subsection{Test subsection}
\subsubsection{Test subsubsection}
\lipsum[2]
\paragraph{Test paragraph}
\lipsum[2]

\end{document}

enter image description here

If, for some reason, using titlesec is not an option, you can redefine \paragraph; here's a little example of this approach:

\documentclass{article}
\usepackage{lipsum}

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
  {-3.25ex\@plus -1ex \@minus -.2ex}%
  {1.5ex plus .2ex}%
  {\normalfont\normalsize\bfseries}}
\makeatother

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\begin{document}

\tableofcontents
\section{Test section}
\subsection{Test subsection}
\subsubsection{Test subsubsection}
\lipsum[2]
\paragraph{Test paragraph}
\lipsum[2]

\end{document}
Related Question