R pandoc() via knitr: How to define a configuration file to make it reflect my commandline Pandoc call?

StackOverflow https://stackoverflow.com/questions/20446271

  •  30-08-2022
  •  | 
  •  

Domanda

I cannot find any thorough description of how to define configuration file for a document conversion with the knitr package pandoc() function. I do know this document by YIHUI XIE, but still find it difficult to receive an equivalent of the following Pandoc commandline call:

pandoc -t slidy -s pander_test.md -o pander_test_slidy.html

in R. I tried (with the configurations embedded in my .md file):

<!--pandoc
t: slidy
s:
o: pander_output_slidy.html
-->

And the R console said:

> pandoc("pander_test.md")
executing pandoc  -t slidy -s -o pander_output_slidy.html -f markdown -t html -o  pander_test.html "pander_test.md"
[1] "pander_test.html"

Which:

  • looks differently from the commadline Pandoc call I would like to reflect to,
  • generates the result different from what I expect (I receive plain HTML, not slides as I would like to).

Any suggestions / references? Thank you in advance for any help.

È stato utile?

Soluzione

Call pandoc("pander_test.md", format = 'slidy'), and use the configuration

<!--pandoc
s:
o: pander_output_slidy.html
-->
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top