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

(v4 inline) the spacing around \implies is different from v3 #3166

Open
hbghlyj opened this issue Jan 24, 2024 · 3 comments
Open

(v4 inline) the spacing around \implies is different from v3 #3166

hbghlyj opened this issue Jan 24, 2024 · 3 comments
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 v4

Comments

@hbghlyj
Copy link

hbghlyj commented Jan 24, 2024

I'm loading MathJax v3 via
<html>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-svg.js"></script>
\(P\implies Q\)
</html>

Screenshot:
image

I'm loading MathJax v4 via

<html>
<script src="https://cdn.jsdelivr.net/npm/mathjax@4.0.0-beta.4/tex-svg.js"></script>
\(P\implies Q\)
</html>

Screenshot:
image

The CHTML output is fine.

@dpvc
Copy link
Member

dpvc commented Jan 24, 2024

This is an interaction of the in-line lin-breaking code with the spacing in SVG output, similar to #3165 and #3135, but apparently not quite the same one. I will need to look into it further.

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

dpvc commented Jan 24, 2024

PS, the current version for v3 is 3.2.2, not 3.0.1, so best to test against that in the future.

@dpvc
Copy link
Member

dpvc commented Jan 26, 2024

I have made a PR to resolve this issue, but for now, you can incorporate

MathJax = {
  startup: { 
    ready() {
      const {SvgWrappers} = MathJax._.output.svg.Wrappers_ts;
      SvgWrappers.mspace = class mySvgMspace extends SvgWrappers.mspace {
        computeLineBBox(i) {
          const bbox = super.computeLineBBox(i);
          if (i === 1) {
            bbox.w = this.getBBox().w;
            bbox.isFirst = (bbox.w === 0);
          }
          return bbox;
        }
      }
      MathJax.startup.defaultReady();
    }
  }
};

into your MathJax configuration in order to work around the problem.

@dpvc dpvc added the Code Example Contains an illustrative code example, solution, or work-around label Jan 26, 2024
dpvc added a commit to mathjax/MathJax-src that referenced this issue Feb 1, 2024
Fix issues with line breaks and spacing in SVG output. (mathjax/MathJax#3166)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Feb 1, 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 v4
Projects
None yet
Development

No branches or pull requests

2 participants