# Problem with chapter number alignment in ToC in LaTeX

This post is about a very very specific problem in LaTex. I had hard time to figure out a way to solve this issue.

This problem is for people using the Memoir class.

When generating my PDF I noticed that by default when the number of chapter has more than 3 digits then, in the table of content, the place which should contain the chapter number is too small for the three digits. And this results in an ugly intersection with the chapter name.

This is the solution I found to correct the display. Put in the preamble of the document, the following code:

\makeatletter
\let\oldchapternumberline\chapternumberline
\renewcommand\chapternumberline[1]{#1\hspace*{1em}}
\renewcommand\cftchaptername{\chaptername~}