尝试编织 R markdown 时出错:!包 inputenc 错误:Unicode 字符锛?(U+FF0C) (inputenc) 未设置为与 LaTeX 一起使用

问题描述 投票:0回答:2

该错误显然与 Latex 有关,我已尽力 google 并解决它,但我得到的只是更多错误。

初始错误:

! Package inputenc Error: Unicode character 锛?(U+FF0C)
(inputenc)                not set up for use with LaTeX.

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. See https://bookdown.org/yihui/rmarkdown-cookbook/latex-unicode.html
错误: LaTeX failed to compile Jan-26-in-class-code.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Jan-26-in-class-code.log for more info.
此外: Warning message:
In grepl("==> Fatal error occurred", x[i], fixed = TRUE) :
  输入的字符串1不适用于此语言环境
停止执行

所以我尝试了xelatex。然后我就得到了

! LaTeX Error: File `unicode-math.sty' not found.

! Emergency stop.
<read *> 

! Unfortunately, the package unicode-math could not be installed.

! Please check the log file:

! C:\Users\86188\AppData\Local\MiKTeX\2.9\miktex\log\xelatex.log

错误: LaTeX failed to compile Jan-26-in-class-code.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Jan-26-in-class-code.log for more info.
停止执行

我想问题是我的计算机上没有安装“unicode-math”,所以我尝试了 install.packages(“unicode-math”),然后我得到了

Warning in install.packages :
  package ‘unicode-math’ is not available for this version of R

我真诚地感谢任何指示或建议。谢谢!

r latex r-markdown pdflatex xelatex
2个回答
1
投票

unicode-math 是一个 LaTeX 软件包而不是 R 软件包,因此需要使用 LateX 软件包管理器进行安装;如果使用 TeX Live 发行版,则为 tlmgr,或者使用带有 MiKTeX 的 MiKTeX Console(通常是 Windows 上的主要 TeX 发行版)。


0
投票

很可能你用的是普通话版本的逗号(,)而不是(,)我遇到了同样的问题。真的只是一个错字

如果您想调整它,可以使用搜索(Ctrl+F)并输入错误版本的逗号并修复它。希望这有帮助!

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