diff --git a/DESCRIPTION b/DESCRIPTION index 626a7d889..dc395a72b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,33 @@ Package: rticles Type: Package -Title: What the package does (short line) -Version: 1.0 -Date: 2014-03-14 -Author: Who wrote it -Maintainer: Who to complain to -Description: More about what it does (maybe more than one line) +Title: Article Formats for R Markdown +Version: 0.2 +Date: 2016-04-24 +Authors@R: c( + person("JJ", "Allaire", role = c("aut", "cre"), email = "jj@rstudio.com"), + person(family = "R Foundation", role = c("aut", "cph")), + person("Hadley", "Wickham", role = "aut", email = "hadley@rstudio.com"), + person(family = "Journal of Statistical Software", role = c("aut", "cph")), + person("Yihui", "Xie", role = "aut", email = "yihui@rstudio.com"), + person(family = "RStudio", role = "cph"), + person("Ramnath ", "Vaidyanathan", role = c("aut", "cph"), email = "ramnath.vaidya@gmail.com"), + person(family = "Assocation for Computing Machinery", role = c("aut", "cph")), + person("Carl", "Boettiger", role = c("aut", "cph"), email = "cboettig@gmail.com"), + person(family = "Elsevier", role = c("aut", "cph")), + person("Karl", "Broman", role = c("aut", "cph"), email = "kbroman@gmail.com"), + person("Kirill", "Mueller", role = c("aut", "cph"), email = "kirill.mueller@ivt.baug.ethz.ch"), + person("Bastiaan", "Quast", role = c("aut", "cph"), email = "bquast@gmail.com"), + person("Randall ", "Pruim", role = c("aut", "cph"), email = "rpruim@gmail.com"), + person("Ben", "Marwick", role = c("aut", "cph"), email = "bmarwick@uw.edu"), + person("Charlotte", "Wickham", role = c("aut", "cph"), email = "cwickham@gmail.com"), + person("Oliver", "Keyes", role = c("aut", "cph"), email = "okeyes@wikimedia.org"), + person("Miao", "Yu", role = c("aut", "cph"), email = "yufreecas@gmail.com") + ) +Description: A suite of custom R Markdown formats and templates for + authoring journal articles and conference submissions. License: GPL-3 -Imports: - rmarkdown +Imports: utils, rmarkdown, knitr, yaml +SystemRequirements: GNU make +RoxygenNote: 5.0.1 +Suggests: testthat + diff --git a/NAMESPACE b/NAMESPACE index 5ce7a3c3b..01a2d077c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,11 +1,9 @@ -# Generated by roxygen2 (4.1.1): do not edit by hand +# Generated by roxygen2: do not edit by hand -export(acm) -export(acs) +export(acm_article) +export(acs_article) +export(ctex) export(ctex_template) -export(frontiers_article) +export(elsevier_article) export(jss_article) -export(plos_article) export(rjournal_article) -export(tufte_ebook) -export(use_r_abstract) diff --git a/R/acm_article.R b/R/acm_article.R index ef728e0a8..98fe1ba0c 100644 --- a/R/acm_article.R +++ b/R/acm_article.R @@ -1,10 +1,26 @@ +#' Association for Computing Machinery (ACM) format. +#' +#' Format for creating an Association for Computing Machinery (ACM) articles. +#' Adapted from +#' \href{http://www.acm.org/publications/article-templates/proceedings-template.html}{http://www.acm.org/publications/article-templates/proceedings-template.html}. +#' +#' @inheritParams rmarkdown::pdf_document +#' @param ... Arguments to \code{rmarkdown::pdf_document} +#' +#' @return R Markdown output format to pass to \code{\link[rmarkdown:render]{render}} +#' +#' @examples +#' +#' \dontrun{ +#' library(rmarkdown) +#' draft("MyArticle.Rmd", template = "acm_article", package = "rticles") +#' } +#' #' @export -acm <- function() { - template <- find_resource("acm", "template.tex") - csl <- find_resource("acm" ,"acm-sig-proceedings.csl") - - rmarkdown::pdf_document( - template = template, - pandoc_args = c("--csl", rmarkdown::pandoc_path_arg(csl))) +acm_article <- function(...) { + pdf_document_format(..., + format = "acm_article", + template = "template.tex", + csl = "acm-sig-proceedings.csl") } diff --git a/R/acs_article.R b/R/acs_article.R old mode 100644 new mode 100755 index 27a2b6f30..b4150067f --- a/R/acs_article.R +++ b/R/acs_article.R @@ -1,11 +1,30 @@ +#' American Chemical Society (ACS) Journal format. +#' +#' Format for creating an American Chemical Society (ACS) Journal articles. +#' Adapted from +#' \href{http://pubs.acs.org/page/4authors/submission/tex.html}{http://pubs.acs.org/page/4authors/submission/tex.html}. +#' +#' @inheritParams rmarkdown::pdf_document +#' @param ... Arguments to \code{rmarkdown::pdf_document} +#' +#' @return R Markdown output format to pass to \code{\link[rmarkdown:render]{render}} +#' @examples +#' +#' \dontrun{ +#' library(rmarkdown) +#' draft("MyArticle.Rmd", template = "acs_article", package = "rticles") +#' } +#' #' @export -acs <- function(keep_tex = TRUE) { - template <- find_resource("acs", "template.tex") - csl <- find_resource("acs", "american-chemical-society.csl") - - rmarkdown::pdf_document( - keep_tex = keep_tex, - fig_caption = TRUE, - template = template, - pandoc_args = c("--csl", rmarkdown::pandoc_path_arg(csl))) +acs_article <- function(..., + keep_tex = TRUE, + md_extensions = c("-autolink_bare_uris"), + fig_caption = TRUE){ + pdf_document_format(..., + keep_tex = keep_tex, + md_extensions = md_extensions, + format = "acs_article", + template = "template.tex", + csl = "american-chemical-society.csl", + fig_caption = fig_caption) } diff --git a/R/ctex.R b/R/ctex.R index ba434bb4d..950265c36 100644 --- a/R/ctex.R +++ b/R/ctex.R @@ -1,6 +1,28 @@ -#' A LaTeX template for Chinese documents +#' A PDF format for documents based on the LaTeX package \pkg{ctex} #' -#' This function returns the path to a LaTeX template for Chinese documents -#' using the ctex package. +#' \code{ctex()} is a wrapper function for \code{rmarkdown::pdf_document()} and +#' changed the default values of two arguments \code{template} and +#' \code{latex_engine} so it works better with the \pkg{ctex} package. +#' @param ...,template,latex_engine Passed to +#' \code{markdown::\link[rmarkdown]{pdf_document}()} +#' @return \code{ctex()} returns a format that can be passed to +#' \code{rmarkdown::render()}; \code{ctex_template()} returns the path to a +#' LaTeX template in \pkg{rticles} for Chinese documents using the \pkg{ctex} +#' package. +#' +#' @examples +#' +#' \dontrun{ +#' library(rmarkdown) +#' draft("MyArticle.Rmd", template = "ctex", package = "rticles") +#' } +#' +#' @export +ctex <- function(..., template = ctex_template(), latex_engine = 'xelatex') { + inherit_pdf_document(..., template = template, latex_engine = latex_engine) +} + + +#' @rdname ctex #' @export ctex_template <- function() find_resource('ctex', 'default.latex') diff --git a/R/elsevier_article.R b/R/elsevier_article.R new file mode 100644 index 000000000..5f3cd82f6 --- /dev/null +++ b/R/elsevier_article.R @@ -0,0 +1,27 @@ +#' Elsevier journal format. +#' +#' Format for creating submissions to Elsevier journals. Adapted from +#' \href{https://www.elsevier.com/authors/author-schemas/latex-instructions}{https://www.elsevier.com/authors/author-schemas/latex-instructions}. +#' +#' @inheritParams rmarkdown::pdf_document +#' @param ... Additional arguments to \code{rmarkdown::pdf_document} +#' +#' @return R Markdown output format to pass to +#' \code{\link[rmarkdown:render]{render}} +#' +#' @examples +#' +#' \dontrun{ +#' library(rmarkdown) +#' draft("MyArticle.Rmd", template = "elsevier_article", package = "rticles") +#' } +#' +#' @export +elsevier_article <- function(..., + keep_tex = TRUE, + md_extensions = c("-autolink_bare_uris")) { + inherit_pdf_document(..., + template = find_resource("elsevier_article", "template.tex"), + keep_tex = keep_tex, + md_extensions = md_extensions) +} diff --git a/R/frontiers_article.R b/R/frontiers_article.R deleted file mode 100644 index c0fcdceda..000000000 --- a/R/frontiers_article.R +++ /dev/null @@ -1,39 +0,0 @@ -#' @export -frontiers_article <- function(keep_tex = TRUE, - includes = NULL){ - template <- system.file("rmarkdown", "templates", "frontiers_article", - "resources", "template.tex", - package = "rticles") - base <- rmarkdown::pdf_document(template = template, - keep_tex = keep_tex, - includes = includes, - highlight = "tango")#, - # pandoc_args = c("--latex-engine=xelatex")) - - # Mostly copied from knitr::render_sweave - base$knitr$opts_knit$out.format <- "sweave" - - base$knitr$opts_chunk$prompt <- TRUE - base$knitr$opts_chunk$comment <- NA - base$knitr$opts_chunk$highlight <- FALSE - - hook_chunk <- function(x, options) { - if (knitr:::output_asis(x, options)) return(x) - paste0('\\begin{CodeChunk}\n', x, '\\end{CodeChunk}') - } - hook_input <- function(x, options) { - paste0(c('\\begin{CodeInput}', x, '\\end{CodeInput}', ''), - collapse = '\n') - } - hook_output <- function(x, options) { - paste0('\\begin{CodeOutput}\n', x, '\\end{CodeOutput}\n') - } - - base$knitr$knit_hooks$chunk <- hook_chunk - base$knitr$knit_hooks$source <- hook_input - base$knitr$knit_hooks$output <- hook_output - base$knitr$knit_hooks$message <- hook_output - base$knitr$knit_hooks$warning <- hook_output - base$knitr$knit_hooks$plot <- knitr:::hook_plot_tex - base -} diff --git a/R/jss_article.R b/R/jss_article.R index 7d912da7c..b40469a95 100644 --- a/R/jss_article.R +++ b/R/jss_article.R @@ -1,8 +1,28 @@ +#' Journal of Statistical Software (JSS) format. +#' +#' Format for creating a Journal of Statistical Software (JSS) articles. Adapted +#' from +#' \href{http://www.jstatsoft.org/about/submissions}{http://www.jstatsoft.org/about/submissions}. +#' +#' @inheritParams rmarkdown::pdf_document +#' @param ... Arguments to \code{rmarkdown::pdf_document} +#' +#' @return R Markdown output format to pass to +#' \code{\link[rmarkdown:render]{render}} +#' +#' @examples +#' +#' \dontrun{ +#' library(rmarkdown) +#' draft("MyArticle.Rmd", template = "jss_article", package = "rticles") +#' } +#' #' @export -jss_article <- function() { +jss_article <- function(..., keep_tex = TRUE) { + template <- find_resource("jss_article", "template.tex") - base <- rmarkdown::pdf_document(template = template, keep_tex = TRUE) + base <- inherit_pdf_document(..., template = template, keep_tex = keep_tex) # Mostly copied from knitr::render_sweave base$knitr$opts_knit$out.format <- "sweave" @@ -17,7 +37,7 @@ jss_article <- function() { base$knitr$opts_chunk$fig.align <- "center" hook_chunk <- function(x, options) { - if (knitr:::output_asis(x, options)) return(x) + if (output_asis(x, options)) return(x) paste0('\\begin{CodeChunk}\n', x, '\\end{CodeChunk}') } hook_input <- function(x, options) { @@ -33,7 +53,8 @@ jss_article <- function() { base$knitr$knit_hooks$output <- hook_output base$knitr$knit_hooks$message <- hook_output base$knitr$knit_hooks$warning <- hook_output - base$knitr$knit_hooks$plot <- knitr:::hook_plot_tex + base$knitr$knit_hooks$plot <- knitr::hook_plot_tex base } + diff --git a/R/plos_article.R b/R/plos_article.R deleted file mode 100644 index 7068001ad..000000000 --- a/R/plos_article.R +++ /dev/null @@ -1,38 +0,0 @@ -#' @export -plos_article <- function(keep_tex = TRUE, - includes = NULL) { - - template <- find_resource("plos_article", "template.tex") - - base <- rmarkdown::pdf_document(template = template, - keep_tex = keep_tex, - includes = includes) - - # Mostly copied from knitr::render_sweave - base$knitr$opts_knit$out.format <- "sweave" - - base$knitr$opts_chunk$prompt <- TRUE - base$knitr$opts_chunk$comment <- NA - base$knitr$opts_chunk$highlight <- FALSE - - hook_chunk <- function(x, options) { - if (knitr:::output_asis(x, options)) return(x) - paste0('\\begin{CodeChunk}\n', x, '\\end{CodeChunk}') - } - hook_input <- function(x, options) { - paste0(c('\\begin{CodeInput}', x, '\\end{CodeInput}', ''), - collapse = '\n') - } - hook_output <- function(x, options) { - paste0('\\begin{CodeOutput}\n', x, '\\end{CodeOutput}\n') - } - - base$knitr$knit_hooks$chunk <- hook_chunk - base$knitr$knit_hooks$source <- hook_input - base$knitr$knit_hooks$output <- hook_output - base$knitr$knit_hooks$message <- hook_output - base$knitr$knit_hooks$warning <- hook_output - base$knitr$knit_hooks$plot <- knitr:::hook_plot_tex - - base -} diff --git a/R/rjournal_article.R b/R/rjournal_article.R index ec2a85e05..99485fb92 100644 --- a/R/rjournal_article.R +++ b/R/rjournal_article.R @@ -1,8 +1,29 @@ +#' R Journal format. +#' +#' Format for creating R Journal articles. Adapted from +#' \href{https://journal.r-project.org/submissions.html}{https://journal.r-project.org/submissions.html}. +#' +#' +#' @inheritParams rmarkdown::pdf_document +#' @param ... Arguments to \code{rmarkdown::pdf_document} +#' +#' @return R Markdown output format to pass to +#' \code{\link[rmarkdown:render]{render}} +#' +#' @examples +#' +#' \dontrun{ +#' library(rmarkdown) +#' draft("MyArticle.Rmd", template = "rjournal_article", package = "rticles") +#' } +#' #' @export -rjournal_article <- function() { +rjournal_article <- function(...) { + template <- find_resource("rjournal_article", "template.tex") - base <- rmarkdown::pdf_document(template = template) + base <- inherit_pdf_document(..., template = template) + # Render will generate tex file, post-process hook generates appropriate # RJwrapper.tex and use pandoc to build pdf from that base$pandoc$to <- "latex" @@ -10,7 +31,7 @@ rjournal_article <- function() { base$post_processor <- function(metadata, utf8_input, output_file, clean, verbose) { filename <- tools::file_path_sans_ext(basename(output_file)) - wrapper_metadata <- list(preamble = metadata$preable, filename = filename) + wrapper_metadata <- list(preamble = metadata$preamble, filename = filename) wrapper_template <- find_resource("rjournal_article", "RJwrapper.tex") wrapper_output <- file.path(getwd(), "RJwrapper.tex") template_pandoc(wrapper_metadata, wrapper_template, wrapper_output, verbose) @@ -22,12 +43,13 @@ rjournal_article <- function() { # Mostly copied from knitr::render_sweave base$knitr$opts_chunk$comment <- "#>" + hilight_source <- knitr_fun('hilight_source') hook_chunk = function(x, options) { - if (knitr:::output_asis(x, options)) return(x) + if (output_asis(x, options)) return(x) paste('\\begin{Schunk}\n', x, '\\end{Schunk}', sep = '') } hook_input <- function(x, options) - paste(c('\\begin{Sinput}', knitr:::hilight_source(x, 'sweave', options), '\\end{Sinput}', ''), + paste(c('\\begin{Sinput}', hilight_source(x, 'sweave', options), '\\end{Sinput}', ''), collapse = '\n') hook_output <- function(x, options) paste('\\begin{Soutput}\n', x, '\\end{Soutput}\n', sep = '') @@ -36,37 +58,9 @@ rjournal_article <- function() { base$knitr$knit_hooks$output <- hook_output base$knitr$knit_hooks$message <- hook_output base$knitr$knit_hooks$warning <- hook_output - base$knitr$knit_hooks$plot <- knitr:::hook_plot_tex + base$knitr$knit_hooks$plot <- knitr::hook_plot_tex base } -#' Render a pandoc template. -#' -#' This is a hacky way to access the pandoc templating engine. -#' -#' @param metadata A named list containing metadata to pass to template. -#' @param template Path to a pandoc template. -#' @param output Path to save output. -#' @return (Invisibly) The path of the generate file. -#' @examples -#' x <- rticles:::template_pandoc( -#' list(preamble = "%abc", filename = "wickham"), -#' rticles:::find_resource("rjournal_article", "RJwrapper.tex"), -#' tempfile() -#' ) -#' if (interactive()) file.show(x) -template_pandoc <- function(metadata, template, output, verbose = FALSE) { - tmp <- tempfile(fileext = ".md") - on.exit(unlink(tmp)) - - cat("---\n", file = tmp) - cat(yaml::as.yaml(metadata), file = tmp, append = TRUE) - cat("---\n", file = tmp, append = TRUE) - cat("\n", file = tmp, append = TRUE) - rmarkdown::pandoc_convert(tmp, "markdown", output = output, - options = paste0("--template=", template), verbose = verbose) - - invisible(output) -} diff --git a/R/tufte_ebook.R b/R/tufte_ebook.R deleted file mode 100644 index e087954d1..000000000 --- a/R/tufte_ebook.R +++ /dev/null @@ -1,91 +0,0 @@ - -#' Tufte e-Book format (PDF) -#' -#' Template for creating an e-book based on the style of -#' Edward R. Tufte and Richard Feynman. -#' -#' @inheritParams pdf_document -#' -#' @param latex_engine LaTeX engine for producing PDF output. Options are -#' "pdflatex", "lualatex", and "xelatex". Note that lualatex may have -#' problems with text spacing, and that pdflatex may have memory issues -#' when using tikzDevice. -#' -#' @export -tufte_ebook <- function( toc = TRUE, - toc_depth = 3, - number_sections = TRUE, - fig_width = 4, - fig_height = 2.5, - fig_crop = TRUE, - highlight = "default", - keep_tex = FALSE, - latex_engine = "xelatex", - includes = NULL, - pandoc_args = NULL, - ... - ) { - - # resolve default highlight - if (identical(highlight, "default")) - highlight <- "pygments" - - # get the tufte handout template - template <- system.file( - "rmarkdown/templates/tufte_ebook/resources/tufte-ebook.tex", - package = "rticles" - ) - - # call the base pdf_document format with the appropriate options - format <- rmarkdown::pdf_document(fig_width = fig_width, - fig_height = fig_height, - fig_crop = fig_crop, - highlight = highlight, - keep_tex = keep_tex, - latex_engine = latex_engine, - includes = includes, - pandoc_args = pandoc_args, - toc = toc, - toc_depth = toc_depth, - template = template, - number_sections = number_sections, - ... - ) - - - # create knitr options (ensure opts and hooks are non-null) - knitr_options <- rmarkdown::knitr_options_pdf(fig_width, fig_height, fig_crop) - if (is.null(knitr_options$opts_knit)) - knitr_options$opts_knit <- list() - if (is.null(knitr_options$knit_hooks)) - knitr_options$knit_hooks <- list() - - # set options - knitr_options$opts_chunk$tidy <- TRUE - knitr_options$opts_knit$width <- 45 - - # set hooks for special plot output - knitr_options$knit_hooks$plot <- function(x, options) { - - # determine caption (if any) - caption <- ifelse(is.null(options$fig.cap), - "", - paste("\\caption{", options$fig.cap, "}\n", sep = "")) - - # determine figure type - if (isTRUE(options$fig.margin)) - figtype <- "marginfigure" - else if (isTRUE(options$fig.fullwidth)) - figtype <- "figure*" - else - figtype <- "figure" - - # return the latex - paste(sprintf('\\begin{%s}\n \\includegraphics{%s}\n%s\\end{%s}\n', - figtype, x, caption, figtype)) - } - - # override the knitr settings of the base format and return the format - format$knitr <- knitr_options - format -} diff --git a/R/use_r_abstract.R b/R/use_r_abstract.R deleted file mode 100644 index df1726c1a..000000000 --- a/R/use_r_abstract.R +++ /dev/null @@ -1,10 +0,0 @@ -#' @export -use_r_abstract <- function() { - template <- find_resource("use_r_abstract", "template.tex") - csl <- find_resource("use_r_abstract" ,"chicago-author-date.csl") - - rmarkdown::pdf_document( - template = template, - pandoc_args = c("--csl", rmarkdown::pandoc_path_arg(csl))) -} - diff --git a/R/utils.R b/R/utils.R index 95ba87200..3c883264e 100644 --- a/R/utils.R +++ b/R/utils.R @@ -11,3 +11,67 @@ find_file <- function(template, file) { find_resource <- function(template, file) { find_file(template, file.path("resources", file)) } + +knitr_fun <- function(name) utils::getFromNamespace(name, 'knitr') + +output_asis <- knitr_fun('output_asis') + +#' Render a pandoc template. +#' +#' This is a hacky way to access the pandoc templating engine. +#' +#' @param metadata A named list containing metadata to pass to template. +#' @param template Path to a pandoc template. +#' @param output Path to save output. +#' @return (Invisibly) The path of the generate file. +#' @examples +#' x <- rticles:::template_pandoc( +#' list(preamble = "%abc", filename = "wickham"), +#' rticles:::find_resource("rjournal_article", "RJwrapper.tex"), +#' tempfile() +#' ) +#' if (interactive()) file.show(x) +#' @noRd +template_pandoc <- function(metadata, template, output, verbose = FALSE) { + tmp <- tempfile(fileext = ".md") + on.exit(unlink(tmp)) + + cat("---\n", file = tmp) + cat(yaml::as.yaml(metadata), file = tmp, append = TRUE) + cat("---\n", file = tmp, append = TRUE) + cat("\n", file = tmp, append = TRUE) + + rmarkdown::pandoc_convert(tmp, "markdown", output = output, + options = paste0("--template=", template), verbose = verbose) + + invisible(output) +} + + +# Call rmarkdown::pdf_documet and mark the return value as inheriting pdf_document +inherit_pdf_document <- function(...) { + fmt <- rmarkdown::pdf_document(...) + fmt$inherits <- "pdf_document" + fmt +} + +# Helper function to create a custom format derived from pdf_document +# that includes a custom LaTeX template and custom CSL definition +pdf_document_format <- function(..., format, template, csl) { + + # base format + fmt <- inherit_pdf_document(..., template = find_resource(format, template)) + + # add csl to pandoc_args + fmt$pandoc$args <- c(fmt$pandoc$args, + "--csl", + rmarkdown::pandoc_path_arg(find_resource(format, csl))) + + + # return format + fmt +} + + + + diff --git a/README.md b/README.md index 2bd059350..0d29562b5 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,45 @@ -### Overview -The **rticles** package includes a set of [R Markdown](http://rmarkdown.rstudio.com) templates that enable authoring of R related journal and conference submissions, and creating e-books. Available templates include: +### Installation + +You can install and use **rticles** from CRAN as follows: + +```r +install.packages("rticles", type = "source") +``` + +If you wish to install the development version from GitHub you can do this: + +```r +devtools::install_github("rstudio/rticles") +``` + +#### Sandbox Version + +Prior to submitting **rticles** to CRAN a number of formats that were not passing tests on all platforms were removed from the package (we expect that these formats will be restored eventually once their authors arrange for the tests to pass). If you are an existing user of one of these **rticles** formats you can install the "sandbox" version of the package which retains these formats as follows: + +```r +devtools::install_github("rstudio/rticles", ref = "sandbox") +``` + +### Overview -- [Tuftish e-book] e-books formatted based on the style of Edward R. Tufte and Richard Feynman +The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown.rstudio.com) LaTeX formats and templates for varoius formats, including: - [JSS](http://www.jstatsoft.org/) articles - [R Journal](http://journal.r-project.org/) articles -- [useR](http://user2014.stat.ucla.edu/) conference abstracts +- [CTeX](http://ctex.org) documents -- [Public Library of Science (PLoS)](http://www.plos.org/) articles +- [ACM](http://www.acm.org/) articles -- [CTeX](http://ctex.org) documents +- [ACS](http://pubs.acs.org/) articles -- [ACS](http://pubs.acs.org) articles +- [Elsevier](https://www.elsevier.com) journal submissions Under the hood, LaTeX templates are used to ensure that documents conform precisely to submission standards. At the same time, composition and formatting can be done using lightweight [markdown](http://rmarkdown.rstudio.com/authoring_basics.html) syntax, and R code and its output can be seamlessly included using [knitr](http://yihui.name/knitr/). -Using **rticles** has some prerequisites which are described below. You can get most of these pre-requisites automatically by installing the latest preview release of RStudio (instructions for using **rticles** without RStudio are also provided). +Using **rticles** has some prerequisites which are described below. You can get most of these pre-requisites automatically by installing the latest release of RStudio (instructions for using **rticles** without RStudio are also provided). ### Using rticles from RStudio @@ -27,14 +48,12 @@ To use **rticles** from RStudio: 1) Install the latest [RStudio](http://www.rstudio.com/products/rstudio/download/). 2) Install the **rticles** package: - -```S -devtools::install_github("rstudio/rticles") -``` - + + install.packages("rticles", type = "source") + 3) Use the **New R Markdown** dialog to create an article from one of the templates: -![New R Markdown](http://rmarkdown.rstudio.com/images/new_r_markdown.png) + ![New R Markdown](http://rmarkdown.rstudio.com/images/new_r_markdown.png) ### Using rticles outside of RStudio @@ -43,15 +62,15 @@ devtools::install_github("rstudio/rticles") 2) Install the **rmarkdown** and **rticles** packages: -```S -devtools::install_github(c("rstudio/rmarkdown", "rstudio/rticles")) -``` + + install.packages("rmarkdown") + devtools::install_github("rstudio/rticles") + 3) Use the `rmarkdown::draft` function to create articles: -```S -rmarkdown::draft("MyAbstract.Rmd", template = "use_r_abstract", package = "rticles") -rmarkdown::draft("MyJSSArticle.Rmd", template = "jss_article", package = "rticles") -rmarkdown::draft("MyRJournalArticle", template = "rjournal_article", package = "rticles") -``` + + rmarkdown::draft("MyJSSArticle.Rmd", template = "jss_article", package = "rticles") + rmarkdown::draft("MyRJournalArticle", template = "rjournal_article", package = "rticles") + diff --git a/inst/NEWS b/inst/NEWS new file mode 100644 index 000000000..03047c0ff --- /dev/null +++ b/inst/NEWS @@ -0,0 +1,21 @@ + +rticles 0.2 +--------------------------------------------------------------------- + +- Add American Chemical Society (ACS) template + +- Allow changing of documentclass and classoption for JSS articles + +- Support bibliography for JSS articles (#63) + +- Add tightlist macro to Elsevier skeleton + +- Add address and footnote examples to Elsevier skeleton + +- Fix preamble variable name in R Journal template + + +rticles 0.1 +--------------------------------------------------------------------- + +- Initial release to CRAN diff --git a/inst/rmarkdown/templates/acm/.gitignore b/inst/rmarkdown/templates/acm_article/.gitignore similarity index 100% rename from inst/rmarkdown/templates/acm/.gitignore rename to inst/rmarkdown/templates/acm_article/.gitignore diff --git a/inst/rmarkdown/templates/acm/resources/acm-sig-proceedings.csl b/inst/rmarkdown/templates/acm_article/resources/acm-sig-proceedings.csl similarity index 100% rename from inst/rmarkdown/templates/acm/resources/acm-sig-proceedings.csl rename to inst/rmarkdown/templates/acm_article/resources/acm-sig-proceedings.csl diff --git a/inst/rmarkdown/templates/acm/resources/template.tex b/inst/rmarkdown/templates/acm_article/resources/template.tex similarity index 100% rename from inst/rmarkdown/templates/acm/resources/template.tex rename to inst/rmarkdown/templates/acm_article/resources/template.tex diff --git a/inst/rmarkdown/templates/acm/skeleton/Makefile b/inst/rmarkdown/templates/acm_article/skeleton/Makefile similarity index 100% rename from inst/rmarkdown/templates/acm/skeleton/Makefile rename to inst/rmarkdown/templates/acm_article/skeleton/Makefile diff --git a/inst/rmarkdown/templates/acm/skeleton/README.md b/inst/rmarkdown/templates/acm_article/skeleton/README.md similarity index 100% rename from inst/rmarkdown/templates/acm/skeleton/README.md rename to inst/rmarkdown/templates/acm_article/skeleton/README.md diff --git a/inst/rmarkdown/templates/acm/skeleton/acm_proc_article-sp.cls b/inst/rmarkdown/templates/acm_article/skeleton/acm_proc_article-sp.cls similarity index 100% rename from inst/rmarkdown/templates/acm/skeleton/acm_proc_article-sp.cls rename to inst/rmarkdown/templates/acm_article/skeleton/acm_proc_article-sp.cls diff --git a/inst/rmarkdown/templates/acm/skeleton/sensys-abstract.cls b/inst/rmarkdown/templates/acm_article/skeleton/sensys-abstract.cls similarity index 100% rename from inst/rmarkdown/templates/acm/skeleton/sensys-abstract.cls rename to inst/rmarkdown/templates/acm_article/skeleton/sensys-abstract.cls diff --git a/inst/rmarkdown/templates/acm/skeleton/sigproc.bib b/inst/rmarkdown/templates/acm_article/skeleton/sigproc.bib similarity index 100% rename from inst/rmarkdown/templates/acm/skeleton/sigproc.bib rename to inst/rmarkdown/templates/acm_article/skeleton/sigproc.bib diff --git a/inst/rmarkdown/templates/acm/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/acm_article/skeleton/skeleton.Rmd similarity index 99% rename from inst/rmarkdown/templates/acm/skeleton/skeleton.Rmd rename to inst/rmarkdown/templates/acm_article/skeleton/skeleton.Rmd index 92979984b..bb7127b83 100755 --- a/inst/rmarkdown/templates/acm/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/acm_article/skeleton/skeleton.Rmd @@ -12,7 +12,7 @@ abstract: | It consists of two paragraphs. bibliography: sigproc.bib -output: rticles::acm +output: rticles::acm_article --- diff --git a/inst/rmarkdown/templates/acm/template.yaml b/inst/rmarkdown/templates/acm_article/template.yaml similarity index 67% rename from inst/rmarkdown/templates/acm/template.yaml rename to inst/rmarkdown/templates/acm_article/template.yaml index 5598ba045..5a0f18759 100644 --- a/inst/rmarkdown/templates/acm/template.yaml +++ b/inst/rmarkdown/templates/acm_article/template.yaml @@ -1,4 +1,4 @@ -name: ACM +name: Association for Computing Machinary description: > Template for creating an article for submission to ACM create_dir: true diff --git a/inst/rmarkdown/templates/acs/resources/template.tex b/inst/rmarkdown/templates/acs/resources/template.tex deleted file mode 100755 index e001b2e9c..000000000 --- a/inst/rmarkdown/templates/acs/resources/template.tex +++ /dev/null @@ -1,46 +0,0 @@ -\documentclass[journal=$journal$,manuscript=$type$]{achemso} -\usepackage[utf8]{inputenc} -\usepackage[version=3]{mhchem} -\usepackage{amsmath} -\newcommand*\mycommand[1]{\texttt{\emph{#1}}} -\providecommand{\tightlist}{% - \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} -$for(author)$ -\author{$author.name$} -$if(author.aff)$ -\affiliation{$author.aff$} -$endif$ -$if(author.alsoaff)$ -\alsoaffiliation{$author.alsoaff$} -$endif$ -$if(author.altaff)$ -\altaffiliation{$author.altaff$} -$endif$ -$if(author.email)$ -$author.email$ -$endif$ -$if(author.phone)$ -\phone{$author.phone$} -$endif$ -$if(author.fax)$ -\fax{$author.fax$} -$endif$ -$endfor$ - -$if(abbr)$ -\abbreviations{$abbr$} -$endif$ - -$if(keywords)$ -\keywords{$keywords$} -$endif$ - -\title[$title.short$]{$title.formatted$} -\makeatletter -\begin{document} - -$body$ - -\end{document} - - diff --git a/inst/rmarkdown/templates/acs/skeleton/american-chemical-society.csl b/inst/rmarkdown/templates/acs/skeleton/american-chemical-society.csl deleted file mode 100644 index cfbffd8a8..000000000 --- a/inst/rmarkdown/templates/acs/skeleton/american-chemical-society.csl +++ /dev/null @@ -1,204 +0,0 @@ - - diff --git a/inst/rmarkdown/templates/acs/resources/american-chemical-society.csl b/inst/rmarkdown/templates/acs_article/resources/american-chemical-society.csl old mode 100644 new mode 100755 similarity index 70% rename from inst/rmarkdown/templates/acs/resources/american-chemical-society.csl rename to inst/rmarkdown/templates/acs_article/resources/american-chemical-society.csl index cfbffd8a8..3e485edd8 --- a/inst/rmarkdown/templates/acs/resources/american-chemical-society.csl +++ b/inst/rmarkdown/templates/acs_article/resources/american-chemical-society.csl @@ -17,14 +17,36 @@ The American Chemical Society style. - 2014-09-06T22:02:33+00:00 + 2015-09-18T15:13:17+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + + + + ed. and translator + eds. and translators + + + translator + translators + + + series ed. + series eds. + + + - - - + + + + + + + + @@ -48,13 +70,22 @@ - - - + + + + + + + + + + + @@ -95,15 +126,40 @@ - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + @@ -118,10 +174,12 @@ - + + + + - @@ -149,7 +207,7 @@ - + @@ -175,16 +233,6 @@ - - - - - - - - - - diff --git a/inst/rmarkdown/templates/acs_article/resources/template.tex b/inst/rmarkdown/templates/acs_article/resources/template.tex new file mode 100755 index 000000000..8aeb12917 --- /dev/null +++ b/inst/rmarkdown/templates/acs_article/resources/template.tex @@ -0,0 +1,67 @@ +\documentclass[journal=$journal$,manuscript=$type$]{achemso} +\usepackage[version=3]{mhchem} +\usepackage{amsmath} +\newcommand*\mycommand[1]{\texttt{\emph{#1}}} +$for(author)$ +\author{$author.name$} +$if(author.aff)$ +\affiliation{$author.aff$} +$endif$ +$if(author.alsoaff)$ +\alsoaffiliation{$author.alsoaff$} +$endif$ +$if(author.altaff)$ +\altaffiliation{$author.altaff$} +$endif$ +$if(author.email)$ +$author.email$ +$endif$ +$if(author.phone)$ +\phone{$author.phone$} +$endif$ +$if(author.fax)$ +\fax{$author.fax$} +$endif$ +$endfor$ + +$if(abbr)$ +\abbreviations{$abbr$} +$endif$ + +$if(keywords)$ +\keywords{$keywords$} +$endif$ + +\title[$title.short$]{$title.formatted$} +\makeatletter +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={$author-meta$}, + pdftitle={$title-meta$}, + colorlinks=true, + urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$, + linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\renewcommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(strikeout)$ +\usepackage[normalem]{ulem} +% avoid problems with \sout in headers with hyperref: +\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$endif$ +\begin{document} +\begin{abstract} +$abstract$ +\end{abstract} +$body$ +\end{document} diff --git a/inst/rmarkdown/templates/acs/skeleton/acstest.bib b/inst/rmarkdown/templates/acs_article/skeleton/acstest.bib old mode 100644 new mode 100755 similarity index 100% rename from inst/rmarkdown/templates/acs/skeleton/acstest.bib rename to inst/rmarkdown/templates/acs_article/skeleton/acstest.bib diff --git a/inst/rmarkdown/templates/acs/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/acs_article/skeleton/skeleton.Rmd similarity index 93% rename from inst/rmarkdown/templates/acs/skeleton/skeleton.Rmd rename to inst/rmarkdown/templates/acs_article/skeleton/skeleton.Rmd index 8e0c8eae3..f83fef8f1 100755 --- a/inst/rmarkdown/templates/acs/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/acs_article/skeleton/skeleton.Rmd @@ -25,8 +25,13 @@ title: short: An \textsf{achemso} demo abbr: IR,NMR,UV keywords: American Chemical Society, \LaTeX +abstract: | + This is an example document for the \textsf{achemso} documentclass, intended for submissions to the American Chemical Society for publication. The class is based on the standard \LaTeXe\ \textsf{report} file, and does not seek to reproduce the appearanceof a published paper. + + This is an abstract for the \textsf{achemso} document class demonstration document. An abstract is only allowed for certain manuscript types. The selection of \texttt{journal} and \texttt{manuscript} will determine if an abstract is valid. If not, the class will issue an appropriate error.This is the abstract. + bibliography: acstest.bib -output: rticles::acs +output: rticles::acs_article --- \begin{tocentry} @@ -47,20 +52,6 @@ This box and the associated title will always be printed on a separate page at the end of the document. \end{tocentry} -\begin{abstract} - This is an example document for the \textsf{achemso} document - class, intended for submissions to the American Chemical Society - for publication. The class is based on the standard \LaTeXe\ - \textsf{report} file, and does not seek to reproduce the appearance - of a published paper. - - This is an abstract for the \textsf{achemso} document class - demonstration document. An abstract is only allowed for certain - manuscript types. The selection of \texttt{journal} and - \texttt{manuscript} will determine if an abstract is valid. If - not, the class will issue an appropriate error. -\end{abstract} - # Introduction This is a paragraph of text to fill the introduction of the demonstration file. The demonstration file attempts to show the @@ -265,6 +256,5 @@ automatically add a sentence pointing to the information on-line: \end{suppinfo} ## References -\bibliography{acstest} diff --git a/inst/rmarkdown/templates/acs/template.yaml b/inst/rmarkdown/templates/acs_article/template.yaml old mode 100644 new mode 100755 similarity index 73% rename from inst/rmarkdown/templates/acs/template.yaml rename to inst/rmarkdown/templates/acs_article/template.yaml index c5f468a87..0084fbc2b --- a/inst/rmarkdown/templates/acs/template.yaml +++ b/inst/rmarkdown/templates/acs_article/template.yaml @@ -1,5 +1,4 @@ -name: ACS +name: American Chemical Society description: > Template for creating an article for submission to ACS create_dir: true - diff --git a/inst/rmarkdown/templates/ctex/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/ctex/skeleton/skeleton.Rmd index 8706c513c..13faed8b3 100644 --- a/inst/rmarkdown/templates/ctex/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/ctex/skeleton/skeleton.Rmd @@ -6,18 +6,16 @@ author: - 于淼 documentclass: ctexart output: - pdf_document: + rticles::ctex: fig_caption: yes - latex_engine: xelatex number_sections: yes - template: !expr rticles::ctex_template() toc: yes classoption: "hyperref," --- # 引言 -中文LaTeX文档并非难题。当然这句话得站在巨人[CTeX](http://ctex.org)的肩膀上才能说,它让我们只需要一句 +中文LaTeX文档并非难题。当然这句话得站在巨人 [CTeX](http://ctex.org) 的肩膀上才能说,它让我们只需要一句 ```latex \documentclass{ctexart} % 或者ctexrep/ctexbook @@ -35,21 +33,18 @@ classoption: "hyperref," LaTeX包[**ctex**](http://ctan.org/pkg/ctex)支持若干种字体选项,如果你是**ctex**老用户,请注意这里我们要求的最低版本是2.2,你可能需要升级你的LaTeX包。从版本2.0开始,**ctex**支持根据不同操作系统自动选择中文字体,简直是为人类进步作出了巨大贡献,我们再也不必费尽口舌向用户解释“啊,你用Windows啊,那么你该使用什么字体;啊,你用Mac啊,又该如何如何”。 -下面的YAML元数据应该能满足多数用户的需求,主要设置三项参数:文档类为`ctexart`(当然也可以是别的类),`latex_engine`为XeLaTeX(真的,别纠结你的旧爱PDFLaTeX了),`template`为这个**rticles**包所带的LaTeX模板(当然你也可以用你自定义的模板)。 +下面的YAML元数据应该能满足多数用户的需求,主要设置两项参数:文档类为`ctexart`(当然也可以是别的类),输出格式为`rticles::ctex`,其默认LaTeX引擎为XeLaTeX(真的,别纠结你的旧爱PDFLaTeX了)。 ```yaml --- documentclass: ctexart -output: - pdf_document: - latex_engine: xelatex - template: !expr rticles::ctex_template() +output: rticles::ctex --- ``` -这里`template`参数用了一点YAML黑魔法,主要是R包yaml发明的,`!expr`表示这个取值是通过运行R代码得到的,若不知道`rticles::ctex_template()`是什么意思,在R里面运行一下就知道了。其它参数都是普通的`pdf_document`参数,参见文档**rmarkdown**包的文档,这里就不赘述了。 +`rticles::ctex`的参数都是普通的`pdf_document`参数,参见文档**rmarkdown**包的文档,这里就不赘述了。 -Windows和Mac用户应该都已经有自带的中文字体了。Linux用户可以另外下载[Fandol字体](http://ctan.org/pkg/fandol)^[http://ctan.org/tex-archive/fonts/fandol],它号称是免费的,不过我们也没太搞清楚它的来头。把那些.otf字体文件下载下来保存到`~/.fonts`文件夹下,然后命令行切换到那里,运行`fc-cache -fv`。 +Windows和Mac用户应该都已经有自带的中文字体了。Linux用户可以另外下载 [Fandol字体](http://ctan.org/pkg/fandol)^[http://ctan.org/tex-archive/fonts/fandol],它号称是免费的,不过我们也没太搞清楚它的来头。把那些.otf字体文件下载下来保存到`~/.fonts`文件夹下,然后命令行切换到那里,运行`fc-cache -fv`。 # R代码段 @@ -58,8 +53,8 @@ R代码用R Markdown的语法嵌入,即三个反引号开始一段代码```` ` ```{r} options(digits = 4) fit = lm(dist ~ speed, data = cars) -b = coef(fit) coef(summary(fit)) +b = coef(fit) ``` 上面回归方程中的斜率是`r b[2]`,完整的回归方程为:$$ Y = `r b[1]` + `r b[2]`x$$ diff --git a/inst/rmarkdown/templates/elsevier_article/resources/elsevier-harvard-without-titles.csl b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-harvard-without-titles.csl new file mode 100644 index 000000000..58c2b820f --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-harvard-without-titles.csl @@ -0,0 +1,242 @@ + + diff --git a/inst/rmarkdown/templates/elsevier_article/resources/elsevier-harvard.csl b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-harvard.csl new file mode 100644 index 000000000..5089861d1 --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-harvard.csl @@ -0,0 +1,239 @@ + + diff --git a/inst/rmarkdown/templates/elsevier_article/resources/elsevier-vancouver.csl b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-vancouver.csl new file mode 100644 index 000000000..9c3a8167b --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-vancouver.csl @@ -0,0 +1,163 @@ + + diff --git a/inst/rmarkdown/templates/elsevier_article/resources/elsevier-with-titles-alphabetical.csl b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-with-titles-alphabetical.csl new file mode 100644 index 000000000..f7cfc01fc --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-with-titles-alphabetical.csl @@ -0,0 +1,134 @@ + + diff --git a/inst/rmarkdown/templates/elsevier_article/resources/elsevier-with-titles.csl b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-with-titles.csl new file mode 100644 index 000000000..a87a81e09 --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-with-titles.csl @@ -0,0 +1,149 @@ + + diff --git a/inst/rmarkdown/templates/elsevier_article/resources/elsevier-without-titles.csl b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-without-titles.csl new file mode 100644 index 000000000..f22af3864 --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/resources/elsevier-without-titles.csl @@ -0,0 +1,125 @@ + + diff --git a/inst/rmarkdown/templates/elsevier_article/resources/template.tex b/inst/rmarkdown/templates/elsevier_article/resources/template.tex new file mode 100755 index 000000000..e239d8e6f --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/resources/template.tex @@ -0,0 +1,210 @@ +\documentclass[$layout$]{elsarticle} %review=doublespace preprint=single 5p=2 column +%%% Begin My package additions %%%%%%%%%%%%%%%%%%% +\usepackage[hyphens]{url} +\usepackage{lineno} % add +$if(linenumbers)$ + \linenumbers % turns line numbering on +$endif$ +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} + +\bibliographystyle{elsarticle-harv} +\biboptions{sort&compress} % For natbib +\usepackage{graphicx} +\usepackage{booktabs} % book-quality tables +%% Redefines the elsarticle footer +%\makeatletter +%\def\ps@pprintTitle{% +% \let\@oddhead\@empty +% \let\@evenhead\@empty +% \def\@oddfoot{\it \hfill\today}% +% \let\@evenfoot\@oddfoot} +%\makeatother + +% A modified page layout +\textwidth 6.75in +\oddsidemargin -0.15in +\evensidemargin -0.15in +\textheight 9in +\topmargin -0.5in +%%%%%%%%%%%%%%%% end my additions to header + +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +% use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[utf8]{inputenc} +$if(euro)$ + \usepackage{eurosym} +$endif$ +\else % if luatex or xelatex + \usepackage{fontspec} + \ifxetex + \usepackage{xltxtra,xunicode} + \fi + \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} + \newcommand{\euro}{€} +$if(mainfont)$ + \setmainfont{$mainfont$} +$endif$ +$if(sansfont)$ + \setsansfont{$sansfont$} +$endif$ +$if(monofont)$ + \setmonofont{$monofont$} +$endif$ +$if(mathfont)$ + \setmathfont{$mathfont$} +$endif$ +\fi +% use microtype if available +\IfFileExists{microtype.sty}{\usepackage{microtype}}{} +$if(geometry)$ +\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} +$endif$ +$if(natbib)$ +\usepackage{natbib} +\bibliographystyle{plainnat} +$endif$ +$if(biblatex)$ +\usepackage{biblatex} +$if(biblio-files)$ +\bibliography{$biblio-files$} +$endif$ +$endif$ +$if(listings)$ +\usepackage{listings} +$endif$ +$if(lhs)$ +\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +$endif$ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ +$if(verbatim-in-note)$ +\usepackage{fancyvrb} +$endif$ +$if(tables)$ +\usepackage{longtable} +$endif$ +$if(graphics)$ +\usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} +$endif$ +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={$author-meta$}, + pdftitle={$title-meta$}, + colorlinks=true, + urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$, + linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\renewcommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(strikeout)$ +\usepackage[normalem]{ulem} +% avoid problems with \sout in headers with hyperref: +\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$endif$ +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines +$if(numbersections)$ +\setcounter{secnumdepth}{5} +$else$ +\setcounter{secnumdepth}{0} +$endif$ +$if(verbatim-in-note)$ +\VerbatimFootnotes % allows verbatim text in footnotes +$endif$ +$if(lang)$ +\ifxetex + \usepackage{polyglossia} + \setmainlanguage{$mainlang$} +\else + \usepackage[$lang$]{babel} +\fi +$endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ +% Pandoc toggle for numbering sections (defaults to be off) +$if(numbersections)$ +$else$ +\setcounter{secnumdepth}{0} +$endif$ +% Pandoc header +$for(header-includes)$ +$header-includes$ +$endfor$ + + +\usepackage[nomarkers]{endfloat} + +\begin{document} +\begin{frontmatter} + + \title{$title$} + $for(author)$ + \author[$author.affiliation$]{$author.name$$if(author.footnote)$\corref{c1}$endif$} + $if(author.email)$ \ead{$author.email$} $endif$ + $if(author.footnote)$ \cortext[c1]{$author.footnote$}$endif$ + $endfor$ + $for(address)$ + \address[$address.code$]{$address.address$} + $endfor$ + + \begin{abstract} + $abstract$ + \end{abstract} + $if(keywords)$ \begin{keyword} $for(keywords)$$keywords$ \sep $endfor$\end{keyword}$endif$ + \end{frontmatter} + +$body$ + +$if(natbib)$ +$if(biblio-files)$ +$if(biblio-title)$ +$if(book-class)$ +\renewcommand\bibname{$biblio-title$} +$else$ +\renewcommand\refname{$biblio-title$} +$endif$ +$endif$ +\bibliography{$biblio-files$} + +$endif$ +$endif$ +$if(biblatex)$ +\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ + +$endif$ +$for(include-after)$ +$include-after$ + +$endfor$ +\end{document} + + diff --git a/inst/rmarkdown/templates/elsevier_article/skeleton/elsarticle.cls b/inst/rmarkdown/templates/elsevier_article/skeleton/elsarticle.cls new file mode 100755 index 000000000..ffee323e4 --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/skeleton/elsarticle.cls @@ -0,0 +1,701 @@ +%% +%% This is file `elsarticle.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% elsarticle.dtx (with options: `class') +%% +%% Copyright 2007, 2008 Elsevier Ltd. +%% +%% This file is part of the 'Elsarticle Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% The list of all files belonging to the 'Elsarticle Bundle' is +%% given in the file `manifest.txt'. +%% +%% $Id: elsarticle.cls,v 1.18 2008-08-28 06:03:47 cvr Exp $ +%% + \def\RCSfile{elsarticle}% + \def\RCSversion{1.0.1}% + \def\RCSdate{2008/05/22}% + \def\@shortjnl{\relax} + \def\@journal{Elsevier Science} \def\@company{Elsevier Science} + \def\@issn{000-0000} + \def\@shortjid{elsarticle} +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesClass{\@shortjid}[\RCSdate, \RCSversion: \@journal] +\def\ABD{\AtBeginDocument} +\newif\ifpreprint \preprintfalse +\newif\iflongmktitle \longmktitlefalse + +\def\@blstr{1} +\newdimen\@bls +\@bls=\baselineskip + +\def\@finalWarning{% + *****************************************************\MessageBreak + This document is typeset in the CRC style which\MessageBreak + is not suitable for submission.\MessageBreak + \MessageBreak + Please typeset again using 'preprint' option\MessageBreak + for creating PDF suitable for submission.\MessageBreak + ******************************************************\MessageBreak +} + +\DeclareOption{preprint}{\global\preprinttrue + \gdef\@blstr{1}\xdef\jtype{0}% + \AtBeginDocument{\@twosidefalse\@mparswitchfalse}} +\DeclareOption{final}{\gdef\@blstr{1}\global\preprintfalse} +\DeclareOption{review}{\global\preprinttrue\gdef\@blstr{1.5}} +\DeclareOption{authoryear}{\xdef\@biboptions{authoryear}} +\DeclareOption{number}{\xdef\@biboptions{square,numbers}} +\DeclareOption{numbers}{\xdef\@biboptions{square,numbers}} +\DeclareOption{longtitle}{\global\longmktitletrue} +\DeclareOption{5p}{\xdef\jtype{5}\global\preprintfalse + \ExecuteOptions{twocolumn}} + \def\jtype{0} +\DeclareOption{3p}{\xdef\jtype{3}\global\preprintfalse} +\DeclareOption{1p}{\xdef\jtype{1}\global\preprintfalse + \AtBeginDocument{\@twocolumnfalse}} +\DeclareOption{times}{\IfFileExists{txfonts.sty}% + {\AtEndOfClass{\RequirePackage{txfonts}% + \gdef\ttdefault{cmtt}% + \let\iint\relax + \let\iiint\relax + \let\iiiint\relax + \let\idotsint\relax + \let\openbox\relax}}{\RequirePackage{times}}} +\ExecuteOptions{a4paper,10pt,oneside,onecolumn,number,preprint} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +\ProcessOptions +\LoadClass{article} +\RequirePackage{graphicx} +\let\comma\@empty +\let\tnotesep\@empty +\def\title#1{\gdef\@title{#1}} +\let\@title\@empty + +\def\elsLabel#1{\@bsphack\protected@write\@auxout{}% + {\string\Newlabel{#1}{\@currentlabel}}\@esphack} +\def\Newlabel#1#2{\expandafter\xdef\csname X@#1\endcsname{#2}} + +\def\Ref#1{\@ifundefined{X@#1}{0}{\csname X@#1\endcsname}% +} + +\def\tnotemark[#1]{\textsuperscript{\@for\@@tmark:=#1\do{% + \edef\tnotenum{\@ifundefined{X@\@@tmark}{1}{\Ref{\@@tmark}}}% + \ifcase\tnotenum\or\ding{73}\or,\ding{73}\ding{73}\fi}}% +} +\let\@tnotemark\@empty + +\let\@tnotes\@empty +\RequirePackage{pifont} +\newcounter{tnote} +\def\tnotetext[#1]#2{\g@addto@macro\@tnotes{% + \refstepcounter{tnote}\elsLabel{#1}% + \def\thefootnote{\ifcase\c@tnote\or\ding{73}\or\ding{73}\ding{73}\fi}% + \footnotetext{#2}}} + +\newcounter{fnote} +\def\fnmark[#1]{\let\comma\@empty + \def\@fnmark{\@for\@@fnmark:=#1\do{% + \edef\fnotenum{\@ifundefined{X@\@@fnmark}{1}{\Ref{\@@fnmark}}}% + \unskip\comma\fnotenum\let\comma,}}% +} + +\let\@fnotes\@empty\let\@fnmark\@empty +\def\fntext[#1]#2{\g@addto@macro\@fnotes{% + \refstepcounter{fnote}\elsLabel{#1}% + \def\thefootnote{\thefnote}% + \global\setcounter{footnote}{\thefnote}% + \footnotetext{#2}}} + +\def\cormark[#1]{\edef\cnotenum{\Ref{#1}}\unskip% + \textsuperscript{\sep\ifcase\cnotenum\or + $\ast$\or$\ast\ast$\fi\hspace{-1pt}}\let\sep=,} + +\let\@cormark\@empty +\let\@cornotes\@empty +\newcounter{cnote} +\def\cortext[#1]#2{\g@addto@macro\@cornotes{% + \refstepcounter{cnote}\elsLabel{#1}% + \def\thefootnote{\ifcase\thecnote\or$\ast$\or + $\ast\ast$\fi}% + \footnotetext{#2}}} + +\def\corref#1{\cormark[#1]} +\def\fnref#1{\fnmark[#1]} +\def\tnoteref#1{\tnotemark[#1]} + +\def\resetTitleCounters{\c@cnote=0 + \c@fnote=0 \c@tnote=0 \c@footnote=0} + +\let\eadsep\@empty +\let\@elseads\@empty +\let\@elsuads\@empty +\let\@cormark\@empty +\def\ead{\@ifnextchar[{\@uad}{\@ead}} +\gdef\@ead#1{\bgroup\def\_{\string\_}\def\{{\string\{}% + \def\}{\string\}}% + \edef\tmp{\the\@eadauthor} + \immediate\write\@auxout{\string\emailauthor + {#1}{\expandafter\strip@prefix\meaning\tmp}}% + \egroup +} +\newcounter{ead} +\gdef\emailauthor#1#2{\stepcounter{ead}% + \g@addto@macro\@elseads{\raggedright% + \let\corref\@gobble + \eadsep\texttt{#1} (#2)\def\eadsep{\unskip,\space}}% +} +\gdef\@uad[#1]#2{\bgroup + \edef\tmp{\the\@eadauthor} + \immediate\write\@auxout{\string\urlauthor + {#2}{\expandafter\strip@prefix\meaning\tmp}}% + \egroup +} +\def\urlauthor#1#2{\g@addto@macro\@elsuads{\let\corref\@gobble% + \raggedright\eadsep\texttt{#1}\space(#2)% + \def\eadsep{\unskip,\space}}% +} + +\def\elsauthors{} +\def\pprinttitle{} +\let\authorsep\@empty +\let\sep\@empty +\newcounter{author} +\def\author{\@ifnextchar[{\@@author}{\@author}} + +\newtoks\@eadauthor +\def\@@author[#1]#2{\g@addto@macro\elsauthors{% + \def\baselinestretch{1}% + \authorsep#2\unskip\textsuperscript{%#1% + \@for\@@affmark:=#1\do{% + \edef\affnum{\@ifundefined{X@\@@affmark}{1}{\Ref{\@@affmark}}}% + \unskip\sep\affnum\let\sep=,}% + \ifx\@fnmark\@empty\else\unskip\sep\@fnmark\let\sep=,\fi}% + \def\authorsep{\unskip,\space}% + \global\let\sep\@empty + \global\let\@fnmark\@empty}% + \@eadauthor={#2} +} + +\def\@author#1{\g@addto@macro\elsauthors{\normalsize% + \def\baselinestretch{1}% + \upshape\authorsep#1\unskip\textsuperscript{% + \ifx\@fnmark\@empty\else\unskip\sep\@fnmark\let\sep=,\fi}% + \def\authorsep{\unskip,\space}% + \global\let\@fnmark\@empty + \global\let\sep\@empty}% + \@eadauthor={{#1}} +} + +\def\elsaddress{} +\def\addsep{\par\vskip6pt} +\def\address{\@ifnextchar[{\@@address}{\@address}} + +\newcounter{affn} +\renewcommand\theaffn{\alph{affn}} + +\long\def\@@address[#1]#2{\g@addto@macro\elsaddress{% + \def\baselinestretch{1}% + \refstepcounter{affn}\elsLabel{#1}% + \textsuperscript{\theaffn}#2\par}} + +\long\def\@address#1{\g@addto@macro\elsauthors{% + \def\baselinestretch{1}% + \addsep\footnotesize\itshape#1\def\addsep{\par\vskip6pt}% + \def\authorsep{\par\vskip8pt}}} + +\newbox\absbox +\renewenvironment{abstract}{\global\setbox\absbox=\vbox\bgroup + \hsize=\textwidth\def\baselinestretch{1}% + \noindent\unskip\textbf{Abstract} + \par\medskip\noindent\unskip\ignorespaces} + {\egroup} + +\newbox\keybox +\def\keyword{% + \def\sep{\unskip, }% + \def\MSC{\@ifnextchar[{\@MSC}{\@MSC[2000]}} + \def\@MSC[##1]{\par\leavevmode\hbox {\it ##1~MSC:\space}}% + \def\PACS{\par\leavevmode\hbox {\it PACS:\space}}% + \def\JEL{\par\leavevmode\hbox {\it JEL:\space}}% + \global\setbox\keybox=\vbox\bgroup\hsize=\textwidth + \normalsize\normalfont\def\baselinestretch{1} + \parskip\z@ + \noindent\textit{Key words: } + \raggedright % Keywords are not justified. + \ignorespaces} +\def\endkeyword{\par \egroup} + +\newdimen\Columnwidth +\Columnwidth=\columnwidth + +\def\printFirstPageNotes{% + \iflongmktitle + \let\columnwidth=\textwidth\fi + \ifx\@tnotes\@empty\else\@tnotes\fi + \ifx\@cornotes\@empty\else\@cornotes\fi + \ifx\@elseads\@empty\relax\else + \let\thefootnote\relax + \footnotetext{\ifnum\theead=1\relax + \textit{Email address:\space}\else + \textit{Email addresses:\space}\fi + \@elseads}\fi + \ifx\@elsuads\@empty\relax\else + \let\thefootnote\relax + \footnotetext{\textit{URL:\space}% + \@elsuads}\fi + \ifx\@fnotes\@empty\else\@fnotes\fi + \iflongmktitle\if@twocolumn + \let\columnwidth=\Columnwidth\fi\fi +} + +\long\def\pprintMaketitle{\clearpage + \iflongmktitle\if@twocolumn\let\columnwidth=\textwidth\fi\fi + \resetTitleCounters + \def\baselinestretch{1}% + \printFirstPageNotes + \begin{center}% + \thispagestyle{pprintTitle}% + \def\baselinestretch{1}% + \Large\@title\par\vskip18pt + \normalsize\elsauthors\par\vskip10pt + \footnotesize\itshape\elsaddress\par\vskip36pt + %\hrule\vskip12pt + \ifvoid\absbox\else\unvbox\absbox\par\vskip10pt\fi + \ifvoid\keybox\else\unvbox\keybox\par\vskip10pt\fi + %\hrule\vskip12pt + \end{center}% + \gdef\thefootnote{\arabic{footnote}}% + } + +\def\printWarning{% + \mbox{}\par\vfill\par\bgroup + \fboxsep12pt\fboxrule1pt + \hspace*{.18\textwidth} + \fcolorbox{gray50}{gray10}{\box\warnbox} + \egroup\par\vfill\thispagestyle{empty} + \setcounter{page}{0} + \clearpage} + +\long\def\finalMaketitle{% + \resetTitleCounters + \def\baselinestretch{1}% + \MaketitleBox + \thispagestyle{pprintTitle}% + \gdef\thefootnote{\arabic{footnote}}% + } + +\long\def\MaketitleBox{% + \resetTitleCounters + \def\baselinestretch{1}% + \begin{center}% + \def\baselinestretch{1}% + \Large\@title\par\vskip18pt + \normalsize\elsauthors\par\vskip10pt + \footnotesize\itshape\elsaddress\par\vskip36pt + %\hrule\vskip12pt + \ifvoid\absbox\else\unvbox\absbox\par\vskip10pt\fi + \ifvoid\keybox\else\unvbox\keybox\par\vskip10pt\fi + %\hrule\vskip12pt + \end{center}% + } + +\def\FNtext#1{\par\bgroup\footnotesize#1\egroup} +\newdimen\space@left +\def\alarm#1{\typeout{******************************}% + \typeout{#1}% + \typeout{******************************}% +} +\long\def\getSpaceLeft{%\global\@twocolumnfalse% + \global\setbox0=\vbox{\hsize=\textwidth\MaketitleBox}% + \global\setbox1=\vbox{\hsize=\textwidth + \let\footnotetext\FNtext + \printFirstPageNotes}% + \xdef\noteheight{\the\ht1}% + \xdef\titleheight{\the\ht0}% + \@tempdima=\vsize + \advance\@tempdima-\noteheight + \advance\@tempdima-1\baselineskip +} + + \skip\footins=24pt + +\newbox\els@boxa +\newbox\els@boxb + +\ifpreprint + \def\maketitle{\pprintMaketitle} + \else + \ifnum\jtype=1 + \def\maketitle{% + \iflongmktitle\getSpaceLeft + \global\setbox\els@boxa=\vsplit0 to \@tempdima + \box\els@boxa\par\resetTitleCounters + \thispagestyle{pprintTitle}% + \printFirstPageNotes + \box0% + \else + \finalMaketitle\printFirstPageNotes + \fi + \gdef\thefootnote{\arabic{footnote}}}% + \else + \ifnum\jtype=5 + \def\maketitle{% + \iflongmktitle\getSpaceLeft + \global\setbox\els@boxa=\vsplit0 to \@tempdima + \box\els@boxa\par\resetTitleCounters + \thispagestyle{pprintTitle}% + \printFirstPageNotes + \twocolumn[\box0]%\printFirstPageNotes + \else + \twocolumn[\finalMaketitle]\printFirstPageNotes + \fi + \gdef\thefootnote{\arabic{footnote}}} + \else + \if@twocolumn + \def\maketitle{% + \iflongmktitle\getSpaceLeft + \global\setbox\els@boxa=\vsplit0 to \@tempdima + \box\els@boxa\par\resetTitleCounters + \thispagestyle{pprintTitle}% + \printFirstPageNotes + \twocolumn[\box0]% + \else + \twocolumn[\finalMaketitle]\printFirstPageNotes + \fi + \gdef\thefootnote{\arabic{footnote}}}% + \else + \def\maketitle{% + \iflongmktitle\getSpaceLeft + \global\setbox\els@boxa=\vsplit0 to \@tempdima + \box\els@boxa\par\resetTitleCounters + \thispagestyle{pprintTitle}% + \printFirstPageNotes + \box0% + \else + \finalMaketitle\printFirstPageNotes + \fi + \gdef\thefootnote{\arabic{footnote}}}% + \fi + \fi + \fi +\fi +\def\ps@pprintTitle{% + \let\@oddhead\@empty + \let\@evenhead\@empty + \def\@oddfoot{\footnotesize\itshape + Preprint submitted to \ifx\@journal\@empty Elsevier + \else\@journal\fi\hfill\today}% + \let\@evenfoot\@oddfoot} + +\def\@seccntDot{.} +\def\@seccntformat#1{\csname the#1\endcsname\@seccntDot\hskip 0.5em} + +\renewcommand\section{\@startsection {section}{1}{\z@}% + {18\p@ \@plus 6\p@ \@minus 3\p@}% + {9\p@ \@plus 6\p@ \@minus 3\p@}% + {\normalsize\bfseries\boldmath}} +\renewcommand\subsection{\@startsection{subsection}{2}{\z@}% + {12\p@ \@plus 6\p@ \@minus 3\p@}% + {3\p@ \@plus 6\p@ \@minus 3\p@}% + {\normalfont\normalsize\itshape}} +\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {12\p@ \@plus 6\p@ \@minus 3\p@}% + {\p@}% + {\normalfont\normalsize\itshape}} + +\def\paragraph{\secdef{\els@aparagraph}{\els@bparagraph}} +\def\els@aparagraph[#1]#2{\elsparagraph[#1]{#2.}} +\def\els@bparagraph#1{\elsparagraph*{#1.}} + +\newcommand\elsparagraph{\@startsection{paragraph}{4}{0\z@}% + {10\p@ \@plus 6\p@ \@minus 3\p@}% + {-6\p@}% + {\normalfont\itshape}} +\newdimen\leftMargin +\leftMargin=2em +\newtoks\@enLab %\newtoks\@enfont +\def\@enQmark{?} +\def\@enLabel#1#2{% + \edef\@enThe{\noexpand#1{\@enumctr}}% + \@enLab\expandafter{\the\@enLab\csname the\@enumctr\endcsname}% + \@enloop} +\def\@enSpace{\afterassignment\@enSp@ce\let\@tempa= } +\def\@enSp@ce{\@enLab\expandafter{\the\@enLab\space}\@enloop} +\def\@enGroup#1{\@enLab\expandafter{\the\@enLab{#1}}\@enloop} +\def\@enOther#1{\@enLab\expandafter{\the\@enLab#1}\@enloop} +\def\@enloop{\futurelet\@entemp\@enloop@} +\def\@enloop@{% + \ifx A\@entemp \def\@tempa{\@enLabel\Alph }\else + \ifx a\@entemp \def\@tempa{\@enLabel\alph }\else + \ifx i\@entemp \def\@tempa{\@enLabel\roman }\else + \ifx I\@entemp \def\@tempa{\@enLabel\Roman }\else + \ifx 1\@entemp \def\@tempa{\@enLabel\arabic}\else + \ifx \@sptoken\@entemp \let\@tempa\@enSpace \else + \ifx \bgroup\@entemp \let\@tempa\@enGroup \else + \ifx \@enum@\@entemp \let\@tempa\@gobble \else + \let\@tempa\@enOther + \fi\fi\fi\fi\fi\fi\fi\fi + \@tempa} +\newlength{\@sep} \newlength{\@@sep} +\setlength{\@sep}{.5\baselineskip plus.2\baselineskip + minus.2\baselineskip} +\setlength{\@@sep}{.1\baselineskip plus.01\baselineskip + minus.05\baselineskip} +\providecommand{\sfbc}{\rmfamily\upshape} +\providecommand{\sfn}{\rmfamily\upshape} +\def\@enfont{\ifnum \@enumdepth >1\let\@nxt\sfn \else\let\@nxt\sfbc \fi\@nxt} +\def\enumerate{% + \ifnum \@enumdepth >3 \@toodeep\else + \advance\@enumdepth \@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth}\fi + \@ifnextchar[{\@@enum@}{\@enum@}} +\def\@@enum@[#1]{% + \@enLab{}\let\@enThe\@enQmark + \@enloop#1\@enum@ + \ifx\@enThe\@enQmark\@warning{The counter will not be printed.% + ^^J\space\@spaces\@spaces\@spaces The label is: \the\@enLab}\fi + \expandafter\edef\csname label\@enumctr\endcsname{\the\@enLab}% + \expandafter\let\csname the\@enumctr\endcsname\@enThe + \csname c@\@enumctr\endcsname7 + \expandafter\settowidth + \csname leftmargin\romannumeral\@enumdepth\endcsname + {\the\@enLab\hskip\labelsep}% + \@enum@} +\def\@enum@{\list{{\@enfont\csname label\@enumctr\endcsname}}% + {\usecounter{\@enumctr}\def\makelabel##1{\hss\llap{##1}}% + \ifnum \@enumdepth>1\setlength{\topsep}{\@@sep}\else + \setlength{\topsep}{\@sep}\fi + \ifnum \@enumdepth>1\setlength{\itemsep}{0pt plus1pt minus1pt}% + \else \setlength{\itemsep}{\@@sep}\fi + %\setlength\leftmargin{\leftMargin}%%%{1.8em} + \setlength{\parsep}{0pt plus1pt minus1pt}% + \setlength{\parskip}{0pt plus1pt minus1pt} + }} + +\def\endenumerate{\par\ifnum \@enumdepth >1\addvspace{\@@sep}\else + \addvspace{\@sep}\fi \endlist} + +\def\sitem{\@noitemargtrue\@item[\@itemlabel *]} + +\def\itemize{\@ifnextchar[{\@Itemize}{\@Itemize[]}} + +\def\@Itemize[#1]{\def\next{#1}% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \ifx\next\@empty\else\expandafter\def\csname + labelitem\romannumeral\the\@itemdepth\endcsname{#1}\fi% + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter\list\csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}}% + \fi} +\def\newdefinition#1{% + \@ifnextchar[{\@odfn{#1}}{\@ndfn{#1}}}%] +\def\@ndfn#1#2{% + \@ifnextchar[{\@xndfn{#1}{#2}}{\@yndfn{#1}{#2}}} +\def\@xndfn#1#2[#3]{% + \expandafter\@ifdefinable\csname #1\endcsname + {\@definecounter{#1}\@newctr{#1}[#3]% + \expandafter\xdef\csname the#1\endcsname{% + \expandafter\noexpand\csname the#3\endcsname \@dfncountersep + \@dfncounter{#1}}% + \global\@namedef{#1}{\@dfn{#1}{#2}}% + \global\@namedef{end#1}{\@enddefinition}}} +\def\@yndfn#1#2{% + \expandafter\@ifdefinable\csname #1\endcsname + {\@definecounter{#1}% + \expandafter\xdef\csname the#1\endcsname{\@dfncounter{#1}}% + \global\@namedef{#1}{\@dfn{#1}{#2}}% + \global\@namedef{end#1}{\@enddefinition}}} +\def\@odfn#1[#2]#3{% + \@ifundefined{c@#2}{\@nocounterr{#2}}% + {\expandafter\@ifdefinable\csname #1\endcsname + {\global\@namedef{the#1}{\@nameuse{the#2}} + \global\@namedef{#1}{\@dfn{#2}{#3}}% + \global\@namedef{end#1}{\@enddefinition}}}} +\def\@dfn#1#2{% + \refstepcounter{#1}% + \@ifnextchar[{\@ydfn{#1}{#2}}{\@xdfn{#1}{#2}}} +\def\@xdfn#1#2{% + \@begindefinition{#2}{\csname the#1\endcsname}\ignorespaces} +\def\@ydfn#1#2[#3]{% + \@opargbegindefinition{#2}{\csname the#1\endcsname}{#3}\ignorespaces} +\def\@dfncounter#1{\noexpand\arabic{#1}} +\def\@dfncountersep{.} +\def\@begindefinition#1#2{\trivlist + \item[\hskip\labelsep{\bfseries #1\ #2.}]\upshape} +\def\@opargbegindefinition#1#2#3{\trivlist + \item[\hskip\labelsep{\bfseries #1\ #2\ (#3).}]\upshape} +\def\@enddefinition{\endtrivlist} + +\def\@begintheorem#1#2{\trivlist + \let\baselinestretch\@blstr + \item[\hskip \labelsep{\bfseries #1\ #2.}]\itshape} +\def\@opargbegintheorem#1#2#3{\trivlist + \let\baselinestretch\@blstr + \item[\hskip \labelsep{\bfseries #1\ #2\ (#3).}]\itshape} + +\def\newproof#1{% + \@ifnextchar[{\@oprf{#1}}{\@nprf{#1}}} +\def\@nprf#1#2{% + \@ifnextchar[{\@xnprf{#1}{#2}}{\@ynprf{#1}{#2}}} +\def\@xnprf#1#2[#3]{% + \expandafter\@ifdefinable\csname #1\endcsname + {\@definecounter{#1}\@newctr{#1}[#3]% + \expandafter\xdef\csname the#1\endcsname{% + \expandafter\noexpand\csname the#3\endcsname \@prfcountersep + \@prfcounter{#1}}% + \global\@namedef{#1}{\@prf{#1}{#2}}% + \global\@namedef{end#1}{\@endproof}}} +\def\@ynprf#1#2{% + \expandafter\@ifdefinable\csname #1\endcsname + {\@definecounter{#1}% + \expandafter\xdef\csname the#1\endcsname{\@prfcounter{#1}}% + \global\@namedef{#1}{\@prf{#1}{#2}}% + \global\@namedef{end#1}{\@endproof}}} +\def\@oprf#1[#2]#3{% + \@ifundefined{c@#2}{\@nocounterr{#2}}% + {\expandafter\@ifdefinable\csname #1\endcsname + {\global\@namedef{the#1}{\@nameuse{the#2}}% + \global\@namedef{#1}{\@prf{#2}{#3}}% + \global\@namedef{end#1}{\@endproof}}}} +\def\@prf#1#2{% + \refstepcounter{#1}% + \@ifnextchar[{\@yprf{#1}{#2}}{\@xprf{#1}{#2}}} +\def\@xprf#1#2{% + \@beginproof{#2}{\csname the#1\endcsname}\ignorespaces} +\def\@yprf#1#2[#3]{% + \@opargbeginproof{#2}{\csname the#1\endcsname}{#3}\ignorespaces} +\def\@prfcounter#1{\noexpand\arabic{#1}} +\def\@prfcountersep{.} +\def\@beginproof#1#2{\trivlist\let\baselinestretch\@blstr + \item[\hskip \labelsep{\scshape #1.}]\rmfamily} +\def\@opargbeginproof#1#2#3{\trivlist\let\baselinestretch\@blstr + \item[\hskip \labelsep{\scshape #1\ (#3).}]\rmfamily} +\def\@endproof{\endtrivlist} +\newcommand*{\qed}{\hbox{}\hfill$\Box$} + +\@ifundefined{@biboptions}{\xdef\@biboptions{numbers}}{} +\InputIfFileExists{\jobname.spl}{}{} +\RequirePackage[\@biboptions]{natbib} + +\newwrite\splwrite +\immediate\openout\splwrite=\jobname.spl +\def\biboptions#1{\def\next{#1}\immediate\write\splwrite{% + \string\g@addto@macro\string\@biboptions{% + ,\expandafter\strip@prefix\meaning\next}}} + +\let\baselinestretch=\@blstr + +\ifnum\jtype=1 + \RequirePackage{geometry} + \geometry{twoside, + paperwidth=210mm, + paperheight=297mm, + textheight=562pt, + textwidth=384pt, + centering, + headheight=50pt, + headsep=12pt, + footskip=12pt, + footnotesep=24pt plus 2pt minus 12pt, + } + \global\let\bibfont=\footnotesize + \global\bibsep=0pt + \if@twocolumn\global\@twocolumnfalse\fi +\else\ifnum\jtype=3 + \RequirePackage{geometry} + \geometry{twoside, + paperwidth=210mm, + paperheight=297mm, + textheight=622pt, + textwidth=468pt, + centering, + headheight=50pt, + headsep=12pt, + footskip=12pt, + footnotesep=24pt plus 2pt minus 12pt, + columnsep=2pc + } + \global\let\bibfont=\footnotesize + \global\bibsep=0pt + \if@twocolumn\input{fleqn.clo}\fi +\else\ifnum\jtype=5 + \RequirePackage{geometry} + \geometry{twoside, + paperwidth=210mm, + paperheight=297mm, + textheight=682pt, + textwidth=522pt, + centering, + headheight=50pt, + headsep=12pt, + footskip=18pt, + footnotesep=24pt plus 2pt minus 12pt, + columnsep=18pt + }% + \global\let\bibfont=\footnotesize + \global\bibsep=0pt + \input{fleqn.clo} + \global\@twocolumntrue +%% +%% End of option '5p' +%% +\fi\fi\fi + +\def\journal#1{\gdef\@journal{#1}} + \let\@journal\@empty +\newenvironment{frontmatter}{}{\maketitle} + +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip\footnotesize + \sbox\@tempboxa{#1: #2}% + \ifdim \wd\@tempboxa >\hsize + #1: #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} + +\AtBeginDocument{\@ifpackageloaded{hyperref} + {\def\@linkcolor{blue} + \def\@anchorcolor{blue} + \def\@citecolor{blue} + \def\@filecolor{blue} + \def\@urlcolor{blue} + \def\@menucolor{blue} + \def\@pagecolor{blue} +\begingroup + \@makeother\`% + \@makeother\=% + \edef\x{% + \edef\noexpand\x{% + \endgroup + \noexpand\toks@{% + \catcode 96=\noexpand\the\catcode`\noexpand\`\relax + \catcode 61=\noexpand\the\catcode`\noexpand\=\relax + }% + }% + \noexpand\x + }% +\x +\@makeother\` +\@makeother\= +}{}} +%% + +\endinput +%% +%% End of file `elsarticle.cls'. diff --git a/inst/rmarkdown/templates/elsevier_article/skeleton/mybibfile.bib b/inst/rmarkdown/templates/elsevier_article/skeleton/mybibfile.bib new file mode 100644 index 000000000..32ccbc79c --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/skeleton/mybibfile.bib @@ -0,0 +1,20 @@ +@article{Dirac1953888, + title = "The lorentz transformation and absolute time", + journal = "Physica ", + volume = "19", + number = "1-–12", + pages = "888--896", + year = "1953", + doi = "10.1016/S0031-8914(53)80099-6", + author = "P.A.M. Dirac" +} + +@article{Feynman1963118, + title = "The theory of a general quantum system interacting with a linear dissipative system", + journal = "Annals of Physics ", + volume = "24", + pages = "118--173", + year = "1963", + doi = "10.1016/0003-4916(63)90068-X", + author = "R.P Feynman and F.L {Vernon Jr.}" +} diff --git a/inst/rmarkdown/templates/elsevier_article/skeleton/numcompress.sty b/inst/rmarkdown/templates/elsevier_article/skeleton/numcompress.sty new file mode 100644 index 000000000..b187effb0 --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/skeleton/numcompress.sty @@ -0,0 +1,189 @@ +%% +%% This is file 'numcompress'. +%% +%% Copyright (C) 2009-2012 River Valley Technologies +%% +%% +%% This package may be distributed under the terms of the LaTeX Project +%% Public License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% $Id: numcompress.sty 187 2012-08-18 09:36:35Z rishi $ +%% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/numcompress.sty $ +%% +\NeedsTeXFormat{LaTeX2e} +\def\Fileversion$#1: #2 ${\gdef\fileversion{#2}} +\def\Filedate$#1: #2-#3-#4 #5 #6 #7 ${\gdef\filedate{#2/#3/#4}} +\Fileversion$Rev: 187 $ +\Filedate$LastChangedDate: 2012-08-18 15:06:35 +0530 (Sat, 18 Aug 2012) $ +\ProvidesPackage{numcompress} + [\filedate\space\fileversion\space numcompress (CVR)] +\PackageWarningNoLine{numcompress} + {****************************************\MessageBreak + Package numcompress v,\fileversion\space loaded\MessageBreak + [Compress numbers (CVR)]\MessageBreak + ****************************************} +\newif\ifdots \dotsfalse +\newif\ifnumcompress \numcompresstrue + +\DeclareOption{dots}{\global\dotstrue} +\DeclareOption{nodots}{\global\dotsfalse} +\DeclareOption{compress}{\global\numcompresstrue} +\DeclareOption{nocompress}{\global\numcompressfalse} + +\ProcessOptions + +\def\removeDot#1{\def\tmp{#1}% + \ifx\tmp\@empty\else\@removeDot#1\@nil\fi} + +\def\@removeDot#1\@nil{\edef\fchar{\expandafter\@car#1\@nil}% + \edef\rchar{\expandafter\@cdr#1!\@nil}% + \def\@xmltempa{.}\def\@xmltempb{!}% + \ifx\fchar\@xmltempb\relax\else% + \ifx\fchar\@xmltempa\relax\else% + \fchar\ignorespaces\fi\removeDot{\rchar}\fi} + +\def\First[#1]{\csname First#1\endcsname} +\def\Second[#1]{\csname Second#1\endcsname} + +\def\parseFirstPage#1{\@tempcnta=0 + \@tfor\@digits:=#1\do{% + {\global\advance\@tempcnta by 1 + \expandafter\xdef\csname + First\the\@tempcnta\endcsname{\@digits}% + \xdef\flength{\the\@tempcnta}}}} + +\def\parseSecondPage#1{\@tempcnta=0 + \@tfor\@digits:=#1\do{% + {\global\advance\@tempcnta by 1 + \expandafter\xdef\csname + Second\the\@tempcnta\endcsname{\@digits}% + \xdef\llength{\the\@tempcnta}}}} + +\newif\ifdissimilar\dissimilarfalse +\def\checkequal#1#2{\edef\Farg{#1}\edef\Sarg{#2}% + \edef\One{A}% + \ifcat\One\Farg \relax\else% + \ifdissimilar\Sarg\else% + \ifnum\Farg=\Sarg\relax\else\Sarg\dissimilartrue\fi\fi\fi} +% +\let\@@fpage\@empty +\let\@@lpage\@empty +\def\fpage@compress#1{% + \gdef\@@fpage{#1}% + \edef\llength{0}% + \parseFirstPage{#1}% + \ifnum\flength=\llength% + \gdef\@fpage{\@@fpage}% + \gdef\@lpage{% + \@ifundefined{Second1}{}{\checkequal{\First[1]}{\Second[1]}}% + \@ifundefined{Second2}{}{\checkequal{\First[2]}{\Second[2]}}% + \@ifundefined{Second3}{}{\checkequal{\First[3]}{\Second[3]}}% + \@ifundefined{Second4}{}{\checkequal{\First[4]}{\Second[4]}}% + \@ifundefined{Second5}{}{\checkequal{\First[5]}{\Second[5]}}% + }% + \else% + \gdef\@fpage{\@@fpage}% + \gdef\@lpage{\@@lpage}% + \fi} + +\def\lpage@compress#1{% + \gdef\@@lpage{#1}% + \parseSecondPage{#1}% + \ifnum\flength=\llength% + \gdef\@fpage{\@@fpage}% + \gdef\@lpage{% + \edef\One{A}% + \edef\xFirst{\First[1]}% + \edef\xSecond{\Second[1]}% + \ifcat\One\xSecond\relax% + \ifx\xFirst\xSecond% + \@ifundefined{Second1}{}{\checkequal{\First[1]}{\Second[1]}}% + \@ifundefined{Second2}{}{\checkequal{\First[2]}{\Second[2]}}% + \@ifundefined{Second3}{}{\checkequal{\First[3]}{\Second[3]}}% + \@ifundefined{Second4}{}{\checkequal{\First[4]}{\Second[4]}}% + \@ifundefined{Second5}{}{\checkequal{\First[5]}{\Second[5]}}% + \else#1\fi% + \else% + \ifx\xFirst\xSecond% + \@ifundefined{Second1}{}{\checkequal{\First[1]}{\Second[1]}}% + \@ifundefined{Second2}{}{\checkequal{\First[2]}{\Second[2]}}% + \@ifundefined{Second3}{}{\checkequal{\First[3]}{\Second[3]}}% + \@ifundefined{Second4}{}{\checkequal{\First[4]}{\Second[4]}}% + \@ifundefined{Second5}{}{\checkequal{\First[5]}{\Second[5]}}% + \else#1\fi% + \fi% + }% + \else + \gdef\@fpage{\@@fpage}% + \gdef\@lpage{% + \edef\Targ{#1}% + \edef\One{A}% + \edef\xFirst{\First[1]}% + \edef\xSecond{\Second[1]}% + \ifx\xFirst\xSecond + \ifcat\One\xSecond\relax\else\@@lpage\fi% + \else#1\fi% + }% + \fi} + +%\newwrite\xx +%\immediate\openout\xx=tmpbib.tex +\gdef\@@lpage@compress#1--#2\@nil{\lpage@compress{#1}} +\gdef\@@@pages#1#2{\def\next{#2}% +% \immediate\write\xx{[\the\c@NAT@ctr.]\space [#1][#2]}% + \fpage@compress{#1}%\ifx\next\@empty\relax\else + \@@lpage@compress#2\@nil%\fi + {\@fpage\ifx\next\@empty\relax\else + --\@lpage\fi}\resetall} + +\gdef\@@@page#1{#1\resetall} + +\def\mk@empty#1{\@tempcnta=1 + \loop\ifnum\@tempcnta<6 + \expandafter\let\csname#1\the\@tempcnta\endcsname\relax + \advance\@tempcnta by 1 \repeat} +\def\resetall{\let\@lpage\@empty\let\@fpage\@empty + \def\flength{0}\def\llength{0}% + \let\@@fpage\@empty\let\@@lpage\@empty + \mk@empty{First}\mk@empty{Second}} + + +\ifdots + \gdef\xfnm[#1]{\unskip\space#1} + \def\bibinfo#1#2{\@ifnextchar.{\@@bibinfo{#1}{#2}}{\@@@bibinfo{#1}{#2}}} + \def\@@@bibinfo#1#2{\def\next{#1}% + \def\@@@pg{pages}\def\@@@au{author}% + \ifx\next\@@@pg\bibpages{#2}\else + \ifx\next\@@@au\bibauthor{#2}\else + #2\fi\fi} + \def\@@bibinfo#1#2.{\def\next{#1}% + \def\@@@pg{pages}\def\@@@au{author}% + \ifx\next\@@@pg\bibpages{#2}.\else + \ifx\next\@@@au\bibauthor{#2}\else + #2.\fi\fi} +\else + \gdef\xfnm[#1]{\unskip\space\removeDot{#1}} + \def\bibinfo#1#2{\def\next{#1}% + \def\@@@pg{pages}\def\@@@au{author}% + \ifx\next\@@@pg\bibpages{#2}\else + \ifx\next\@@@au\bibauthor{#2}\else + #2\fi\fi} +\fi + +\ifnumcompress + \def\bibpages#1{\@@bibpages#1--\\\@nil} + \def\@@bibpages#1--#2\@nil{% + \ifx\\#2\relax\@@@page{#1}\else + \@@@pages{#1}{#2}\fi} + \else + \def\bibpages#1{#1} +\fi + +\def\bibauthor#1{#1} + +\endinput + +%% +%% End of package 'numcompress.sty' +%% diff --git a/inst/rmarkdown/templates/elsevier_article/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/elsevier_article/skeleton/skeleton.Rmd new file mode 100755 index 000000000..82fe94e4a --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/skeleton/skeleton.Rmd @@ -0,0 +1,91 @@ +--- +title: Short Paper +author: + - name: Alice Anonymous + email: alice@example.com + affiliation: Some Institute of Technology + footnote: Corresponding Author + - name: Bob Security + email: bob@example.com + affiliation: Another University +address: + - code: Some Institute of Technology + address: Department, Street, City, State, Zip + - code: Another University + address: Department, Street, City, State, Zip +abstract: | + This is the abstract. + + It consists of two paragraphs. + +bibliography: mybibfile.bib +output: rticles::elsevier_article +--- + +_Text based on elsarticle sample manuscript, see [http://www.elsevier.com/author-schemas/latex-instructions#elsarticle](http://www.elsevier.com/author-schemas/latex-instructions#elsarticle)_ + + +The Elsevier article class +========================== + +#### Installation + +If the document class *elsarticle* is not available on your computer, +you can download and install the system package *texlive-publishers* +(Linux) or install the LaTeX package *elsarticle* using the package +manager of your TeX installation, which is typically TeX Live or MikTeX. + +#### Usage + +Once the package is properly installed, you can use the document class +*elsarticle* to create a manuscript. Please make sure that your +manuscript follows the guidelines in the Guide for Authors of the +relevant journal. It is not necessary to typeset your manuscript in +exactly the same way as an article, unless you are submitting to a +camera-ready copy (CRC) journal. + +#### Functionality + +The Elsevier article class is based on the standard article class and +supports almost all of the functionality of that class. In addition, it +features commands and options to format the + +- document style + +- baselineskip + +- front matter + +- keywords and MSC codes + +- theorems, definitions and proofs + +- lables of enumerations + +- citation style and labeling. + +Front matter +============ + +The author names and affiliations could be formatted in two ways: + +(1) Group the authors per affiliation. + +(2) Use footnotes to indicate the affiliations. + +See the front matter of this document for examples. You are recommended +to conform your choice to the journal you are submitting to. + +Bibliography styles +=================== + +There are various bibliography styles available. You can select the +style of your choice in the preamble of this document. These styles are +Elsevier styles based on standard styles like Harvard and Vancouver. +Please use BibTeX to generate your bibliography and include DOIs +whenever available. + +Here are two sample references: @Feynman1963118 [@Dirac1953888]. + +References {#references .unnumbered} +========== diff --git a/inst/rmarkdown/templates/elsevier_article/template.yaml b/inst/rmarkdown/templates/elsevier_article/template.yaml new file mode 100644 index 000000000..859108e08 --- /dev/null +++ b/inst/rmarkdown/templates/elsevier_article/template.yaml @@ -0,0 +1,5 @@ +name: Elsevier Journal Article +description: > + Template for creating an article for submission to any Elsevier journal +create_dir: true + diff --git a/inst/rmarkdown/templates/frontiers_article/resources/template.tex b/inst/rmarkdown/templates/frontiers_article/resources/template.tex deleted file mode 100755 index 51da2710b..000000000 --- a/inst/rmarkdown/templates/frontiers_article/resources/template.tex +++ /dev/null @@ -1,114 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This is just an example/guide for you to refer to when submitting manuscripts to Frontiers, it is not mandatory to use frontiers.cls nor frontiers.tex % -% This will only generate the Manuscript, the final article will be typeset by Frontier after acceptance. % -% % -% When submitting your files, remember to upload this *tex file, the pdf generated with it, the *bib file (if bibliography is not within the *tex) and all the figures. -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%% Version 3.0 Generated 2014/12/19 %%% -%%% You will need to have the following packages installed: datetime, fmtcount, etoolbox, fcprefix, which are normally inlcuded in WinEdt. %%% -%%% In http://www.ctan.org/ you can find the packages and how to install them, if necessary. %%% - -\documentclass{frontiersSCNS} % for Science, Engineering and Humanities and Social Sciences articles -%\documentclass{frontiersHLTH} % for Health articles -%\documentclass{frontiersFPHY} % for Physics articles - -%\setcitestyle{square} -\usepackage{url,lineno} -\linenumbers - - -% BELOW TAKEN FROM rticles plos template -% -% amsmath package, useful for mathematical formulas -\usepackage{amsmath} -% amssymb package, useful for mathematical symbols -\usepackage{amssymb} - -% hyperref package, useful for hyperlinks -\usepackage{hyperref} - -% graphicx package, useful for including eps and pdf graphics -% include graphics with the command \includegraphics -\usepackage{graphicx} - -% Sweave(-like) -\usepackage{fancyvrb} -\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl} -\DefineVerbatimEnvironment{Soutput}{Verbatim}{} -\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl} -\newenvironment{Schunk}{}{} -\DefineVerbatimEnvironment{Code}{Verbatim}{} -\DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl} -\DefineVerbatimEnvironment{CodeOutput}{Verbatim}{} -\newenvironment{CodeChunk}{}{} - -% cite package, to clean up citations in the main text. Do not remove. -\usepackage{cite} - -\usepackage{color} - -\providecommand{\tightlist}{% - \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} - -% Below is from frontiers -% -\bibliographystyle{frontiersinSCNS} -% Use doublespacing - comment out for single spacing -%\usepackage{setspace} -%\doublespacing - - -% Leave a blank line between paragraphs instead of using \\ - - - -\def\keyFont{\fontsize{8}{11}\helveticabold } - -%% ** EDIT HERE ** -%% PLEASE INCLUDE ALL MACROS BELOW - -%% END MACROS SECTION - -$for(header-includes)$ -$header-includes$ -$endfor$ - - - \def\Authors{ -$for(author)$ - $author.name$\,\textsuperscript{$author.affiliation$$if(author.email)$*$endif$}$sep$, -$endfor$ -} -% \\ -\def\Address{ -$for(affiliation)$ - \textsuperscript{$affiliation.id$} $if(affiliation.department)$$affiliation.department$, $endif$$if(affiliation.institution)$$affiliation.institution$, $endif$ $if(affiliation.city)$$affiliation.city$, $endif$ $if(affiliation.state)$$affiliation.state$, $endif$ $if(affiliation.country)$$affiliation.country$\\$endif$ -$endfor$ -} - -$for(author)$ - $if(author.email)$\def\corrAuthor{$author.name$}\def\corrAddress{$if(author.institution)$$author.institution$\\$endif$$if(author.street)$$author.street$\\$endif$$author.city$, $if(author.state)$$author.state$, $endif$$author.zip$$if(author.country)$$author.country$$endif$}\def\corrEmail{$author.email$}$endif$ - $if(author.etal)$\def\firstAuthorLast{$author.etal$ {et~al.}}$endif$ -$endfor$ - - -\begin{document} -% \inputencoding{utf8} -\onecolumn -\firstpage{1} - -\title[$runtitle$]{$title$} -\author[\firstAuthorLast]{\Authors} -\address{} -\correspondance{} -\extraAuth{}% If there are more than 1 corresponding author, comment this line and uncomment the next one. -%\extraAuth{corresponding Author2 \\ Laboratory X2, Institute X2, Department X2, Organization X2, Street X2, City X2 , State XX2 (only USA, Canada and Australia), Zip Code2, X2 Country X2, email2@uni2.edu} -\topic{}% If your article is part of a Research Topic, please indicate here which. -\maketitle - -$body$ - - -\end{document} - diff --git a/inst/rmarkdown/templates/frontiers_article/skeleton/frontiers.csl b/inst/rmarkdown/templates/frontiers_article/skeleton/frontiers.csl deleted file mode 100644 index ca296a949..000000000 --- a/inst/rmarkdown/templates/frontiers_article/skeleton/frontiers.csl +++ /dev/null @@ -1,160 +0,0 @@ - - diff --git a/inst/rmarkdown/templates/frontiers_article/skeleton/frontiersSCNS.cls b/inst/rmarkdown/templates/frontiers_article/skeleton/frontiersSCNS.cls deleted file mode 100755 index 3bdabe616..000000000 --- a/inst/rmarkdown/templates/frontiers_article/skeleton/frontiersSCNS.cls +++ /dev/null @@ -1,938 +0,0 @@ -\newcommand\classname{frontiersSCNS} %this file is based in bioninfo.cls -\newcommand\lastmodifieddate{2015/01/08} -\newcommand\versionnumber{2.4} - -% For printing crop marks -\newif\if@cropmarkson \@cropmarksontrue - -\NeedsTeXFormat{LaTeX2e}[2013/26/03] -\ProvidesClass{\classname}[\lastmodifieddate\space\versionnumber] - -\setlength{\paperheight}{11truein} -\setlength{\paperwidth}{8.5truein} - -\newif\if@final - -\DeclareOption{draft}{\PassOptionsToPackage{draft}{graphicx}} -\DeclareOption{paper}{\PassOptionsToPackage{paper}{graphicx}} -\DeclareOption{a4paper}{\PassOptionsToPackage{a4}{crop}} -\DeclareOption{centre}{\PassOptionsToPackage{center}{crop}} -\DeclareOption{crop}{\PassOptionsToPackage{cam}{crop}\global\@cropmarksontrue} -\DeclareOption{nocrop}{\PassOptionsToPackage{off}{crop}\global\@cropmarksonfalse} -\DeclareOption{info}{\PassOptionsToPackage{info}{crop}} -\DeclareOption{noinfo}{\PassOptionsToPackage{noinfo}{crop}} -\DeclareOption{final}{\global\@finaltrue} - -\ExecuteOptions{a4paper,nocrop,centre,info,paper} - -\ProcessOptions - -% Load all necessary packages -\RequirePackage{crop,graphicx,amsmath,array,color,amssymb,flushend,stfloats,amsthm,chngpage,times,datetime,parskip,epstopdf} -\def\helvetica{\fontfamily{phv}\selectfont} -\def\helveticaitalic{\fontfamily{phv}\itshape\selectfont} -\def\helveticabold{\fontfamily{phv}\bfseries\selectfont} -\def\helveticabolditalic{\fontfamily{phv}\bfseries\itshape\selectfont} -\usepackage[usenames,dvipsnames]{xcolor} - -\newcommand\@ptsize{0} - -% Set twoside printing -\@twosidetrue - -% Marginal notes are on the outside edge -\@mparswitchfalse - -\reversemarginpar - -\renewcommand\normalsize{% - \@setfontsize\normalsize{12}{12}% - \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ - \abovedisplayshortskip \z@ \@plus3\p@ - \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ - \belowdisplayskip \abovedisplayskip - \let\@listi\@listI} -\normalsize -\let\@bls\baselineskip - -\newcommand\small{% - \@setfontsize\small{11}{12}% - \abovedisplayskip 11\p@ minus 3\p@ - \belowdisplayskip \abovedisplayskip - \abovedisplayshortskip \z@ plus 2\p@ - \belowdisplayshortskip 4\p@ plus 2\p@ minus2\p@ - \def\@listi{\topsep 4.5\p@ plus 2\p@ minus 1\p@ - \itemsep \parsep - \topsep 4\p@ plus 2\p@ minus 2\p@}} - -\newcommand\footnotesize{% - \@setfontsize\footnotesize{8}{10}% - \abovedisplayskip 6\p@ minus 3\p@ - \belowdisplayskip\abovedisplayskip - \abovedisplayshortskip \z@ plus 3\p@ - \belowdisplayshortskip 6\p@ plus 3\p@ minus 3\p@ - \def\@listi{\topsep 3\p@ plus 1\p@ minus 1\p@ - \parsep 2\p@ plus 1\p@ minus 1\p@\itemsep \parsep}} - -\def\scriptsize{\@setfontsize\scriptsize{11pt}{11pt}} -\def\tiny{\@setfontsize\tiny{10pt}{11pt}} -\def\large{\@setfontsize\large{13pt}{14pt}} -\def\Large{\@setfontsize\Large{14pt}{16}} -\def\LARGE{\@setfontsize\LARGE{15pt}{17pt}} -\def\huge{\@setfontsize\huge{22pt}{22pt}} -\def\Huge{\@setfontsize\Huge{30pt}{30pt}} - - - - -\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} -\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} -\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} -\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} -\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} -\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} -\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} - -% Line spacing -\setlength\lineskip{1\p@} -\setlength\normallineskip{1\p@} -\renewcommand\baselinestretch{} - -% Set inter-para skips -\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@} -\setlength\medskipamount{6\p@ \@plus 2\p@} -\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@} - -% Paragraph dimensions and inter-para spacing -\setlength\parindent{3mm} -\setlength{\parskip}{\medskipamount} - -% Page break penalties -\@lowpenalty 51 -\@medpenalty 151 -\@highpenalty 301 - -% Disallow widows and orphans -\clubpenalty 10000 -\widowpenalty 10000 - -% Disable page breaks before equations, allow pagebreaks after -% equations and discourage widow lines before equations. -\displaywidowpenalty 100 -\predisplaypenalty 10000 -\postdisplaypenalty 2500 - -% Allow breaking the page in the middle of a paragraph -\interlinepenalty 0 - -% Disallow breaking the page after a hyphenated line -\brokenpenalty 10000 - -% Hyphenation; don't split words into less than three characters -\lefthyphenmin=3 -\righthyphenmin=3 - -% -% Set page layout dimensions -% -\setlength\headheight{16\p@} % height of running head -\setlength\topmargin{2.9pc} % head margin -\addtolength\topmargin{-1in} % subtract out the 1 inch driver margin - -\setlength\topskip{10\p@} % height of first line of text -\setlength\headsep{19\p@} % space below running head -- - -\setlength\footskip{34\p@} % space above footer line -\setlength\maxdepth{1\topskip} % pages can be short or deep by half a line? - -\setlength\textwidth{42pc} % text measure excluding margins - -\setlength\textheight{52\baselineskip} % 54 lines on a full page, -\addtolength\textheight{\topskip} % including the first - % line on the page - -% Set the margins -\setlength\marginparsep{3\p@} -\setlength\marginparpush{3\p@} -\setlength\marginparwidth{35\p@} - -\setlength\oddsidemargin{4.5pc} -\addtolength\oddsidemargin{-1in} % subtract out the 1 inch driver margin -\setlength\@tempdima{\paperwidth} -\addtolength\@tempdima{-\textwidth} -\addtolength\@tempdima{-4.5pc} -\setlength\evensidemargin{\@tempdima} -\addtolength\evensidemargin{-1in} - -\setlength\columnsep{1.5pc} % space between columns for double-column text -\setlength\columnseprule{0\p@} % width of rule between two columns - -% Footnotes -\setlength\footnotesep{9\p@} % space between footnotes -% space between text and footnote -\setlength{\skip\footins}{12\p@ \@plus 6\p@ \@minus 1\p@} - -% Float placement parameters - -% The total number of floats that can be allowed on a page. -\setcounter{totalnumber}{10} -% The maximum number of floats at the top and bottom of a page. -\setcounter{topnumber}{5} -\setcounter{bottomnumber}{5} -% The maximum part of the top or bottom of a text page that can be -% occupied by floats. This is set so that at least four lines of text -% fit on the page. -\renewcommand\topfraction{.9} -\renewcommand\bottomfraction{.9} -% The minimum amount of a text page that must be occupied by text. -% This should accomodate four lines of text. -\renewcommand\textfraction{.06} -% The minimum amount of a float page that must be occupied by floats. -\renewcommand\floatpagefraction{.94} - -% The same parameters repeated for double column output -\renewcommand\dbltopfraction{.9} -\renewcommand\dblfloatpagefraction{.9} - -% Space between floats -\setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} -% Space between floats and text -\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} -% Space above and below an inline figure -\setlength\intextsep {18\p@ \@plus 2\p@ \@minus 2\p@} - -% For double column floats -\setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} -\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} - -% Space left at top, bottom and inbetween floats on a float page. -\setlength\@fptop{0\p@} % no space above float page figures -\setlength\@fpsep{12\p@ \@plus 1fil} -\setlength\@fpbot{0\p@} - -% The same for double column -\setlength\@dblfptop{0\p@} -\setlength\@dblfpsep{12\p@ \@plus 1fil} -\setlength\@dblfpbot{0\p@} - -% Override settings in mathtime back to TeX defaults -\DeclareMathSizes{5} {5} {5} {5} -\DeclareMathSizes{6} {6} {5} {5} -\DeclareMathSizes{7} {7} {5} {5} -\DeclareMathSizes{8} {8} {6} {5} -\DeclareMathSizes{9} {9} {6.5} {5} -\DeclareMathSizes{10} {10} {7.5} {5} -\DeclareMathSizes{12} {12} {9} {7} - -% Page styles -\def\ps@headings - {% - \def\@oddfoot{\vbox to 12.5\p@{\rule{\textwidth}{0.5\p@}\vss - \hbox to \textwidth{\helveticabold\small {Frontiers}\hfill \thepage}% - }}% - \def\@evenfoot{\vbox to 12.5\p@{\rule{\textwidth}{0.5\p@}\vss - \hbox to \textwidth{\helvetica\small {\color{red}This is a provisional file, not the final typeset article}\hfill\helveticabold\color{black}\thepage}% - }}% - \def\@evenhead{\vbox{\hbox to \textwidth{\fontsize{11}{10}\selectfont - \helveticabold{\fontshape{it}\selectfont - \strut\firstAuthorLast}\hfill\strut\rightmark}\vspace{6.5\p@}\rule{\textwidth}{0.5\p@}}}% - \def\@oddhead{\vbox{\hbox to \textwidth{\fontsize{11}{10}\selectfont - \helveticabold{\fontshape{it}\selectfont - \strut\firstAuthorLast}\hfill\strut\rightmark}\vspace{6.5\p@}\rule{\textwidth}{0.5\p@}}}% - \def\titlemark##1{\markboth{##1}{##1}}% - \def\authormark##1{\gdef\leftmark{##1}}% - } - -\def\ps@opening - {% - \def\@oddfoot{\vbox to 13\p@{\hbox{\rule{\textwidth}{1\p@}}\vss - \hbox to \textwidth{\helvetica - \fontsize{7}{9}\fontshape{n}\selectfont \space % - \hfill\small\helveticabold\thepage}% - }}% - \def\@evenfoot{\vbox to 13\p@{\rule{\textwidth}{1\p@}\vss - \hbox to \textwidth{\helvetica\thepage\hfill - \fontsize{7}{9}\fontshape{n}\selectfont \space }% - }}% - \let\@evenhead\relax - \let\@oddhead\relax} - -% Page range -\newif\iflastpagegiven \lastpagegivenfalse -\newcommand\firstpage[1]{% - \gdef\@firstpage{#1}% - \ifnum\@firstpage>\c@page - \setcounter{page}{#1}% - \ClassWarning{BIO}{Increasing pagenumber to \@firstpage}% - \else \ifnum\@firstpage<\c@page - \ClassWarning{BIO}{Firstpage lower than pagenumber}\fi\fi - \xdef\@firstpage{\the\c@page}% - } -\def\@firstpage{1} -\def\pagenumbering#1{% - \global\c@page \@ne - \gdef\thepage{\csname @#1\endcsname \c@page}% - \gdef\thefirstpage{% - \csname @#1\endcsname \@firstpage}% - \gdef\thelastpage{% - \csname @#1\endcsname \@lastpage}% - } - -\newcommand\lastpage[1]{\xdef\@lastpage{#1}% - \global\lastpagegiventrue} -\def\@lastpage{0} -\def\setlastpage{\iflastpagegiven\else - \edef\@tempa{@lastpage@}% - \expandafter - \ifx \csname \@tempa \endcsname \relax - \gdef\@lastpage{0}% - \else - \xdef\@lastpage{\@nameuse{@lastpage@}}% - \fi - \fi } -\def\writelastpage{% - \iflastpagegiven \else - \immediate\write\@auxout% - {\string\global\string\@namedef{@lastpage@}{\the\c@page}}% - \fi - } -\def\thepagerange{% - \ifnum\@lastpage =0 {\ \bf ???} \else - \ifnum\@lastpage = \@firstpage \ \thefirstpage\else - \thefirstpage--\thelastpage \fi\fi} - -\AtBeginDocument{\setlastpage - \pagenumbering{arabic}% - } -\AtEndDocument{% - \writelastpage - \if@final - \clearemptydoublepage - \else - \clearpage - \fi} - -% -% Sectional units -% - -% Counters -\newcounter{section} -\newcounter{subsection}[section] -\newcounter{subsubsection}[subsection] -\newcounter{paragraph}[subsubsection] -\newcounter{subparagraph}[paragraph] -\newcounter{figure} -\newcounter{table} - -% Form of the numbers -\newcommand\thepage{\arabic{page}} -\renewcommand\thesection{\arabic{section}} -\renewcommand\thesubsection{{\thesection.\arabic{subsection}}} -\renewcommand\thesubsubsection{{\thesubsection.\arabic{subsubsection}}} -\renewcommand\theparagraph{\thesubsubsection.\arabic{paragraph}} -\renewcommand\thesubparagraph{\theparagraph.\arabic{subparagraph}} -\renewcommand\theequation{\arabic{equation}} - -% Form of the words -\newcommand\contentsname{Contents} -\newcommand\listfigurename{List of Figures} -\newcommand\listtablename{List of Tables} -\newcommand\partname{Part} -\newcommand\appendixname{Appendix} -\newcommand\abstractname{Abstract} -\newcommand\refname{References} -\newcommand\bibname{References} -\newcommand\indexname{Index} -\newcommand\figurename{Figure} -\newcommand\tablename{Table} - -% Clearemptydoublepage should really clear the running heads too -\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} - -% Frontmatter, mainmatter and backmatter - -\newif\if@mainmatter \@mainmattertrue - -\newcommand\frontmatter{% - \clearpage - \@mainmatterfalse - \pagenumbering{roman}} - -\newcommand\mainmatter{% - \clearpage - \@mainmattertrue - \pagenumbering{arabic}} - -\newcommand\backmatter{% - \clearpage - \@mainmatterfalse} - - \newdateformat{mydate}{\THEDAY \ \monthname[\THEMONTH] \THEYEAR} - \newdateformat{mydate2}{\monthname[\THEMONTH] \THEYEAR} - -%******** -% TITLE * -%******** -\newlength{\dropfromtop} -\setlength{\dropfromtop}{\z@} - -% Application Notes -\newif\if@appnotes -\newcommand{\application}{% -% \setlength{\dropfromtop}{-2.25pc}% - \global\@appnotestrue} - -% Short Title is for the Title of the Article -% Title is for the Title of the Journal - -\long\def\title{\@ifnextchar[{\short@title}{\@@title}} -\def\short@title[#1]{\titlemark{#1}\@@@title} -\def\@@title#1{\authormark{#1}\@@@title{#1}} -\long\def\@@@title#1{\gdef\@title{#1}} - -\long\def\author{\@ifnextchar[{\short@uthor}{\@uthor}} -\def\short@uthor[#1]{\authormark{#1}\@@author} -\def\@uthor#1{\authormark{#1}\@@author{#1}} -\long\def\@@author#1{\gdef\@author{#1}} - -\def\vol#1{\global\def\@vol{#1}} -\def\issue#1{\global\def\@issue{#1}} -\def\address#1{\global\def\@issue{#1}} -\def\history#1{\global\def\@history{#1}} -\def\correspondance#1{\global\def\@correspondance{#1}} -\def\extraAuth#1{\global\def\@extraAuth{#1}} -\def\topic#1{\global\def\@topic{#1}} -\def\pubyear#1{\global\def\@pubyear{#1}} -\def\copyrightyear#1{\global\def\@copyrightyear{#1}} -\def\address#1{\global\def\@address{#1}} -\def\DOI#1{\global\def\@DOI{#1}} - -\def\date#1{\gdef\@date{#1}} - -%*********** -% Colors * -%*********** - -% Other colors -\definecolor{black}{cmyk}{0, 0, 0, 1} -\definecolor{gray}{cmyk}{0, 0, 0, 0.25} -\definecolor{darkgray}{cmyk}{0, 0, 0, 0.5} -\newlength{\extraspace} -\setlength{\extraspace}{\z@} - -\newcommand\maketitle{\par - \begingroup - \renewcommand\thefootnote{\@fnsymbol\c@footnote}% - \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% - \long\def\@makefntext##1{\parindent 3mm\noindent -% \@textsuperscript{\normalfont\@thefnmark}\raggedright##1}% - \@textsuperscript{\normalfont\@thefnmark}##1}% - \if@twocolumn - \ifnum \col@number=\@ne - \@maketitle - \else - \twocolumn[\@maketitle]% - \fi - \else - \newpage - \global\@topnum\z@ % Prevents figures from going at top of page. - \@maketitle - \fi - \thispagestyle{opening}\@thanks - \endgroup - \setcounter{footnote}{0}% - \global\let\thanks\relax - \global\let\maketitle\relax - \global\let\@maketitle\relax - \global\let\@address\@empty - \global\let\@history\@empty - \global\let\@extraAuth\@empty - \global\let\@topic\@empty - \global\let\@thanks\@empty - \global\let\@author\@empty - \global\let\@date\@empty - \global\let\@title\@empty - \global\let\@pubyear\@empty - \global\let\address\relax - \global\let\topic\relax - \global\let\extraAuth\relax - \global\let\title\relax - \global\let\author\relax - \global\let\date\relax - \global\let\pubyear\relax - \global\let\@copyrightline\@empty - \global\let\and\relax - \@afterindentfalse\@afterheading -} - -\newlength{\aboveskipchk}%for checking oddpage or evenpage top skip -\setlength{\aboveskipchk}{\z@}% - -\def\@maketitle{% - \let\footnote\thanks - \clearemptydoublepage - \checkoddpage\ifcpoddpage\setlength{\aboveskipchk}{-7pc}\else\setlength{\aboveskipchk}{-3pc}\fi%for checking oddpage or evenpage top skip%% - \vspace*{\aboveskipchk}% - \vspace{\dropfromtop}% - \hbox to \textwidth{% - - \parbox[c]{15pc}{% - \helvetica - \hfil - \flushleft \includegraphics[width=15pc,angle=0]{./logo1.jpg} - - -}} - - \rule{\textwidth}{1\p@}\par% - \helvetica - \hbox to \textwidth{% - \parbox[t]{36.5pc}{% - \vspace*{1sp} - {\helveticabold\fontsize{20}{21}\color{black}\selectfont\raggedright \@title \par}% - \vspace{4.5\p@} - {\helveticabold\fontsize{12}{15}\selectfont\raggedright \@author \par}% - \vspace{4\p@} - {\helvetica\fontsize{12}{12}\selectfont\raggedright\slshape\@address \Address \par}% - \vspace{6\p@} - {\helvetica\fontsize{12}{10}\selectfont\raggedright {Correspondence*:\\ }\@correspondance \corrAuthor \\ \corrAddress, \corrEmail \par} - \vspace{4\p@} - {\helvetica\fontsize{12}{12}\selectfont\raggedright\@extraAuth \par}% - \vspace{8\p@} - {\helveticabold\color{darkgray}\fontsize{12}{12}\selectfont\raggedright\@topic \par} - %\vspace{20\p@} - }% - } - \vspace{14.5\p@}% -% \rule{\textwidth}{1\p@}% - \vspace{8\p@ plus 6\p@ minus 6\p@}% - \vspace{\extraspace} - } - -%*********** -% Abstract * -%*********** -\newcommand{\absection}[1]{% - \par\noindent{\bfseries #1}\space\ignorespaces} - -\newenvironment{abstract}{% - \begingroup - \let\section\absection - \fontfamily{\sfdefault}\fontsize{12}{12}\sffamily\selectfont - {\fontseries{b}\selectfont ABSTRACT}\par} -{\endgroup\bigskip\@afterheading\@afterindentfalse\vskip 12pt plus 3pt minus 1pt} - -% Section macros - -% Lowest level heading that takes a number by default -\setcounter{secnumdepth}{3} - -\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\quad} - -\def\section{% - \@startsection{section}{1}{\z@} - {-22\p@ plus -3\p@}{3\p@} - {\reset@font\raggedright\helveticabold\fontsize{13}{13}\color{black}\selectfont\MakeUppercase}} - -\def\subsection{% - \@startsection{subsection}{2}{\z@} - {-11\p@ plus -2\p@}{3\p@} - {\reset@font\raggedright\mathversion{bold}\helveticabold\fontsize{11.5}{12}\selectfont\MakeUppercase}} - -\def\subsubsection{% - \@startsection{subsubsection}{3}{\z@} - {-11\p@ plus -1\p@}{-1em} - {\reset@font\normalfont\normalsize\itshape}} - -\def\textcolon{\text{\rm :}} - - \def\paragraph{% - \@startsection{paragraph}{4}{\z@} - {-6\p@} - {-.4em} - {\reset@font\itshape}} - -% ******************** -% Figures and tables * -% ******************** - -% Table and array parameters -\setlength\arraycolsep{.5em} -\setlength\tabcolsep{.5em} -\setlength\arrayrulewidth{.5pt} -\setlength\doublerulesep{2.5pt} -\setlength\extrarowheight{\z@} -\renewcommand\arraystretch{1} - -\newlength{\abovecaptionskip} -\newlength{\belowcaptionskip} -\setlength{\abovecaptionskip}{13pt} -\setlength{\belowcaptionskip}{10.5pt} - -\long\def\@makecaption#1#2{\vspace{\abovecaptionskip}% - \begingroup - \footnotesize - \textbf{#1.}\enskip{#2}\par - \endgroup} - - -% Table rules -\def\toprule{\noalign{\ifnum0=`}\fi\hrule \@height 0.5pt \hrule \@height 6pt \@width 0pt \futurelet - \@tempa\@xhline} -\def\midrule{\noalign{\ifnum0=`}\fi \hrule \@height 6.75pt \@width 0pt \hrule \@height 0.5pt - \hrule \@height 6pt \@width 0pt \futurelet \@tempa\@xhline} -\def\botrule{\noalign{\ifnum0=`}\fi \hrule \@height 5.75pt \@width 0pt \hrule \@height 0.5pt \futurelet - \@tempa\@xhline} -\def\hrulefill{\leavevmode\leaders\hrule height .5pt\hfill\kern\z@} - -\def\thefigure{\@arabic\c@figure} -\def\fps@figure{tbp} -\def\ftype@figure{1} -\def\ext@figure{lof} -\def\fnum@figure{\figurename~\thefigure} -\def\figure{\@float{figure}} -\let\endfigure\end@float -\@namedef{figure*}{\@dblfloat{figure}} -\@namedef{endfigure*}{\end@dblfloat} -\def\thetable{\@arabic\c@table} -\def\fps@table{tbp} -\def\ftype@table{2} -\def\ext@table{lot} -\def\fnum@table{Table~\thetable} -\def\table{\let\@makecaption\@tablecaption\let\source\tablesource\@float{table}} -\def\endtable{\end@float} -\@namedef{table*}{\let\@makecaption\@tablecaption\@dblfloat{table}} -\@namedef{endtable*}{\end@dblfloat} - -\newif\if@rotate \@rotatefalse -\newif\if@rotatecenter \@rotatecenterfalse -\def\rotatecenter{\global\@rotatecentertrue} -\def\rotateendcenter{\global\@rotatecenterfalse} -\def\rotate{\global\@rotatetrue} -\def\endrotate{\global\@rotatefalse} -\newdimen\rotdimen -\def\rotstart#1{\special{ps: gsave currentpoint currentpoint translate - #1 neg exch neg exch translate}} -\def\rotfinish{\special{ps: currentpoint grestore moveto}} -\def\rotl#1{\rotdimen=\ht#1\advance\rotdimen by \dp#1 - \hbox to \rotdimen{\vbox to\wd#1{\vskip \wd#1 - \rotstart{270 rotate}\box #1\vss}\hss}\rotfinish} -\def\rotr#1{\rotdimen=\ht #1\advance\rotdimen by \dp#1 - \hbox to \rotdimen{\vbox to \wd#1{\vskip \wd#1 - \rotstart{90 rotate}\box #1\vss}\hss}\rotfinish} - -\newdimen\tempdime -\newbox\temptbox - -% From ifmtarg.sty -% Copyright Peter Wilson and Donald Arseneau, 2000 -\begingroup -\catcode`\Q=3 -\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil} -\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4} -\long\gdef\@ifnotmtarg#1{\@xifmtarg#1QQ\@firstofone\@gobble\@nil} -\endgroup - -\def\tablesize{\@setfontsize\tablesize{10\p@}{10\p@}} - -\newenvironment{processtable}[3]{\setbox\temptbox=\hbox{{\tablesize #2}}% -\tempdime\wd\temptbox\@processtable{#1}{#2}{#3}{\tempdime}} -{\relax} - -\newcommand{\@processtable}[4]{% -\if@rotate -\setbox4=\vbox to \hsize{\vss\hbox to \textheight{% -\begin{minipage}{#4}% -\@ifmtarg{#1}{}{\caption{#1}}{\tablesize #2}% -\vskip7\p@\noindent -\parbox{#4}{\fontsize{10}{10}\selectfont #3\par}% -\end{minipage}}\vss}% -\rotr{4} -\else -\hbox to \hsize{\hss\begin{minipage}[t]{#4}% -\vskip2.9pt -\@ifmtarg{#1}{}{\caption{#1}}{\tablesize #2}% -\vskip6\p@\noindent -\parbox{#4}{\fontsize{8}{9}\selectfont #3\par}% -\end{minipage}\hss}\fi}% - -\newcolumntype{P}[1]{>{\raggedright\let\\\@arraycr\hangindent1em}p{#1}} - -% ****************************** -% List numbering and lettering * -% ****************************** -\def\labelenumi{{\rm\arabic{enumi}.}} -\def\theenumi{\arabic{enumi}} -\def\labelenumii{{\rm\alph{enumii}.}} -\def\theenumii{\alph{enumii}} -\def\p@enumii{\theenumi} -\def\labelenumiii{{\rm(\arabic{enumiii})}} -\def\theenumiii{\roman{enumiii}} -\def\p@enumiii{\theenumi(\theenumii)} -\def\labelenumiv{{\rm(\arabic{enumiv})}} -\def\theenumiv{\Alph{enumiv}} -\def\p@enumiv{\p@enumiii\theenumiii} -\def\labelitemi{{\small$\bullet$}} -\def\labelitemii{{\small$\bullet$}} -\def\labelitemiii{{\small$\bullet$}} -\def\labelitemiv{{\small$\bullet$}} - -\def\@listI{\leftmargin\leftmargini \topsep\medskipamount} -\let\@listi\@listI -\@listi -\def\@listii{\topsep\z@\leftmargin\leftmarginii} -\def\@listiii{\leftmargin\leftmarginiii \topsep\z@} -\def\@listiv{\leftmargin\leftmarginiv \topsep\z@} -\def\@listv{\leftmargin\leftmarginv \topsep\z@} -\def\@listvi{\leftmargin\leftmarginvi \topsep\z@} - -\setlength{\leftmargini}{3mm} -\setlength{\leftmarginii}{\z@} -\setlength{\leftmarginiii}{\z@} -\setlength{\leftmarginiv}{\z@} - -% Changes to the list parameters for enumerate -\def\enumargs{% - \partopsep \z@ - \itemsep 3\p@ - \parsep \z@ - \labelsep 0.5em - \listparindent \parindent - \itemindent \z@ - \topsep 11\p@ -} - -\def\enumerate{% - \@ifnextchar[{\@numerate}{\@numerate[0]}} - -\def\@numerate[#1]{% - \ifnum \@enumdepth >3 \@toodeep\else - \advance\@enumdepth \@ne - \edef\@enumctr{enum\romannumeral\the\@enumdepth} - \list{\csname label\@enumctr\endcsname}{% - \enumargs - \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@enumdepth\endcsname} - \usecounter{\@enumctr} - \settowidth\labelwidth{#1} - \addtolength{\leftmargin}{\labelwidth} - \addtolength{\leftmargin}{\labelsep} - \def\makelabel##1{\hss \llap{##1}}}% - \fi - } -\let\endenumerate\endlist - -% Changes to the list parameters for itemize -\def\itemargs{% - \partopsep \z@ - \itemsep 3\p@ - \parsep \z@ - \labelsep 0.5em - \rightmargin \z@ - \listparindent \parindent - \itemindent \z@ - \topsep11\p@ -} - -\def\itemize{% - \@ifnextchar[{\@itemize}{\@itemize[$\bullet$]}} - -\def\@itemize[#1]{% - \ifnum \@itemdepth >3 \@toodeep\else - \advance\@itemdepth \@ne - \edef\@itemctr{item\romannumeral\the\@itemdepth} - \list{\csname label\@itemctr\endcsname}{% - \itemargs - \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@itemdepth\endcsname} - \settowidth\labelwidth{#1} - \addtolength{\leftmargin}{\labelwidth} - \addtolength{\leftmargin}{\labelsep} - \def\makelabel##1{\hss \llap{##1}}}% - \fi - } -\let\enditemize\endlist - -\newenvironment{unlist}{% - \begin{list}{}% - {\setlength{\labelwidth}{\z@}% - \setlength{\labelsep}{\z@}% - \setlength{\topsep}{\medskipamount}% - \setlength{\itemsep}{3\p@}% - \setlength{\leftmargin}{2em}% - \setlength{\itemindent}{-2em}}} -{\end{list}} - - -% *********************** -% Quotes and Quotations * -% *********************** -\def\quotation{\par\begin{list}{}{ - \setlength{\topsep}{\medskipamount} - \setlength{\leftmargin}{2em}% - \setlength{\rightmargin}{\z@}% - \setlength\labelwidth{0pt}% - \setlength\labelsep{0pt}% - \listparindent\parindent}% - \item[]} -\def\endquotation{\end{list}} -\let\quote\quotation -\let\endquote\endquotation - -\skip\@mpfootins = \skip\footins -\fboxsep=6\p@ -\fboxrule=1\p@ - -% ******************* -% Table of contents * -% ******************* -\newcommand\@pnumwidth{4em} -\newcommand\@tocrmarg{2.55em plus 1fil} -\newcommand\@dotsep{1000} -\setcounter{tocdepth}{4} - -\def\numberline#1{\hbox to \@tempdima{{#1}}} - -\def\@authortocline#1#2#3#4#5{% - \vskip 1.5\p@ - \ifnum #1>\c@tocdepth \else - {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip - \parindent #2\relax\@afterindenttrue - \interlinepenalty\@M - \leavevmode - \@tempdima #3\relax - \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip - {\itshape #4}\nobreak - \leaders\hbox{$\m@th - \mkern \@dotsep mu\hbox{.}\mkern \@dotsep - mu$}\hfill - \nobreak - \hb@xt@\@pnumwidth{\hfil}% - \par}% - \fi} - -\newcommand*\l@author{\@authortocline{2}{0pt}{30pt}} -\newcommand*\l@section{\@dottedtocline{3}{11pt}{20pt}} -\newcommand*\l@subsection{\@dottedtocline{4}{31pt}{29pt}} -\newcommand*\l@subsubsection[2]{} - - - -% *********** -% Footnotes * -% *********** - -\def\footnoterule{\noindent\rule{\columnwidth}{0.5pt}} -\def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}}% -\newcommand\@makefntext[1]{\noindent{\@makefnmark}\enskip#1} - -% *********** -% References * -% *********** - -\providecommand{\newblock}{} -\newenvironment{thebibliography}{% - \section{\bibname}% - \begingroup - \small - \begin{list}{}{% - \setlength{\topsep}{\z@}% - \setlength{\labelsep}{\z@}% - \settowidth{\labelwidth}{\z@}% - \setlength{\leftmargin}{4mm}% - \setlength{\itemindent}{-4mm}}\small} -{\end{list}\endgroup} - -\RequirePackage{natbib} - - -% ********** -% Appendix * -% ********** -\newif\ifappend % Are we in the Appendix? -\def\appendix{\par - \setcounter{section}{0} - \setcounter{subsection}{0} - \appendtrue -} - -%Math parameters - -\setlength{\jot}{5\p@} -\mathchardef\@m=1500 % adapted value - -\def\frenchspacing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m - \sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m} - -% Theorems -\def\th@plain{% -%% \let\thm@indent\noindent % no indent -\thm@headfont{\quad\scshape}% heading font is bold -\thm@notefont{\upshape\mdseries}% same as heading font -\thm@headpunct{.}% no period after heading -\thm@headsep 5\p@ plus\p@ minus\p@\relax -\itshape % body font -} - -\vbadness=9999 -\tolerance=9999 -\doublehyphendemerits=10000 -\doublehyphendemerits 640000 % corresponds to badness 800 -\finalhyphendemerits 1000000 % corresponds to badness 1000 - -\flushbottom -\frenchspacing -\ps@headings -\twocolumn - -% Screen PDF compatability -\newcommand{\medline}[1]{% - \unskip\unskip\ignorespaces} - - -%%%%for smaller size text -\newenvironment{methods}{% - \begingroup -\def\section{% - \@startsection{section}{1}{\z@} - {-24\p@ plus -3\p@}{4\p@} - {\reset@font\raggedright\helveticabold\fontsize{10}{12}\selectfont\MakeUppercase}} - \def\subsection{% - \@startsection{subsection}{2}{\z@} - {-5\p@ plus -2\p@}{4\p@} - {\reset@font\raggedright\mathversion{bold}\fontseries{b}\fontsize{10}{12}\selectfont}} - \def\subsubsection{% - \@startsection{subsubsection}{3}{\z@} - {-6\p@ plus -1\p@}{-1em} - {\reset@font\normalfont\normalsize\itshape}} -\footnotesize - \par} -{\par\endgroup\bigskip\@afterheading\@afterindentfalse} - - - -\graphicspath{{g:/artwork/oup/bioinfo/}} - -\language=2 - -\hyphenation{Figure Table Figures Tables} - -\newcommand{\href}[2]{#2} - -\renewenvironment{proof}[1][\proofname]{\par - \normalfont \topsep6\p@\@plus6\p@\relax - \labelsep 0.5em - \trivlist - \item[\hskip\labelsep\hskip1em\textsc{#1}.]\ignorespaces -}{\endtrivlist\@endpefalse} - -%%Different Bonds - -\def\sbond{\ensuremath{\raise.25ex\hbox{${-}\!\!\!\!{-}$}}\kern -.9pt} -\def\dbond{\ensuremath{\raise.25ex\hbox{=$\!$=}}} -\def\tbond{\ensuremath{\raise.20ex\hbox{${\equiv}\!\!\!{\equiv}$}}} - -\newcommand{\query}[2][0pt]{}% - -\renewcommand{\dag}{{\mathversion{normal}$^{\dagger}$}} - -\endinput diff --git a/inst/rmarkdown/templates/frontiers_article/skeleton/logo1.jpg b/inst/rmarkdown/templates/frontiers_article/skeleton/logo1.jpg deleted file mode 100755 index a7561f797..000000000 Binary files a/inst/rmarkdown/templates/frontiers_article/skeleton/logo1.jpg and /dev/null differ diff --git a/inst/rmarkdown/templates/frontiers_article/skeleton/logo2.eps b/inst/rmarkdown/templates/frontiers_article/skeleton/logo2.eps deleted file mode 100755 index 6071a9a4f..000000000 Binary files a/inst/rmarkdown/templates/frontiers_article/skeleton/logo2.eps and /dev/null differ diff --git a/inst/rmarkdown/templates/frontiers_article/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/frontiers_article/skeleton/skeleton.Rmd deleted file mode 100644 index 8675e229c..000000000 --- a/inst/rmarkdown/templates/frontiers_article/skeleton/skeleton.Rmd +++ /dev/null @@ -1,173 +0,0 @@ ---- -title: "Article Title" -runtitle: "Short Title" -author: - - name: First Author - affiliation: '1' - etal: LASTNAME # First author's last name. - - name: Co-Author - affiliation: '2' - - name: Co-Author - affiliation: '1,3' - email: email@uni.edu # Indicates corresponding Author - institution: Laboratory X, Institute X, Department X, Organization X - street: Street X - city: City X - state: State XX # only USA, Australia, Canada - zip: Zip Code X - country: Country X -affiliation: - - id: '1' - department: Department X - institution: Institution X - city: City X - state: State XX # only USA, Australia, Canada - country: Country X - - id: '2' - department: Department X - institution: Institution X - city: City X - state: State XX # only USA, Australia, Canada - country: Country X - - id: '3' - department: Department X - institution: Institution X - city: City X - state: State XX # only USA, Australia, Canada - country: Country X -output: rticles::frontiers_article -csl: frontiers.csl -bibliography: test.BIB ---- - -\begin{abstract} - -Abstract length and content varies depending on article type. Refer to -\url{http://www.frontiersin.org/about/AuthorGuidelines} for abstract requirement -and length according to article type. - -%All article types: you may provide up to 8 keywords; at least 5 are mandatory. -\tiny - \keyFont{ \section{Keywords:} Text Text Text Text Text Text Text Text } - -\end{abstract} - - -# Introduction {-} -Cite fancy references [@Neuro2013]. As demonstrated in @Gene2012, citations can -also be automatically reference. Multiple references are separated by semicolons -[@Neuro2013; @Neurobot2013]. - -# Results {-} - - - -## Subsection 1 {-} - -You can use R chunks directly to plot graphs. - -```{r, graph, echo=TRUE, message=FALSE, fig.show = "hide"} -require("ggplot2") -x <- 0:100 -set.seed(999) -y <- 2 * (x + rnorm(length(x), sd = 3) + 3) -ggplot(data = data.frame(x, y), - aes(x = x, y = y)) + - geom_point() + - geom_smooth(method = "lm") -``` - -## Subsection 2 {-} - -Frontiers requires figures to be submitted individually, in the same order as -they are referred to in the manuscript. Figures will then be automatically -embedded at the bottom of the submitted manuscript. Kindly ensure that each -table and figure is mentioned in the text and in numerical order. Permission -must be obtained for use of copyrighted material from other sources (including -the web). Please note that it is compulsory to follow figure instructions. -Figures which are not according to the guidelines will cause substantial delay -during the production process. - -# Discussion - -# Disclosure/Conflict-of-Interest Statement {-} - - - -The authors declare that the research was conducted in the absence of any -commercial or financial relationships that could be construed as a potential -conflict of interest. - -# Author Contributions {-} - - - -The statement about the authors and contributors can be up to several sentences -long, describing the tasks of individual authors referred to by their initials -and should be included at the end of the manuscript before the References -section. - - -# Acknowledgments {-} - -Funding: - -# Supplemental Data - -Supplementary Material should be uploaded separately on submission, if there are -Supplementary Figures, please include the caption in the same file as the -figure. LaTeX Supplementary Material templates can be found in the Frontiers -LaTeX folder - -# References - -A reference list should be automatically created here. However it won't. Pandoc -will place the list of references at the end of the document instead. There are -no convenient solution for now to force Pandoc to do otherwise. The easiest way -to get around this problem is to edit the LaTeX file created by Pandoc before -compiling it again using the traditional LaTeX commands. - -# Figures {-} - -```{r, Figure-1, ref.label = "graph", results = "hide", echo = FALSE, message = FALSE, fig.height=4, fig.width=4, fig.align='center', fig.cap='Figure caption', out.width = "85mm", out.height = "85mm"} -# You can also refer to code chunks from above to place figures at the bottom. -``` - diff --git a/inst/rmarkdown/templates/frontiers_article/skeleton/test.BIB b/inst/rmarkdown/templates/frontiers_article/skeleton/test.BIB deleted file mode 100755 index cbe76bbfc..000000000 --- a/inst/rmarkdown/templates/frontiers_article/skeleton/test.BIB +++ /dev/null @@ -1,34 +0,0 @@ -@Article{ Neuro2013, - author = "Author1 LastName1 and Author2 LastName2 and Author3 LastName2", - title = "Article Title", - volume = "30", - number = "30", - pages = "10127--10134", - year = "2013", - doi = "10.3389/fnins.2013.12345", - URL = "http://www.frontiersin.org/Neuroscience/10.3389/fnins.2013.12345/abstract", - journal = "Frontiers in Neuroscience" -} - -@Article{ Gene2012, - author = "Name OtherAuthor and Name S. Coauthor", - title = "Article Title", - volume = "30", - number = "49", - pages = "16417--16418", - year = "2012", - doi = "10.3389/fgene.2012.54321", - URL = "http://www.frontiersin.org/Genetics/10.3389/fgene.2012.54321/abstract", - journal = "Frontiers in Genetics" -} - -@Article{ Neurobot2013, -author = "Name4 Author4 and Name5 Author5", - title = "Title of the Article", - volume = "7", - number = "25", - year = "2013", - doi = "10.3389/fnbot.2013.56789", - URL = "http://www.frontiersin.org/Neurorobotics/10.3389/fnbot.2013.56789/abstract", - journal = "Frontiers in Neurorobotics" -} diff --git a/inst/rmarkdown/templates/frontiers_article/template.yaml b/inst/rmarkdown/templates/frontiers_article/template.yaml deleted file mode 100644 index 0aefee022..000000000 --- a/inst/rmarkdown/templates/frontiers_article/template.yaml +++ /dev/null @@ -1,4 +0,0 @@ -name: Frontiers Template -description: > - Template for Frontiers article -create_dir: true diff --git a/inst/rmarkdown/templates/jss_article/resources/template.tex b/inst/rmarkdown/templates/jss_article/resources/template.tex index 0450d2013..41cdf7d55 100644 --- a/inst/rmarkdown/templates/jss_article/resources/template.tex +++ b/inst/rmarkdown/templates/jss_article/resources/template.tex @@ -1,4 +1,4 @@ -\documentclass[article]{jss} +\documentclass[$if(documentclass)$$documentclass$$else$article$endif$$if(classoption)$,$classoption$$endif$]{jss} \usepackage[utf8]{inputenc} \providecommand{\tightlist}{% @@ -53,5 +53,22 @@ $body$ +$if(natbib)$ +$if(bibliography)$ +$if(biblio-title)$ +$if(book-class)$ +\renewcommand\bibname{$biblio-title$} +$else$ +\renewcommand\refname{$biblio-title$} +$endif$ +$endif$ +\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} +$endif$ +$endif$ + +$if(biblatex)$ +\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ +$endif$ + \end{document} diff --git a/inst/rmarkdown/templates/plos_article/resources/template.tex b/inst/rmarkdown/templates/plos_article/resources/template.tex deleted file mode 100644 index 2f6843f0b..000000000 --- a/inst/rmarkdown/templates/plos_article/resources/template.tex +++ /dev/null @@ -1,104 +0,0 @@ -% Template for PLoS - -\documentclass[10pt]{article} -\usepackage[utf8]{inputenc} - -% amsmath package, useful for mathematical formulas -\usepackage{amsmath} -% amssymb package, useful for mathematical symbols -\usepackage{amssymb} - -% hyperref package, useful for hyperlinks -\usepackage{hyperref} - -% graphicx package, useful for including eps and pdf graphics -% include graphics with the command \includegraphics -\usepackage{graphicx} - -% Sweave(-like) -\usepackage{fancyvrb} -\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl} -\DefineVerbatimEnvironment{Soutput}{Verbatim}{} -\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl} -\newenvironment{Schunk}{}{} -\DefineVerbatimEnvironment{Code}{Verbatim}{} -\DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl} -\DefineVerbatimEnvironment{CodeOutput}{Verbatim}{} -\newenvironment{CodeChunk}{}{} - -% cite package, to clean up citations in the main text. Do not remove. -\usepackage{cite} - -\usepackage{color} - -% Use doublespacing - comment out for single spacing -%\usepackage{setspace} -%\doublespacing - - -% Text layout -\topmargin 0.0cm -\oddsidemargin 0.5cm -\evensidemargin 0.5cm -\textwidth 16cm -\textheight 21cm - -% Bold the 'Figure #' in the caption and separate it with a period -% Captions will be left justified -\usepackage[labelfont=bf,labelsep=period,justification=raggedright]{caption} - -% Use the PLoS provided bibtex style -\bibliographystyle{plos} - -% Remove brackets from numbering in List of References -\makeatletter -\renewcommand{\@biblabel}[1]{\quad#1.} -\makeatother - -\providecommand{\tightlist}{% - \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} - -% Leave date blank -\date{} - -\pagestyle{myheadings} -%% ** EDIT HERE ** - - -%% ** EDIT HERE ** -%% PLEASE INCLUDE ALL MACROS BELOW - -%% END MACROS SECTION - -$for(header-includes)$ -$header-includes$ -$endfor$ - -\begin{document} - -% Title must be 150 characters or less -\begin{flushleft} -{\Large -\textbf{$title$} -} -% Insert Author names, affiliations and corresponding author email. -\\ -$for(author)$ - $author.name$\textsuperscript{$author.affiliation$$if(author.email)$*$endif$}$sep$, -$endfor$ -\\ -$for(affiliation)$ -\bf{$affiliation.id$} $if(affiliation.department)$$affiliation.department$, $endif$$if(affiliation.institution)$$affiliation.institution$, $endif$ $if(affiliation.city)$$affiliation.city$, $endif$ $if(affiliation.state)$$affiliation.state$, $endif$ $if(affiliation.country)$$affiliation.country$$endif$ -\\ -$endfor$ - -\textasteriskcentered{} E-mail: $for(author)$ - $if(author.email)$$author.email$$endif$ -$endfor$ - -\end{flushleft} - -$body$ - -\end{document} - diff --git a/inst/rmarkdown/templates/plos_article/skeleton/library.bib b/inst/rmarkdown/templates/plos_article/skeleton/library.bib deleted file mode 100644 index 231160ff2..000000000 --- a/inst/rmarkdown/templates/plos_article/skeleton/library.bib +++ /dev/null @@ -1,17 +0,0 @@ -@article{Garnier2007, -abstract = {The roots of swarm intelligence are deeply embedded in the biological study of self-organized behaviors in social insects. From the routing of traffic in telecommunication networks to the design of control algorithms for groups of autonomous robots, the collective behaviors of these animals have inspired many of the foundational works in this emerging research field. For the first issue of this journal dedicated to swarm intelligence, we review the main biological principles that underlie the organization of insects’ colonies. We begin with some reminders about the decentralized nature of such systems and we describe the un- derlying mechanisms of complex collective behaviors of social insects, from the concept of stigmergy to the theory of self-organization in biological systems.We emphasize in partic- ular the role of interactions and the importance of bifurcations that appear in the collective output of the colony when some of the system’s parameters change. We then propose to categorize the collective behaviors displayed by insect colonies according to four functions that emerge at the level of the colony and that organize its global behavior. Finally, we ad- dress the role of modulations of individual behaviors by disturbances (either environmental or internal to the colony) in the overall flexibility of insect colonies. We conclude that fu- ture studies about self-organized biological behaviors should investigate such modulations to better understand how insect colonies adapt to uncertain worlds.}, -author = {Garnier, Simon and Gautrais, Jacques and Theraulaz, Guy}, -doi = {10.1007/s11721-007-0004-y}, -file = {:Users/simongarnier/Work/bibliography/Mendeley/Swarm Intelligence/2007/Garnier, Gautrais, Theraulaz - 2007.pdf:pdf}, -issn = {1935-3812}, -journal = {Swarm Intelligence}, -keywords = {self organization collective,self-organization collective,social insects,stigmergy,swarm intelligence}, -mendeley-tags = {swarm intelligence}, -month = jul, -number = {1}, -pages = {3--31}, -title = {{The biological principles of swarm intelligence}}, -url = {http://www.springerlink.com/index/10.1007/s11721-007-0004-y}, -volume = {1}, -year = {2007} -} diff --git a/inst/rmarkdown/templates/plos_article/skeleton/plos.bst b/inst/rmarkdown/templates/plos_article/skeleton/plos.bst deleted file mode 100644 index 122acf5cb..000000000 --- a/inst/rmarkdown/templates/plos_article/skeleton/plos.bst +++ /dev/null @@ -1,1330 +0,0 @@ -%% -%% This is file `PLoS.bst', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% merlin.mbs (with options: `annote,seq-no,nm-rvx,ed-rev,jnrlst,nmlm,x5,m5,dt-beg,yr-par,xmth,yrp-x,jxper,jttl-rm,vnum-x,pp-last,num-xser,jnm-x,btit-rm,bt-rm,pg-bk,add-pub,pre-pub,doi,in-col,pp,xedn,jabr,xand,eprint,url,url-blk,nfss,') -%% ---------------------------------------- -%% *** This works for PLoS (as of October. 2008) *** -%% **** Updated Oct. 2008 by JZR -%% -%% Copyright 1994-2004 Patrick W Daly - % =============================================================== - % IMPORTANT NOTICE: - % This bibliographic style (bst) file has been generated from one or - % more master bibliographic style (mbs) files, listed above. - % - % This generated file can be redistributed and/or modified under the terms - % of the LaTeX Project Public License Distributed from CTAN - % archives in directory macros/latex/base/lppl.txt; either - % version 1 of the License, or any later version. - % =============================================================== - % Name and version information of the main mbs file: - % \ProvidesFile{merlin.mbs}[2004/02/09 4.13 (PWD, AO, DPC)] - % For use with BibTeX version 0.99a or later - %------------------------------------------------------------------- - % This bibliography style file is intended for texts in ENGLISH - % This is a numerical citation style, and as such is standard LaTeX. - % It requires no extra package to interface to the main text. - % The form of the \bibitem entries is - % \bibitem{key}... - % Usage of \cite is as follows: - % \cite{key} ==>> [#] - % \cite[chap. 2]{key} ==>> [#, chap. 2] - % where # is a number determined by the ordering in the reference list. - % The order in the reference list is that by which the works were originally - % cited in the text, or that in the database. - %--------------------------------------------------------------------- - -ENTRY - { address - annote - archive - author - booktitle - chapter - doi - edition - editor - eid - eprint - howpublished - institution - journal - key - month - note - number - organization - pages - publisher - school - series - title - type - url - volume - year - } - {} - { label } -INTEGERS { output.state before.all mid.sentence after.sentence after.block } -FUNCTION {init.state.consts} -{ #0 'before.all := - #1 'mid.sentence := - #2 'after.sentence := - #3 'after.block := -} -STRINGS { s t} -FUNCTION {output.nonnull} -{ 's := - output.state mid.sentence = - { ", " * write$ } - { output.state after.block = - { add.period$ write$ - newline$ - "\newblock " write$ - } - { output.state before.all = - 'write$ - { add.period$ " " * write$ } - if$ - } - if$ - mid.sentence 'output.state := - } - if$ - s -} -FUNCTION {output} -{ duplicate$ empty$ - 'pop$ - 'output.nonnull - if$ -} -FUNCTION {output.check} -{ 't := - duplicate$ empty$ - { pop$ "empty " t * " in " * cite$ * warning$ } - 'output.nonnull - if$ -} -FUNCTION {fin.entry} -{ add.period$ - write$ - newline$ - annote missing$ - { "\bibAnnoteFile{" cite$ * "}" * write$ newline$ } - { "\bibAnnote{" cite$ * "}{" * annote * "}" * write$ newline$ - } - if$ -} - -FUNCTION {new.block} -{ output.state before.all = - 'skip$ - { after.block 'output.state := } - if$ -} -FUNCTION {new.sentence} -{ output.state after.block = - 'skip$ - { output.state before.all = - 'skip$ - { after.sentence 'output.state := } - if$ - } - if$ -} -FUNCTION {add.blank} -{ " " * before.all 'output.state := -} - -FUNCTION {date.block} -{ - add.blank -} - -FUNCTION {not} -{ { #0 } - { #1 } - if$ -} -FUNCTION {and} -{ 'skip$ - { pop$ #0 } - if$ -} -FUNCTION {or} -{ { pop$ #1 } - 'skip$ - if$ -} -STRINGS {z} -FUNCTION {remove.dots} -{ 'z := - "" - { z empty$ not } - { z #1 #1 substring$ - z #2 global.max$ substring$ 'z := - duplicate$ "." = 'pop$ - { * } - if$ - } - while$ -} -FUNCTION {new.block.checka} -{ empty$ - 'skip$ - 'new.block - if$ -} -FUNCTION {new.block.checkb} -{ empty$ - swap$ empty$ - and - 'skip$ - 'new.block - if$ -} -FUNCTION {new.sentence.checka} -{ empty$ - 'skip$ - 'new.sentence - if$ -} -FUNCTION {new.sentence.checkb} -{ empty$ - swap$ empty$ - and - 'skip$ - 'new.sentence - if$ -} -FUNCTION {field.or.null} -{ duplicate$ empty$ - { pop$ "" } - 'skip$ - if$ -} -FUNCTION {emphasize} -{ duplicate$ empty$ - { pop$ "" } - { "\emph{" swap$ * "}" * } - if$ -} -FUNCTION {tie.or.space.prefix} -{ duplicate$ text.length$ #3 < - { "~" } - { " " } - if$ - swap$ -} - -FUNCTION {capitalize} -{ "u" change.case$ "t" change.case$ } - -FUNCTION {space.word} -{ " " swap$ * " " * } - % Here are the language-specific definitions for explicit words. - % Each function has a name bbl.xxx where xxx is the English word. - % The language selected here is ENGLISH -FUNCTION {bbl.and} -{ "and"} - -FUNCTION {bbl.etal} -{ "et~al." } - -FUNCTION {bbl.editors} -{ "editors" } - -FUNCTION {bbl.editor} -{ "editor" } - -FUNCTION {bbl.edby} -{ "edited by" } - -FUNCTION {bbl.edition} -{ "edition" } - -FUNCTION {bbl.volume} -{ "volume" } - -FUNCTION {bbl.of} -{ "of" } - -FUNCTION {bbl.number} -{ "number" } - -FUNCTION {bbl.nr} -{ "no." } - -FUNCTION {bbl.in} -{ "in" } - -FUNCTION {bbl.pages} -{ "pp." } - -FUNCTION {bbl.page} -{ "p." } - -FUNCTION {bbl.chapter} -{ "chapter" } - -FUNCTION {bbl.techrep} -{ "Technical Report" } - -FUNCTION {bbl.mthesis} -{ "Master's thesis" } - -FUNCTION {bbl.phdthesis} -{ "Ph.D. thesis" } - -MACRO {jan} {"January"} - -MACRO {feb} {"February"} - -MACRO {mar} {"March"} - -MACRO {apr} {"April"} - -MACRO {may} {"May"} - -MACRO {jun} {"June"} - -MACRO {jul} {"July"} - -MACRO {aug} {"August"} - -MACRO {sep} {"September"} - -MACRO {oct} {"October"} - -MACRO {nov} {"November"} - -MACRO {dec} {"December"} - -MACRO {acmcs} {"ACM Comput. Surv."} - -MACRO {acta} {"Acta Inf."} - -MACRO {cacm} {"Commun. ACM"} - -MACRO {ibmjrd} {"IBM J. Res. Dev."} - -MACRO {ibmsj} {"IBM Syst.~J."} - -MACRO {ieeese} {"IEEE Trans. Software Eng."} - -MACRO {ieeetc} {"IEEE Trans. Comput."} - -MACRO {ieeetcad} - {"IEEE Trans. Comput. Aid. Des."} - -MACRO {ipl} {"Inf. Process. Lett."} - -MACRO {jacm} {"J.~ACM"} - -MACRO {jcss} {"J.~Comput. Syst. Sci."} - -MACRO {scp} {"Sci. Comput. Program."} - -MACRO {sicomp} {"SIAM J. Comput."} - -MACRO {tocs} {"ACM Trans. Comput. Syst."} - -MACRO {tods} {"ACM Trans. Database Syst."} - -MACRO {tog} {"ACM Trans. Graphic."} - -MACRO {toms} {"ACM Trans. Math. Software"} - -MACRO {toois} {"ACM Trans. Office Inf. Syst."} - -MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} - -MACRO {tcs} {"Theor. Comput. Sci."} - -FUNCTION {bibinfo.check} -{ swap$ - duplicate$ missing$ - { - pop$ pop$ - "" - } - { duplicate$ empty$ - { - swap$ pop$ - } - { swap$ - pop$ - } - if$ - } - if$ -} -FUNCTION {bibinfo.warn} -{ swap$ - duplicate$ missing$ - { - swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ - "" - } - { duplicate$ empty$ - { - swap$ "empty " swap$ * " in " * cite$ * warning$ - } - { swap$ - pop$ - } - if$ - } - if$ -} -FUNCTION {format.eprint} -{ eprint duplicate$ empty$ - 'skip$ - { "\eprint" - archive empty$ - 'skip$ - { "[" * archive * "]" * } - if$ - "{" * swap$ * "}" * - } - if$ -} -FUNCTION {format.url} -{ url empty$ - { "" } - { "\urlprefix\url{" url * "}" * } - if$ -} - -STRINGS { bibinfo} -INTEGERS { nameptr namesleft numnames } - -FUNCTION {format.names} -{ 'bibinfo := - duplicate$ empty$ 'skip$ { - 's := - "" 't := - #1 'nameptr := - s num.names$ 'numnames := - numnames 'namesleft := - { namesleft #0 > } - { s nameptr - "{vv~}{ll}{ f{}}{ jj}" - format.name$ - remove.dots - bibinfo bibinfo.check - 't := - nameptr #1 > - { - nameptr #5 - #1 + = - numnames #5 - > and - { "others" 't := - #1 'namesleft := } - 'skip$ - if$ - namesleft #1 > - { ", " * t * } - { - "," * - s nameptr "{ll}" format.name$ duplicate$ "others" = - { 't := } - { pop$ } - if$ - t "others" = - { - " " * bbl.etal * - } - { " " * t * } - if$ - } - if$ - } - 't - if$ - nameptr #1 + 'nameptr := - namesleft #1 - 'namesleft := - } - while$ - } if$ -} -FUNCTION {format.names.ed} -{ - format.names -} -FUNCTION {format.authors} -{ author "author" format.names -} -FUNCTION {get.bbl.editor} -{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } - -FUNCTION {format.editors} -{ editor "editor" format.names duplicate$ empty$ 'skip$ - { - "," * - " " * - get.bbl.editor - * - } - if$ -} -FUNCTION {format.book.pages} -{ pages "pages" bibinfo.check - duplicate$ empty$ 'skip$ - { " " * bbl.pages * } - if$ -} -FUNCTION {format.doi} -{ doi "doi" bibinfo.check - duplicate$ empty$ 'skip$ - { - new.block - "\doi{" swap$ * "}" * - } - if$ -} -FUNCTION {format.note} -{ - note empty$ - { "" } - { note #1 #1 substring$ - duplicate$ "{" = - 'skip$ - { output.state mid.sentence = - { "l" } - { "u" } - if$ - change.case$ - } - if$ - note #2 global.max$ substring$ * "note" bibinfo.check - } - if$ -} - -FUNCTION {format.title} -{ title - duplicate$ empty$ 'skip$ - { "t" change.case$ } - if$ - "title" bibinfo.check -} -FUNCTION {output.bibitem} -{ newline$ - "\bibitem{" write$ - cite$ write$ - "}" write$ - newline$ - "" - before.all 'output.state := -} - -FUNCTION {n.dashify} -{ - 't := - "" - { t empty$ not } - { t #1 #1 substring$ "-" = - { t #1 #2 substring$ "-" = not - %{ "--" * - { "-" * - t #2 global.max$ substring$ 't := - } - { { t #1 #1 substring$ "-" = } - { "-" * - t #2 global.max$ substring$ 't := - } - while$ - } - if$ - } - { t #1 #1 substring$ * - t #2 global.max$ substring$ 't := - } - if$ - } - while$ -} - -FUNCTION {word.in} -{ bbl.in capitalize - ":" * - " " * } - -FUNCTION {format.date} -{ - "" - duplicate$ empty$ - year "year" bibinfo.check duplicate$ empty$ - { swap$ 'skip$ - { "there's a month but no year in " cite$ * warning$ } - if$ - * - } - { swap$ 'skip$ - { - swap$ - " " * swap$ - } - if$ - * - } - if$ - duplicate$ empty$ - 'skip$ - { - before.all 'output.state := - " (" swap$ * ")" * - } - if$ -} -FUNCTION {format.btitle} -{ title "title" bibinfo.check - duplicate$ empty$ 'skip$ - { - } - if$ -} -FUNCTION {either.or.check} -{ empty$ - 'pop$ - { "can't use both " swap$ * " fields in " * cite$ * warning$ } - if$ -} -FUNCTION {format.bvolume} -{ volume empty$ - { "" } - { bbl.volume volume tie.or.space.prefix - "volume" bibinfo.check * * - series "series" bibinfo.check - duplicate$ empty$ 'pop$ - { swap$ bbl.of space.word * swap$ - emphasize * } - if$ - "volume and number" number either.or.check - } - if$ -} -FUNCTION {format.number.series} -{ volume empty$ - { number empty$ - { series field.or.null } - { series empty$ - { number "number" bibinfo.check } - { output.state mid.sentence = - { bbl.number } - { bbl.number capitalize } - if$ - number tie.or.space.prefix "number" bibinfo.check * * - bbl.in space.word * - series "series" bibinfo.check * - } - if$ - } - if$ - } - { "" } - if$ -} - -FUNCTION {format.edition} -{ edition duplicate$ empty$ 'skip$ - { - output.state mid.sentence = - { "l" } - { "t" } - if$ change.case$ - "edition" bibinfo.check - " " * bbl.edition * - } - if$ -} -INTEGERS { multiresult } -FUNCTION {multi.page.check} -{ 't := - #0 'multiresult := - { multiresult not - t empty$ not - and - } - { t #1 #1 substring$ - duplicate$ "-" = - swap$ duplicate$ "," = - swap$ "+" = - or or - { #1 'multiresult := } - { t #2 global.max$ substring$ 't := } - if$ - } - while$ - multiresult -} -FUNCTION {format.pages} -{ pages duplicate$ empty$ 'skip$ - { duplicate$ multi.page.check - { - bbl.pages swap$ - n.dashify - } - { - bbl.page swap$ - } - if$ - tie.or.space.prefix - "pages" bibinfo.check - * * - } - if$ -} -FUNCTION {format.journal.pages} -{ pages duplicate$ empty$ 'pop$ - { swap$ duplicate$ empty$ - { pop$ pop$ format.pages } - { - ": " * - swap$ - n.dashify - "pages" bibinfo.check - * - } - if$ - } - if$ -} -FUNCTION {format.journal.eid} -{ eid "eid" bibinfo.check - duplicate$ empty$ 'pop$ - { swap$ duplicate$ empty$ 'skip$ - { - ": " * - } - if$ - swap$ * - } - if$ -} -FUNCTION {format.vol.num.pages} -{ volume field.or.null - duplicate$ empty$ 'skip$ - { - "volume" bibinfo.check - } - if$ -} - -FUNCTION {format.chapter.pages} -{ chapter empty$ - { "" } - { type empty$ - { bbl.chapter } - { type "l" change.case$ - "type" bibinfo.check - } - if$ - chapter tie.or.space.prefix - "chapter" bibinfo.check - * * - } - if$ -} - -FUNCTION {format.booktitle} -{ - booktitle "booktitle" bibinfo.check -} -FUNCTION {format.in.ed.booktitle} -{ format.booktitle duplicate$ empty$ 'skip$ - { - editor "editor" format.names.ed duplicate$ empty$ 'pop$ - { - "," * - " " * - get.bbl.editor - ", " * - * swap$ - * } - if$ - word.in swap$ * - } - if$ -} -FUNCTION {empty.misc.check} -{ author empty$ title empty$ howpublished empty$ - month empty$ year empty$ note empty$ - and and and and and - { "all relevant fields are empty in " cite$ * warning$ } - 'skip$ - if$ -} -FUNCTION {format.thesis.type} -{ type duplicate$ empty$ - 'pop$ - { swap$ pop$ - "t" change.case$ "type" bibinfo.check - } - if$ -} -FUNCTION {format.tr.number} -{ number "number" bibinfo.check - type duplicate$ empty$ - { pop$ bbl.techrep } - 'skip$ - if$ - "type" bibinfo.check - swap$ duplicate$ empty$ - { pop$ "t" change.case$ } - { tie.or.space.prefix * * } - if$ -} -FUNCTION {format.article.crossref} -{ - key duplicate$ empty$ - { pop$ - journal duplicate$ empty$ - { "need key or journal for " cite$ * " to crossref " * crossref * warning$ } - { "journal" bibinfo.check emphasize word.in swap$ * } - if$ - } - { word.in swap$ * " " *} - if$ - " \cite{" * crossref * "}" * -} -FUNCTION {format.crossref.editor} -{ editor #1 "{vv~}{ll}" format.name$ - "editor" bibinfo.check - editor num.names$ duplicate$ - #2 > - { pop$ - "editor" bibinfo.check - " " * bbl.etal - * - } - { #2 < - 'skip$ - { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = - { - "editor" bibinfo.check - " " * bbl.etal - * - } - { - bbl.and space.word - * editor #2 "{vv~}{ll}" format.name$ - "editor" bibinfo.check - * - } - if$ - } - if$ - } - if$ -} -FUNCTION {format.book.crossref} -{ volume duplicate$ empty$ - { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ - pop$ word.in - } - { bbl.volume - capitalize - swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * - } - if$ - editor empty$ - editor field.or.null author field.or.null = - or - { key empty$ - { series empty$ - { "need editor, key, or series for " cite$ * " to crossref " * - crossref * warning$ - "" * - } - { series emphasize * } - if$ - } - { key * } - if$ - } - { format.crossref.editor * } - if$ - " \cite{" * crossref * "}" * -} -FUNCTION {format.incoll.inproc.crossref} -{ - editor empty$ - editor field.or.null author field.or.null = - or - { key empty$ - { format.booktitle duplicate$ empty$ - { "need editor, key, or booktitle for " cite$ * " to crossref " * - crossref * warning$ - } - { word.in swap$ * } - if$ - } - { word.in key * " " *} - if$ - } - { word.in format.crossref.editor * " " *} - if$ - " \cite{" * crossref * "}" * -} -FUNCTION {format.org.or.pub} -{ 't := - "" - address empty$ t empty$ and - 'skip$ - { - address "address" bibinfo.check * - t empty$ - 'skip$ - { address empty$ - 'skip$ - { ": " * } - if$ - t * - } - if$ - } - if$ -} -FUNCTION {format.publisher.address} -{ publisher "publisher" bibinfo.warn format.org.or.pub -} - -FUNCTION {format.organization.address} -{ organization "organization" bibinfo.check format.org.or.pub -} - -FUNCTION {article} -{ output.bibitem - format.authors "author" output.check - format.date "year" output.check - date.block - format.title "title" output.check - new.block - crossref missing$ - { - journal - remove.dots - "journal" bibinfo.check - "journal" output.check - add.blank - format.vol.num.pages output - } - { format.article.crossref output.nonnull - } - if$ - eid empty$ - { format.journal.pages } - { format.journal.eid } - if$ -% format.doi output -% new.block -% format.url output -% new.block -% format.note output -% format.eprint output - fin.entry -} -FUNCTION {book} -{ output.bibitem - author empty$ - { format.editors "author and editor" output.check - } - { format.authors output.nonnull - crossref missing$ - { "author and editor" editor either.or.check } - 'skip$ - if$ - } - if$ - format.date "year" output.check - date.block - format.btitle "title" output.check - crossref missing$ - { format.bvolume output - new.block - format.number.series output - new.sentence - format.publisher.address output - } - { - new.block - format.book.crossref output.nonnull - } - if$ - format.edition output - format.book.pages output - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} -FUNCTION {booklet} -{ output.bibitem - format.authors output - format.date output - date.block - format.title "title" output.check - new.block - howpublished "howpublished" bibinfo.check output - address "address" bibinfo.check output - format.book.pages output - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} - -FUNCTION {inbook} -{ output.bibitem - author empty$ - { format.editors "author and editor" output.check - } - { format.authors output.nonnull - crossref missing$ - { "author and editor" editor either.or.check } - 'skip$ - if$ - } - if$ - format.date "year" output.check - date.block - format.btitle "title" output.check - crossref missing$ - { - format.publisher.address output - format.bvolume output - format.chapter.pages "chapter and pages" output.check - new.block - format.number.series output - new.sentence - } - { - format.chapter.pages "chapter and pages" output.check - new.block - format.book.crossref output.nonnull - } - if$ - format.edition output - format.pages "pages" output.check - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} - -FUNCTION {incollection} -{ output.bibitem - format.authors "author" output.check - format.date "year" output.check - date.block - format.title "title" output.check - new.block - crossref missing$ - { format.in.ed.booktitle "booktitle" output.check - format.publisher.address output - format.bvolume output - format.number.series output - format.chapter.pages output - new.sentence - format.edition output - } - { format.incoll.inproc.crossref output.nonnull - format.chapter.pages output - } - if$ - format.pages "pages" output.check - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} -FUNCTION {inproceedings} -{ output.bibitem - format.authors "author" output.check - format.date "year" output.check - date.block - format.title "title" output.check - new.block - crossref missing$ - { format.in.ed.booktitle "booktitle" output.check - new.sentence - publisher empty$ - { format.organization.address output } - { organization "organization" bibinfo.check output - format.publisher.address output - } - if$ - format.bvolume output - format.number.series output - } - { format.incoll.inproc.crossref output.nonnull - } - if$ - format.pages "pages" output.check - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} -FUNCTION {conference} { inproceedings } -FUNCTION {manual} -{ output.bibitem - author empty$ - { organization "organization" bibinfo.check - duplicate$ empty$ 'pop$ - { output - address "address" bibinfo.check output - } - if$ - } - { format.authors output.nonnull } - if$ - format.date output - date.block - format.btitle "title" output.check - author empty$ - { organization empty$ - { - address new.block.checka - address "address" bibinfo.check output - } - 'skip$ - if$ - } - { - organization address new.block.checkb - organization "organization" bibinfo.check output - address "address" bibinfo.check output - } - if$ - format.edition output - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} - -FUNCTION {mastersthesis} -{ output.bibitem - format.authors "author" output.check - format.date "year" output.check - date.block - format.btitle - "title" output.check - new.block - bbl.mthesis format.thesis.type output.nonnull - school "school" bibinfo.warn output - address "address" bibinfo.check output - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} - -FUNCTION {misc} -{ output.bibitem - format.authors output - format.date output - title howpublished new.block.checkb - format.title output - howpublished new.block.checka - howpublished "howpublished" bibinfo.check output - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry - empty.misc.check -} -FUNCTION {phdthesis} -{ output.bibitem - format.authors "author" output.check - format.date "year" output.check - date.block - format.btitle - "title" output.check - new.block - bbl.phdthesis format.thesis.type output.nonnull - school "school" bibinfo.warn output - address "address" bibinfo.check output - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} - -FUNCTION {proceedings} -{ output.bibitem - editor empty$ - { organization "organization" bibinfo.check output - } - { format.editors output.nonnull } - if$ - format.date "year" output.check - date.block - format.btitle "title" output.check - format.bvolume output - format.number.series output - editor empty$ - { publisher empty$ - 'skip$ - { - new.sentence - format.publisher.address output - } - if$ - } - { publisher empty$ - { - new.sentence - format.organization.address output } - { - new.sentence - organization "organization" bibinfo.check output - format.publisher.address output - } - if$ - } - if$ - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} - -FUNCTION {techreport} -{ output.bibitem - format.authors "author" output.check - format.date "year" output.check - date.block - format.title - "title" output.check - new.block - format.tr.number output.nonnull - institution "institution" bibinfo.warn output - address "address" bibinfo.check output - format.doi output - new.block - format.url output - new.block - format.note output - format.eprint output - fin.entry -} - -FUNCTION {unpublished} -{ output.bibitem - format.authors "author" output.check - format.date output - date.block - format.title "title" output.check - format.doi output - new.block - format.url output - new.block - format.note "note" output.check - format.eprint output - fin.entry -} - -FUNCTION {default.type} { misc } -READ -STRINGS { longest.label } -INTEGERS { number.label longest.label.width } -FUNCTION {initialize.longest.label} -{ "" 'longest.label := - #1 'number.label := - #0 'longest.label.width := -} -FUNCTION {longest.label.pass} -{ number.label int.to.str$ 'label := - number.label #1 + 'number.label := - label width$ longest.label.width > - { label 'longest.label := - label width$ 'longest.label.width := - } - 'skip$ - if$ -} -EXECUTE {initialize.longest.label} -ITERATE {longest.label.pass} -FUNCTION {begin.bib} -{ preamble$ empty$ - 'skip$ - { preamble$ write$ newline$ } - if$ - "\begin{thebibliography}{" longest.label * "}" * - write$ newline$ - "\providecommand{\url}[1]{\texttt{#1}}" - write$ newline$ - "\providecommand{\urlprefix}{URL }" - write$ newline$ - "\expandafter\ifx\csname urlstyle\endcsname\relax" - write$ newline$ - " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else" - write$ newline$ - " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" - write$ newline$ - "\providecommand{\bibAnnoteFile}[1]{%" - write$ newline$ - " \IfFileExists{#1}{\begin{quotation}\noindent\textsc{Key:} #1\\" - write$ newline$ - " \textsc{Annotation:}\ \input{#1}\end{quotation}}{}}" - write$ newline$ - "\providecommand{\bibAnnote}[2]{%" - write$ newline$ - " \begin{quotation}\noindent\textsc{Key:} #1\\" - write$ newline$ - " \textsc{Annotation:}\ #2\end{quotation}}" - write$ newline$ - "\providecommand{\eprint}[2][]{\url{#2}}" - write$ newline$ -} -EXECUTE {begin.bib} -EXECUTE {init.state.consts} -ITERATE {call.type$} -FUNCTION {end.bib} -{ newline$ - "\end{thebibliography}" write$ newline$ -} -EXECUTE {end.bib} -%% End of customized bst file -%% -%% End of file `PLoS.bst'. diff --git a/inst/rmarkdown/templates/plos_article/skeleton/plos.csl b/inst/rmarkdown/templates/plos_article/skeleton/plos.csl deleted file mode 100644 index d0c4cadcc..000000000 --- a/inst/rmarkdown/templates/plos_article/skeleton/plos.csl +++ /dev/null @@ -1,150 +0,0 @@ - - diff --git a/inst/rmarkdown/templates/plos_article/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/plos_article/skeleton/skeleton.Rmd deleted file mode 100644 index 3f0ec1cf0..000000000 --- a/inst/rmarkdown/templates/plos_article/skeleton/skeleton.Rmd +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: - # Title must be 150 characters or less - "A Capitalized Title: Something about a great Discovery" -author: - - name: FirstName LastName - affiliation: '1,2' - # If corresponding author (only one corresponding author per manuscript) - email: name@company.com - - name: Second Author - affiliation: '3' -affiliation: - - id: '1' - department: Dept/Program/Center - institution: Institution Name - city: City - state: State - country: Country - - id: '2' - department: Dept/Program/Center - institution: Institution Name - city: City - state: State - country: Country - - id: '3' - department: Dept/Program/Center - institution: Institution Name - city: City - state: State - country: Country -output: rticles::plos_article -csl: plos.csl -bibliography: library.bib ---- - -# Abstract {-} -Please keep the abstract between 250 and 300 words - -# Author summary {-} -Please keep the Author Summary between 150 and 200 words Use first person. PLoS -ONE authors please skip this step. Author Summary not valid for PLoS ONE -submissions. - -# Introduction {-} -Cite fancy references [@Garnier2007]. - -# Results {-} -Results and Discussion can be combined. - -## Subsection 1 {-} -You can use R chunks directly to plot graphs. - -```{r, graph, echo=TRUE, message=FALSE, fig.height=4, fig.width=4, fig.align='center', fig.cap='Figure caption'} -require("ggplot2") -x <- 0:100 -y <- 2 * (x + rnorm(length(x), sd = 3) + 3) -ggplot(data = data.frame(x, y), - aes(x = x, y = y)) + - geom_point() + - geom_smooth(method = "lm") -``` - -## Subsection 2 {-} - -# Discussion {-} - -# Material and Methods {-} -You may title this section "Methods" or "Models". "Models" is not a valid title -for PLoS ONE authors. However, PLoS ONE authors may use "Analysis" - -# Acknowledgments {-} -Do NOT remove this, even if you are not including acknowledgments - -# References {-} -A reference list should be automatically created here. However it won't. Pandoc -will place the list of references at the end of the document instead. There are -no convenient solution for now to force Pandoc to do otherwise. The easiest way -to get around this problem is to edit the LaTeX file created by Pandoc before -compiling it again using the traditional LaTeX commands. - -# Figure Legends {-} - -# Tables {-} diff --git a/inst/rmarkdown/templates/plos_article/template.yaml b/inst/rmarkdown/templates/plos_article/template.yaml deleted file mode 100644 index a2d4cddba..000000000 --- a/inst/rmarkdown/templates/plos_article/template.yaml +++ /dev/null @@ -1,4 +0,0 @@ -name: PLoS Computational Biology -description: > - Template for creating an article for submission to PLoS Computational Biology. -create_dir: true diff --git a/inst/rmarkdown/templates/tufte_ebook/resources/tufte-ebook.tex b/inst/rmarkdown/templates/tufte_ebook/resources/tufte-ebook.tex deleted file mode 100644 index 0ebfa8918..000000000 --- a/inst/rmarkdown/templates/tufte_ebook/resources/tufte-ebook.tex +++ /dev/null @@ -1,208 +0,0 @@ -\documentclass[$if(lang)$$lang$,$endif$$if(citecolor)$$citecolor$,$endif$$if(urlcolor)$$urlcolor$,$endif$$if(linkcolor)$$linkcolor$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{tufte-ebook} - -\hypersetup{colorlinks, - citecolor=$if(citecolor)$$citecolor$$else$DarkGreen$endif$, - urlcolor=$if(urlcolor)$$urlcolor$$else$DarkGreen$endif$, - linkcolor=$if(linkcolor)$$linkcolor$$else$DarkBlue$endif$, -} - -% ams -\usepackage{amssymb,amsmath} - -\usepackage{ifxetex,ifluatex} -\usepackage{fixltx2e} % provides \textsubscript - -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - \usepackage[T1]{fontenc} - \usepackage[utf8]{inputenc} -\else - \usepackage{fontspec} -\fi - -% multi-language settings -$if(lang)$ -\ifxetex - \usepackage{polyglossia} - \setmainlanguage{$mainlang$} -\else - \usepackage[shorthands=off,$lang$]{babel} -\fi -$endif$ - - -% graphix -\usepackage{graphicx} -\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} - -% booktabs -\usepackage{booktabs} - -% url -\usepackage{url} - -% hyperref -\usepackage{hyperref} - -% units. -\usepackage{units} - -% pandoc syntax highlighting -$if(highlighting-macros)$ -$highlighting-macros$ -$endif$ - -% longtable -$if(tables)$ -\usepackage{longtable,booktabs} -$endif$ - -% landscape moce -\usepackage{lscape} - -% multiplecol -\usepackage{multicol} - -% lipsum -\usepackage{lipsum} - -% strikeout -\usepackage[normalem]{ulem} - -% morefloats -\usepackage{morefloats} - -\usepackage{fancyvrb} % extended verbatim environments -\fvset{fontsize=\normalsize}% default font size for fancy-verbatim environments - -%% -% If they're installed, use Bergamo and Chantilly from www.fontsite.com. -% They're clones of Bembo and Gill Sans, respectively. -\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo -\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans - - -% Standardize command font styles and environments -\newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically -\newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument -\newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument -\newcommand{\docenv}[1]{\textsf{#1}}% environment name -\newcommand{\docpkg}[1]{\texttt{#1}}% package name -\newcommand{\doccls}[1]{\texttt{#1}}% document class name -\newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name -\newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment - -%% -% Prints argument within hanging parentheses (i.e., parentheses that take -% up no horizontal space). Useful in tabular environments. -\newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}} - -%% -% Prints an asterisk that takes up no horizontal space. -% Useful in tabular environments. -\newcommand{\hangstar}{\makebox[0pt][l]{*}} - -%% -% Prints a trailing space in a smart way. -\usepackage{xspace} - -% Prints an epigraph and speaker in sans serif, all-caps type. -\newcommand{\openepigraph}[2]{% -%\sffamily\fontsize{14}{16}\selectfont -\begin{fullwidth} -\sffamily\large -\begin{doublespace} -\noindent\allcaps{#1}\\% epigraph -\noindent\allcaps{#2}% author -\end{doublespace} -\end{fullwidth} -} - -\providecommand{\tightlist}{% - \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} - -$if(numbersections)$ -\setcounter{secnumdepth}{5} -$else$ -\setcounter{secnumdepth}{0} -$endif$ - -% Inserts a blank page -\newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage} - - -% title / author / date -$if(title)$ -\title{$title$} -$endif$ -$if(author)$ -\author{$for(author)$$author$$sep$ \and $endfor$} -$endif$ -$if(date)$ -\date{$date$} -$endif$ - -$for(header-includes)$ -$header-includes$ -$endfor$ - -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex -% -\else -% work around bug with interaction between a package and luatex/xetex, without using the NOLS option above - \renewcommand{\allcapsspacing}[1]{{\addfontfeature{LetterSpace=20.0}#1}} - \renewcommand{\smallcapsspacing}[1]{{\addfontfeature{LetterSpace=5.0}#1}} - \renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}} - \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}} -\fi - - -% Generates the index -\usepackage{makeidx} -\makeindex - -\begin{document} - -$if(title)$ -\maketitle -$endif$ - -$if(abstract)$ -\begin{abstract} -\noindent $abstract$ -\end{abstract} -$endif$ - -$for(include-before)$ -$include-before$ -$endfor$ - -$if(toc)$ -\setcounter{tocdepth}{$toc-depth$} -\tableofcontents -$endif$ - -$body$ - - - -\begin{fullwidth} -\begin{multicols}{2} - -\backmatter -$if(lof)$ -\listoffigures -$endif$ -$if(lot)$ -\listoftables -$endif$ - -\printindex - -\end{multicols} -\end{fullwidth} - -$for(include-after)$ -$include-after$ -$endfor$ - -\end{document} diff --git a/inst/rmarkdown/templates/tufte_ebook/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/tufte_ebook/skeleton/skeleton.Rmd deleted file mode 100644 index d214a516e..000000000 --- a/inst/rmarkdown/templates/tufte_ebook/skeleton/skeleton.Rmd +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: "Tufte e-Book" -author: "John Smith" -date: "February 8, 2015" -bibliography: "knitcitations.bib" -classoption: oneside -output: - rticles::tufte_ebook: - toc: true - latex_engine: xelatex - toc_depth: 3 - number_sections: true - keep_tex: true ---- - -```{r setup,echo=FALSE,message=FALSE,cache=FALSE,include=TRUE} -# Its a good idea to start any rmarkdown document with a block like this one to set knit defaults, setup the bibliography, and so forth. -library(knitcitations) -library(knitr) -library(xtable) -library(ggplot2) -library(pander) -cite_options( - citation_format = "pandoc", - style="citation" - ) - -options(xtable.comment = FALSE) -options(xtable.booktabs = TRUE) - -# This is also a good place to setup any ggplot2 themes for the document using ggplot2::theme_set() -``` - -\clearpage - -\openepigraph{Sometimes epigraphs look cool.}{-Apocryphal} - -\phantomsection -\section*{Introduction} -\addcontentsline{toc}{section}{Introduction} - -The Tufte-\LaTeX\ document classes define a style similar to the style Edward Tufte uses in his books and handouts. Tufte’s style is known for its extensive use of sidenotes, tight integration of graphics with text, and well-set typography.[^tufte_latex] - -This template is adapted from the Tufte-book class. It has modifications intended to make it both more flexible and more consistent with expectations from `rmarkdown`. Some of those modifications are inconsistent with Tufte's style, in that the template will allow you to make documents more visually complex than Tufte would probably advise. - -This skeleton presents an overview of the key Tufte e-Book capabilities, and examples of some of R packages that can be used with the template for pretty printing. - -\phantomsection -\section*{Known Bug} -\addcontentsline{toc}{section}{Known Bug} - -If you choose LuaTeX as your TeX engine, character spacing will be wrong on the title page and page headers. This is related to a known-bug in a LaTeX package that has existed for at least four years. We workaround that bug for XeTeX, but have not found a solution for LuaTeX. Please don't report this to Rstudio or on the git as a bug. Feel free to discuss it here, though: https://code.google.com/p/tufte-latex/issues/detail?id=45. And do feel free to make a pull request if you have a workaround. - -For most uses, pdfTeX is fine anyway, and XeTeX better. If tikZ is running out of memory, then consider switching to LuaTeX. The default engine for this template is XeTeX. - -\phantomsection -\section*{Getting Help} -\addcontentsline{toc}{section}{Getting Help} - -The Tufte \LaTeX\ classes produce sophisticated \LaTeX\. If you see errors compiling the \LaTeX\, try using the `keep_tex:` option and examining the result. Because these are \TeX\ issues and not R or rmarkdown issues, you will probably find an answer more quickly by seeking help from the \TeX\ message boards. - -\part{The party of the first part} - -Books can have more than one Part. - -\chapter{A Chapter About Headings} - -And many chapters - -# This is a section heading - -This style provides a-, b-, c- and d-heads (that is, `#`, `##`, `###`, and `####`). - -## This is a subsection heading - -Isn't that pretty? - -### This is a subsubsection heading - -Some people feel these are ~~unnecessary, but some of those are the same people who don't like struck-out text~~. - -#### This is a paragraph heading. - -Don't look bad, do they? - - -\newthought{In his later books}, Tufte starts each section with a bit of vertical space, a non-indented paragraph, and sets the first few words of the sentence in small caps. To accomplish this using this style, use the `\newthought` command as demonstrated at the beginning of this paragraph.[^books_be] - -\chapter{A Chapter About Class Options, Figures, Equations, and Tables} - -# Options and Class Options - -The Tufte e-Book template supports a number of `classoptions` that can be set in the `rmarkdown` `YAML` header. (See http://rmarkdown.rstudio.com/pdf_document_format.html#latex-options.) These include: - -* `twoside`/`oneside`: Whether to alternate the running header. -* `symmetric`: Place margin notes and figures on the left side for left pages. -* `a4paper`/`b5paper`: Self-explanatory. -* `titlepage`/`notitlepage`: Self-explanatory. -* `sfsidenotes`: Sans-serif font for margin notes and captions. -* `justified`: Fully justify text. -* `fonts`/`nofonts`: Whether to load fonts. Either way, the class will not honor the rmarkdown font-selection options. If you can get them to work, please let us know. -* `ls`/`nols`: Whether to configure letterspacing. -* `nobib`: Don't load natbib. -* `notoc`: Use a normal, rather than Tufte-style, table of contents. -* `bidi`: Load the bidi package for bi-directional text. - -Tufte e-Book also supports the `citecolor`, `urlcolor`, and `linkcolor` options. - -# Figures - -None of the figures in this book were made using the **tikzDevice** R package, which would automagically match the font styles in the figures with those in the rest of the document. The plots themselves tend to be slightly more elegant. `CairoPDF` and, on Mac OS X, `QuartzPDF`, are good alterntives if you can't use tikz for some reason. - -## Margin Figures - -Images and graphics play an integral role in Tufte's work. To place figures or tables in the margin you can use the `fig.margin` knitr chunk option. For example: - -```{r, fig.margin = TRUE, fig.cap = "Sepal length vs. petal length, colored by species"} -library(ggplot2) -qplot(Sepal.Length, Petal.Length, data = iris, color = Species) -``` - -Note the use of the `fig.cap` chunk option to provide a figure caption. You can adjust the proportions of figures using the `fig.width` and `fig.height` chunk options. These are specified in inches, and will be automatically scaled down to fit within the handout margin. - -## Equations - -You can also include \LaTeX\ equations in the margin by explicitly invoking the `marginfigure` environment. - -\begin{marginfigure} -$$\frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x).$$ -\caption{An equation} -\end{marginfigure} - -Note the use of the `\caption` command to add additional text below the equation. - -## Full Width Figures - -You can arrange for figures to span across the entire page by using the `fig.fullwidth` chunk option. - -```{r, fig.width = 10, fig.height = 2, fig.fullwidth = TRUE, fig.cap = "Full width figure"} -qplot(wt, mpg, data=mtcars, colour=factor(cyl)) -``` - -Note the use of the `fig.width` and `fig.height` chunk options to establish the proportions of the figure. Full width figures look much better if their height is minimized. - -## Main Column Figures - -Besides margin and full width figures, you can of course also include figures constrained to the main column. - -```{r, fig.cap = "Another figure"} -qplot(factor(cyl), mpg, data = mtcars, geom = "boxplot") -``` - -# Sidenotes - -One of the most prominent and distinctive features of this style is the extensive use of sidenotes. There is a wide margin to provide ample room for sidenotes and small figures. Any use of a footnote will automatically be converted to a sidenote. ^[This is a sidenote that was entered using a footnote.] - -If you'd like to place ancillary information in the margin without the sidenote mark (the superscript number), you can use the `\marginnote` command. \marginnote{This is a margin note. Notice that there isn't a number preceding the note.} - -Note also that the two footnote references (`tufte_latex` and `books_be`, both defined below) were also included in the margin on the first page of this document. Another way of doing things, which will be explained below, is to use a citation management package to keep track of citations. - -# Tables - -## xtable - -You can use the **xtable** package to format \LaTeX\ tables that integrate well with the rest of the document. Note that it's important to set the `xtable.comment` and `xtable.booktabs` options to ensure the table is formatted correctly for inclusion in the document. - -```{r, results='asis'} -xtable(head(mtcars[,1:6]), - caption = "xtable, first rows of mtcars") -``` - -## Margin Tables - -You can also create margin tables using the **xtable** package together with the **kable** function in the **knitr** package. - -Margin tables, like some of the other formatting elements discussed below, can be very picky about their contents. If you see errors when you try to compile \TeX\ to pdf, margin tables are a likely culprit. - -\begin{margintable} -```{r amargintable,results='latex',echo=FALSE} -frm <- data.frame(a = c(1,2,3), - b = c("a","b", "c")) -kable(xtable(table(frm)), - format = "latex") -``` -\caption{Margin tables captions are defined in latex, not in arguments to the table-making function} -\end{margintable} - -## papeR - -Another package with pretty printing features is **papeR**, which has methods for `anova`, `summary`, and a number of other R classes. Unfortunately **papeR** is no longer on CRAN, so you'll have to explore it yourself. - -## pander - -`pander` is another pretty printing package. `pander` has functions creating a variety of `rmarkdown`-compatible markup.^[`r citep(citation("pander"))`] - -Pander's pretty printing functions let you emphasize cells, rows, and columns with italic and bold type. - -```{r pandocDemo2,results='asis'} -emphasize.rows(2) -emphasize.strong.cols(3) -pander(head(mtcars[,1:5]), - caption="pander, first rows of mtcars") -``` - - -## kable - -`knitr` itself has a `kable` function. Like `xtable`, `kable` will escape special \LaTeX\ characters. `kable` also lets you give tables labels for cross-referencing.^[`r citep(citation("xtable"))`; `r citep(citation("knitr"))`] - -```{r kable,results='asis'} -kable(head(mtcars[,1:5]), - caption = "kable, first rows of mtcars") -``` - -\chapter{A Chapter About Columns, Full Width Text, and Landscape Mode.} - -# Columns - -There are many ways to make columns. The one built into the Tufte-Book class is called `multicol`.^[`r citep("http://ctan.mirrorcatalogs.com/macros/latex/required/tools/multicol.pdf")`. For other ways to make columns see http://wiki.contextgarden.net/Columns.] - -\begin{multicols}{2} - -Some things don't work inside of columns, or other environments like margin notes and margin tables. That's why the citations are in the main text and not in columns. - -\columnbreak - -I could have made that first column of text flow into this one, but instead I used a column break. - -\end{multicols} - -\clearpage - - - -\section{Fullwidth and Landscape} - -\begin{fullwidth} - -Its easy to get a portion of the text to use the full width of a page. \LaTeX\ can be touchy though. I couldn't use the `\#` markdown for the section heading above. Or put the `pander` table in fullwidth. - -In fact, backtics don't work at all. - -xtable will print full-width though. - -\vspace{10mm} - -```{r fullwidthxtable,results='asis',echo=FALSE} -mtcar2 <- cbind(mtcars, mtcars) -print(xtable(mtcar2[1:6,1:11])) -``` - -If you try to include a caption it will print over part of the table. Let me know if you find a way to fix that. - -\clearpage - - -\begin{landscape} - -Part of a document can also be in landscape. This can also be useful for wide tables. - -\end{landscape} -\end{fullwidth} - - -\clearpage - -[^tufte_latex]: https://code.google.com/p/tufte-latex/ -[^books_be]: http://www.edwardtufte.com/tufte/books_be - -\phantomsection -\addcontentsline{toc}{chapter}{Indices} -\chapter*{Indices} - -You can insert lists of tables and figures in your document. - -All of the indicies, bibliography, and footnotes get hyperlinked together automagically. If you look in the source, you'll see how these were added to the toc. - -\phantomsection -\addcontentsline{toc}{section}{List of Figures} -\listoffigures - -\phantomsection -\addcontentsline{toc}{section}{List of Tables} -\listoftables - -\clearpage - -\phantomsection -\addcontentsline{toc}{section}{Bibliography} -\section*{Bibliography} - -Including a bibliography is a 3-step process. *First*, using the **RefManageR** and **knitcitations** packages, liberally sprinkle your text with inline R calls to knitcitation's `citep()` or `citet()` functions. `r citep(citation("knitcitations"))`; `r citep(citation("RefManageR"))`. *Second*, at the end of your document, include an R block that calls the function `write.bibtex()`. `r write.bibtex(file="knitcitations.bib", append=FALSE,biblatex=TRUE)` That will write a bibtex file containing your citations to disk. *Third*, in the yaml header, include a `bibliography` line pointing to the `.bib` file produced by `write.bibtex()`. - -Use the `\vspace` command to insert blank vertical spaces, like the one separating this line from the bibliography. - -\vspace{10mm} - - - diff --git a/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte-common.def b/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte-common.def deleted file mode 100644 index 559b01a3a..000000000 --- a/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte-common.def +++ /dev/null @@ -1,2007 +0,0 @@ -%% -%% This file contains the code that is common to the Tufte-LaTeX document classes. -%% - -\ProvidesFile{tufte-common.def}[2011/06/18 v3.5.2 Common code for the Tufte-LaTeX styles] - -%% -% The `xkeyval' package simplifies the user interface for the document class options -\RequirePackage{xkeyval} - -%% -% We use the `xifthen' package to handle our package option switches -\RequirePackage{xifthen} - -%% -% Define some shortcut macros for error/warning/info logging. -\RequirePackage{hardwrap} -\GenerateClassLogMacros[@tufte]{\@tufte@pkgname} -\newcommand{\@tufte@debug@info}[1]{\ifthenelse{\boolean{@tufte@debug}}{\@tufte@info{#1}}{}} -\newcommand{\@tufte@debug@info@noline}[1]{\ifthenelse{\boolean{@tufte@debug}}{\@tufte@info@noline{#1}}{}} - -%% -% `debug' option -- provides more information in the .log file for use in -% troubleshooting problems -\newboolean{@tufte@debug} -\DeclareOptionX[tufte]{debug}{\setboolean{@tufte@debug}{true}} - -%% -% `nofonts' option -- doesn't load any fonts -% `fonts' option -- tries to load fonts -\newboolean{@tufte@loadfonts}\setboolean{@tufte@loadfonts}{true} -\DeclareOptionX[tufte]{fonts}{\setboolean{@tufte@loadfonts}{true}} -\DeclareOptionX[tufte]{nofonts}{\setboolean{@tufte@loadfonts}{false}} - -%% -% `nols' option -- doesn't configure letterspacing -% `ls' option -- configures letterspacing -\newboolean{@tufte@letterspace}\setboolean{@tufte@letterspace}{true} -\DeclareOptionX[tufte]{ls}{\setboolean{@tufte@letterspace}{true}} -\DeclareOptionX[tufte]{nols}{\setboolean{@tufte@letterspace}{false}} - -%% -% `nobib' option -- doesn't load natbib or adjust the \cite command -\newboolean{@tufte@loadnatbib}\setboolean{@tufte@loadnatbib}{true} -\DeclareOptionX[tufte]{nobib}{\setboolean{@tufte@loadnatbib}{false}} - -%% -% `titlepage' option -- creates a full title page with \maketitle - -\newboolean{@tufte@titlepage} -\DeclareOptionX[tufte]{titlepage}{\setboolean{@tufte@titlepage}{true}} -\DeclareOptionX[tufte]{notitlepage}{\setboolean{@tufte@titlepage}{false}} - -%% -% `a4paper' option - -\newboolean{@tufte@afourpaper} -\DeclareOptionX[tufte]{a4paper}{\setboolean{@tufte@afourpaper}{true}} - -%% -% `b5paper' option - -\newboolean{@tufte@bfivepaper} -\DeclareOptionX[tufte]{b5paper}{\setboolean{@tufte@bfivepaper}{true}} - -%% -% `sfsidenotes' option -- typesets sidenotes in sans serif typeface - -\newboolean{@tufte@sfsidenotes} -\DeclareOptionX[tufte]{sfsidenotes}{\setboolean{@tufte@sfsidenotes}{true}} - -%% -% `symmetric' option -- puts marginpar space to the outside edge of the page -% Note: this option forces the twoside option (see the .cls files) - -\newboolean{@tufte@symmetric} -\DeclareOptionX[tufte]{symmetric}{ - \setboolean{@tufte@symmetric}{true} - \@tufte@info@noline{The `symmetric' option implies `twoside'} - \ExecuteOptionsX[tufte]{twoside} -} - -%% -% `twoside' option -- alternates running heads - -\newboolean{@tufte@twoside} -\DeclareOptionX[tufte]{twoside}{% - \setboolean{@tufte@twoside}{true} - \@tufte@info@noline{Passing the `twoside' option to the `\@tufte@class' class} - \PassOptionsToClass{twoside}{\@tufte@class} -} - -%% -% `notoc' option -- suppresses the Tufte-style table of contents - -\newboolean{@tufte@toc} -\setboolean{@tufte@toc}{true} -\DeclareOptionX[tufte]{notoc}{\setboolean{@tufte@toc}{false}} -\DeclareOptionX[tufte]{toc}{\setboolean{@tufte@toc}{true}} - -%% -% `justified' option -- uses fully justified text (flush left and flush -% right) instead of ragged right. - -\newboolean{@tufte@justified} -\DeclareOptionX[tufte]{justified}{\setboolean{@tufte@justified}{true}} - -%% -% `bidi' option -- loads the bidi package for bi-directional text - -\newboolean{@tufte@loadbidi} -\DeclareOptionX[tufte]{bidi}{\setboolean{@tufte@loadbidi}{true}} -\DeclareOptionX[tufte]{nobidi}{\setboolean{@tufte@loadbidi}{false}} - -%% -% `nohyper' option -- suppresses loading of the hyperref package - -\newboolean{@tufte@loadhyper} -\setboolean{@tufte@loadhyper}{true} -\DeclareOptionX[tufte]{hyper}{\setboolean{@tufte@loadhyper}{true}} -\DeclareOptionX[tufte]{nohyper}{\setboolean{@tufte@loadhyper}{false}} - -%% -% `sidenote', `marginnote', `caption', `citation', `marginals' options -% Each allows one of {justified,raggedleft,raggedright,raggedouter,auto}. - -\newcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect} -\define@choicekey*+[tufte]{common}{sidenote}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% - \ifcase\@tufte@kvnum\relax - \renewcommand*{\@tufte@sidenote@justification}{\justifying}% justified - \or - \renewcommand*{\@tufte@sidenote@justification}{\RaggedLeft}% ragged left - \or - \renewcommand*{\@tufte@sidenote@justification}{\RaggedRight}% ragged right - \or - \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) - \or - \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options - \fi -}{% - \@tufte@warning@noline{Invalid option `#1' for sidenote key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} - \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options -} - -\newcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect} -\define@choicekey*+[tufte]{common}{marginnote}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% - \ifcase\@tufte@kvnum\relax - \renewcommand*{\@tufte@marginnote@justification}{\justifying}% justified - \or - \renewcommand*{\@tufte@marginnote@justification}{\RaggedLeft}% ragged left - \or - \renewcommand*{\@tufte@marginnote@justification}{\RaggedRight}% ragged right - \or - \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) - \or - \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options - \fi -}{% - \@tufte@warning@noline{Invalid option `#1' for marginnote key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} - \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options -} - -\newcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect} -\define@choicekey*+[tufte]{common}{caption}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% - \ifcase\@tufte@kvnum\relax - \renewcommand*{\@tufte@caption@justification}{\justifying}% justified - \or - \renewcommand*{\@tufte@caption@justification}{\RaggedLeft}% ragged left - \or - \renewcommand*{\@tufte@caption@justification}{\RaggedRight}% ragged right - \or - \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@caption@outer}% ragged outer (flush right on verso pages, flush left on recto pages) - \or - \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options - \fi -}{% - \@tufte@warning@noline{Invalid option `#1' for caption key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} - \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options -} - -\newcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect} -\define@choicekey*+[tufte]{common}{citation}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% - \ifcase\@tufte@kvnum\relax - \renewcommand*{\@tufte@citation@justification}{\justifying}% justified - \or - \renewcommand*{\@tufte@citation@justification}{\RaggedLeft}% ragged left - \or - \renewcommand*{\@tufte@citation@justification}{\RaggedRight}% ragged right - \or - \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) - \or - \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options - \fi -}{% - \@tufte@warning@noline{Invalid option `#1' for citation key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} - \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options -} - -% The ``marginals'' key simultaneously sets the same justification for all marginal material -\define@choicekey*+[tufte]{common}{marginals}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% - \ifcase\@tufte@kvnum\relax - \ExecuteOptionsX[tufte]{citation=justified,sidenote=justified,caption=justified,marginnote=justified}% justified - \or - \ExecuteOptionsX[tufte]{citation=raggedleft,sidenote=raggedleft,caption=raggedleft,marginnote=raggedleft}% ragged left - \or - \ExecuteOptionsX[tufte]{citation=raggedright,sidenote=raggedright,caption=raggedright,marginnote=raggedright}% ragged right - \or - \ExecuteOptionsX[tufte]{citation=raggedouter,sidenote=raggedouter,caption=raggedouter,marginnote=raggedouter}% ragged outer (flush right on verso pages, flush left on recto pages) - \or - \ExecuteOptionsX[tufte]{citation=auto,sidenote=auto,caption=auto,marginnote=auto}% autodetects best justification mode based on all class options - \fi -}{% - \@tufte@warning@noline{Invalid option `#1' for marginals key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} - \ExecuteOptionsX[tufte]{citation=auto,sidenote=auto,caption=auto,marginnote=auto}% autodetects best justification mode based on all class options -} - - -%% -% Unsupported options - -\newcommand{\@tufte@unsupported@option}[1]{\@tufte@warning@noline{Option `#1' is not supported -- ignoring option}\OptionNotUsed} - -\DeclareOptionX[tufte]{10pt}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{11pt}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{12pt}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{a5paper}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{executivepaper}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{legalpaper}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{landscape}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{onecolumn}{\@tufte@unsupported@option{\CurrentOption}} -\DeclareOptionX[tufte]{twocolumn}{\@tufte@unsupported@option{\CurrentOption}} - -\DeclareOptionX*{% - \@tufte@info@noline{Passing \CurrentOption\space to the `\@tufte@class' class.}% - \PassOptionsToClass{\CurrentOption}{\@tufte@class}% -} -\ProcessOptionsX*[tufte]\relax - -%% -% Load the appropriate base class -\@tufte@info@noline{Loading the base class `\@tufte@class'} -\LoadClass{\@tufte@class} - -%% -% Detect whether we're in two-side mode or not. (Used to set up running -% heads later.) - -\ifthenelse{\boolean{@twoside}} - {\setboolean{@tufte@twoside}{true}} - {} - - - -%% -% Detect if we're using pdfLaTeX - -\newboolean{@tufte@pdf} -\IfFileExists{ifpdf.sty}{% - \RequirePackage{ifpdf} - \ifthenelse{\boolean{pdf}} - {\setboolean{@tufte@pdf}{true}} - {\setboolean{@tufte@pdf}{false}} -}{% assume we're not using pdfTex? - \setboolean{@tufte@pdf}{false} -} - -%% -% Detect if we're using XeLaTeX - -\newboolean{@tufte@xetex} -\IfFileExists{ifxetex.sty}{% - \RequirePackage{ifxetex} - \ifthenelse{\boolean{xetex}} - {\setboolean{@tufte@xetex}{true}} - {\setboolean{@tufte@xetex}{false}} -}{% not using xelatex - \setboolean{@tufte@xetex}{false} -} - -\ifthenelse{\boolean{@tufte@xetex}}{% - \RequirePackage{xltxtra}% xltxtra loads xunicode and fontspec; must be loaded before bidi -}{} - -%% -% Detect if we're using LuaTeX - -\newboolean{@tufte@luatex} -\IfFileExists{ifluatex.sty}{% - \RequirePackage{ifluatex} - \ifthenelse{\boolean{luatex}} - {\setboolean{@tufte@luatex}{true}} - {\setboolean{@tufte@luatex}{false}} -}{% not using luatex - \setboolean{@tufte@luatex}{false} -} - -\ifthenelse{\boolean{@tufte@luatex}}{% - \RequirePackage{fontspec} - \RequirePackage[osf,sc]{mathpazo} - \setmainfont[Renderer=Basic, Numbers=OldStyle, Scale = 1.0]{TeX Gyre Pagella} - \setsansfont[Renderer=Basic, Scale=0.90]{TeX Gyre Heros} - \setmonofont[Renderer=Basic]{TeX Gyre Cursor} -}{} - -%% -% Globally sets the length - -\newcommand*{\gsetlength}[2]{% - \setlength{#1}{#2}% - \global#1=#1\relax% -} - -%% -% Globally sets a boolean - -\newcommand*{\gsetboolean}[2]{% based on code from ifthen pkg - \lowercase{\def\@tempa{#2}}% - \@ifundefined{@tempswa\@tempa}% - {\PackageError{ifthen}{You can only set a boolean to `true' or `false'}\@ehc}% - {\@ifundefined{#1\@tempa}% - {\PackageError{ifthen}{Boolean #1 undefined}\@ehc}% - {\global\csname#1\@tempa\endcsname}% - }% -} - -%% -% The titlesec and titletoc packages are used to change the style of the -% section headings. These packages should be loaded before the hyperref -% package. - -\RequirePackage{titlesec,titletoc} - -%% -% Color - load before hypersetup -\RequirePackage[usenames,dvipsnames,svgnames]{xcolor}% load before bidi - -%%% -%% Loads the hyperref package and sets some default options. - -\newcommand{\TufteLoadHyperref}{% - \ifthenelse{\boolean{@tufte@xetex}} - {\RequirePackage[unicode,hyperfootnotes=false,xetex]{hyperref}} - {\RequirePackage[unicode,hyperfootnotes=false]{hyperref}} - \hypersetup{% - pdfborder = {0 0 0}, - bookmarksdepth = section, - }% -} - -%%% -%% Load the `hyperref' package. - -\ifthenelse{\boolean{@tufte@loadhyper}}{% - \TufteLoadHyperref% -}{% hyperfootnotes override our modifications to the \footnote* and \@footnote* commands. - \PassOptionsToPackage{hyperfootnotes=false}{hyperref} -} - -%% -% Set the font sizes and baselines to match Tufte's books -\renewcommand\normalsize{% - \@setfontsize\normalsize\@xpt{14}% - \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ - \abovedisplayshortskip \z@ \@plus3\p@ - \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ - \belowdisplayskip \abovedisplayskip - \let\@listi\@listI} -\normalbaselineskip=14pt -\normalsize -\renewcommand\small{% - \@setfontsize\small\@ixpt{12}% - \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ - \abovedisplayshortskip \z@ \@plus2\p@ - \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ - \def\@listi{\leftmargin\leftmargini - \topsep 4\p@ \@plus2\p@ \@minus2\p@ - \parsep 2\p@ \@plus\p@ \@minus\p@ - \itemsep \parsep}% - \belowdisplayskip \abovedisplayskip -} -\renewcommand\footnotesize{% - \@setfontsize\footnotesize\@viiipt{10}% - \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ - \abovedisplayshortskip \z@ \@plus\p@ - \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ - \def\@listi{\leftmargin\leftmargini - \topsep 3\p@ \@plus\p@ \@minus\p@ - \parsep 2\p@ \@plus\p@ \@minus\p@ - \itemsep \parsep}% - \belowdisplayskip \abovedisplayskip -} -\renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt} -\renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt} -\renewcommand\large{\@setfontsize\large\@xipt{15}} -\renewcommand\Large{\@setfontsize\Large\@xiipt{16}} -\renewcommand\LARGE{\@setfontsize\LARGE\@xivpt{18}} -\renewcommand\huge{\@setfontsize\huge\@xxpt{30}} -\renewcommand\Huge{\@setfontsize\Huge{24}{36}} - -\setlength\leftmargini {1pc} -\setlength\leftmarginii {1pc} -\setlength\leftmarginiii {1pc} -\setlength\leftmarginiv {1pc} -\setlength\leftmarginv {1pc} -\setlength\leftmarginvi {1pc} -\setlength\labelsep {.5pc} -\setlength\labelwidth {\leftmargini} -\addtolength\labelwidth{-\labelsep} - -%% -% \RaggedRight allows hyphenation - -\setlength{\parindent}{1.0pc}% -\setlength{\parskip}{0pt}% -\RequirePackage{ragged2e} -\setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize} - -% Paragraph indentation and separation for normal text -\newcommand{\@tufte@reset@par}{% - \setlength{\RaggedRightParindent}{1.0pc}% - \setlength{\JustifyingParindent}{1.0pc}% - \setlength{\parindent}{1pc}% - \setlength{\parskip}{0pt}% -} -\@tufte@reset@par - -% Paragraph indentation and separation for marginal text -\newcommand{\@tufte@margin@par}{% - \setlength{\RaggedRightParindent}{0.5pc}% - \setlength{\JustifyingParindent}{0.5pc}% - \setlength{\parindent}{0.5pc}% - \setlength{\parskip}{0pt}% -} - - -%% -% Set page layout geometry - -\RequirePackage[letterpaper,left=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry} - -\ifthenelse{\boolean{@tufte@afourpaper}} - {\geometry{a4paper,left=24.8mm,top=27.4mm,headsep=2\baselineskip,textwidth=107mm,marginparsep=8.2mm,marginparwidth=49.4mm,textheight=49\baselineskip,headheight=\baselineskip}} - {} - -\ifthenelse{\boolean{@tufte@bfivepaper}} - {\geometry{paperwidth=176mm,paperheight=250mm,left=14.66mm,top=13.88mm,textwidth=102.66mm,marginparsep=7.33mm,marginparwidth=36.66mm,textheight=38\baselineskip,includehead}} - {} - -\ifthenelse{\boolean{@tufte@symmetric}} - {} - {\geometry{asymmetric}}% forces internal LaTeX `twoside' - - -%% -% Separation marginpars by a line's worth of space. - -\setlength\marginparpush{10pt} - -%% -% Font for margin items - -\ifthenelse{\boolean{@tufte@sfsidenotes}} - {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize\sffamily}} - {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize}} - -\newcommand*{\@tufte@sidenote@font}{\@tufte@marginfont} -\newcommand*{\@tufte@caption@font}{\@tufte@marginfont} -\newcommand*{\@tufte@marginnote@font}{\@tufte@marginfont} -\newcommand*{\@tufte@citation@font}{\@tufte@marginfont} - -\newcommand*{\setsidenotefont}[1]{\renewcommand*{\@tufte@sidenote@font}{#1}} -\newcommand*{\setcaptionfont}[1]{\renewcommand*{\@tufte@caption@font}{#1}} -\newcommand*{\setmarginnotefont}[1]{\renewcommand*{\@tufte@marginnote@font}{#1}} -\newcommand*{\setcitationfont}[1]{\renewcommand*{\@tufte@citation@font}{#1}} - -%% -% Set the justification baesed on the `justified' class option - -\newcommand{\@tufte@justification}{% - \ifthenelse{\boolean{@tufte@justified}}% - {\justifying}% - {\RaggedRight}% -} - -%% -% Turn off section numbering - -\setcounter{secnumdepth}{-1} - -%% -% Tighten up space between displays (e.g., a figure or table) and make symmetric - -\setlength\abovedisplayskip{6pt plus 2pt minus 4pt} -\setlength\belowdisplayskip{6pt plus 2pt minus 4pt} - -%% -% To implement full-width display environments - -\newboolean{@tufte@changepage} -\IfFileExists{changepage.sty}{% - \@tufte@debug@info@noline{Found changepage.sty} - \RequirePackage[strict]{changepage} - \setboolean{@tufte@changepage}{true} -}{% - \@tufte@debug@info@noline{Found chngpage.sty} - \RequirePackage[strict]{chngpage} - \setboolean{@tufte@changepage}{false} -} - -% Write our own aliases for the \checkoddpage and \ifoddpage or \ifcpoddpage commands -\newboolean{@tufte@odd@page} -\setboolean{@tufte@odd@page}{true} -\newcommand*{\@tufte@checkoddpage}{% - \checkoddpage% - \ifthenelse{\boolean{@tufte@changepage}}{% - \ifoddpage% - \setboolean{@tufte@odd@page}{true}% - \else% - \setboolean{@tufte@odd@page}{false}% - \fi% - }{% - \ifcpoddpage% - \setboolean{@tufte@odd@page}{true}% - \else% - \setboolean{@tufte@odd@page}{false}% - \fi% - }% -} - -%% -% Compute lengths used for full-width displays - -\newlength{\@tufte@overhang}% used by the fullwidth environment and the running heads -\newlength{\@tufte@fullwidth} -\newlength{\@tufte@caption@fill} - -\newcommand{\TufteRecalculate}{% - \setlength{\@tufte@overhang}{\marginparwidth} - \addtolength{\@tufte@overhang}{\marginparsep} - - \setlength{\@tufte@fullwidth}{\textwidth} - \addtolength{\@tufte@fullwidth}{\marginparsep} - \addtolength{\@tufte@fullwidth}{\marginparwidth} - - \setlength{\@tufte@caption@fill}{\textwidth} - \addtolength{\@tufte@caption@fill}{\marginparsep} -} - -\AtBeginDocument{\TufteRecalculate} - -%% -% Modified \title, \author, and \date commands. These store the -% (footnote-less) values in \plaintitle, \plainauthor, and \thedate, respectively. - -\newcommand{\plaintitle}{}% plain-text-only title -\newcommand{\plainauthor}{}% plain-text-only author -\newcommand{\plainpublisher}{}% plain-text-only publisher - -\newcommand{\thanklesstitle}{}% full title text minus \thanks{} -\newcommand{\thanklessauthor}{}% full author text minus \thanks{} -\newcommand{\thanklesspublisher}{}% full publisher minus \thanks{} - -\newcommand{\@publisher}{}% full publisher with \thanks{} -\newcommand{\thedate}{\today} - -% TODO Fix it so that \thanks is not spaced out (with `soul') and can be -% used in \maketitle when the `sfsidenotes' option is provided. -\renewcommand{\thanks}[1]{\NoCaseChange{\footnote{#1}}} - -\renewcommand{\title}[2][]{% - \gdef\@title{#2}% - \begingroup% - % TODO store contents of \thanks command - \renewcommand{\thanks}[1]{}% swallow \thanks contents - \protected@xdef\thanklesstitle{#2}% - \endgroup% - \ifthenelse{\isempty{#1}}% - {\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title - {\renewcommand{\plaintitle}{#1}}% use provided plain-text title - \ifthenelse{\isundefined{\hypersetup}}% - {}% hyperref is not loaded; do nothing - {\hypersetup{pdftitle={\plaintitle}}}% set the PDF metadata title -} - -\let\@author\@empty% suppress default latex.ltx ``no author'' warning -\renewcommand{\author}[2][]{% - \ifthenelse{\isempty{#2}}{}{\gdef\@author{#2}}% - \begingroup% - % TODO store contents of \thanks command - \renewcommand{\thanks}[1]{}% swallow \thanks contents - \protected@xdef\thanklessauthor{#2}% - \endgroup% - \ifthenelse{\isempty{#1}}% - {\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author - {\renewcommand{\plainauthor}{#1}}% use provided plain-text author - \ifthenelse{\isundefined{\hypersetup}}% - {}% hyperref is not loaded; do nothing - {\hypersetup{pdfauthor={\plainauthor}}}% set the PDF metadata author -} - -\renewcommand{\date}[1]{% - \gdef\@date{#1}% - \begingroup% - % TODO store contents of \thanks command - \renewcommand{\thanks}[1]{}% swallow \thanks contents - \protected@xdef\thedate{#1}% - \endgroup% -} - -%% -% Provides a \publisher command to set the publisher - -\newcommand{\publisher}[2][]{% - \gdef\@publisher{#2}% - \begingroup% - \renewcommand{\thanks}[1]{}% swallow \thanks contents - \protected@xdef\thanklesspublisher{#2}% - \endgroup% - \ifthenelse{\isempty{#1}} - {\renewcommand{\plainpublisher}{\thanklesspublisher}}% use thankless publisher - {\renewcommand{\plainpublisher}{#1}}% use provided plain-text publisher -} - -% TODO: Test \hypersetup{pdfauthor,pdftitle} with DVI and XeTeX - -%% -% Require paralist package for tighter lists - -\RequirePackage{paralist} - -% Add rightmargin to compactenum - -\def\@compactenum@{% - \expandafter\list\csname label\@enumctr\endcsname{% - \usecounter{\@enumctr}% - \rightmargin=2em% added this - \parsep\plparsep - \itemsep\plitemsep - \topsep\pltopsep - \partopsep\plpartopsep - \def\makelabel##1{\hss\llap{##1}}}} - -%% -% Improved letterspacing of small caps and all-caps text. -% -% First, try to use the `microtype' package, if it's available. -% Failing that, try to use the `soul' package, if it's available. -% Failing that, well, I give up. - -\DeclareTextFontCommand{\textsmallcaps}{\scshape} - -\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase -\def\allcapsspacing{\@tufte@warning{Proper spacing of ALL-CAPS letters has not been set up.}} -\def\smallcapsspacing{\@tufte@warning{Proper spacing of small-caps letters has not been set up.}} -\newcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{#1}}} -\newcommand{\smallcaps}[1]{\smallcapsspacing{\MakeTextLowercase{#1}}} - -% If we're using pdfLaTeX v1.40+, use the letterspace package. -% If we're using pdfLaTex < v1.40, use the soul package. -% If we're using XeLaTeX, use XeLaTeX letterspacing options. -% Otherwise fall back on the soul package. - -\ifthenelse{\boolean{@tufte@pdf}} - {\@tufte@debug@info@noline{ifpdf = true}} - {\@tufte@debug@info@noline{ifpdf = false}} - -\ifthenelse{\boolean{@tufte@xetex}} - {\@tufte@debug@info@noline{ifxetex = true}} - {\@tufte@debug@info@noline{ifxetex = false}} - -% Check pdfLaTeX version -\def\@tufte@pdftexversion{0} -\ifx\normalpdftexversion\@undefined \else - \let\pdftexversion \normalpdftexversion - \let\pdftexrevision\normalpdftexrevision - \let\pdfoutput \normalpdfoutput -\fi -\ifx\pdftexversion\@undefined \else - \ifx\pdftexversion\relax \else - \def\@tufte@pdftexversion{6} - \ifnum\pdftexversion < 140 - \def\@tufte@pdftexversion{5} - \fi - \fi -\fi - -\newboolean{@tufte@letterspace@pkg@prereqs} -\setboolean{@tufte@letterspace@pkg@prereqs}{true} -\ifnum\@tufte@pdftexversion<6 - \setboolean{@tufte@letterspace@pkg@prereqs}{false} -\fi - - -\newcommand{\@tufte@letterspacing@soul}{% - \RequirePackage{soul}% - \sodef\allcapsspacing{}{0.15em}{0.65em}{0.6em}% - \sodef\smallcapsspacing{}{0.075em}{0.5em}{0.6em}% - \sodef\sotextsc{\scshape}{0.075em}{0.5em}{0.6em}% - \renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}% - \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{##1}}}% - \renewcommand{\textsc}[1]{\sotextsc{##1}}% -} - -\newcommand{\@tufte@letterspacing@letterspace}{% - \@tufte@debug@info@noline{Modern version of pdfTeX detected. Using `letterspace' package}% - \RequirePackage{letterspace}% - % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+ - \renewcommand{\allcapsspacing}[1]{\textls[200]{##1}}% - \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}% - \renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}% - \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{##1}}}% - \renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{##1}}}% -} - -\ifthenelse{\boolean{@tufte@letterspace}}{% - \ifthenelse{\boolean{@tufte@pdf}\AND\boolean{@tufte@letterspace@pkg@prereqs}\AND\NOT\boolean{@tufte@xetex}}{% - % load letterspace pkg - \IfFileExists{letterspace.sty}{% - \@tufte@letterspacing@letterspace - }{}% - }{}% - % load soul pkg - \@ifpackageloaded{letterspace}{}{% - \IfFileExists{soul.sty}{% - \@tufte@letterspacing@soul - }{% - \@tufte@warning@noline{Couldn't locate `soul' package}% - }% soul not installed... giving up. - }% -}{} - -%\ifthenelse{\boolean{@tufte@letterspace}}{% - %\ifthenelse{\boolean{pdf}}{% - %\ifthenelse{\NOT\boolean{@tufte@letterspace@pkg@prereqs}}{% - %% pdfLaTeX version is too old or not using pdfLaTeX - %\ifthenelse{\boolean{@tufte@xetex}}{% - %% TODO use xetex letterspacing - %\@tufte@debug@info@noline{XeTeX detected. Reverting to `soul' package for letterspacing}% - %\@tufte@loadsoul% - %}{% - %% use `soul' package for letterspacing - %\@tufte@debug@info@noline{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing}% - %\@tufte@loadsoul% - %} - %}{% - %\IfFileExists{letterspace.sty}{% - %\@tufte@debug@info@noline{Modern version of pdfTeX detected. Using `letterspace' package} - %\RequirePackage{letterspace} - %% Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+ - %\renewcommand{\allcapsspacing}[1]{\textls[200]{##1}} - %\renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}} - %\renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}} - %\renewcommand{\smallcaps}[1]{\smallcapsspacing{\MakeTextLowercase{##1}}} - %\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{##1}}} - %}{% microtype failed, check for soul - %\@tufte@debug@info@noline{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing} - %\@tufte@loadsoul - %}% - %}% - %}{% - %\@tufte@debug@info@noline{Plain LaTeX detected. Using `soul' package for letterspacing} - %\@tufte@loadsoul - %} -%}{% -%% we're not to load letterspacing, so do nothing -%} - - -%% -% An environment for paragraph-style section - -\providecommand\newthought[1]{% - \tuftebreak - \noindent\textsc{#1}% -} - -%% -% Redefine the display environments (quote, quotation, etc.) - -\renewenvironment{verse} - {\let\\\@centercr - \list{}{\itemsep \z@ - \itemindent -1pc% - \listparindent\itemindent - \rightmargin \leftmargin - \advance\leftmargin 1pc}% - \small% - \item\relax} - {\endlist} -\renewenvironment{quotation} - {\list{}{\listparindent 1pc% - \itemindent \listparindent - \rightmargin \leftmargin - \parsep \z@ \@plus\p@}% - \small% - \item\relax\noindent\ignorespaces} - {\endlist} -\renewenvironment{quote} - {\list{}{\rightmargin\leftmargin}% - \small% - \item\relax} - {\endlist} - -%% -% Italicize description run-in headings (instead of the default bold) - -\renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\em #1} - - -%% -% Used for doublespacing, and other linespacing - -\RequirePackage{setspace} - -%% -% Load the bidi package if instructed to do so. This package must be loaded -% prior to our redefining the \footnote and \cite commands. - -\ifthenelse{\boolean{@tufte@loadbidi}}{% - \AtBeginDocument{% - \RequirePackage{bidi} - \@tufte@pkghook@post@bidi% - }% -}{} - - -%% -% A function that removes leading and trailling spaces from the supplied macro. -% Based on code written by Michael Downes (See ``Around the Bend'', #15.) -% Executing \@tufte@trim@spaces\xyzzy will result in the contents of \xyzzy -% being trimmed of leading and trailing white space. - -\catcode`\Q=3 -\def\@tufte@trim@spaces#1{% - % Use grouping to emulate a multi-token afterassignment queue - \begingroup% - % Put `\toks 0 {' into the afterassignment queue - \aftergroup\toks\aftergroup0\aftergroup{% - % Apply \trimb to the replacement text of #1, adding a leading - % \noexpand to prevent brace stripping and to serve another purpose - % later. - \expandafter\@tufte@trim@b\expandafter\noexpand#1Q Q}% - % Transfer the trimmed text back into #1. - \edef#1{\the\toks0}% -} - -% \trimb removes a trailing space if present, then calls \@tufte@trim@c to -% clean up any leftover bizarre Qs, and trim a leading space. In -% order for \trimc to work properly we need to put back a Q first. -\def\@tufte@trim@b#1 Q{\@tufte@trim@c#1Q} - -% Execute \vfuzz assignment to remove leading space; the \noexpand -% will now prevent unwanted expansion of a macro or other expandable -% token at the beginning of the trimmed text. The \endgroup will feed -% in the \aftergroup tokens after the \vfuzz assignment is completed. -\def\@tufte@trim@c#1Q#2{\afterassignment\endgroup \vfuzz\the\vfuzz#1} -\catcode`\Q=11 - -%% -% Citations should go in the margin as sidenotes - -\ifthenelse{\boolean{@tufte@loadnatbib}}{% - \RequirePackage{natbib}% - \RequirePackage{bibentry}% allows bibitems to be typeset outside thebibliography environment - % Redefine the \BR@b@bibitem command to fix a bug with bibentry+chicago style - \renewcommand\BR@b@bibitem[2][]{% - \ifthenelse{\isempty{#1}}% - {\BR@bibitem{#2}}% - {\BR@bibitem[#1]{#2}}% - \BR@c@bibitem{#2}% - }% - \nobibliography*% pre-loads the bibliography keys - \providecommand{\doi}[1]{\textsc{doi:} #1}% pre-defining this so it may be used before the \bibliography command it issued -}{} - -%% -% Normal \cite behavior -\newcounter{@tufte@num@bibkeys}% -\newcommand{\@tufte@normal@cite}[2][0pt]{% - % Snag the last bibentry in the list for later comparison - \let\@temp@last@bibkey\@empty% - \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}% - \sidenote[][#1]{% - % Loop through all the bibentries, separating them with semicolons and spaces - \normalsize\normalfont\@tufte@citation@font% - \setcounter{@tufte@num@bibkeys}{0}% - \@for\@temp@bibkeyx:=#2\do{% - \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% - {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% - \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey - \bibentry{\@temp@bibkeyx}}% - {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey - \bibentry{\@temp@bibkeyx};\ }% - \stepcounter{@tufte@num@bibkeys}% - }% - }% -} - - -%% -% Macros for holding the list of cite keys until after the \sidenote - -\gdef\@tufte@citations{}% list of cite keys -\newcommand\@tufte@add@citation[1]{\relax% adds a new bibkey to the list of cite keys - \ifx\@tufte@citations\@empty\else - \g@addto@macro\@tufte@citations{,}% separate by commas - \fi - \g@addto@macro\@tufte@citations{#1} -} - -\newcommand{\@tufte@print@citations}[1][0pt]{% puts the citations in a margin note - % Snag the last bibentry in the list for later comparison - \let\@temp@last@bibkey\@empty% - \@for\@temp@bibkey:=\@tufte@citations\do{\let\@temp@last@bibkey\@temp@bibkey}% - \marginpar{% - \hbox{}\vspace*{#1}% - \@tufte@citation@font% - \@tufte@citation@justification% - \@tufte@margin@par% use parindent and parskip settings for marginal text - \vspace*{-1\baselineskip}% - % Loop through all the bibentries, separating them with semicolons and spaces - \setcounter{@tufte@num@bibkeys}{0}% - \@for\@temp@bibkeyx:=\@tufte@citations\do{% - \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% - {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% - \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey - \bibentry{\@temp@bibkeyx}}% - {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey - \bibentry{\@temp@bibkeyx};\ }% - \stepcounter{@tufte@num@bibkeys}% - }% - }% -} - -%% -% \cite behavior when executed within a sidenote - -\newcommand{\@tufte@sidenote@citations}{}% contains list of \cites in sidenote -\newcommand{\@tufte@infootnote@cite}[1]{% - \@tufte@add@citation{#1} -} - -%% -% Set the default \cite style. This is set and reset by the \sidenote command. - -\ifthenelse{\boolean{@tufte@loadnatbib}}{% - \let\cite\@tufte@normal@cite -}{} - -%% -% Transform existing \footnotes into \sidenotes -% Sidenote: ``Where God meant footnotes to go.'' ---Tufte - -\RequirePackage{optparams}% for our new sidenote commands -- provides multiple optional arguments for commands - -\providecommand{\footnotelayout}{\@tufte@sidenote@font\@tufte@sidenote@justification} -\renewcommand{\footnotelayout}{\@tufte@sidenote@font\@tufte@sidenote@justification} - -% Override footmisc's definition to set the sidenote marks (numbers) inside the -% sidenote's text block. -\long\def\@makefntext#1{\@textsuperscript{\@tufte@sidenote@font\tiny\@thefnmark}\,\footnotelayout#1} - -% Set the in-text footnote mark in the same typeface as the body text itself. -\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}} - -\providecommand*{\multiplefootnotemarker}{3sp} -\providecommand*{\multfootsep}{,} - -\renewcommand{\@footnotemark}{% - \leavevmode% - \ifhmode% - \edef\@x@sf{\the\spacefactor}% - \@tufte@check@multiple@sidenotes% - \nobreak% - \fi% - \@makefnmark% - \ifhmode\spacefactor\@x@sf\fi% - \relax% -} - -\newcommand{\@tufte@check@multiple@sidenotes}{% - \ifdim\lastkern=\multiplefootnotemarker\relax% - \edef\@x@sf{\the\spacefactor}% - \unkern% - \textsuperscript{\multfootsep}% - \spacefactor\@x@sf\relax% - \fi -} - -\renewcommand\@footnotetext[2][0pt]{% - \marginpar{% - \hbox{}\vspace*{#1}% - \def\baselinestretch {\setspace@singlespace}% - \reset@font\footnotesize% - \@tufte@margin@par% use parindent and parskip settings for marginal text - \vspace*{-1\baselineskip}\noindent% - \protected@edef\@currentlabel{% - \csname p@footnote\endcsname\@thefnmark% - }% - \color@begingroup% - \@makefntext{% - \ignorespaces#2% - }% - \color@endgroup% - }% -}% - -% Ensure this is run after the bidi package has been loaded -\def\@tufte@pkghook@post@bidi{}% -\g@addto@macro{\@tufte@pkghook@post@bidi}{% - \renewcommand\@footnotetext[2][0pt]{% - \marginpar{% - \hbox{}\vspace*{#1}% - \def\baselinestretch {\setspace@singlespace}% - \if@rl@footnote\@rltrue\else\@rlfalse\fi% - \reset@font\footnotesize% - \@tufte@margin@par% use parindent and parskip settings for marginal text - \vspace*{-1\baselineskip}\noindent% - \protected@edef\@currentlabel{% - \csname p@footnote\endcsname\@thefnmark% - }% - \color@begingroup% - \@makefntext{% - \ignorespaces#2% - }% - \color@endgroup% - }% - }% -}% - -% -% Define \sidenote command. Can handle \cite. - -\newlength{\@tufte@sidenote@vertical@offset} -\setlength{\@tufte@sidenote@vertical@offset}{0pt} - -% #1 = footnote num, #2 = vertical offset, #3 = footnote text -\long\def\@tufte@sidenote[#1][#2]#3{% - \ifthenelse{\boolean{@tufte@loadnatbib}}{% - \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command - }{}% - \gdef\@tufte@citations{}% clear out any old citations - \ifthenelse{\NOT\isempty{#2}}{% - \gsetlength{\@tufte@sidenote@vertical@offset}{#2}% - }{% - \gsetlength{\@tufte@sidenote@vertical@offset}{0pt}% - }% - \ifthenelse{\isempty{#1}}{% - % no specific footnote number provided - \stepcounter\@mpfn% - \protected@xdef\@thefnmark{\thempfn}% - \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}% - }{% - % specific footnote number provided - \begingroup% - \csname c@\@mpfn\endcsname #1\relax% - \unrestored@protected@xdef\@thefnmark{\thempfn}% - \endgroup% - \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}% - }% - \@tufte@print@citations% print any citations - \ifthenelse{\boolean{@tufte@loadnatbib}}{% - \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command - }{}% - \unskip\ignorespaces% remove extra white space - \kern-\multiplefootnotemarker% remove \kern left behind by sidenote - \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked -} - -\newcommand{\sidenote}{\optparams{\@tufte@sidenote}{[][0pt]}} -\renewcommand{\footnote}{\optparams{\@tufte@sidenote}{[][0pt]}} - -%% -% Sidenote without the footnote mark - -\newcommand\marginnote[2][0pt]{% - \ifthenelse{\boolean{@tufte@loadnatbib}}{% - \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command - }{}% - \gdef\@tufte@citations{}% clear out any old citations - \marginpar{\hbox{}\vspace*{#1}\@tufte@marginnote@font\@tufte@marginnote@justification\@tufte@margin@par\vspace*{-1\baselineskip}\noindent #2}% - \@tufte@print@citations% print any citations - \ifthenelse{\boolean{@tufte@loadnatbib}}{% - \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command - }{}% -} - - -%% -% The placeins package provides the \FloatBarrier command. This forces -% LaTeX to place all of the floats before proceeding. We'll use this to -% keep the float (figure and table) numbers in sequence. -\RequirePackage{placeins} - -%% -% Margin float environment - -\newsavebox{\@tufte@margin@floatbox} -\newenvironment{@tufte@margin@float}[2][-1.2ex]% - {\FloatBarrier% process all floats before this point so the figure/table numbers stay in order. - \begin{lrbox}{\@tufte@margin@floatbox}% - \begin{minipage}{\marginparwidth}% - \@tufte@caption@font% - \def\@captype{#2}% - \hbox{}\vspace*{#1}% - \@tufte@caption@justification% - \@tufte@margin@par% - \noindent% - } - {\end{minipage}% - \end{lrbox}% - \marginpar{\usebox{\@tufte@margin@floatbox}}% - } - - -%% -% Margin figure environment - -\newenvironment{marginfigure}[1][-1.2ex]% - {\begin{@tufte@margin@float}[#1]{figure}} - {\end{@tufte@margin@float}} - - -%% -% Margin table environment - -\newenvironment{margintable}[1][-1.2ex]% - {\begin{@tufte@margin@float}[#1]{table}} - {\end{@tufte@margin@float}} - - -%% -% Auto-detects the proper text alignment based on the various class options - -\newcommand*{\@tufte@justification@autodetect}{% - \ifthenelse{\boolean{@tufte@justified}}% - {\justifying}% - {\RaggedRight}% -} - -%% -% Forces the outer edge of the caption to be set ragged. -% Therefore, on verso pages it's ragged left, and on recto pages it's ragged right. - -\newcommand*{\@tufte@justification@caption@outer}{% - \ifthenelse{\boolean{@tufte@float@recto}}% - {\RaggedRight}% - {\RaggedLeft}% -} - -\newcommand*{\@tufte@justification@outer}{% - \@tufte@checkoddpage% - \ifthenelse{\boolean{@tufte@odd@page}}% - {\RaggedRight}% - {\RaggedLeft}% -} - - - -%% -% A collection of macros to be used with the new Tufte-style float environments. -% \setfloatalignment forces the caption placement to be treated as top, bottom, etc. -% \forcerectofloat forces the float to be treated as if it were appearing on a recto page. -% \forceversofloat does the same, but for verso pages. - -\newcommand{\@tufte@float@debug@info}{}% contains debug info generated as the float is processed -\newcommand{\@tufte@float@debug}[1]{% adds debug info to the queue for output - \ifthenelse{\equal{\@tufte@float@debug@info}{}}% - {\def\@tufte@float@debug@info{#1}}% - {\g@addto@macro\@tufte@float@debug@info{\MessageBreak#1}}% -} - -\newcommand{\floatalignment}{x}% holds the current float alignment (t, b, h, p) -\newcommand{\setfloatalignment}[1]{\global\def\floatalignment{#1}\@tufte@float@debug{Forcing position: [#1]}}% manually sets the float alignment -\newboolean{@tufte@float@recto} -\newcommand{\forcerectofloat}{\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Forcing page: [recto]}} -\newcommand{\forceversofloat}{\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Forcing page: [verso]}} - -% Boxes to temporarily store our float and caption -\newsavebox{\@tufte@figure@box} -\newsavebox{\@tufte@caption@box} - -% Save original LaTeX float environment -\let\@tufte@orig@float\@float -\let\@tufte@orig@endfloat\end@float - -% New length for tweaking float captions -\newlength{\@tufte@caption@vertical@offset} -\setlength{\@tufte@caption@vertical@offset}{0pt} - -% Store the caption and label contents -\newcommand{\@tufte@stored@shortcaption}{} -\newcommand{\@tufte@stored@caption}{} -\newcommand{\@tufte@stored@label}{} - -\long\def\@tufte@caption[#1][#2]#3{% - \ifthenelse{\isempty{#1}}% - {\gdef\@tufte@stored@shortcaption{#3}}% - {\gdef\@tufte@stored@shortcaption{#1}}% - \gsetlength{\@tufte@caption@vertical@offset}{-#2}% we want a positive offset to lower captions - \gdef\@tufte@stored@caption{#3}% -} - -\newcommand{\@tufte@label}[1]{% - \gdef\@tufte@stored@label{#1}% -} - -\newcommand{\@tufte@fps}{} - -\newboolean{@tufte@float@star} -\newlength{\@tufte@float@contents@width} - -%% -% Define a float environment to place the captions in the margin space - -\newenvironment{@tufte@float}[3][htbp]% - {% begin @tufte@float - % Should this float be full-width or just text-width? - \ifthenelse{\equal{#3}{star}}% - {\gsetboolean{@tufte@float@star}{true}}% - {\gsetboolean{@tufte@float@star}{false}}% - % Check page side (recto/verso) and store detected value -- can be overriden in environment contents - \@tufte@checkoddpage% - \ifthenelse{\boolean{@tufte@odd@page}}% - {\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Detected page: [recto/odd]}}% - {\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Detected page: [verso/even]}}% - % If the float placement specifier is 'b' and only 'b', then bottom-align the mini-pages, otherwise top-align them. - \renewcommand{\@tufte@fps}{#1}% - \@tufte@float@debug{Allowed positions: [#1]}% - \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}% - {\renewcommand{\floatalignment}{b}\@tufte@float@debug{Presumed position: [bottom]}}% - {\renewcommand{\floatalignment}{t}\@tufte@float@debug{Presumed position: [top]}}% - % Capture the contents of the \caption and \label commands to use later - \global\let\@tufte@orig@caption\caption% - \global\let\@tufte@orig@label\label% - \renewcommand{\caption}{\optparams{\@tufte@caption}{[][0pt]}}% - \renewcommand{\label}[1]{\@tufte@label{##1}}% - % Handle subfigure package compatibility - \ifthenelse{\boolean{@tufte@packages@subfigure}}{% - % don't move the label while inside a \subfigure or \subtable command - \global\let\label\@tufte@orig@label% - }{}% subfigure package is not loaded - \@tufte@orig@float{#2}[#1]% - \ifthenelse{\boolean{@tufte@float@star}}% - {\setlength{\@tufte@float@contents@width}{\@tufte@fullwidth}}% - {\setlength{\@tufte@float@contents@width}{\textwidth}}% - \begin{lrbox}{\@tufte@figure@box}% - \begin{minipage}[\floatalignment]{\@tufte@float@contents@width}\hbox{}% - }{% end @tufte@float - \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes - \end{minipage}% - \end{lrbox}% - % build the caption box - \begin{lrbox}{\@tufte@caption@box}% - \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}% - \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}% - \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}% - \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY - \end{minipage}% - \end{lrbox}% - % now typeset the stored boxes - \begin{fullwidth}% - \begin{minipage}[\floatalignment]{\linewidth}% - \ifthenelse{\boolean{@tufte@float@star}}% - {\@tufte@float@fullwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% - {\@tufte@float@textwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% - \end{minipage}% - \end{fullwidth}% - \@tufte@orig@endfloat% end original LaTeX float environment - % output debug info - \ifthenelse{\boolean{@tufte@debug}}{% - \typeout{^^J^^J----------- Tufte-LaTeX float information ----------}% - \ifthenelse{\equal{\@tufte@stored@label}{}}% - {\typeout{Warning: Float unlabeled!}}% - {\typeout{Float label: [\@tufte@stored@label]}}% - \typeout{Page number: [\thepage]}% - \def\MessageBreak{^^J}% - \typeout{\@tufte@float@debug@info}% - \ifthenelse{\boolean{@tufte@symmetric}}% - {\typeout{Symmetric: [true]}}% - {\typeout{Symmetric: [false]}}% - \typeout{----------------------------------------------------^^J^^J}% - }{}% - % reset commands and temp boxes and captions - \gdef\@tufte@float@debug@info{}% - \let\caption\@tufte@orig@caption% - \let\label\@tufte@orig@label% - \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}% - \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}% - \gdef\@tufte@stored@shortcaption{}% - \gdef\@tufte@stored@caption{}% - \gdef\@tufte@stored@label{}% - \gsetlength{\@tufte@caption@vertical@offset}{0pt}% reset caption offset - } - -\newcommand{\@tufte@float@textwidth}[3][0pt]{% - \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}{% - % asymmetric or page is odd, so caption is on the right - \hbox{% - \usebox{#2}% - \hspace{\marginparsep}% - \smash{\raisebox{#1}{\usebox{#3}}}% - }% - \@tufte@float@debug{Caption position: [right]}% - }{% symmetric pages and page is even, so caption is on the left - \hbox{% - \smash{\raisebox{#1}{\usebox{#3}}}% - \hspace{\marginparsep}% - \usebox{#2}% - }% - \@tufte@float@debug{Caption position: [left]}% - }% -} - -\newcommand{\@tufte@float@fullwidth}[3][0pt]{% - \ifthenelse{\equal{\floatalignment}{b}}% - {% place caption above figure - \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% - {\hfill\smash{\raisebox{#1}{\usebox{#3}}}\par\usebox{#2}\@tufte@float@debug{Caption position: [above right]}}% caption on the right - {\smash{\raisebox{#1}{\usebox{#3}}}\hfill\par\usebox{#2}\@tufte@float@debug{Caption position: [above left]}}% caption on the left - }{% place caption below figure - \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% - {\usebox{#2}\par\hfill\smash{\raisebox{#1}{\usebox{#3}}}\@tufte@float@debug{Caption position: [below right]}}% caption on the right - {\usebox{#2}\par\smash{\raisebox{#1}{\usebox{#3}}}\hfill\@tufte@float@debug{Caption position: [below left]}}% caption on the left - }% -} - - -%% -% Redefine the figure environment to place the captions in the margin space - -\renewenvironment{figure}[1][htbp]% - {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{figure}{}} - {\end{@tufte@float}} - - -%% -% Redefine the table environment to place the captions in the margin space - -\renewenvironment{table}[1][htbp] - {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{table}{}} - {\end{@tufte@float}} - - -%% -% Full-width figure - -\renewenvironment{figure*}[1][htbp]% - {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{figure}{star}} - {\end{@tufte@float}} - - -%% -% Full-width table - -\renewenvironment{table*}[1][htbp]% - {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{table}{star}} - {\end{@tufte@float}} - - -%% -% Full-page-width area - -\newenvironment{fullwidth} - {\ifthenelse{\boolean{@tufte@symmetric}}% - {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}% - {\begin{adjustwidth}{}{-\@tufte@overhang}}% - }% - {\ifthenelse{\boolean{@tufte@symmetric}}% - {\ifthenelse{\boolean{@tufte@changepage}}{\end{adjustwidth*}}{\end{adjustwidth}}}% - {\end{adjustwidth}}% - } - -%% -% Format the captions in a style similar to the sidenotes - -\long\def\@caption#1[#2]#3{% - \par% - \addcontentsline{\csname ext@#1\endcsname}{#1}% - {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% - \begingroup% - \@parboxrestore% - \if@minipage% - \@setminipage% - \fi% - \@tufte@caption@font\@tufte@caption@justification% - \noindent\csname fnum@#1\endcsname: \ignorespaces#3\par% - %\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup} - -%% -% If we're NOT using XeLaTeX and the `nofonts' class option was NOT provided, -% we should load the Palatino, Helvetica, and Bera Mono fonts (if they are -% installed.) - -\ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}\AND\NOT\boolean{@tufte@luatex}}{% - \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{} - \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{} - \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{} - \RequirePackage[T1]{fontenc} - \RequirePackage{textcomp} -}{} - - -%% -% Turns newlines into spaces. Based on code from the `titlesec' package. - -\DeclareRobustCommand{\@tufte@newlinetospace}{% - \@ifstar{\@tufte@newlinetospace@i}{\@tufte@newlinetospace@i}% -} - -\def\@tufte@newlinetospace@i{% - \ifdim\lastskip>\z@\else\space\fi - \ignorespaces% -} - -\DeclareRobustCommand{\newlinetospace}[1]{% - \let\@tufte@orig@cr\\% save the original meaning of \\ - \def\\{\@tufte@newlinetospace}% turn \\ and \\* into \space - \let\newline\\% turn \newline into \space - #1% - \let\\\@tufte@orig@cr% revert to original meaning of \\ -} - - -%% -% Sets up the running heads and folios. - -\RequirePackage{fancyhdr} - -% Set the default page style to 'fancy' -\pagestyle{fancy} - -% Set the header/footer width to be the body text block plus the margin -% note area. -\AtBeginDocument{% - \ifthenelse{\boolean{@tufte@symmetric}} - {\fancyhfoffset[LE,RO]{\@tufte@overhang}} - {\fancyhfoffset[RE,RO]{\@tufte@overhang}} -} - -% The running heads/feet don't have rules -\renewcommand{\headrulewidth}{0pt} -\renewcommand{\footrulewidth}{0pt} - -% The 'fancy' page style is the default style for all pages. -\fancyhf{} % clear header and footer fields -\ifthenelse{\boolean{@tufte@twoside}} - {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plainauthor}}}% - \fancyhead[RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} - {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} - - -% The `plain' page style is used on chapter opening pages. -% In Tufte's /Beautiful Evidence/ he never puts page numbers at the -% bottom of pages -- the folios are unexpressed. -\fancypagestyle{plain}{ - \fancyhf{} % clear header and footer fields - % Uncomment the following five lines of code if you want the opening page - % of the chapter to express the folio in the lower outside corner. - %\ifthenelse{\boolean{@tufte@twoside}} - % {\fancyfoot[LE,RO]{\thepage}} - % {\fancyfoot[RE,RO]{\thepage}} -} - -% The `empty' page style suppresses all headers and footers. -% It's used on title pages and `intentionally blank' pages. -\fancypagestyle{empty}{ - \fancyhf{} % clear header and footer fields -} - - -%% -% Set raggedright and paragraph indentation for document - -\AtBeginDocument{\@tufte@justification} - - -%% -% Prints the list of class options and their states. - -\newcommand{\typeoutbool}[2]{% - \ifthenelse{\boolean{#2}} - {\typeout{\space\space#1: true}} - {\typeout{\space\space#1: false}} -} - -\newcommand{\typeoutstr}[2]{% - \typeout{\space\space#1: #2} -} - -\newcommand{\PrintTufteSettings}{% - \typeout{-------------------- Tufte-LaTeX settings ----------} - \typeout{Class: \@tufte@pkgname} - \typeout{} - \typeout{Class options:} - \typeoutbool{a4paper}{@tufte@afourpaper} - \typeoutbool{b5paper}{@tufte@bfivepaper} - \typeoutbool{load fonts}{@tufte@loadfonts} - \typeoutbool{fully-justified}{@tufte@justified} - \typeoutbool{letterspacing}{@tufte@letterspace} - \typeoutbool{sans-serif sidenotes}{@tufte@sfsidenotes} - \typeoutbool{symmetric margins}{@tufte@symmetric} - \typeoutbool{titlepage}{@tufte@titlepage} - \typeoutbool{twoside}{@tufte@twoside} - \typeoutbool{debug}{@tufte@debug} - \typeout{} - \typeout{Internal variables:} - \typeoutbool{[twoside]}{@twoside} - \typeoutbool{pdflatex}{@tufte@pdf} - \typeoutbool{xelatex}{@tufte@xetex} - \typeout{----------------------------------------------------} -} - -%% -% Amount of space to skip before \newthought or after title block - -\newskip\tufteskipamount -\tufteskipamount=1.0\baselineskip plus 0.5ex minus 0.2ex - -\newcommand{\tuftebreak}{\par\ifdim\lastskip<\tufteskipamount - \removelastskip\penalty-100\tufteskip\fi} - -\newcommand{\tufteskip}{\vspace\tufteskipamount} - - -%% -% Produces a full title page - -\newcommand{\maketitlepage}[0]{% - \clearpage% - {% - \sffamily% - \begin{fullwidth}% - \fontsize{18}{20}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklessauthor}}% - \vspace{11.5pc}% - \fontsize{36}{40}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklesstitle}}% - \vfill% - \fontsize{14}{16}\selectfont\par\noindent\allcaps{\thanklesspublisher}% - \end{fullwidth}% - } - \thispagestyle{empty}% - \clearpage% -} - -%% -% Title block - -\renewcommand{\maketitle}{% - \newpage - \global\@topnum\z@% prevent floats from being placed at the top of the page - \begingroup - \setlength{\parindent}{0pt}% - \setlength{\parskip}{4pt}% - \let\@@title\@empty - \let\@@author\@empty - \let\@@date\@empty - \ifthenelse{\boolean{@tufte@sfsidenotes}}{% - \gdef\@@title{\sffamily\LARGE\allcaps{\@title}\par}% - \gdef\@@author{\sffamily\Large\allcaps{\@author}\par}% - \gdef\@@date{\sffamily\Large\allcaps{\@date}\par}% - }{% - \gdef\@@title{\LARGE\itshape\@title\par}% - \gdef\@@author{\Large\itshape\@author\par}% - \gdef\@@date{\Large\itshape\@date\par}% - }% - \@@title - \@@author - \@@date - \endgroup - \thispagestyle{plain}% suppress the running head - \tuftebreak% add some space before the text begins - \@afterindentfalse\@afterheading% suppress indentation of the next paragraph -} - - -%% -% Title page (if the `titlepage' option was passed to the tufte-handout -% class.) - -\ifthenelse{\boolean{@tufte@titlepage}} - {\renewcommand{\maketitle}{\maketitlepage}} - {} - -%% -% When \cleardoublepage is called, produce a blank (empty) page -- i.e., -% without headers and footers -\def\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else - \hbox{} - %\vspace*{\fill} - %\begin{center} - % This page intentionally contains only this sentence. - %\end{center} - %\vspace{\fill} - \thispagestyle{empty} - \newpage - \if@twocolumn\hbox{}\newpage\fi\fi\fi} - -%% -% Make Tuftian-style section headings and TOC formatting - -\titleformat{\chapter}% - [display]% shape - {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}}% format applied to label+text - {\itshape\huge\thechapter}% label - {0pt}% horizontal separation between label and title body - {\huge\rmfamily\itshape}% before the title body - [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body - -\titleformat{\section}% - [hang]% shape - {\normalfont\Large\itshape}% format applied to label+text - {\thesection}% label - {1em}% horizontal separation between label and title body - {}% before the title body - []% after the title body - -\titleformat{\subsection}% - [hang]% shape - {\normalfont\large\itshape}% format applied to label+text - {\thesubsection}% label - {1em}% horizontal separation between label and title body - {}% before the title body - []% after the title body - -\titleformat{\subsubsection}% - [hang]% shape - {\normalfont\large\itshape}% format applied to label+text - {\thesubsubsection}% label - {2em}% horizontal separation between label and title body - {}% before the title body - []% after the title body - -\titleformat{\paragraph}% - [runin]% shape - {\normalfont\itshape}% format applied to label+text - {\theparagraph}% label - {1em}% horizontal separation between label and title body - {}% before the title body - []% after the title body - -\titlespacing*{\chapter}{0pt}{50pt}{40pt} -\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex} -\titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus.2ex} -\titlespacing*{\subsubsection}{0pt}{3ex plus 1ex minus .2ex}{1.2ex plus.2ex} - -% Formatting for main TOC (printed in front matter) -% {section} [left] {above} {before w/label} {before w/o label} {filler + page} [after] -\ifthenelse{\boolean{@tufte@toc}}{% - \titlecontents{part}% FIXME - [0em] % distance from left margin - {\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry) - {\contentslabel{2em}} % before w/label (label = ``II'') - {} % before w/o label - {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) - [\end{fullwidth}] % after - \titlecontents{chapter}% - [0em] % distance from left margin - {\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry) - {\hspace*{0em}\contentslabel{2em}} % before w/label (label = ``2'') - {\hspace*{0em}} % before w/o label - {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) - [\end{fullwidth}] % after - \titlecontents{section}% FIXME - [0em] % distance from left margin - {\vspace{0\baselineskip}\begin{fullwidth}\Large\rmfamily\itshape} % above (global formatting of entry) - {\hspace*{2em}\contentslabel{2em}} % before w/label (label = ``2.6'') - {\hspace*{2em}} % before w/o label - {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) - [\end{fullwidth}] % after - \titlecontents{subsection}% FIXME - [0em] % distance from left margin - {\vspace{0\baselineskip}\begin{fullwidth}\large\rmfamily\itshape} % above (global formatting of entry) - {\hspace*{4em}\contentslabel{4em}} % before w/label (label = ``2.6.1'') - {\hspace*{4em}} % before w/o label - {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) - [\end{fullwidth}] % after - \titlecontents{subsubsection}% FIXME - [2em] % distance from left margin - {\vspace{0\baselineskip}\begin{fullwidth}\large\rmfamily\itshape} % above (global formatting of entry) - {\hspace*{6em}\contentslabel{6em}} % before w/label (label = ``2.6.1.3'') - {\hspace*{6em}} % before w/o label - {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) - [\end{fullwidth}] % after - \titlecontents{paragraph}% FIXME - [4em] % distance from left margin - {\vspace{0\baselineskip}\begin{fullwidth}\normalsize\rmfamily\itshape} % above (global formatting of entry) - {\hspace*{6em}\contentslabel{2em}} % before w/label (label = ``2.6.0.0.1'') - {\hspace*{6em}} % before w/o label - {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) - [\end{fullwidth}] % after -}{} - -%% -% Format lists of figures/tables - -\renewcommand\listoffigures{% - \ifthenelse{\equal{\@tufte@class}{book}}% - {\chapter*{\listfigurename}}% - {\section*{\listfigurename}}% -% \begin{fullwidth}% - \@starttoc{lof}% -% \end{fullwidth}% -} - -\renewcommand\listoftables{% - \ifthenelse{\equal{\@tufte@class}{book}}% - {\chapter*{\listtablename}}% - {\section*{\listtablename}}% -% \begin{fullwidth}% - \@starttoc{lot}% -% \end{fullwidth}% -} - -\newcommand{\@tufte@lof@line}[2]{% - % #1 is the figure/table number and its caption text - % #2 is the page number on which the figure/table appears - \leftskip 0.0em - \rightskip 0em - \parfillskip 0em plus 1fil - \parindent 0.0em - \@afterindenttrue - \interlinepenalty\@M - \leavevmode - \@tempdima 2.0em - \advance\leftskip\@tempdima - \null\nobreak\hskip -\leftskip - {#1}\nobreak\qquad\nobreak#2% - \par% -} - -\renewcommand*\l@figure{\@tufte@lof@line} -\let\l@table\l@figure - - -%% -% A handy command to disable hyphenation for short bits of text. -% Borrowed from Peter Wilson's `hyphenat' package. - -\AtBeginDocument{% - \@ifpackageloaded{hyphenat}{}{% - \newlanguage\langwohyphens% define a language without hyphenation rules - \providecommand{\nohyphens}[1]{{\language\langwohyphens #1}}% used for short bits of text - \providecommand{\nohyphenation}{\language\langwohyphens}% can be used inside environments for longer text - }% -} - -%% -% Redefine \bibsection to not mark the running heads. -% (Code modified from natbib.sty.) - -\ifthenelse{\boolean{@tufte@loadnatbib}}{% - \@ifundefined{chapter}{% - \renewcommand\bibsection{\section*{\refname}}% - }{% - \@ifundefined{NAT@sectionbib}{% - \renewcommand\bibsection{\chapter{\bibname}}% - }{% - \renewcommand\bibsection{\section*{\bibname}}% - }% - }% -} - -%% -% An index environment to mimic Tufte's indexes - -\RequirePackage{multicol} -\renewenvironment{theindex}{% - \ifthenelse{\equal{\@tufte@class}{book}}% - {\chapter{\indexname}}% - {\section*{\indexname}}% - \begin{fullwidth}% - \small% - \parskip0pt% - \parindent0pt% - \let\item\@idxitem% - \begin{multicols}{3}% -}{% - \end{multicols}% - \end{fullwidth}% -} -\renewcommand\@idxitem{\par\hangindent 2em} -\renewcommand\subitem{\par\hangindent 3em\hspace*{1em}} -\renewcommand\subsubitem{\par\hangindent 4em\hspace*{2em}} -\renewcommand\indexspace{\par\addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}\relax}% -\newcommand{\lettergroup}[1]{}% swallow the letter heading in the index - - -%% -% A couple commands to incresae the number of floats you can use at a time. - -\def\morefloats{% provides a total of 52 floats - \ifthenelse{\isundefined{\bx@S}}{% - \@tufte@debug@info@noline{Adding 34 more float slots.} - \newinsert\bx@S - \newinsert\bx@T - \newinsert\bx@U - \newinsert\bx@V - \newinsert\bx@W - \newinsert\bx@X - \newinsert\bx@Y - \newinsert\bx@Z - \newinsert\bx@a - \newinsert\bx@b - \newinsert\bx@c - \newinsert\bx@d - \newinsert\bx@e - \newinsert\bx@f - \newinsert\bx@g - \newinsert\bx@h - \newinsert\bx@i - \newinsert\bx@j - \newinsert\bx@k - \newinsert\bx@l - \newinsert\bx@m - \newinsert\bx@n - \newinsert\bx@o - \newinsert\bx@p - \newinsert\bx@q - \newinsert\bx@r - \newinsert\bx@s - \newinsert\bx@t - \newinsert\bx@u - \newinsert\bx@v - \newinsert\bx@w - \newinsert\bx@x - \newinsert\bx@y - \newinsert\bx@z - \gdef\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E - \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J - \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N - \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R - \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V - \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z - \@elt\bx@a\@elt\bx@b\@elt\bx@c\@elt\bx@d\@elt\bx@e - \@elt\bx@f\@elt\bx@g\@elt\bx@h\@elt\bx@i\@elt\bx@j - \@elt\bx@k\@elt\bx@l\@elt\bx@m\@elt\bx@n - \@elt\bx@o\@elt\bx@p\@elt\bx@q\@elt\bx@r - \@elt\bx@s\@elt\bx@t\@elt\bx@u\@elt\bx@v - \@elt\bx@w\@elt\bx@x\@elt\bx@y\@elt\bx@z}% - }{% we've already added another 34 floats, so we'll add 26 more, but that's it! - \ifthenelse{\isundefined{\bx@AA}}{% - \@tufte@debug@info@noline{Adding 26 more float slots.} - \newinsert\bx@AA - \newinsert\bx@BB - \newinsert\bx@CC - \newinsert\bx@DD - \newinsert\bx@EE - \newinsert\bx@FF - \newinsert\bx@GG - \newinsert\bx@HH - \newinsert\bx@II - \newinsert\bx@JJ - \newinsert\bx@KK - \newinsert\bx@LL - \newinsert\bx@MM - \newinsert\bx@NN - \newinsert\bx@OO - \newinsert\bx@PP - \newinsert\bx@QQ - \newinsert\bx@RR - \newinsert\bx@SS - \newinsert\bx@TT - \newinsert\bx@UU - \newinsert\bx@VV - \newinsert\bx@WW - \newinsert\bx@XX - \newinsert\bx@YY - \newinsert\bx@ZZ - \gdef\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E - \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J - \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N - \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R - \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V - \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z - \@elt\bx@a\@elt\bx@b\@elt\bx@c\@elt\bx@d\@elt\bx@e - \@elt\bx@f\@elt\bx@g\@elt\bx@h\@elt\bx@i\@elt\bx@j - \@elt\bx@k\@elt\bx@l\@elt\bx@m\@elt\bx@n - \@elt\bx@o\@elt\bx@p\@elt\bx@q\@elt\bx@r - \@elt\bx@s\@elt\bx@t\@elt\bx@u\@elt\bx@v - \@elt\bx@w\@elt\bx@x\@elt\bx@y\@elt\bx@z - \@elt\bx@AA\@elt\bx@BB\@elt\bx@CC\@elt\bx@DD\@elt\bx@EE - \@elt\bx@FF\@elt\bx@GG\@elt\bx@HH\@elt\bx@II\@elt\bx@JJ - \@elt\bx@KK\@elt\bx@LL\@elt\bx@MM\@elt\bx@NN - \@elt\bx@OO\@elt\bx@PP\@elt\bx@QQ\@elt\bx@RR - \@elt\bx@SS\@elt\bx@TT\@elt\bx@UU\@elt\bx@VV - \@elt\bx@WW\@elt\bx@XX\@elt\bx@YY\@elt\bx@ZZ}% - }{% - \@tufte@error{You may only call \string\morefloats\space twice. See the Tufte-LaTeX documentation for other workarounds} - {There are already 78 float slots allocated. Try using \string\FloatBarrier\space or \string\clearpage\space to place some floats before creating more.} - }% - }% -} - - -%% -% Detect if the subfigure package has been loaded - -\newboolean{@tufte@packages@subfigure} -\setboolean{@tufte@packages@subfigure}{false} -\AtBeginDocument{% - \@ifpackageloaded{subfigure} - {\gsetboolean{@tufte@packages@subfigure}{true}} - {\gsetboolean{@tufte@packages@subfigure}{false}}% -} - - -%% -% Detect of the float package has been loaded - -\AtBeginDocument{% - \@ifpackageloaded{float}{% - % Save the redefined float environment (instead of the LaTeX float environment) - \let\@tufte@orig@float\@float - \let\@tufte@orig@endfloat\end@float - - % Define Tuftian float styles (with the caption in the margin) - \newcommand{\floatc@tufteplain}[2]{% - \begin{lrbox}{\@tufte@caption@box}% - \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}% - \@tufte@caption@font{\@fs@cfont #1:} #2\par% - \end{minipage}% - \end{lrbox}% - \smash{\hspace{\@tufte@caption@fill}\usebox{\@tufte@caption@box}}% - } - \newcommand{\fs@tufteplain}{% - \def\@fs@cfont{\@tufte@caption@font}% - \let\@fs@capt\floatc@tufteplain% - \def\@fs@pre{}% - \def\@fs@post{}% - \def\@fs@mid{}% - \let\@fs@iftopcapt\iftrue% - } - \let\fs@tufteplaintop=\fs@tufteplain - \let\floatc@tufteplaintop=\floatc@tufteplain - \newcommand\floatc@tufteruled[2]{% - {\@fs@cfont #1} #2\par% - } - \newcommand\fs@tufteruled{% - \def\@fs@cfont{\@tufte@caption@font}% - \let\@fs@capt\floatc@tufteplain% - \def\@fs@pre{\hrule height.8pt depth0pt width\textwidth \kern2pt}% - \def\@fs@post{\kern2pt\hrule width\textwidth\relax}% - \def\@fs@mid{}% - \let\@fs@iftopcapt\iftrue% - } - \newcommand\fs@tufteboxed{% - \def\@fs@cfont{}% - \let\@fs@capt\floatc@tufteplain% - \def\@fs@pre{% - \setbox\@currbox\vbox{\hbadness10000 - \moveleft3.4pt\vbox{\advance\hsize by6.8pt - \hrule \hbox to\hsize{\vrule\kern3pt - \vbox{\kern3pt\box\@currbox\kern3pt}\kern3pt\vrule}\hrule}} - }% - \def\@fs@mid{\kern2pt}% - \def\@fs@post{}% - \let\@fs@iftopcapt\iftrue% - } - }{% - % Nothing to do - } -} - -\AtBeginDocument{% - \@ifpackageloaded{algorithm}{% - % Set the float style to the Tuftian version - \ifthenelse{\equal{\ALG@floatstyle}{plain}\OR\equal{\ALG@floatstyle}{ruled}\OR\equal{\ALG@floatstyle}{boxed}}{% - \@tufte@info@noline{Switching algorithm float style from \ALG@floatstyle\space to tufte\ALG@floatstyle}% - \floatstyle{tufte\ALG@floatstyle}% - \restylefloat{algorithm}% - }{}% - }{% - % Nothing to do - } -} - - -%% -% For compatibility with the subfig package, we'll set captions=false so that -% it doesn't load the caption package (which modifies our own caption -% formatting). - -\PassOptionsToPackage{caption=false}{subfig} - - -%% -% If debugging is enabled, print the Tufte-LaTeX options and the list of -% files. - -\ifthenelse{\boolean{@tufte@debug}} - {\PrintTufteSettings\listfiles} - {} - - -%% -% If there is a `tufte-common-local.tex' file, load it up. - -\IfFileExists{tufte-common-local.tex} - {\input{tufte-common-local.tex}% - \@tufte@info@noline{Loading tufte-common-local.tex}} - {} - - -%% -% End of file -\endinput diff --git a/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte-ebook.cls b/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte-ebook.cls deleted file mode 100644 index 8812141d8..000000000 --- a/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte-ebook.cls +++ /dev/null @@ -1,76 +0,0 @@ -\NeedsTeXFormat{LaTeX2e}[1994/06/01] - -\ProvidesClass{tufte-ebook}[2015/02/08 v3.5.1 Tufte-book class] - -%% -% Declare we're tufte-book -\newcommand{\@tufte@class}{book}% the base LaTeX class (defaults to the article/handout style) -\newcommand{\@tufte@pkgname}{tufte-ebook}% the name of the package (defaults to tufte-handout) - -%% -% Load the common style elements -\input{tufte-common.def} - - -%% -% Set up any book-specific stuff now - -%% -% The front matter in Tufte's /Beautiful Evidence/ contains everything up -% to the opening page of Chapter 1. The running heads, when they appear, -% contain only the (arabic) page number in the outside corner. -%\newif\if@mainmatter \@mainmattertrue -\renewcommand\frontmatter{% - \clearpage% - \@mainmatterfalse% - \pagenumbering{arabic}% - %\pagestyle{plain}% - \fancyhf{}% - \ifthenelse{\boolean{@tufte@twoside}}% - {\fancyhead[LE,RO]{\thepage}}% - {\fancyhead[RE,RO]{\thepage}}% -} - - -%% -% The main matter in Tufte's /Beautiful Evidence/ doesn't restart the page -% numbering---it continues where it left off in the front matter. -\renewcommand\mainmatter{% - \clearpage% - \@mainmattertrue% - \fancyhf{}% - \ifthenelse{\boolean{@tufte@twoside}}% - {% two-side - \renewcommand{\chaptermark}[1]{\markboth{##1}{}}% - \fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plaintitle}}}% book title - \fancyhead[RO]{\smallcaps{\newlinetospace{\leftmark}}\quad\thepage}% chapter title - }% - {% one-side - \fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}% book title - }% -} - - -%% -% The back matter contains appendices, indices, glossaries, endnotes, -% biliographies, list of contributors, illustration credits, etc. -\renewcommand\backmatter{% - \clearpage% - \@mainmatterfalse% -} - -%% -% Only show the chapter titles in the table of contents -\setcounter{tocdepth}{0} - -%% -% If there is a `tufte-book-local.sty' file, load it. - -\IfFileExists{tufte-book-local.tex}{% - \@tufte@info@noline{Loading tufte-book-local.tex}% - \input{tufte-book-local}% -}{} - -%% -% End of file -\endinput diff --git a/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte.bst b/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte.bst deleted file mode 100644 index 76efca794..000000000 --- a/inst/rmarkdown/templates/tufte_ebook/skeleton/tufte.bst +++ /dev/null @@ -1,1314 +0,0 @@ -%% -%% This is file `tufte.bst', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% merlin.mbs (with options: `seq-no,vonx,ed-au,nmlm,x2,m1,yr-com,xmth,tit-qq,qx,atit-u,jxper,trtit-b,volp-com,jwdpg,pp-last,num-xser,pre-pub,edpar,edby,blk-com,pp,ed,abr,ord,url,url-blk,nfss') -%% ---------------------------------------- -%% *** tufte handout bibliography style *** -%% -%% Copyright 1994-2002 Patrick W Daly - % =============================================================== - % IMPORTANT NOTICE: - % This bibliographic style (bst) file has been generated from one or - % more master bibliographic style (mbs) files, listed above. - % - % This generated file can be redistributed and/or modified under the terms - % of the LaTeX Project Public License Distributed from CTAN - % archives in directory macros/latex/base/lppl.txt; either - % version 1 of the License, or any later version. - % =============================================================== - % Name and version information of the main mbs file: - % \ProvidesFile{merlin.mbs}[2002/10/21 4.05 (PWD, AO, DPC)] - % For use with BibTeX version 0.99a or later - %------------------------------------------------------------------- - % This bibliography style file is intended for texts in ENGLISH - % This is a numerical citation style, and as such is standard LaTeX. - % It requires no extra package to interface to the main text. - % The form of the \bibitem entries is - % \bibitem{key}... - % Usage of \cite is as follows: - % \cite{key} ==>> [#] - % \cite[chap. 2]{key} ==>> [#, chap. 2] - % where # is a number determined by the ordering in the reference list. - % The order in the reference list is that by which the works were originally - % cited in the text, or that in the database. - %--------------------------------------------------------------------- - -ENTRY - { address - author - booktitle - chapter - edition - editor - howpublished - institution - journal - key - month - note - number - organization - pages - publisher - school - series - title - type - url - volume - year - } - {} - { label } -INTEGERS { output.state before.all mid.sentence after.sentence after.block } -FUNCTION {init.state.consts} -{ #0 'before.all := - #1 'mid.sentence := - #2 'after.sentence := - #3 'after.block := -} -STRINGS { s t} -FUNCTION {output.nonnull} -{ 's := - output.state mid.sentence = - { ", " * write$ } - { output.state after.block = - { add.period$ write$ - newline$ - "\newblock " write$ - } - { output.state before.all = - 'write$ - { add.period$ " " * write$ } - if$ - } - if$ - mid.sentence 'output.state := - } - if$ - s -} -FUNCTION {output} -{ duplicate$ empty$ - 'pop$ - 'output.nonnull - if$ -} -FUNCTION {output.check} -{ 't := - duplicate$ empty$ - { pop$ "empty " t * " in " * cite$ * warning$ } - 'output.nonnull - if$ -} -FUNCTION {fin.entry} -{ add.period$ - write$ - newline$ -} - -FUNCTION {new.block} -{ output.state before.all = - 'skip$ - { after.block 'output.state := } - if$ -} -FUNCTION {new.sentence} -{ output.state after.block = - 'skip$ - { output.state before.all = - 'skip$ - { after.sentence 'output.state := } - if$ - } - if$ -} -FUNCTION {add.blank} -{ " " * before.all 'output.state := -} - -FUNCTION {date.block} -{ - skip$ -} - -FUNCTION {not} -{ { #0 } - { #1 } - if$ -} -FUNCTION {and} -{ 'skip$ - { pop$ #0 } - if$ -} -FUNCTION {or} -{ { pop$ #1 } - 'skip$ - if$ -} -FUNCTION {non.stop} -{ duplicate$ - "}" * add.period$ - #-1 #1 substring$ "." = -} - -STRINGS {z} -FUNCTION {remove.dots} -{ 'z := - "" - { z empty$ not } - { z #1 #1 substring$ - z #2 global.max$ substring$ 'z := - duplicate$ "." = 'pop$ - { * } - if$ - } - while$ -} -FUNCTION {new.block.checka} -{ empty$ - 'skip$ - 'new.block - if$ -} -FUNCTION {new.block.checkb} -{ empty$ - swap$ empty$ - and - 'skip$ - 'new.block - if$ -} -FUNCTION {new.sentence.checka} -{ empty$ - 'skip$ - 'new.sentence - if$ -} -FUNCTION {new.sentence.checkb} -{ empty$ - swap$ empty$ - and - 'skip$ - 'new.sentence - if$ -} -FUNCTION {field.or.null} -{ duplicate$ empty$ - { pop$ "" } - 'skip$ - if$ -} -FUNCTION {emphasize} -{ duplicate$ empty$ - { pop$ "" } - { "\emph{" swap$ * "}" * } - if$ -} -FUNCTION {tie.or.space.prefix} -{ duplicate$ text.length$ #3 < - { "~" } - { " " } - if$ - swap$ -} - -FUNCTION {capitalize} -{ "u" change.case$ "t" change.case$ } - -FUNCTION {space.word} -{ " " swap$ * " " * } - % Here are the language-specific definitions for explicit words. - % Each function has a name bbl.xxx where xxx is the English word. - % The language selected here is ENGLISH -FUNCTION {bbl.and} -{ "and"} - -FUNCTION {bbl.etal} -{ "et~al." } - -FUNCTION {bbl.editors} -{ "eds." } - -FUNCTION {bbl.editor} -{ "ed." } - -FUNCTION {bbl.edby} -{ "edited by" } - -FUNCTION {bbl.edition} -{ "edn." } - -FUNCTION {bbl.volume} -{ "vol." } - -FUNCTION {bbl.of} -{ "of" } - -FUNCTION {bbl.number} -{ "no." } - -FUNCTION {bbl.nr} -{ "no." } - -FUNCTION {bbl.in} -{ "in" } - -FUNCTION {bbl.pages} -{ "pp." } - -FUNCTION {bbl.page} -{ "p." } - -FUNCTION {bbl.chapter} -{ "chap." } - -FUNCTION {bbl.techrep} -{ "Tech. Rep." } - -FUNCTION {bbl.mthesis} -{ "Master's thesis" } - -FUNCTION {bbl.phdthesis} -{ "Ph.D. thesis" } - -FUNCTION {bbl.first} -{ "1st" } - -FUNCTION {bbl.second} -{ "2nd" } - -FUNCTION {bbl.third} -{ "3rd" } - -FUNCTION {bbl.fourth} -{ "4th" } - -FUNCTION {bbl.fifth} -{ "5th" } - -FUNCTION {bbl.st} -{ "st" } - -FUNCTION {bbl.nd} -{ "nd" } - -FUNCTION {bbl.rd} -{ "rd" } - -FUNCTION {bbl.th} -{ "th" } - -MACRO {jan} {"Jan."} - -MACRO {feb} {"Feb."} - -MACRO {mar} {"Mar."} - -MACRO {apr} {"Apr."} - -MACRO {may} {"May"} - -MACRO {jun} {"Jun."} - -MACRO {jul} {"Jul."} - -MACRO {aug} {"Aug."} - -MACRO {sep} {"Sep."} - -MACRO {oct} {"Oct."} - -MACRO {nov} {"Nov."} - -MACRO {dec} {"Dec."} - -FUNCTION {eng.ord} -{ duplicate$ "1" swap$ * - #-2 #1 substring$ "1" = - { bbl.th * } - { duplicate$ #-1 #1 substring$ - duplicate$ "1" = - { pop$ bbl.st * } - { duplicate$ "2" = - { pop$ bbl.nd * } - { "3" = - { bbl.rd * } - { bbl.th * } - if$ - } - if$ - } - if$ - } - if$ -} - -MACRO {acmcs} {"ACM Computing Surveys"} - -MACRO {acta} {"Acta Informatica"} - -MACRO {cacm} {"Communications of the ACM"} - -MACRO {ibmjrd} {"IBM Journal of Research and Development"} - -MACRO {ibmsj} {"IBM Systems Journal"} - -MACRO {ieeese} {"IEEE Transactions on Software Engineering"} - -MACRO {ieeetc} {"IEEE Transactions on Computers"} - -MACRO {ieeetcad} - {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} - -MACRO {ipl} {"Information Processing Letters"} - -MACRO {jacm} {"Journal of the ACM"} - -MACRO {jcss} {"Journal of Computer and System Sciences"} - -MACRO {scp} {"Science of Computer Programming"} - -MACRO {sicomp} {"SIAM Journal on Computing"} - -MACRO {tocs} {"ACM Transactions on Computer Systems"} - -MACRO {tods} {"ACM Transactions on Database Systems"} - -MACRO {tog} {"ACM Transactions on Graphics"} - -MACRO {toms} {"ACM Transactions on Mathematical Software"} - -MACRO {toois} {"ACM Transactions on Office Information Systems"} - -MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} - -MACRO {tcs} {"Theoretical Computer Science"} -FUNCTION {bibinfo.check} -{ swap$ - duplicate$ missing$ - { - pop$ pop$ - "" - } - { duplicate$ empty$ - { - swap$ pop$ - } - { swap$ - pop$ - } - if$ - } - if$ -} -FUNCTION {bibinfo.warn} -{ swap$ - duplicate$ missing$ - { - swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ - "" - } - { duplicate$ empty$ - { - swap$ "empty " swap$ * " in " * cite$ * warning$ - } - { swap$ - pop$ - } - if$ - } - if$ -} -FUNCTION {format.url} -{ url empty$ - { "" } - { "\urlprefix\url{" url * "}" * } - if$ -} - -STRINGS { bibinfo} -INTEGERS { nameptr namesleft numnames } - -FUNCTION {format.names} -{ 'bibinfo := - duplicate$ empty$ 'skip$ { - 's := - "" 't := - #1 'nameptr := - s num.names$ 'numnames := - numnames 'namesleft := - { namesleft #0 > } - { s nameptr - "{ff~}{vv~}{ll}{, jj}" - format.name$ - bibinfo bibinfo.check - 't := - nameptr #1 > - { - nameptr #1 - #1 + = - numnames #2 - > and - { "others" 't := - #1 'namesleft := } - 'skip$ - if$ - namesleft #1 > - { ", " * t * } - { - numnames #2 > - { "," * } - 'skip$ - if$ - s nameptr "{ll}" format.name$ duplicate$ "others" = - { 't := } - { pop$ } - if$ - t "others" = - { - " " * bbl.etal * - } - { - bbl.and - space.word * t * - } - if$ - } - if$ - } - 't - if$ - nameptr #1 + 'nameptr := - namesleft #1 - 'namesleft := - } - while$ - } if$ -} -FUNCTION {format.names.ed} -{ - format.names -} -FUNCTION {format.authors} -{ author "author" format.names -} -FUNCTION {get.bbl.editor} -{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } - -FUNCTION {format.editors} -{ editor "editor" format.names duplicate$ empty$ 'skip$ - { - " " * - get.bbl.editor - "(" swap$ * ")" * - * - } - if$ -} -FUNCTION {format.note} -{ - note empty$ - { "" } - { note #1 #1 substring$ - duplicate$ "{" = - 'skip$ - { output.state mid.sentence = - { "l" } - { "u" } - if$ - change.case$ - } - if$ - note #2 global.max$ substring$ * "note" bibinfo.check - } - if$ -} - -FUNCTION {format.title} -{ title - "title" bibinfo.check - duplicate$ empty$ 'skip$ - { - "\enquote{" swap$ * - "}, " * - } - if$ -} -FUNCTION {end.quote.title} -{ title empty$ - 'skip$ - { before.all 'output.state := } - if$ -} -FUNCTION {output.bibitem} -{ newline$ - "\bibitem{" write$ - cite$ write$ - "}" write$ - newline$ - "" - before.all 'output.state := -} - -FUNCTION {n.dashify} -{ - 't := - "" - { t empty$ not } - { t #1 #1 substring$ "-" = - { t #1 #2 substring$ "--" = not - { "--" * - t #2 global.max$ substring$ 't := - } - { { t #1 #1 substring$ "-" = } - { "-" * - t #2 global.max$ substring$ 't := - } - while$ - } - if$ - } - { t #1 #1 substring$ * - t #2 global.max$ substring$ 't := - } - if$ - } - while$ -} - -FUNCTION {word.in} -{ bbl.in - " " * } - -FUNCTION {format.date} -{ - "" - duplicate$ empty$ - year "year" bibinfo.check duplicate$ empty$ - { swap$ 'skip$ - { "there's a month but no year in " cite$ * warning$ } - if$ - * - } - { swap$ 'skip$ - { - swap$ - " " * swap$ - } - if$ - * - } - if$ - duplicate$ empty$ - 'skip$ - { - before.all 'output.state := - ", " swap$ * - } - if$ -} -FUNCTION {format.btitle} -{ title "title" bibinfo.check - duplicate$ empty$ 'skip$ - { - emphasize - } - if$ -} -FUNCTION {either.or.check} -{ empty$ - 'pop$ - { "can't use both " swap$ * " fields in " * cite$ * warning$ } - if$ -} -FUNCTION {format.bvolume} -{ volume empty$ - { "" } - { bbl.volume volume tie.or.space.prefix - "volume" bibinfo.check * * - series "series" bibinfo.check - duplicate$ empty$ 'pop$ - { swap$ bbl.of space.word * swap$ - emphasize * } - if$ - "volume and number" number either.or.check - } - if$ -} -FUNCTION {format.number.series} -{ volume empty$ - { number empty$ - { series field.or.null } - { series empty$ - { number "number" bibinfo.check } - { output.state mid.sentence = - { bbl.number } - { bbl.number capitalize } - if$ - number tie.or.space.prefix "number" bibinfo.check * * - bbl.in space.word * - series "series" bibinfo.check * - } - if$ - } - if$ - } - { "" } - if$ -} -FUNCTION {is.num} -{ chr.to.int$ - duplicate$ "0" chr.to.int$ < not - swap$ "9" chr.to.int$ > not and -} - -FUNCTION {extract.num} -{ duplicate$ 't := - "" 's := - { t empty$ not } - { t #1 #1 substring$ - t #2 global.max$ substring$ 't := - duplicate$ is.num - { s swap$ * 's := } - { pop$ "" 't := } - if$ - } - while$ - s empty$ - 'skip$ - { pop$ s } - if$ -} - -FUNCTION {convert.edition} -{ extract.num "l" change.case$ 's := - s "first" = s "1" = or - { bbl.first 't := } - { s "second" = s "2" = or - { bbl.second 't := } - { s "third" = s "3" = or - { bbl.third 't := } - { s "fourth" = s "4" = or - { bbl.fourth 't := } - { s "fifth" = s "5" = or - { bbl.fifth 't := } - { s #1 #1 substring$ is.num - { s eng.ord 't := } - { edition 't := } - if$ - } - if$ - } - if$ - } - if$ - } - if$ - } - if$ - t -} - -FUNCTION {format.edition} -{ edition duplicate$ empty$ 'skip$ - { - convert.edition - output.state mid.sentence = - { "l" } - { "t" } - if$ change.case$ - "edition" bibinfo.check - " " * bbl.edition * - } - if$ -} -INTEGERS { multiresult } -FUNCTION {multi.page.check} -{ 't := - #0 'multiresult := - { multiresult not - t empty$ not - and - } - { t #1 #1 substring$ - duplicate$ "-" = - swap$ duplicate$ "," = - swap$ "+" = - or or - { #1 'multiresult := } - { t #2 global.max$ substring$ 't := } - if$ - } - while$ - multiresult -} -FUNCTION {format.pages} -{ pages duplicate$ empty$ 'skip$ - { duplicate$ multi.page.check - { - bbl.pages swap$ - n.dashify - } - { - bbl.page swap$ - } - if$ - tie.or.space.prefix - "pages" bibinfo.check - * * - } - if$ -} -FUNCTION {format.journal.pages} -{ pages duplicate$ empty$ 'pop$ - { swap$ duplicate$ empty$ - { pop$ pop$ format.pages } - { - ", " * - swap$ - n.dashify - pages multi.page.check - 'bbl.pages - 'bbl.page - if$ - swap$ tie.or.space.prefix - "pages" bibinfo.check - * * - * - } - if$ - } - if$ -} -FUNCTION {format.vol.num.pages} -{ volume field.or.null - duplicate$ empty$ 'skip$ - { - "volume" bibinfo.check - } - if$ - number "number" bibinfo.check duplicate$ empty$ 'skip$ - { - swap$ duplicate$ empty$ - { "there's a number but no volume in " cite$ * warning$ } - 'skip$ - if$ - swap$ - "(" swap$ * ")" * - } - if$ * -} - -FUNCTION {format.chapter.pages} -{ chapter empty$ - { "" } - { type empty$ - { bbl.chapter } - { type "l" change.case$ - "type" bibinfo.check - } - if$ - chapter tie.or.space.prefix - "chapter" bibinfo.check - * * - } - if$ -} - -FUNCTION {format.booktitle} -{ - booktitle "booktitle" bibinfo.check - emphasize -} -FUNCTION {format.in.ed.booktitle} -{ format.booktitle duplicate$ empty$ 'skip$ - { - editor "editor" format.names.ed duplicate$ empty$ 'pop$ - { - bbl.edby - " " * swap$ * - swap$ - "," * - " " * swap$ - * } - if$ - word.in swap$ * - } - if$ -} -FUNCTION {empty.misc.check} -{ author empty$ title empty$ howpublished empty$ - month empty$ year empty$ note empty$ - and and and and and - { "all relevant fields are empty in " cite$ * warning$ } - 'skip$ - if$ -} -FUNCTION {format.thesis.type} -{ type duplicate$ empty$ - 'pop$ - { swap$ pop$ - "t" change.case$ "type" bibinfo.check - } - if$ -} -FUNCTION {format.tr.number} -{ number "number" bibinfo.check - type duplicate$ empty$ - { pop$ bbl.techrep } - 'skip$ - if$ - "type" bibinfo.check - swap$ duplicate$ empty$ - { pop$ "t" change.case$ } - { tie.or.space.prefix * * } - if$ -} -FUNCTION {format.article.crossref} -{ - key duplicate$ empty$ - { pop$ - journal duplicate$ empty$ - { "need key or journal for " cite$ * " to crossref " * crossref * warning$ } - { "journal" bibinfo.check emphasize word.in swap$ * } - if$ - } - { word.in swap$ * " " *} - if$ - " \cite{" * crossref * "}" * -} -FUNCTION {format.crossref.editor} -{ editor #1 "{vv~}{ll}" format.name$ - "editor" bibinfo.check - editor num.names$ duplicate$ - #2 > - { pop$ - "editor" bibinfo.check - " " * bbl.etal - * - } - { #2 < - 'skip$ - { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = - { - "editor" bibinfo.check - " " * bbl.etal - * - } - { - bbl.and space.word - * editor #2 "{vv~}{ll}" format.name$ - "editor" bibinfo.check - * - } - if$ - } - if$ - } - if$ -} -FUNCTION {format.book.crossref} -{ volume duplicate$ empty$ - { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ - pop$ word.in - } - { bbl.volume - swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * - } - if$ - editor empty$ - editor field.or.null author field.or.null = - or - { key empty$ - { series empty$ - { "need editor, key, or series for " cite$ * " to crossref " * - crossref * warning$ - "" * - } - { series emphasize * } - if$ - } - { key * } - if$ - } - { format.crossref.editor * } - if$ - " \cite{" * crossref * "}" * -} -FUNCTION {format.incoll.inproc.crossref} -{ - editor empty$ - editor field.or.null author field.or.null = - or - { key empty$ - { format.booktitle duplicate$ empty$ - { "need editor, key, or booktitle for " cite$ * " to crossref " * - crossref * warning$ - } - { word.in swap$ * } - if$ - } - { word.in key * " " *} - if$ - } - { word.in format.crossref.editor * " " *} - if$ - " \cite{" * crossref * "}" * -} -FUNCTION {format.org.or.pub} -{ 't := - "" - address empty$ t empty$ and - 'skip$ - { - t empty$ - { address "address" bibinfo.check * - } - { t * - address empty$ - 'skip$ - { ", " * address "address" bibinfo.check * } - if$ - } - if$ - } - if$ -} -FUNCTION {format.publisher.address} -{ publisher "publisher" bibinfo.warn format.org.or.pub -} - -FUNCTION {format.organization.address} -{ organization "organization" bibinfo.check format.org.or.pub -} - -FUNCTION {article} -{ output.bibitem - format.authors "author" output.check - format.title "title" output.check - end.quote.title - crossref missing$ - { - journal - remove.dots - "journal" bibinfo.check - emphasize - "journal" output.check - format.vol.num.pages output - format.date "year" output.check - } - { format.article.crossref output.nonnull - } - if$ - format.journal.pages - format.url output - format.note output - fin.entry -} -FUNCTION {book} -{ output.bibitem - author empty$ - { format.editors "author and editor" output.check - } - { format.authors output.nonnull - crossref missing$ - { "author and editor" editor either.or.check } - 'skip$ - if$ - } - if$ - format.btitle "title" output.check - crossref missing$ - { format.bvolume output - format.number.series output - format.publisher.address output - } - { - format.book.crossref output.nonnull - } - if$ - format.edition output - format.date "year" output.check - format.url output - format.note output - fin.entry -} -FUNCTION {booklet} -{ output.bibitem - format.authors output - format.title "title" output.check - end.quote.title - howpublished "howpublished" bibinfo.check output - address "address" bibinfo.check output - format.date output - format.url output - format.note output - fin.entry -} - -FUNCTION {inbook} -{ output.bibitem - author empty$ - { format.editors "author and editor" output.check - } - { format.authors output.nonnull - crossref missing$ - { "author and editor" editor either.or.check } - 'skip$ - if$ - } - if$ - format.btitle "title" output.check - crossref missing$ - { - format.publisher.address output - format.bvolume output - format.chapter.pages "chapter and pages" output.check - format.number.series output - } - { - format.chapter.pages "chapter and pages" output.check - format.book.crossref output.nonnull - } - if$ - format.edition output - format.date "year" output.check - format.pages "pages" output.check - format.url output - format.note output - fin.entry -} - -FUNCTION {incollection} -{ output.bibitem - format.authors "author" output.check - format.title "title" output.check - end.quote.title - crossref missing$ - { format.in.ed.booktitle "booktitle" output.check - format.publisher.address output - format.bvolume output - format.number.series output - format.chapter.pages output - format.edition output - format.date "year" output.check - } - { format.incoll.inproc.crossref output.nonnull - format.chapter.pages output - } - if$ - format.pages "pages" output.check - format.url output - format.note output - fin.entry -} -FUNCTION {inproceedings} -{ output.bibitem - format.authors "author" output.check - format.title "title" output.check - end.quote.title - crossref missing$ - { format.in.ed.booktitle "booktitle" output.check - publisher empty$ - { format.organization.address output } - { organization "organization" bibinfo.check output - format.publisher.address output - } - if$ - format.date "year" output.check - format.bvolume output - format.number.series output - } - { format.incoll.inproc.crossref output.nonnull - } - if$ - format.pages "pages" output.check - format.url output - format.note output - fin.entry -} -FUNCTION {conference} { inproceedings } -FUNCTION {manual} -{ output.bibitem - author empty$ - { organization "organization" bibinfo.check - duplicate$ empty$ 'pop$ - { output - address "address" bibinfo.check output - } - if$ - } - { format.authors output.nonnull } - if$ - format.btitle "title" output.check - author empty$ - { organization empty$ - { - address "address" bibinfo.check output - } - 'skip$ - if$ - } - { - organization "organization" bibinfo.check output - address "address" bibinfo.check output - } - if$ - format.edition output - format.date output - format.url output - format.note output - fin.entry -} - -FUNCTION {mastersthesis} -{ output.bibitem - format.authors "author" output.check - format.btitle - "title" output.check - bbl.mthesis format.thesis.type output.nonnull - school "school" bibinfo.warn output - address "address" bibinfo.check output - format.date "year" output.check - format.url output - format.note output - fin.entry -} - -FUNCTION {misc} -{ output.bibitem - format.authors output - format.title output - end.quote.title - howpublished "howpublished" bibinfo.check output - format.date output - format.url output - format.note output - fin.entry - empty.misc.check -} -FUNCTION {phdthesis} -{ output.bibitem - format.authors "author" output.check - format.btitle - "title" output.check - bbl.phdthesis format.thesis.type output.nonnull - school "school" bibinfo.warn output - address "address" bibinfo.check output - format.date "year" output.check - format.url output - format.note output - fin.entry -} - -FUNCTION {proceedings} -{ output.bibitem - editor empty$ - { organization "organization" bibinfo.check output - } - { format.editors output.nonnull } - if$ - format.btitle "title" output.check - format.bvolume output - format.number.series output - editor empty$ - { publisher empty$ - 'skip$ - { - format.publisher.address output - } - if$ - } - { publisher empty$ - { - format.organization.address output } - { - organization "organization" bibinfo.check output - format.publisher.address output - } - if$ - } - if$ - format.date "year" output.check - format.url output - format.note output - fin.entry -} - -FUNCTION {techreport} -{ output.bibitem - format.authors "author" output.check - format.btitle - "title" output.check - format.tr.number output.nonnull - institution "institution" bibinfo.warn output - address "address" bibinfo.check output - format.date "year" output.check - format.url output - format.note output - fin.entry -} - -FUNCTION {unpublished} -{ output.bibitem - format.authors "author" output.check - format.title "title" output.check - end.quote.title - format.date output - format.url output - format.note "note" output.check - fin.entry -} - -FUNCTION {default.type} { misc } -READ -STRINGS { longest.label } -INTEGERS { number.label longest.label.width } -FUNCTION {initialize.longest.label} -{ "" 'longest.label := - #1 'number.label := - #0 'longest.label.width := -} -FUNCTION {longest.label.pass} -{ number.label int.to.str$ 'label := - number.label #1 + 'number.label := - label width$ longest.label.width > - { label 'longest.label := - label width$ 'longest.label.width := - } - 'skip$ - if$ -} -EXECUTE {initialize.longest.label} -ITERATE {longest.label.pass} -FUNCTION {begin.bib} -{ preamble$ empty$ - 'skip$ - { preamble$ write$ newline$ } - if$ - "\begin{thebibliography}{" longest.label * "}" * - write$ newline$ - "\newcommand{\enquote}[1]{``#1''}" - write$ newline$ - "\expandafter\ifx\csname url\endcsname\relax" - write$ newline$ - " \def\url#1{\texttt{#1}}\fi" - write$ newline$ - "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi" - write$ newline$ -} -EXECUTE {begin.bib} -EXECUTE {init.state.consts} -ITERATE {call.type$} -FUNCTION {end.bib} -{ newline$ - "\end{thebibliography}" write$ newline$ -} -EXECUTE {end.bib} -%% End of customized bst file -%% -%% End of file `tufte.bst'. diff --git a/inst/rmarkdown/templates/tufte_ebook/template.yaml b/inst/rmarkdown/templates/tufte_ebook/template.yaml deleted file mode 100644 index cd0b70b7e..000000000 --- a/inst/rmarkdown/templates/tufte_ebook/template.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: Tufte e-Book (PDF) -description: > - Template for creating a book according to the style of - Edward R. Tufte and Richard Feynman. -create_dir: true diff --git a/inst/rmarkdown/templates/use_r_abstract/resources/chicago-author-date.csl b/inst/rmarkdown/templates/use_r_abstract/resources/chicago-author-date.csl deleted file mode 100644 index bc5a8993f..000000000 --- a/inst/rmarkdown/templates/use_r_abstract/resources/chicago-author-date.csl +++ /dev/null @@ -1,499 +0,0 @@ - - diff --git a/inst/rmarkdown/templates/use_r_abstract/resources/template.tex b/inst/rmarkdown/templates/use_r_abstract/resources/template.tex deleted file mode 100644 index 9c7582155..000000000 --- a/inst/rmarkdown/templates/use_r_abstract/resources/template.tex +++ /dev/null @@ -1,62 +0,0 @@ -\documentclass[11pt, a4paper]{article} -\usepackage[utf8]{inputenc} -\usepackage{amsfonts, amsmath, hanging, hyperref, parskip, times} -\usepackage[numbers]{natbib} -\usepackage[pdftex]{graphicx} -\hypersetup{ - colorlinks, - linkcolor=blue, - urlcolor=blue, - citecolor=blue -} - -\let\section=\subsubsection -\newcommand{\pkg}[1]{{\normalfont\fontseries{b}\selectfont #1}} -\let\proglang=\textit -\let\code=\texttt -\renewcommand{\title}[1]{\begin{center}{\bf \LARGE #1}\end{center}} -\newcommand{\affiliations}{\footnotesize\centering} -\newcommand{\keywords}{\paragraph{Keywords:}} - -\providecommand{\tightlist}{% - \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} - -\setlength{\topmargin}{-15mm} -\setlength{\oddsidemargin}{-2mm} -\setlength{\textwidth}{165mm} -\setlength{\textheight}{250mm} - -\begin{document} -\pagestyle{empty} - -\title{$title$} - -\begin{center} - {\bf $for(author)$$author.name$$$^{$for(author.affiliation)$$author.affiliation$$sep$, $endfor$$if(author.contact)$,^\star$endif$}$$$sep$, $endfor$} -\end{center} - -\vskip 0.3cm - -\begin{affiliations} -\begin{enumerate} -\begin{minipage}{0.915\textwidth} -\centering -$for(affiliation)$ -\item $affiliation$ \\[-2pt] -$endfor$ -\end{minipage} -\end{enumerate} -$for(author)$ -$if(author.contact)$ -$$^\star$$Contact author: $author.email$\\ -$endif$ -$endfor$ -\end{affiliations} - -\keywords $keywords$ - -\vskip 0.8cm - -$body$ - -\end{document} diff --git a/inst/rmarkdown/templates/use_r_abstract/skeleton/bibliography.bib b/inst/rmarkdown/templates/use_r_abstract/skeleton/bibliography.bib deleted file mode 100644 index d39ffe178..000000000 --- a/inst/rmarkdown/templates/use_r_abstract/skeleton/bibliography.bib +++ /dev/null @@ -1,16 +0,0 @@ -@misc{ref1, - author = {AuthorA}, - title = {Title of a web resource}, - howpublished = {\url{http://url/of/resource/}}, - year = {2007} -} - -@article{ref2, - author = {AuthorC}, - journal = {Journal name}, - pages = {13--17}, - title = {Title of an article}, - volume = {6}, - year = {2008} -} - diff --git a/inst/rmarkdown/templates/use_r_abstract/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/use_r_abstract/skeleton/skeleton.Rmd deleted file mode 100644 index d83a0a1af..000000000 --- a/inst/rmarkdown/templates/use_r_abstract/skeleton/skeleton.Rmd +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Title of Your Submission" -author: - - name: FirstNameA LastNameA - affiliation: [1,2] - email: foo@bar.com - contact: yes - - name: FirstNameB LastNameB - affiliation: [1,3] -affiliation: - - Affiliation of author A and author B - - Second affiliation of author A - - Second affiliation of author B -keywords: First, Second, ... up to 5 keywords -bibliography: bibliography.bib -output: rticles::use_r_abstract ---- - -Some suggestions and rules: If you mention a programming language like \proglang{R}, typeset the language name with the `\proglang` macro. If you mention an \proglang{R} function `foo`, typeset the function name with standard markdown backticks. If you mention an \proglang{R} package \pkg{fooPkg}, typeset the package name with the `\pkg` macro. - -Textual, *e.g.* "[@ref1] jumped over the fence" and parenthetical, *e.g.* "The fence was jumped [-@ref2]" citations may appear within the abstract. - -Itemized lists are allowed in abstracts, but may be wasteful of space, which is *strictly limited*. Avoid itemized lists if possible, but gracefully. **Abstracts should not exceed one US letter (8.5 x 11 inches) page**. The page should not be numbered. - -**References** - - diff --git a/inst/rmarkdown/templates/use_r_abstract/template.yaml b/inst/rmarkdown/templates/use_r_abstract/template.yaml deleted file mode 100644 index fe45da39a..000000000 --- a/inst/rmarkdown/templates/use_r_abstract/template.yaml +++ /dev/null @@ -1,6 +0,0 @@ -name: useR Conference Abstract -description: > - Template for creating abstract submissions for the 2014 - useR conference at UCLA. -create_dir: true - diff --git a/man/acm_article.Rd b/man/acm_article.Rd new file mode 100644 index 000000000..e869284b1 --- /dev/null +++ b/man/acm_article.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/acm_article.R +\name{acm_article} +\alias{acm_article} +\title{Association for Computing Machinery (ACM) format.} +\usage{ +acm_article(...) +} +\arguments{ +\item{...}{Arguments to \code{rmarkdown::pdf_document}} +} +\value{ +R Markdown output format to pass to \code{\link[rmarkdown:render]{render}} +} +\description{ +Format for creating an Association for Computing Machinery (ACM) articles. +Adapted from +\href{http://www.acm.org/publications/article-templates/proceedings-template.html}{http://www.acm.org/publications/article-templates/proceedings-template.html}. +} +\examples{ + +\dontrun{ +library(rmarkdown) +draft("MyArticle.Rmd", template = "acm_article", package = "rticles") +} + +} + diff --git a/man/acs_article.Rd b/man/acs_article.Rd new file mode 100644 index 000000000..1696e1049 --- /dev/null +++ b/man/acs_article.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/acs_article.R +\name{acs_article} +\alias{acs_article} +\title{American Chemical Society (ACS) Journal format.} +\usage{ +acs_article(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris"), + fig_caption = TRUE) +} +\arguments{ +\item{...}{Arguments to \code{rmarkdown::pdf_document}} + +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} + +\item{md_extensions}{Markdown extensions to be added or removed from the +default definition or R Markdown. See the \code{\link{rmarkdown_format}} for +additional details.} + +\item{fig_caption}{\code{TRUE} to render figures with captions} +} +\value{ +R Markdown output format to pass to \code{\link[rmarkdown:render]{render}} +} +\description{ +Format for creating an American Chemical Society (ACS) Journal articles. +Adapted from +\href{http://pubs.acs.org/page/4authors/submission/tex.html}{http://pubs.acs.org/page/4authors/submission/tex.html}. +} +\examples{ + +\dontrun{ +library(rmarkdown) +draft("MyArticle.Rmd", template = "acs_article", package = "rticles") +} + +} + diff --git a/man/ctex.Rd b/man/ctex.Rd new file mode 100644 index 000000000..c36eb2bc0 --- /dev/null +++ b/man/ctex.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ctex.R +\name{ctex} +\alias{ctex} +\alias{ctex_template} +\title{A PDF format for documents based on the LaTeX package \pkg{ctex}} +\usage{ +ctex(..., template = ctex_template(), latex_engine = "xelatex") + +ctex_template() +} +\arguments{ +\item{..., template, latex_engine}{Passed to +\code{markdown::\link[rmarkdown]{pdf_document}()}} +} +\value{ +\code{ctex()} returns a format that can be passed to + \code{rmarkdown::render()}; \code{ctex_template()} returns the path to a + LaTeX template in \pkg{rticles} for Chinese documents using the \pkg{ctex} + package. +} +\description{ +\code{ctex()} is a wrapper function for \code{rmarkdown::pdf_document()} and +changed the default values of two arguments \code{template} and +\code{latex_engine} so it works better with the \pkg{ctex} package. +} +\examples{ + +\dontrun{ +library(rmarkdown) +draft("MyArticle.Rmd", template = "ctex", package = "rticles") +} + +} + diff --git a/man/ctex_template.Rd b/man/ctex_template.Rd deleted file mode 100644 index 4150e79b8..000000000 --- a/man/ctex_template.Rd +++ /dev/null @@ -1,13 +0,0 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/ctex.R -\name{ctex_template} -\alias{ctex_template} -\title{A LaTeX template for Chinese documents} -\usage{ -ctex_template() -} -\description{ -This function returns the path to a LaTeX template for Chinese documents -using the ctex package. -} - diff --git a/man/elsevier_article.Rd b/man/elsevier_article.Rd new file mode 100644 index 000000000..004d51a07 --- /dev/null +++ b/man/elsevier_article.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/elsevier_article.R +\name{elsevier_article} +\alias{elsevier_article} +\title{Elsevier journal format.} +\usage{ +elsevier_article(..., keep_tex = TRUE, + md_extensions = c("-autolink_bare_uris")) +} +\arguments{ +\item{...}{Additional arguments to \code{rmarkdown::pdf_document}} + +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} + +\item{md_extensions}{Markdown extensions to be added or removed from the +default definition or R Markdown. See the \code{\link{rmarkdown_format}} for +additional details.} +} +\value{ +R Markdown output format to pass to + \code{\link[rmarkdown:render]{render}} +} +\description{ +Format for creating submissions to Elsevier journals. Adapted from +\href{https://www.elsevier.com/authors/author-schemas/latex-instructions}{https://www.elsevier.com/authors/author-schemas/latex-instructions}. +} +\examples{ + +\dontrun{ +library(rmarkdown) +draft("MyArticle.Rmd", template = "elsevier_article", package = "rticles") +} + +} + diff --git a/man/jss_article.Rd b/man/jss_article.Rd new file mode 100644 index 000000000..8dcb47ff9 --- /dev/null +++ b/man/jss_article.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/jss_article.R +\name{jss_article} +\alias{jss_article} +\title{Journal of Statistical Software (JSS) format.} +\usage{ +jss_article(..., keep_tex = TRUE) +} +\arguments{ +\item{...}{Arguments to \code{rmarkdown::pdf_document}} + +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} +} +\value{ +R Markdown output format to pass to + \code{\link[rmarkdown:render]{render}} +} +\description{ +Format for creating a Journal of Statistical Software (JSS) articles. Adapted +from +\href{http://www.jstatsoft.org/about/submissions}{http://www.jstatsoft.org/about/submissions}. +} +\examples{ + +\dontrun{ +library(rmarkdown) +draft("MyArticle.Rmd", template = "jss_article", package = "rticles") +} + +} + diff --git a/man/rjournal_article.Rd b/man/rjournal_article.Rd new file mode 100644 index 000000000..ca545ae02 --- /dev/null +++ b/man/rjournal_article.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/rjournal_article.R +\name{rjournal_article} +\alias{rjournal_article} +\title{R Journal format.} +\usage{ +rjournal_article(...) +} +\arguments{ +\item{...}{Arguments to \code{rmarkdown::pdf_document}} +} +\value{ +R Markdown output format to pass to + \code{\link[rmarkdown:render]{render}} +} +\description{ +Format for creating R Journal articles. Adapted from +\href{https://journal.r-project.org/submissions.html}{https://journal.r-project.org/submissions.html}. +} +\examples{ + +\dontrun{ +library(rmarkdown) +draft("MyArticle.Rmd", template = "rjournal_article", package = "rticles") +} + +} + diff --git a/man/template_pandoc.Rd b/man/template_pandoc.Rd deleted file mode 100644 index 1952bf13b..000000000 --- a/man/template_pandoc.Rd +++ /dev/null @@ -1,30 +0,0 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/rjournal_article.R -\name{template_pandoc} -\alias{template_pandoc} -\title{Render a pandoc template.} -\usage{ -template_pandoc(metadata, template, output, verbose = FALSE) -} -\arguments{ -\item{metadata}{A named list containing metadata to pass to template.} - -\item{template}{Path to a pandoc template.} - -\item{output}{Path to save output.} -} -\value{ -(Invisibly) The path of the generate file. -} -\description{ -This is a hacky way to access the pandoc templating engine. -} -\examples{ -x <- rticles:::template_pandoc( - list(preamble = "\%abc", filename = "wickham"), - rticles:::find_resource("rjournal_article", "RJwrapper.tex"), - tempfile() -) -if (interactive()) file.show(x) -} - diff --git a/man/tufte_ebook.Rd b/man/tufte_ebook.Rd deleted file mode 100644 index 71ba78e44..000000000 --- a/man/tufte_ebook.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/tufte_ebook.R -\name{tufte_ebook} -\alias{tufte_ebook} -\title{Tufte e-Book format (PDF)} -\usage{ -tufte_ebook(toc = TRUE, toc_depth = 3, number_sections = TRUE, - fig_width = 4, fig_height = 2.5, fig_crop = TRUE, - highlight = "default", keep_tex = FALSE, latex_engine = "xelatex", - includes = NULL, pandoc_args = NULL, ...) -} -\arguments{ -\item{latex_engine}{LaTeX engine for producing PDF output. Options are - "pdflatex", "lualatex", and "xelatex". Note that lualatex may have - problems with text spacing, and that pdflatex may have memory issues - when using tikzDevice.} -} -\description{ -Template for creating an e-book based on the style of -Edward R. Tufte and Richard Feynman. -} - diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 000000000..e2603d83c --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,4 @@ +library(testthat) +library(rticles) + +test_check("rticles") diff --git a/tests/testthat/test_formats.R b/tests/testthat/test_formats.R new file mode 100644 index 000000000..3f11d4317 --- /dev/null +++ b/tests/testthat/test_formats.R @@ -0,0 +1,51 @@ + +context("Formats") + +test_format <- function(name, file_check = TRUE, os_skip = NULL) { + + test_that(paste(name, "format"), { + + # don't run on cran because pandoc is required + skip_on_cran() + + # skip on os if requested + if (!is.null(os_skip)) + skip_on_os(os_skip) + + # work in a temp directory + dir <- tempfile() + dir.create(dir) + oldwd <- setwd(dir) + on.exit(setwd(oldwd), add = TRUE) + + # create a draft of the format + testdoc <- "testdoc.Rmd" + rmarkdown::draft(testdoc, + system.file("rmarkdown", "templates", name, + package = "rticles"), + create_dir = FALSE, + edit = FALSE) + + # render it + capture.output({ + if (file_check) { + output_file <- tempfile(fileext = ".pdf") + rmarkdown::render(testdoc, output_file = output_file) + expect_true(file.exists(output_file)) + } else { + rmarkdown::render(testdoc) + } + }) + }) +} + +test_format("acm_article") +test_format("elsevier_article") +test_format("jss_article") +test_format("rjournal_article", file_check = FALSE) +test_format("acs_article", os_skip = "windows") + + + + +