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

mfenced in maction tooltip #412

Closed
pkra opened this issue Mar 18, 2013 · 7 comments

Comments

Projects
None yet
3 participants
@pkra
Copy link
Member

commented Mar 18, 2013

It seems that MathJax is not rendering fences in a tooltip. E.g., from the MathML test suite

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<maction actiontype="tooltip">
<mrow>
<msup>
<mrow>
<mfenced>
<mrow>
<mtable>
<mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr>
<mtr><mtd><mn>2</mn></mtd><mtd><mn>3</mn></mtd></mtr>
</mtable>
</mrow>
</mfenced>
</mrow>
<mo>T</mo>
</msup>
</mrow>
<mrow>
<mfenced>
<mrow>
<mtable>
<mtr><mtd><mn>0</mn></mtd><mtd><mn>2</mn></mtd></mtr>
<mtr><mtd><mn>1</mn></mtd><mtd><mn>3</mn></mtd></mtr>
</mtable>
</mrow>
</mfenced>
</mrow>
</maction>
</math>

The tooltip is missing brackets. Should there be brackets?

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 18, 2013

Yes, there should be brackets. This turns out to be due to not calling setTeXclass() on the tooltip itself (only on the element that is the base of the tooltip). It is easily fixed in the mml/jax.js file, which I will do.

dpvc pushed a commit to dpvc/MathJax that referenced this issue Mar 18, 2013

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 18, 2013

The issue412 branch of my fork of MathJax includes the fix.

@pkra

This comment has been minimized.

Copy link
Member Author

commented Mar 18, 2013

Awesome.

@fred-wang

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2013

OK, that looks good to me, although I'm not familiar enough with the code to know when setTeXclass should be called with or without the parameter.

And as usual, when you do some changes, do not hesitate to add a comment explaining what the code is doing ;-)

=> Ready for Release
=> Unit test wanted

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 20, 2013

I'm not familiar enough with the code to know when setTeXclass should be called with or without the parameter.

The parameter is supposed to be the (logically) previous element (that is, the one that determines the spacing between the two). So given

<mi>x</mi><mrow><mo>+</mo></mrow>

when the <mo> has setTeXclass called, it is passed the <mi>, even though the <mo> has no immediate predecessor in the <mrow>.

In the case of this patch, the tooltip is acting as a separate piece of mathematics, and so it has no previous element, so we don't pass anything to setTeXclass.

dpvc pushed a commit to dpvc/MathJax that referenced this issue Mar 20, 2013

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 20, 2013

OK, I added a comment. Here are the current differences.

dpvc pushed a commit to dpvc/MathJax that referenced this issue Mar 20, 2013

@fred-wang

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2013

MathMLToDisplay/Presentation/GeneralLayout/maction/issue412.html

I verified the fix on Opera, Firefox and Chrome.

=> In testsuite

@dpvc dpvc closed this May 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.