Skip to content

Commit

Permalink
new YSU thesis
Browse files Browse the repository at this point in the history
  • Loading branch information
gjkerns committed Nov 25, 2022
1 parent db30f84 commit f6a655b
Show file tree
Hide file tree
Showing 41 changed files with 883 additions and 1,368 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!--
This is for including Chapter 1. Notice that it's also good practice to name your chunk. This will help you debug potential issues as you knit. The chunk above is called intro and the one below is called chapter1. Feel free to change the name of the Rmd file as you wish, but don't forget to change it here from chap1.Rmd.
The below is the body text for Section 1.
-->

<!--
The {#rmd-basics} text after the chapter declaration will allow us to link throughout the document back to the beginning of Chapter 1. These labels will automatically be generated (if not specified) by changing the spaces to hyphens and capital letters to lowercase. Look for the reference to this label at the beginning of Chapter 2.
The {#rmd-basics} text after the section declaration will allow us to link throughout the document back to the beginning of Section 1. These labels will automatically be generated (if not specified) by changing the spaces to hyphens and capital letters to lowercase. Look for the reference to this label at the beginning of Section 2.
-->

# R Markdown Basics {#rmd-basics}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ Many of the symbols you will need can be found on the math page <https://web.ree

## Biology

You will probably find the resources at <https://www.lecb.ncifcrf.gov/~toms/latex.html> helpful, particularly the links to bsts for various journals. You may also be interested in TeXShade for nucleotide typesetting (<https://homepages.uni-tuebingen.de/beitz/txe.html>). Be sure to read the proceeding chapter on graphics and tables.
You will probably find the resources at <https://www.lecb.ncifcrf.gov/~toms/latex.html> helpful, particularly the links to bsts for various journals. You may also be interested in TeXShade for nucleotide typesetting (<https://homepages.uni-tuebingen.de/beitz/txe.html>). Be sure to read the next section on graphics and tables.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ flights <- read.csv("data/flights.csv", stringsAsFactors = FALSE)

## Figures

If your thesis has a lot of figures, _R Markdown_ might behave better for you than that other word processor. One perk is that it will automatically number the figures accordingly in each chapter. You'll also be able to create a label for each figure, add a caption, and then reference the figure in a way similar to what we saw with tables earlier. If you label your figures, you can move the figures around and _R Markdown_ will automatically adjust the numbering for you. No need for you to remember! So that you don't have to get too far into LaTeX to do this, a couple **R** functions have been created for you to assist. You'll see their use below.
If your thesis has a lot of figures, _R Markdown_ might behave better for you than that other word processor. One perk is that it will automatically number the figures accordingly in each section. You'll also be able to create a label for each figure, add a caption, and then reference the figure in a way similar to what we saw with tables earlier. If you label your figures, you can move the figures around and _R Markdown_ will automatically adjust the numbering for you. No need for you to remember! So that you don't have to get too far into LaTeX to do this, a couple **R** functions have been created for you to assist. You'll see their use below.

<!--
One thing that may be annoying is the way _R Markdown_ handles "floats" like tables and figures (it's really \LaTeX's fault). \LaTeX\ will try to find the best place to put your object based on the text around it and until you're really, truly done writing you should just leave it where it lies. There are some optional arguments specified in the options parameter of the `label` function. If you need to shift your figure around, it might be good to look here on tweaking the options argument: <https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions>
Expand All @@ -86,24 +86,24 @@ If you need a graphic or tabular material to be part of the text, you can just p
-->


In the **R** chunk below, we will load in a picture stored as `reed.jpg` in our main directory. We then give it the caption of "Reed logo", the label of "reedlogo", and specify that this is a figure. Make note of the different **R** chunk options that are given in the R Markdown file (not shown in the knitted document).
In the **R** chunk below, we will load in a picture stored as `YSU.png` in our main directory. We then give it the caption of "YSU logo", the label of "ysulogo", and specify that this is a figure. Make note of the different **R** chunk options that are given in the R Markdown file (not shown in the knitted document).

```{r reedlogo, fig.cap="Reed logo", out.width="0.2\\linewidth", fig.align="center"}
include_graphics(path = "figure/reed.jpg")
```{r ysulogo, fig.cap="YSU logo", out.width="0.2\\linewidth", fig.align="center"}
include_graphics(path = "figure/YSU.png")
```

<!-- Note the use of `out.width` as a chunk option here. The resulting
image is 20% of what the linewidth is in LaTeX. You can also center
the image using `fig.align="center"` as shown.-->

Here is a reference to the Reed logo: Figure \@ref(fig:reedlogo). Note the use of the `fig:` code here. By naming the **R** chunk that contains the figure, we can then reference that figure later as done in the first sentence here. We can also specify the caption for the figure via the R chunk option `fig.cap`.
Here is a reference to the YSU logo: Figure \@ref(fig:ysulogo). Note the use of the `fig:` code here. By naming the **R** chunk that contains the figure, we can then reference that figure later as done in the first sentence here. We can also specify the caption for the figure via the R chunk option `fig.cap`.

\clearpage

<!-- clearpage ends the page, and also dumps out all floats.
Floats are things like tables and figures. -->

Below we will investigate how to save the output of an **R** plot and label it in a way similar to that done above. Recall the `flights` dataset from Chapter \@ref(rmd-basics). (Note that we've shown a different way to reference a section or chapter here.) We will next explore a bar graph with the mean flight departure delays by airline from Portland for 2014.
Below we will investigate how to save the output of an **R** plot and label it in a way similar to that done above. Recall the `flights` dataset from Chapter \@ref(rmd-basics). (Note that we've shown a different way to reference a section here.) We will next explore a bar graph with the mean flight departure delays by airline from Portland for 2014.

```{r delaysboxplot, warnings=FALSE, messages=FALSE, fig.cap="Mean Delays by Airline", fig.width=6, fig.height=5}
mean_delay_by_carrier <- flights %>%
Expand Down Expand Up @@ -139,15 +139,15 @@ As another example, here is a reference: Figure \@ref(fig:subd2).

## Footnotes and Endnotes

You might want to footnote something. ^[footnote text] The footnote will be in a smaller font and placed appropriately. Endnotes work in much the same way. More information can be found about both on the CUS site or feel free to reach out to <data@reed.edu>.
You might want to footnote something. ^[footnote text] The footnote will be in a smaller font and placed appropriately. Endnotes work in much the same way.

## Bibliographies

Of course you will need to cite things, and you will probably accumulate an armful of sources. There are a variety of tools available for creating a bibliography database (stored with the .bib extension). In addition to BibTeX suggested below, you may want to consider using the free and easy-to-use tool called Zotero. The Reed librarians have created Zotero documentation at <https://libguides.reed.edu/citation/zotero>. In addition, a tutorial is available from Middlebury College at <https://sites.middlebury.edu/zoteromiddlebury/>.
Of course you will need to cite things, and you will probably accumulate an armful of sources. There are a variety of tools available for creating a bibliography database (stored with the .bib extension). In addition to BibTeX suggested below, you may want to consider using the free and easy-to-use tool called Zotero. The librarians at Reed College have created Zotero documentation at <https://libguides.reed.edu/citation/zotero>. In addition, a tutorial is available from Middlebury College at <https://sites.middlebury.edu/zoteromiddlebury/>.

_R Markdown_ uses _pandoc_ (<https://pandoc.org/>) to build its bibliographies. One nice caveat of this is that you won't have to do a second compile to load in references as standard LaTeX requires. To cite references in your thesis (after creating your bibliography database), place the reference name inside square brackets and precede it by the "at" symbol. For example, here's a reference to a book about worrying: [@Molina1994]. This `Molina1994` entry appears in a file called `thesis.bib` in the `bib` folder. This bibliography database file was created by a program called BibTeX. You can call this file something else if you like (look at the YAML header in the main .Rmd file) and, by default, is to placed in the `bib` folder.

For more information about BibTeX and bibliographies, see our CUS site (<https://web.reed.edu/cis/help/latex/index.html>)^[@reedweb2007]. There are three pages on this topic: _bibtex_ (which talks about using BibTeX, at <https://web.reed.edu/cis/help/latex/bibtex.html>), _bibtexstyles_ (about how to find and use the bibliography style that best suits your needs, at <https://web.reed.edu/cis/help/latex/bibtexstyles.html>) and _bibman_ (which covers how to make and maintain a bibliography by hand, without BibTeX, at <https://web.reed.edu/cis/help/latex/bibman.html>). The last page will not be useful unless you have only a few sources.
For more information about BibTeX and bibliographies, see the CUS site at Reed College (<https://web.reed.edu/cis/help/latex/index.html>)^[@reedweb2007]. There are three pages on this topic: _bibtex_ (which talks about using BibTeX, at <https://web.reed.edu/cis/help/latex/bibtex.html>), _bibtexstyles_ (about how to find and use the bibliography style that best suits your needs, at <https://web.reed.edu/cis/help/latex/bibtexstyles.html>) and _bibman_ (which covers how to make and maintain a bibliography by hand, without BibTeX, at <https://web.reed.edu/cis/help/latex/bibman.html>). The last page will not be useful unless you have only a few sources.

If you look at the YAML header at the top of the main .Rmd file you can see that we can specify the style of the bibliography by referencing the appropriate csl file. You can download a variety of different style files at <https://www.zotero.org/styles>. Make sure to download the file into the csl folder.

Expand All @@ -162,9 +162,6 @@ If you look at the YAML header at the top of the main .Rmd file you can see that
- When you have more than one author or editor, you need to separate each author's name by the word "and" e.g. `Author = {Noble, Sam and Youngberg, Jessica},`.
- Bibliographies made using BibTeX (whether manually or using a manager) accept LaTeX markup, so you can italicize and add symbols as necessary.
- To force capitalization in an article title or where all lowercase is generally used, bracket the capital letter in curly braces.
- You can add a Reed Thesis citation^[@noble2002] option. The best way to do this is to use the phdthesis type of citation, and use the optional "type" field to enter "Reed thesis" or "Undergraduate thesis."
- You can add a YSU Thesis citation^[@noble2002] option. The best way to do this is to use the phdthesis type of citation, and use the optional "type" field to enter "YSU thesis" or "Undergraduate thesis."

## Anything else?

If you'd like to see examples of other things in this template, please contact the Data @ Reed team (email <data@reed.edu>) with your suggestions. We love to see people using _R Markdown_ for their theses, and are happy to help.

4 changes: 2 additions & 2 deletions inst/rmarkdown/templates/thesis/skeleton/04-conclusion.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Conclusion {-}

If we don't want Conclusion to have a chapter number next to it, we can add the `{-}` attribute.
If we don't want Conclusion to have a section number next to it, we can add the `{-}` attribute.

**More info**

And here's some other random info: the first paragraph after a chapter title or section head _shouldn't be_ indented, because indents are to tell the reader that you're starting a new paragraph. Since that's obvious after a chapter or section title, proper typesetting doesn't add an indent there.
And here's some other random info: the first paragraph after a section head _shouldn't be_ indented, because indents are to tell the reader that you're starting a new paragraph. Since that's obvious after a chapter or section title, proper typesetting doesn't add an indent there.

4 changes: 2 additions & 2 deletions inst/rmarkdown/templates/thesis/skeleton/05-appendix.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This first appendix includes all of the R chunks of code that were hidden throug
```{r ref.label='include_packages', results='hide', echo = TRUE}
```

**In Chapter \@ref(ref-labels):**
**In Section \@ref(ref-labels):**

```{r ref.label='include_packages_2', results='hide', echo = TRUE}
```

# The Second Appendix, for Fun
# Another Appendix, if you want one
3 changes: 1 addition & 2 deletions inst/rmarkdown/templates/thesis/skeleton/99-references.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
The bib chunk below must go last in this document according to how R Markdown renders. More info is at http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html
-->

\backmatter

<!--
If you'd like to change the name of the bibliography to something else,
Expand All @@ -11,7 +10,7 @@ delete "References" and replace it.

# References {-}
<!--
This manually sets the header for this unnumbered chapter.
This manually sets the header for this unnumbered section.
-->
\markboth{References}{References}
<!--
Expand Down
13 changes: 13 additions & 0 deletions inst/rmarkdown/templates/thesis/skeleton/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Welcome!

This is a minimal example of a book based on R Markdown and **bookdown** (https://github.com/rstudio/bookdown).

This template provides a skeleton file structure that you can edit to create your book.

The contents inside the .Rmd files provide some pointers to help you get started, but feel free to also delete the content in each file and start fresh.

Additional resources:

The **bookdown** book: https://bookdown.org/yihui/bookdown/

The **bookdown** package reference site: https://pkgs.rstudio.com/bookdown
Loading

0 comments on commit f6a655b

Please sign in to comment.