在 R Markdown 演示文稿中设置页面持续时间

Setting page duration in R Markdown presentations

我需要为闪电演讲创建一个自动推进的演示文稿。 有没有办法在不编辑中间 .tex 文件的情况下在 R Markdown 中使用 Beamer 的 \hypersetup{pdfpageduration=n} 功能?如果可能的话,我希望能够为每张幻灯片设置不同的时间。我愿意接受使用 html 演示引擎(ioslides 或 Slidy)的解决方案,如果这是一个更简单的选择。

我完全忘记了R Sweave! 这是一个功能示例,它使用 RStudio 中的 R Sweave 格式实现了我的目标。

\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}

您可以使用 \transduration{<seconds>}:

分别设置每张幻灯片的持续时间
---
output: 
  beamer_presentation:
    keep_tex: true
---

# slide 1
\transduration{0.5}


# slide 2
\transduration{0.1}