我通过 MacTeX 使用 TeXLive 2011,并保持软件包更新。我尝试从简单的开始tkz-graph
。
当我使用以下代码时,直接从tkz-graph
文档中复制:
\begin{tikzpicture}
\GraphInit[vstyle=Classic]
\Vertices[Lpos=90,unit=2]{circle}{A,B,C,D,E,F}
\end{tikzpicture}
我得到了错误
Latex Error: ./myfile.tex:26 Package xkeyval Error: `unit' undefined in families `vertex'.
当我尝试这个时:
\begin{tikzpicture}
\GraphInit[vstyle=Classic]
\Vertices{circle}{A,B,C,D,E,F}
\end{tikzpicture}
输出为:
显然有些事情非常错误,但到底是什么问题呢?我该如何修复它?
编辑:最小破坏示例:
\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}
更多信息:
$ 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
而且它也不是我的编辑器——如果我运行latex
或pdflatex
直接从命令行运行,也会发生同样的事情。
更多编辑:此外,似乎即使使用也会\SetGraphUnit
导致Undefined control sequence.
错误。
包括\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
***********
答案1
tkz-graph.sty
TeX 程序搜索到的某个目录中有一个旧版本。您可以通过询问来找到它
kpsewhich tkz-graph.sty
这将返回在树中找到的第一个文件。删除它:它肯定是过时的\listfiles
,因为正确的行应该是
tkz-graph.sty 2011/06/01 ctan v 1.00 base for graphs
删除后,运行
sudo mktexlsr
从 shell 中你将拥有一个完整系统的。
答案2
您需要将其包含 \usepackage{tkz-graph}
在序言中,之后您会得到:
\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}