# Is there an alternative for using \mbox to prevent ugly hyphenation in the toc

Assume I have a long chapter title \chapter{one two three four five six seven eight nine ten} that appears in the table of contents like this:

1. one two three four five six se-

ven eight nine ten

This seems ugly to me. I would like to have it like:

1. one two three four five six

seven eight nine ten

But if I use \chapter{one two three four five six \mbox{seven} eight nine ten} the line in the table of contents will be too long, so is there an alternative to have a linebreak in the table of contents without hyphenation and without having a line that is too long?

• Welcome to TeX.SX. With index, you mean the table of contents? – Johannes_B Nov 13 '19 at 16:00
• Which documentclass are you using? – Johannes_B Nov 13 '19 at 16:01
• arrange that your chapter headings are set \raggedright then tex won't hyphenate them. – David Carlisle Nov 13 '19 at 17:22
• by the way you mean Table of Contents not Index (Index in English means the alphabetical list, usually at the end of the book) – David Carlisle Nov 13 '19 at 17:23
• Have you tried the \hyphenpenalty option? It is intended for that, you can set it to \hyphenpenalty=10000 to prevent most hyphens. And modify it before and after including the index. – Salatiel Garcia Nov 14 '19 at 4:47

If you want to disable hyphenation for all entries in ToC, LoF and LoT:

(Remember to compile code twice)

\documentclass[b5paper,12pt,twoside]{book}
\usepackage[pdfspacing]{classicthesis}
\usepackage{arsclassica}
\usepackage[inner=2.2cm,outer=1.8cm,bottom=2.7cm,top=2.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage[english]{babel}

\titleformat{\section}
{\raggedright}{\textsc{\MakeTextLowercase{\thesection}}}{1em}{\spacedlowsmallcaps}

\makeatletter
\renewcommand{\@tocrmarg}{2.55em plus1fil}
\makeatother

\begin{document}
\frontmatter
\tableofcontents
\cleardoublepage
\mainmatter
\chapter{Test Chapter}
\section{The Separation Axioms and Continuous Real-Valued Functions}
\lipsum
\end{document}


Taken from--https://tex.stackexchange.com/a/430273/197451