Package 'beaverdown'

Title: An updated R Markdown thesis template for Oregon State University using the bookdown package
Description: Using the bookdown package and LaTeX and Word thesis templates from Oregon State University, this package was derived from Chester Ismay's package "thesisdown"
Authors: Zhian N. Kamvar [aut, cre], Chester Ismay [aut, ccp], Rick Treinen [aut], Neville Mehta [aut], Deling Ren [aut], John Metta [aut, ccp]
Maintainer: Zhian N. Kamvar <[email protected]>
License: MIT + file LICENSE
Version: 0.2.1
Built: 2024-10-27 03:04:11 UTC
Source: https://github.com/zkamvar/beaverdown

Help Index


beaver: A package for creating undergraduate, Masters, and PhD theses using R Markdown

Description

This package creates theses/dissertations for Oregon State University.

thesis_gitbook

Creates an R Markdown thesis template as a webpage

thesis_pdf

Creates an R Markdown thesis template as a PDF

thesis_word

Creates an R Markdown thesis template as a Microsoft Word document


Return latex control text if rendering latex

Description

Return latex control text if rendering latex

Usage

iflatex(txt)

Arguments

txt

Value

a string

Examples

## Not run: 
iflatex("\\vspace*{\\fill}")

## End(Not run)

Generate a section for the yaml input

Description

Generate a section for the yaml input

Usage

inc(input, sep = "\n  ")

Arguments

input

a file containing markdown text

sep

a separator for each line. Defaults to "\n "

Value

a string

Examples

f <- file()
cat("  this is\nsome text that\nwill be renedered in\na file\n", file = f)
cat(inc(f))
close(f)

Process citations in a text formatted with markdown

Description

Process citations in a text formatted with markdown

Usage

process_citations(caption, yml, figname = "fig1", to = "latex")

Arguments

caption

text formatted with markdown

yml

a list of yaml metadata

figname

the name of the output file

to

the output format. Defaults to "latex". Could also be "html". "markdown" does nothing useful.

Value

formatted text with rendered citations

See Also

render_caption

Examples

# Setup for the example
# Note that this will already be set for you when you run the document
rootdir <- find.package("beaverdown")
rootdir <- paste0(rootdir, "/rmarkdown/templates/oregonstate/skeleton/")
bib <- file.path(rootdir, c("bib/references.bib", "bib/thesis.bib"))
bib <- paste(bib, collapse = "\n    ")
csl <- file.path(rootdir, "csl/apa.csl")
txt <- "**Hey!** This is a citation from @angel2000."
yml <- list(bibliography = bib, csl = csl, `link-citations` = TRUE)
process_citations(txt, yml)

Render LaTeX captions

Description

Captions are not rendered to latex by default. To aid in writing these, This function will take in your markdown-formatted caption, and give you a latex formatted caption.

Usage

render_caption(caption, figname = "fig1", index = "index.Rmd",
  to = "latex")

Arguments

caption

the markdown-formatted text you want to render as a figure caption.

figname

the name of the figure (as to not crowd the )

Details

This works by utilizing the knitr function pandoc. It allows you to include references in your captions, which are not automatically rendered.

Value

a figure caption rendered in LaTeX

See Also

process_citations

Examples

# Setup for the example
# Note that this will already be set for you when you run the document
rootdir <- find.package("beaverdown")
rootdir <- paste0(rootdir, "/rmarkdown/templates/oregonstate/skeleton/")
knitr::opts_knit$set(root.dir = rootdir)


caption <- "This is some *text* to use as a caption [@angel2000]!"
# Make sure to set your index to whatever your project is called!
render_caption(caption, index = "skeleton.Rmd")

Creates an R Markdown epub Thesis document

Description

This is a function called in output in the YAML of the driver Rmd file to specify the creation of a epub version of the thesis.

Usage

thesis_epub()

Value

A ebook version of the thesis

Examples

## Not run: 
 output: thesisdown::thesis_epub

## End(Not run)

Creates an R Markdown gitbook Thesis document

Description

This is a function called in output in the YAML of the driver Rmd file to specify the creation of a webpage version of the thesis.

Usage

thesis_gitbook()

Value

A gitbook webpage

Examples

## Not run: 
 output: thesisdown::thesis_gitbook

## End(Not run)

Creates an R Markdown PDF Thesis document

Description

This is a function called in output in the YAML of the driver Rmd file to specify using the Oregon State University LaTeX template and cls files.

Usage

thesis_pdf(toc = TRUE, toc_depth = 3, ...)

Arguments

toc

A Boolean (TRUE or FALSE) specifying where table of contents should be created

toc_depth

A positive integer

...

arguments to be passed to rmarkdown::pdf_document

Value

A modified pdf_document based on the Reed Senior Thesis LaTeX template

Note

The arguments highlight, keep_tex, and pandoc_args, are already set.

Examples

## Not run: 
 output: thesisdown::thesis_pdf

## End(Not run)

Creates an R Markdown Word Thesis document

Description

This is a function called in output in the YAML of the driver Rmd file to specify the creation of a Microsoft Word version of the thesis.

Usage

thesis_word()

Value

A Word Document based on (hopefully soon, but not currently) the Reed Senior Thesis Word template

Examples

## Not run: 
 output: thesisdown::thesis_word

## End(Not run)