titlesec icon indicating copy to clipboard operation
titlesec copied to clipboard

Unwanted space before chapter title

Open taulantarapi opened this issue 3 years ago • 1 comments

Titlesec adds some unwanted space before chapter titles (of any shape, not just display), as shown by the following MWE:

\documentclass{report}

\usepackage[showframe]{geometry}
\usepackage{titlesec}

\titleformat{\chapter}
    {}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{*0}{*0}
% same result with \titlespacing*{\chapter}{0pt}{0pt}{0pt}

\begin{document}
\chapter{Test}
\end{document}

This only happens with chapters, and not with sections. This answer https://tex.stackexchange.com/a/70213 suggests using -\topskip as before-sep, but there is still some undesired space which is particularly noticeable with larger font sizes.

Related thread, with working solution: https://tex.stackexchange.com/questions/59389/package-titlesec-adds-extra-space-on-top-of-chapter-despite-commands-to-the-co/59392#59392

taulantarapi avatar Jan 07 '23 11:01 taulantarapi

The default \chapter adds this space, too, and for titlesec I just (naïvely) copied its definition. This behavior won’t change, but maybe a new, more intuitive wrt vertical spacing, title class would be useful.

jbezos avatar Jan 08 '23 08:01 jbezos