[Tex/LaTex] KOMA-Script – paragraph new line without space and parskip

koma-scriptparskipsections-paragraphs

I am currently writing my master thesis with KOMA-Class srcreprt and I am a little bit weird about blank lines in paragraphs, parskips and sectioning vertical space.

As I have learned usage of \\ as shown in the following mwe is some kind of bad style:

\documentclass[a4paper,12pt,chapterprefix=true]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage{blindtext}

\setlength{\parindent}{0em}

\usepackage[onehalfspacing]{setspace}

\RedeclareSectionCommands[
beforeskip=1em,
afterskip=1sp
]{paragraph,subparagraph}

\begin{document}
    \chapter{Ein Kapitel}
    \blindtext

    \paragraph{Ein Absatz}
    \blindtext \\

    \blindtext
\end{document}

It produces the following output:

Bad style example

As I have read, it is better to use \usepackage{parskip}, remove \setlength{\parindent}{0em} and use blank lines instead of \\. This gives a slightly different look, but is almost the same. But pdflatex now throws the following warning:

Usage of package `parskip' together(scrreprt) with a KOMA-Script class
is not recommended.

I figured out, that KOMA-Script offers the parameter parskip which can be used instead of \usepackage{parskip}. But this creates big vertical spaces for the sections. Especially there seems to be no way to reduce the spacing between the \paragraph and the following text:

KOMA-Script parskip

So my question is:
What is the "best" solution to go for? I guess it is the KOMA-Script option parskip. But how can I reduce the vertical Spacings? Especially the afterskip of \paragraph?

I also came across the following: When using \usepackage[onehalfspacing]{setspace} one should DVI=last. I did not really understand this. Also in combination with the scrmanual it confused me more then anything else. Is this something I should take care of?

Thank you for your help!

Best Answer

KOMA-script makes the spacing before, within and after the heading dependent on \baselineskip and parskip, which the packages setspace and parskip increase. A document with 1.5 linespacing, no paragraph indenting, but space between paragraphs, tries to copy Word-layout, and will never look nice, even though it will look better than a Word-document.

Correct syntax to set fontsize in KOMAscript is fontsize=12pt. Also, you may omit the a4paper option, since this is the default for all KOMA-Script classes.

The line

\usepackage[onehalfspacing]{setspace}

also increases the spacing before, within and after the headings. In addition, when you increase the parskip value to have blank line between paragrapgh, this will increase spacing in headers. Use the internal command parskip=true or parskip=half to have blank lines between paragraphs.

In KOMAscript, you may redeclare the sectioning commands individually to revert (decrease) the added space.

Chapter is pretty easy, as you see from my example. To remove additional space after \section, \subsection , \paragraph and \subparagraph commands, use \RedeclareSectioncommand and set runin false and afterskip to a negative value.

enter image description here

\documentclass[fontsize=12pt, chapterprefix=true, parskip=half]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage{blindtext}

%\setlength{\parindent}{0em} % Not needed when 

\usepackage[onehalfspacing]{setspace}

\RedeclareSectionCommand[%
innerskip=0.05\baselineskip,
afterskip=1\baselineskip plus .1\baselineskip minus .12\baselineskip,
beforeskip=-2\baselineskip%
]{chapter}

\RedeclareSectionCommands[
runin=false,              %% NB! Important
afterskip=-0.5\parskip
]{section,subsection}


\RedeclareSectionCommands[
beforeskip=1em,
runin=false,
afterskip=-\parskip
]{paragraph,subparagraph}

\begin{document}
    \chapter{Ein Kapitel}
    \vspace{-0.5\baselineskip}
    \blindtext

\section{Ein Section}
\blindtext

    \paragraph{Ein Absatz}
    \blindtext

    \blindtext
\end{document}