[Tex/LaTex] New TikZ arrowhead

tikz-arrowstikz-pgf

I'm looking how to use currarrow as a new arrowhead in tikz.

Especially it's of the same size of latex or stealth and way smaller than triangle 45.

Any idea how to make it?

For now I use node[currarrow, sloped, allow upside down, pos=1] {} which is not really convenient…

enter image description here

Best Answer

A quick conceptual definition with hard coded values, you can combine it with Luigi's goodies. It won't work with different line widths etc. since I didn't do any right/left extend calculation.

I took the currarrow definition from circutikz library. It doesn't look too different from the scaled triangle 45. I would recommend using Luigi's definitions and modifiying them if necessary.

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows}
\makeatletter
\pgfarrowsdeclare{mycurrarrow}{mycurrarrow}{
\pgfarrowsleftextend{-5\pgflinewidth}
\pgfarrowsrightextend{5\pgflinewidth}
}
{
            \newlength\pgf@my@length
            \pgf@my@length = 1cm
            \divide \pgf@my@length by 16
            \pgfpathmoveto{\pgfpoint{-.7\pgf@my@length}{0pt}}
            \pgfpathlineto{\pgfpoint{-.7\pgf@my@length}{-.8\pgf@my@length}}
            \pgfpathlineto{\pgfpoint{1\pgf@my@length}{0pt}}
            \pgfpathlineto{\pgfpoint{-.7\pgf@my@length}{.8\pgf@my@length}}
            \pgfpathlineto{\pgfpoint{-.7\pgf@my@length}{0pt}}           
            \pgfusepathqfillstroke
}
\makeatother
\begin{document}
\begin{tikzpicture}
    \draw[mycurrarrow-mycurrarrow,blue] (0,0) -- (2,1);
    \draw[latex-latex,shift={(0mm,3mm)}] (0,0) -- (2,1);
    \draw[triangle 45-triangle 45,shift={(0mm,-3mm)},red] (0,0) -- (2,1);
\end{tikzpicture}
\end{document}

enter image description here

I don't get why you don't post five lines of code(four being documentclass and begin/end document and circutikz package)for an example instead of describing the arrow with screenshot from the manual.