How do you achieve roman numerals for things like preface, acknowledgement etc and restart Arabic numbering at 1 for first page of chapter one in R Bookdown.
I am wanting to render to pdf in bookdown, but have not found any good information on how to change page numbering like this
thanks
I think it might be easier to just follow the example @yihui used in his own bookdown krantz example:
Add the following files, perhaps in a /latex subfolder:
preamble.tex with the latex \frontmatter command at the end,after_body.tex with the latex \backmatter command,Then, before your first actual main body, just add the \mainmatter command (just in latex) to, say, your index.Rmd (whichever of your *.Rmds is first, conventionally index.Rmd).
Then, to amend your _output.yml like so:
bookdown::pdf_book:
includes:
in_header: latex/preamble.tex
after_body: latex/after_body.tex
This intersperses the correct \frontmatter, \mainmatter and \backmatter commands into your pandoc-ed latex book. It will be respected by most style files to make sure that arabic numbering only begins inside the main matter.
This is also documented in the publishing chapter of the bookdown book.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With