-
Notifications
You must be signed in to change notification settings - Fork 15
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
Consider adding menclose to core #245
Comments
Note: It references mathml full w3c/mathml#105, not the auto-linked 105 in this same (mathml-core) repo |
This recently came up in a discussion about MathML support in mathlive. If you look at the differences between Core and MathML 3, the ones that aren't easy to have work in both are:
The first two are not widely implemented, so from a practical point of view, the difference is not a big deal when deciding what to generate. Getting css support into the other browsers would be great, but isn't simple. That leaves supporting Prioritizing adding |
Polyfills and IntentA new consideration we will have with MathML 4 will be whether polyfills can/should use the new Neil's example polyfill recovery for <mrow class="menclose" intent="enclose(up-right-diagonal-strike, $content)">
<mrow arg="content">...</mrow>
<mrow class="menclose-arrow" style="..."><mrow class="line"></mrow></mrow>
</mrow> That said, if we had a new MathML 4 <menclose intent="cancel($content)" notation="updiagonalstrike">
<mrow arg="content">...</mrow>
</menclose> |
Another accessibility example is drawing a box or circle around an
@dginev's idea of using |
First, menclose was removed from the first release of MathML Core because it had very bad state (I mean, to present it to people as a new feature with browser's high bar requirements), even with the clarification and simplification that were in MathML Core. So it was likely to add extra effort (spec, test, implementation, 'convincing non-mathml people'). If we want to integrate it for MathML Core, I think we need to do it very carefully. My suggestion would be:
|
This seems to be a very complex topic. To get an overview, I would like to understand 1 How does this issue differentiate from #274 ? 2 Is there a MathML core alternative to represent |
I believe that this can be accomplished with CSS via a However, and this is the problem with using CSS for things that are more than stylistic such as cross-outs, this is invisible to AT. Potentially, |
For Wikipedia, we have implemented basic infrastructure for intent. Thus, I think this could be an option. On the other hand, displaying the cancel symbol is the main concern and the top 1 pressing issue for Wikipedia. The chances are not very high that we could use the JS polyfill, as people might have disabled JS. I was trying to understand how, for example, MathJax, when using CHTML, generates the HTML. In my browser, I see the following output for It would be interesting if there is more information on how one can use only MathML core and CSS to get the desired rendering.
|
Looking at the defined notation values in MathML 3,
I'd say only |
For Wikipedia, the grammar is fixed. There is only cancel, cancelto and matrix, which generate menclosed. In this context, the following constants are being used in the code
updiagonalarrow was missing from the list above. And I hope there are better alternatives for matrix, so that we can get rid of lrtb. |
For the table (lrtb) TEMML does it with style attributes on the mtd elements as well. We use the rowlines attribute. |
After the MathML Core discussion today, I wanted to ask the question if we have a suggested behavior for If/when that menclose variant reaches Core, it may benefit from an example comparing it to using CSS borders. |
* Add hline search in matrix construction: ** This avoids a second scan later for the cost of some memory overhead * Parse | in array column specification * Add CSS based table lines as done by TMML, cf. w3c/mathml-core#245 Bug: T377167 Change-Id: I6e29b47b1731638ea9b06de3006ce2834e4f0c68
* Update Math from branch 'master' to cc5c21dd54cace5614a424080f1d1a23c62dd42a - Merge "Use cell based table rendering" - Use cell based table rendering * Add hline search in matrix construction: ** This avoids a second scan later for the cost of some memory overhead * Parse | in array column specification * Add CSS based table lines as done by TMML, cf. w3c/mathml-core#245 Bug: T377167 Change-Id: I6e29b47b1731638ea9b06de3006ce2834e4f0c68
CSS padding/border/margin properties are already defined in MathML Core and implemented in Chromium. They are available in development versions of Gecko and WebKit (and so probably firefox nightly and safari tech preview). So we could already re-implement box notation (left, right, top, etc) with pure CSS. That will be different from what was specified in earlier versions of MathML Core or from how menclose was implemented in Firefox/WebKit though: the bars/spacing implied by these notations are currently part of the content box while using padding/border/margin would apply to the padding/border/margin boxes (so outside the context box). AFAIK, none of these options contradict MathML 3. |
Ah, and I also clarified on w3c/mathml-docs#40 what box-sizing is about. |
As commented in #274 (sorry if I missed the difference between both issues), I would advocate to make it not reach core for the same argument as for #271. Removing different options to get the same rendering seems a promising path to get a similar experience across different browsers. For the table-like elements (mtable, mtr, mtd), I think it's better to use properties that also exist for (table, tr, td). The remaining elements, such as updiagonalstrike, should also be aligned with nonmath elements as much as possible. |
Is there a problem with using border for "box"? If multiple notations are given, they should all use the same inner box to size themselves. So notation="box updiagonalstrike downdiagonalstrike" should have diagonal lines that reach the corners of the box lines. Those lines should be the same size whether "box" is part of the notation list or not. The resulting box needs to have proper padding so that an @tmke8: phasorangle was added at the request of (I think) some people in the EE community where is not uncommon. Here's a wikipedia article that mentions it, although they use a "primitive" version of the notation. There is a TeX package called "steinmetz" so TeX users can use that notation in their papers. I have no idea how common this package gets used. Maybe @dginev can grab some numbers from arXiv (maybe also a % of papers with the denominator restricted to the Electrical Engineering and Systems Science top level category in arXiv) ... |
@NSoiffer the easy number I have is ~500 documents using that package in our arXiv build system. About half seem not to use any macro from it given they emit no conversion errors. Errors are expected as LaTeXML does not yet support An example of where |
For more complicated enclosing notations like phasorangle or longdiv, it may be interesting to consider recent proposals from the CSS Shape module. In particular, I imagine the w3c/csswg-drafts#6997 (comment) More links related to that proposal: |
@dginev: thanks for the data point. That says that it is rare in the community that uses arXiv. I wish there was some better way to know its usage in the broader world. E.g., maybe engineers use it when working out designs in their companies and it isn't something that shows up in research much. I suspect there are lots of notations like that -- all the elementary math notations are one obvious example. |
For me, it does not show the strike through (in FF) did I miss anything? |
@physikerwelt I think you need a Chromium-based browser to demo CSS over MathML Core today. |
I would like to use that in production. For the array grid lines, the Temml solution works very well. I can see that TEMML combines menclose and the CSS solution. In contrast, my goal is to find a solution that does not require menclose. My gut feeling is that the ability to draw a diagonal line over something is not a feature that is only useful for math notation. If you put some content in the second mrow the diagonal line shows up in FF and no errors are shown in the FF console. Thus I'll be digging a bit further to understand the problem. |
* Update Math from branch 'master' to a7f8306d1800c05c41e17f90f1317225f7b0f245 - Merge "Remove menclose in cancel rendering" - Remove menclose in cancel rendering Chrome and similar browsers do not support the menclose tag. This change introduces a css polyfill suggested in w3c/mathml-core#245 (comment) but keeps the mencose rendering since FF does not support the polyfill https://bugzilla.mozilla.org/show_bug.cgi?id=1929800 Bug: T376829 Change-Id: I860e2f2f9bf9eef8eeba35b0999ec50175fdfc4b
Chrome and similar browsers do not support the menclose tag. This change introduces a css polyfill suggested in w3c/mathml-core#245 (comment) but keeps the mencose rendering since FF does not support the polyfill https://bugzilla.mozilla.org/show_bug.cgi?id=1929800 Bug: T376829 Change-Id: I860e2f2f9bf9eef8eeba35b0999ec50175fdfc4b
This addresses some discussion from the 24/5/24 meeting that came up in relation to what should go in in the accessibility tree.
Although
menclose
can be done via CSS, the CSS can be quite complicated, especially for arrowheads (see the polyfill for some css). Standardizing this via the notation attribute would simplify the MathML need. It would also enhance accessibility because strikeouts/cancellations and other modifications would be visible to AT.Note: there is a PR about this. It references the closed issue w3c/mathml#105.
The text was updated successfully, but these errors were encountered: