3

Consider this MWE:

\documentclass[12pt%,oneside%
]{book}
\usepackage{setspace}
\setstretch{1.2}
\usepackage{lipsum}
\begin{document}
%\raggedbottom
\chapter{ABC}
See how this chapter heading is not in the same place as the following one? Try the oneside option of the book class, and the problem disappears!
\chapter{ABC}
\lipsum[1-3]
\end{document}

You'll note the positions of the first and second chapter headings are different. This is quite annoying when switching from one doublepage to another after a very short chapter.

How can I fix this without using \raggedbottom or oneside?

1 Answer 1

3

It's a bug, er, feature in the book class, where \par is used for separating “Chapter 1” from the title, but \parskip is not set to zero. The usual setting for \parskip is 0pt plus 1pt, in order for TeX to be able to obey \flushbottom.

Just correct the bad behavior:

\documentclass[
  12pt,
  openany,% just to be able to see both chapter heads side by side
]{book}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makechapterhead}
  {\parindent}
  {\parskip=\z@skip\parindent}
  {}{}
\makeatother

\usepackage{setspace}
\setstretch{1.2}
\usepackage{lipsum}

\begin{document}
\chapter{ABC}

See how this chapter heading is not in the same place as the following one? Try the oneside
option of the book class, and the problem disappears!

\chapter{ABC}
\lipsum[1-3]
\end{document}

The setting \parskip=\z@skip is local, because LaTeX does the printing of the chapter head in a group, so it won't propagate to the text typesetting.

3
  • Thanks! I use titlesec with \titleformat{\chapter}[hang], and so I had to replace \@makechapterhead by \ttlh@hang (I guess that stands for title header hanging). Working great so far!
    – bers
    Aug 5, 2014 at 12:36
  • Since you use titlesec did you think of setting the option rigidchapters rather than the default rubberchapters?
    – Bernard
    Aug 5, 2014 at 13:19
  • Actually, I didn't know about it :) It looks more difficult to apply in my case, though, because my chapter headings have a variable number of lines and the text starts on the same page. With just rigidchapters and no corrections, multiline headings overlap with the text, or text is far away from single-line headings. I am very happy with patching \ttlh@hang.
    – bers
    Aug 5, 2014 at 14:03

You must log in to answer this question.

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