mathjax-node-page icon indicating copy to clipboard operation
mathjax-node-page copied to clipboard

Can't use with mathjax-node-svg2png

Open marcin-serwin opened this issue 4 years ago • 1 comments

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 &gt; 0}\\; \\exists_{\\delta &gt; 0}\\; \\forall_{x \\in M}\\ \\ \\ |x-x_0| &lt; \\delta \\Rightarrow |f(x) - f(x_0)| &lt; \\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.

marcin-serwin avatar Aug 18 '20 16:08 marcin-serwin

Good catch. Unfortunately, this repository is no longer maintained, see also #87.

pkra avatar Aug 18 '20 18:08 pkra