How to define a "final slide" in a beamer template?

To enforce something upon the end of the document you can use \AtEndDocument:

\documentclass{beamer}

\AtEndDocument{\begin{frame}
                  The last slide
               \end{frame}
                }

\begin{document}
\frame{Some slide}
\end{document}

This can be applied to @samcarter's answer as well to obtain the same result:

\documentclass{beamer}

\setbeamertemplate{endpage}{%
    \begin{frame}
        The last slide
    \end{frame}
}

\AtEndDocument{\usebeamertemplate{endpage}}

\begin{document}
\frame{Some slide}
\end{document}

You can define whatever templates you like:

\documentclass{beamer}

\setbeamertemplate{endpage}{%
    \begin{frame}
        bla
    \end{frame}
}

\begin{document}

\frame{text}

\usebeamertemplate{endpage}

\end{document}

Tags:

Beamer