[Tex/LaTex] Basic tkz-graph usage problems, errors, bad output

mactextikz-pgftkz-graph

I'm using TeXLive 2011 via MacTeX, and I keep my packages updated. I'm trying to start simple with tkz-graph.

When I use the following code, copied directly from the tkz-graph documentation:

\begin{tikzpicture}
    \GraphInit[vstyle=Classic]
    \Vertices[Lpos=90,unit=2]{circle}{A,B,C,D,E,F}
\end{tikzpicture}

I get the error

Latex Error: ./myfile.tex:26 Package xkeyval Error: `unit' undefined in families `vertex'.

And when I try this:

\begin{tikzpicture}
    \GraphInit[vstyle=Classic]
    \Vertices{circle}{A,B,C,D,E,F}
\end{tikzpicture}

The output is:

Clearly something is very wrong, but what is it? How can I fix this?


Edit: Minimum breaking example:

\documentclass{article}
\usepackage{tkz-graph}

\begin{document}
\begin{tikzpicture}
    \GraphInit[vstyle=Classic]
    \Vertices[Lpos=90,unit=2]{circle}{A,B,C,D,E,F}
\end{tikzpicture}
\end{document}

And more information:

$ tlmgr show tkz-graph
package:     tkz-graph
category:    Package
shortdesc:   Draw graph-theory graphs.
longdesc:    The package is designed to create graph diagrams as simply as possible, using TikZ
installed:   Yes
revision:    22832
cat-version: 1.00
cat-date:    2011-06-24 10:33:31 +0200
cat-license: lppl
collection:  collection-pictures

And it's not my editor, either — if I run latex or pdflatex directly from the command line, the same thing happens.


More edit: in addition, it seems that even using \SetGraphUnit results in an Undefined control sequence. error.

Including \listfiles:

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
tkz-graph.sty    18/11/2008 v 2.7d base for graphs
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
  ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
    tikz.sty    2010/10/13 v2.10 (rcs-revision 1.76)
     pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)
 ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)
  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)
  pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)
 pgfkeys.sty    
 pgfkeys.code.tex
  pgffor.code.tex
    tikz.code.tex
supp-pdf.mkii
pdftexcmds.sty    2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Managing graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Defining keys (HO)
kvoptions.sty    2010/12/23 v3.10 Keyval support for LaTeX options (HO)
kvsetkeys.sty    2011/04/07 v1.13 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********

Best Answer

You have an old version of tkz-graph.sty in some directory searched by the TeX programs. You can find it by asking

kpsewhich tkz-graph.sty

which will return the file that's found first in the trees. Remove it: it is certainly outdated, as \listfiles tells, because the correct line should be

tkz-graph.sty    2011/06/01 ctan v 1.00 base for graphs

After having removed it, run

sudo mktexlsr

from the shell and you'll have a system in full shape.

Related Question