diff --git a/DESCRIPTION b/DESCRIPTION index e337ebf80b..4a5f66914e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: knitr Type: Package Title: A General-Purpose Package for Dynamic Report Generation in R -Version: 1.20.16 +Version: 1.20.17 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("Adam", "Vogt", role = "ctb"), diff --git a/NEWS.md b/NEWS.md index 6d587e2806..05e1d64132 100644 --- a/NEWS.md +++ b/NEWS.md @@ -26,6 +26,8 @@ - MP4 generated by `hook_ffmpeg()` does not work in Safari (thanks, @brianzhang01, #1586). +- The chunk option `fig.env` does not work for PDF output from R Markdown (thanks, @RSchwinn, #1620). + ## MINOR CHANGES - `spin()` will close each individual code chunk if multiple code chunks appear consecutively (previously it only closes the last code chunk in this case) (thanks, @avehtari, #1590). diff --git a/R/hooks-md.R b/R/hooks-md.R index 03fe834e29..31b41fef28 100644 --- a/R/hooks-md.R +++ b/R/hooks-md.R @@ -9,7 +9,7 @@ hook_plot_md = function(x, options) { office_output = to %in% c('docx', 'pptx', 'rtf', 'odt') if (!is.null(options$out.width) || !is.null(options$out.height) || !is.null(options$out.extra) || options$fig.align != 'default' || - !is.null(options$fig.subcap)) { + !is.null(options$fig.subcap) || options$fig.env != 'figure') { if (is_latex_output()) { # Pandoc < 1.13 does not support \caption[]{} so suppress short caption if (is.null(options$fig.scap)) options$fig.scap = NA