# Why doesn't this code compile?

Why doesn't this code compile?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\GraphInit[vstyle=Classic]
\SetGraphUnit{2}
\Vertices{circle}{A,B,C,D}
\Edges(A,B,C,D,A,C)
\SetVertexNoLabel
\end{tikzpicture}
\end{document}

-
You need to load the correct package from tkz-collection. – Claudio Fiandrino Jul 21 '14 at 14:54
I have package tikz – benedito Jul 21 '14 at 14:58
tikz is not enough. You need some of the tkz packages that build upon tikz – daleif Jul 21 '14 at 15:04
The commands \GraphInit, \SetGraphUnit, \Vertices and so on are not provided by \usepackage{tikz}, but by another package based on TikZ. Possibly \usepackage{tkz-graph}. – egreg Jul 21 '14 at 15:05
In the future try to include the error message you received at the point the compilation halted. That is useful information that can help others (or maybe even yourself) solve the problem. – Matthew Leingang Jul 21 '14 at 15:46

The commands you use are not standard TikZ commands, but rely on an extension of it called tkz-graph.

\documentclass{article}

\usepackage{tkz-graph} % <---- HERE!

\begin{document}
\begin{tikzpicture}
\GraphInit[vstyle=Classic]
\SetGraphUnit{2}
\Vertices{circle}{A,B,C,D}
\Edges(A,B,C,D,A,C)
\SetVertexNoLabel
\end{tikzpicture}
\end{document}


-

Using an additional package works. See your code with this package below.

\documentclass{article}
\usepackage{tikz}
\usepackage{tkz-graph} % needed package
\begin{document}
\begin{tikzpicture}
\GraphInit[vstyle=Classic]
\SetGraphUnit{2}
\Vertices{circle}{A,B,C,D}
\Edges(A,B,C,D,A,C)
\SetVertexNoLabel