Home > latex > LaTeX formula to image (PNG)

LaTeX formula to image (PNG)


With LaTeX you produce a nice formula that you would like to crop and convert to an image.


Let’s see the following simple LaTeX source:



Save it as file.tex and execute “latex file.tex“, which will produce a DVI output (file.dvi). The image conversion is done the following way:

dvipng -T tight -x 1200 -z 9 file.dvi -o file.png


Ref.: I saw this conversion technique in justinvh’s Markdown-LaTeX project. If your goal is to include LaTeX formulae in HTML, try his script.

Categories: latex Tags: , ,
  1. mehdi
    April 19, 2011 at 10:28

    This website is so great :)

  2. jaume
    April 19, 2011 at 10:40

    thanks so much. Outstanding site, by the way :)

    • April 19, 2011 at 10:42

      Thank you guys. And I just complained the other day that I get no feedbacks :)

  3. Rockin
    April 19, 2011 at 23:03

    Nice tip !
    How to create an image of difficult formula in five seconds :)


  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: