How to convert R Markdown to PDF?

后端 未结 8 1200
天命终不由人
天命终不由人 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条回答
  •  情歌与酒
    2020-11-28 01:39

    Only two steps:

    1. Install the latest release "pandoc" from here:

      https://github.com/jgm/pandoc/releases

    2. Call the function pandoc in the library(knitr)

      library(knitr)
      pandoc('input.md', format = 'latex')
      

    Thus, you can convert your "input.md" into "input.pdf".

提交回复
热议问题