Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIUC LaTeX PDF ECE Department Thesis Style #15

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
^README-.*\.png$
^\.travis\.yml$
^cran-comments\.md$
^inst/rmarkdown/templates/cover_letter$
^inst/rmarkdown/templates/exam$
^inst/rmarkdown/templates/uiuc_hw$
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false
cache: packages
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: uiucthemes
Type: Package
Title: 'R' 'Markdown' Themes for 'UIUC' Documents and Presentations
Version: 0.2.1
Version: 0.2.2
Authors@R: c(
person("James", "Balamuta",
email = "balamut2@illinois.edu", role = c("aut", "cre"),
Expand All @@ -13,7 +13,7 @@ Authors@R: c(
email = "dalpiaz2@illinois.edu", role = "ctb",
comment = "Collaborated on the LaTeX Journal Theme"),
person("Jose Luis", "Rodriguez",
email = "jrodriguezorjuela@luc.edu", role = "ctb",
email = "jlroo@illinois.edu", role = "ctb",
comment = "Provided the Market Information Lab (MIL) Beamer Theme")
)
Description: A set of custom 'R' 'Markdown' templates for documents and
Expand All @@ -25,8 +25,9 @@ Depends:
R (>= 3.0)
License: MIT + file LICENSE
Imports:
rmarkdown (>= 1.1.0)
RoxygenNote: 6.1.0
rmarkdown (>= 1.1.0),
bookdown
RoxygenNote: 6.1.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
Suggests: knitr
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export(beamer_illinois)
export(beamer_mil)
export(beamer_orange)
export(latex_journal_format)
importFrom(rmarkdown,beamer_presentation)
export(thesis_pdf_ece)
12 changes: 10 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# uiucthemes 0.2.2

## NEW

- Added `thesis_pdf_ece()` template for writing a Master's and PhD thesis in
the Department of ECE at UIUC.


# uiucthemes 0.2.1

## NEW

- Added the `beamer_mil()` template for the
[Market Information Lab (MIL)](https://business.illinois.edu/mil/) @ UIUC
created by [Jose Luis Rodriguez](https://www.luc.edu/quinlan/faculty/joseluisrodriguezorjuela.shtml)
[Market Information Lab (MIL)](https://giesbusiness.illinois.edu/margolis-market-information-lab) @ UIUC
created by [Jose Luis Rodriguez](https://giesbusiness.illinois.edu/profile/jose-luis-rodriguez-orjuela)
- Added a vignette that contains screenshots of each template.

## CHANGES
Expand Down
62 changes: 62 additions & 0 deletions R/thesis-templates.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#' Creates an R Markdown PDF Thesis document in the Style of the ECE Department
#' at UIUC
#'
#' Processes the R Markdown file using the appropriate ECE PDF template.
#'
#' @param toc_depth Depth shown in table of contents. Must be a positive integer.
#' @param highlight Syntax highlighting style. Supported styles include:
#' "default", "tango", "pygments", "kate", "monochrome",
#' "espresso", "zenburn", and "haddock". Pass `NULL`
#' to prevent syntax highlighting.
#' @param ... Additional parameters passed to [bookdown::pdf_book()].
#'
#' @return
#' A modified \code{pdf_document} that uses the ECE Department style at UIUC.
#'
#' @references
#'
#' - [`thesisdown::thesis_pdf`](https://github.com/ismayc/thesisdown) by Chester Ismay
#' - The _R_ function is largely based off of this format.
#' - [ECE Department Thesis LaTeX Template](https://wiki.illinois.edu/wiki/display/ECEThesisReview/LaTeX+Resources)
#' - The `template.tex` uses the shell.
#'
#' @export
#' @examples
#' \dontrun{
#' output: uiucthemes::thesis_pdf_ece
#' }
thesis_pdf_ece <- function(toc_depth = 3, highlight = "default", ...){

base <- bookdown::pdf_book(template = "template.tex",
toc = TRUE,
toc_depth = toc_depth,
highlight = highlight,
keep_tex = TRUE,
pandoc_args = "--top-level-division=chapter",
...)

# Mostly copied from knitr::render_sweave
base$knitr$opts_chunk$comment <- NA
#base$knitr$opts_chunk$fig.align <- "center"

old_opt <- getOption("bookdown.post.latex")
options(bookdown.post.latex = fix_envs)
on.exit(options(bookdown.post.late = old_opt))

base

}


fix_envs = function(x){
beg_reg <- '^\\s*\\\\begin\\{.*\\}'
end_reg <- '^\\s*\\\\end\\{.*\\}'
i3 = if (length(i1 <- grep(beg_reg, x))) (i1 - 1)[grepl("^\\s*$", x[i1 - 1])]

i3 = c(i3,
if (length(i2 <- grep(end_reg, x))) (i2 + 1)[grepl("^\\s*$", x[i2 + 1])]
)
if (length(i3)) x = x[-i3]
x
}

8 changes: 8 additions & 0 deletions R/uiucthemes-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#' @keywords internal
"_PACKAGE"

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
## usethis namespace: end
NULL
3 changes: 0 additions & 3 deletions R/uiucthemes.R

This file was deleted.

7 changes: 4 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ presentations, journal articles, and exam templates.

Included in the package are:

- `beamer_illinois`: Illinois colored header boxes
- `beamer_illinois`: Illinois colored header boxes.
- `beamer_orange`: Minimialist slides with a color preference to orange.
- `beamer_mil`: Beamer Market Information Lab (MIL)
- `latex_journal_report`: initial implementation of a journal entry for a class.
- `beamer_mil`: [Market Information Lab (MIL)](https://giesbusiness.illinois.edu/margolis-market-information-lab) Beamer Template.
- `thesis_pdf_ece`: LaTeX Thesis Template for the [Department of ECE at UIUC](https://wiki.illinois.edu/wiki/display/ECEThesisReview/LaTeX+Resources).
- `latex_journal_report`: Initial implementation of a journal entry for a class.

Screenshots of each template are included in package overview vignette.

Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ for presentations, journal articles, and exam templates.

Included in the package are:

- `beamer_illinois`: Illinois colored header boxes
- `beamer_illinois`: Illinois colored header boxes.
- `beamer_orange`: Minimialist slides with a color preference to
orange.
- `beamer_mil`: Beamer Market Information Lab (MIL)
- `latex_journal_report`: initial implementation of a journal entry
- `beamer_mil`: [Market Information Lab
(MIL)](https://giesbusiness.illinois.edu/margolis-market-information-lab)
Beamer Template.
- `thesis_pdf_ece`: LaTeX Thesis Template for the [Department of ECE
at
UIUC](https://wiki.illinois.edu/wiki/display/ECEThesisReview/LaTeX+Resources).
- `latex_journal_report`: Initial implementation of a journal entry
for a class.

Screenshots of each template are included in package overview vignette.
Expand All @@ -31,8 +36,8 @@ title: '"Illinois" UIUC Beamer Theme'
short-title: "Beamer Slides"
author: "John and Mary Doe"
short-author: "J & M Doe"
date: 'October 03, 2018' # Month DD, YYYY (Main Slide)
short-date: '10/03/2018' # MM/DD/YYYY (Lower Right)
date: 'May 22, 2019' # Month DD, YYYY (Main Slide)
short-date: '05/22/2019' # MM/DD/YYYY (Lower Right)
institute: "University of Illinois at Urbana-Champaign"
short-institute: "UIUC"
department: "Department of Magic" # Institute must be defined
Expand Down Expand Up @@ -134,8 +139,7 @@ install.packages(c("rmarkdown","uiucthemes"))
install.packages(c("rmarkdown","uiucthemes"))
```

3) Use the `rmarkdown::draft` function to create
articles:
3) Use the `rmarkdown::draft` function to create articles:

<!-- end list -->

Expand Down
Binary file not shown.
Loading