简体   繁体   English

rmarkdown::pandoc_convert 从 md 到 pdf

[英]rmarkdown::pandoc_convert from md to pdf

I am working in Rstudio on Windows.我在 Windows 上的 Rstudio 工作。 I know minimal Linux我知道最小的 Linux

R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763) R 版本 3.6.1 (2019-07-05) 平台:x86_64-w64-mingw32/x64 (64-bit) 运行于:Windows 10 x64 (build 17763)

I have a markdown file (not an Rmarkdown) that i am trying to convert to a pdf.我有一个 markdown 文件(不是 Rmarkdown),我正在尝试将其转换为 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? pdf 作家? What is that?那是什么? Thanks谢谢

Seems to be a bug in rmarkdown because no output was set.似乎是 rmarkdown 中的一个错误,因为没有设置 output。 You have to use:你必须使用:

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

or或者

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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