Search code examples
macroslatexbeamer

Latex Macro for Backup Slides


I am struggling to implement a feature in LaTeX beamer that would help my preparation of talks a lot. I would like the following MWE to create me a backup slide, link it and insert it after appendbackupframes, instead of putting the content into a footnote:

\documentclass[handout]{beamer}
\newcommand{\additionalinfo}[2]{\beamerbutton{#1}\footnote{#2}}
\newcommand{\appendbackupframes}{}
\begin{document}
\begin{frame}
    \additionalinfo{Beyond the world}{Show me something fancy, like a theorem
    \begin{theorem}
        Hello!
    \end{theorem}}
\end{frame}
\appendbackupframes
\end{document}

In other words, I would like this code to compile in the same way as:

\documentclass{beamer}
\usepackage{hyperref}
\begin{document}
\begin{frame}
    \hyperlink{backup:1}{\beamerbutton{Beyond the world}}\label{backupback:1}
\end{frame}
\begin{frame}{Beyond the world}
\label={backup:1} Show me something fancy, like a theorem
    \begin{theorem}
        Hello!
    \end{theorem}
\hyperlink{backupback:1}{\beamergotobutton{Back}}
\end{frame}
\end{document}

For me, any solution that I can make work on overleaf (i.e., there are no problems to compile in XeLaTeX or LuaLaTeX, but running external scripts for pre-processing is hard) would be helpful, as it allows to work easily with collaborators.


Solution

  • It seems you are pretty much looking for the beamerappendixnote package:

    \documentclass{beamer}
    \usepackage{beamerappendixnote}
    \begin{document}
    \begin{frame}{Main title}
      Main content \vfill
      \appxnote{Beyond the world}{Show me something fancy, like a theorem
          \begin{theorem}
              Hello!
          \end{theorem}}
    \end{frame}
    \printappxnotes
    \end{document}
    

    enter image description here