-
Notifications
You must be signed in to change notification settings - Fork 11
/
README.Rmd
175 lines (112 loc) · 6.36 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
devtools::load_all()
```
# `dissertateUSU` `v0.3.1` <img src="inst/dissertateUSU_hex.png" align="right" width="30%" height="30%"/>
<!-- badges: start -->
[![R-CMD-check](https://github.com/TysonStanley/dissertateUSU/workflows/R-CMD-check/badge.svg)](https://github.com/TysonStanley/dissertateUSU/actions)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3516441.svg)](https://doi.org/10.5281/zenodo.3516441)
![](https://img.shields.io/badge/status-stable-brightgreen.svg)
<!-- badges: end -->
The goal of `dissertateUSU` is to make two aspects of writing a dissertation at Utah State University better:
1. Formatting of the dissertation is automatically done for you
2. All analyses are intimately tied to the document, making the work more reproducible
Ultimately, this allows the student to focus on the writing and the results without having to worry excessively about updating tables and figures, adjusting formatting of things like the title page and table of contents, and other minor (but important) aspects of getting the document correct.
It is up-to-date as of the 2020-21 graduate school formatting guidelines.
## Installation
You can install `dissertateUSU` with:
``` r
remotes::install_github("tysonstanley/dissertateUSU")
```
## LaTeX
> Importantly, this package requires the new release of LaTeX from your preferred distribution. Older versions will often encounter an error regarding "\\counterwithin". If this error comes up for you, then you need to update your LaTeX.
## Example
To use the package, after installing it--*and restarting Rstudio*--open up a new RMarkdown file:
<img src="inst/dropdownmenu.png" align="center" width="20%"/>
and select the "Dissertate USU" template:
<img src="inst/fromtemplate.png" align="center" width="60%"/>
This will open up a new folder with a skeleton RMarkdown file:
<img src="inst/template.png" align="center" width="70%"/>
This produces a document that matches the USU dissertation guidelines:
<img src="inst/output.png" align="center" width="70%"/>
If you'd rather have the Master's Thesis cover page, just remove the `committee5` and `committee4` lines in the main `.Rmd` file.
<img src="inst/thesis_coverpage.png" align="center" width="70%"/>
### General Notes
- To put the title on two lines (see the thesis cover page above), use `\newline` (or if that doesn't work, use `\\newline`) at the point where you want the title to split to the second line. In general, USU wants the first of the two title lines to be longer than the second part.
- If you don't need a section (e.g., "Public Abstract", "Chapter 5", etc.), remove it from the main `.Rmd` file. For example, if you want to remove the "Public Abstract", remove all the lines starting from the `\newpage` in that section down to the actual words `Publically abstracted words go here.`. It will then not be included in the knitted document.
- Currently, the package uses APA 7 formatting for citations (by default) but this can be altered by downloading a new `.csl` file and specifying it in the yaml, by replacing the `apa7.csl` in the `pandoc_args: [ "--csl", "apa7.csl" ]` argument with your file name. The package also comes with `apa6.csl` to use.
- Although the School of Graduate Studies at Utah State University has approved the use of `dissertateUSU`, before using it, talk to your committee chair and your graduate program coordinator to make sure it is approved by your department.
## Writing, Writing, Writing
In the folder, there are other RMarkdown files called `Chapter1.Rmd`, `Chapter2.Rmd`, etc. These are the files where you will do the writing and analyzing. The main RMarkdown file will bring all these files together into one document. The only things you need to update in the main RMarkdown file is the `yaml` information, the abstracts, acknowledgments, and dedication.
## Some specifics for formatting
### Appendices
To add appendices, you can use the following at the very end of the skeleton `.Rmd` file:
```
<div id="refs"></div>
<!-- Appendix -->
\clearpage
\addcontentsline{toc}{chapter}{APPENDICES}
\fancyhead[L]{Appendices}
\fancyhead[R]{Page\newline\thepage}
\fancyfoot[C]{}
\vspace*{\fill}
\begin{center}
APPENDICES
\end{center}
\vspace*{\fill}
\addcontentsline{toc}{section}{Appendix A}
\section*{Appendix A}
...appendix stuff...
```
### Multipaper Format
A now common approach for dissertations at Utah State University are multi-paper dissertations. To make this work in `dissertateUSU`, you will need to use four steps. First, note each of the chapters that are the individual papers (e.g., chapters 2, 3, and 4).
First, add the bibliography line to the yaml for each chapter that will be its own paper. To do that, add the following lines to the top of the `.Rmd` file, where `yourbibfile.bib` is the name of the bib file you are using. At the same time, remove the `\newpage` to `\chapter{}` from the core `.Rmd` file for that specific chapter. Do this for each chapter.
```
---
bibliography: yourbibfile.bib
---
\newpage
\fancyhead[R]{\thepage}
\fancyfoot[C]{}
\chapter{Chapter name}
```
Second, add the following at the end of the chapter.
```
\section*{References}
\setlength{\parindent}{-0.6in}
\setlength{\leftskip}{0.6in}
\setlength{\parskip}{6pt}
\noindent
```
Third, to reset the paragraph formatting for the following chapter, at the beginning of the next chapter add:
```
\setlength{\parindent}{0.4in}
\setlength{\leftskip}{0.0in}
\setlength{\parskip}{6pt}
\noindent
```
Finally, change the core `.Rmd` code chunks from:
````markdown
`r ''````{r, child="Chapter2.Rmd"}
```
````
to:
````markdown
`r ''````{r, results='asis'}
chapter_knit("Chapter2")
```
````
This will do an alternative form of knitting (and will create a `.md` and `.tex` file for the chapter).
## Final Notes and Thanks
The package is still undergoing some development and we would love feedback on any aspect that doesn't work as expected.
We also want to thank the [`rticles`](https://github.com/rstudio/rticles) package for the functionality for `dissertateUSU`. The idea to make this package, as well as its design, was derived from the `rticles` package.
And thanks to David Jenks for his help finding LaTeX bugs from older LaTeX releases.