1

I have a problem in an scrbook document that I could isolate to this element:

\RedeclareSectionCommands[
beforeskip=1.5em,
afterskip=3pt
]{section}

\RedeclareSectionCommands[
beforeskip=1em,
afterskip=3pt
]{subsection,subsubsection}

With these lines, the paragraphs after the headings are indented. (Which I'd rather avoid since indents look odd with centered headings.) If I comment out these lines, indents appear as desired.

I assume there is something which I simply don't know about, and adding stuff like "indent=false" to the lists above didn't do anything.

Titlesec is not an option since it conflicts with a KOMA parameter I need.

I am using Xetex and Polyglossia (with bidi) is loaded before these lines, in case it makes a difference.

  • 2
    Use beforeskip=-1.5em and beforeskip=-1em. The - means that the first paragraph after the heading should not be indented. – esdd Mar 4 '18 at 19:22
  • Wow, that's quick and easy! Works like a charm - thanks a lot! – Paul Burgh Mar 4 '18 at 19:28
  • To my shame, after knowing what to look for, I also found it in the scrguide. P. 451 in the English version. (2017-08-08) – Paul Burgh Mar 4 '18 at 19:36
3

Update

Since KOMA-Script version 3.26 you can also use the new key afterindent=false¹ and a positive beforeskip to get the desired result.

Example:

\documentclass{scrartcl}

\RedeclareSectionCommands[
  afterindent=false,
  beforeskip=1.5em,
  afterskip=3pt
]{section}

\RedeclareSectionCommands[
  afterindent=false,
  beforeskip=1em,
  afterskip=3pt
]{subsection,subsubsection}

\usepackage{blindtext}% only for dummy text
\begin{document}
\section{Section Title}
\Blindtext[2]
\subsection{Subsection Title}
\Blindtext[2]
\subsubsection{Subsubsection Title}
\Blindtext[2]
\section{Another Section Title}
\Blindtext[2]
\end{document}

The result is the same as in the original answer below.

¹Default setting is afterindent=bysign which results in the same behavior as in the original answer.


Original answer

From the KOMA-Script documentation:

beforeskip (length): The absolute value of the vertical skip before the heading. If the value is negative, then the paragraph indent of the text following the heading is suppressed.

So you have to add a - in front of the beforeskip values.

Example:

\documentclass{scrartcl}

\RedeclareSectionCommands[
  beforeskip=-1.5em,
  afterskip=3pt
]{section}

\RedeclareSectionCommands[
  beforeskip=-1em,
  afterskip=3pt
]{subsection,subsubsection}

\usepackage{blindtext}% only for dummy text
\begin{document}
\section{Section Title}
\Blindtext[2]
\subsection{Subsection Title}
\Blindtext[2]
\subsubsection{Subsubsection Title}
\Blindtext[2]
\section{Another Section Title}
\Blindtext[2]
\end{document}

enter image description here

Additional remark: If you use a negative value for afterskip, you will get a run-in heading.

0

Answered in the comment by @esdd:

Use beforeskip=-1.5em and beforeskip=-1em. The - means that the first paragraph after the heading should not be indented.

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.