【发布时间】: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