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

问题描述 投票:0回答:1
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发行版?

r pdf r-markdown tinytex
1个回答
1
投票

我已经解决了我的问题。

首先,我必须安装Tex发行版。

我可以使用“ tinytex :: install_tinytex()”来安装Tex发行版。

第二,我使用的是CJK(中文,日文,韩文)字符。

所以我不得不使用其他乳胶引擎。

此外,我必须在YAML标头中设置包含我的语言(韩国)的mainfont。

我附上了解决问题的YAML标头。

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

© www.soinside.com 2019 - 2024. All rights reserved.