knitr 1.45
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.gfig.width = 10
is converted tofig-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 viafig_path()
(e.g., ropensci/magick#310). -
opts_current$set()
withoutopts_current$lock(FALSE)
will trigger a warning instead of an error for now and it will become an error in future (#2296).