-
-
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
Rendering error in SVG inline of \frac #3135
Comments
Thanks for this report. This seems to be connected to the in-line line breaking, so turning that off is a work-around for now. I'll look into it further and see what I can do. |
Thank you. My current workaround was manual, using
|
It turns out that MathJax was descending too far into the internal MathML tree when looking or the position of the potential inline breaks, and rather than stopping at the fraction, continued into the fraction and through the break was in the numerator. Because the scaling factor for the node where the break occurs in used to determine the size of the SVG used for the piece between line breaks, it was getting the wrong scaling factor (the scale of the numerator instead of the fractions as a whole) leading to the fraction no getting the proper width. I have made a PR to resolve the problem. I the meantime, here is a configuration that you can use to patch the incorrect function: MathJax = {
startup: {
ready() {
const {CommonWrapper} = MathJax._.output.common.Wrapper;
const getBreakNode = CommonWrapper.prototype.getBreakNode;
CommonWrapper.prototype.getBreakNode = function (bbox) {
if (!bbox.start) return [this, null];
return getBreakNode.call(this, bbox);
}
MathJax.startup.defaultReady();
}
}
}; |
Don't descend into items that aren't broken when looking for the linebreak node. (mathjax/MathJax#3135)
It appears to work fine with CHTML output. With SVG output, the frac overlaps the equals sign. The display math below is fine.
It is supposed to look as with earlier MathJax:$\frac{1}{123456789}=$
Fiddle: https://jsfiddle.net/pgce2bj5/
The text was updated successfully, but these errors were encountered: