Can MathJax generate png equation images? (Was: Mathematics equations not showing correctly ...)

2,140 views
Skip to first unread message

William F Hammond

unread,
Dec 25, 2013, 4:36:13 PM12/25/13
to mathja...@googlegroups.com
Isn't this a new thread?

The question:

> Can I use Mathjax to convert a TeX equation to a .png image? ...

I don't know.  It's certainly not part of mainstream usage. (Why do you want to do that?)

> ... Also, can you recommend a way (gem, etc) to convert TeX to .png on the server side for a Ruby on Rails application? I really appreciate your help.

On a local platform by default the program htlatex in the tex4ht suite -- which operates on complete LaTeX documents -- generates images for math segments.  One can fashion a script to employ htlatex this way for isolated math segments by encapsulating the math segment in a (very small) complete LaTeX document.

       -- Bill




Davide P. Cervone

unread,
Dec 27, 2013, 2:12:08 PM12/27/13
to mathja...@googlegroups.com
> Can I use Mathjax to convert a TeX equation to a .png image?

No. MathJax does not produce images, it produces either: (1) HTML-with-CSS using math fonts to lay out the mathematics as positioned text on the page, (2) an SVG graphics version of the math, or (3) a MathML version of the math. It would be possible to use the SVG version and convert that to PNG, but we don't have anything packaged up do do that. There is a phantom.js implementation of converting a TeX expression into an SVG one as a command-line program. It was also converted to a web service called svgtex (https://github.com/agrbin/svgtex), and been modified to produce both SVG and MathML for use with MediaWiki as a product called Mathoid (https://github.com/gwicke/mathoid). You might be able to take one of these and add the SVG to PNG conversion to get what you want.

Davide

technisoft...@gmail.com

unread,
Sep 21, 2016, 9:12:51 AM9/21/16
to MathJax Users
Hi William,

Yeah, it seems to be possible. First convert your mathjax equation into .gif image format using LATEX. You can insert your mathjax equation formula after '?'  as mentioned below,


This will return you .gif image format. Now you can convert this .gif format to .png format by using ImageMagick with format conversion method. 
If you any help you can ask me please don't hasitate.


Reagrds,

Ahmed Shair

John Edwards

unread,
Oct 6, 2020, 8:19:09 PM10/6/20
to MathJax Users
MathJax is way too unreliable for production usage.  That's why we need to convert to images.

William F Hammond

unread,
Oct 6, 2020, 9:59:46 PM10/6/20
to mathja...@googlegroups.com
On Tue, Oct 6, 2020 at 5:19 PM John Edwards <net.st...@gmail.com> chose to revisit a dormant thread
initiated in 2013 and revived in 2016 by saying:

MathJax is way too unreliable for production usage.  That's why we need to convert to images.

I disagree.  I cannot imagine why one would say that.

                                 -- Bill

Ahmed Shair

unread,
Oct 7, 2020, 1:53:59 AM10/7/20
to MathJax Users
I also disagreed because we are using Mathjax on the enterprise level for the previous many years and our customers are very happy. Mathjax is a very powerful tool for math equations. I am working on this for the previous 5 years and have a lot of stuff about the mathjax. Recently, codecogs also update the latex library to make the images of the equations. Now, this is very easy to make the images of equations in any format and quickly. 

Thanks,
Ahmed Shair

Reply all
Reply to author
Forward
0 new messages