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

SVG output can lose \text{} content #775

Closed
sam-pf opened this issue Mar 27, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@sam-pf
Copy link

commented Mar 27, 2014

I may have found an odd issue with the SVG output, and I would like to report it. Basically, p \left(L_n \left| \text{evidence} \right.\right) does not render well in the SVG output mode, while p \left(\left. L_n \right| \text{evidence} \right) works fine. Both expressions render fine in the HTML-CSS mode. It appears that problem occurs when \left and \right encloses a pure text. You can see it for yourself in the following link.

http://jsfiddle.net/SamG/w93vc/

@dpvc dpvc added Accepted labels Mar 27, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 27, 2014

Thanks. I'm able to reproduce the problem. I'll check into it.

For now, you can use \middle for the central vertical line:

p \left(L_n \middle| \, \text{evidence} \right)
@sam-pf

This comment has been minimized.

Copy link
Author

commented Mar 28, 2014

Thanks for both comments. I did not know about \middle---seems quite useful!

@dpvc dpvc added this to the Next Release milestone Aug 19, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Sep 9, 2014

Davide P. Cervone
Make mrows that are embellished operators properly include the elemen…
…ts other than the core when stretched. Resolves issue mathjax#775.

dpvc pushed a commit to dpvc/MathJax that referenced this issue Sep 9, 2014

Davide P. Cervone
Make fences use empty <mo> for blank delimiters so the result will no…
…t be an embellished operator. Also resolves issue mathjax#775.
@dpvc

This comment has been minimized.

Copy link
Member

commented Sep 9, 2014

OK, this one turned out to be a bit subtle. When the delimiter for \right is ., the resulting MathML construct is an <mrow> containing an <mo> with the opening delimiter followed by the contents of the \left...\right. In this case, that content was a single <mtext> element. So the result is <mrow><mo>|</mo><mtext>evidence</mtext></mrow>. Since <mtext> is considered space-like, this makes this an "embellished operator" (with core <mo>|</mo>. When that is used inside another <mrow>, it will stretch to meet the size of that <mrow>. Unfortunately, the SVG output had a bug where it only stretched the <mo> and lost the other elements in the <mrow> when it was stretched as an embellished operator.

This also means that

\left(\left(\text{x}\right.\Rule{.5em}{2em}{0pt}\right)

will produce the wrong result (the inner parenthesis will be too large).

I have fixed both problems in the issue775 branch of my fork of MathJax.

@dpvc dpvc changed the title SVG output oddity SVG output can lose \text{} content Sep 11, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Sep 14, 2014

@dpvc dpvc added Merged and removed Ready for Review labels Sep 14, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Sep 14, 2014

==> Merged.

@dpvc dpvc closed this Sep 14, 2014

dpvc pushed a commit to mathjax/MathJax-test that referenced this issue Jan 17, 2015

@dpvc dpvc added Test Available and removed Test Needed labels Jan 17, 2015

@dpvc

This comment has been minimized.

Copy link
Member

commented Jan 17, 2015

==> In Testsuite

LaTeXToMathML/delimiters/issue775.html
MathMLToDisplay/Presentation/GeneralLayout/mfenced/issue775.html

@dpvc dpvc added Fixed v2.5 and removed Merged labels Jan 30, 2015

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.