-
Notifications
You must be signed in to change notification settings - Fork 401
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
[Website] Use mathjax svg renderer #2481
Conversation
We identified an issue where mathjax would fail to render certain math symbols. This happens on MacOS versions Ventura and later (13+) because of a change in the OS-supplied STIX fonts. We fix this here by changing the renderer from HTML+CSS (which tries to use local STIX fonts) to SVG. More details on the issue can be found here: https://meta.stackexchange.com/a/389308 The [official docs](https://docs.mathjax.org/en/stable/output.html#mathjax-output-formats) outline a couple considerations for using the SVG renderer, the biggest being lack of IE8 support. If IE8 support is crucial then we should consider alternate approaches. An alternative fix could be to upgrade our mathjax version as later versions may not be as reliant on local STIX fonts but the 3.0 update was a complete rewrite and appears to [not be a straightforward upgrade](https://docs.mathjax.org/en/latest/upgrading/v2.html).
@CristianLara has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2481 +/- ##
=======================================
Coverage 99.98% 99.98%
=======================================
Files 192 192
Lines 16927 16927
=======================================
Hits 16925 16925
Misses 2 2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for figuring this out and the fix!
the biggest being lack of IE8 support
Oh no, Lord, have mercy! Pretty sure you're trolling me here...
Co-authored-by: Max Balandat <[email protected]>
@CristianLara has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@CristianLara merged this pull request in 302509d. |
We identified an issue where mathjax would fail to render certain math symbols. This happens on MacOS versions Ventura and later (13+) because of a change in the OS-supplied STIX fonts. We fix this here by changing the renderer from HTML+CSS (which tries to use local STIX fonts) to SVG. This is a follow up to pytorch/botorch#2481 which solved the same problem on the botorch website
Summary: We identified an issue where mathjax would fail to render certain math symbols. This happens on MacOS versions Ventura and later (13+) because of a change in the OS-supplied STIX fonts. We fix this here by changing the renderer from HTML+CSS (which tries to use local STIX fonts) to SVG. This is a follow up to pytorch/botorch#2481 which solved the same problem on the botorch website. See that PR for more details | **Before** | <img width="920" alt="Screenshot 2024-08-23 at 4 40 19 PM" src="https://github.com/user-attachments/assets/6bf1e0ca-e457-4629-956d-29105b50d6e3"> | | -------- | ------- | | **After** | <img width="932" alt="Screenshot 2024-08-23 at 4 40 40 PM" src="https://github.com/user-attachments/assets/c7d804c6-fd3d-4083-beb5-123a9f535862"> | Pull Request resolved: #2707 Reviewed By: Balandat Differential Revision: D61735692 Pulled By: CristianLara fbshipit-source-id: 91a9585ebd8978f0bb1f0f25b2eab07fdda9a4b2
We identified an issue where mathjax would fail to render certain math symbols. This happens on MacOS versions Ventura and later (13+) because of a change in the OS-supplied STIX fonts. We fix this here by changing the renderer from HTML+CSS (which tries to use local STIX fonts) to SVG.
More details on the issue can be found here: https://meta.stackexchange.com/a/389308
Considerations
The official docs outline a couple considerations for using the SVG renderer, the biggest being lack of IE8 support. If IE8 support is crucial then we should consider alternate approaches.
An alternative fix could be to upgrade our mathjax version as later versions may not be as reliant on local STIX fonts but the 3.0 update was a complete rewrite and appears to not be a straightforward upgrade.