-
-
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
SVG output ignores the scale configuration option #2376
Comments
How can I help with testing? I'm seeing this on Safari (iOS 13, macOS 10.15) - chose _SVG to get away from _CHTML which doesn't render all MML items. |
You could try out the Alternatively, this is a sample file that patches the CDN copy of MathJax, and you can check that this does scale properly when you set the scaling factor. <!DOCTYPE html>
<html>
<head>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta charset="utf-8"/>
<title>SVG scale option</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script>
MathJax = {
svg: {
scale: 2
},
startup: {
ready() {
const SVG = MathJax._.output.svg_ts.SVG;
const percent = MathJax._.util.lengths.percent;
SVG.prototype.setScale = function (node) {
if (this.options.scale !== 1) {
this.adaptor.setStyle(node, 'fontSize', percent(this.options.scale));
}
}
MathJax.startup.defaultReady();
}
}
};
</script>
<script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
</head>
<body>
Scaled math: \(x+1\).
</body>
</html> If it works for you, you could indicate that in the pull request for this issue. |
Both SVG and CHTML should process exactly the same MathML items. Can you give an example of one that CHTML doesn't process but SVG does? |
Sorry that comment was probably out of line/scope. I am experiencing rendering issues with 2.7.x not 3.0 but that's on a site which is subscription only with tests, not entirely easy to provide examples. I'll open a specific issue if I can recreate it in a vanilla HTML. Will report back about the scaling. |
No problem. Thanks for being willing to help check. |
Make SVG honor the scale configuration option. (mathjax/MathJax#2376)
The SVG output is not taking the scale configuration option into account. This should be done in the SVG output jax
setScale()
method, but that was override because the default includes the MathItem's metric scaling as well, which isn't needed for SVG output.The text was updated successfully, but these errors were encountered: