2017-04-01 65 views
0

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

回答

0

我完全忘了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}