28

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?

3 Answers 3

17

The 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}

Different spacings from chapter title using titlesec

The lipsum package merely provides some dummy text, Lorem Ipsum style.

2
  • This is great but, as you can see in your example, this has erroneously added horizontal space before the first paragraph of text. How do I get rid of that? May 2, 2021 at 12:53
  • @TamaMcGlinn: See Cancelling first-line indents after section titles: \usepackage[noindentafter]{titlesec}
    – Werner
    May 2, 2021 at 17:20
13

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.

7

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}

You must log in to answer this question.

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