latex - 我可以将 Pandoc 排版引擎更改为 XeTeX 或 LuaTex 吗?
问题描述
我正在尝试在我的文档中使用 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。
解决方案
在使用 Pandoc 创建 pdf 时使用 LuaTex:
pandoc test.txt --pdf-engine=lualatex -o test.pdf
相应地申请 XeTex:
pandoc test.txt --pdf-engine=xelatex -o test.pdf
来自 Pandoc手册:
--pdf-engine=pdflatex|lualatex|xelatex|wkhtmltopdf|weasyprint|prince|context|pdfroff
生成 PDF 输出时使用指定的引擎。默认为 pdflatex。如果引擎不在您的 PATH 中,则可以在此处指定引擎的完整路径。
查看手册的演示部分- 大多数用例都包含在其中。
推荐阅读
- ansible - ansible - 无法访问嵌套列表中的项目
- python - 如何用百分比编写一个计算公式来用python构建一个金融计算器?
- java - Maven多模块依赖解析
- css - mat-tab-group 宽度对 flex 中的宽度 100% 容器没有反应
- azure-active-directory - Azure B2C 启用诊断日志以与请求订阅的日志分析集成,即使租户已经喜欢订阅
- javascript - 如何将属性添加到数组中的对象?
- python - 我有什么方法可以使此代码与 elif 中的嵌套 if 一起使用?
- python - 减少广播和求和的内存使用
- android - 以下代码和 android 应用程序停止工作
- android - 在 android studio 我使用 AppCompat api28 ,如何更改 style.xml 文件中的工具栏属性,如背景颜色等?