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

Wrapping with \text{} creates strange overlapped output with tex-svg-full #2524

Closed
zmoon opened this issue Sep 6, 2020 · 3 comments
Closed
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Milestone

Comments

@zmoon
Copy link

zmoon commented Sep 6, 2020

Issue Summary

Wrapping with \text{} creates strange overlapped output with tex-svg-full but not tex-svg.

Example:

\text{
This is an equation: $y = m\,x + b$; another: $e^{i \pi} = -1$. These are literal dollar signs: \$\$
}

With tex-svg-full (see full code below):
mathjax3_test_bad

With tex-svg:
mathjax3_test_good

Technical details:

  • MathJax Version: 3.0.5 (MathJax.version in console) but 3.1.0 in the "About MathJax" right-click menu
  • Client OS: Windows 10
  • Browser: Firefox 80.0

Supporting information:

code
<!DOCTYPE html>
<html>
<head>
<title>MathJax TeX Test Page</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script type="text/javascript" id="MathJax-script" async
  src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg-full.js">
</script>
</head>
<body>

$$
\text{
This is an equation: $y = m\,x + b$; another: $e^{i \pi} = -1$. These are literal dollar signs: \$\$
}
$$

</body>
</html>
@dpvc
Copy link
Member

dpvc commented Sep 6, 2020

This is an error with the textmacros extension, which is included in the tex-svg-full component, but not tex-svg the component. Apparently there is a bug with it in the SVG output that I'm looking into. For now, you should be able to disable it using

<script>
MathJax = {
  tex: {
    packages: {'[-]': ['textmacros']}
  }
}

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team Investigate v3 labels Sep 6, 2020
dpvc added a commit to mathjax/MathJax-src that referenced this issue Sep 6, 2020
@dpvc dpvc added this to the 3.1.1 milestone Sep 6, 2020
dpvc added a commit to mathjax/MathJax-src that referenced this issue Sep 12, 2020
 Fix issue with textmacros in SVG mode. (mathjax/MathJax#2524)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Sep 12, 2020
@edemaine
Copy link

In case you need some more breaking tests for textmacros, I found the following, testing on the demo site:

$$\require{textmacros}hello + \text{\textbf{hello}}$$

renders correctly as:
image

$$\require{textmacros}hello + \text{hello}$$

renders correctly as:
image

$$\require{textmacros}hello + \text{hello \textbf{hello}}$$

renders incorrectly as:

image

@dpvc
Copy link
Member

dpvc commented Sep 13, 2020

Thanks. I suspect it is related to the same issue, which must not be completely resolved. Sigh.

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

No branches or pull requests

3 participants