Appendixify: Move selected slides to appendix in Beamer

The beamersubframe package provides a convenient way to move frames to the backup without moving the actual code around:

\documentclass{beamer}

\usepackage[append]{beamersubframe}

\begin{document}

\begin{frame}
    abc
\end{frame} 

\begin{subframe}
    moved to appendix
\end{subframe}

\begin{frame}
    abc
\end{frame} 

\appendix

\appendsubframes
\end{document}

For section navigation etc. the one from the parent section will be shown on the "appendixified" frames.

For detailed information on creating convenient navigation to and from the appended frames, please see the package documentation.


Here is my solution. Probably not good, but it works for me.

% Moving slides to appendix
% Define a variable to store everything to move
\newcommand{\backupSlides}{}
% Define command to append text to backup variable
\newcommand{\backup}[1]{
\expandafter\def\expandafter\backupSlides\expandafter{\backupSlides#1}
}

To appendixify a frame simply put it into a backup command:

\backup{
    \begin{frame}...\end{frame}
}

At the end of your document add (once for all frames):

\backupSlides