The following code gives me some space above the chapter title, that I'd like to avoid:
\documentclass{book}
\usepackage[showframe]{geometry}
\usepackage{titlesec}
\titleformat{\chapter}[frame]
{}
{\thechapter}
{0pt}
{}
\titlespacing*{\chapter}{0cm}{0pt}{0pt}[0pt]
\begin{document}
\chapter{Chapter Title}
Fancy text.
\end{document}
See this image:
The ellipse (added afterwards) is above the chapter title, but within the text area.
When I do the same with section instead of chapter, everything is fine:
\documentclass{book}
\usepackage[showframe]{geometry}
\usepackage{titlesec}
\titleformat{\section}[hang]
{}
{\thesection}
{0pt}
{}
\titlespacing*{\section}{0cm}{0pt}{0pt}[0pt]
\begin{document}
\section{Section Title}
Fancy text.
\end{document}
What makes \chapter
so special in this respect? Is there a way to avoid the space above the chapter title with the package titlesec
?
Best Answer
When I go back the amount of
\topskip
, everything is fine:The
{-50pt}{40pt}
in the linked answer ( https://tex.stackexchange.com/a/63393 ) are not the correct values for the question above.