Consider test case:
\documentclass{report}
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\LARGE\bfseries}{\thechapter}{10pt}{}
\titlespacing*{\chapter}{0pt}{0pt}{10pt}
\begin{document}
\chapter{Test0}\newpage
\chapter{Test1}\newpage
\section{Test1.1}\newpage
\end{document}
Even after setting vertical space before title to 0pt
with titlespacing
, chapter and section titles at the beginning of pages still aren't on the same line:
This can be a result of report
use, at least in article
this difference is about 1pt.
Is it possible to set vertical space before chapter title to 0 or remove it? Instead of using titlespacing
with negative values?
Best Answer
If you use Gonzalo Medina's or Danie Els' answer, the vertical space above the chapter title is 'almost' removed. According to Gonzalo Medina's answer:
Output after applying Gonzalo Medina's solution: The red line indicates page margin.
After removing the vertical space by commenting out the
\vspace*
, there is still a small space left. The reason behind this small space (see struts) being left is described in the titlesec documentation. From the documentation:To remove this strut from the chapter title, the
\nostruts
macro can be used in the\titleformat
of the chapter.1st page:
2nd page:
3rd page:
Notice that the strut is still present in the section title as we only removed it from the chapter title.