Page MenuHomePhabricator

native: align environement still not optimal
Open, MediumPublic

Description

Most things seem fine, although with a lighter weight, and font size for equations a little less than standard font for surronding text. A couple of things are broken

\begin{align}
f(x) & = (a+b)^2 \\
& = a^2+2ab+b^2 \\
\end{align}

Has not aligned correctly. It can be made to perform a bit better, if a second ampersand is added

\begin{align}
f(x) & = & (a+b)^2 \\
& = & a^2+2ab+b^2
\end{align}

But chrome is aligning each part in the centre of its space rather than left aligning. It also not respecting alignment info in \begin{array}{lcr}.

I'm not sure where the issues lie, is it the conversion of latex to mathml, or Chrome's rendering of the mathml.

Event Timeline

"\begin{align} f(x) & = (a+b)^2 \\\\ & = a^2+2ab+b^2 \\\\ \\end{align}"; #renders not correctly
"\begin{align} f(x) & = & (a+b)^2 \\\\ & = & a^2+2ab+b^2 \\end{align}"; #renders correctly
"\begin{align} f(x) & = (a+b)^2 \\\\ & = a^2+2ab+b^2 \\end{align}";    # renders correctly

Just checked these variations. In the current implementation, the Ampersand is not recognized. The difference in rendering behaviour of the examples, is the trailing row-seperators as backslashes.

Edit after setting very similar to MathJax output i just read columnalign-attribute is not supported in Chrome currently https://golem.ph.utexas.edu/~distler/blog/archives/003452.html

Change 973344 had a related patch set uploaded (by Stegmujo; author: Stegmujo):

[mediawiki/extensions/Math@master] Fix begin align rendering trailing row seperators

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

Edit after setting very similar to MathJax output i just read columnalign-attribute is not supported in Chrome currently https://golem.ph.utexas.edu/~distler/blog/archives/003452.html

This points to
https://github.com/parasew/instiki/commit/debe162a7de353d63452322fc85f668868e8b9b8

My feeling is that it is an issue with Chrome not supporting some attributes of mtable https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable For me it looks good with FF and safari. @fredw Can you confirm this? Do you know if there is an upstream issue?