Home

Awesome

gopherdown

This project is a modified version Chester Ismay’s thesisdown package to provide support for the University of Minnesota’s thesis.Currently, the PDF version is fully functional. All other versions are derived from thesisdown and are not guaranteed to work.

An example of using this can be found here, where I re-created my own PhD thesis.

Installation

To install and use {gopherdown} and use it for your dissertation/thesis, you will need:

Rather than installing a large TeX distribution, I recommend installing LaTeX via the install_tinytex() function from the R package {tinytex}.

# Install tinytex package
install.packages('tinytex')

# Install LaTeX
tinytex::install_tinytex()

Once you have pandoc and LaTeX installed, you can install and use {gopherdown}. Open Rstudio and type:

if (!require("devtools")) install.packages("devtools", repos = "http://cran.rstudio.org")
devtools::install_github("zief0002/gopherdown")

To use {gopherdown}, open Rstudio, click on File > New File > Rmarkdown … and then select the University of Minnesota Thesis from the Templates.

New R Markdown

Make sure to give your thesis the name index and save it to the correct path. (This will ensure that the main RMD document will be called index.Rmd.) You can rename the directory (i.e., folder), but if you rename the main RMD document, you will also need to open _bookdown.yml and edit the first Rmd file (index.Rmd) to change its name to what ever you named the main document.

book_filename: "thesis"
chapter_name: "Chapter "
rmd_files: [
  "my-project-name.Rmd",
  
  "chapters/01-chap1.Rmd",
  "chapters/02-chap2.Rmd",
  "chapters/03-chap3.Rmd",
  "chapters/04-chap4.Rmd",
  "chapters/05-chap5.Rmd",
  
  "chapters/90-references.Rmd",
  "chapters/91-appendix-a.Rmd",
  "chapters/92-appendix-b.Rmd"
  ]
download: [
  ["thesis.pdf", "PDF"]
  ]

Note the remainder of this document will assume that document is named index.Rmd.

Rendering

To render your thesis, you can open index.Rmd in RStudio and then hit the “knit” button. Alternatively, you can use:

rmarkdown::render("index.Rmd")

Your thesis will be deposited in the _book/ directory.

Files and Directories (Edit These)

The following files and directories are the ones I updated, edited, and added content to in order to customize my thesis:

_bookdown.yml

This is the main configuration file for your thesis. Arrange the order of your chapters in this file and ensure that the names match the names in your folders.

index.Rmd

This file contains all the meta information (in the YAML) that helps create the thesis. I also included an R code chunk that loads all the packages and sets different global (e.g., scientific notation penalty) and knitr options (e.g., supress messages nd warnings in code chunks).

There are several YAML fields here to edit:

Required Information

Degree

Rendering Options

In general, do not edit things in this section.

Fonts

Link Highlighting

Bibliography/References

Create List of tables and Figures

These are required for the thesis, so do not change these unless you are drafting things and want to speed up renders.

Add LaTeX Content to the Preamble

Optional Frontmatter

pre/

This folder contains all of the Rmd files to be included in the pretext of your dissertation (e.g. abstract, acknowledgements, author contributions, etc.). If you are not including one or more of these sections, the file appropriate to those sections can be deleted.

chapters/

This folder contains the RMD files for each chapter in the dissertation, as well as the appendices. These files contain the main content for the thesis.

bib/

Store your bibliography as bibtex (.BIB) files here. By default, {gopherdown} includes two BIB files, references.bib file and packages.bib. If you have other .BIB files they can be included in this folder. You would also need to add them to the bibliography: YAML field in index.Rmd.

csl/

Specific style files for bibliographies should be stored here. The APA style file is added by default when you create a new document using {gopherdown}. If you want to use a different style file grab it from https://www.zotero.org/styles or https://github.com/citation-style-language/styles and add the CSL file to this folder. Then change the csl: YAML field in index.Rmd.

figure/

Store figures not created within the RMD files (e.g., figures created in Keynote, PowerPoint). They can then be referenced using knitr::include_graphics() in the RMD files.

data/

Store data sets (e.g., CSV files) used in analyses, etc. here.


Files and Directories (Do Not Edit)

The {gopherdown} package calls the thesis_pdf() function to create your thesis. It draws on the template.tex and umnthesis.cls files in the main directory. (Do not change these unless you know what you are doing!) When the thesis is rendered (clicking the knit button in the index.Rmd file), the _book and _bookdown_files directories are populated.

_book/

This directory includes your compiled thesis and all the relevant TEX files.

_bookdown_files

This directory includes things that the {bookdown} package creates when the PDF is compiled (e.g., PDF versions of all figures).

You should not edit these. To edit, change the RMD files or other files in the main directory.

Helpful Documents

There are several resources online to help you with RMarkdown. The OG is: