2017-11-14 7 views
5

私はrmarkdownを使って単語(.docx)レポートを生成しています。私はtocのヘッダーを変更したいと思います。これは、docファイル(1)の場合、yamlヘッダのオプションとしてpandoc_argsを渡すことができるため可能です。しかし、私はそれを正しくやっていません。誰でも実用的な例を提供できますか?rmarkdownのyamlヘッダーにpandoc_argsを渡すにはどうしたらいいですか?

(1)pandoc.argsがrmarkdown可能なオプションおよびpandoc書に含まれ、TOC-タイトルオプションがある

--- 
title: "yaml header" 
author: "cedric" 
output: 
    word_document: 
    toc: true 
pandoc_args: toc-title="Table des matières" 
--- 
# One section 
# Another 

これは生成:

document without change in toc_title

答えて

13

目次のタイトルは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" 
    ] 
--- 
関連する問題