TikZ:平滑曲线末端的大箭头

TikZ:平滑曲线末端的大箭头

我在为平滑曲线添加大箭头时遇到了问题。它对直线非常有效,但只要我使用该edge命令,箭头就会添加到曲线的开头而不是结尾!下面显示了一个最小示例:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings}
\tikzstyle{every picture}+=[remember picture] % remember every node
\begin{document}
A: $A = \tikz[baseline=-.65ex]{\node[](){$a$};} + \tikz[baseline=-.65ex]{\node[](){$b$};}$ \\
B: $B = \tikz[baseline=-.65ex]{\node[](end1){$c$};} + \tikz[baseline=-.65ex]{\node[](end2){$d$};}$ \\
A explanation \tikz[baseline=-.5ex,overlay]{\node [coordinate] (start1) {}; \draw[very thick,>=latex,shorten >=2pt,decoration={markings,mark=at position 1 with {\arrow[scale=2.5]{>}};},postaction={decorate}] (start1) edge [out=0, in=-90] (end1);} \\ % this is where the first arrow tip fails
B explanation \tikz[baseline=-.5ex,overlay]{\node [coordinate] (start2) {}; \draw[thick,>=latex,shorten >=2pt,decoration={markings,mark=at position 1 with {\arrow[scale=2.5]{>}};},postaction={decorate}] (start2) edge [out=0, in=-90] (end2);} % this is where the second arrow tip fails
\end{document} 

如何将箭头尖添加到弯曲路径的末端?

答案1

正如解释的那样带有 TikZ 边缘和锚点的奇怪箭头标记。edge实际上创建了一条新路径,在本例中就是被修饰的路径。要绘制平滑曲线,不需要edge,而是需要to操作。它似乎pos=1也不适用于修饰库,你应该使用类似 的东西pos=0.999

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings}
\tikzstyle{every picture}+=[remember picture] % remember every node
\begin{document}
A: $A = \tikz[baseline=-.65ex]{\node[](){$a$};} + \tikz[baseline=-.65ex]{\node[](){$b$};}$ \\
B: $B = \tikz[baseline=-.65ex]{\node[](end1){$c$};} + \tikz[baseline=-.65ex]{\node[](end2){$d$};}$ \\[2cm]
A explanation \tikz[baseline=-.5ex,overlay]{
    \node [coordinate] (start1) {};
    \draw[very thick, >=latex, shorten >=12pt, decoration={
        markings,
        mark=at position 0.999 with {
            \arrow[scale=2.5]{>}
        };
    },
    postaction={decorate}
    ] (start1) to [out=0, in=-90] (end1);} \\
B explanation \tikz[baseline=-.5ex,overlay]{
    \node [coordinate] (start2) {};
    \draw[thick, >=latex ,shorten >=12pt, decoration={
        markings,
        mark=at position 0.999 with {
            \arrow[scale=2.5]{>}
        };
    },
    postaction={decorate}] (start2) to [out=0, in=-90] (end2);
}
\end{document} 

相关内容