Bookdown template with Springer latex class
This is easiest using Rstudio.
-
Load Rstudio and open the "irnbrukdown.Rpoj" --- it is necessary that you have an Rproj in the same directory as all the other files for the book in order for the building of the book to work.
-
With the R project open, ther should be a tab called "Build" in the Environment page (usually top-right pane). Click on this tab and then click "Build Book". You can use the drop down menu to select which formats are built. By default, it should build "gitbook" and "pdf".
-
The book should open automatically once built.
index.Rmd
: There must be a file by this name containing the Markdown header "---". Document class is set to "svmono"
the Springer monograph Latex template. Below the header "---" is a code chunk called "postlatex", this chunk is required in order
for the svmono class to work (it is an ugly programming hack).
_bookdown.yml
: the final line of this file starting "rmd_files" is where you specify the Rmd files for each
chapter in the order you want them to appear in the book. The book's file name is set here too.
_output.yml
: specify parameters for each output type. In particular for "gitbook", you can set what is printed
before and after the table of contents. You can also specify your CSS style file.
style.css
: This is the style file used by gitbook, if you are familiar with CSS.
toc.css
: The CSS style file for the table of contents in gitbook
preamble.tex
: Include here any latex code (e.g. including packages, defining new commands) and it will be
added to the beginning the Latex file created using bookdown, before the PDF is made. Please keep the "\usepackage{}" command
as this includes all the packages required by the Springer template.
book.bib
and packages.bib
: include here your references for the book (to papers etc...) and a
separate file is used to R packages (not sure why).
Once the book is built, the output is saved in the directory _book
. Generated figures are saved in _bookdown_files
.