Skip to content
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

Closed
wants to merge 3 commits into from
Closed

[Website] Use mathjax svg renderer #2481

wants to merge 3 commits into from

Conversation

CristianLara
Copy link
Contributor

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

Before image
After image

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.

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).
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 22, 2024
@facebook-github-bot
Copy link
Contributor

@CristianLara has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (d6e6db5) to head (d3708aa).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Balandat Balandat left a 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...

website/siteConfig.js Outdated Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@CristianLara has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@CristianLara merged this pull request in 302509d.

@CristianLara CristianLara deleted the mathjax-svg branch August 23, 2024 20:26
CristianLara added a commit to facebook/Ax that referenced this pull request Aug 23, 2024
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
facebook-github-bot pushed a commit to facebook/Ax that referenced this pull request Aug 23, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants