github rstudio/rmarkdown v2.4
rmarkdown 2.4

latest releases: v2.29, v2.28, v2.27...
4 years ago
  • Lua filters handling has been improved internally with some user-facing changes (#1899):

    • New exported function pandoc_lua_filter_args() to return the Pandoc command-line argument to add a Lua filter.
    • New argument lua_filters in pandoc_options() to pass the Lua filter paths to use with a format. This allow output format authors to add filters for a custom format using the pandoc argument of output_format() and to get filters from a format using fmt$pandoc$lua_filters.
    • The Lua filters of an output format are now passed to Pandoc in render(). By default, they are passed to Pandoc before any other format-defined or user-defined Pandoc arguments (usually via the pandoc_args option of an output format). This ensures that filters of an output format are executed first. To change the default, you need to deal with it in a custom format (i.e., modify the elements in fmt$pandoc$lua_filters, such as reordering them).
    • New exported function pkg_file_lua() to get the full system path of a Lua filter included in a package source within the inst/rmarkdown/lua folder (thanks, @atusy, #1903).
  • Fixed the path separators for the css parameter in YAML frontmatter for HTML output files under Windows. Previously, forward slashes in css paths were converted to backslashes (thanks, @jonathan-g, #1862).

  • Since rmarkdown 1.16, Pandoc's fenced Div's are converted to LaTeX environments when the output format is LaTeX, e.g., ::: {.center data-latex=""} is converted to \begin{center}. The attribute data-latex of the Div was mandatory, even if it is empty. In rmarkdown 2.2, we silently drop this requirement, which means ::: {.center} is converted to \begin{center}. This turns out to be a bad idea, because users have no control over which Div's to be converted to LaTeX environments. Previously, they could opt-in by the data-latex attribute, but with rmarkdown 2.3, all Div's are converted to LaTeX environments unconditionally. What's more, this change led to bugs like https://stackoverflow.com/q/62340425/559676 and rstudio/bookdown#883. Therefore the data-latex attribute became mandatory again in this version. If the LaTeX environment does not need arguments, you may use data-latex="".

  • The two Lua fitlers pagebreak.lua and latex-div.lua (introduced in rmarkdown 1.16) are also applied to the output format beamer_presentation now (thanks, @XiangyunHuang, #1815).

  • When customizing formats with the output_format function, pre_knit, opts_hooks, and knit_hooks can now refer to rmarkdown::metadata. Previously, rmarkdown::metadata returned list() in these functions (thanks, @atusy, #1855).

  • rmarkdown::find_external_resources() now discovers external template files. This in turn fixes the rendering issue of html_document with the shiny runtime and intermediate_dir set (thanks, @atusy, @cderv, #1865).

  • Added the number_sections argument to following formats: github_document, ioslides_presentation, md_document, odt_document, powerpoint_presentation, rtf_document, slidy_presentation, word_document. These are powered by a Lua filter and requires Pandoc > 2.0. It will silently have no effect has before with previous pandoc version (thanks @atusy 1893). Pandoc >= 2.10.1 adds --number-sections for docx format, and thus word_document prefers the native feature to the Lua filter (thanks, @jooyoungseo, #1869).

  • For the output format pdf_document, the option fig_crop will not be enabled unless both the programs pdfcrop and ghostscript are found (thanks, @dalupus, yihui/knitr#954).

  • Fixed a bug that a chunk with a class fold-hide hides the rest of the chunks even the output format setting html_document(code_folding = "show") (thanks, @atusy, #1906).

  • Updated documentation for render() to make it clearer how options are set for the output_format parameter (thanks, @jonathan-g, #1907 and rstudio/bookdown#930).

  • Ported some CSS styles (e.g., underlines, small caps, and multi-column layouts) from the latest Pandoc's HTML template into rmarkdowns HTML templates (thanks, @atusy, #1878, #1908).

Don't miss a new rmarkdown release

NewReleases is sending notifications on new releases.