diff --git a/R/revealjs_presentation.R b/R/revealjs_presentation.R
index d6d3d7d..b345c51 100644
--- a/R/revealjs_presentation.R
+++ b/R/revealjs_presentation.R
@@ -1,69 +1,68 @@
 #' Convert to a reveal.js presentation
-#' 
+#'
 #' Format for converting from R Markdown to a reveal.js presentation.
-#' 
+#'
 #' @inheritParams rmarkdown::beamer_presentation
 #' @inheritParams rmarkdown::pdf_document
 #' @inheritParams rmarkdown::html_document
-#'   
+#'
 #' @param smart Produce typographically correct output, converting straight
 #'  quotes to curly quotes, \code{---} to em-dashes, \code{--} to en-dashes, and
 #'  \code{...} to ellipses.
 #' @param center \code{TRUE} to vertically center content on slides
-#' @param slide_level Level of heading to denote individual slides. If 
-#'   \code{slide_level} is 2 (the default), a two-dimensional layout will be 
-#'   produced, with level 1 headers building horizontally and level 2 headers 
-#'   building vertically. It is not recommended that you use deeper nesting of 
+#' @param slide_level Level of heading to denote individual slides. If
+#'   \code{slide_level} is 2 (the default), a two-dimensional layout will be
+#'   produced, with level 1 headers building horizontally and level 2 headers
+#'   building vertically. It is not recommended that you use deeper nesting of
 #'   section levels with reveal.js.
-#' @param theme Visual theme ("simple", "sky", "beige", "serif", "solarized", 
+#' @param theme Visual theme ("simple", "sky", "beige", "serif", "solarized",
 #'   "blood", "moon", "night", "black", "league" or "white").
-#' @param transition Slide transition ("default", "none", "fade", "slide", 
+#' @param transition Slide transition ("default", "none", "fade", "slide",
 #'   "convex", "concave" or "zoom")
-#' @param background_transition Slide background-transition ("default", "none", 
+#' @param background_transition Slide background-transition ("default", "none",
 #'   "fade", "slide", "convex", "concave" or "zoom")
-#' @param reveal_options Additional options to specify for reveal.js (see 
+#' @param reveal_options Additional options to specify for reveal.js (see
 #'   \href{https://revealjs.com/config/}{https://revealjs.com/config/}
 #'    for details).
 #' @param reveal_plugins Reveal plugins to include. Available plugins include
 #'   "notes", "search", "zoom", "chalkboard", and "menu". Note that
 #'   \code{self_contained} must be set to \code{FALSE} in order to use Reveal
 #'   plugins.
-#' @param template Pandoc template to use for rendering. Pass "default" to use 
-#'   the rmarkdown package default template; pass \code{NULL} to use pandoc's 
-#'   built-in template; pass a path to use a custom template that you've 
-#'   created. Note that if you don't use the "default" template then some 
-#'   features of \code{revealjs_presentation} won't be available (see the 
+#' @param template Pandoc template to use for rendering. Pass "default" to use
+#'   the rmarkdown package default template; pass \code{NULL} to use pandoc's
+#'   built-in template; pass a path to use a custom template that you've
+#'   created. Note that if you don't use the "default" template then some
+#'   features of \code{revealjs_presentation} won't be available (see the
 #'   Templates section below for more details).
 #' @param extra_dependencies Additional function arguments to pass to the base R
 #'   Markdown HTML output formatter [rmarkdown::html_document_base()].
 #' @param ... Ignored
-#'   
+#'
 #' @return R Markdown output format to pass to \code{\link{render}}
-#'   
+#'
 #' @details
-#' 
+#'
 #' In reveal.js presentations you can use level 1 or level 2 headers for slides.
 #' If you use a mix of level 1 and level 2 headers then a two-dimensional layout
-#' will be produced, with level 1 headers building horizontally and level 2 
+#' will be produced, with level 1 headers building horizontally and level 2
 #' headers building vertically.
-#' 
-#' For additional documentation on using revealjs presentations see 
+#'
+#' For additional documentation on using revealjs presentations see
 #' \href{https://github.com/rstudio/revealjs}{https://github.com/rstudio/revealjs}.
-#' 
+#'
 #' @examples
 #' \dontrun{
-#' 
+#'
 #' library(rmarkdown)
 #' library(revealjs)
-#' 
+#'
 #' # simple invocation
 #' render("pres.Rmd", revealjs_presentation())
-#' 
+#'
 #' # specify an option for incremental rendering
 #' render("pres.Rmd", revealjs_presentation(incremental = TRUE))
 #' }
-#' 
-#' 
+#'
 #' @export
 revealjs_presentation <- function(incremental = FALSE,
                                   center = FALSE,
@@ -90,10 +89,10 @@
                                   extra_dependencies = NULL,
                                   md_extensions = NULL,
                                   ...) {
-  
+
   # base pandoc options for all reveal.js output
   args <- c()
-  
+
   # template path and assets
   if (identical(template, "default")) {
     default_template <- reveal_resources("default.html")
@@ -101,42 +100,42 @@
   } else if (!is.null(template)) {
     args <- c(args, "--template", pandoc_path_arg(template))
   }
-  
+
   # incremental
-  if (incremental)
-    args <- c(args, "--incremental")
-  
+  if (incremental) args <- c(args, "--incremental")
+
   # centering
   args <- c(args, pandoc_variable_arg("center", jsbool(center)))
-  
+
   # slide level
   args <- c(args, "--slide-level", as.character(slide_level))
-  
+
   # theme
   theme <- match.arg(theme, revealjs_themes())
-  if (identical(theme, "default"))
+  if (identical(theme, "default")) {
     theme <- "simple"
-  else if (identical(theme, "dark"))
+  } else if (identical(theme, "dark")) {
     theme <- "black"
-  if (theme %in% c("blood", "moon", "night", "black"))
+  }
+  if (theme %in% c("blood", "moon", "night", "black")) {
     args <- c(args, "--variable", "theme-dark")
-  args <- c(args, "--variable", paste("theme=", theme, sep=""))
-  
-  
+  }
+  args <- c(args, "--variable", paste("theme=", theme, sep = ""))
+
+
   # transition
   transition <- match.arg(transition, revealjs_transitions())
-  args <- c(args, "--variable", paste("transition=", transition, sep=""))
-  
+  args <- c(args, "--variable", paste("transition=", transition, sep = ""))
+
   # background_transition
   background_transition <- match.arg(background_transition, revealjs_transitions())
-  args <- c(args, "--variable", paste("backgroundTransition=", background_transition, sep=""))
-  
+  args <- c(args, "--variable", paste("backgroundTransition=", background_transition, sep = ""))
+
   # use history
   args <- c(args, pandoc_variable_arg("history", "true"))
-  
+
   # additional reveal options
   if (is.list(reveal_options)) {
-    
     add_reveal_option <- function(option, value) {
       if (is.logical(value)) {
         value <- jsbool(value)
@@ -144,26 +143,28 @@
         # Special handling for some chalkboard plugin options
         # e.g: color: [ 'rgba(0,0,255,1)', 'rgba(255,255,255,0.5)' ]
         if (grepl("chalkboard-(background|color|draw|pen)", option)) {
-          value <- sprintf('[%s]', paste(paste0("'", value, "'"), collapse = ", "))
+          value <- sprintf("[%s]", paste(paste0("'", value, "'"), collapse = ", "))
         }
         # Add quotes around some config that can be several type
         # like number or percent unit or slideNumber = true or slideNumber = 'c/t'
         if (
           option %in% c("slideNumber") ||
-          (option %in% c("width", "height") && grepl("%$", value))) {
+            (option %in% c("width", "height") && grepl("%$", value))) {
           value <- paste0("'", value, "'")
         }
       }
       args <<- c(args, pandoc_variable_arg(option, value))
     }
-    
+
     for (option in names(reveal_options)) {
       # special handling for nested options
       if (option %in% c("chalkboard", "menu")) {
         nested_options <- reveal_options[[option]]
         for (nested_option in names(nested_options)) {
-          add_reveal_option(paste0(option, "-", nested_option),
-                            nested_options[[nested_option]])
+          add_reveal_option(
+            paste0(option, "-", nested_option),
+            nested_options[[nested_option]]
+          )
         }
       }
       # standard top-level options
@@ -172,95 +173,111 @@
       }
     }
   }
-  
+
   # reveal plugins
   if (is.character(reveal_plugins)) {
-    
+
     # validate that we need to use self_contained for plugins
-    if (self_contained)
+    if (self_contained) {
       stop("Using reveal_plugins requires self_contained: false")
-    
+    }
+
     # validate specified plugins are supported
     supported_plugins <- c("notes", "search", "zoom", "chalkboard", "menu")
     invalid_plugins <- setdiff(reveal_plugins, supported_plugins)
-    if (length(invalid_plugins) > 0)
+    if (length(invalid_plugins) > 0) {
       stop("The following plugin(s) are not supported: ",
-           paste(invalid_plugins, collapse = ", "), call. = FALSE)
-    
+        paste(invalid_plugins, collapse = ", "),
+        call. = FALSE
+      )
+    }
+
     # add plugins
     sapply(reveal_plugins, function(plugin) {
       args <<- c(args, pandoc_variable_arg(paste0("plugin-", plugin), "1"))
       if (plugin %in% c("chalkboard", "menu")) {
-        extra_dependencies <<- append(extra_dependencies,
-                                     list(rmarkdown::html_dependency_font_awesome()))
-          
+        extra_dependencies <<- append(
+          extra_dependencies,
+          list(rmarkdown::html_dependency_font_awesome())
+        )
       }
-    })    
+    })
   }
-  
+
   # content includes
   args <- c(args, includes_to_pandoc_args(includes))
-  
+
   # additional css
-  for (css_file in css)
+  for (css_file in css) {
     args <- c(args, "--css", pandoc_path_arg(css_file))
-  
+  }
+
   # pre-processor for arguments that may depend on the name of the
   # the input file (e.g. ones that need to copy supporting files)
   pre_processor <- function(metadata, input_file, runtime, knit_meta, files_dir,
                             output_dir) {
-    
+
     # we don't work with runtime shiny
     if (identical(runtime, "shiny")) {
-      stop("revealjs_presentation is not compatible with runtime 'shiny'", 
-           call. = FALSE)
+      stop("revealjs_presentation is not compatible with runtime 'shiny'",
+        call. = FALSE
+      )
     }
-    
+
     # use files_dir as lib_dir if not explicitly specified
-    if (is.null(lib_dir))
+    if (is.null(lib_dir)) {
       lib_dir <- files_dir
-    
+    }
+
     # extra args
     args <- c()
-    
+
     # reveal.js
     revealjs_path <- system.file("reveal.js-3.3.0.1", package = "revealjs")
-    if (!self_contained || identical(.Platform$OS.type, "windows"))
+    if (!self_contained || identical(.Platform$OS.type, "windows")) {
       revealjs_path <- relative_to(
-        output_dir, render_supporting_files(revealjs_path, lib_dir))
-    else 
+        output_dir, render_supporting_files(revealjs_path, lib_dir)
+      )
+    } else {
       revealjs_path <- pandoc_path_arg(revealjs_path)
+    }
     args <- c(args, "--variable", paste0("revealjs-url=", revealjs_path))
-    
+
     # highlight
     args <- c(args, pandoc_highlight_args(highlight, default = "pygments"))
-    
+
     # return additional args
     args
   }
-  
+
   # return format
   output_format(
     knitr = knitr_options_html(fig_width, fig_height, fig_retina, keep_md),
-    pandoc = pandoc_options(to = "revealjs",
-                            from = rmarkdown_format(paste0(
-                              md_extensions,
-                              ifelse(fig_caption, "", "-implicit_figures")
-                            )),
-                            args = args),
+    pandoc = pandoc_options(
+      to = "revealjs",
+      from = rmarkdown_format(paste0(
+        md_extensions,
+        ifelse(fig_caption, "", "-implicit_figures")
+      )),
+      args = args
+    ),
     keep_md = keep_md,
     clean_supporting = self_contained,
     pre_processor = pre_processor,
-    base_format = html_document_base(smart = smart, lib_dir = lib_dir,
-                                     self_contained = self_contained,
-                                     mathjax = mathjax,
-                                     pandoc_args = pandoc_args, 
-                                     extra_dependencies = extra_dependencies,
-                                     ...))
+    base_format = html_document_base(
+      smart = smart, lib_dir = lib_dir,
+      self_contained = self_contained,
+      mathjax = mathjax,
+      pandoc_args = pandoc_args,
+      extra_dependencies = extra_dependencies,
+      ...
+    )
+  )
 }
 
 revealjs_themes <- function() {
-  c("default",
+  c(
+    "default",
     "dark",
     "simple",
     "sky",
@@ -272,7 +289,8 @@
     "night",
     "black",
     "league",
-    "white")
+    "white"
+  )
 }
 
 
@@ -285,7 +303,5 @@
     "convex",
     "concave",
     "zoom"
-    )
+  )
 }
-
-
