Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rpres HTML5 presentation "Save As PDF" (Google Chrome) displays incorrectly

I am trying to save the Rpres HTML5 presentation (a new feature of Rstudio) as PDF document, which will serve as a presentation handout (as suggested here )

The problem is that the output looks messed up in the pdf, even for the basic presentation example supplied with the RStudio.

How to recreate the problem - copy this to new .Rpres file from within RStudio, or just open new 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)
```

Within RStudio, click Preview -> View in Browser Within Google Chrome, right-click -> Print... will produce the following messy pdf

like image 216
Daniel Krizian Avatar asked Oct 30 '13 21:10

Daniel Krizian


1 Answers

At the moment, RStudio doesn't come with a print CSS for the Rpresentations. As per RStudio support reply here, they are looking to add the feature to save as PDF directly into RStudio. In the meantime, Pandoc is the way to go.

EDIT May 12, 2014:

PDF production of presentations has in the meantime been implemented in RStudio. You can get nice PDF in landscape format with controls to navigate between slides. Download preview version 0.98.836 or higher from here. Then click:

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

enter image description here

like image 99
Daniel Krizian Avatar answered Sep 22 '22 01:09

Daniel Krizian