Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have problems with adding a large arrow tip to smooth curves. It works perfect with straight lines, but as soon as I use the edge command, the arrow tips are added to the beginning of the curve instead of the end of the curve! A minimal example is shown here:

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

How can I add the arrow tip to the end of the curved path?

share|improve this question
    
The decoration options never make it to the edge. The main path is drawn (which in your case is just a coordinate) and then a new path is drawn for the edge. The problem here is that you specify your decoration options on the main path and not on the edge. Page 198 of the TikZ manual explains the edge operation in detail. –  Roelof Spijker Mar 5 '12 at 10:32
    
There's a very similar question: tex.stackexchange.com/q/15567/2552 –  Jake Mar 5 '12 at 10:34
    
Thank you. The mentioned question, however, does not deal with variable arrow sizes which is very different. –  Bernd Mar 5 '12 at 10:53
    
@Bernd: You're right, the problem is slightly different. The underlying problem is the same, though: In this case, you don't actually want an edge. You should use to instead. Also, for some reason I have to use a value slightly smaller than 1 for the pos (0.999, say). –  Jake Mar 5 '12 at 11:08

1 Answer 1

As explained in Strange arrow mark with TikZ edge and anchors., edge actually creates a new path, which is the one that gets decorated in this case. For drawing smooth curves, you don't need an edge, but the to operation. It also seems like pos=1 doesn't work with the decorations library, instead you should use something like 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} 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.