I'm using titlesec
to change the style of my section titles. Sometimes, when the title is long, but just short enough to fit on one line, some extra vertical spaces is add. The following MWE illustrates the problem:
\documentclass{book}
\usepackage[a4paper]{geometry}
\usepackage[explicit]{titlesec}
\titleformat{\section}[block]{\Large\normalfont\bfseries}{#1}{.5em}{}
\begin{document}
\section{This is a short title}
This is a paragraph.
\section{This is a purposely long title that shows some odd behavior}
This is a paragraph.
\end{document}
This is rendered as follows:
Clearly, there is too much space below the second section title. I've played around with \ignorespaces
and \ignorespacesafterend
, but can't seem to get rid of the extra space. What to do?
\raggedbottom
after\begin{document}
, but this does not resolve anything. Also, I tried what happens when I duplicate the sections, and the problem remains: there is more vertical space under sections with long titles than under the other sections.