如何更改 tikz 中的箭头提示

How to change arrow tip in tikz

有没有一种简单的方法可以使用类似的方法来增加箭头尖端的大小:

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

没有从头开始设计新的箭头样式?

一个解决方案,非常快,只缩放箭头是下面的数字 %2

\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 question and in this answer, that I used as a source 的答案中还有更多内容。

附录

\tikzset进场。此代码:

\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}

产生与上述相同的输出(来源:PGF Manual,第 2.8 节)。

显然你可以使用 -Latex 而不是 stealth

有一个新的解决方案,见https://latexdraw.com/exploring-tikz-arrows/#t-1610685307397。它允许改变箭头的长度和宽度:

\documentclass[border=1mm]{standalone}
 
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows}


\begin{document}
 
\begin{tikzpicture}
  \draw [-{Stealth[length=3mm, width=2mm]}] (0,0.5) -- (1,0.5);
  \draw [-stealth] (0,0) -- (1,0);
\end{tikzpicture}
 
\end{document}