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

[4 beta6] underline with prime renders as accent, not superscript #3233

Open
pkra opened this issue May 21, 2024 · 1 comment
Open

[4 beta6] underline with prime renders as accent, not superscript #3233

pkra opened this issue May 21, 2024 · 1 comment
Labels
Accepted Issue has been reproduced by MathJax team Code Example Contains an illustrative code example, solution, or work-around Merged Merged into develop branch Test Needed v4

Comments

@pkra
Copy link
Contributor

pkra commented May 21, 2024

In 4.beta-6, \underline{b}' renders the prime as accent

image

instead of superscript (mathjax.org#demo)

image

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

dpvc commented May 24, 2024

This one is due to the same commit as #3234, and for the same reason, except in a different place. Here is a configuration that patches the PrimeItem object to replace the incorrect function.

MathJax = {
  startup: {
    ready() {
      const {PrimeItem} = MathJax._.input.tex.base.BaseItems;
      const NodeUtil = MathJax._.input.tex.NodeUtil.default;
      PrimeItem.prototype.checkItem = function(item) {
        let [top0, top1] = this.Peek(2);
        const isSup = NodeUtil.isType(top0, 'msubsup') && !NodeUtil.getChildAt(top0, top0.sup);
        const isOver = NodeUtil.isType(top0, 'munderover') && !NodeUtil.getChildAt(top0, top0.over) &&
                      !NodeUtil.getProperty(top0, 'subsupOK');
        if (!isSup && !isOver) {
          const node = this.create('node', top0.getProperty('movesupsub') ? 'mover' : 'msup', [top0, top1]);
          return [[node, item], true];
        }
        const pos = isSup ? top0.sup : top0.over;
        NodeUtil.setChild(top0, pos, top1);
        return [[top0, item], true];
      }
      MathJax.startup.defaultReady();
    }
  }
};

The subsupOK check was again the missing piece.

Again, I will make a PR for this (combined with the one for #3234).

@dpvc dpvc added the Code Example Contains an illustrative code example, solution, or work-around label May 24, 2024
dpvc added a commit to mathjax/MathJax-src that referenced this issue May 24, 2024
dpvc added a commit to mathjax/MathJax-src that referenced this issue Jun 5, 2024
dpvc added a commit to mathjax/MathJax-src that referenced this issue Jun 11, 2024
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Jun 11, 2024
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 Merged Merged into develop branch Test Needed v4
Projects
None yet
Development

No branches or pull requests

2 participants