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
Subscripts and superscripts are incorrectly sized inside SVG when font-size
is set on <foreignObject>
#2975
Comments
font-size
is set on <foreignObject>
This is because the default value for the So you might want to set the default minimum script size to something smaller. For example, MathJax = {
startup: {
ready() {
MathJax._.core.MmlTree.MmlNodes.math.MmlMath.defaults.scriptminsize = '8pt';
MathJax.startup.defaultReady();
}
}
} sets it back to |
Many thanks @dpvc for your quick response, the detailed explanation, and the fix! While I now understand the reasons for this, I still consider this a bug, since the 'actual font-size' of the sub- and superscripts is much larger than Would you consider changing the default value of |
Yes, the value used for |
… a better default value. (mathjax/MathJax#2975)
I've made a PR to improve the handling of |
Better handling of scriptminsize (mathjax/MathJax#2975)
Issue Summary
When
style="font-size: ..."
is set on a<foreignObject>
tag inside of an SVG, subscripts and superscripts are incorrectly sized (see the screenshot below).When no
style="font-size: ..."
is set on the<foreignObject>
, this bug does not appear. The problem exists both for SVG as well as CHTML output, although the size and positioning appears to be slightly different in each case.Steps to Reproduce:
Technical details:
I am using the following MathJax configuration: None
and loading MathJax via
Supporting information:
HTML file:
The text was updated successfully, but these errors were encountered: