Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Can't use with mathjax-node-svg2png #86

Open
marcin-serwin opened this issue Aug 18, 2020 · 1 comment
Open

Can't use with mathjax-node-svg2png #86

marcin-serwin opened this issue Aug 18, 2020 · 1 comment

Comments

@marcin-serwin
Copy link

marcin-serwin commented Aug 18, 2020

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

// a dummy call to wait for mathjax-node to finish

produces an SVG with width 0.

@pkra
Copy link
Owner

pkra commented Aug 18, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants