gpt4 book ai didi

r - 使用带有绘图的 RStudio/knitr 编译 PDF 时出错

转载 作者:行者123 更新时间:2023-12-02 01:42:08 24 4
gpt4 key购买 nike

已经在 RStudio 帮助上发布了这个,但看看这里是否有人有任何想法。当我尝试使用 RStudio 在文档中绘制带有绘图的 PDF 时,出现以下错误。当我尝试在没有绘图的情况下编织 PDF 时不会发生错误,当我用绘图编织 HTML 时也不会发生错误。我在 Mac 上安装 Yosemite。

sh: line 1: 3234 Trace/BPT trap: 5 gs -dSAFER -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop -f fcmb_files/figure-latex/unnamed-chunk-2-1.pdf 2>&1 > /dev/null
!!! Error: Ghostscript exited with error code 133!
output file: fcmb.knit.md

! Undefined control sequence.
l.98 \begin{center}\includegraphics

pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43

编辑:罪魁祸首似乎是由于某种原因没有添加 graphicx 包。我通过包含

破解了一个解决方案

header-includes:\usepackage{graphicx}

在我文档的开头。

最佳答案

我也收到错误 "sh: line 1: Trace/BPT trap: 5 gs -dSAFER -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop -f .pdf 2>&1 >/dev/null !!! 错误:Ghostscript 已退出,错误代码为 133!”
当我在带有 Yosemite 的 Mac 上使用命令“pdfcrop”时。这是因为 Ghostscript 在 Yosemite 上被破坏了:https://tug.org/mactex/yosemite.html .因此,您可能需要安装 Ghostscript 9.15 软件包。

关于r - 使用带有绘图的 RStudio/knitr 编译 PDF 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27952087/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com