我正在尝试按照 pgfmanual 中的说明设计一个新箭头。我尝试了示例代码(第 610 页):
\pgfarrowsdeclare{arcs}{arcs}{...}
{
\pgfsetdash{}{0pt} % do not dash
\pgfsetroundjoin % fix join
\pgfsetroundcap % fix cap
\pgfpathmoveto{\pgfpoint{-10pt}{10pt}}
\pgfpatharc{180}{270}{10pt}
\pgfpatharc{90}{180}{10pt}
\pgfusepathqstroke
}
\begin{tikzpicture}
\draw[-arcs,line width=3pt] (-2,0) -- (0,0);
\draw[arcs-arcs,line width=1pt] (-2,-1.5) -- (0,-1);
\useasboundingbox (-2,-2) rectangle (2,2);
\end{tikzpicture}
但我得到的结果与手册中显示的结果不同。有什么建议吗?
答案1
运行良好PGF 3.0
\documentclass{article}
\usepackage{tikz,pgfplots}
\pgfarrowsdeclare{arcs}{arcs}{...}
{
\pgfsetdash{}{0pt} % do not dash
\pgfsetroundjoin % fix join
\pgfsetroundcap % fix cap
\pgfpathmoveto{\pgfpoint{-10pt}{10pt}}
\pgfpatharc{180}{270}{10pt}
\pgfpatharc{90}{180}{10pt}
\pgfusepathqstroke
}
\begin{document}
\section{Declaring an Arrow Tip Kind}
\begin{tikzpicture}
\draw[-arcs,line width=3pt] (-2,0) -- (0,0);
\draw[arcs-arcs,line width=1pt] (-2,-1.5) -- (0,-1);
\useasboundingbox (-2,-2) rectangle (2,2);
\end{tikzpicture}
\end{document}