Code Monkey home page Code Monkey logo

ubcthesis_bookdown's Introduction

UBC Thesis template using Bookdown

This is skeleton Bookdown code to create a thesis that complies with the UBC formatting guidelines for a thesis, specifically a PhD thesis. Bookdown allows you to easily put in plots and other R code inline with your thesis text. Plus it can manage citations and cross-references.

Based On

This is a modified version of the existing ubcthesis Latex template created by Michael McNeil Forbes.

Dependencies

Basically you need RStudio so it's not painful. You will need up-to-date versions of the R packages: knitr and bookdown. If there are weird Latex issues, try installing tinytex and restarting RStudio. Latex/tinytex should manage installing all needed Latex packages.

Using it.

Fill in the following and before you know it, you'll have a finished thesis.

  • Title & author: These need to be updated in the index.Rmd and abstract.tex files.
  • Committee: The examining and additional committee info should be put into the abstract.tex file
  • Abstract, lay summary & preface: Also go into the abstract.tex file
  • Acknowledgements & Dedication: Go into the index.Rmd file
  • Abbreviations: Edit the tab-delimited abbreviations.tsv file (which is loaded in index.Rmd and rendered using knitr kable)
  • Bibliography: Goes into the thesis.bib file (in BibTex format)
  • Previous Degree: Goes in the preamble.tex file
  • New Chapters: Create new .Rmd files using the same numbering as the existing 01-, 02-, etc format. Reorder as necessary and the numbering will be managed automatically.

An example of a figure and table with captions are shown in 02-research.Rmd. These are then indexed automatically in the list of figures and tables. References are done using the square brackets format (e.g. [@meyer2003pressures])

Building it.

Either use the Knit button in RStudio or run the following command(s).

library(bookdown)

# For a PDF
bookdown::render_book("index.Rmd", "bookdown::pdf_book")

# For a Word file - useful for Track Changes
bookdown::render_book("index.Rmd", "bookdown::word_document2")

Note that the Word file will not match the appropriate formatting and will be missing the title page, abstract, lay summary and preface (things before the Table of Contents). So you'd need to add them in manually. But it may still be useful to enable easy editing by supervisors & collaborators.

Adapting for Another University

The general format is probably mostly valid for theses at other universities. The quick changes are the institution name and location in genthesis.cls. Do a find & replace for "University of British Columbia" and "Vancouver". You'd also likely need to change some of the text of the main page to comply with what's expected at your university. That is also in genthesis.cls.

Bibliography Files per Chapter

If you want to have a citation file for each chapter (e.g. 01-intro.bib, etc), you can include the code below to merge them into one bib file (and remove duplicates). This can be useful if your chapters are already Markdown or Latex based papers. Add this code to the index.Rmd file (in an R block) and change the bib file (in the header bit of that file) to thesis.bib.

```{r bibliographyMerge, eval=T, echo=F}
library(dplyr)
library(kableExtra)
library(RefManageR)
BibOptions(check.entries=F)
bibfiles <- list.files(pattern = "\\.bib$")
bibfiles <- grep("thesis.bib",bibfiles,invert=T,value=T)
bib <- ReadBib(bibfiles[1])
for(bibfile in bibfiles[2:length(bibfiles)])
  bib <- suppressWarnings(suppressMessages(merge(bib,ReadBib(bibfile))))

suppressWarnings(suppressMessages(WriteBib(bib, file='thesis.bib',check=F)))
```

Issues

If you encounter any problems, please file an issue along with a detailed description.

ubcthesis_bookdown's People

Contributors

jakelever avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.