【问题标题】:Package pdftex.def Error: File not found: using draft setting包 pdftex.def 错误:找不到文件:使用草稿设置
【发布时间】:2019-04-10 20:09:38
【问题描述】:

虽然用 html 渲染很好,但 Rmd 没有渲染!有一个similar question,但没有得到答复。 jpg 也位于本地目录中,因为乳胶无法处理 http// 路径

这里是一个可复现的例子(图片存在,html模式下可以渲染):

---
title: 'Title'
author: "SQC"
date: "30 march 2019"
output:
  pdf_document:
    toc: yes
    toc_depth: '2'
  html_document:
    keep_md: yes
    number_sections: yes
    toc: yes
    toc_depth: 2
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

Some text.

![text](C:/path2/file.jpg){width=500px}

more text...

评论:按照链接答案中的建议,我添加了

```{r}
getwd()
list.files("C:/path2/", full.names=TRUE)
```

那么错误就是

"C:/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to 乳胶——来自 markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.tex --table-of-contents --toc-depth 2 --template "C:\R\R-3.5.1\library\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes" 输出文件:test.knit.md

! LaTeX 错误:找不到文件“fancyvrb.sty”。

!紧急停止。

Fehler:无法编译 test.tex。有关更多信息,请参阅 test.log。 安然无恙

再次,我通过重新编写 html 知道一切正常:路径存在,文件存在并被列出。

【问题讨论】:

  • 见这里:github.com/rstudio/rmarkdown/issues/359 你必须安装一些额外的乳胶包。
  • @J_F 我现在不想改变我正在运行的 miktex。但可能还有另一种解决方案here。不幸的是,这现在不起作用:parse error - unexpected end of input; expected '}'

标签: windows r-markdown jpeg


【解决方案1】:

最后,“解决方案”很简单:我只需要按照建议更改包的路径,例如here.

=> 运行“miktex-console_admin.exe” => 转到 Packages => Install from... 我也改成了 Uni-Hagen。

PS:我不知道在 Windows 机器上工作是否必要。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-29
    • 1970-01-01
    • 2019-03-28
    • 1970-01-01
    • 2010-12-25
    相关资源
    最近更新 更多