I am trying to make the subsection entries in a TOC to be grouped together as a paragraph, as provided by the \titlecontents* command in the titletoc package. See my attempt in this MWE:
\documentclass[12pt]{tufte-book}
%\usepackage{titletoc} % Don't need---included with tufte-book
\titlecontents*{subsection}[.5in]
{\addvspace{.5pc}\small\itshape}{}{}{~~\thecontentspage}[\ \ \ \ ]
\begin{document}
\frontmatter
\setcounter{tocdepth}{2}
\tableofcontents
\mainmatter
\chapter{A boring chapter}
\section{A first section}
% Words in section title are separated by ~ to prevent line breaks in titles
\subsection{Corvids~and~jays}
\subsection{Elephants~and~cetaceans}
\subsection{Rosids~and~arachnids}
\end{document}
In the document produced, the subsection title "Rosids and arachnids" is broken across a line, with "arachnids" hyphenated:
I want to force the entire subsection title to go to the next line rather than span it.
I believe the interaction between the titletoc package and the tufte-book class affects this, since tufte-book requires titletoc and I wasn't able to reproduce the problem in a MWE that doesn't use tufte-book.
None of the solutions involving \raggedright or \hyphenpenalty suggested in answers to related questions have worked---again, I suspect it is the tufte-book document class that is the factor. Can anyone shed some light on this?


\raggedrightand\mbox) separately. Putting\raggedrightat the end of the "above code" parameter overrides the left placement, as shown in your example. The\mboxworks by itself without changing the left placement. However, I don't understand these effects, such as why\raggedrightoverrides the left placement. Is there any explanation in terms oftitletoc's options? – Thomas VanDrunen May 29 '21 at 12:41\raggedrightdeleted. – Thomas VanDrunen May 29 '21 at 15:18