【问题标题】:Rmarkdown fails at using xelatex engineRmarkdown 无法使用 xelatex 引擎
【发布时间】:2021-01-23 13:35:01
【问题描述】:

我试图在我的文档中指定一种字体样式,但我发现我应该使用特定的乳胶引擎: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了解不多

【问题讨论】:

    标签: r latex r-markdown xelatex tinytex


    【解决方案1】:

    检查您的标题。一些帖子(即here)报告说指定引擎的正确方法是

    output:
      pdf_document:
        latex_engine: xelatex
    

    【讨论】:

    • 是的,对不起。您知道将标题字体更改为另一种的方法吗?比如 Helvetica
    • 这听起来像是另一个问题。
    猜你喜欢
    • 2018-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-21
    • 2017-01-20
    • 2011-12-17
    • 1970-01-01
    相关资源
    最近更新 更多