Pandoc、Markdown 转 Doc,如何使用变量?

Pandoc, Markdown to Doc, how to use variables?

AFAIK,变量可以在 YAML 外部文件中定义,也可以在 header.

中的 Markdown 文件中定义

然后就可以在文档中使用了。我找到了具有两种不同语法的示例:

问题:

Pandoc 变量只能在 pandoc templates, not the document itself (there's an open issue about that).

中使用

为此,您应该查看 preprocessor like gpp or use a pandoc filter like pandoc-mustache or this lua-filter