andy
andy

Reputation: 194

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

Upvotes: 2

Views: 639

Answers (1)

J_F
J_F

Reputation: 10372

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")

Upvotes: 1

Related Questions