Open FrancoRossi-Globant opened 12 months ago
Thanks for providing the CodePen, that's useful.
However, I'm not sure what the "expected math tags" are. Could you elaborate on what you are expecting?
Yes sorry, that wasn't very tech. I was referring to the conversion from latex to mathml, "math tags" would be mathml. Taking for example "\overbrace{ab}" the conversion to mathml would be something like...
<math display="block">
<mover accent="true">
<mrow>
<mi>A</mi>
<mi>B</mi>
</mrow>
<mo>⏞</mo>
</mover>
</math>
instead im getting:
<mover >⏞</mover>
OK, got it. You don't know where I could find a mapping of the LaTeX commands to the matching MathML Unicode operators by any chance?
Thanks, @NSoiffer. That's a start, it seems to give the following:
\overbrace
: U+23DE\overparen
: U+23DCBut there are several missing, include \overgroup
, \overline
, \overlinesegment
, \overrightarrow
, \overleftarrow
, \overarc
, \wideparen
and `\widetilde.
And some are only provided with combining characters: \overline
, \overleftrightarrow
which seems like it's an error.
I can't vouch for the accuracy of the list. Sorry.
For MathML, the over arrows would simply be mover
with the appropriate arrow as the second arg. Same for a line (U+005F).
I don't know if there is a stretchy/wider tilde or arc.
The MathML operator dictionary does list some accents: see https://www.w3.org/TR/2009/WD-MathML3-20090924/appendixc.html, "stretchy accent" operators.
In case it isn't clear, you can click on a column and it will sort by that column. So clicking on "properties" is a way to get all the stretch operators together. Of course, whether a character actually will stretch depends upon the font being used.
Any update on this? Or any other help I could bring?
It could help if you could provide the specific mappings you are looking for.
Hi Arno, a long time without coming here. What are you referring to the mapping??? An example here is that modifing somelines of code in the lib I get something more useful from the \overleftrightarrow. Modified lines atom-to-math-ml.ts:
864: overscript = atom.above || atom.svgAbove;
866: if ((overscript) && (atom.svgBelow || underscript))
And I start getting this: <mover ><mrow><mi>A</mi><mo>⁢</mo><mi>b</mi></mrow>←</mover>
And what I want to get is this: <mover><mrow><mi>A</mi><mi>b</mi></mrow><mo stretchy="true" style="math-style: normal; math-depth: 0;">←</mo></mover>
see: https://temml.org/
Description
In this codepen i've added a couple of Extensible Accents conversion adding its return value to the doc. In mathfield I'm showing how we need to be render with the exact formula.
Steps to Reproduce
('\\overgroup{ab}')
ej:convertLatexToMathMl('\\overgroup{ab}');
Actual Behavior
Expected Behavior
Environment
Operating System Windows
Browser _Chrome, Firefox ... didn't test in others.