Skip to content

Unexpected linebreak behaviour with array environments in v4 #3434

@dmca-glasgow

Description

@dmca-glasgow

Issue Summary

When displayOverflow: 'linebreak' is set on an SVG output, and for example containerWidth: 600 is set on doc.convert from the node methods, array environments are incorrectly rendered when triggered to "wrap", for example:

Image

becomes:

Image

When the containerWidth is less than the natural width of the SVG.

Steps to Reproduce:

The LaTeX code used in the above example, although I see this with all wide array environments:

\[
\begin{array}{r|ccccccc}
\text{cycle structure} & e & ({*}{*}) & ({*}{*}{*}) & ({*}{*}{*}{*}) & ({*}{*}{*}{*}{*}) & ({*}{*})({*}{*}) & ({*}{*}{*})({*}{*})  \\
\hline\text{\# of elements} & 1 & 10 & 20 & 30 & 24 & 15 & 20
\end{array}
\]

This can be replicated using the node demo tex2svg like so:

./tex2svg --overflow linebreak --width 600 '\begin{array}{r|ccccccc}
\text{cycle structure} & e & ({*}{*}) & ({*}{*}{*}) & ({*}{*}{*}{*}) & ({*}{*}{*}{*}{*}) & ({*}{*})({*}{*}) & ({*}{*}{*})({*}{*})  \\
\hline\text{\# of elements} & 1 & 10 & 20 & 30 & 24 & 15 & 20
\end{array}'

Technical details:

  • MathJax Version: 4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedIssue has been reproduced by MathJax teamMergedMerged into develop branchv4

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions