6

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).

\documentclass[11pt,a4paper,BCOR10mm,DIV11,toc=listof,parskip=full]{scrbook}

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{booktabs}            
\usepackage{multicol}      

\twocolumn
\raggedright
\Chapter{chap1}
\Section{sec1}
blaahblah
\Section{sec2}
Blah
\Chapter{chap2}
BlahBlah
\Chapter{chap3}
Blah

Edit: 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.

\subsection{Disadvantages}

\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}

\subsection{Advantages}

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

enter image description here

3

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

\renewcommand*{\chapterheadstartvskip}{%
  \vspace*{2.3\baselineskip}%
}%
\renewcommand*{\chapterheadendvskip}{%
  \vspace{1.725\baselineskip
    \@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:

\newcommand\section{%
  \@startsection{section}{\sectionnumdepth}{\z@}%
  {-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
    \raggedsection\normalfont\sectfont\nobreak\size@section}%
}

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

\documentclass[11pt,a4paper,BCOR10mm,DIV11,toc=listof,parskip=full,twocolumn]{scrbook}
\usepackage{etoolbox}
\makeatletter
\renewcommand{\chapterheadstartvskip}{\vspace{0pt}}
\renewcommand{\chapterheadendvskip}{\vspace{\baselineskip}}
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\section}{-3.5ex \@plus -1ex \@minus -.2ex}{-\baselineskip}{}{}
\patchcmd{\section}{2.3ex \@plus .2ex}{.5\baselineskip}{}{}
\makeatother
\begin{document}

\raggedright
\chapter{chap1}
\section{sec1}
blaahblah
\section{sec2}
Blah
\chapter{chap2}
BlahBlah
\chapter{chap3}
Blah

\end{document}

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:

\usepackage{etoolbox}
\makeatletter
\renewcommand{\chapterheadstartvskip}{\vspace{0pt}}
\renewcommand{\chapterheadendvskip}{\vspace{\baselineskip}}
% \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}{}{}
\patchcmd{\@xsect}{\ignorespaces}{\vspace*{-.5\baselineskip}\ignorespaces}{}{}
\makeatother
  • I tried around a bit now. The chapter is clear so far, but for section and subsection I'm not 100% getting it how to modify it so that it is only half a normal line before and after it – Thomas Jul 22 '14 at 20:32
  • @ThomasE.: Try the following three patches: \patchcmd{\section}{-3.5ex \@plus -1ex \@minus -.2ex}{-\z@}{}{} \patchcmd{\section}{2.3ex \@plus .2ex}{1sp}{}{} \patchcmd{\@xsect}{\ignorespaces}{\vspace*{-.5\baselineskip}\ignorespaces}{}{}. – Werner Jul 23 '14 at 1:56
  • taht works for chapter (2x enter), section(2x enter), subsection(2x enter) being under each other nicely. strangely if I put a \noindent\textbf, 2x enter, \subsection{Disadvantages}, 2x enter it still has the same distance as before – Thomas Jul 23 '14 at 4:25
  • do you have any idea there @Werner? – Thomas Jul 23 '14 at 19:48
  • @ThomasE.: Could you update your question with an edit showing the current problem? – Werner Jul 23 '14 at 19:48

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.