# CHANGES IN knitr VERSION 1.52 # CHANGES IN knitr VERSION 1.51 ## NEW FEATURES - Added support for [OpenTelemetry](https://opentelemetry.io/) observability. When the **otel** and **otelsdk** packages are installed and tracing is enabled, spans are automatically created for all knit operations. See [`otelsdk`'s Collecting Telemetry Data](https://otelsdk.r-lib.org/reference/collecting.html) for more details on configuring OpenTelemetry (thanks, @shikokuchuo, #2422). - `knit()` produces 'knitr processing' and 'knitr output' spans when starting and finishing an operation - `knit()` produces 'knit' spans for each chunk, recording attributes such as the label and knit engine - Added support for hooks that get executed before and after knitting. To register a hook before knitting starts, use `knitr::knit_hooks$set(before.knit = function() {})`. Similarly, the hook `after.knit` can be registered and will be executed after knitting is finished. ## BUG FIXES - Fix issue with error traceback not correctly showing when **rlang** is available. - Improve error traceback when **rlang** is available and **evaluate** > 1.0.3 is used (thanks, @cderv, #2388). - For Quarto, chunk options written in pipe comments must use the comment character of the chunk's language (#2225). Previously, comments written in `#|` will be parsed even if `#` is not the comment character of the chunk. - `hook_optipng()` now uses the `-quiet` argument of `optipng` to suppress the messages by default. - Don't set `vheight` or `vwidth` for `webshot2::webshot()` when the chunk option `out.height` or `out.width` is a percentage (%). Setting `screenshot.opts` chunk option is still a way to specify `vheight` or `vwidth` specifically for `webshot()`, e.g., `screenshot.opts = list(vwidth = 6 * 72, vheight = 6 * 72 * 0.618)` for the width of 6 inches size with 72 dpi and 0.618 of aspect ratio. - HTML screenshots are taken inside the current working directory by default if it is writable, instead of `tempdir()`, which may not be accessible to certain browsers (thanks, @markschl, #2416). The directory can be customized via the global R option `knitr.html_screenshot.tmpdir`, e.g., if you want the old behavior, you may set `options(knitr.html_screenshot.tmpdir = tempdir())`. ## MINOR CHANGES - Empty alt text for images is allowed now (thanks, @Olivia-Box-Power, #2415). With the chunk option `fig.alt = ''`, the HTML output will be ``. Previously, the `alt` attribute was omitted in this case. If you still want to omit the `alt` attribute, you may use `fig.alt = NA`. # CHANGES IN knitr VERSION 1.50 ## NEW FEATURES - For inline code expressions, their specific line numbers will be shown in the message when errors occur (thanks, @kevinushey, #2387). Previously, the numbers were not specific to the inline code but the lines of the whole text chunk containing the inline code, which are often quite vague. - Display error traceback when vignettes fail in `R CMD build` (thanks, @hadley, #2390). - `kable()` properly supports column alignment for Org Mode tables now (thanks, @mclements, #2391). ## MINOR CHANGES - Moved implementations of `combine_words()` and `write_bib()` to the **xfun** package as `xfun::join_words()` and `xfun::pkg_bib()`, respectively, since they are not directly relevant to **knitr**. The functions `combine_words()` and `write_bib()` are still kept in **knitr**, and can continue to be used in the future. - A warning will be issued when chunk options are duplicated in both the chunk header and pipe comments (thanks, @cderv, #2386). A chunk option should appear in only one of these places. - Removed the function `read_rforge()` since it has stopped working for a long time. - Removed demos from the package (which were early experiments from several years ago). # CHANGES IN knitr VERSION 1.49 ## NEW FEATURES - In-chunk references of the form `<