How to convert R Markdown to PDF?

后端 未结 8 1190
天命终不由人
天命终不由人 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:35

    Follow these simple steps :

    1: In the Rmarkdown script run Knit(Ctrl+Shift+K) 2: Then after the html markdown is opened click Open in Browser(top left side) and the html is opened in your web browser 3: Then use Ctrl+P and save as PDF .

    0 讨论(0)
  • 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".

    0 讨论(0)
提交回复
热议问题