12

Currently there seem to be two ways to do presentations in R:

To me, it looks like the latter is slightly more powerful. The input format is very similar, yet not identical. I'm thinking about converting an RStudio presentation to rmarkdown. What's the best way to do this? How about the conversion back?

On that note, I'd really like to see an "in-pane" preview for rmarkdown presentations in RStudio, just like for RStudio presentations. I wonder why this isn't implemented -- the preview forcibly shows up in a modal window. Technical issues?

krlmlr
  • 25,056
  • 14
  • 120
  • 217
  • 4
    The reason in-pane preview isn't implemented for rmarkdown has to do with the ioslides format, which is the default for rmarkdown presentations. It's got a lot of absolute sizes baked into it, and consequently looks and behaves poorly when placed in a small/embedded space. These challenges can be overcome with enough elbow grease/CSS/JS, so it's not unlikely that .Rmd presentations will render in a pane at some point in the future. – Jonathan Sep 11 '14 at 16:58
  • @Jonathan: Thanks for your feedback. Does your browser component support scaling, just like the "zoom" functionality in Chromium and Firefox? Then you could still render even ioslides at their desired dimension and simply scale down. I understand that `.Rpres` uses reveal.js under the hood -- perhaps preview pane could be enabled for those `.Rmd` presentations that use reveal.js? – krlmlr Sep 13 '14 at 19:47

1 Answers1

8

To change from .Rpres to .Rmd you need to change file extension (easy) and the front matter of the markdown document (slightly more involved).

A .Rpres file places the front matter on the first slide:

Untitled
=============================
author: Your Name Here
date: 4 July, 2015

while a .Rmd document places the front matter in a special block:

---
title: "Untitled"
author: "Your Name Here"
date: "04 July, 2015"
output: ioslides_presentation
---

The rest of your presentation code remains in rmarkdown, and should require minimal work to convert.

Some exceptions that I can think of immediately include

  • ioslides/slidify don't support columns via *** (a real shame, as this is so convenient)
  • Rpres doesn't support citations and a bibliography (also a shame)

Additionally, when converting you will need to look for any speciall CSS or other directives that are only supported by one framework.

Brian G. Peterson
  • 3,531
  • 2
  • 20
  • 21
  • 1
    Late comment, but for other readers: Slidify has a workaround for two column layouts: http://slidify.org/customize.html (see the section "Customizing Layouts") – R Yoda Nov 21 '15 at 22:48