titlesec icon indicating copy to clipboard operation
titlesec copied to clipboard

Add option to clear \parfillskip in section titles

Open dphlin opened this issue 8 months ago • 0 comments

While \parfillskip as set by \usepackage[parfill]{parskip} is useful to avoid rectangular paragraphs. It produces undesirable results when used with section titles set raggedright.

Eg:

\usepackage[raggedright]{titlesec}
\usepackage[parfill]{parskip}
\begin{document}
\section{Some long title that would otherwise fill one line}

This is solved for regular section titles in https://tex.stackexchange.com/a/151692.

However, for titlesec, something like the following is required:

\usepackage{etoolbox}
\makeatletter
\patchcmd{\filright}{\relax}{\parfillskip=0pt plus 1fil\relax}{}{}
\makeatother

A package option (noparfillskip?) to control this would be convenient.

dphlin avatar Apr 02 '25 13:04 dphlin