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

[CommonHTML] [Firefox] Anomaly with spacing before and after \text #1718

Closed
cebola2 opened this issue Mar 12, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@cebola2
Copy link

commented Mar 12, 2017

The issue can be seen in https://cdi2tp.math.tecnico.ulisboa.pt/texto/10 with Firefox 52 on Linux Mint. This may be very browser, version, OS,..., specific problem. Absent from Firefox 51 on Windows or Firefox 52 on Android.

imagem

Spacing after the phrase "Existe um caminho unindo" in a displayed formula has disappeared although you can see it on mouseover.

@pkra pkra added the Accepted label Mar 13, 2017

@pkra pkra added this to the A future release milestone Mar 13, 2017

@pkra pkra added the Investigate label Mar 13, 2017

@pkra

This comment has been minimized.

Copy link
Member

commented Mar 13, 2017

Thanks for the report.

I see this on FF 51 on Windows 10 actually (and Linux) but not on macOS.

I also only see this for the CommonHTML output.

@pkra pkra changed the title Anomaly with spacing before and after \text [CommonHTML] [Firefox] Anomaly with spacing before and after \text Mar 13, 2017

@pkra

This comment has been minimized.

Copy link
Member

commented Mar 13, 2017

For the record, I don't see it with FF's dev channel on Win10, so it might be a browser bug with an upcoming fix.

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 29, 2017

The issue is not restricted to Firefox. Here's what's going on: because you are using mtextFontInherit:true, MathJax must measure the size of the text so that it knows how much space it takes up. It gets the size in pixels, and must convert that to em's (which is what it uses internally). This is done using the em-size of the font surrounding the math, but this value is determined empirically and so is only an approximation. For a very wide item (like a long string of text), the inaccuracy of the em-size has a noticeable effect on the size that MathJax determines, and so the computed size is somewhat far off from the actual size. The CommonHTML output forces the size of the items it measures to be the computed size (so that if it is off, that doesn't have ripple effects to the sizes of things that surround it). So what you are seeing here is CommonHTML trying to force the long line of text to fit the size it thinks it is rather than the size it actually is.

One possible solution might be to have CommonHTML not set the width for items over a certain size, where the inaccuracy in the em-size measurements are magnified to such an extent that it becomes problematic, as in this case. Or a second measurement could be taken after the size is set to see how far off it is (though that would cause an additional reflow performance hit).

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 7, 2017

The issue1718 branch of my fork of MathJax works around this.

@dpvc dpvc removed their assignment Jul 7, 2017

dpvc added a commit that referenced this issue Jul 10, 2017

Merge pull request #1788 from dpvc/issue1718
Don't force width of large collections of text.  #1718.
@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 10, 2017

==> Merged

@dpvc dpvc added Merged and removed Ready for Review labels Jul 10, 2017

dpvc pushed a commit to mathjax/MathJax-test that referenced this issue Jul 15, 2017

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 15, 2017

==> In testsuite

MathMLToDisplay/Presentation/TokenElements/mtext/issue1718.html

@dpvc dpvc added Test Available and removed Test Needed labels Jul 15, 2017

@dpvc dpvc closed this Jul 15, 2017

@dpvc dpvc added Fixed v2.7 and removed Merged labels Jul 18, 2018

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.