How can we pass pandoc_args to yaml header in rmarkdown?

后端 未结 1 400
刺人心
刺人心 2020-12-30 06:51

I\'m using rmarkdown to produce a word (.docx) report. I would like to change the header of the toc. This seems possible as pandoc_args can be passed as options

相关标签:
1条回答
  • 2020-12-30 07:12

    The title of the table of contents is document metadata, so you can set it with YAML metadata block.

    ---
    title: "yaml header"
    author: "cedric"
    output:  
      word_document:
        toc: true
    toc-title: "Table des matières"
    ---
    

    Or passed it in with the -M command-line flag.

    ---
    title: "yaml header"
    author: "cedric"
    output:  
      word_document:
        toc: true
        pandoc_args: [
          "-M", "toc-title=Table des matières"
        ]
    ---
    
    0 讨论(0)
提交回复
热议问题