【发布时间】:2026-01-04 06:35:01
【问题描述】:
我正在尝试在我的文档中使用 Arial 字体并将 Markdown 转换为 Latex。我在我的乳胶模板中包含以下内容:
\usepackage{fontspec}
\setmainfont{Arial}
当我正常使用它时,这可以工作并将字体更改为 Arial,但是当我使用 Pandoc 转换为 PDF 时,我收到错误:
Error producing PDF.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Fatal fontspec error: "cannot-use-pdftex"
!
! The fontspec package requires either XeTeX or LuaTeX.
!
! You must change your typesetting engine to, e.g., "xelatex" or
! "lualatex"instead of plain "latex" or "pdflatex".
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.28 \msg_fatal:nn {fontspec} {cannot-use-pdftex}
它说这个包需要 XeTeX 或 LuaTex。我已经尝试了很多方法来将字体更改为 Arial,但到目前为止没有任何效果。
我使用 OS X。
【问题讨论】: