rstudio / gt

Easily generate information-rich, publication-quality tables from R
https://gt.rstudio.com
Other
1.94k stars 197 forks source link

LaTeX table rendering issue with math + `fmt_markdown()` #1741

Closed olivroy closed 2 days ago

olivroy commented 2 days ago

Invalid

I am trying to see what the problem is here

The example in https://quarto-gt-examples.netlify.app/gt-fmt_markdown.html doesn't render correctly.

Locally, I see this with latest dev

image

On gt 0.10.1 (on webR) image

Locally, I see the warning

Avis : LaTeX-incompatible input and strict mode is set to 'warn': In LaTeX, \\ or \newline does nothing in display mode [newLineInDisplayMode]

Let me know if you need more information.

In Quarto 1.5

image

olivroy commented 2 days ago

Related to #1687

rich-iannone commented 2 days ago

This is entirely a problem of not faithfully extracting the examples from the Rd database to the Quarto documents for the site. I made a quick fix here: https://github.com/rstudio/gt/commit/0fb1c96c625253aa296d3783c805dc9658a015f0. And if you copy that equation example into a Quarto doc and render it (or run it in the console), it renders without error.

Here's the zipped Quarto doc for testing: formulas.qmd.zip

rich-iannone commented 2 days ago

The file https://github.com/rstudio/gt/blob/master/R/utils_examples.R has all the Quarto-example-building logic. It needs some attention because of the above issue. Also, it only works for R4.2 and below since the .Rd database structure seems to have changed.

Once the examples are repaired (and the workflows run successfully again), it would be great to have LaTeX output tests done via Quarto (this is the near-term goal).

olivroy commented 2 days ago

Sure, I will take a look. Would you mind trying to add a CodeCov token, so that we can track coverage on codecov again. (The test-coverage action has been failing for a few weeks now) https://github.com/r-lib/actions/issues/834

rich-iannone commented 2 days ago

The CodeCov token has been added as CODECOV_TOKEN. Thanks for reminding me of that.