'Lua'-Filters for R Markdown

A collection of 'Lua' filters that extend the functionality of R Markdown templates (e.g., count words or post-process citations).

Lifecycle:experimental Travis buildstatus CRANstatus [CRANdownloads

rmdfiltr provides a collection of Lua-filters that extend the functionality of R Markdown templates.


You can install the development version from this GitHub repository with:

# install.packages("remotes")


You can add a filter to any R Markdown template that accepts additional pandoc arguments.

title: "Word count test"
    pandoc_args: !expr rmdfiltr::add_wordcount_filter()

Of course, you can also use the filters in a custom R Markdown format by adding pandoc arguments with the preprocessor function.

wordcount_html_document = function(...) {
  format <- rmarkdown::html_document(...)
  format$pre_processor <- rmdfiltr::add_wordcount_filter

See R Markdown: The Definitive Guide for details on how to create custom formats.


Contributions of new filters are welcome. Pleas refer to the contributing guidelines before you start working or open a pull request. Also, please note that the rmdfiltr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.


rmdfiltr 0.1.0

  • Initial release with word count and ampersand replacement filter.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.3 by Frederik Aust, a year ago


Report a bug at https://github.com/crsh/rmdfiltr/issues

Browse source code at https://github.com/cran/rmdfiltr

Authors: Frederik Aust [aut, cre] , Marius Barth [ctb]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports assertthat, utils, rmarkdown

Suggests dplyr, ggplot2, knitr, spelling, testthat, tibble

System requirements: pandoc (>= 2.0; https://pandoc.org)

See at CRAN