I'm trying to control the position and format of the different headings using the awesome package titlesec. However, I am having trouble controlling the vertical space above a \chapter. It always seems to add a small vertical space of approximately 4.8 mm from the top of the body.
Here is my MWE where I have disabled all spacing, with geometry's showframe and a \fbox around the chapter label:
\documentclass[11pt]{book}
\usepackage[showframe]{geometry}
\usepackage{titlesec}
\titleformat{\chapter}[display]{}{\fbox{Chapter \thechapter}}{0mm}{\bf}
\titlespacing*{\chapter}{0mm}{0mm}{0mm}
\begin{document}
\chapter{Display of Heading Levels}
Some paragraph
\end{document}
For comparison, if I comment out the line \chapter{Display of Heading Levels}, it perfectly aligns with the top of the document.
What's going on here? I have tried solutions of other question, e.g. this one, but I couldn't get it to work.




0mmjust result in0mm? I have exact instructions for the spacings, and therefore it bothers me thattitlesecdoesn't use this exact height. – André Feb 15 '21 at 08:20titlesecto format the titles? The package has defaults to format a chapter heading . They provided you a template or only specifications? – Simon Dispa Feb 15 '21 at 13:39titlesecinstead? – André Feb 15 '21 at 14:35titleec, go ahead. I personally usememoirto write books. It emulates many packages, so there are fewer compatibility issues. A comment: usually the chapter headings have some space before and after, plus bigger fonts. Look at different printed books. – Simon Dispa Feb 15 '21 at 15:4150mmas vertical space, it actually will place it at around54.8mm. I will look at thememoirclass though, thanks for the heads up! – André Feb 15 '21 at 18:44