Horizontal space between chapter number and title in book [duplicate]

This question already has an answer here:

I am writing a document with the bookclass and a redefined \thechaptercommand. Since I have a lot of chapters, the chapter number and the chapter title overlap in the TOC. How can I change the horizontal space between them? I have only seen solutions that do not work for the bookclass.

MWE:

\documentclass{book}
\begin{document}
\tableofcontents
\renewcommand*{\thechapter}{I.\arabic{chapter}}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\end{document}


marked as duplicate by Werner table-of-contents StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Nov 16 '16 at 18:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• Number your chapters in base 16? :o) – Bernard Nov 16 '16 at 17:42

1 Answer

Try to reserve some space for the numbers in advance by \setlength{\cftchapnumwidth}{3em}, for example, after loading the tocloft package.

\documentclass{book}

\usepackage{tocloft}
\setlength{\cftchapnumwidth}{3em}

\begin{document}
\tableofcontents
\renewcommand*{\thechapter}{I.\arabic{chapter}}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\end{document}