简体   繁体   中英

rmarkdown::pandoc_convert from md to pdf

I am working in Rstudio on Windows. I know minimal Linux

R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763)

I have a markdown file (not an Rmarkdown) that i am trying to convert to a pdf. I am using the command

rmarkdown::pandoc_convert("test.md",to="pdf")

I receive the following error

Unknown writer: pdf
To create a pdf using pandoc, use -t latex|beamer|context|ms|html5
and specify an output file with .pdf extension (-o filename.pdf).

However the functions help has pretty much this exact example.

Advice on what the problem is? Do i need to install something? a pdf writer? What is that? Thanks

Seems to be a bug in rmarkdown because no output was set. You have to use:

rmarkdown::pandoc_convert("test.md", output = "test.pdf")

or

rmarkdown::pandoc_convert("test.md", to = "latex")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM