Is it possible to make graphs in questions using tikz? Or must I insert it as a picture? I wanted to ask a question about graph theory. Thanks in advance!


1 Answer 1


Tikz does not (yet!) work.

You can compile the diagram into a pdf file, turn that into a png file (or another format), and embed that in a question.

In linux, I usually do this with

pdftops filename.pdf - | pstopnm | pnmtopng > filename.png
  • 1
    $\begingroup$ Maybe bug the MathJax people to support TikZ? :) $\endgroup$ Commented Nov 8, 2011 at 23:26
  • $\begingroup$ Doesn't convert filename.pdf filename.png work? $\endgroup$
    – lhf
    Commented Nov 9, 2011 at 0:16
  • $\begingroup$ @lhf: you do get the PNG, indeed, but there was some reason —which I no longer remember,— which made me prefer the multistep thingie. $\endgroup$ Commented Nov 9, 2011 at 0:20
  • $\begingroup$ @Mariano: you mean besides needing Imagemagick installed? But if you have access to pdftops, you can also use pdftoppm -png filename.pdf > filename.png which belongs to the same software packages as pdftops (which would be the pdf library poppler). I can conceive, however, a good reason to chain pdf2ps (which belongs to ghostscript) and pstopnm and pnmtopng (which belong to netpbm) when neither poppler nor imagemagick are installed. $\endgroup$ Commented Nov 9, 2011 at 9:24

Not the answer you're looking for? Browse other questions tagged .