我使用了revealjs R包中的一个模板在R中制作演示文稿。
默认情况下,它生成的是一个html文件,在演示时显示浏览器的顶部,包括书签、文件路径等。我可以关闭书签栏,但无法关闭文件路径部分。因为我需要在正式场合进行展示,所以将演示文稿导出为pdf似乎是一个更好的选择。
有人知道如何将其导出为pdf吗?我是否可以在YAML头文件中添加任何内容,以使输出为pdf而不是html?
以下是示例代码,它生成“test.html”文件。我想生成“test.pdf”,同时保留演示文稿的所有其他属性,例如过渡动画、交互式图形等......
---
title: "test"
output: revealjs::revealjs_presentation
---
## R Markdown
This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
## Slide with R Code and Output
```{r}
summary(cars)
```
## Slide with Plot
```{r, echo=FALSE}
plot(cars)
```