诊断 R 包构建错误:pdfLatex 不可用 [英] Diagnosing R Package build Error: pdfLatex Not Available

查看:129
本文介绍了诊断 R 包构建错误:pdfLatex 不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 R 中构建一个包.我制作了骨架,然后运行命令R CMD check package1.我在此处.我按照解决步骤操作,结果是:

  1. devtools 不适用于 R 2.15.1

  2. R CMD Rd2pdf package1中打孔.

<块引用>

嗯..看起来像一个包裹将 Rd 文件转换为 LaTeX从 LaTeX 创建 pdf 输出texi2dvi 中的错误(文件=文件,pdf=true,干净=干净,安静=安静,:pdflatex 不可用运行工具时出错::texi2pdf

  1. 我查找了这个,安装了完整的 tex live&MiKTeX.出现了相同的错误消息.
  2. 我导航到 pdflatex 所在的目录并尝试从那里运行命令.没有帮助.

我在这里遗漏了什么,或者有什么解决方法?或者,有没有办法在包创建过程中抑制 pdf 生成?

更新:当我在 LINUX (CentOS) 中尝试时没有抛出这个错误.

解决方案

虽然您已经在 Windows 下安装了 MikTeX,但这并不能使其对 R 可用.您需要将 latex 可执行文件的位置添加到您的 PATH 环境变量中.如何做到这一点完全取决于您的 Windows 版本.例如,此链接 描述了如何为 Windows 7 执行此操作.谷歌搜索更改环境variables (windows 7|windows xp|windows 95) 会告诉你如何改变你的环境变量.

I am trying to build a package in R. I made the skeleton, and ran the command R CMD check package1. I got an an error described here. I followed the solution steps, and the results are:

  1. package devtools not available for R 2.15.1

  2. punched in R CMD Rd2pdf package1.

Hmm.. Looks like a package
Converting Rd files to LaTeX
Creating pdf output from LaTeX
Error in texi2dvi(file=file, pdf=true, clean=clean, quiet=quiet, : pdflatex not available
Error in running tools::texi2pdf

  1. I looked up this amongst other things, installed the complete tex live & MiKTeX. Same error message showed up.
  2. I navigated to the directory where pdflatex is located and tried running the command from there. Didn't help.

Is there something I'm missing here, or is there a workaround? Or maybe, Is there a way to suppress pdf generation during package creation?

UPDATE: This error was not thrown when I tried it in LINUX (CentOS).

解决方案

Although you have installed MikTeX under Windows, this does not make it available to R. You need to add the location of the latex executables to your PATH environment variable. How to do this exactly depends on your Windows version. For example, this link describes how to do this for Windows 7. Googling for change environment variables (windows 7|windows xp|windows 95) will tell you how to change your environment variables.

这篇关于诊断 R 包构建错误:pdfLatex 不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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