【问题标题】:R studio on Mac, how to knit to pdf?Mac上的R工作室,如何编织成pdf?
【发布时间】:2020-05-26 02:28:01
【问题描述】:

我在 R studio 的 knit 功能上遇到了一些问题。看起来它已经完成了“100%”? 但随后显示如下错误消息,并要求我安装 Latex。我遵循指南并成功安装了 MacTex。然而,同样的消息再次出现。
我想知道我可能错过了一些步骤吗?因为安装后我没有做任何其他事情,我应该将它与 r studio 连接/像库一样加载它吗? 谢谢!


! sh: pdflatex: command not found

Error: LaTeX failed to compile 6501-hw1.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See 6501-hw1.log for more info.
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
  error in running command
Execution halted

No LaTeX installation detected (LaTeX is required to create PDF output). You should install a LaTeX distribution for your platform: https://www.latex-project.org/get/

  If you are not sure, you may install TinyTeX in R: tinytex::install_tinytex()

  Otherwise consider MiKTeX on Windows - http://miktex.org

  MacTeX on macOS - https://tug.org/mactex/
  (NOTE: Download with Safari rather than Chrome _strongly_ recommended)

  Linux: Use system package manager

[在此处输入图片描述][1][1]:https://i.stack.imgur.com/BnBaf.png

【问题讨论】:

  • 如果没有其他原因,请使用TinyTeX。现在推荐给rmarkdown
  • 您使用的是哪个平台/操作系统?尝试先运行installr::install.MikTeX() 以便能够安装Latex,然后您可以将markdown 编织成pdf

标签: r macos latex


【解决方案1】:

如果您尝试运行“tinytex::install_tinytex()”,请关闭 RStudio,重新打开它,然后 knit 应该可以工作了。

【讨论】:

    猜你喜欢
    • 2015-04-04
    • 1970-01-01
    • 2020-01-25
    • 2018-09-05
    • 1970-01-01
    • 2021-10-18
    • 1970-01-01
    • 1970-01-01
    • 2020-06-07
    相关资源
    最近更新 更多