I'm making a small automata with TiKZ and I need to convert it to a png without having all the empty space around. Right now I get a whole page but I only want the automata.
I have followed the instructions from this link but I couldn't make it work. Compile a LaTeX document into a PNG image that's as short as possible
My original code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=6cm,on grid,auto]
\node[state,initial] (q_0) {$q_0$};
\node[state,accepting](q_3) [right=of q_0] {$q_3$};
\path[->]
(q_0) edge node {bb+(a+ba)(ab)*(a+bb)} (q_3);
\end{tikzpicture}
\end{document}
standaloneclass, while you're just usingarticle. Add\pagestyle{empty}to your preamble, followed by apdfcropcall and use the suggested ImageMagikconvertsequence to take the output PDF into PNG. – Werner Jul 17 '14 at 21:22