Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mathjax 3.2.0 (and earlier versions too) have broken svg layout when compared to 2.5 series #2836

Closed
kevinhendricks opened this issue Feb 15, 2022 · 2 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed v3 v3.2
Milestone

Comments

@kevinhendricks
Copy link

Issue Summary

Attached is a testmj.zip folder which has mathml pages extracted from the official epub 3.0 test suite extracted into xhtml.

This test is nice as it has its own images of what the mathml should look like when properly processed by MathJax.

I have tested with FireFox, Safari, Chrome, and QtWebEngine (Sigil and PageEdit) and all show the same errors under MathJax 3.2.0, 3.1.X, etc

The .xhtml file names indicates the the version of MathJax and the output chosen.

Using the mml-svg testcase you can see that the series, integral, and infinite sum equations at the top of the file no longer layout properly (and have not in any of the MathJax after 3.0.5).

The testsuite also shows issues with bidirectional multiscipts in rtl in both mml-svg and mml-chtml.

Included is also a test of the newly added back mml3 extension (trying to follow the latest MathJax 3.2 docs to enable it) but it fails every time with mlongdiv unknown. Perhaps I have set it up incorrectly.

Steps to Reproduce:

  1. Unzip testmj.zip
  2. Use Safari, Chrome, etc to "Open File" the .xhtml files in testmj/text/
  3. The test name indicates what is being tested (please choose an svg output one)

Results should be similar to old single file MathJax 2.7.5 included beside the xhtml files.

Technical details:

  • MathJax Version: 3.2
  • Client OS: Mac OS X 10.15, Windows 11, QtWebEngine (Qt 6.2.3 and Qt 5.12.9), etc
  • Browser: Chrome, Safari, Firefox, etc

Supporting information:

Attached standalone test case so you can see everything.

testmj.zip

@dpvc
Copy link
Member

dpvc commented Feb 18, 2022

Thanks for your report, and the test files.

The issue with the SVG output turns out to be triggered by the presence of the comments in the token elements. When a token element has more than one text child, the SVG output incorrectly positions the text of the first text child. When the comment is in the element, there is text before the comment and after it, which caused the misplaced display. Without the comments, the display is correct.

This error is fixed here as part of a PR that has already been made. So this should be resolved in the next release.

In terms of the bidirectional issues, MathJax doesn't currently support bi-directional output (in v2 or v3). It is something we do hope to address in the future.

The issue with the mml3 processing has been reported at #2718, and fixed via mathjax/MathJax-src#765. This will also be resolved in the next release.

@dpvc dpvc added the Accepted Issue has been reproduced by MathJax team label Feb 18, 2022
@dpvc dpvc added this to the 3.2.1 milestone Feb 18, 2022
@dpvc dpvc self-assigned this Feb 18, 2022
@kevinhendricks
Copy link
Author

That is wonderful news! Thank you for looking into it so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed v3 v3.2
Projects
None yet
Development

No branches or pull requests

2 participants