Chapter 3 Bookdown Notes

Build the book:

bookdown::render_book("index.Rmd", "bookdown::gitbook")
bookdown::render_book("index.Rmd", "bookdown::pdf_book")
bookdown::render_book("index.Rmd", "all") # builds all outputs defined in _output.yml

Build a specific chapter only:

bookdown::preview_chapter("chapter.Rmd", "bookdown::gitbook")

Auto-update view in browser (http://127.0.0.1:4321) when saving a .Rmd file (from here). To stop the server, run servr::daemon_stop("140206388818696") or restart your R session:

bookdown::serve_book(dir=".", output_dir="_book", preview=TRUE, in_session=TRUE, quiet=FALSE, ...)

Cache time consuming code chunks not to run them in every new knit

```{r important-computing, cache=T}

Run a script

```{r code=readLines("myscript.R")}

Create bib entries from a package:

knitr::write_bib(c("knitr", "stringr"), "", width = 60)

In labels, no . signs are allowed!

This is a multi-line latex equation example: \[\begin{align} \begin{split} & \text{RF} & = \quad \alpha \, \ln \left( \frac{\text{C}}{\text{C}_0} \right) \\ \Leftrightarrow \quad & \text{C}_0 \, \exp \left( \frac{\text{RF}}{\alpha} \right) \quad & = \quad \text{C} \,, \end{split} \tag{3.1} \end{align}\]