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: mspace linebreak problems in fractions #391

Closed
pkra opened this issue Feb 8, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@pkra
Copy link
Member

commented Feb 8, 2013

The following renders fine in HTML-output but SVG-output draws a very long fraction bar.

<math display="block">
  <mfrac>
    <mrow>
      <mspace linebreak="newline" />
      <mi>A</mi>
    </mrow>
    <mrow>
      <mi>B</mi>
       </mrow>
  </mfrac>
</math>

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

Davide P. Cervone
Only set width to full for top-level math elements, and make svg.Alig…
…n() handle expanding the box to accommodate larger lines. Resolves issue mathjax#391.

@dpvc dpvc added Ready for Review and removed Investigate labels Feb 14, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Feb 14, 2014

The reason for this is that the SVG line-breaking forced the lines to be full-width so that alignment would work properly. Since we don't have dynamic placement (like in HTML, where percentage widths can be used), things like centering need to now the width before centering can be performed. But at the time a line-break is made, we don't know how large later lines may be, and so the full width was forced.

I have resolved the issue by checking if the added line is longer than the previous contents, and moving the previous contents to accommodate the new size. The full width is set only when the line-breaking is for top-level <math> elements.

dpvc pushed a commit to dpvc/MathJax that referenced this issue Feb 15, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Feb 15, 2014

=> Merged.

@dpvc

This comment has been minimized.

Copy link
Member

commented Apr 21, 2014

=> In Test Suite

MathMLToDisplay/Topics/LineBreak/issue391.html

See also

MathMLToDisplay/Presentation/CSS/mfrac/mfrac-11.html

@dpvc dpvc added v2.4 and removed Merged labels Jun 30, 2014

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.