A Minimal Book Example with ARCA Template
A Handbook for …
2022-04-21
Prerequisites
This is a sample book written in Markdown. You can use anything that Pandoc’s Markdown supports, e.g., a math equation \(a^2 + b^2 = c^2\).
The bookdown package can be installed from CRAN or Github:
install.packages("bookdown")
# or the development version
# devtools::install_github("rstudio/bookdown")
Remember each Rmd file contains one and only one chapter, and a chapter is defined by the first-level heading #
.
To compile this example to PDF, you need XeLaTeX. You are recommended to install TinyTeX (which includes XeLaTeX): https://yihui.name/tinytex/.
ARCA Template
ARCA Template is based on Rstudio Bookdown-demo released under CC BY-SA 4.0 License
Icons by rstudio4edu released under CC BY-NC 2.0 License.
Deploy Github Actions
Follow tutorial at https://medium.com/@delucmat/how-to-publish-bookdown-projects-with-github-actions-on-github-pages-6e6aecc7331e but note that github action https://github.com/Cecilapp/GitHub-Pages-deploy is slightly changed so we adapted de code. In particular now we have as last action:
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
email: ${{ secrets.EMAIL }}
build_dir: _site/
Moreover, we also installed tinytex
and specified rmarkdown::render_site(encoding = "UTF-8")
in the first job to obtain pdf and epub available versions as well.
HTML and LaTeX
Remember that as the output is compiled to create a website and a PDF you have to take care of defining options and environments in both cases. See official documeentation https://bookdown.org/yihui/bookdown/