Search code examples
pandocr-markdownslidify

Pandoc Error in Slidify: Customizing First Slide Goes Wrong


I am using "slidify", "slidifyLibraries" and R Version 3.1.2 + RStudio Version 0.98. To knit the slidify slides I use the knitHTML-button.

I have my own styles that I would like to use, but when I add a class tag, id tag or both to the first slide (code directly after YAML's ---), I get this error message:

pandoc.exe: Could not parse YAML header: UnexpectedEvent {_received =    Just EventDocumentStart, _expected = Just EventStreamEnd} "source" (line 1, column 1)

I do have the YAML metadata specified, but I guess, adding a tag after the --- somehow prevents pandoc from recognizing te YAML header.

So, this .Rmd doesn't work:

---
framework   : impressjs     # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js  # {highlight.js, prettify, highlight}
hitheme     : tomorrow      # 
mode        : selfcontained # {standalone, draft}
knit        : slidify::knit2slides
--- .slide 

First Slide

--- x:1000 y:1500

Second Slide

If I apply the class, id tag or both to other slides, it works! Also, I'm having the same error in both impressjs and revealjs framework (I haven't tested others, but I don't think it's a framework issue).

I'd be grateful for help.


Solution

  • I had the same problem today and this is how I solved it. Use slidify("file.Rmd") instead of knit button in Rstudio.