I'd like to use fenced divs in a large bookdown project to create numbered environments like Theorem, Example, etc. Bookdown's built-in code blocks to do this aren't sufficient, since they can't have R code blocks inside of them and also interfere with RStudio syntax highlighting.
Fenced divs have a lighter syntax and work really well for me.
I can do this:
::: {.example #funexample}
Here is an example
:::
Bookdown automatically calls the lua-filter latex-div.lua
by Lesur, Derview, and Xie on these blocks. I've modified this filter to handle latex labels properly, and plan to continue to customize it. I can use my new filter with the following in output.yml
:
pandoc_args:
- --lua-filter=latex-fenced-blocks.lua
However, it appears that the latex-div.lua
filter is hardwired into the pandoc
command that bookdown uses to generate latex. Is there a way to tell bookdown I do not want it to use the latex-div.lua
filter?
The pandoc_args
seems to only allow for adding arguments to pandoc, not removing them.