rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.87k stars 971 forks source link

Adapt to new github math for next Pandoc #2572

Closed cderv closed 3 weeks ago

cderv commented 3 weeks ago

We get a failure in our test suite for Pandoc devel

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-github_document.R:58:3'): github_document supports native math ──
`res` does not match "$$\\sum_{k=1}^n$$".
Actual values:
* 
* **The Cauchy-Schwarz Inequality**
* ``` math\\sum_{k=1}^n```
* 
* This sentence uses `$` delimiters to show math inline:
* $`\\sqrt{3x-1}+(1+x)^2`$
Backtrace:
    ▆
 1. └─testthat::expect_match(...) at test-github_document.R:58:3
 2.   └─testthat:::expect_match_(...)
── Failure ('test-github_document.R:59:3'): github_document supports native math ──
`res` does not match "$\\sqrt{3x-1}+(1+x)^2$".
Actual values:
* 
* **The Cauchy-Schwarz Inequality**
* ``` math\\sum_{k=1}^n```
* 
* This sentence uses `$` delimiters to show math inline:
* $`\\sqrt{3x-1}+(1+x)^2`$
Backtrace:
    ▆
 1. └─testthat::expect_match(...) at test-github_document.R:59:3
 2.   └─testthat:::expect_match_(...)

This is because they modified support for Github Math

It can be deactivated using -t gfm-tex_math_gfm which is activated by default. It seems this is not sensible to math method 🤔

New support was added in 3.1.9

and it now the default it seems

I'll look into this.