4
votes

I use the HTML and PDF outputs from bookdown as instructional material in a programming course, and I'd like to achieve the "page break" effect at the subsection level in addition to the chapter and section levels.

From what I have read in the bookdown documentation, "subsection" is not a permissible setting for the split_by argument in my bookdown's "_output.yaml" file.

bookdown::gitbook: split_by: section

Is there a workaround besides creating individual books for each chapter (thus turning my current book-level subsections into chapter-level sections)? I strongly prefer having one book at the end.

1
No, it is not possible. Sorry.Yihui Xie
Ok, thanks for the quick response, and thanks for making bookdown.Mike

1 Answers

3
votes

A work around might be using "split_by: rmd"; see this answer for reference. Then you put contents in each subsection into a separate Rmd file.

I tried this, and it works. The drawback is that I always receive this message when preview the book in Rstudio:

In split_chapters(output, gitbook_page, number_sections, split_by, : You have 5 Rmd input file(s) but only 3 first-level heading(s). Did you forget first-level headings in certain Rmd files?

Also, I don't know if there are other drawbacks.