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

[textmacros] \tag{$*$} spacing issue #2828

Closed
pkra opened this issue Feb 2, 2022 · 3 comments
Closed

[textmacros] \tag{$*$} spacing issue #2828

pkra opened this issue Feb 2, 2022 · 3 comments
Labels
Accepted Issue has been reproduced by MathJax team Code Example Contains an illustrative code example, solution, or work-around Fixed Test Needed v3 v3.2
Milestone

Comments

@pkra
Copy link
Contributor

pkra commented Feb 2, 2022

E.g.$$\text{Tag with math}\tag{$*$}$$ will render differently (using SVG but see below).

Without textmacros extension:

image

With textmacros extension:

image

I think this come down to a missing data-mjx-texclass="ORD" when the extension is active.

@dpvc
Copy link
Member

dpvc commented Feb 2, 2022

You are correct about the cause. It should to be hard to fix. Thanks for the report!

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team Ready for Development v3 labels Feb 2, 2022
@dpvc dpvc self-assigned this Feb 2, 2022
@dpvc dpvc added this to the 3.2.1 milestone Feb 2, 2022
@dpvc
Copy link
Member

dpvc commented Feb 2, 2022

PS, you could use \tag{${*}$} for now to work around the problem.

@dpvc
Copy link
Member

dpvc commented Feb 2, 2022

I've made a PR to address the issue. But in the meantime, you can use

MathJax = {
  loader: {load: ['[tex]/textmacros']},
  tex: {packages: {'[+]': ['textmacros']}},
  startup: {
    ready() {
      const TextParser = MathJax._.input.tex.textmacros.TextParser.TextParser;
      const TextParser.prototype._PushMath = TextParser.prototype.PushMath;
      TextParser.prototype.PushMath = (mml) => {
        if (!mml.isKind('TeXAtom')) {
          mml = this.create('node', 'TeXAtom', [mml]);  // make sure the math is class ORD
        }
        this._PushMath(mml);
      };
      MathJax.startup.defaultReady();
    }
  }
}

as part of your configuration in order to get the effect of the patch.

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 Fixed Test Needed v3 v3.2
Projects
None yet
Development

No branches or pull requests

2 participants