Pandoc 在 `lang: hu` 中使用引号时会产生错误

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

MWE:

---
lang: hu
---

"Test quotation"

如果我运行

pandoc test.md -o test.pdf
,我会收到以下错误:

Error producing PDF.
! Undefined control sequence.
l.66 `

这似乎是由于匈牙利语言设置而发生的。我该如何避免这种情况?如果我从 YAML 块中删除

lang: hu
pandoc
会成功构建 pdf 文件,但当然带有英文引号。我想要本地化的匈牙利引号...

latex markdown pandoc xelatex typesetting
2个回答
1
投票

发生这种情况是因为 pandoc 默认使用 pdfTeX,而不是 XeLaTeX。通过将选项

--pdf-engine=xelatex
添加到您的 pandoc 调用中来指定您的首选引擎。 (该选项在 pandoc 2 之前被命名为
--latex-engine=xelatex
。)


0
投票

我知道这是一个太老的问题,但在线搜索将我带到了这里,所以这是我的解决方案,它可以生成带有正确本地化引号的 PDF。

---
lang: hu
---

"Test quotation"

"Another test quotation"

使用此命令:

pandoc --pdf-engine=xelatex -o example.pdf example.md

它生成带有错误引用的 PDF:

“Test quotation”
“Another test quotation”

但是鉴于您已安装 csquotes,此文档:

„Test quotation”
„Another test quotation”
© www.soinside.com 2019 - 2024. All rights reserved.