I want to create with TikZ a yellow arrow with black margin (border, edge).
I thought I could do this by using two arrows which lie on the top of each other, e.g. with:
\documentclass[12pt,twoside, a4paper]{report}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[yscale=0.25]%
\draw[->,black,very thick](-1974*0.107pt,119*0.107pt) -- (-2258*0.107pt,820*0.107pt);%first layer, black arrow
\draw[->,yellow,thick](-1974*0.107pt,119*0.107pt) -- (-2258*0.107pt,820*0.107pt);%second layer, yellow arrow
\end{tikzpicture}%
\end{document}
But I am not so satisfied with the result because the black arrow should be a bit longer. I know I could play with the end point coordinates of the black arrow so that it fits well. But if I want to change the coordinates of my black-yellow arrow, this means I have to play again with the coordinates of the black arrow, which would cost a while.
Does anyone have a better solution? I would be glad to hear any hint.:-) Thanks in advance!
Best Answer
Edit 1: the new version of
double arrow
style requires three parameters: the global width and the two colors.Here is a solution using
postaction
to define the new styledouble arrow
(I usestealth
arrows because doubled default arrows are not beautiful). Thepostaction
option allows to redraw the arrow with different parameters (likeshorten >
to shorten the ending) :Edit 2: I created other styles of double arrows:
double -latex
,double round cap-latex
,double -stealth
anddouble round cap-stealth
(originaldouble arrow
anddouble -stealth
are the same).Firstly a small bunch:
Then the code (with the four styles of double arrows):