Skip to content

Commit

Permalink
close rstudio/bookdown#687: provide an output_extensions argument in …
Browse files Browse the repository at this point in the history
…pdf_document() to enable/disable Pandoc output extensions
  • Loading branch information
yihui committed May 9, 2019
1 parent 7ad693e commit 7d228fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rmarkdown
Type: Package
Title: Dynamic Documents for R
Version: 1.12.6
Version: 1.12.7
Authors@R: c(
person("JJ", "Allaire", role = "aut", email = "[email protected]"),
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ rmarkdown 1.13

- The `*_files` directory is not properly cleared due to the inappropriate fix for #1503 and #1472 in the last version (thanks, @wxli0 #1553, @cderv #1566).

- Added an `output_extensions` argument to `pdf_document()` to make it possible to enable/disable Pandoc extensions for the LaTeX output format (thanks, @hongyuanjia, rstudio/bookdown#687).


rmarkdown 1.12
================================================================================
Expand Down
6 changes: 5 additions & 1 deletion R/pdf_document.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
#' created. See the documentation on
#' \href{http://pandoc.org/README.html}{pandoc online documentation}
#' for details on creating custom templates.
#' @param output_extensions Pandoc extensions to be added or removed from the
#' output format, e.g., \code{"-smart"} means the output format will be
#' \code{latex-smart}.
#' @param extra_dependencies A LaTeX dependency \code{latex_dependency()}, a
#' list of LaTeX dependencies, a character vector of LaTeX package names (e.g.
#' \code{c("framed", "hyperref")}), or a named list of LaTeX package options
Expand Down Expand Up @@ -94,6 +97,7 @@ pdf_document <- function(toc = FALSE,
citation_package = c("none", "natbib", "biblatex"),
includes = NULL,
md_extensions = NULL,
output_extensions = NULL,
pandoc_args = NULL,
extra_dependencies = NULL) {

Expand Down Expand Up @@ -211,7 +215,7 @@ pdf_document <- function(toc = FALSE,
# return format
output_format(
knitr = knitr_options_pdf(fig_width, fig_height, fig_crop, dev),
pandoc = pandoc_options(to = "latex",
pandoc = pandoc_options(to = paste(c("latex", output_extensions), collapse = ""),
from = from_rmarkdown(fig_caption, md_extensions),
args = args,
latex_engine = latex_engine,
Expand Down

0 comments on commit 7d228fa

Please sign in to comment.