如何在 R Studio 中更改 pandoc 选项 [英] How to change pandoc option in R Studio

查看:66
本文介绍了如何在 R Studio 中更改 pandoc 选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 R Studio 中安装包 rmarkdown,您可以使用 Rmd 文件创建 docx 文档并按下 Knit Word 按钮.

Installing package rmarkdown in R Studio you can create docx documents using a Rmd-file and pressing the Knit Word button.

调用的命令是:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS hallo.utf8.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures
--output hallo.docx --highlight-style tango

问题

如何添加其他选项?我想补充:

How to add other options? I want to add:

--filter ./pandoc-word-pagebreak

获得:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS hallo.utf8.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --filter ./pandoc-word-pagebreak
    --output hallo.docx --highlight-style tango

推荐答案

你可以在你的 yaml 前端使用 pandoc_args:

You can use pandoc_args in your yaml front matter:

---
title: "Mytitle"
output:
  word_document:
    pandoc_args: [ 
      "--filter", "./pandoc-word-pagebreak" 
    ]
---

查看文档此处

这篇关于如何在 R Studio 中更改 pandoc 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆