-
-
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
\overbrace broken in SVG output #2402
Comments
"\not\equiv" failed in SVG output in MJ 3.0.5 |
@dainiak, yes, it is the same issue. You can use <script>
MathJax = {
startup: {
ready() {
if (MathJax.version === '3.0.5') {
const SVGWrapper = MathJax._.output.svg.Wrapper.SVGWrapper;
const CommonWrapper = SVGWrapper.prototype.__proto__;
SVGWrapper.prototype.unicodeChars = function (text, variant) {
if (!variant) variant = this.variant || 'normal';
return CommonWrapper.unicodeChars.call(this, text, variant);
}
}
MathJax.startup.defaultReady();
}
}
};
</script> as a work-around until the next release. |
Fix \overbrace in SVG output. (mathjax/MathJax#2402)
Fixed in v3.1 released today. |
Still Problems with svg-Output: Try it on https://mathjax.github.io/MathJax-demos-web/input-tex2svg.html set on renderer: svg with \overbrace{\underbrace{x}\text{real} +\underbrace{iy}\text{imaginary}}^\text{complex number}. In HTML it is fixed. |
@FDK7, it works for me: ![]() Are you still getting an error message? |
It is set to SVG initially (and I checked that it was set to that). But if I switch first to CHTML, reload the page, and switch back to SVG, then I see your results. This is not the same issue as the original, and should have been reported in a new issue (it is never good to add to a closed issue if it is not the same issue). This appears to be related to switching from the initial CHTML renderer to SVG, and since there is some shared data between them, it appears that something is being changed by CHTML that affects the SVG output. Version 4 (currently in beta release) does not have this issue, so it is fixed in v4, but I'll see if I can figure out what is happening in v3 and provide a work-around. |
@FDK7, OK, here is a configuration that should resolve the problem in v3: MathJax = {
startup: {
ready() {
if (MathJax._.output.svg) {
const {SVGWrapper} = MathJax._.output.svg.Wrapper;
Object.assign(SVGWrapper.prototype, {
_unicodeChars: SVGWrapper.prototype.unicodeChars,
unicodeChars(text, variant = this.variant) {
text = text.replace(/\\([0-9A-F]{1,4})/g, (match, n) => String.fromCodePoint(parseInt(n, 16)));
return this._unicodeChars(text, variant);
}
});
}
MathJax.startup.defaultReady();
}
}
}; If you incorporate that into your configuration, that should take care of it. |
Great! Included in my electron-app and it is working. Thanks so much! |
Use of
\overbrace
causes an error (getVariant
not defined). This is due to not passing the variant name tounicodeChars()
in theplaceChar()
method.See the MathJax User's Forum post.
The text was updated successfully, but these errors were encountered: