首页 > 解决方案 > Rstudio pdflatex.exe 没有成功

问题描述

我目前正在使用 Rstudio 和 R markdown 创建 pdf。但是,每次我尝试编织这些错误消息时都会出现:

! Sorry, but C:\Users\AP\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe did not succeed.

! The log file hopefully contains the information to get MiKTeX going again:

!   C:\Users\AP\AppData\Local\MiKTeX\miktex\log\pdflatex.log

Error: LaTeX failed to compile new-report.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See c2089682-report.log for more info.
In addition: Warning message:
In has_crop_tools() : 
Tool(s) not installed or not in PATH: ghostcript
-> As a result, figure cropping will be disabled.
Execution halted

我尝试卸载/重新安装 MiKTex 并重新启动 Rstudio,但问题仍然存在。我该如何解决这个问题?

标签: rlatexr-markdownmiktex

解决方案


使用新安装的,未安装将文件编织为 PDFMiKTeX所需的许多样式文件。RMarkdown要允许 MiKTeX 即时安装它们,请打开 MiKTeX 控制台并转到Settings选项卡。

有一个选项说You can choose whether missing packages are to be installed automatically (on-the-fly)。确保将其设置为Always以允许安装必要的样式文件。


推荐阅读