Rpres HTML5演示文稿“另存为PDF”(谷歌浏览器)显示不正确

时间:2013-10-30 21:52:41

标签: html5 r google-chrome pdf rstudio

我正在尝试将Rpres HTML5演示文稿(a new feature of Rstudio)保存为PDF文档,该文档将作为演示文稿讲义(如建议here

问题是输出看起来在pdf中搞砸了,即使对于RStudio提供的基本演示示例也是如此。

如何重新创建问题 - 将其从RStudio中复制到新的.Rpres文件,或者只是打开新的File -> New File -> R Presentation

test
========================================================
author: 
date: 

First Slide
========================================================

For more details on authoring R presentations click the
**Help** button on the toolbar.

- Bullet 1
- Bullet 2
- Bullet 3

Slide With Code
========================================================

```{r}
summary(cars)
```

Slide With Plot
========================================================

```{r, echo=FALSE}
plot(cars)
```

在RStudio中,点击Preview -> View in Browser 在谷歌浏览器中,right-click -> Print...将生成the following messy pdf

2 个答案:

答案 0 :(得分:13)

目前,RStudio没有为Rpresentations提供打印CSS。 As per RStudio support reply here,他们希望添加功能以将PDF直接保存到RStudio中。与此同时,Pandoc是可行的方法。

编辑2014年5月12日:

演示文稿的PDF制作同时在RStudio中实施。您可以使用控件在幻灯片之间导航,从而获得横向格式的精美PDF。 Download preview version 0.98.836 or higher from here。然后点击:

File -> New File -> R Markdown -> Presentation -> Default Output Format = PDF (Beamer)

enter image description here

答案 1 :(得分:3)

您可以使用RStudio打开相应的.md文件,当然您必须先预览.Rpres才能生成.md文件。然后单击“预览”按钮以查看.md文件并在浏览器中将其打开。最后,它可以作为传单打印出来。