我正在使用 rmarkdown 生成 word (.docx) 报告。我想更改目录的标题。这似乎是可能的,因为 pandoc_args
在 doc 文件 (1) 的情况下,可以作为 yaml header 中的选项传递。但我做得不对。谁能提供一个工作示例?
(1) pandoc.args 包含在 rmarkdown 可能的选项中,在 pandoc 手册中,有一个 toc-title 选项
---
title: "yaml header"
author: "cedric"
output:
word_document:
toc: true
pandoc_args: toc-title="Table des matières"
---
# One section
# Another
这产生:
最佳答案
目录的标题是document metadata ,因此您可以使用 YAML 元数据块对其进行设置。
---
title: "yaml header"
author: "cedric"
output:
word_document:
toc: true
toc-title: "Table des matières"
---
或者用
-M
传入命令行标志。---
title: "yaml header"
author: "cedric"
output:
word_document:
toc: true
pandoc_args: [
"-M", "toc-title=Table des matières"
]
---
关于r - 我们如何在 rmarkdown 中将 pandoc_args 传递给 yaml header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47290659/