# How to change space before and after chapter / section etc

I would like to have the following spacing:

\titlespacing*{\chapter}{0pt}{50pt}{30pt}
\titlespacing*{\section}{0pt}{13.2pt}{*0}
\titlespacing*{\subsection}{0pt}{13.2pt}{*0}
\titlespacing*{\subsubsection}{0pt}{13.2pt}{*0}


When I'm using titelspacing I'm getting an error due to KOMA-script. I think I have to do it with the following command:

\RedeclareSectionCommand[
beforeskip=50sp,
afterskip=30\baselineskip]{chapter}

\RedeclareSectionCommands[
beforeskip=0\baselineskip,
afterskip=13.2\baselineskip
]{section,subsection,subsubsection}


But what values do I have to insert and how can they be calculated? When I use it, there is no change in the spacing.

Moreover, I have recognized that the following part of my code template somehow changes the space before the chapter. Which part of it should I keep or should I throw away everything?

\renewcommand*{\chapterheadstartvskip}{\vspace*{215pt}}  % different hack to keep spacing to chapter artwork

\def\mychpstyleintl{%
{\noindent\setlength{\tabcolsep}{0pt}\setlength{\arrayrulewidth}{2pt}%
\begin{tabular}{c}
\\[100pt]
\begin{tabular}{lr}
\begin{tabular}{p{0.6\linewidth}}
\\
\end{tabular}
&
\begin{tabular}{p{0.4\linewidth}}
\rightline{{%
\sffamily%
\fontseries{bx}%
\fontshape{n}%
\selectfont
\thechapter}}
\end{tabular}
\end{tabular}\\[300pt]
\end{tabular}
}}

• Since you're using KOMA-script, there's probably a way to do this without the titlesec package, though I don't know how myself. – Arun Debray Jan 27 '16 at 23:22

Update

KOMA-Script version 3.26 provides afterindent as new option for \RedeclareSectionCommand and \RedeclareSectionCommands, see the documentation or Adjusting spacing around section/subsection titles with koma-script.

So now you can use

\documentclass{scrbook}

\RedeclareSectionCommand[
beforeskip=50pt,% <- changed
afterskip=30pt,
]{chapter}

\RedeclareSectionCommands[
beforeskip=0pt,% <- changed
afterskip=1.2pt,
]{section,subsection,subsubsection}

\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}


to get the same result as in the original answer below.

Do not use package titlesec together with a KOMA-Script class. There is the command \RedeclareSectionCommand to change the space before and after a section title. But use the correct units ...

\RedeclareSectionCommand[
beforeskip=-50pt,
afterskip=30pt
]{chapter}

\RedeclareSectionCommands[
beforeskip=-1sp,
afterskip=1.2pt
]{section,subsection,subsubsection}


Note that the beforeskip must be lower than 0 to remove the par indent for the text directly following after the section command. So you have to use -1sp that is nearly 0pt.

Example:

\documentclass{scrbook}

\RedeclareSectionCommand[
beforeskip=-50pt,
afterskip=30pt
]{chapter}

\RedeclareSectionCommands[
beforeskip=-1sp,
afterskip=1.2pt
]{section,subsection,subsubsection}

\usepackage{blindtext}

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


The line

 \renewcommand*{\chapterheadstartvskip}{\vspace*{215pt}}


has the same effect as

\RedeclareSectionCommand[
beforeskip=-215pt
]{chapter}


So you have to decide if you want 50pt or 215pt space before your chapter title??