gpt4 book ai didi

ms-word - Pandoc:设置导出Word docx的语言

转载 作者:行者123 更新时间:2023-12-01 01:55:32 25 4
gpt4 key购买 nike

我使用 Pandoc 从 Markdown 导出 Word docx。

默认情况下,docx 文件中的所有内容似乎都标记为英语。所以我试图覆盖这个,例如通过命令行选项 pandoc -s -S images.md -o images.docx -V lang=de或在标题 YAML 中:

---
subtitle: <%= @report.name %>
toc-title: <%= t('.toc_title') %>
lang: de
---

但似乎没有任何效果,导出的 docx 文件中的所有内容都被语言拼写功能标记为红色,告诉我在英语中找不到单词。

如何覆盖语言?

更新

我尝试在 docx 文件中指定语言,只需选择所有文本( Cmd+A ,我在 OSX 上)并单击左下角的语言按钮。

enter image description here

另外,我尝试使用 Tools -> Language :

enter image description here

虽然没有任何影响。

更新

有趣的是,在导出为 HTML 时,在 <html> 中正确设置了语言。属性。

最佳答案

目前没有办法设置 pandoc 输出的 doc、docx 或 odt 文档的语言。 pandoc GitHub issue讨论了这个问题(在@Serge Correia 的评论中指出)。

确实,其他格式的本地化需要通过模板,但与模板、引用文件等价的 doc、docx 和 odt 仅设置一些选定的样式和属性。例如,引用文档:(来自 pandoc README)

The contents of the reference docx are ignored, but its stylesheets and document properties (including margins, page size, header, and footer) are used in the new docx.

关于ms-word - Pandoc:设置导出Word docx的语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41027757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com