Reputation: 2283
I'm considering to use Bookdown to write an academic paper. This includes the data processing and analysis code, plus everything else.
I know how to use Bookdown to write books where each .Rmd
document creates its own .html
page and a book chapter in a LaTeX PDF. I can also see how to use bookdown to write a single .Rmd
that becomes a multi-page website and an article-style PDF. At least, that is what I think I see in the bookdown documentation
But what I am trying to figure out is how to have multiple .Rmd
files that become a single article-style PDF. I want to have more than one .Rmd
to keep the runtime down and my work somewhat organized, but I am not writing a book. It seems as though bookdown is built to turn document breaks into chapters, and I want them to be turned into sections. Am I missing something obvious, or is this going to require a bit of hacking to make it work?
Upvotes: 2
Views: 156
Reputation: 30114
It seems your actual question is how to turn the top-level headers into sections instead of chapters. It depends on the documentclass
field in index.Rmd
. The default value of this field is article
, which means you get sections instead of chapters. Top-level headers are converted to chapters only if the documentclass
is for books (e.g., documentclass: book
here: https://github.com/rstudio/bookdown-demo/blob/master/index.Rmd#L7).
Then, to render multiple Rmd
files to a single PDF, use bookdown::render_book()
instead of rmarkdown::render()
.
Upvotes: 2