pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

math in README

Open maelle opened this issue 2 years ago • 5 comments

Fix #2261 See also #2262 (would better be done in a separate PR)

I got a bit stuck trying to test this as it was hard for me to catch the Pandoc error in a test (it appeared in the log but I could not catch it :sweat_smile:) hence the new Pandoc option for making warnings failures.

In any case the whole point is adding --mathjax to the Pandoc call.

maelle avatar Jan 06 '23 09:01 maelle

Hi Maelle, FYI I'm still unable to render $\sqrt{x}$ in https://cthombor.github.io/SafeVote/; but I do have another clue which might help localise the defect... or perhaps just indicates that a repair is still in the process of being deployed!

Using devtools::check_rhub() today, I got a couple of notes:

❯ checking HTML version of manual ... [11s] NOTE Skipping checking math rendering: package 'V8' unavailable

❯ checking for detritus in the temp directory ... NOTE Found the following files/directories: 'lastMiKTeXException'

I don't find a copy of lastMiKTeXException in my check_rub() results

cthombor avatar Jan 17 '23 01:01 cthombor

the fix is in this branch only for now :-)

maelle avatar Jan 20 '23 08:01 maelle

@maelle Pandoc's --mathjax option optionally allows to specify a URL pointing to the MathJax assets to be used. If none is provided (like in your current PR),

a link to the Cloudflare CDN will be inserted.

This is kinda detrimental to the goal of https://github.com/r-lib/pkgdown/pull/2249. 😐

Furthermore, I don't quite understand why the README is treated differently than articles/vignettes... pkgdown already includes MathJax assets, so it should really be possible to use the same approach to build both the README and articles/vignettes (where inline math is properly rendered), no?

salim-b avatar Jan 25 '23 19:01 salim-b

@maelle Pandoc's --mathjax option optionally allows to specify a URL pointing to the MathJax assets to be used. If none is provided (like in your current PR),

This is kinda detrimental to the goal of https://github.com/r-lib/pkgdown/pull/2249. neutral_face

Good to know, thank you! I guess that if we keep this option, we'll need to add the URL then.

Furthermore, I don't quite understand why the README is treated differently than articles/vignettes... pkgdown already includes MathJax assets, so it should really be possible to use the same approach to build both the README and articles/vignettes (where inline math is properly rendered), no?

The big difference is that vignettes/articles are knit whereas the README is not. Now, it does not mean approaches can't be aligned somehow. :sweat_smile:

maelle avatar Jan 26 '23 10:01 maelle

Probably worth digging into how RMarkdown sets the --mathjax argument so we can make sure to align.

hadley avatar Apr 19 '24 16:04 hadley

🚀 Deployed on https://664275b6275d192272162b4a--pkgdown-dev.netlify.app

github-actions[bot] avatar May 13 '24 20:05 github-actions[bot]

@maelle can you please take another look at this? I just tweaked the way that you test the code, adding some future looking support to make it easier to modify existing pkgdown test sites.

hadley avatar May 13 '24 20:05 hadley