Convert final appendix to a supplementary material section

I am writing a document where each chapter has an appendix. In addition to the appendices I would like to have a final supplementary files section where I list all the files that accompany the document each in their own section.

I am using both the appendix and cleveref packages.

Essentially when I refer to an appendix I would like the in-text reference to say "Appendix X" except when referring to the final appendix where it should say "Supplement X.X".

In addition since appendices are labeled alphabetically I would like to set the appendix counter forward to 19 so that the supplementary files section is section "S".

Here is a MWE:

\documentclass{report}
\usepackage[toc,page,titletoc]{appendix}

\begin{document}

TITLE

\tableofcontents

\chapter{Test Chapter 1}

Here is an idea (\cref{app:ch1}). The raw data is available in \cref{app:supp1}.

\chapter{Test Chapter 2}

Another idea.

\appendix
\chapter{Test Chapter 1}
\label{app:ch1}

\chapter{Test Chapter 2}
\label{app:ch2}

\crefalias{sectiom}{supp}

\chapter{Supplementary material}
\section{Supplementary material of chapter 1}
\label{app:supp1}
\section{Supplementary material of chapter 2}
\label{app:supp2}

\end{document}


Using the appendices environment you can control things a little more finely:

Text reference:

Supplementary material:

\documentclass{report}

\usepackage[toc,page,titletoc]{appendix}

\crefname{supp}{Supplement}{Supplements}

\begin{document}

\begin{center}
TITLE
\end{center}

\tableofcontents

\chapter{Test Chapter 1}

Here is an idea (\cref{app:ch1}).
The raw data is available in \cref{app:supp1}.

\chapter{Test Chapter 2}

Another idea.

\begin{appendices}
\chapter{Test Chapter 1}
\label{app:ch1}

\chapter{Test Chapter 2}
\label{app:ch2}
\end{appendices}

\appendixpageoff
\appendixtitleoff
\renewcommand{\appendixtocname}{Supplementary material}
\begin{appendices}
\setcounter{chapter}{19}
\crefalias{section}{supp}
\chapter*{Supplementary material}
\section{Supplementary material of chapter 1}
\label{app:supp1}
\section{Supplementary material of chapter 2}
\label{app:supp2}
\end{appendices}

\end{document}


The ingredients are as follows:

1. Ordinary appendices in their appendices environment with options controlled by the option passed to the appendix package
2. Supplementary material in a separate appendices environment, where the extra page and heading are turned off, the toc name is adjusted, the chapter counter is set to 19 (corresponding to "S"), the chapter title is provide by \chapter* and the section counter is aliased to supp
3. A \crefname instruction to print references to the supp counter with the name Supplement

\documentclass{report}
\usepackage[toc,page,titletoc]{appendix}

\makeatletter
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\def\@chapapp{\appendixname}%
\def\thechapter{\@Alph\c@chapter}}
\makeatother

\begin{document}

TITLE

\tableofcontents

\chapter{Test Chapter 1}

Here is an idea (\cref{app:ch1}). The raw data is available in \cref{app:supp1}.

\chapter{Test Chapter 2}

Another idea.

{
\appendix
\chapter{Test Chapter 1}
\label{app:ch1}

\chapter{Test Chapter 2}
\label{app:ch2}
}

\crefalias{sectiom}{supp}

\renewcommand\chaptername{Supplementary}
\def\thechapter{S}

\chapter*{Supplementary material}
\section{Supplementary material of chapter 1}
\label{app:supp1}
\section{Supplementary material of chapter 2}
\label{app:supp2}

\end{document}