In my scrreprt
I've changed distance between paragraphs with \setlength{\parskip}{9pt}
. But \parskip
changes also distance between chapter title and the paragraph.
How can I change distance between chapter title and the paragraph?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityThe titlesec
package provides
\titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>}[<right>]
that allows for the spacing around any sectional <command>
(like \part
, \chapter
, \section
, etc.). The former two sectional commands require the additional \titleformat
to be used (see the package documentation). Consequently, altering <after-sep>
should suit your needs.
The following minimal example, altered for <after-sep>
equal to \parskip
, 5\baselineskip
and 150pt
illustrates the changes (from left to right):
\documentclass{scrreprt}
\usepackage{titlesec}% http://ctan.org/pkg/titlesec
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\titleformat{\chapter}{\Huge\bfseries}{\chaptername\ \thechapter}{0pt}{\vskip 20pt\raggedright}%
% Alter <after-sep> in the macro below to vary the separation after the \chapter title.
\titlespacing{\chapter}{0pt}{50pt}{<after-sep>}% \titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>}[<right>]
\begin{document}
\chapter{First chapter}
\lipsum[1-5]
\end{document}
The lipsum
package merely provides some dummy text, Lorem Ipsum style.
\usepackage[noindentafter]{titlesec}
Don't change the \parskip
length, but use the class option parskip=full
. (This will, among other things, remove the now redundant indention of paragraphs.) If you don't want the "additional" parskip immediately after a chapter heading, change the \chapterheadendvskip
macro.
\documentclass[parskip=full]{scrreprt}
\renewcommand*{\chapterheadendvskip}{%
\vspace{0.725\baselineskip plus 0.115\baselineskip minus 0.192\baselineskip}%
}
\usepackage{blindtext}
\begin{document}
\chapter{foo}
\blindtext
\blindtext
\end{document}
(The blindtext package is only used to add some dummy text to the example.)
EDIT: My redefinition of \chapterheadendvskip
resembles the original one, except that I replaced 1.725\baselineskip
with 0.725\baselineskip
. Hopefully, this will exactly offset the space added by parskip=full
.
The \renewcommand
should go into the preamble. It is here only for demonstration inside the text.
\documentclass[parskip]{scrreprt}
\begin{document}
\chapter{foo}
bar
\setlength\parskip{40pt}
\renewcommand*\chapterheadendvskip{\vspace{-\normalbaselineskip}}
\chapter{foo}
bar
baz
\end{document}