gpt4 book ai didi

r - 如何更改 R Studio 中的 pandoc 选项

转载 作者:行者123 更新时间:2023-12-02 04:25:09 25 4
gpt4 key购买 nike

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

调用的命令是:

"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

问题

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

--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:

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

请参阅文档 here

关于r - 如何更改 R Studio 中的 pandoc 选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35271593/

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