【问题标题】:Does the option results = 'asis' work in xaringan presentation?选项 results = 'asis' 在 xaringan 演示文稿中是否有效?
【发布时间】:2020-02-03 17:13:31
【问题描述】:

我正在尝试使用 knitr 的选项 results='assis'xaringan 演示文稿中创建各种幻灯片,但它不起作用。

我使用了以下代码:

    ---
    title: "Presentation"
    author: ""
    date: ""
    output:
      xaringan::moon_reader:
        lib_dir: libs
        nature:
          highlightStyle: github
          highlightLines: true
          countIncrementalSlides: false
    ---

    ```{r, results='asis'}
    for (i in 1:3) {  
      cat("---", "\n")
      cat("## Slide", i, "\n")
      cat("Hello", i)
      cat("\n")
    }
   '''

我希望输出为 3 页,但实际输出为一页。我也试过asis_output 而不是cat

【问题讨论】:

    标签: r-markdown xaringan


    【解决方案1】:

    你几乎拥有它。改变

    cat("---", "\n")
    

    cat("---\n")
    

    前者在---\n之间加了一个空格,xaringan/remark.js后面不能有空格---否则就变成横线了。

    【讨论】:

      猜你喜欢
      • 2021-04-20
      • 2019-10-13
      • 2020-06-11
      • 2018-12-10
      • 2021-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-23
      相关资源
      最近更新 更多