I want chapters in the report class to start 3em
below the end of the previous chapter. To do this, I patch the \chapter
command using titlesec
and etoolbox
. However, this adds blank space above the chapter name even if is on the top of a new page, which I don't want. How can I remove the spacing if the chapter starts at the top of a new page?
I want the Sixth chapter heading like in the right hand side figure below, not the one at the left.
\documentclass[12pt,a4paper]{report}
\usepackage{lipsum}
\usepackage{titlesec}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}%
{\par\vspace{\baselineskip}}{}{}
\makeatother
\titlespacing*{\chapter}{0mm}{3em}{1em}
\begin{document}
\chapter*{First chapter}
\lipsum[1-4]
\chapter*{Second chapter}
\lipsum[1-2]
\chapter*{Third chapter}
\lipsum[2]
\chapter*{Fourth chapter}
\lipsum[1-3]
\chapter*{Fifth chapter}
\lipsum[2]
\chapter*{Sixth chapter}
\lipsum[1-2]
\end{document}
Best Answer
titlesec
inserts the "traditional" forcedv
erticalspace
as part of setting the chapter title header. You need to also change this\vspace*
to\vspace
so the space is gobbled at the start of a page: