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

horizontal spacing for displayed equation structures when a floated element exists on the same line (version 4 beta 7) #3299

Open
cebola2 opened this issue Oct 16, 2024 · 5 comments
Labels
Accepted Issue has been reproduced by MathJax team v4

Comments

@cebola2
Copy link

cebola2 commented Oct 16, 2024


Issue Summary

There is something wrong with horizontal spacing for displayed equation structures when a floated element exists on the same line. I have a page which is a kind of torture test on this respect.

Steps to Reproduce:

Go to https://mr.math.tecnico.ulisboa.pt/seminars_1?id=7380 on a tablet in vertical mode. You will probably see something like this

https://photos.app.goo.gl/5uY6UQs9G38vVwsXA

There is a displayed equation block missing between the words "form" and "where".

On a phone you might see it or not. I have not been able to make it reproducible but when you do see it it will look all right except for some extra vertical spacing after the displayed equation block as in

https://photos.app.goo.gl/JhR5o1jXf2v1GjbUA

On a desktop system there are no visible problems.

It might be relevant or not that the displayed equation block has an equation number.

Technical details:

This seems quite independent from browsers and other technical details except for screen width and MathJax version which is MathJax-4.0.0-beta.7 installed locally.

Configuration is available from https://mr.math.tecnico.ulisboa.pt/seminars_1?id=7380

Supporting information:

imagem

imagem

@dpvc
Copy link
Member

dpvc commented Oct 17, 2024

It looks like it may be related to the lazy typesetting extension. Can you try disabling that (i.e., not loading it) and see if that resolves the issue? My best guess is that the events needed by the intersection observer that indicate when the math comes into view may have fired before MathJax has been set up, and so the expressions aren't being displayed for that reason.

You might also try changing the defer to async on the script that loads tex-mml-svg-nofont.js and removing defer from the one that loads your configuration. It may be that getting MathJax to run earlier will allow it to get the needed events.

If either of those work for you, please let us know. We may have to figure out a way to get the initial intersection observer events if that is the problem.

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team v4 labels Oct 17, 2024
@dpvc
Copy link
Member

dpvc commented Oct 17, 2024

Oh, as for the extra spacing, it looks like the linebreaking is trying to kick in and may be inserting a break after the final comma (not what it should be doing), which is causing a blank line to be inserted. I will have to look into that further.

@cebola2
Copy link
Author

cebola2 commented Oct 18, 2024

Removing lazy typesetting does solve the disappearance of the displayed equation block in portable devices. On this particular site that is an acceptable solution. I will create a page with lazy typesetting displaying the original problem sometime later today and correct the link in the report above.

Thanks for your usual super fast and accurate answer!

@cebola2
Copy link
Author

cebola2 commented Oct 18, 2024

I have changed the link in the original report from https://mr.math.tecnico.ulisboa.pt/seminars?id=7380 to https://mr.math.tecnico.ulisboa.pt/seminars_1?id=7380

The former link no longer uses the lazy typesetting extension.

The far less serious problem of extra vertical spacing is visible in both.

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 v4
Projects
None yet
Development

No branches or pull requests

4 participants
@dpvc @cebola2 and others