[Tex/LaTex] Adding space in ToC between the part number and part title

memoirpartsspacingtable of contents

I am running into some formatting trouble with memoir and the \part commands. In the table of contents, as the number of parts add up, the space between the part number, i.e. "III" and the part heading, i.e. "Background", gets smaller.

Is there a way of adding a constant space there, so that each part title are separated from the part number by the same amount? Here's an MWE showing the problem.

\documentclass{memoir}

\begin{document}

    \tableofcontents

    \part{Background}

    \chapter{The problem}

    \chapter{Risk assessment}

    \part{Theory and principles}

    \chapter{Inductively coupled plasma mass spectrometry}

    \chapter{Inductively coupled plasma optical emission spectrometry}

    \chapter{X-ray diffraction}

    \chapter{Ion chromatography}

    \part{Thesis}

    \chapter{Introduction}

    \chapter{Methodology}

    \chapter{Results}

    \chapter{Discussion}

    \chapter{Conclusion}


\end{document}

enter image description here

Best Answer

The memoir manual says on page 156 that

the \book, \part and \chapter numbers are typeset inside a box of certain fixed withs

In order to get a fixed width after the part number, we have to get rid of the box and insert some whitespace (1em in this example) after the number. We do so by renewing \partnumberlinebox:

\renewcommand\partnumberlinebox[2]{#2\hspace{1em}}

Now the MWE looks like this:

\documentclass{memoir}
\renewcommand\partnumberlinebox[2]{#2\hspace{1em}} % <-- Adds 1em whitespace between part number and title

\begin{document}

    \tableofcontents

    \part{Background}

    \chapter{The problem}

    \chapter{Risk assessment}

    \part{Theory and principles}

    \chapter{Inductively coupled plasma mass spectrometry}

    \chapter{Inductively coupled plasma optical emission spectrometry}

    \chapter{X-ray diffraction}

    \chapter{Ion chromatography}

    \part{Thesis}

    \chapter{Introduction}

    \chapter{Methodology}

    \chapter{Results}

    \chapter{Discussion}

    \chapter{Conclusion}


\end{document}

MWE

Related Question