Skip to content

Commit

Permalink
fix #1602: use the latex plot hook when fig.env is not the default
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Oct 9, 2018
1 parent 978acd8 commit 0f53929
Show file tree
Hide file tree
Showing 3 changed files with 4 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: 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 = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person("Adam", "Vogt", role = "ctb"),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion R/hooks-md.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f53929

Please sign in to comment.