I've been having quite a frustrating problem, I wish to output a graph I have drawn with tikz, and I want the output to be just the size of the graph, instead I keep getting an A4/letter sized output. I thought the \beginpgfgraphicnamed and \endpgfgraphicnamed, were precisely there to delineate exactly what was to be included in the output, preventing the output of an entire page.
Thanks in advance for any help with this problem.
Here is the code I'm executing:
Code: Select all
\documentclass{article}
\usepackage{amsmath,tikz}
\usepackage{graphics}
\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{\includegraphics{#1}}
\begin{document}
\pgfrealjobname{7-rotations}
\begin{figure}
\centering
\beginpgfgraphicnamed{7-rotations}
\begin{tikzpicture}
\node [style={draw,circle}](1) at (-0.5,1) {};
\node [style={draw,circle}] (2) at (0.5,1) {};
\node [style={draw,circle}] (3) at (1,0.5) {};
\node [style={draw,circle}] (4) at (1,-0.5) {};
\node [style={draw,circle}] (5) at (0.5,-1) {};
\node [style={draw,circle}] (6) at (-0.5,-1) {};
\node [style={draw,circle}] (7) at (-1,-0.5) {};
\node [style={draw,circle}] (8) at (-1,0.5) {};
\node (9) at (-0.5, 1.5) {};
\node (10) at (0.5, 1.5) {};
\path[->] (9) edge [above, bend left] (10);
\path[-] (1) edge (2)
edge (8)
(2) edge (3)
(3) edge (4)
(4) edge (5)
(5) edge (6)
(6) edge (7)
(7) edge (8);
\end{tikzpicture}
\caption{rotations $\times$ 7}
\endpgfgraphicnamed
\end{figure}
\end{document}