# Latex Koma instead of titlesec for section spacing

As suggested by esdd I post this as a new question. Original post: Latex KOMA and titlesec incompatible again.

I have some section spacing settings in titlesec, which I would like to "convert" to koma script. I use scrbook as document class. My options are as follows:

\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{2ex}{1ex}
\titlespacing{\subsection}{0pt}{1ex}{0ex}
\titlespacing{\subsubsection}{0pt}{0.5ex}{0ex}


Thanks to anyone who can help me.

Regards,

Simon

Use \RedeclareSectionCommand to change the settings for a single section level or \RedeclareSectionCommands to change the settings for a list of section levels.

\documentclass{scrbook}
\usepackage{blindtext}

\RedeclareSectionCommand[
afterindent=true% indent the paragraph following the section heading
]{section}

\RedeclareSectionCommands[
afterindent=true,
afterskip=0ex,
]{subsection,subsubsection}

\RedeclareSectionCommand[beforeskip=1ex]{subsection}
\RedeclareSectionCommand[beforeskip=.5ex]{subsubsection}
\RedeclareSectionCommand[beforeskip=1ex]{paragraph}

\begin{document}
\blinddocument
\end{document}


Use the \DeclareSectionCommand, see page 474 in the manual:

\DeclareSectionCommand[%
beforeskip=3.25ex plus 1ex minus .2ex,
afterskip=-1em,
]{section}