Skip to content

CHANGES IN knitr VERSION 1.16

Compare
Choose a tag to compare
@yihui yihui released this 18 May 18:33
· 985 commits to master since this release

NEW FEATURES

  • adds two new options, class.output and class.source to apply additional HTML classes to output and source chunks, which can be useful for R Markdown documents with HTML output formats since you can define custom CSS styles for these classes (thanks, @ijlyttle #1335 and @AmeliaMN #1333)

  • added a go engine (thanks, @hodgesds, #1330)

  • added a sql.show_interpolated chunk option for sql engine. For {sql, sql.show_interpolated=TRUE}, interpolated SQL query will be dispalyed in the renderred document instead (thanks, @saurfang, #1357)

  • the chunk option results=FALSE is an alias of results='hide' now (thanks, @hadley, #1360)

  • added a wrapper function knit2pandoc(), and reStructuredText vignettes will be compiled through Pandoc instead of rst2pdf (thanks, @trevorld, #1386)

  • longest common whitespace prefix in code chunks is now stripped off along with the eventual prefix (see #1391)

MAJOR CHANGES

  • a warning will be emitted when the chunk option fig.show='hold' and the output format is Word (rstudio/bookdown#249); fig.show='hold' will be changed to 'asis' at the same time

  • purl() no longer writes verbatim non-R code chunks to the output R script; these code chunks will be commented out in the output

  • purl() can now also retrieve the code from inline expressions; it is disabled by default for compatibility, and can be enabled via options(knitr.purl.inline = TRUE) (thanks, @kforner, #1345)

  • the chunk option fig.show also applies to plots included via include_graphics(), e.g. fig.show='hold' will put all plots to the end of a chunk (thanks, @statnmap, #1382)

BUG FIXES

  • kable() should not ignore the table caption if provided when the input is a list, the table format is pandoc, and the document output format is not HTML or LaTeX, e.g. Word output (thanks, @ugroempi, rstudio/bookdown#368)

  • opts_chunk$set() supports referencing a sql connection by variable name, e.g. knitr::opts_chunk$set(connection = "db") (thanks, @javierluraschi, #1362)

  • the chunk option dev = 'CairoPS' will lead to double filename extensions .eps.ps (thanks, @qifei9, #1364)

  • the output file of write_bib() is now encoded in UTF-8 (thanks, @arnyeinstein, #1374)

  • the <embed> tag should be used instead of <img> for PDF images in HTML output (thanks, Daijiang Li, http://stackoverflow.com/q/43549930/559676)