TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


I get the error

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

And when I try this:


The output is:

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

Edit: Minimum breaking example:



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)
 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)
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
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)
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
share|improve this question
Could you include the preamble of your file. This type of error is often of the type "problem with packages". In fact, you should include a complete MWE. – Frédéric Feb 20 '12 at 20:52
Sure, but the results are disappointing: I get the same behavior when I include nothing but tkz-graph. – jtbandes Feb 20 '12 at 20:58
I don't get any error from your example. Try adding \listfiles on top of the file and show what results in the log file (you'll find *File List* in it, and a longish list of the input files). I suspect an outdated version of PGF lying astray in some place. – egreg Feb 20 '12 at 23:42
@egreg: Thanks for the tip. I just updated the question to include the output of \listfiles. – jtbandes Feb 20 '12 at 23:45
up vote 3 down vote accepted

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.

share|improve this answer
Well sleuthed, sir! – jtbandes Feb 20 '12 at 23:56

You need to include \usepackage{tkz-graph} in the preamble, after which you get:

enter image description here


share|improve this answer
If I use this exact input I get the same error I originally posted. – jtbandes Feb 20 '12 at 20:57
I suspect then you must be using older versions of the libraries. I am using the latest version of TeXLive2011 (updated last week). If I switch to TeXLive 2010 I get LaTeX Error: File tkz-graph.sty not found. – Peter Grill Feb 20 '12 at 21:00
The output of tlmgr show tkz-graph includes revision: 22832, cat-version: 1.00,cat-date: 2011-06-24 10:33:31 +0200. – jtbandes Feb 20 '12 at 21:02
Hmmmm... Perhaps some of the other tikzrelated libraries are out of date. – Peter Grill Feb 20 '12 at 22:17
Which would those be? TeX Live Utility doesn't show any new updates. – jtbandes Feb 20 '12 at 22:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.