titlesec icon indicating copy to clipboard operation
titlesec copied to clipboard

newlinetospace doesn't discard optional arg of \\

Open kberry opened this issue 11 months ago • 0 comments

Following #81 ... I don't know if it's feasible, but newlinetospace doesn't discard the optional arg to \, which is not unusual to need in chapter titles.

\documentclass{book}
\usepackage[newlinetospace]{titlesec}
\titleclass{\chapter}{top}
%
\titleformat{\chapter}
  [display]% shape
  {\huge\rm}% format
  {\thechapter}% label  (.2)
  {0\baselineskip}% sep between label and text (vertical because shape=display)
  {}% before-code
%
\begin{document}
\tableofcontents
\chapter{The\\[-1pt]First Chapter}
Text of first chapter.
\newpage Second page of first chapter.
\end{document}

The output has literal text [-1pt] (or PT) in the toc and running head.

Just wanted to report ... --thanks, karl.

kberry avatar Jan 06 '25 18:01 kberry