使用 PGF/TikZ 的一侧为双线箭头,另一侧为单线箭头

使用 PGF/TikZ 的一侧为双线箭头,另一侧为单线箭头

双线箭头

我希望能够在 PGF/TikZ 中执行与上述类似的操作。可能吗?如果可以,我想知道怎么做。我在 PGF 手册中找到了以下用于在双线上打印箭头提示的代码

\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}
   \begin{tikzpicture}
       \pgfsetlinewidth{10 pt}
       \pgfsetinnerlinewidth{2 pt}
       \draw [-implies] (90pt,1640pt) -- ++(1cm,0);
   \end{tikzpicture}
\end{document}

但似乎只使用了内线,箭头仍然居中。我尝试使用类standalone,但显示不正确,因此我使用了 article 类。

答案1

结果

我作了一点小手脚。首先,我用大箭头画出双线,然后在底线上再画一条更细的单线,用较小的箭头以仔细调整的距离画出第二条线。

调整线宽和线距比较棘手,因为您还必须调整第二条线的位置。此外,根据箭头的尖角,可能需要不同的shorten >和值。shorten <

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\def\drawDoubleThing#1#2{
\draw[double, double distance=.6mm, line width=.4mm, ->] (#1) -- (#2);
\draw[line width=.2mm, ->, shorten >=-1pt, shorten <=5pt] 
  ($(#2)!.5mm!90:(#1)$) -- ($(#1)!.5mm!-90:(#2)$);
}
\begin{document}
\begin{tikzpicture}[>=stealth]
  \coordinate (A) at (0,0);
  \coordinate (B) at (5,0);
  \coordinate (C) at (0,.5);
  \coordinate (D) at (5,2);
  \drawDoubleThing{A}{B}
  \drawDoubleThing{C}{D}
\end{tikzpicture}
\end{document}

相关内容