2

I am trying to create a HTML slides with knitr, Rmarkdown and pandoc. I got a reference from http://rprogramming.net/create-a-slideshow-powerpoint-with-r-knitr-pandoc-and-slidy/.

But I meet a problem at the step5. After executing

knit("test4.Rmd")
system("pandoc -s -t slidy test4.md -o test4.html")

I got a message

pandoc.exe: Could not parse YAML header: found character that cannot start any token "source" (line 13, column 1)

Please help me to solve this problem. Thanks in advance!

Andrie
  • 176,377
  • 47
  • 447
  • 496
Glen Chen
  • 21
  • 2

1 Answers1

0

You can check your line 13 in your md file. and change --- into ----- or more. This is how I solved my problem.

Obviously it has something to do with YAML header. I just got inspiration from another stackoverflow answer, so I figure maybe change the --- with ----(just add more -)can prevent the pandoc from treating it as a YAML block.

Community
  • 1
  • 1
nofacetou
  • 21
  • 2
  • Could you elaborate on your answer? Why does it work? What effects does this change cause? – Xaver Kapeller May 12 '14 at 10:35
  • I think it has something to do with YAML header. I'm new to the YAML thing, I just got inspiration from [another stackoverflow answer](http://stackoverflow.com/questions/19520463/pandoc-cannot-parse-yaml-header-when-converting-md-to-pdf), so I figure maybe change the `---` with `----`(just add more `-`)can prevent the pandoc from treating it as a YAML block. – nofacetou May 12 '14 at 12:16
  • You should edit that into your answer, not just post a comment. – Xaver Kapeller May 12 '14 at 12:18