r - 关于TeX二进制文件的Rd2pdf错误

时间:2014-11-02 19:38:31

标签: r package latex reference-manual

我使用devtools和roxygen2在RStudio中创建了一个R包。我打开了项目文件,现在我想把我的函数的所有文档都放到pdf参考手册中。我跑了

system("R CMD Rd2pdf .")

给了我以下错误:

# Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
#  Running 'texi2dvi' on 'Rd2.tex' failed.

# Output:
# You don't have a working TeX binary (tex) installed anywhere in
# your PATH, and texi2dvi cannot proceed without one.  If you want to use
# this script, you'll need to install TeX (if you don't have it) or change
# your PATH or TEX environment variable (if you do).  See the --help
# output for more details.

# For information about obtaining TeX, please see http://www.tug.org.  If
# you happen to be using Debian, you can get it with this command:
#  apt-get install tetex-bin
# Error in running tools::texi2pdf()

我使用OS X 10.10并且安装了MacTeX(它位于我的Applications文件夹中)。我是R和LaTeX的初学者,因此当我说我没有安装正在运行的TeX二进制文件时,我不确定错误消息的含义。我该怎么办?

1 个答案:

答案 0 :(得分:2)

在挖掘之后,我发现我得到的错误与该错误有关 优胜美地升级。

解决方法是按照here上的建议从终端启动RStudio。

当我这样做时,我能够很好地制作参考手册。