MathJax
MathJax copied to clipboard
Mathjax version 3. Any update regarding font support other than MathJax TeX font?
Mathjax version 3. Any update regarding font support other than MathJax TeX font?
Work is progressing on this, but it is a complicated project. Yesterday, I pushed a stix2
branch that includes an SVG version of the STIX2 fonts. There is a stix2
subdirectory in that branch that includes an example HTML file that shows some stretchy characters, and an interactive file that you can use to type in your own TeX or MathML expressions for testing. There is a cli
directory that includes tex2svg
and mml2svg
commands that you can use to convert individual expressions to SVG files using the STIX2 fonts (and can use as templates for your own custom versions of these). You can compare to the originals from the direct
subdirectory of the MathJax node demos repository to see what modifications are needed.
Finally, there is a tables
directory that includes font tables for the STIX2 fonts as I've mapped them to the various mathvariant
values for MathJax (variants starting with -
are internal use to access things like the larger sizes of stretchy delimiters, calligraphic characters, and so on).
This branch currently is intended for server-side pre-processing only, as the data for the STIX2 fonts is very large, and needs to be broken in to pieces that can be loaded dynamically as needed in order to be used effectively in a browser. Then CommonHTML support will follow relatively quickly.
The tools for producing the files needed by MathJax are coming along well, and were used to produce the files in this branch, but are not yet ready for public use.
So while much work has been happening behind the scenes, it is not quite ready yet for prime time. Work is going to slow down as I begin teaching again this fall, so a formal release will probably need to wait until early next year.
Thank you very much for your reply.
Are there any news? (Since it is 'early next year' now...)
We are actively working on it. There is a stix2 branch that includes an SVG version of the STIX2 fonts for server-side use (not yet for in-browser use) as an illustration of the effort. We expect to include more fonts in a public release during the summer.
@BrackXs just a thought: if @le-tex actually supported mathjax, development might just be faster.
High on my font wish list are sans serif fonts, such as newtxsf which plays nicely with the popular Fira Sans font.
@kno10 I think you mean sans-serif? I wondered if these changes would make it possible to make use of Fira Math in the future?
Yes, sans serif obviously. Fira Sans is pretty popular, and I'd like math typography consistent with Fira Sans. Fira Math seems to be work in progress. newtxsf supposedly is quite complete and similar enough for most use cases.
Can we expect Gyre Pagella font in v3?
@apolanco115, yes. I have the data files ready for Gyre Pagella read to go for the next release (and will have the other Gyre fonts as well). The tools for creating the needed MathJax data files will be made available, so you could create your own font for Fira Sans, or a font extension to override some of an existing font.
Is there an approximate timeplan for this release? Sorry for pressuring, but loading custom fonts would truly be a blessing.
I expect the font release to be in early Q2 this year.
@dpvc Any update on the font support?
@stnor, it is coming along, but is taking longer than expected. I have the SVG versions working well for both new fonts and font extensions, and the tools for creating the font data, but still need to do some work for CHTML fonts (the main difference is in the fact that CHTML needs actual fonts rather than svg paths, and the large font files need to be broken into smaller ones to match the layout Mathjax uses). We are finalizing a bug-fix release 3.2.1 for next week, and then will have a major feature release that will include the font work later this year. There are a number of other features being added (including line breaking, HTML in MathML token elements, changes to the assistive tools, some reorganization of the npm packages, etc.), so that is going to be a significant update.
Thanks! I'm still running beta3 in prod, and got some help from you back then from you with sans-fonts, so looking forward to upgrade when done! :)
@dpvc I'm making slow progress on the single-stroke math font idea, but it would be brilliant if the new tools & infrastructure allowed this possibility (for experimentation) as well. I bet others would follow and draw their own glyphs, once the opportunity to typeset them via Mathjax is demonstrated.
I imagine having the full list of glyphs as a json dictionary containing the svg paths and their placement offsets would be a suitable input format?
The 4.0.0 Alpha.1 milestone had in the changelog:
- Support for 11 different fonts, including the STIX2 font set, five Gyre math fonts, and a sans-serif font based on the Fira-Math font.
So I guess there has been some progress?
Yup, I am using the Fira font in production on alpha.1 since a while back (simple use case - see https://nomp.se/nomp/matematik/93/algebra/forenkling-av-polynom/93.ALGEBRA.9)
@kno10, yes, the v4 alpha release has the 11 fonts, and has been well received over all. There are still some issues to resolve, however, and code review is not yet complete (but well underway). I'm hoping a beta release will be soon, followed by the official release shortly thereafter.
close this, as additional fonts are available in 4.0? Works well for me, specific issues are likely best tracked in their own reports?