R markdown ioslides incremental mode for code chunks

泄露秘密 提交于 2020-01-24 03:03:32

问题


How do you turn R code chunks to appear incrementally?

For example, I put the following option in the header:

---
...other configurations...
output:
  ioslides_presentation:
    incremental: true
---

But the incremental mode only applies to bullets and not to the code chunks

## Slide 1
  * this bullet point appears first
  * this bullet point appears second
```{r eval=FALSE}
# This chunk is there from the beginning
```

So my question is : How do you make the chunk appear after the second bullet?


回答1:


You can use the .build attribute

## Slide 1 {.build}
  * this bullet point appears first
  * this bullet point appears second
```{r eval=FALSE}
# This chunk appears third
```

There is a minor problem to this solution: On your first advancement on this slide, nothing will be displayed. You have to advance twice to make the first bullet point appear.



来源:https://stackoverflow.com/questions/29899766/r-markdown-ioslides-incremental-mode-for-code-chunks

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!