I need to create an auto advancing presentation for a lightning talk.
Is there a way to use the \hypersetup{pdfpageduration=n}
functionality from Beamer within R Markdown without editing the intermediate .tex file? If possible, I would like to be able to set a different time for each slide. I'm open to solutions that use the html presentation engines (ioslides or Slidy) if this is an easier alternative.
Asked
Active
Viewed 136 times
0

samcarter_is_at_topanswers.xyz
- 33,336
- 5
- 41
- 62

silastittes
- 65
- 6
2 Answers
1
I completely forgot about R Sweave! Here's a functioning example that addresses my goals using the R Sweave format in RStudio.
\documentclass[usepdftitle=false]{beamer}
\usetheme{boxes}
\usecolortheme{seahorse}
\title{Test}
\author{Silas Tittes}
\institute{\normalsize University of Colorado Boulder}
\date{\today}
\begin{document}
\SweaveOpts{concordance=TRUE}
\frame{
\hypersetup{pdfpageduration=2} %2 seconds
\titlepage
}
\begin{frame}[fragile]{Example Slide}
\hypersetup{pdfpageduration=2} %2 seconds
\begin{columns}
\begin{column}{0.4\linewidth}
\begin{itemize}
\item R includes a powerful and flexible system (Sweave) for creating dynamic reports and reproducible research using LaTeX.
\item Warning, more time will be spent tinkering with options than you ever thought would be possible.
\end{itemize}
\end{column}
\begin{column}{0.7\linewidth}
<<mtcarsplot, fig=TRUE, echo=FALSE>>=
par(cex.lab = 2.2, cex.axis = 1.5, mar = c(5,5,1,2))
plot(x = mtcars$mpg, y = mtcars$wt,
cex = 2.5*mtcars$hp/max(mtcars$hp), pch = 19,
xlab = "Car weight", ylab = "MPG")
@
\end{column}
\end{columns}
\end{frame}
\end{document}

silastittes
- 65
- 6
0
You can set the duration on each slide separately by using \transduration{<seconds>}
:
---
output:
beamer_presentation:
keep_tex: true
---
# slide 1
\transduration{0.5}
# slide 2
\transduration{0.1}

samcarter_is_at_topanswers.xyz
- 33,336
- 5
- 41
- 62