0

Writing a text in the article class, there are levels of headers until \subsubsection. However, for the next lower header type, \paragraph needs to be used. If this is a multi-line header, it is not indented for the subsequent lines after the first one.

I would like to indent the second line of the \paragraph header as much as its first line is indented.

I think, ultimately, this would help, but I wasn't able to adapt it to my question

The MWE would look like this:

\documentclass[12pt,oneside]{article}
\usepackage[a4paper, left=2cm, right=2cm, top=3.5cm,bottom=3.5cm]{geometry}


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

\begin{document}
\section{Kapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}
\subsection{Unterkapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}
\subsubsection{Unterunterkapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}
\paragraph{Unterunterunterkapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}


\end{document}
0

1 Answer 1

2

Just declare paragraph to be a display heading like the higher levels:

enter image description here

\documentclass[12pt,oneside]{article}
\usepackage[a4paper, left=2cm, right=2cm, top=3.5cm,bottom=3.5cm]{geometry}

\makeatletter
% display heading
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                    {1.5ex}%
                                    {\normalfont\normalsize\bfseries}}
\makeatother

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

\begin{document}
\section{Kapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}
\subsection{Unterkapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}
\subsubsection{Unterunterkapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}
\paragraph{Unterunterunterkapitel mit sehr langem Text, sodass er in die nächste Zeile ragt}


\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .