CSharpMath icon indicating copy to clipboard operation
CSharpMath copied to clipboard

textPainter does not correctly center an equation which contains eqnarray

Open kevcrooks opened this issue 5 years ago • 1 comments

We have a formula containing eqnarray which should appear centered, however it's rendered too far over to the right.

In the screenshot, the first formula is an eqnarray with two lines, which are aligned on the "=" sign. The third line is a separate formula which shows how the second line would appear if it was centered.

It appears that the textPainter assumes both lines in the first formula are individually centered (instead of the second line being aligned slightly to the right with the "="): image

The LaTex is respectively: $$\begin{eqnarray}a+b+c+d+e+f&=&a+b+c+d+e+f\\0 &=& a+b+c+d+e+f-a-b-c-d-e-f\end{eqnarray}$$ $$0=a+b+c+d+e+f-a-b-c-d-e-f$$

kevcrooks avatar Oct 12 '20 10:10 kevcrooks

Similar spacing issue:

$$\begin{pmatrix} y^{2}e^{xy} & (xy + 1)e^{xy} \\ (xy + 1)e^{xy} & x^{2}e^{xy} \end{pmatrix}$$

image

charlesroddie avatar Apr 29 '21 07:04 charlesroddie