
Ich möchte den vertikalen Abstand definieren, der zwischen Textabsätzen eingefügt wird, wenn der Code eine leere Zeile enthält. Wenn ich
\setparsizes{0pt}{1.0\baselineskip}{0pt plus 1fil}
oder
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}
dann wirkt es sich auch auf den vertikalen Abstand zwischen den Überschriften und Sonstiges aus.
\mypar
Gibt es eine einfache Lösung, bei der ich nicht so etwas wie with verwenden muss \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}
Antwort1
Nicht \parskip
manuell einstellen. Die Standardeinstellung für KOMA-Script-Klassen ist die Verwendung der parskip
Option mit einem Wert wie half
, full
, full-
usw. Weitere Einzelheiten finden Sie in der Dokumentation - und im Kommentar vonegregunten.
Um den Sprung vor oder nach einer Überschriftenebene einzustellen, verwenden Sie
\RedeclareSectionCommand[
beforeskip=<length or glue>,
afterskip=<length or glue>
]{<heading level name>}
Der vertikale Abstand nach einer Überschrift beträgt jedoch mindestens , \parskip
auch wenn Sie den kleinsten positiven Wert verwenden afterskip=1sp
. Wenn für einen horizontalen Sprung ein negativer Wert vorhanden ist, afterskip
wird stattdessen ein vertikaler Sprung verwendet. Siehe auchhttps://tex.stackexchange.com/a/292202/43317.
Wenn Sie das Leerzeichen \parskip
am Ende der Überschrift wirklich entfernen möchten, gibt es einen Hack
\usepackage{xpatch}
\xapptocmd{\sectionlinesformat}{\vspace*{-\parskip}}{}{}
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}
Antwort2
Sie können Änderungen einfach \parskip
innerhalb einer Gruppe vornehmen, um deren Wirkung innerhalb dieser Gruppe einzuschränken.
\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}
Antwort3
Folgendes funktioniert als schnelle Lösung:
\usepackage[parfill]{parskip}