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

Assistive MML displaced when using text-indent #3348

Open
LukeNK opened this issue Mar 23, 2025 · 3 comments
Open

Assistive MML displaced when using text-indent #3348

LukeNK opened this issue Mar 23, 2025 · 3 comments
Labels
Accepted Issue has been reproduced by MathJax team Code Example Contains an illustrative code example, solution, or work-around v3

Comments

@LukeNK
Copy link

LukeNK commented Mar 23, 2025

This is one of my first issues, so if I make any mistakes, please let me know.

Issue Summary

<mjx-assistive-mml> and the child element <math> are offset based on the value of text-indent on Microsoft Edge, Windows 11.

Steps to Reproduce:

  1. Have a paragraph element with the style text-indent set to a number

Image

The <mjx-assistive-mml> should be perfectly on the displayed math, but this time it is offset by the value of text-indent. Moreover, if you try to resize the page close to the equation itself, it will trigger the x-overflow scroll bar:

Image

Technical details:

  • MathJax Version: 3.2.3
  • Client OS: Window 11 Home 23H2 build 22631.5039
  • Browser: Microsoft Edge version 134.0.3124.83

I am using the following MathJax configuration:

window.MathJax = {
    tex: {
        tags: 'ams',
        inlineMath: [['$', '$']],
    }
};

and loading MathJax via

(() => {
    var script = document.createElement('script');
    script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js';
    script.async = true;
    document.head.appendChild(script);
})();

Supporting information:

This problem also appears when I use tex-svg.js. I tried disabling stuff with the following options:

    options: {
        enableMenu: false,
        enableAssistiveMml: false,
        assistiveMml: false,
    }

JSbin file: https://jsbin.com/bazotuj

@dpvc
Copy link
Member

dpvc commented Mar 24, 2025

Can you add the CSS

mjx-assistive-mml {
  text-indent: 0 ! important;
  bottom: 0;
  right: 0;
}

to your page and see if that resolves the issue for you?

Note: your jsBin link seems to be broken, so I can't test your exact file, but this should take care of the issue.

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team v3 Code Example Contains an illustrative code example, solution, or work-around labels Mar 24, 2025
@LukeNK
Copy link
Author

LukeNK commented Mar 27, 2025

Can you add the CSS

mjx-assistive-mml {
text-indent: 0 ! important;
bottom: 0;
right: 0;
}
to your page and see if that resolves the issue for you?

Note: your jsBin link seems to be broken, so I can't test your exact file, but this should take care of the issue.

I have tested your solution and it works! However, do you think I should keep this issue open? I think having the Assistive MML being displaced like that really messes up with CSS, considering it took me half an hour to figure out why my page has x-overflow despite setting the size of everything correctly. Let me know your opinion!

(btw, sorry for the broken JSbin; I fixed it. I hope it is right this time...)

@dpvc
Copy link
Member

dpvc commented Mar 27, 2025

Yes, leave it open for now. I will include the fix in a future PR, and will close this when that is merged.

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 Code Example Contains an illustrative code example, solution, or work-around v3
Projects
None yet
Development

No branches or pull requests

2 participants