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

Spacing after \setminus too large #2325

Closed
cebola2 opened this issue Feb 11, 2020 · 3 comments
Closed

Spacing after \setminus too large #2325

cebola2 opened this issue Feb 11, 2020 · 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
Milestone

Comments

@cebola2
Copy link

cebola2 commented Feb 11, 2020

$A\setminus B$ produces excessive space before the B.
Live page with example: https://logrus.math.tecnico.ulisboa.pt/test (MathJax 3.0.1)
Counterexample: https://cdi1tp.math.tecnico.ulisboa.pt/solucoes/T1B20181110 (MathJax 2.7.x)
Screenshot_2020-02-11 CDI II — Taguspark — Teste
Observed in current versions of Firefox and Chromium on Linux.

@dpvc
Copy link
Member

dpvc commented Feb 12, 2020

Thanks for the report. I can reproduce the issue. It looks like there is a font character mapping issue. The spacing is for a different character (which is shown in SVG output). So something is off with the character data.

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team Investigate labels Feb 12, 2020
dpvc added a commit to mathjax/MathJax-src that referenced this issue Feb 14, 2020
@dpvc
Copy link
Member

dpvc commented Feb 14, 2020

OK, I found the problem (it was caused by some complicated remapping that had been done in the v2 data that didn't transfer correctly to the v3 data via the automated tool I used for that). I have created a pull request with the fix.

In the meantime, you can use the configuration:

  MathJax = {
    startup: {
      ready() {
        MathJax.startup.defaultReady();
        if (MathJax.version.match(/^3\.0\.[01]$/)) {
          const output = MathJax.startup.document.outputJax;
          if (output.name === 'CHTML') {
            delete output.font.variant['-tex-variant'].chars[0x2216][3].f;
            output.font.variant['normal'].chars[0x2216] = [.75, .25, .5];
          } else {
            output.font.variant['normal'].chars[0x2216] = [.75, .25, .5, {
              p: '56 731Q56 740 62 745T75 750Q85 750 92 740Q96 733 270 255T444 -231Q444 -239 438 -244T424 -250Q414 -250 407 -240Q404 -236 230 242T56 731'
            }];
          }
          const handlers = MathJax.startup.document.inputJax[0].parseOptions.handlers;
          const map = handlers.retrieve('mathchar0mo');
          const amsmap = handlers.retrieve('AMSsymbols-mathchar0m0');
          delete map.map.get('setminus')._attributes.variantForm;
          amsmap.map.get('smallsetminus')._attributes = {variantForm: true};
        }
      }
    }
  }

to patch v2 on the fly.

@cebola2
Copy link
Author

cebola2 commented Feb 17, 2020

Works like a charm. Thanks!
Patched configuration for https://cdi2tp.math.tecnico.ulisboa.pt/test
Maintained original configuration in https://logrus.math.tecnico.ulisboa.pt/test

@dpvc dpvc added the v3 label Feb 19, 2020
@dpvc dpvc added this to the 3.0.2 milestone Mar 5, 2020
dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 30, 2020
Fix incorrect font data for \setminus and \smallsetminus. mathjax/MathJax#2325
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Mar 30, 2020
@dpvc dpvc added the Fixed label Apr 10, 2020
@dpvc dpvc closed this as completed Apr 10, 2020
@dpvc dpvc removed the Merged Merged into develop branch label Sep 3, 2020
@dpvc dpvc added the Code Example Contains an illustrative code example, solution, or work-around label Apr 1, 2021
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
Projects
None yet
Development

No branches or pull requests

2 participants