carl
Below I show a simple example of Beamer slides. I want to place a beamerbutton vertically to my footline. I know the way of \btVFill, which is very close to what I am looking for.

I would like to place the button directly next to the frame number, however, I only need the button on a few slides and so putting it in the footline does not seem like the right way to go.

Any thoughts on how to achieve this?

Code:


\documentclass{beamer}

\setbeamertemplate{footline}{
\hspace*{0.2cm}
Author
\hfill
\hspace*{0.2cm}
\vspace{0.3cm}
}

\newcommand{\btVFill}{\vskip0pt plus 1filll}

\begin{document}
\begin{frame}
\btVFill\hfill\beamerbutton{Button}
\end{frame}
\end{document}


Expected Result:
![tex.JPG](/image?hash=7fdec98cdea539e45a566994744185bf4275b59eb47cd261f1187ec4a57b85fe)
samcarter
## Beamer solution

If the button should only be displayed on some slides, you can still temporarily add them to the footline by making any changes inside a group {...}:


\documentclass{beamer}

\setbeamertemplate{footline}{
\hspace*{0.2cm}
Author
\hfill
\hspace*{0.2cm}
\vspace{0.3cm}
}

\begin{document}

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

\begin{frame}
content...
\end{frame}

\end{document}


If you need this for more (non-consecutive) frames, you could make a custom frame option out of this, see

for an example how to do this.

And just for completes, here also the code for adding the button for the whole presentation:


\documentclass{beamer}

\setbeamertemplate{footline}{
\hspace*{0.2cm}
Author
\hfill
\hspace*{0.2cm}
\vspace{0.3cm}
}

\begin{document}

\begin{frame}
\end{frame}

\begin{frame}
content...
\end{frame}

\end{document}


(the page number in head/foot template needs beamer version 3.54 or newer)

## Rmarkdown solution

### Edit 1:

Rmarkdown makes all this a bit more complicate, but one could hack it by showing the button only on predefined framenumbers.

For example


\raisebox{-0.5ex}{
\fi


will only show the button on the second frame. To add it to more frames, either repeat the code or, if you want the button on several consecutive frames, use some ifcase with > and <.

The other difficulty is to get a label for the link target. In normal beamer that is so easy with \begin{frame}[label=quack], but in markdown you have to make a lucky guess on what name markdown will use for the labels it automatically created. For example if you want to link to a frame with the title slide 3, the automatic label seems to be slide-3. Replace this with whatever frame you want to link to


---
output:
beamer_presentation:
keep_tex: true
---

# slide 1

test

# slide 2

test

# slide 3

test


### Edit 2:

Totally different approach: one can also use tikz to position the button


---
output:
beamer_presentation:
keep_tex: true
- \include{preamble}
---

# slide 1

test

# slide 2

\mybutton{slide-3}{some text}

test

# slide 3

test


with preamble.tex:



\setbeamertemplate{footline}{
\hspace*{0.2cm}
Author
\hfill
\hspace*{0.2cm}
\vspace{0.3cm}
}
\usepackage{tikz}

\newcommand{\mybutton}[2]{%
\begin{tikzpicture}[remember picture, overlay]
\node[xshift=-1.5cm, yshift=0.4cm] at (current page.south east) {\hyperlink{#1}{\beamerbutton{#2}}};
\end{tikzpicture}
}


Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.