0

I am trying to reproduce the behavior described in this question in a scrartcl document class using KOMA script.

My understanding is this is the default behavior for the article document class. However, KOMA script's default setting forces an indent on all paragraphs, including the first paragraph of a new section.

1
  • KOMA-Script does not force the indentation of the first paragraph after a section heading.. Did you change beforeskip for sections to a positive value?. – esdd Feb 26 at 0:06
1

The suppression of the indentation of the paragraph following the heading is the default behaviour of the KOMA-Script classes, too.

Example:

\documentclass{scrartcl}
\usepackage{blindtext}% only for dummy text
\begin{document}
\section{Foo}
\Blindtext[2]
\section{Bar}
\Blindtext[2]
\end{document}

enter image description here

scrartcl declares section with the following code:

\DeclareSectionCommand[%
  style=section,%
  level=1,%
  indent=\z@,%
  beforeskip=-3.5ex \@plus -1ex \@minus -.2ex,%
  afterskip=2.3ex \@plus.2ex,%
  tocstyle=section,%
  tocindent=0pt,%
  tocnumwidth=1.5em%
]{section}

Note, afterindent is not set explicitely. So the default afterindent=bysign is active and the negative sign of beforeskip supresses the indentation of the first paragraph following the heading. The vertical skip before the heading is still positive.

If you want to change the value of beforeskip, you have to use the minus sign for its length , eg

\documentclass{scrartcl}
\usepackage{blindtext}% only for dummy text
\RedeclareSectionCommand[
  beforeskip=-10ex plus -1ex minus -.2ex
]{section}
\begin{document}
\section{Foo}
\Blindtext[2]
\section{Bar}
\Blindtext[2]
\end{document}

Alternatively you can use a positive value for beforeskip and change afterindent to false:

\documentclass{scrartcl}
\usepackage{blindtext}% only for dummy text
\RedeclareSectionCommand[
  beforeskip=10ex plus 1ex minus .2ex,
  afterindent=false
]{section}
\begin{document}
\section{Foo}
\Blindtext[2]
\section{Bar}
\Blindtext[2]
\end{document}

Both results in

enter image description here


Warning: If you only change afterindent to true or false without changing beforeskip to a positive value, the section heading could overlap the text before it:

enter image description here

Code:

\documentclass{scrartcl}
\usepackage{blindtext}% only for dummy text
\RedeclareSectionCommand[
  afterindent=false
]{section}
\begin{document}
\section{Foo}
\Blindtext[2]
\section{Bar}
\Blindtext[2]
\end{document}
1

It didn't take me long to find the answer: Setting afterindent=false in \RedeclareSectionCommand does the trick.

1
  • 3
    If you set afterindent=falsewithout changing beforeskip to a positive value, the heading could overlap the text before it. – esdd Feb 26 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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