How to convert R Markdown to PDF?

后端 未结 8 1198
天命终不由人
天命终不由人 2020-11-28 00:36

I\'ve previously asked about the commands for converting R Markdown to HTML.

What is a good way to convert R Markdown files to PDF documents?

8条回答
  •  萌比男神i
    2020-11-28 01:22

    I think you really need pandoc, which great software was designed and built just for this task :) Besides pdf, you could convert your md file to e.g. docx or odt among others.

    Well, installing an up-to-date version of Pandoc might be challanging on Linux (as you would need the entire haskell-platform˙to build from the sources), but really easy on Windows/Mac with only a few megabytes of download.

    If you have the brewed/knitted markdown file you can just call pandoc in e.g bash or with the system function within R. A POC demo of that latter is implemented in the Ṗandoc.convert function of my little package (which you must be terribly bored of as I try to point your attention there at every opportunity).

提交回复
热议问题