【发布时间】:2019-02-28 05:16:37
【问题描述】:
是否可以将 R tufte 包中的 tufte_html 文档拆分为每章一个文件?我想写一整本书。 Bookdown 让我可以在自己的文件中组织章节,并且章节在 pdf 输出中开始新页面,但对于 html 输出,它只是一个文件。
这是我尝试过的,但不起作用。
index.Rmd
---
title: "Probability and Statistics<br />"
author: "Bob Carpenter"
date: "2018"
output:
tufte::tufte_html
---
```{r setup, include=FALSE}
bookdown::tufte_html_book(split_by = "chapter")
```
# A Chapter
Blah blah blah.
# Another Chapter
Blah blah blah.
```
_bookdown.yml
rmd_files: [
"index.Rmd",
"another_file.Rmd"
]
another_file.Rmd
# Yet another chapter
Foo bar baz.
$ R
> library(bookdown)
> render_book("index.Rmd")
这会生成一个 html 文档作为输出,而不是每章一个文件。我还尝试将 split_by 调用替换为 bookdown::tufte_html_book(split_by = "chapter")。
这是我的sessionInfo()
【问题讨论】:
标签: r r-markdown knitr bookdown