3

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

4

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}
| improve this answer | |
  • 1
    The easiest answer is “don't set \parskip either manually or with KoMa-Script methods.” ;-) – egreg Mar 23 '16 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 '16 at 10:49
1

The following works as a quick fix:

\usepackage[parfill]{parskip}
| improve this answer | |
0

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}
| improve this answer | |

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.