r - 无法编译 test.tex。有关调试提示,请参阅 https ://yihui. name/tinytex/r/#debugging。有关更多信息,请参阅 test.log。执行停止

标签 r pdf r-markdown tinytex

output file: test.knit.md

! pdflatex: warning: running with administrator privileges

! Sorry, but C:\Users\jjw11\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe did not succeed.

! The log file hopefully contains the information to get MiKTeX going again:

!   C:\Users\jjw11\AppData\Local\MiKTeX\2.9\miktex\log\pdflatex.log

Error: Failed to compile test.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See test.log for more info.
Execution halted

我在尝试使用 r markdown 生成 pdf 文件时收到此错误消息。

我该如何解决这个问题?我使用 install.packages("tinytex") 安装了 tinytex

我也试过 tinytex::reinstall_tinytex()。但我收到此错误消息
tinytex::reinstall_tinytex()
Error in system2("tlmgr", args, ...) : '"tlmgr"' not found
In addition: Warning message:
In tlmgr(c("info", "--list", "--only-installed", "--data", field,  :
  TeX Live does not seem to be installed. See https://yihui.name/tinytex/.

我使用“tinytex::install_tinytex()”安装了tinytex。

当我使用“tinytex::install_tinytex()”安装 tinytex 时,我收到警告,这意味着已经安装了其他 Latex 发行版。

在使用“tinytex::install_tinytex()”安装tinytex后,我尝试生成pdf文件。

但是这次我收到了这个错误信息。
output file: test.knit.md

"C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.tex --template "C:\PROGRA~1\R\R-35~1.3\library\RMARKD~1\rmd\latex\DEFAUL~3.TEX" --highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes" 
! Package inputenc Error: Unicode character ??(U+B144)
(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
Error: Failed to compile test.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See test.log for more info.
In addition: Warning message:
In grepl("==> Fatal error occurred", x[i], fixed = TRUE) :
  input string 1 is invalid in this locale
Execution halted

我是否必须卸载其他 Latex 发行版?

那么,如何卸载其他 Latex 发行版?

最佳答案

我已经解决了我的问题。
首先,我必须安装 Tex 发行版。
我可以使用 tinytex::install_tinytex() 安装 Tex 发行版.
其次,我使用的是 CJK(中文、日文、韩文)字符。
所以我不得不使用不同的 latex 引擎。
此外,我必须在 YAML header 中设置包含我的语言(韩国)的 mainfont。
我附上了 YAML header ,它解决了我的问题。

title: "Untitled"
author: "jjw"
date: "2019년 10월 17일"
output: 
    pdf_document :
      latex_engine : xelatex
mainfont : NanumGothic

关于r - 无法编译 test.tex。有关调试提示,请参阅 https ://yihui. name/tinytex/r/#debugging。有关更多信息,请参阅 test.log。执行停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58427254/

相关文章:

r - 根据焦点画一个椭圆

css - 将 Rmarkdown 与来自 CDN 的 CSS 结合使用

R:如何更改knitr word中文本的字体和对齐方式

r - 在 RMarkdown 上使用附录时包括引文和引用文献

r - 在某个框架框中获取 Sweave 代码块?

r - 使用带有主动绑定(bind)的引用类时,求值嵌套太深

r - 将双字字符串中两个单词的第一个字母大写

R markdown 格式标题 - pdf 输出

php - 使用 DOMPDF 生成错误的 pdf

PHP在网页上查看PDF并禁止用户下载