我正在尝试通过 pandoc Rmarkdown 提高性能

问题描述 投票:0回答:1

我正在尝试调整 pandoc 参数以增加内存和转换速度,但无法得到任何结果。这是 RMarkdown 中的输出部分:

output:
  word_document: 
    toc: yes
    pandoc_args: ["-RTS", "-M2G"]
    fig_width: 8
  html_document:
    self_contained: no
    keep_md: no
    pandoc_args:
    - "-RTS"
    - "-M2G"
    - "--to=html5"
    toc: yes
    toc_float: yes
    collapsed: no
    smooth_scroll: yes
    theme: cosmo
    number_sections: yes
    cache: yes
    fig_width: 8
    df_print: kable
editor_options:
  chunk_output_type: console

我一直在尝试导出为 .html,并且花了几个小时来渲染它。现在我正在尝试将其导出到word,但仍然相同......它有效,但需要很多时间。 我正在尝试调整 pandoc 参数,但无法完成此操作。这是渲染时的消息...

/usr/lib/rstudio-server/bin/quarto/bin/tools/pandoc +RTS -K512m -RTS Proceso_NETO.knit.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash --output Proceso_NETO.docx --lua-filter /home/cesarkero/R/x86_64-pc-linux-gnu-library/4.3/rmarkdown/rmarkdown/lua/pagebreak.lua --table-of-contents --toc-depth 3 --highlight-style tango -RTS -M2G 

我怎样才能在做knitr时真正改变这些pandoc_args?我还可以更改其他内容以增加从 .md 到 .docx 或 .html 的 pandoc 转换?

yaml r-markdown rstudio pandoc
1个回答
0
投票

运行时系统参数需要用

+RTS
-RTS
(docs) 包装。所以,举个例子

output:
  word_document: 
    pandoc_args: ["+RTS", "-M2G", "-RTS"]

但是花费这么长时间的转换可能会遇到难以通过这种方式解决的问题。

© www.soinside.com 2019 - 2024. All rights reserved.