Skip to content

Commit

Permalink
For pandoc 3.4, deactivate -tex_math_gfm to still keep writing $$ a…
Browse files Browse the repository at this point in the history
…nd $ for math in GFM documents.
  • Loading branch information
cderv committed Sep 10, 2024
1 parent 661414a commit f9cd149
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/github_document.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ github_document <- function(toc = FALSE,
# don't activate math in Pandoc and pass it as is
# https://github.blog/changelog/2022-05-19-render-mathematical-expressions-in-markdown/
math <- NULL
# TODO: Check for version - should be the default in Pandoc 2.19+
variant <- paste0(variant, "+tex_math_dollars")
# Pandoc 3.4 uses +tex_math_gfm by default to write special gfm syntax. We choose to keep $$ and $ which are still supported by Github
variant <- if (pandoc_available("3.4")) paste0(variant, "-tex_math_gfm") else paste0(variant, "+tex_math_dollars")
preview_math <- check_math_argument("mathjax")
} else {
# fallback to webtex
Expand Down

0 comments on commit f9cd149

Please sign in to comment.