Skip to content

knitr 1.45

Compare
Choose a tag to compare
@yihui yihui released this 30 Oct 14:44
· 114 commits to master since this release

NEW FEATURES

  • Improved the error message to contain more specific information when YAML chunk options could not be parsed (thanks, @pedropark99, #2294).

BUG FIXES

  • Special characters in the chunk option fig.alt are properly escaped now (thanks, @jay-sf, #2290).

  • Negative numbers returned from inline R expressions lost their minus signs when formatted in the scientific notation (thanks, @fkohrt, #2288).

  • convert_chunk_header(type = 'yaml') will now use dash option name for known knitr options, and numeric option are kept with same significant digits, e.g fig.width = 10 is converted to fig-width: 10.

  • Add the necessary \newline to the last subfigure (thanks, @slrellison, rstudio/rmarkdown#2518).

  • Percent signs (%) in LaTeX figure captions and short captions are properly escaped now (thanks, @s-u, #2302).

MAJOR CHANGES

  • The object opts_current will be restored after each code chunk has finished executing. Previously, it would not be restored, which means even for inline R expressions, opts_current$get() will inherit chunk options from a previous code chunk (thanks, @rundel, #1988). Besides, opts_current$get('label') will return a unique label for inline expressions. One possible application is to construct unique figure paths via fig_path() (e.g., ropensci/magick#310).

  • opts_current$set() without opts_current$lock(FALSE) will trigger a warning instead of an error for now and it will become an error in future (#2296).