Closed pkra closed 6 years ago
Minimal example:
var mjAPI = require("./lib/main.js");
mjAPI.typeset({
math: "\\begin{equation} x \\tag{1} \\end{equation}",
format: ("TeX"),
svg: true
}, function (data) {
if (!data.errors) {console.log(data.svg)}
});
// => <svg xmlns:xlink="http://www.w3.org/1999/xlink" width="100ex" height="2.843ex" style="vertical-align: -0.838ex; max-width: 600;" ...
The problem is line 2175 in the SVG jax.js file. It should have + 'px'
at the end.
Huh, weird; I tested it and didn't see this with MathJax itself. If browsers add the px themselves, jsdom might consider this a bug.
In earlier versions of CSS, unit-less values meant px
, and browsers probably still handle that for backward compatibility. The CSSStyleDeclaration implementation in jsdom is very buggy (as you will recall), and I don't think it is currently being actively maintained.
Thanks for clarifying, Davide.
This has been fixed upstream (but perhaps closing this should wait until https://github.com/mathjax/MathJax/issues/1972 is resolved).
The SVG output generates a max-width as an inline style (e.g. labeled expressions). However, the value is missing a unit and is thus invalid.
MathJax itself seems to give the max-width is given in
px
.