Home

Awesome

Contents

Coventrydown

Coventrydown is a fork of Ulrik Lyngs's oxfordown. Oxford University uses a LaTeX thesis template that is similar to Coventry University's thesis structure. Below you will find Ulik Lyngs's detailed instricutions on how to build a thesis using oxforddown. He has created a series of video tutorials on YouTube to guide you through the individual steps.

To build a Coventry University thesis using the coventrydown template, do the following:

Additionally, if you desire to have a list of figures, you need to transform the Markdown image links in your chapter files with the following R code:


```{r echo=FALSE, fig.cap="long caption under the figure", fig.scap="short caption used in the list of figures", out.width="100%"}

knitr::include_graphics("./figures/<filename>.jpg")
```

For Coventry University's pre-viva submission, you have to add Candidate's Declaration, Ethics Approval, your data and published articles with permissions to the thesis, which are mostly separate, already existing PDFs. These PDFs are placed in the inserted-PDFs folder. As the Declaration and Ethics Approval should go after the title page, they are inserted into the thesis through the template.tex, whereas published articles are included as appendices through the appendices.Rmd file. To insert PDFs into the thesis use the following LaTeX code:


\includepdf[pages=-]{inserted-PDFs/<filename>.pdf}

To add a mini-ToC to chapters, add \minitoc after the chapter title and adapt the ToC-depth in the index.Rmd file.

To build the thesis, you simply knit index.Rmd.

What follows are Ulik's instructions for oxforddown.

Oxforddown

A template for writing an Oxford University thesis in R Markdown. The template uses the bookdown R package together with the OxThesis LaTeX template, plus lots of inspiration from thesisdown.

Examples of theses written with oxforddown (see also Google Scholar):

NOTE: If you've used this template to write your thesis, drop me a line at ulrik.lyngs@cs.ox.ac.uk and I'll add a link showcasing it!

How to cite

DOI

@misc{lyngsOxforddown2019,
  author = {Lyngs, Ulrik},
  title = {oxforddown: An Oxford University Thesis Template for R Markdown},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/ulyngs/oxforddown}},
  doi = {10.5281/zenodo.3484681},
}

Requirements

How to use

How-to chapters

Read the 'How to use' chapter to understand the structure of oxforddown and how to do the basic things like building your thesis.

For how to use R Markdown syntax in general and in oxforddown in particular, read the dedicated chapters on this (R Markdown basics, Citations, cross-references, and collaboration, and Tables).

See also the general, official R Markdown resources R Markdown: The Definitive Guide and the R Markdown Cookbook.

Video tutorials

I am in the process of updating the tutorial videos to v3 - I've noted below which have yet to be updated, but are still informative, and struck out those that no longer apply:

Writing your thesis

.Rmd files you don't want included in the body text must be given file names that begin with an underscore (e.g. front-and-back-matter/_abstract.Rmd and front-and-back-matter/_acknowledgements.Rmd). (Alternatively, specify manually in _bookdown.yml which files should be merged into the body text.)

Building your entire thesis

PDF output

knit: (function(input, ...) {
    thesis_formats <- "pdf";
    ...

When you build the entire thesis to PDF, Latex generates a whole bunch of auxillary files - these are automatically removed after the build process end by the custom knit function that is used when you knit index.Rmd.

To change how this removal is done, edit scripts_and_filters/knit-functions.R. The line file.remove(list.files(pattern = "*\\.(log|mtc\\d*|maf|aux|bcf|lof|lot|out|toc)$")) within if ("pdf" %in% output_format){ is the one that removes files after PDF output is generated.

BS4 book output (HTML)

knit: (function(input, ...) {
    thesis_formats <- "bs4";
    ...

Gitbook output (HTML)

knit: (function(input, ...) {
    thesis_formats <- "gitbook";
    ...

Word output

knit: (function(input, ...) {
    thesis_formats <- "word";
    ...

Building a single chapter

To knit an individual chapter without compiling the entire thesis:

  1. open the .Rmd file of a chapter
  2. add a YAML header specifying the output format(s) (e.g. bookdown::word_document2 for a word document you might want to upload to Google Docs for feedback from collaborators)
  3. click the knit button (the output file is then saved in the root folder)

As shown in the sample chapters' YAML headers, to output a single chapter to PDF, use e.g.:

output:
  bookdown::pdf_document2:
    template: templates/brief_template.tex
    citation_package: biblatex
documentclass: book
bibliography: references.bib

The file templates/brief_template.tex formats the chapter in the OxThesis style but without including the front matter (table of contents, abstract, etc).

NOTE: The bibliography path in your individual chapters' YAML headers needs to be identical to the one in index.Rmd - otherwise your individual chapters' bibliography path may override the path in index.Rmd and cause trouble when you knit the entire thesis.

Customisations and extensions

Limitations

Gotchas

Output formats

Enjoy!