Skip to content

Commit

Permalink
Develop (#91)
Browse files Browse the repository at this point in the history
* Tweak phrasing

* Updates (#68)

* Add hadamardown template (#67)

* Add hadamardown

* Update documentation

* Update DESCRIPTION

Co-authored-by: Antoine Bichat <[email protected]>

* update (#88)

* Add hadamardown template (#67)

* Add hadamardown

* Update documentation

* Update DESCRIPTION

* Switch to PDF by default

* Update README.md

* Update README.md

* updates README.md (#78)

* updates README.md

* changes dependencies from devtools to remotes.

* Update template.tex (#79)

* Add link to amsterdown pkg in README (#80)

* Fixed broken URLs and added few more (#85)

* Fixed broken URLs and added few more

* Reversed a URL change for markdown cheatsheet

I moved the Rmakrdown Cheatsheet under R Markdown and reversed the modification of the Markdown Cheatsheet.

* Allow user to change bookdown::gitbook() options (#84)

* Add ...

* Allow user to change "before" and "after" toc arguments

* Pass all type of option and sub-options to bookdown::gitbook

Co-authored-by: Antoine Bichat <[email protected]>
Co-authored-by: Leon Reteig <[email protected]>
Co-authored-by: Mehrad Mahmoudian <[email protected]>

* Fix Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 14.49998pt.

* Fix abstract messing up bib findings/fix spacing

* Move preliminary content to their own folder

* Start using {here}

* Apply {styler} / Can't use rmd_files with {thesisdown} in _bookdown.yml

* Remove extra line

* Switch to https from http

* Add License, update dev version, clean up dependencies

* Update documentation

* Clean up Rmds

* Reduce size of data

* Tweak package definition in R file

* Add {usethis} commands for setup

* Move pictures to images folder

* Add hex to README

* Add pkgdown build to docs

* Update NEWS for 0.1.0

Co-authored-by: Chester Ismay <[email protected]>
Co-authored-by: Antoine Bichat <[email protected]>
Co-authored-by: Leon Reteig <[email protected]>
Co-authored-by: Mehrad Mahmoudian <[email protected]>
  • Loading branch information
5 people authored May 27, 2020
1 parent 9bf78a3 commit 2a39610
Show file tree
Hide file tree
Showing 27 changed files with 12,788 additions and 52,879 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
^.*\.Rproj$
^\.Rproj\.user$
R/.setup.R
^_pkgdown\.yml$
^docs$
^pkgdown$
^images$
^LICENSE\.md$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.DS_Store
inst/rmarkdown/templates/thesis/skeleton/_book/*
inst/rmarkdown/templates/thesis/skeleton/_bookdown_files/*
docs
11 changes: 7 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ Description: Using the bookdown package and LaTeX and Word thesis templates from
and analyses as well.
Maintainer: Chester Ismay <[email protected]>
Depends:
R (>= 3.2.0),
remotes,
R (>= 3.2.0)
Imports:
dplyr,
ggplot2,
bookdown,
knitr,
here
License: MIT
Suggests:
remotes,
usethis
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
SystemRequirements: pandoc (>= 1.18) - http://pandoc.org
SystemRequirements: pandoc (>= 1.18) - https://pandoc.org
RoxygenNote: 7.1.0
23 changes: 2 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
MIT License

Copyright (c) 2016 Chester Ismay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
YEAR: 2020
COPYRIGHT HOLDER: Chester Ismay
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2020 Chester Ismay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# thesisdown 0.1.0

- Fixed issue ((#86)[https://github.com/ismayc/thesisdown/issues/86]) with references not showing in Gitbook version
- Added support for customizing of thesisdown::gitbook ((#84)[https://github.com/ismayc/thesisdown/pull/84])
- Added hex sticker ([1](https://github.com/ismayc/thesisdown/commit/ababba5437ee2fe0632c74d5428fed35b911c751) and [2](https://github.com/ismayc/thesisdown/commit/d556073c94ae5069d4373fc73811b3115905c56f))
- [Converted http to https throughout Rmd files](https://github.com/ismayc/thesisdown/commit/aa4bac89ab7cf91d7898d9b52d737b00e6b6f71a)
- [Reduced `flights.csv` included data](https://github.com/ismayc/thesisdown/commit/0a6bf0c5d6bdb75be4e09a58b588feeaff778af0) to prepare for sending to CRAN
- [Created {pkgdown} site](https://github.com/ismayc/thesisdown/commit/7febd70b98ae6e8d104bf1080e066468d030b968)

# thesisdown 0.0.2

- Changed default filename (in directions) to be `index` instead of `skeleton` to match with gitbook requirements
Expand Down
7 changes: 7 additions & 0 deletions R/.setup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import_pkgs <- c("bookdown", "dplyr", "ggplot2", "here", "knitr")
invisible(lapply(import_pkgs, usethis::use_package, type = "Imports"))
suggest_pkgs <- c("remotes", "usethis")
invisible(lapply(suggest_pkgs, usethis::use_package, type = "Suggests"))

usethis::use_pkgdown()
usethis::use_mit_license(name = "Chester Ismay")
2 changes: 1 addition & 1 deletion R/thesisdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
#' Creates an R Markdown thesis template as an ebook
#' @docType package
#' @name thesisdown
NULL
"_PACKAGE"
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# thesisdown
# thesisdown <img src="man/figures/thesisdown_hex.png" align="right" width=200 />

This project was inspired by the [bookdown](https://github.com/rstudio/bookdown) package and is an updated version of my Senior Thesis template in the `reedtemplates` package [here](https://github.com/ismayc/reedtemplates). It was originally designed to only work with the Reed College LaTeX template, but has since been adapted to work with many different institutions by many different individuals. Check out the [**Customizing thesisdown to your institution**](https://github.com/ismayc/thesisdown#customizing-thesisdown-to-your-institution) section below for examples.

Expand All @@ -7,7 +7,7 @@ Currently, the PDF and gitbook versions are fully-functional. The word and epub
If you are new to working with `bookdown`/`rmarkdown`, please read over the documentation available in the `gitbook` template at https://thesisdown.netlify.com/. This is also available below at https://ismayc.github.io/thesisdown_book.

The current output for the four versions is here:
- [PDF](https://github.com/ismayc/thesisdown_book/blob/gh-pages/thesis.pdf) (Generating LaTeX file is available [here](https://github.com/ismayc/thesisdown_book/blob/gh-pages/thesis.tex) with other files at in the [book directory](https://github.com/ismayc/thesisdown_book/tree/gh-pages).)
- [PDF](https://github.com/ismayc/thesisdown_book/blob/gh-pages/thesis.pdf) (Generating LaTeX file is available [here](https://github.com/ismayc/thesisdown_book/blob/gh-pages/thesis.tex) with other files in the [book directory](https://github.com/ismayc/thesisdown_book/tree/gh-pages).)
- [Word](https://github.com/ismayc/thesisdown_book/blob/gh-pages/thesis.docx)
- [ePub](https://github.com/ismayc/thesisdown_book/blob/gh-pages/thesis.epub)
- [gitbook](https://ismayc.github.io/thesisdown_book)
Expand Down Expand Up @@ -71,14 +71,14 @@ You may need to install a few extra LaTeX packages on your first attempt to knit
tinytex::tlmgr_install("babel-portuges")
```

To use **thesisdown** from [RStudio](http://www.rstudio.com/products/rstudio/download/):
To use **thesisdown** from [RStudio](https://www.rstudio.com/products/rstudio/download/):

1) Ensure that you have already installed LaTeX and the fonts described above, and are using the latest version of [RStudio](http://www.rstudio.com/products/rstudio/download/). You can use `thesisdown` without RStudio. For example, you can write the Rmd files in your favourite text editor (e.g. [Atom](https://atom.io/), [Notepad++](https://notepad-plus-plus.org/)). But RStudio is probably the easiest tool for writing both R code and text in your thesis. It also provides a nice way to build your thesis while editing. We'll proceed assuming that you have decided to use the RStudio workflow.
1) Ensure that you have already installed LaTeX and the fonts described above, and are using the latest version of [RStudio](https://www.rstudio.com/products/rstudio/download/). You can use `thesisdown` without RStudio. For example, you can write the Rmd files in your favourite text editor (e.g. [Atom](https://atom.io/), [Notepad++](https://notepad-plus-plus.org/)). But RStudio is probably the easiest tool for writing both R code and text in your thesis. It also provides a nice way to build your thesis while editing. We'll proceed assuming that you have decided to use the RStudio workflow.

2) Install the **bookdown** and **thesisdown** packages. Note that **thesisdown** is not available on CRAN at the moment and that's why `install.packages("thesisdown")` won't work. Use `remotes::install_github()` as shown below instead to install the package.

```r
if (!require("remotes")) install.packages("remotes", repos = "http://cran.rstudio.org")
if (!require("remotes")) install.packages("remotes", repos = "https://cran.rstudio.org")
remotes::install_github("rstudio/bookdown")
remotes::install_github("ismayc/thesisdown")
```
Expand All @@ -87,15 +87,15 @@ Note that you may need to restart RStudio at this point for the following dialog

3) Use the **New R Markdown** dialog to select **Thesis**:

![New R Markdown](thesis_rmd.png)
![New R Markdown](images/thesis_rmd.png)

Note that this will currently only **Knit** if you name the directory `index` as shown above. This guarantees that `index.html` is generated correctly for the Gitbook version of the thesis.
Note that this will currently only **Knit** if you name the directory `index` as shown above. This guarantees that `index.html` is generated correctly for the Gitbook version of the thesis.

4) After choosing which type of output you'd like in the YAML at the top of index.Rmd, **Knit** the `index.Rmd` file to get the book in PDF or HTML formats.

### Day-to-day writing of your thesis

You need to edit the individual chapter R Markdown files to write your thesis. It's recommended that you version control your thesis using GitHub if possible. RStudio can also easily sync up with GitHub to make the process easier. While writing, you should `git commit` your work frequently, after every major activity on your thesis. For example, every few paragraphs or section of text, and after major step of analysis development. You should `git push` at the end of each work session before you leave your computer or change tasks. For a gentle, novice-friendly guide to getting starting with using Git with R and RStudio, see <http://happygitwithr.com/>.
You need to edit the individual chapter R Markdown files to write your thesis. It's recommended that you version control your thesis using GitHub if possible. RStudio can also easily sync up with GitHub to make the process easier. While writing, you should `git commit` your work frequently, after every major activity on your thesis. For example, every few paragraphs or section of text, and after major step of analysis development. You should `git push` at the end of each work session before you leave your computer or change tasks. For a gentle, novice-friendly guide to getting starting with using Git with R and RStudio, see <https://happygitwithr.com/>.

## Rendering

Expand Down Expand Up @@ -127,7 +127,7 @@ Store your bibliography (as bibtex files) here. We recommend using the [citr add
### `csl/`

Specific style files for bibliographies should be stored here. A good source for
citation styles is https://github.com/citation-style-language/styles#readme
citation styles is https://github.com/citation-style-language/styles#readme.

### `figure/` and `data/`

Expand Down
Empty file added _pkgdown.yml
Empty file.
Binary file added images/happy_cap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions images/hex_creator.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
library(hexSticker)

# https://pixabay.com/illustrations/graduation-hats-throw-graduation-4906359/
cap <- "images/happy_cap.png"

sticker(cap,
package = "thesisdown",
p_family = "Aller_Rg",
p_size = 7, p_color = "#5B5040", # p_x = 4, p_y = 1.4,
s_x = 1, s_y = .8, s_width = 0.75, s_height = 0.75,
h_fill = "#FAECC7", h_color = "#5B5040",
filename = "thesisdown_hex.png",
url = "thesisdown.rbind.io"
)

# Final image was revised in Adobe Illustrator
File renamed without changes
23 changes: 13 additions & 10 deletions inst/rmarkdown/templates/thesis/skeleton/01-chap1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The {#rmd-basics} text after the chapter declaration will allow us to link throu

# R Markdown Basics {#rmd-basics}

Here is a brief introduction into using _R Markdown_. _Markdown_ is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. _R Markdown_ provides the flexibility of _Markdown_ with the implementation of **R** input and output. For more details on using _R Markdown_ see <http://rmarkdown.rstudio.com>.
Here is a brief introduction into using _R Markdown_. _Markdown_ is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. _R Markdown_ provides the flexibility of _Markdown_ with the implementation of **R** input and output. For more details on using _R Markdown_ see <https://rmarkdown.rstudio.com>.

Be careful with your spacing in _Markdown_ documents. While whitespace largely is ignored, it does at times give _Markdown_ signals as to how to proceed. As a habit, try to keep everything left aligned whenever possible, especially as you type a new paragraph. In other words, there is no need to indent basic text in the Rmd document (in fact, it might cause your text to do funny things if you do).

Expand Down Expand Up @@ -75,34 +75,37 @@ As you see with `$2 \pi$` above, mathematics can be added by surrounding the mat

## Including plots

You can also embed plots. For example, here is a way to use the base **R** graphics package to produce a plot using the built-in `pressure` dataset:
You can also embed plots. For example, here is a way to use the base **R** graphics package to produce a plot using the built-in `pressure` dataset:

```{r pressure, echo=FALSE, cache=TRUE}
```{r pressure, echo=FALSE, cache=TRUE, fig.height=3, fig.width=5}
plot(pressure)
```

Note that the `echo=FALSE` parameter was added to the code chunk to prevent printing of the **R** code that generated the plot. There are plenty of other ways to add chunk options. More information is available at <http://yihui.name/knitr/options/>.
Note that the `echo=FALSE` parameter was added to the code chunk to prevent printing of the **R** code that generated the plot. There are plenty of other ways to add chunk options (like `fig.height` and `fig.width` in the chunk above). More information is available at <https://yihui.org/knitr/options/>.

Another useful chunk option is the setting of `cache=TRUE` as you see here. If document rendering becomes time consuming due to long computations or plots that are expensive to generate you can use knitr caching to improve performance. Later in this file, you'll see a way to reference plots created in **R** or external figures.

## Loading and exploring data

Included in this template is a file called `flights.csv`. This file includes a subset of the larger dataset of information about all flights that departed from Seattle and Portland in 2014. More information about this dataset and its **R** package is available at <http://github.com/ismayc/pnwflights14>. This subset includes only Portland flights and only rows that were complete with no missing values. Merges were also done with the `airports` and `airlines` data sets in the `pnwflights14` package to get more descriptive airport and airline names.
Included in this template is a file called `flights.csv`. This file includes a subset of the larger dataset of information about all flights that departed from Seattle and Portland in 2014. More information about this dataset and its **R** package is available at <https://github.com/ismayc/pnwflights14>. This subset includes only Portland flights and only rows that were complete with no missing values. Merges were also done with the `airports` and `airlines` data sets in the `pnwflights14` package to get more descriptive airport and airline names.

We can load in this data set using the following command:
We can load in this data set using the following commands:

```{r load_data}
flights <- read.csv("data/flights.csv")
# flights.csv is in the data directory
flights_path <- here::here("data", "flights.csv")
# string columns will be read in as strings and not factors now
flights <- read.csv(flights_path, stringsAsFactors = FALSE)
```

The data is now stored in the data frame called `flights` in **R**. To get a better feel for the variables included in this dataset we can use a variety of functions. Here we can see the dimensions (rows by columns) and also the names of the columns.
The data is now stored in the data frame called `flights` in **R**. To get a better feel for the variables included in this dataset we can use a variety of functions. Here we can see the dimensions (rows by columns) and also the names of the columns.

```{r str}
dim(flights)
names(flights)
```

Another good idea is to take a look at the dataset in table form. With this dataset having more than 50,000 rows, we won't explicitly show the results of the command here. I recommend you enter the command into the Console **_after_** you have run the **R** chunks above to load the data into **R**.
Another good idea is to take a look at the dataset in table form. With this dataset having more than 20,000 rows, we won't explicitly show the results of the command here. I recommend you enter the command into the Console **_after_** you have run the **R** chunks above to load the data into **R**.

```{r view_flights, eval=FALSE}
View(flights)
Expand All @@ -121,7 +124,7 @@ new.pkg <- pkg[!(pkg %in% installed.packages())]
# If there are any packages in the list that aren't installed,
# install them
if (length(new.pkg)) {
install.packages(new.pkg, repos = "http://cran.rstudio.com")
install.packages(new.pkg, repos = "https://cran.rstudio.com")
}
# Load packages (thesisdown will load all of the packages as well)
library(thesisdown)
Expand Down
4 changes: 2 additions & 2 deletions inst/rmarkdown/templates/thesis/skeleton/02-chap2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ $\mathrm{NH_4Cl_{(s)}}$ $\rightleftharpoons$ $\mathrm{NH_{3(g)}+HCl_{(g)}}$

## Physics

Many of the symbols you will need can be found on the math page <http://web.reed.edu/cis/help/latex/math.html> and the Comprehensive LaTeX Symbol Guide (<http://mirror.utexas.edu/ctan/info/symbols/comprehensive/symbols-letter.pdf>).
Many of the symbols you will need can be found on the math page <https://web.reed.edu/cis/help/latex/math.html> and the Comprehensive LaTeX Symbol Guide (<https://mirror.utexas.edu/ctan/info/symbols/comprehensive/symbols-letter.pdf>).

## Biology

You will probably find the resources at <http://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 (<http://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 proceeding chapter on graphics and tables.

Loading

0 comments on commit 2a39610

Please sign in to comment.