How to increase memoir table of contents spacing between appendix and its hyphen?

by user   Last Updated October 20, 2019 02:23 AM

After patching (manually, i.e, directly editing memoir's code), this:

enter image description here

It should look like this:

enter image description here

I tried to patch the memoir using xpatch. This patch I did would work if it was finding the correct code, but xpatch says is does not find the code to patch:

\documentclass[
12pt,
]{abntex2} % memoir is loaded internally by the `abntex2` class
\usepackage{xpatch}

\makeatletter
\newcommand{\chapternumberlineappendixpatch}[1]{%
\chapternumberlinehook{#1}%
\chapternumberlinebox\@tempdima{\@[email protected]\@cftbsnum #1~~\@cftasnum~~}%
\@cftasnumb~}%

\patchcmd{\@chapter}{%
  \addcontentsline{toc}{appendix}{\protect\chapternumberline{\thechapter}\[email protected]}
}{}{\addcontentsline{toc}
  {appendix}{\protect\chapternumberlineappendixpatch{\thechapter}\[email protected]}}{
  \message{Chapterformat patch for chapternumberline could NOT
  be applied because its code was not found!^^J ^^J^^J^^J^^J^^J^^J^^J^^J^^J^^J}
  \xshowcmd\@chapter
}
\makeatother

\begin{document}
    \tableofcontents
    \chapter{Some}

    \begin{apendicesenv}
        \chapter{Other}
    \end{apendicesenv}

\end{document}

This the memoir code:

File: memoir.cls
2926:     \ifanappendix
2927:       \addcontentsline{toc}{appendix}{%
2928:         \protect\chapternumberline{\thechapter}\[email protected]}%
2929:       \memappchapinfo{\thechapter}{\[email protected]}{\[email protected]}{#2}%
2930:     \else

It should stop calling that \chapternumberline and call my custom \chapternumberlineappendixpatch function with increased the space around the hyphen:

\newcommand{\chapternumberlineappendixpatch}[1]{%
\chapternumberlinehook{#1}%
\chapternumberlinebox\@tempdima{\@[email protected]\@cftbsnum #1~~\@cftasnum~~}%
\@cftasnumb~}%

File: memoir.cls
2926:     \ifanappendix
2927:       \addcontentsline{toc}{appendix}{%
2928:         \protect\chapternumberlineappendixpatch{\thechapter}\[email protected]}%
2929:       \memappchapinfo{\thechapter}{\[email protected]}{\[email protected]rhdr}{#2}%
2930:     \else


Related Questions


Updated October 19, 2019 22:23 PM

Updated February 19, 2017 03:23 AM

Updated May 02, 2017 18:23 PM