ms-word - 如何指定用于使用 pandoc 导出的 word doc 的字体?

标签 ms-word markdown pandoc

使用 pandoc 渲染 Microsoft Word 文档。字体似乎默认为 口径 用于标题和 Cambri 对于正文。目标是让文件使用 Arial 或 Times 罗马字体。

我不想触摸/编辑/与word中的文件有任何关系。

如何从多 Markdown 源或在对 pandoc 的调用中设置将在 Word™ 中使用的字体?

Pandoc 命令:

pandoc -s my_markdown.txt -o whycambriafont.docx

这个问题:pandoc-generated docx misses italic variables in equations显示了一种通过创建 zip 文件然后编辑样式文件来编辑字体样式的方法,但这是一种杂乱无章的方法。

最佳答案

您可以提供带有 --reference-doc option 的 reference.docx 文件到 pandoc 有点像模板。

  • 使用 echo 'hello word' | pandoc -o reference.docx 生成文件或类似。
  • 更改样式中的字体。通过在 Word 中打开文件,更改样式并保存它,或者例如使用 vim 打开它。 :
  • 重命名 reference.docxreference.zip
  • vim reference.zip并选择 reference/theme/theme1.xml
  • 查找和更改 CalibriArial
  • 将 zip 保存并重命名回 docx
  • 利润:与 pandoc --reference-doc reference.docx 一起使用

  • 另见 Defining-custom-DOCX-styles-in-LibreOffice-(and-Word) .

    关于ms-word - 如何指定用于使用 pandoc 导出的 word doc 的字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34600141/

    相关文章:

    perl - 获取 Word 文档特定部分中的段落

    latex - markdown -> pandoc -> PDF |渲染表上的扼流圈

    excel - VBA - 为什么从 Excel 打开 Word 很慢?

    vba - 我可以更改 Word 2007 中插入表格命令的行为吗?

    c# - 下划线和粗体文本

    将 Markdown 转换为 pdf 时 pandoc 错误

    python - 由于缺少 pandoc,构建文档失败

    php - 我需要帮助修改 PHP markdown 的正则表达式

    Markdown 内部链接在 BitBucket README.md 中不起作用

    html - 如何使用 Markdown 在表格中插入图像