-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
AsciiMath doesn't use the correct display style #2520
Comments
Handle AsciiMath configuration properly, in particular, displaystyle. (mathjax/MathJax#2520)
In some sense this bug remains. I am using MathJax 3.2.0 in Excalidraw PR #2993. AsciiMath always renders in display mode, disregarding the I tried changing @dpvc Any suggestions where to check for the real culprit? I would gladly submit a bugfix PR once a proper solution is found. |
@DanielJGeiger, the following file: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<title>AsciiMath configuration</title>
<script>
MathJax = {
loader: {load: ['input/asciimath', 'output/chtml']},
asciimath: {displaystyle: false}
}
</script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/startup.js"></script>
</head>
<body>
`sum_{n=0}^infty xn`
</body>
</html> produces for me, while switching so the My only suggestion is that the configuration is not being read, which means either it is not being inserted into the page, or it is added after MathJax already starts up, in which case it won't have any effect. I looked at the PR you linked to, but could not find the configuration at all, nor any calls to MathJax, so I wasn't able to figure out what was wrong. |
@dpvc Thanks. That example falls into one of the cases where I have seen the
My apologies. The relevant file in the linked PR is src/textlike/math/index.tsx, and the relevant method is |
OK, I think I was not understanding the issue properly. It isn't the AsciiMath Because AsciiMath doesn't actually have both display and non-display modes (it always uses wither one or the other based on the It is possible, however, to switch the global mode in the AsciiMath input jax using MathJax.InputJax.AsciiMath.AM.Augment({displaystyle: false}); (or class MyAsciiMath<N, T, D> extends AsciiMath<N, T, D> {
public compile(math: MathItem<N, T, D>, document: MathDocument<N, T, D>) {
MathJax.InputJax.AsciiMath.AM.Augment({displaystyle: math.display});
return super.Compile(math, document);
}
} so that |
AsciiMath in v3 doesn't seem to set the inherited properties correctly, as the output is in inline-mode rather than the displaystyle that is the default, despite the fact that there is an
mstyle
that sets thedisplaystyle
attribute properly. Something in the translation from the old internal MathML to the new is going wrong.The text was updated successfully, but these errors were encountered: