Memoir: treating a section as an appendix

We have an in-house document class which is based on memoir. For some smaller documents we don't want chapters so we effectively promote sections to be chapters as in my MWE. My question is how can I create an Appendix in this case? The \appendix command formats subsequent chapters as appendices, but I don't have chapters and I want subsequent sections to become appendices.

My MWE gets some of the way there (for simplicity using memoir itself, not our class based on it):

\documentclass{memoir}
\usepackage{hyperref}
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Change the section commands because we don't have chapters           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.}
\renewcommand{\thechapter}{\thesection}

\mainmatter

\section{Helium}

\section{Alpha particles}

See \autoref{app:numden}

\appendix
\renewcommand{\thesection}{\Alph{section}}

\section{Number densities}
\label{app:numden}

\end{document}


The \appendix command restarts the section numbering from 1, and I can change this to "A" using \renewcommand{\thesection}{\Alph{section}}. However, when I reference the appendix, as I do with \autoref{app:numden}, It says "section A" where I want this to say "Appendix A". Of course I could faff around with how I typeset the cross-reference at that point, but how do I get a section to be properly treated as an appendix as it would in the article class?

• Have you looked at memoir's subappendices environment and the \namedsubappendices command? – gusbrs May 4 '18 at 13:19
• Just as a matter of style, memoir allows to use the class option 'article'. With this option, chapters are styled as section headers. Maybe that solves your problem, that seems like a mix between visual appeareance and meaning of instructions. – djnavas Jul 29 '18 at 7:21

\newcommand{\appref}[1]{\hyperref[#1]{Appendix~\ref{#1}}}