opencollab / jlatexmath

A Java API to render LaTeX
Other
514 stars 109 forks source link

matrices wrong after one with empty cell #46

Closed murkle closed 3 years ago

murkle commented 6 years ago

Just spotted this fix in a fork: https://github.com/CBN-Polska/jlatexmath/commit/271489baed5183664003989ae8e36895463e2a2c

-                    boxarr[i][j - 1].type = TeXConstants.TYPE_INTERTEXT;
+                    if (boxarr[i][j - 1] != nullBox) // BUGFIX: EN-122
+                        boxarr[i][j - 1].type = TeXConstants.TYPE_INTERTEXT;

BUGFIX EN-122 solves problem:

When a matrix like this

\begin{tabular}{ccc}
  &     \\
  & 1 & 2  \\
\end{tabular}

is created then all next matrixes having first cell in a row empty have all row empty.

So when you call above tex and later write for example:

\begin{tabular}{ccc}
  & 2 & 3   \\
4 & 5 & 6  \\
  & 8 & 9  \\
\end{tabular}

you will see only 4 5 6. First and third line are print empty.

murkle commented 6 years ago

Seems related to this bug: https://github.com/opencollab/jlatexmath/issues/30