-
Notifications
You must be signed in to change notification settings - Fork 337
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
Improve support for math rendering with CDN #2833
base: main
Are you sure you want to change the base?
Conversation
@hadley I think the CDN approach for katex is the best we're going to do. We'd have to cache ~60 files to fully support katex outside of CDN. |
Thanks @jayhesselberth for this fix. I ran some manual tests on this branch across different
|
Articles need The complex math example ( |
@nanxstats Can you confirm this fixes katex for you? What do you mean by "function reference" in the table above — math included in params and examples? I'm not sure why mathml is not rendering that correctly. |
@jayhesselberth Yes, "function reference" means the function documentation pages under Overall resultsHere is how it looks after the latest patch - KaTeX is now ✨perfect✨
Load MathJaX web fontsYou can configure MathJaX via the In out$uses_mathjax <- config_math_rendering(pkg) == "mathjax" In {{#uses_mathjax}}
<script>
window.MathJax = {
chtml: {
fontURL: "https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/output/chtml/fonts/woff-v2"
}
};
</script>
{{/uses_mathjax}} On MathMLYep, under I do support considering KaTeX as the future default, like you mentioned in #2704. |
Nice, I can confirm MathJax now also loads web fonts properly:
I have no more comments. |
If we're moving to supporting math libraries with CDN, then we should move MathJax from the cached libraries and into the head template: Lines 62 to 72 in 4519ca0
|
Closes #2704