latextikz

How to change arrow tip in tikz


Is there a simple way to increase the size of an arrow tip using something like:

\tikzset{myptr/.style=->, ????}

without designing a new arrow style from scratch?


Solution

  • One solution, very quick, to just scale the arrow head is number %2 in the following:

    \documentclass[multi=false,tikz,border=2mm]{standalone}
    \usetikzlibrary{arrows,decorations.markings}
    
    \begin{document}
    
    \begin{tikzpicture}
    %1
    \draw [->,>=stealth] (0,.5) -- (2,.5);
    %2
    \draw [decoration={markings,mark=at position 1 with
        {\arrow[scale=3,>=stealth]{>}}},postaction={decorate}] (0,0) -- (2,0);
    \end{tikzpicture}
    
    \end{document}
    

    This produces:

    enter image description here

    (sorry for excessive zoom).

    Much more in the answers to this question and in this answer, that I used as a source.

    Addendum

    \tikzset approach. This code:

    \documentclass[multi=false,tikz,border=2mm]{standalone}
    \usetikzlibrary{arrows,decorations.markings}
    
    \begin{document}
    
    \begin{tikzpicture}
    \tikzset{myptr/.style={decoration={markings,mark=at position 1 with %
        {\arrow[scale=3,>=stealth]{>}}},postaction={decorate}}}
    %1
    \draw [->,>=stealth] (0,.5) -- (2,.5);
    %2
    \draw [myptr] (0,0) -- (2,0);
    \end{tikzpicture}
    
    \end{document}
    

    produces the same output as the above one (source: PGF Manual, section 2.8).

    Obviously you can use -Latex instead of stealth.