[Tex/LaTex] Button on all slides after Table of Contents in beamer

beamertable of contents

I'd like to add a "return" button on all the slides after the table of contents, returning to the ToC itself, but not exactly on the footer (as shown in How to edit Beamer theme CambridgeUS). I've used on the first slide manually (see the MWE below), but I'd like to put it in the whole document (except for the title and ToC frames, of course). Is there a way to do it not by hand?

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usetheme{Boadilla}

\begin{document}

\title{Apresentação RLZ}
\author{RLZ}
\date{\today}


\begin{frame}
    \titlepage
\end{frame}

\section*{Sumário}
\label{toc}
\frame{\tableofcontents}

\begin{frame}
    \frametitle{Conceitual}
    \framesubtitle{Instituição dos procedimentos eletrônicos, iniciado no encontro de Salvador (julho de 2004) e concretizado em São Paulo (abril de 2005)}

    \begin{itemize}[<alert@+>]
        \item \textbf{NF-e} -- Nota Fiscal Eletrônica (Emenda Constitucional nº 42)

        \item \textbf{NFS-e} -- Nota Fiscal de Serviços Eletrônica

        \item \textbf{SPED} -- Sistema Público de Escrituração Digital (Decreto nº 6022/2007)
    \end{itemize}

\end{frame}
\vfill
\hyperlink{toc}{\beamergotobutton{Voltar ao início}}
\end{document}

Best Answer

Update:

the initial solution I proposed (it's on the bottom now) was theme-dependent since it involved a redefinition of the footline template (which may vary from them to theme). Here now I present a simpler solution which doesn't depend on the theme used. The idea is to use the background canvas template and a \node (inside a tikzpicture environment with the remember picture,overlay options) to place the button at the desired location:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage[brazil]{babel}
\usetheme{Boadilla}

\newcommand\AddButton{%
\setbeamertemplate{background canvas}{%
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=west] at ([yshift=20pt,xshift=1em]current page.south west)
  {\hyperlink{toc}{\beamergotobutton{Voltar ao início}}};
\end{tikzpicture}%
  }%
}

\title{Apresentação RLZ}
\author{RLZ}
\date{\today}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}[label=toc]
\tableofcontents
\end{frame}

\AddButton
\section{Test Section}
\begin{frame} test frame \thepage \end{frame}
\begin{frame} test frame \thepage \end{frame}
\begin{frame} test frame \thepage \end{frame}

\end{document}

First idea (theme dependent):

Here's one possibility; the idea is to define a command (\AddButton in my code) that oncludes the button as a part of the footline template used by the Boadilla theme; simply issue the command at the point where the button must be included in all successive frames (you can change the position of the button by changing the lengths used in the lines marked % HERE in my code):

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usetheme{Boadilla}

\makeatletter
\newcommand\AddButton{%
\setbeamertemplate{footline}
{
  \leavevmode%
  \vskip-15pt% HERE
  \hskip1em\hyperlink{toc}{\beamergotobutton{Voltar ao início}}% HERE
  \vskip5pt% HERE
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}%
}
\makeatother

\title{Apresentação RLZ}
\author{RLZ}
\date{\today}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}[label=toc]
\tableofcontents
\end{frame}

\AddButton
\section{Test Section}
\begin{frame} test frame \thepage \end{frame}
\begin{frame} test frame \thepage \end{frame}
\begin{frame} test frame \thepage \end{frame}

\end{document}

enter image description here