rmarkdown:手动指定 pandoc 路径? [英] rmarkdown: specify manually pandoc path?

查看:148
本文介绍了rmarkdown:手动指定 pandoc 路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 rmarkdown 文档,我用 rmarkdown::render

I have a rmarkdown document that I render regularly with rmarkdown::render

它在我的计算机 (Windows) 上运行良好,因为我安装了 RStudio,并且它自动设置了 pandoc 的路径.

It works fine on my computer (Windows) as I have RStudio installed, and it has setup automatically the path to pandoc.

但是,当我尝试在我的服务器上(在 RStudio 之外)运行它时,它失败了,错误是找不到 pandoc.

However when I try to run it on my server (outside RStudio), it fails with error that pandoc is not found.

如何从我的脚本手动设置 pandoc 的路径?无需更改服务器上的配置.

How can I set up manually the path the pandoc from my script? Without changing the configuration on the server.

我试过了,但没有用:

Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc/pandoc.exe")

推荐答案

建议设置pandoc的系统路径(Windows 10指令):
1.在开始菜单中,搜索编辑系统环境变量"
2. 此时,Windows 可能会要求您输入用户名 + 密码(对于有权更改系统设置的用户)
3. 单击环境变量"按钮
4. 在窗口的下部部分(系统变量),选择带有路径"的行,然后单击编辑"
5.添加pandoc.exe所在文件夹的路径,但包括pandoc.exe"或末尾的斜线

I suggest to set the system path for pandoc (Windows 10 instructions):
1. In the Start menu, search for "Edit the system environment variables"
2. At this point, Windows may ask you for username + password (for a user with permission to change system settings)
3. Click "Environment Variables" button
4. In the lower part of the window (System variables), select the line with "Path" and click Edit
5. Add the path to the folder where pandoc.exe is, but not including "pandoc.exe" or a slash at the end

这篇关于rmarkdown:手动指定 pandoc 路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆