I have the following code for a generating a diagram. How do I make the resulting PDF as large as the figure only like IPE does?
\documentclass[landscape]{article}
\usepackage{standalone}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\begin{document}
\begin{figure}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=3 cm,scale=1,transform shape,line width=0.25mm]
\node[initial,state,fill=green!20,initial text={},line width=0.25mm] (A) {$q_{000}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (B) [right of=A] {$q_{100}$};
\node[state,fill=blue!20,line width=0.25mm] (C) [right of=B] {$q_{010}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (D) [right of=C] {$q_{110}$};
\node[state,fill=blue!20,line width=0.25mm] (E) [below of=A] {$q_{001}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (F) [right of=E] {$q_{101}$};
\node[state,fill=blue!20,line width=0.25mm] (G) [right of=F] {$q_{011}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (H) [right of=G] {$q_{111}$};
\path[->,black] (A) edge [loop above] node [align=center] {$ 0$} (A)
(B) edge [above] node [align=center] {$0$} (A)
(C) edge [above] node [align=center] {$0$} (B)
(D) edge [ above, bend right ] node [align=center] {$0$} (B)
(A) edge [ left ] node [align=center] {$1$} (E)
(B) edge [ above ] node [align=center,xshift=-5] {$1$} (E)
(E) edge [ bend left = 6, above ] node [align=center] {$0$} (C)
(C) edge [ bend right = 10, above] node [align=center,xshift=-8,yshift=-5] {$1$} (F)
(F) edge [ bend right = 10, below ] node [align=center,xshift=8,yshift=5] {$0$} (C)
(F) edge [ ] node [align=center] {$1$} (G)
(G) edge [ ] node [align=center] {$1$} (H)
(H) edge [loop right] node [align=center] {$ 1$} (H)
(H) edge [ right ] node [align=center] {$0$} (D)
(G) edge [ below ] node [align=center,xshift=5] {$0$} (D)
(D) edge [ bend left = 5,above] node [align=center,yshift=3] {$1$} (F)
(E) edge [ below, bend right ] node [align=center] {$1$} (G);
\end{tikzpicture}
\end{figure}
\end{document}
Updated working code. Thanks for the help!
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\begin{document}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=3 cm,scale=1,transform shape,line width=0.25mm]
\node[initial,state,fill=green!20,initial text={},line width=0.25mm] (A) {$q_{000}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (B) [right of=A] {$q_{100}$};
\node[state,fill=blue!20,line width=0.25mm] (C) [right of=B] {$q_{010}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (D) [right of=C] {$q_{110}$};
\node[state,fill=blue!20,line width=0.25mm] (E) [below of=A] {$q_{001}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (F) [right of=E] {$q_{101}$};
\node[state,fill=blue!20,line width=0.25mm] (G) [right of=F] {$q_{011}$};
\node[state,accepting,fill=red!20,line width=0.25mm] (H) [right of=G] {$q_{111}$};
\path[->,black] (A) edge [loop above] node [align=center] {$ 0$} (A)
(B) edge [above] node [align=center] {$0$} (A)
(C) edge [above] node [align=center] {$0$} (B)
(D) edge [ above, bend right ] node [align=center] {$0$} (B)
(A) edge [ left ] node [align=center] {$1$} (E)
(B) edge [ above ] node [align=center,xshift=-5] {$1$} (E)
(E) edge [ bend left = 6, above ] node [align=center] {$0$} (C)
(C) edge [ bend right = 10, above] node [align=center,xshift=-8,yshift=-5] {$1$} (F)
(F) edge [ bend right = 10, below ] node [align=center,xshift=8,yshift=5] {$0$} (C)
(F) edge [ ] node [align=center] {$1$} (G)
(G) edge [ ] node [align=center] {$1$} (H)
(H) edge [loop right] node [align=center] {$ 1$} (H)
(H) edge [ right ] node [align=center] {$0$} (D)
(G) edge [ below ] node [align=center,xshift=5] {$0$} (D)
(D) edge [ bend left = 5,above] node [align=center,yshift=3] {$1$} (F)
(E) edge [ below, bend right ] node [align=center] {$1$} (G);
\end{tikzpicture}
\end{document}
pgf,graphicxand probably some more as they are loaded anyway. – cfr Oct 27 '15 at 22:34graphicx, but good point. Am editing my answer at the moment, so will include that. – Torbjørn T. Oct 27 '15 at 22:35ZIP file URL: https://www.ctan.org/pkg/standalone?lang=en
– aghost Oct 27 '15 at 22:47standalonepackage you should have thestandaloneclass as well, they are part of the same bundle. – Torbjørn T. Oct 27 '15 at 22:52