如何解决Rmarkdown 无法使用 xelatex 引擎
我试图在我的文档中指定字体样式,但我发现我应该使用特定的 Latex 引擎:xelatex
。但是,当我在 YAML 标头中指定以下指令时:
---
title: BLABLA - me
output:
pdf_document: default
engine: xelatex
header-includes:
- \usepackage{fontspec}
- \setmainfont{Times New Roman}
fontsize: 12pt
---
由于错误,我无法编译我的文档:
! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec) LuaTeX.
(fontspec)
(fontspec) You must change your typesetting engine to,(fontspec) e.g.,"xelatex" or "lualatex"instead of
(fontspec) "latex" or "pdflatex".
我已经安装了 tinytex
包,但我对 Latex 了解不多
解决方法
检查您的标题。一些帖子(即 here)报告说指定引擎的正确方法是
output:
pdf_document:
latex_engine: xelatex
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。