[Tex/LaTex] Reducing chapter and section spacing for scrbook


I'm using scrbook document class and using chapters and sections. The spacing between chapters and sections is quite large, too large for my taste (before and after the chapter and section). So my question is how can this spacing be reduced? (saw a few variants for non-KOMA document classes but those don't seem to work for this class).




After applying the changes that Werner mentioned I have the following phenomenon (the code excerpts and the screenshot are to show what I tried to describe in the comments):

"Species" is a chapter, "Applying" is a section, Advantages and Disadvantages are subsections each.

Code excerpt for the disadvantages (1 enter is before and after the subsection):

all perception rolls.


\noindent\textbf{Bestial psychology and territorial instincts}: Dragons despite their intellect are part beast. This means that they have strong territo

Code excerpt for the chapter part:

\chapter{Species template}

\section{Applying the template}


\noindent\textbf{Dragons bodies}: +5.....

enter image description here

Best Answer

In scrbook/scrreport, the skip before/at the end of a chapter is given by

    \@plus .115\baselineskip \@minus .192\baselineskip}%

Adjust them to your liking. In terms of \sections, the KOMA-script bundle still uses \@startsection (see Where can I find help files or documentation for commands like \@startsection for LaTeX?). Here's the definition for \section:

  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
  {\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
    \setlength{\parfillskip}{\z@ plus 1fil}\fi

Adjust the two rubber lengths (arguments #4 and #5 to \@startsection) to suit your needs.

Here is a minimal example where the mentioned lengths have been adjusted:

enter image description here

% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\section}{-3.5ex \@plus -1ex \@minus -.2ex}{-\baselineskip}{}{}
\patchcmd{\section}{2.3ex \@plus .2ex}{.5\baselineskip}{}{}



Of course the above only references changes to \chapter and \section. You'd have to adjust lower-level sectional units in an analogous way. For example, here's an option to remove even more spacing around the sectional units, this time including that of \subsection:

% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\section}{-3.5ex \@plus -1ex \@minus -.2ex}{-\z@}{}{}
\patchcmd{\section}{2.3ex \@plus .2ex}{1sp}{}{}
\patchcmd{\subsection}{-3.25ex\@plus -1ex \@minus -.2ex}{-\z@}{}{}
\patchcmd{\subsection}{1.5ex \@plus .2ex}{1sp}{}{}