Skip to content

Commit

Permalink
fix #1161: default self_contained = TRUE for beamer_presentation() (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui authored Oct 23, 2017
1 parent 9cd2c7f commit 76ef4d7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
13 changes: 11 additions & 2 deletions R/beamer_presentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@
#' @param theme Beamer theme (e.g. "AnnArbor").
#' @param colortheme Beamer color theme (e.g. "dolphin").
#' @param fonttheme Beamer font theme (e.g. "structurebold").
#' @param self_contained Whether to generate a full LaTeX document (\code{TRUE})
#' or just the body of a LaTeX document (\code{FALSE}). Note the LaTeX
#' document is an intermediate file unless \code{keep_tex = TRUE}.
#'
#' @return R Markdown output format to pass to \code{\link{render}}
#'
#' @details
#'
#' See the \href{http://rmarkdown.rstudio.com/beamer_presentation_format.html}{online
#' documentation} for additional details on using the \code{beamer_presentation} format.
#' See the
#' \href{http://rmarkdown.rstudio.com/beamer_presentation_format.html}{online
#' documentation} for additional details on using the \code{beamer_presentation}
#' format.
#'
#' Creating Beamer output from R Markdown requires that LaTeX be installed.
#'
Expand Down Expand Up @@ -69,6 +74,7 @@ beamer_presentation <- function(toc = FALSE,
keep_tex = FALSE,
latex_engine = "pdflatex",
citation_package = c("none", "natbib", "biblatex"),
self_contained = TRUE,
includes = NULL,
md_extensions = NULL,
pandoc_args = NULL) {
Expand Down Expand Up @@ -116,6 +122,9 @@ beamer_presentation <- function(toc = FALSE,
citation_package <- match.arg(citation_package)
if (citation_package != "none") args <- c(args, paste0("--", citation_package))

# generate a self-contained LaTeX document (including preamble)
if (self_contained) args <- c(args, "--self-contained")

# content includes
args <- c(args, includes_to_pandoc_args(includes))

Expand Down
2 changes: 1 addition & 1 deletion R/slidy_presentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#'
#' Format for converting from R Markdown to a slidy presentation.
#'
#' @inheritParams beamer_presentation
#' @inheritParams pdf_document
#' @inheritParams html_document
#' @inheritParams beamer_presentation
#'
#' @param duration Duration (in minutes) of the slide deck. This value is used
#' to add a countdown timer to the slide footer.
Expand Down
2 changes: 2 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ rmarkdown 1.7 (unreleased)
* `render()` will stop if the output format is PDF but there are any errors
during building the index or bibliography (#1166).

* `beamer_presentation()` doesn't work when `citation_package != 'none'` (#1161).

rmarkdown 1.6
--------------------------------------------------------------------------------

Expand Down
14 changes: 10 additions & 4 deletions man/beamer_presentation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 76ef4d7

Please sign in to comment.