欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Rmd输出pdf报错

程序员文章站 2024-02-14 17:23:46
...

复现

! Package inputenc Error: Unicode character 娉?(U+6CF0)
(inputenc) not set up for use with LaTeX.
Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see https://bookdown.org/yihui/rmarkdown/pdf-document.html
错误: Failed to compile 泰坦尼克号乘客生存率.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See 泰坦尼克号乘客生存率.log for more info.
此外: Warning message:
In grepl("==> Fatal error occurred", x[i], fixed = TRUE) :
输入的字符串1不适用于此语言环境
停止执行

解决

在文件头部pdf输出上配置下列文件

 output:
     pdf_document:
         latex_engine: xelatex

参考

  1. https://*.com/questions/32794157/package-inputenc-error-unicode-char-u8-in-rstudio
  2. https://github.com/rstudio/rmarkdown/issues/1450
相关标签: BUG记录