[Tex/LaTex] Exporting .png or .jpg files directly from LaTeX code. Possible

png

Sometimes it's impossible to upload .pdf, .dvi and .ps files (usually images of diagrams generated with TiKZ in my case). There, one wishes to obtain a way to export them directly to a .png or some other pic-like file extension. Unfortunately the result I get by taking a snapshot of my .pdf is awful.

Which is the better way to get, say, a .png out of a LaTeX base code?

Best Answer

Yes.You can export the latex output to various formats like .png, .svg , html ...etc.

The convert command from the ImageMagick suite can convert both DVI and PDF files to PNG.

convert input.pdf output.png

EDIT: for a good looking png you should provide a higher density than standard like this: convert -density 300 -quality 90 input.pdf output.png

This wikipedia page gives you a list of other formats.

Related Question