I have several section titles in my document that are getting hyphenated, which is quite ugly.
I am now looking for some way to avoid the hyphenation, which is is somewhat related to this question, but unfortunately my titles have to be centered (so raggedright is not an option), and adding \sloppy to my titlesec definition of the subsection format didn't help:
\newcommand{\trailthesubsection}[1]{\MakeUppercase{#1} (\thesubsection)}
\titleformat{\subsection}
{\normalfont\fontsize{15pt}{16pt}\bfseries\sffamily\sloppy} % <- "sloppy" didn't help.
{}
{0pt}
{\filcenter\trailthesubsection}
I could, of course, set manual linebreaks - but in order not to destroy the layout of my TOC in the process, I would have to use the optional parameter to the section commands:
\subsection[Could do this but it is not nice]{Could do this\\ but it is not nice}
Isn't there some way to suppress hyphenation for a given text (e.g. by some command in the \titleformat), or to suppress manually-set linebreaks in the TOC?
newlinetospace, with does what the name suggests in headlines and tocs. – Javier Bezos May 23 '12 at 12:30