首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有在R中加载tikzDevice包

没有在R中加载tikzDevice包
EN

Stack Overflow用户
提问于 2017-01-29 02:34:21
回答 3查看 521关注 0票数 2

在我的R上加载tikz包时遇到了问题:

代码语言:javascript
复制
> require(tikzDevice)
Loading required package: tikzDevice
Warning message:
In fun(libname, pkgname) : 

tikzDevice: No appropriate LaTeX compiler could be found.
Access to LaTeX is required in order for the TikZ device
to produce output.

The following places were tested for a valid LaTeX compiler:

    the global option: tikzLatex
    the environment variable: R_LATEXCMD
    the environment variable: R_PDFLATEXCMD
    the global option: latexcmd
    the PATH using the command: pdflatex
    the PATH using the command: latex
    the PATH using the command: /usr/texbin/pdflatex

If you have a working LaTeX compiler, try one of the
following solutions:

    Set the path to your compiler as the value of either latexcmd or
    tikzLatex in .Rprofile using options().

    Set the path to your compiler as the value of either R_LATEXCMD or
    R_PDFLATEXCMD in .Renviron.

    Ensure the folder containing your compiler is included in PATH.

奇怪的是,当我使用终端时,我可以很好地运行我的脚本。知道GUI发生了什么吗?

我在MacOS 10.12.3上运行R3.3.2。我使用TexShop,这是我用MacTEX下载的。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2017-08-23 21:53:17

这一点很容易解决:

代码语言:javascript
复制
options(tikzLatex = "PATH")

用LaTeX编译器的路径替换PATH。您可以通过在终端中为Mac用户键入以下内容来发现这一点:

代码语言:javascript
复制
which pdflatex
票数 0
EN

Stack Overflow用户

发布于 2018-10-18 17:45:31

这对最近升级了操作系统的其他Mac用户可能是有用的。这对我来说是有效的,而不是一个与tikzDevice包相关的问题,而是因为Mac删除了编译pdflatex的路径(因为苹果开始阻止用户在usr/文件夹中安装胶乳项目,请参见MacTex f.a.q. on el Capitan的完整解释)。

我建议如下:

  1. 下载和安装MacTex
  2. 指定要在texshop/texworks中编译的路径,而不是usr/bin put /Library/TeX/texbin
  3. 现在检查tikzDevice是否在您的GUI中工作(应该是现在!)
票数 0
EN

Stack Overflow用户

发布于 2022-08-14 03:25:33

在碰到相同的问题/完全相同的输出后,我遇到了这个页面,但是在Windows 11下。

我用tinytex。所以对我来说解决问题的是

options("tikzLatex"=tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe'))

就在我的文档顶部,在第一个安装块中,在调用library(tikzDevice)之前。我试过很多其他的东西,但是不断地碰到上面的错误.真的把我逼疯了!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41917088

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档