I am creating a labbook for which the \part is the year, the \chapter is the month and the \section is the specific day.
This is how my document currently looks:
I managed to get rid of the chapter numbers in \mainmatter but this also got rid of the chapter numbers (A, B etc.). From reading the memoir.dtx file on CTAN, I found that memoir uses \ifanappendix to test for whether the number line is an appendix or not (?) and attempted to modify it like:
\renewcommand{\chapternumberline}[1]{\ifanappendix \thechapter. \else \fi}
Which doesn't seem to work (on the image, Appendix 1 and .. 2 should have A and B in front respectively). I am not sure why the spacing between the numbers for Foo, Baz and Bar subsections are so large either. If anyone could help me get rid of that space and have chapter numbers for \appendix only I would be appreciative.
MWE:
% arara: pdflatex: {options: [-halt-on-error]}
% arara: pdflatex: {options: [-halt-on-error]}
\documentclass[11pt,oneside]{memoir}
% From memoir manual p. 156 the \renewcommand was found
%\renewcommand{\chapternumberline}[1]{} % To create blank chapter numbers
\renewcommand{\chapternumberline}[1]{\ifanappendix \thechapter. \else \fi}
% Copied exactly from memoir manual p. 163
\let\oldcftsf\cftsectionfont% save definition of \cftsectionfont
\let\oldcftspn\cftsectionafterpnum% and of \cftsectionafterpnum
\renewcommand{\cftsectionfont}{%
\let\oldnl\numberline% save definition of \numberline
\renewcommand{\numberline}[1]{}% change it
\oldcftsf} % use original \cftsectionfont
\renewcommand*{\cftsectionafterpnum}{%
\let\numberline\oldnl% % restore orginal \numberline
\oldcftspn} % use original \cftsectionafterpnum
% From https://tex.stackexchange.com/a/215164/273733
\makeatletter
\def\cl@section{}
\makeatletter
\renewcommand{\thesubsection}{\arabic{subsection}}
\setsecnumdepth{subparagraph}
\settocdepth{subparagraph}
\begin{document}
\tableofcontents*
\part{2022}
\chapter{August}
Foo
\newpage
\section{\today}
Foo
\subsection{Foo}
Bar
\subsubsection{Baz}
Baz
\subsection{Bar}
Foo
\subsubsection{Baz}
Baz
\newpage
\section{15/08/2022}
Foo
\subsection{Foo}
Bar
\subsubsection{Baz}
Baz
\subsection{Bar}
Foo
\subsubsection{Baz}
Baz
\appendix
\chapter{Appendix 1}
Foo
\section{Testing}
bar
\chapter{Appendix 2}
Foo
\section{Testing}
bar
\end{document}
If this question needs splitting into multiple questions then please comment, I think they are somewhat similar so grouped them but I am happy to be corrected if they're very different.


\includesolely for packages, macros etc.). The code above failed in my main document (! Illegal parameter number in definition of \appendix) but when including it before packages, it worked as intended. Must be a clash between a package and the code so use before loading packages. – JamesT Aug 14 '22 at 17:14