# Avoid hyphenation in chapter title

I wonder if there is a way to avoid hyphenation of words in the title of a chapter.

I have tried \mbox but that makes the word run over the margin. I've also tried inserting a \\ in front of the word, but while this has the intended result on the chapter title page it has the unwanted side effect that the breakline also appears in the ToC.

Any ideas?

-
\chapter{\mbox{maybe} \mbox{this} \mbox{would} \mbox{work}?} –  gerrit Nov 21 '11 at 22:19
No it won't, I already tried that (see question): it causes margin run-overs. –  Matthias Nov 21 '11 at 22:50

If you want to have linebreaks in the chapter title, but not in TOC, use the optional argument for \chapter:

\chapter[The long long long title]{The long long\\ long title}

-

In ConTeXt, you can use

\setuphead[chapter][align=nothyphenated]


or, slightly better

\setuphead[chapter][align={flushleft, nothyphenated, verytolerant}]


which sets the title to be flushed left, not hyphenated, and the white space between words to be more stretchable.

-
Cool, but I can't risk switching to a new typesetting system at this (final) stage of the writing-up of my thesis :-). So I'm sticking with XeTeX. –  Matthias Nov 23 '11 at 16:37
@Matthias: I understand. I gave a ConTeXt solution in case a ConTeXt user has the same question and is searching for a solution. –  Aditya Nov 23 '11 at 17:39

The hyphenat package provides the command \nohyphens. You can control the hyphenation locally.

If you want to switch off hyphenation globally, use \usepackage[none]{hyphenat}.

-

Chapter headings are set, by default, using \raggedright. However, this does not avoid hyphenation necessarily. Yet one can patch the respective chapter heading macros to avoid hyphenation via \hyphenpenalty=10000:

\documentclass{report}%
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox

% http://mentalfloss.com/article/50611/12-exceptionally-long-or-extremely-special-words
\hyphenation{sub-der-ma-to-gly-phic}
\setlength{\textwidth}{.5\textwidth}% Just for this example
\begin{document}
\chapter{This subdermatoglyphic title is long}

\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}

Note that avoiding hyphenation could cause "Overfull \hbox" warnings, which is exactly the case above. Perhaps it's an extreme case, but still.