Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
It worked just fine! –  Luan Resende May 17 '13 at 17:24
1  
@LuanResende I've updated my answer with a simpler and more general solution (it's at the beginning of my answer now). –  Gonzalo Medina May 17 '13 at 19:15
    
I was already using the background canvas template to define a transparent background image for the slides. Fortunately, there was no conflict, except that the image used by me was "ofuscating" the button. I corrected it using \node[anchor=east] at ([yshift=30pt,xshift=0em]current page.south east). Thanks for the effort (since I can't upvote your answer again). –  Luan Resende May 17 '13 at 19:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.