-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
export to mathml-core #2367
Comments
That's a good question. I believe it's MathML-Core, but it's hard to tell. I couldn't find a validator for MathML-Core, so not sure how to verify that. I also couldn't find a clear description of what is no longer allowed in MathML-Core that was allowed in MathML-3. The best I could find is this but it focuses on what is allowed in MathML-Core and only alludes that there are 163 elements which are no longer allowed, without specifying what they are. Note also that the MathML-Core spec is quite open-ended on what it includes or may include in the future:
So some features that are currently in MathML-3 (or MathML-4) might become part of MathML-Core at some point. The Notes on MathML document unfortunately does not provide much additional information but perhaps future editions will. |
One place to look is the polyfills that I implemented. That gives you a good sense of what is part of MathML 3 that is not in core since I had to write polyfills for them. I tihnk there are a few other minor things that I didn't polyfill because the Core spec changed slightly since I wrote them. Probably the three most used features not supported in MathML core are:
Also something to watch out for is that (despite many objections), one must use U+2212 rather than the ASCII "-". There are larger polyfills for linebreaking and elementary math, but browsers have never supported them so they weren't generated by most software. As Arno indicated, MathML Core (like CSS) will hopefully add functionality over time. First though, we need to get browsers to have better interoperability with MathML Core. @arnog: are any of the top three generated by MathLive? |
@NSoiffer yes, it does generate |
@arnog Do I read correctly here that it also produces mathlive/src/formats/atom-to-math-ml.ts Line 1001 in 69e0374
That also seems to not be supported. It looks like they have tagged the parts not supported as deprecated on MDN: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced (see left column) |
You are correct. I searched for |
Yes, \hat{x} (\bar{x}, etc.) should generate
It appears that mathlive generates the correct MathML core output. |
Only Chrome is fully MathML core compliant. The other browsers had implementations before Chrome (and before MathML core). They implemented most of MathML 3 (except line breaking and elementary math), but now they are playing catch up to deal with the CSS integration in MathML Core (among other things). MathML Core is adopting the "level" approach of CSS. So additional levels of MathML Core will eventually come out and they will add features. I suspect that |
Ok, but the two Chromium-based browsers Chrome and Edge have a combined marketshare of 70+%, so it's not insignificant. If no development is taking place in creating another level of MathML core, then it can take decades for another level to be published. |
The remaining two browsers also plan to switch to mathml core: Webkit issue: https://bugs.webkit.org/show_bug.cgi?id=195797 Gecko issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1495813 In my project I use mathlive to create output files (among other things) that the end users archive or publish, and so it should preferably be syntax that is following current W3C specs and can be rendered in browsers. I was hoping I could export to MathML Core, but it sounds like that is not the case. @NSoiffer are you saying that |
I'm not sure what MathLive can do about this issue. Are you suggesting I drop the generation of |
@arnog Looking at w3c/mathml#216, it looks like I understand the problem that MathML Core is not delivering as much as MathML 3. Unfortunately it looks like MathML Core will replace MathML 3 in browsers and although there are efforts by @NSoiffer and others to try to add more stuff to MathML Core, as far as I can tell from browsing through the various issues, none of that is being picked up by the browser makers who are happy to just ship MathML Core in its current form - and for Wbekit/Gecko to unship the parts of MathML 3 that are not in MathML Core. The perspective of people who need to use the output from MathLive's MathML is that at the very least we need to know which version this is for. If the output is MathML 3, then that is not great, but at least it's specific. Then I may need to create some filter that dumbs the MathML 3 output down to MathML Core so that it can be displayed (In Chromium now and in Safari/Firefox once they have implemented MathML Core). |
What is a bit unclear to me is whether MathML 3 in general is to be seen as being replaced with MathML Core or whether it is meant that MathML continues to be developed and one is supposed to publish documents with full MathML 3 and then include these polyfills: https://w3c.github.io/mathml-polyfills/ . It should be possible to rewrite these polyfills slightly so to run them over the MathML 3 output of MathLive if the idea is that MathML is to be replaced entirely. Based on the source code of the polyfills, it looks like all cases of |
OK, if the issue is knowing which version of MathML MathLive outputs, let's clarify this by saying it's MathML 3. |
@arnog Thanks! |
My understanding of what is going on with Webkit and Gecko issues is that they are trying to become more compatible with MathML core and reducing the number of web platform test failures. I suspect progress will continue to be slow as the big players behind the browsers aren't devoting many resources to the effort (most work is done by outsiders such as Igalia). Supporting core doesn't mean that they are planning to remove features they currently support (such as As for "full" MathML, work continues on that. The main focus of MathML 4 is alignment with core (to make it a proper superset) and the addition of author intent to improve accessibility. For example., is Hopefully at some point in the future MathLive will start to generate intent for ambiguous notations since it is interpreting the notation for the compute engine. I plan to help with that effort. I know that @arnog doesn't like to have open issues with no plans for resolving them, so I haven't opened an issue yet on this. However, once we start the process of moving to CR, I'll open an issue since that will be a time to start work on an implementation (which I hope to help with). I suspect most of what is needed already in the code. |
If you look at the bug reports I linked above, they actually state that they have and will remove MathML 3 features from Firefox and Webkit. For example On MDN So it does look like they are removing features that re not part of MathML 3, but not all of Conclusion for this: The difference between MathML3 and MathML Core output from MathLive may just be a question of whether to use [1] https://groups.google.com/u/1/g/mozilla.dev.platform/c/vwAkuZIEhnY/m/KALRPR3wAQAJ [2] https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced |
You are correct that FYI: A switch that allows targeting MathML Core or MathML 3 might be a good idea. I'll leave that judgement to @arnog. |
@NSoiffer I came to the same conclusion in relation to those features. It's just too bad there is no spec version anywhere that contains core level 1 + |
MathML confuses me. Between MathML 3, MathML 4 (with a Presentation and Content variants of each), MathML Core and the upcoming MathML Core w/ intents, not counting the actual MathML implemented by various browsers, it's hard to keep it all straight. The lack of conformance suite is not helping. To give some historical context, the MathML support in MathLive was implemented by Neil so that screen readers could interpret the MathML and present it to users in an appropriate way. I believe NVDA uses MathCAT to read MathML. I'm not sure about other screen readers. I'm also not sure of how valuable this is, since MathLive also has a built-in LaTeX-to-speech engine and also support SRE. Maybe this MathML support is just more aggravation than it's worth. I'm really not sure what the benefit of outputting MathML over LaTeX is. I don't have the bandwidth or the expertise to make improvements/changes to the MathML support in MathLive. I don't know if it makes sense to even keep what's there. Adding support for MathML Core with Intents in MathLive does not make sense since MathLive is a visual editor and has no semantic understanding of the input. If anywhere, it would make much more sense in Compute Engine. Perhaps the way forward is a separate project that does MathJSON to MathML Core w/ Intents conversion, and perhaps in the other direction too. Anyway, if someone with the necessary expertise is willing to make improvements to the current support for MathML in MathLive, I'd be happy to consider submitted PR but I'm unlikely to spend some time myself on it. |
Hey,
I am using the convertLatexToMathMl() function. I have been clicking through https://cortexjs.io/mathlive/ but cannot find it there.
My question is: The mathml that is returned, will it be adhere to mathml-core or mathml 3?
The text was updated successfully, but these errors were encountered: