Page MenuHomePhabricator

Problem while displaying latex code with \underline
Closed, ResolvedPublic

Description

Hello,

formulas written with latex will not displayed correctly, if the formula has an underline. In this case the formula has not the same baseline as the text around it. For example a formula like <math>\underline{\mathbb{Z}}</math> is problematic. I'm using the latest version of Mozilla Firefox and my operation system is Windows 10. I have added a screenshot of a part of the German Wikipedia artical 'Garbenkohomologie' there you can see the problems.

Best reguards

Screen_Underline.png (1×1 px, 154 KB)

Details

Related Changes in Gerrit:

Event Timeline

@Christian1985 Ok. I'm seeing the problem now. Somehow the baseline adjustment must have been lost.
As a quick fix, you could install https://addons.mozilla.org/en-US/firefox/addon/native-mathml/, which makes the page look like that

Screenshot from 2016-05-16 14-52-28.png (1×1 px, 188 KB)

Physikerwelt edited projects, added Mathoid; removed Texvcjs.

I investigated this issue.

$ curl -sD - https://en.wikipedia.org/api/rest_v1/media/math/render/mml/3f62755bfb0cfae950981e324bcf06d4ba99c8d8 | grep 'x-mathoid'
x-mathoid-style: vertical-align: -0.583ex; width:1.819ex; height:3.176ex;

But I think for a good visual impression it should be more like about -1.5ex instead of -0.5.
@Pkra Do you know by chance, if that was already fixed in a recent MathJax version?

At official version of MathJax-node also reports today
width="1.808ex" height="3.176ex" style="vertical-align: -0.52ex;"

Physikerwelt renamed this task from Problem while displaying latex code with \unterline to Problem while displaying latex code with \underline.May 17 2016, 8:46 PM

We know have a set of changes that would eliminate the problem, which I deployed to our beta.math test instance

$ curl -sD - http://beta.math.wmflabs.org:7231/wikimedia.org/v1/media/math/render/mml/72270158db956adb742cf5e5d4b723badf2e2b82 | grep 'x-mathoid'
x-mathoid-style: vertical-align: -0.581ex; margin-bottom: -0.757ex; width:1.819ex; height:3.176ex;

@Christian1985 Can you check if http://beta.math.wmflabs.org:8080/wiki/Garbenkohomologie looks good now. Since a lot of code was changed, I'm afraid that it might have broken the alignments in other locations.
I also regenerated this page
http://beta.math.wmflabs.org:8080/wiki/Help:Formula
even though it does not contain to much inline math.

@Physikerwelt now there are on the page many formulas which wont be rendered. Instett I got the message "Cannot get mml. Server problem.".

@Christian1985 That's a problem with the test-server config. It can not handle too many request in parallel. It should go away when you run action=purge

@Christian1985 Can you check if http://beta.math.wmflabs.org:8080/wiki/Garbenkohomologie looks good now. Since a lot of code was changed, I'm afraid that it might have broken the alignments in other locations.

The in-lined formulae start below the text's base line in both Chromium and FF.

@mobrovac in a good or a bad way? Can you share a screenshot?

Screenshot from 2016-05-18 17-01-24.png (1×1 px, 221 KB)

Screenshot from 2016-05-18 17-02-49.png (1×1 px, 245 KB)

For me everything looks terrible compared to MathML rendering.
FF with Native MathML plugin:

Screenshot from 2016-05-18 17-05-24.png (1×1 px, 180 KB)

Here's my screenshot for Chromium:

shot-2016-05-18_23-21-45.png (1×2 px, 287 KB)

Pretty similar to yours, @Physikerwelt. Most of the in-lined formuale start lower than the text around them.

For me it looks like an improvement over the first screenshot of @Christian1985 and what was the intended behavior as described here http://beta.math.wmflabs.org:8080/wiki/MathAxisAlignment. @Christian1985 what do you think?

For me it looks like an improvement over the first screenshot of @Christian1985 and what was the intended behavior as described here http://beta.math.wmflabs.org:8080/wiki/MathAxisAlignment.

Yes, indeed, good point. I've forgotten to take a second look at the original.

Change 289312 had a related patch set uploaded (by Physikerwelt):
Update MathJax-Node version

https://gerrit.wikimedia.org/r/289312

Change 289312 merged by Mobrovac:
Update MathJax-Node version

https://gerrit.wikimedia.org/r/289312

Hello,

I think the bug is fixed. Thank you!

Christian

Physikerwelt claimed this task.