问题内容
在Rmarkdown中使用CTEX Template+Tinytex 生成含中文的pdf,一开始能顺利成功knit生成pdf,后来,不知道出了什么问题,一直出现以下的错误:
! Unable to load picture or PDF file '0512_files/figure-latex/缁樺埗ang鏁g偣鍥?1.pdf'.
<to be read again>
}
l.178 ...s{0512_files/figure-latex/缁樺埗ang鏁g偣鍥?1.pdf}
错误: Failed to compile 0512.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See 0512.log for more info.
此外: Warning message:
In grepl("==> Fatal error occurred", x[i], fixed = TRUE) :
输入的字符串1不适用于此语言环境
停止执行
我的系统环境
以下是我的sessionInfo:
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.3 htmltools_0.3.6 tools_3.5.3 rticles_0.7 yaml_2.2.0 tinytex_0.12
[7] Rcpp_1.0.1 rmarkdown_1.12 knitr_1.22 xfun_0.6 digest_0.6.18 evaluate_0.13
补充
- 重新安装了tinytex也没有解决问题。
- RMD文件里有多个R代码块,有的代码块有产生图片。
- 其中,0512是我的RMD文件名称
- 其中,乱码文字是RMD文件产生的第一张图片的名称(出现在warning里变成乱码了)
- 按照益辉大佬的debugging添加了
{r include=FALSE}
options(tinytex.verbose = TRUE)
也不能使这个错误消失。
感谢!