[This question is similar to the one here, but the solutions given there do not work in my context]
In a (fairly complex) book I'm using titlesec and tikz to produce fancy chapter headings, basically using the following code
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\sffamily}{\scalebox{3}{\thechapter}}{25pt}{\Huge\chaptitle}
% left before after
\titlespacing*{\chapter} {0pt}{110pt}{20pt}
% set the style of the chapter title as a tikzpicture,
% filled using the current partcol2 color
\newcommand{\chaptitle}[1]{%
\begin{tikzpicture}
\node[fill=gray!20,inner sep=6pt,text width=\dimexpr\linewidth-12pt\relax] {#1};
\end{tikzpicture}
}
However, in several chapters, the chapter title gets hyphenated like this image

I tried to make a simple MWE to demonstrate this, but for some reason it doesn't hyphenate the word 'Table' in this simple example. (The krantz.cls is that used by my publisher to set page dimensions.) FWIW, here it is:
%\documentclass[10pt]{book}
\documentclass[10pt,krantz2]{krantz}
\usepackage{titlesec}
\usepackage{blindtext}
\usepackage[cmyk]{xcolor} %% extended color models; load before tikz
\usepackage{tikz} %% used for hyp3way.tex and chapter vtocs
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\sffamily}{\scalebox{3}{\thechapter}}{25pt}{\Huge\chaptitle}
% left before after
\titlespacing*{\chapter} {0pt}{110pt}{20pt}
\newsavebox{\chaptocbox}
% set the style of the chapter title as a tikzpicture,
% filled using the current partcol2 color
\newcommand{\chaptitle}[1]{%
\begin{tikzpicture}
\node[fill=gray!20,inner sep=6pt,text width=\dimexpr\linewidth-12pt\relax] {#1};
\end{tikzpicture}
}
\begin{document}
\chapter[Mosaic Displays for n-way Tables]{Mosaic Displays for n-way Tables}\label{ch:mosaic}
\blindtext
\end{document}
This gives:
One suggested solution was to manually break the title, e.g.,
\chapter[Mosaic Displays for n-way Tables]{Mosaic Displays for n-way\\ Tables}\label{ch:mosaic}
This does have the desired effect, however, it screws up the use of the chapter title in the running heads of the subsequent pages.
So, I'm looking for some way to modify the \titleformat or \chaptitle commands to say do-not-hyphenate. I did try adding \sloppy to the \titleformat command.
font=\raggedrightin\node[fill=gray!20,inner sep=6pt,text width=\dimexpr\linewidth-12pt\relax,font=\raggedright] {#1};As I can't reproduce the issue, I can't add an answer now. – Apr 16 '15 at 13:04\chapter{Mosaic Displays for n-way \mbox{Tables}}won't hyphenTables. – Ignasi Apr 16 '15 at 15:12\chapter{Mosaic Displays for n-way \mbox{Tables}}works for me. Thanks! – user101089 Apr 17 '15 at 12:34