# TeX figure to .png

Let me begin with a confession: when someone says command line'' I nearly pee because I get so scared. I know that means I'm asking my question to the wrong community, and yes, I'm seeing someone about my problems. I don't want to talk about it anymore.

This thread asks almost exactly the same question I am interested in. I have two small additions to that post: is it possible to do the exact same thing for a xypic image (I would assume this is the case), and how do I do the part that's all code-ish''?

For those who don't want to go read the other thread, here's the simple version: I have three xypic drawings that I want to make .png or .jpg (or whatever) files from. How do I do that?

In case it matters: I use a mac with OSX10.8.4 installed, and when I try really really hard I've managed to find and open a terminal window in the past. I then usually get scared and run away.

You could simply use the standalone documentclass with the png option, which will automatically convert the picture into a PNG after the compilation.

Simply compiling the following...

\documentclass[png]{standalone}
\usepackage[all]{xy}
\begin{document}
\xymatrix{
A \ar[r] \ar[d] & B \ar[d] \\
C \ar[r] & D
}
\end{document}


... will result in this PNG (in addition to the usual PDF document):

• png conversion requires: -shell-escape or --enable-write18(MiKTeX) enabled eg: pdflatex -shell-escape filename.tex and imagemagick installed – texenthusiast Jun 28 '13 at 19:48
• May be possible Feature request: It would be nice if all xy-pic package components could be loaded via standalone Options like TikZ and PSTricks \documentclass[png,xy-all]{standalone} – texenthusiast Jun 28 '13 at 19:56
• @texenthusiast: I'm writing in TeXworks (answering your other question) and where/how do I do the -shell-escape'' thing to which you refer? This is exactly what is making the compiler sad when I run it. – Shay Jul 8 '13 at 13:57