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

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

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

It should look like this:

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}{%
{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
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