6

I want to define the vertical space that is inserted between text paragraphs when there is an empty line in the code. If I use

\setparsizes{0pt}{1.0\baselineskip}{0pt plus 1fil}

or

\setlength{\parskip}{\bigskipamount} 
\setlength{\parindent}{0pt}

then it affects also the vertical space between the headings and other.

Is there an easy solution where I do not have to use something like \mypar with\newcommand{\mypar}{\par\bigskip}.

\documentclass{scrreprt}

%% Method by KOMA-Script
%\setparsizes{0pt}{1.0\baselineskip}{0pt plus 1fil}

%% Other Method
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}

\begin{document}
    \chapter{}
==========================================
    \section{TestSection Large Space}
    \subsection{TestSubsection Large Space}
    \subsubsection{TestSubSubsection Large Space}
Here we have big vertical space between headings because parskip

is inserted. I just want a parskip between text paragraphs.

==========================================

\newcommand{\mypar}{\par\bigskip}
\setlength{\parskip}{0pt}
    \section{TestSection space I want}
    \subsection{TestSubSection space I want}
    \subsubsection{TestSubSubsection space I want}
Here I have the space between the headings that I want. And the space between text-paragraphs that I want. 
\mypar
I wonder if there is an easy way to achieve this. 
I would like to keep using an empty line as par bigskip instead newcommand a new command to achieve that. 
\end{document}

set Vertical Space between headings ans text paragraphs

3 Answers 3

5

Do not set \parskip manually. The default way for KOMA-Script classes is using the parskip option with a value like half, full, full- etc. See the documentation for more details - and see the comment of egreg below.

To set the skip before or after a heading level use

\RedeclareSectionCommand[
  beforeskip=<length or glue>,
  afterskip=<length or glue>
]{<heading level name>}

But the vertical space after a heading is at least \parskip even if you use the smallest positive value afterskip=1sp. If there is a negative value for afterskip a horizontal skip instead a vertical skip is used. See also https://tex.stackexchange.com/a/292202/43317.

If you really want to remove the the space inserted by \parskip at the end of the heading there is a hack

\usepackage{xpatch}
\xapptocmd{\sectionlinesformat}{\vspace*{-\parskip}}{}{}

enter image description here

Code:

\documentclass[parskip=full-]{scrreprt}
\RedeclareSectionCommand[
  beforeskip=3.3\baselineskip,
  afterskip=.725\baselineskip plus .115\baselineskip minus .192\baselineskip
]{chapter}

\RedeclareSectionCommand[
  beforeskip=-2ex plus -1ex minus -.2ex
]{section}

\RedeclareSectionCommands[
  beforeskip=-1.75ex plus -1ex minus -.2ex
]{subsection,subsubsection}

\usepackage{xpatch}
\xapptocmd{\sectionlinesformat}{\vspace*{-\parskip}}{}{}

\usepackage{blindtext}% dummy text
\begin{document}

\chapter{Chapter}
\section{TestSection Large Space}
\subsection{TestSubsection Large Space}
\subsubsection{TestSubSubsection Large Space}
\Blindtext[2]
\Blinddocument
\end{document}
4
  • 1
    The easiest answer is “don't set \parskip either manually or with KoMa-Script methods.” ;-)
    – egreg
    Mar 23, 2016 at 18:51
  • Thank you for the hack. That only was the answer to my question.But your long answer might help others. Thats great.
    – Tobias
    Mar 24, 2016 at 10:49
  • Is there a way to reduce the parskip below half that your described solution still works? I only found tex.stackexchange.com/questions/161254/… which seems like a manual setting which isn't recommend.
    – mhellmeier
    Mar 14, 2021 at 18:24
  • @mhellmeier \setparsizes is descriped in the KOMA-Script documentation. You can use it, if you need a smaller parskip than half.
    – esdd
    Mar 15, 2021 at 14:20
1

You can just modify \parskip within a group to restrict there effect inside this group

\documentclass{scrreprt}

%% Method by KOMA-Script
%\setparsizes{0pt}{1.0\baselineskip}{0pt plus 1fil}

%% Other Method
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}

\begin{document}

{\parskip=0pt 
    \chapter{}
==========================================
    \section{TestSection Large Space}
    \subsection{TestSubsection Large Space}
    \subsubsection{TestSubSubsection Large Space}
}

Here we have big vertical space between headings because parskip

is inserted. I just want a parskip between text paragraphs.

==========================================

{\parskip=0pt
    \section{TestSection space I want}
    \subsection{TestSubSection space I want}
    \subsubsection{TestSubSubsection space I want}
}    
Here I have the space between the headings that I want. And the space between text-paragraphs that I want. 

I wonder if there is an easy way to achieve this. 
I would like to keep using an empty line as par bigskip instead newcommand a new command to achieve that. 
\end{document}
1

The following works as a quick fix:

\usepackage[parfill]{parskip}
1
  • Nice pragmetic solution which causes some side effects: It will reduce the cell spacing in your table cells as an example.
    – mhellmeier
    Mar 14, 2021 at 18:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .