Skip to content

knitr 1.44

Compare
Choose a tag to compare
@yihui yihui released this 11 Sep 17:40
· 129 commits to master since this release

NEW FEATURES

  • kable() can generate Emacs org-mode tables now via kable(..., format = 'org') (thanks, @xvrdm #1372, @maxecharel #2258).

  • Added support for the qmd (Quarto) output format to spin(), e.g., spin('script.R', format = 'qmd') (thanks, @cderv, #2284).

  • write_bib() has a new argument packageURL to control whether to use a URL from the DESCRIPTION file or the one generated by utils::citation() (thanks, @dmurdoch, #2264).

  • Updated the package vignette vignette('knit_print', 'knitr') to mention that package authors no longer have to make knitr a hard dependency if they want to define S3 methods for knitr::knit_print with R >= 3.6.0 (thanks, @cderv, #1929).

  • Added a new function download_image() to download an image from a URL and include it via include_graphics(). This is mainly for including online images when the output format is not HTML (e.g., LaTeX), because the URL will not work as the image path, and it has to be downloaded beforehand (thanks, @bayeslearner, #2274).

BUG FIXES

  • Make the internal function add_html_caption() work with Quarto <= v1.3.353 (thanks, @giabaio, #2261).

  • Fixed a bug in spin(format = 'Rnw') reported by @Tarious14 at yihui/yihui.org#769 (reply in thread)

  • When the chunk option dev = 'svglite', the svglite device should be used to record plots (thanks, @Darxor, #2272).

  • Figure captions are no longer escaped for reStructuredText output, and the alt text can also be specified via the fig.alt chunk option now (thanks, @trevorld, #2023).

  • Use the correct type of progress bar when rendering Quarto documents in RStudio, which takes place in RStudio's background jobs pane or build pane (thanks, @hadley, #2271).

  • The opts_current object can no longer be modified within code chunks via its $set() method (thanks, @AshesITR, #1798).

  • The argument col.names of kable() can be used to specify the column name of row names now, e.g., kable(head(mtcars), col.names = c("car", names(mtcars))) ("car" will be the column name of row names in the first column) (thanks, @iago-pssjd, #1933).

MAJOR CHANGES

  • Dashes (-) in the names of all chunk options are normalized to dots (.) now, e.g., fig-height will be converted to fig.height. This is to make knitr more compatible with Quarto since Quarto always use dashes in chunk option names (#2282).

MINOR CHANGES

  • In-body chunk options (#|) are now preserved when extracting code from a document via purl() (thanks, @LuisLauM, #2268).

  • A warning message will be issued when taking PDF screenshots for HTML widgets with the webshot2 package, because webshot2 doesn't use the correct figure size at the moment (thanks, @icejean, #2276).

  • If the title argument of knit2wp() is omitted and a title field is specified in the YAML metadata of the input document, the YAML title will be used (thanks, @arencambre, #1924).