-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgdown 2.1.0 prevents \eqn{}
and \deqn{}
math rendering on function reference pages under Bootstrap 5
#2704
Comments
Hmmm, I wonder what's different between your example and https://pkgdown.r-lib.org/articles/test/rendering.html#math ... Oh maybe because it's an example, and we don't seem to have a test for math rendering in examples :( |
@nanxstats Did you try setting the previous default, e.g. template:
bootstrap: 5
math-rendering: mathjax |
Confirmed, setting We should try to figure out why mathml (which is now the default) doesn't work. |
Just to mention that the rendering is not what is used to be. I see different fonts as reported in #2739. Right clicking on the equation -> About MathJax, I get the following: |
And the answer is here:
So by upgrading mathjax to v3.2.2, we don't get web TeX fonts.. |
This is how math rendering looks like using Maybe it's because the MathJaX fonts are missing, from all the 404s in network requests: Since it's tricky to side-load the MathJax fonts (originally defined in JS), my current workaround is to use the I'm not in a place to suggest anything on the font situation, but it would be very useful to have math rendering working again on function reference pages for all engine types. |
@nanxstats Do you know if there is a CDN source for katex / Mathjax fonts? If so we could include them in the dependencies: Lines 60 to 91 in 1d40a80
We're probably not going to bundle math fonts in pkgdown itself. |
Indeed, Thanks for confirming @nanxstats . |
Would we expect inclusion of these fonts from cdnjs to have an effect? These could be added to the mathjax dependencies. There are also SVG fonts, not sure which we'd need. It's also a little puzzling why katex fonts aren't included in the dependencies we are already listing. I can't find a reference to need a separate katex font download. |
@jayhesselberth I will let the MathJax experts comment on what should be used. For KaTeX, I think you can add these 60 fonts files as "cached dependency" (may not look pretty...). It didn't work before probably because the CSS file is cached locally and distributed with the pkgdown site. It contains relative font paths that are interpreted as the pkgdown site instead of the CDN site. |
If we're going to need to include many external font dependencies for katex / mathjax, we may need to go back to the yaml format that was originally in #2249. |
I've hit this issue just now, and felt it was a bit much work to include all the font files manually although that was a cool solution given above. My slightly hacky approach is just to remove the template:
bootstrap: 5
includes:
in_header: |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script> I found this "just worked" for now thankfully, though it'd be really nice to have this fixed (ideally with option not to use CDN) so that the |
…asier but see r-lib/pkgdown#2704 and update this when fixed
A math-heavy example that used to work until recently: https://mlopez-ibanez.github.io/eaf/reference/igd.html |
Just in case this is useful or if anyone else runs into this issue, I noticed that using
As we can see, all of the equations appear on the same line, instead of appearing on separate lines (per pkgdown 2.0.9). |
* Workaround for r-lib/pkgdown#2704 * Shorten workflow names
Minimal reproducible example
and set
in
_pkgdown.yml
.pkgdown 2.1.0 + Bootstrap 5
Expand screenshot
pkgdown 2.0.9 + Bootstrap 5
Expand screenshot
The text was updated successfully, but these errors were encountered: