I had a similar problem times ago.
Taking advantage of the gorgeous answer by Symbol 1, I think it's possible to solve your problem, too.
I created a style with two options: arrow type and length, with the default values Stealth
and 10pt
, respectively. Of course, it could be further customized.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{calc}
% Code from: https://tex.stackexchange.com/a/623891/101651
\makeatletter
\def\computevisuallength#1#2#3{% visual end, visual tip, dummy
\pgf@x#1
\pgf@y#2
\advance\pgf@x-\pgf@y
\xdef\visuallength{\the\pgf@x}
}
\tikzset{
mystyle/.style 2 args={%
decoration={%
show path construction,
lineto code={%
\coordinate (start) at (\tikzinputsegmentfirst);
\coordinate (end) at (\tikzinputsegmentlast);
\draw[dash pattern=on0off9999,-{#1[open, length=#2]}] (start) -- (end);
{
\pgfsetarrowsend{#1[open, length=#2]}% force pgf recall this arrow
\def\pgf@arrow@hull@point{hull}%%
\expandafter\expandafter\expandafter\computevisuallength
\csname pgf@ar@visual@\pgf@arrow@id\endcsname
}
\coordinate (arrowstart) at ($(end)!\visuallength!(start)$);
\draw[decorate, decoration={zigzag, segment length=2pt, amplitude=1pt, post=lineto, post length=1pt}] (start) -- (arrowstart);
}
},
decorate
},
mystyle/.default={Stealth}{10pt},
}
\begin{document}
\begin{tikzpicture}
\draw[mystyle={Latex}{5pt}] (0,2) -- (50pt,1.5);
\draw[mystyle={Triangle}{20pt}] (0,0.5) -- (50pt,1);
\draw[mystyle] (0,0) -- (50pt,0);
\end{tikzpicture}
\end{document}
shorten >=-6pt