What is an appropriate way to have a page break before each of my chapters in my bookdown project? edit: this is for a PDF output
In an Rmarkdown document I would just use \newpage, but that does not work for my bookdown project. In this project I have place \newpage at the end of my Rmd documents and at the beginning, but neither option worked.
Should I set this in the index.Rmd? How?
Should I set this in the _bookdown.yml? How?
Should I set this in the _output.yml? How?
I would also appreciate it if you could direct me to references for:
bookdown
rmarkdown
yaml
LaTeX
I've reviewed the bookdown and rmarkdown stuff prepared by Yihui Xie, but I don't know where to go to find what I need to be able to understand the options.
It should be on its own line inside the Rmd document after the paragraph you want to go the the new page.
This is not a bookdown feature, it is a LaTeX thing and inserting raw TeX should be kept during the process, so it should work as long as it works in LaTeX
I am not quite sure to follow why you need to add at the beginning or at the end of a chapter. bookdown::pdf_book() already split by chapter and you'll get a new page for each section. Don't you ?
I tried adding \newpage on the bookdown-demo book in between paragraph and it worked.
Thank you. That bookdown demo is what I used to build this project. I made a (minimal reproducible example)[GitHub - reneherrera-cocohhs/my-bookdown-example] from my project, but I see that there is a page break occurring prior to each chapter, starting with the index.
I don't understand what might be or might have been the problem with my project that I was originally asking about.
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:
Yes, but I don't understand why it is working now. As far as I know, I did not make any changes. I still don't understand which project level settings to set in order to return a PDF with page breaks before each chapter.
bookdown offers bookdown::pdf_book() to write some PDF books following bookdown features and must be pair with a LaTeX documentclass: book in YAML (or another book-like class).
See
I believe the Book documentclass in LaTeX will by default make the newpage before each chapter. You should see about how that works in LaTeX.
Yes documentclass: book is required in the index.Rmd in addition of the format you want to use. Sometimes, there are some specific documentclass like krantz that need to be set for book - that is why it is not hardcoded. However, this should be set in all the book template.