【问题标题】:How to use code folding in Distill for R Markdown articles?如何在 Distill 中为 R Markdown 文章使用代码折叠?
【发布时间】:2019-06-15 19:02:13
【问题描述】:

我们在 RMarkdown 文档中有代码折叠,但仅当输出为 html_document 时。答案:https://stackoverflow.com/a/37839683/5359328 在 Distill for R Markdown 文章中不起作用,因为添加 CSS 和 JS 的方式未知。如何在 Distill 中为 R Markdown 文章使用代码折叠?

【问题讨论】:

    标签: r-markdown


    【解决方案1】:

    您可以将codefolder 包用于Distill 文档或Bookdown

    对于Distill,这是通过在 Rmarkdown 文档中包含以下内容来完成的:

    <aside>
    ```{r codefolder, echo=FALSE, results='asis'}
    codefolder::distill(init = "hide")
    ```
    </aside>
    

    【讨论】:

      猜你喜欢
      • 2022-01-16
      • 2020-08-17
      • 1970-01-01
      • 2017-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-07
      相关资源
      最近更新 更多