TikZ:根据文档配置箭头尖外观不起作用

TikZ:根据文档配置箭头尖外观不起作用

我尝试按照手册中概述的细节来配置箭头的外观。但是,我只得到错误。

我正在尝试从第 16.3 节中获取示例方向键工作。这是我的最小工作示例:

\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\listfiles
\begin{document}

  \tikz{\draw[-{Stealth[length=5mm]}] (0,0) -- (2,0);}

\end{document}

这将产生以下错误:

! Package pgf Error: Unknown arrow tip kind 'Stealth'.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.9       \tikz{\draw[-{Stealth[length=5mm]}]
                                              (0,0) -- (2,0);}
? 

如果我没有加载正确的库,我不确定它们应该是什么。

如果我尝试

\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\listfiles
\begin{document}

  \tikz{\draw[-{stealth[length=5mm]}] (0,0) -- (2,0);}

\end{document}

笔记 stealth这次(而不是Stealth)。我收到错误:

! Package pgfkeys Error: I do not know the key 'length', to which you passed '5
mm', and I am going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.9       \tikz{\draw[-{stealth[length=5mm]}]
                                              (0,0) -- (2,0);}
? 

我做错了什么?

附言:我正在使用 2013 年 9 月 30 日的 TikZ CVS 版本:

\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)
     pgf.sty    2013/08/23 v2.10-cvs (rcs-revision 1.13)
  pgfrcs.sty    2010/11/07 v2.10-cvs (rcs-revision 1.25)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v2.10-cvs (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
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/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  pgfsys.sty    2013/08/23 v2.10-cvs (rcs-revision 1.46)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
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-cvs (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10-cvs (rcs-revision 1.1)
    tikz.sty    2013/09/30 v2.10-cvs (rcs-revision 1.138)
  pgffor.sty    2013/07/18 v2.10-cvs (rcs-revision 1.24)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
supp-pdf.mkii
pdftexcmds.sty    2011/11/29 v0.20 Utility functions 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 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********

答案1

arrows库已贬值。请使用该库arrows.meta

\documentclass{article}
%\url{http://tex.stackexchange.com/q/136190/86}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\listfiles
\begin{document}

  \tikz{\draw[-{Stealth[length=5mm]}] (0,0) -- (2,0);}

\end{document}

带长度选项的箭头

相关内容