pkra / mathjax-node-page

mathjax-node for pages
Apache License 2.0
42 stars 20 forks source link

using svg2png with mjpage from command-line #84

Open ronligt opened 4 years ago

ronligt commented 4 years ago

We're using mjpage from the command-line to render a lot of equations on a lot of html-pages to SVG. This works great!

Just very recent we're experiencing problems with SVG in Cordova on the latest iOS. As a temporary solution we want to render the equations to PNG (instead of SVG) with the mathjax-node-svg2png package. We can't however find a way to use this functionality directly from the command-line with mjpage.

Is there a option we need to add to mjpage to create PNG-files? Are links to these PNG-files automagically inserted in the original HTML file in place of the equations?

Kind regards, Ronald

pkra commented 4 years ago

Is there a option we need to add to mjpage to create PNG-files?

I'm afraid there isn't. The easiest workaround would be to modfy ./bin/mjpage to suit your needs, i.e., along the lines of the instructions at https://github.com/pkra/mathjax-node-page#mathjax-node-customization.

Just very recent we're experiencing problems with SVG in Cordova on the latest iOS.

It sounds painful to have to go back to PNG on a modern OS. Are you able to share some details?

(FWIW, I would also advise to look at switching to mathjax v3 which supports NodeJS out of the box.)