Skip to content

knitr 1.43

Compare
Choose a tag to compare
@yihui yihui released this 25 May 13:30
· 177 commits to master since this release

NEW FEATURES

  • Progress bar includes the chunk location (chunk-name @ file:line) when options(knitr.progress.linenums = TRUE) is set (thanks, @zeehio, #2232).

  • The global option knitr.progress.simple can be used to decide whether to output the bar in the progress. When set to FALSE, only the step numbers and chunk labels will be printed, and the progress bar is omitted. This can be more useful for logging purposes since the bar itself is not useful (thanks, @hadley, #2221). By default, the simple progress output is used when the progress is not written to a connection such as stdout or stderr (e.g., written to a file instead), or the output connection is not a "terminal".

  • HTML Widgets can now support alt text by specifying an attribute aria-labelledby="<label>" in their first HTML tag. The text will be obtained from the fig.alt or fig.cap chunk option in the usual way (thanks, @dmurdoch, #2243).

  • Added a new argument newline to kable() to handle newlines in data when the table output format is Markdown-based (simple, pipe, rst, or jira). By default, newlines are not processed, which can result in broken tables. To substitute newlines with spaces, use kable(..., newline = ' '). To remove newlines, use kable(..., newline = '') (thanks, @aronatkins, #2255).

BUG FIXES

  • The chunk option collapse = TRUE works with HTML widgets now (thanks, @dmurdoch, #2212).

  • Option hooks should be run before child documents are processed (thanks, @richarddmorey, #2247).

  • For .Rnw documents, is_latex_output() returns TRUE for output formats sweave (render_sweave()) and listings (render_listings()) now (thanks, @DavisVaughan, #2231).

  • write_bib() does not fail anymore if an empty string is passed as package name (thanks, @phargarten2, #2240).

  • Fix an issue with using cache = TRUE on sql engine chunk not defining a output.var (thanks, @mfherman, @eitsupi, #1842).

  • plot_crop() correctly checks the required tools (pdfcrop and ghostscript) on Windows when the LaTeX is distribution is TeX Live or TinyTeX (thanks, @remlapmot, #2246). An external installation of ghostscript is no longer required on Windows, since TeX Live's built-in ghostscript will be used.

  • The chunk option dev.args was not recognized in certain cases (thanks, @petrbouchal, #2238).

MINOR CHANGES

  • The css and js engines work for the markdown output format now. Previous these engines will not output anything when the output format is markdown. If you still want to disable them for markdown output, you may use the chunk option eval = FALSE or eval = knitr::is_html_output(excludes = 'markdown').

  • is_html_output() recognizes R Markdown v1 documents now (.Rmd documents compiled via the markdown package).

  • For .Rnw documents, dots in figure file paths are no longer sanitized to underscores (thanks, @otoomet, #2213). Other special characters are still sanitized, but this feature can be turned off via options(knitr.sanitize.paths = FALSE).

  • imgur_upload() now recognizes a global option knitr.imgur.key or an environment variable R_KNITR_IMGUR_KEY for a custom client ID (thanks, @jonthegeek, #2233).

  • imgur_upload() requires fewer package dependencies now. It only requires the curl package; httr is no longer required, and xml2 has become optional.