如何解决工具未安装或不在路径中:pdfcrop
我是 R 的新手,只是尝试将我的第一个 R Markdown 编织为 pdf 作为我正在做的课程的一部分。被警告消息卡住了(下面以粗体突出显示)。生成了 PDF,但根本没有裁剪图表。看起来不知何故 RStudio 无法找到 pdfcrop,尽管它已安装。我认为将它添加到路径中可能会起作用,但不确定如何执行此操作。 以前,与 Ghostscript 有相同的问题,通过运行解决了 Sys.setenv(R_GSCMD="C:/Program Files/gs/gs9.54.0/bin/gswin64.exe").
非常感谢任何帮助和输入。提前致谢。
我做的步骤:
- 从 LateX 发行版安装 TinyTex。
- 已安装的 Ghostscript
- 使用 tinytex::tlmgr_install("pdfcrop") 安装 pdfcrop
- Sys.which('pdfcrop'),它给出一个空字符串 - "" 我使用的是 Windows 操作系统和 Rstudio。
输出创建:MyFirstRMarkDown.pdf 警告信息: 在 has_crop_tools() 中: 工具未安装或不在 PATH 中:pdfcrop -> 因此,图形裁剪将被禁用。
以下是源文件:
---
title: "My first R Markdown doc"
author: Sanjukta Samom
output: pdf_document
---
```{r setup,include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML,PDF,and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
```{r}
print("Hello World")
```
## Including Plots
You can also embed plots,for example:
```{r pressure,echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。