首页 > 解决方案 > rmarkdown 笔记本中的 bookdown 扩展

问题描述

我想在html_notebook用作我的输出格式时使用一些 bookdown 扩展。例如,这有效:

---
output: bookdown::html_document2
---

```{theorem}
My proof here.
\```
knitr::knit("test.rmd", "test.html")

但这不会:

---
output: html_notebook
---

```{theorem}
My proof here.
\```
knitr::knit("test.rmd", "test.html")

有没有办法在 rmarkdown 笔记本中使用这些扩展?

标签: rr-markdownknitrbookdown

解决方案


您可以使用以下输出定义:

output:  
  bookdown::html_document2:
    base_format: rmarkdown::html_notebook

此功能的手册可以在这里找到:https ://bookdown.org/yihui/bookdown/a-single-document.html


推荐阅读