可以在不指定模板的情况下向 docx 添加页码和页脚吗?

Possible to add page numbers and footer to docx WITHOUT specifying template?

我几个小时前才开始研究 pandoc,所以还有很多我不知道的地方。我知道如果我修改生成的 docx 并添加页脚和页码,那么我可以将其用作模板,但我想知道是否可以在没有模板的情况下使用 pandox 并生成页脚和页码?

我在想这是可能的

pandoc <args> --page_numbers --footer="Created by John Smith"

还是只能使用模板才能实现?

目前没有 docx 格式的默认模板(请参阅 1, 2, 3),因此您无法通过命令行传递页脚文件。

您可以使用 reference-docx 选项提供页脚,但不能覆盖 footer 变量:

pandoc -f markdown --reference-docx=template.docx -t docx input.md -o output.docx

编辑:在模板上添加(从 Word)页码确实有效。