为什么箭头的位置如下图所示?即为什么它们没有放在路径的确切起点和终点?
使用的代码:
\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{decorations.markings,arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw[double distance=15, thick,
postaction={decorate, decoration={markings, mark=at position 0 with {\arrow{Straight Barb[reversed,length=0pt 0.7]}}}},
postaction={decorate, decoration={markings, mark=at position 1 with {\arrow{Straight Barb[length=2pt 0.7]}}}}
] (0,2) -- node {FOO}(5,2);
\end{tikzpicture}
\end{document}
作为参考,我希望它是这样的:
答案1
用线放置箭头double
很困难(读作不可能)。在这里您必须进行一些手动调整。这是第一次尝试使用xshift
:
\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{decorations.markings,arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw[double distance=15, thick,
postaction={decorate, decoration={markings, mark=at position 0 with {\arrow[xshift=5mm]{Straight Barb[reversed,length=2pt 0.7]}}}},
postaction={decorate, decoration={markings, mark=at position 1 with {\arrow[xshift=7mm]{Straight Barb[length=2pt 0.7]}}}}
] (0,2) -- node {FOO}(5,2);
\end{tikzpicture}
\end{document}
这是第二个杂技:
\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{decorations.markings,arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw[double distance=15](8pt,2) -- (5cm-8pt,2); %% this length needs to be adjusted.
\draw[double distance=15,
{Straight Barb[black,length=2pt 0.7 0.2].}-{.Straight Barb[length=2pt 0.7 0.2]}
] (0,2) -- node {FOO}(5,2);
\end{tikzpicture}
\end{document}
所以,根据您想要什么,您可能还会对double arrow
Ignasi 所评论的形状感兴趣。
\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{shapes.arrows}
\begin{document}
\begin{tikzpicture}
\node [double arrow,draw, text width=5cm,align=center] {FOO};
\end{tikzpicture}
\end{document}