Awesome
Write your PhD thesis in Rmarkdown <br/> - University of Bergen
This is an Rmarkdown dissertation/thesis template for PhD students at University of Bergen and was created by Marius R. Langvad (PhD student).
The template is a combination of RMarkdown and the official UiB LaTeX template (https://avhandling.uib.no/) to achieve proper formatting (no LaTeX skills required). This template was inspired by ismayc/thesisdown where you can also find a more detailed description on starting a template or installing necessary packages.
You can preview a rendered PDF template by clicking here.
Install template
To install this template, copy these commands to your R console in RStudio:
if (!require("remotes"))
install.packages("remotes", repos = "https://cran.rstudio.org")
remotes::install_github("rstudio/bookdown")
remotes::install_github("SaltyRydM/bergendown")
Once installed you can open a fresh template by clicking:
- File -> New File -> R Markdown... -> From Template -> UiB dissertation template -> OK
Note: You might need to restart R session for the template to appear. You can also name the mother document before you click "OK", if not it will be named Untitled.Rmd
by default.
About the template
All the *.Rmd
files correspond to the different sections of the dissertation. Even though the title page is written in LaTeX (and might look frighting), you only need to replace the text that is already there (e.g. "Main Title", "Subtitle", "First-name Last-name"...).
You may render the template at any time by knitting the mother document. The mother document is named Untitled.Rmd
by default unless you have given it a specific name when starting a new template. In the mother document you can also add/remove/rename sections to fit your thesis outline.
By default the knitting will generate a PDF, but you may change the mother document to render a word file by changing bookdown::pdf_document2:
to bookdown::word_document2:
in the YAML
section. However, the front page graphics will not be included in the word document, but you can easily copy this from the official UiB word template at https://avhandling.uib.no/. I found it practical to render to word document when getting feedback, so that non R users may easily provide comments on the thesis.
Furthermore, the YAML
section in the mother document provides proper format of the dissertation, so it can be shrunken to a smaller book-format (17 x 24 cm) before print (which means that you don't have to worry about this). Additionally, this section loads in the bibliography file containing the references written in BibTex
format, and it loads in the preamble.tex
file that loads in necessary LaTeX commands and packages.
Check out the file called chX_examples.Rmd
to see some nice examples and useful commands.
If you prefer to manually download all the files associated with the template you can do it by clicking here. Note, this download link is no longer maintained and may be outdated.