mathjax-node-page
mathjax-node-page copied to clipboard
Can't use with mathjax-node-svg2png
Versions
- mathjax-node-page: 3.2.0
- mathjax-node-svg2png: 2.0.0
- node: 13.6.0
Reproduction
'use strict';
const MathJax = require("mathjax-node-svg2png")
const mjAPI = require("mathjax-node-page");
mjAPI.init(MathJax);
mjAPI.addOutput("png", (wrapper, png) => { wrapper.innerHTML = `<img src="${png}">` })
const html = `<p>\\[\\forall_{\\varepsilon > 0}\\; \\exists_{\\delta > 0}\\; \\forall_{x \\in M}\\ \\ \\ |x-x_0| < \\delta \\Rightarrow |f(x) - f(x_0)| < \\varepsilon\\]</p>`
mjAPI.mjpage(html, {}, {
png: true,
}, result => {
console.log(result)
});
produces error
Error: Uncaught [Error: Width or height could not be determined from either the source file or the supplied dimensions
phantomjs://code/converter.js:49 in onLoadFinished]
Reason This dummy call https://github.com/pkra/mathjax-node-page/blob/858955628a6565e68e35a0d6ca4b9787530c7b22/lib/main.js#L271 produces an SVG with width 0.
Good catch. Unfortunately, this repository is no longer maintained, see also #87.