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 would like to draw a path with an arrowtip at the beginning and the end. If there is only one arrowtip everything is perfect. But with a second mark only the first one is visible. Has anybody an idea what I do wrong?

\documentclass[
    a4paper,
    12pt,
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} 
\usepackage[english,ngerman]{babel}

\usepackage{tikz}
\usetikzlibrary{positioning,arrows,chains,matrix,scopes,fit,decorations.markings,decorations}

\begin{document}


    \begin{tikzpicture}


        \tikzstyle{vecArrow} = [thick,
                decoration={markings, 
                            mark=at position 1 with {\arrow[semithick]{open triangle 60};}},
                double distance=1.4pt,
                shorten >= 5.5pt,
                preaction = {decorate},
                postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]

        \tikzstyle{vecArrow2} = [thick,
                    decoration={markings,
                                mark=at position 1 with {\arrow[semithick]{open triangle 60}},
                                mark=at position 0 with {\arrowreversed[semithick]{open triangle 60};}},
                    double distance=1.4pt,
                    shorten >= 5.5pt, shorten <= 5.5pt,
                    preaction = {decorate},
                    postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]


        \draw[vecArrow] (0,0) to (1,0);

        \draw[vecArrow2] (0,-1) to (1,-1);


    \end{tikzpicture}


\end{document}
share|improve this question
1  
The mark=at position Ns have to be in increasing order. Try swapping the two declarations and see if that fixes it. –  Loop Space Jan 28 '13 at 14:39
    
Thanks, that was easy! Now it works. –  Froop Jan 28 '13 at 14:47

1 Answer 1

Markings have to be specified in the order in which they are to appear on the path: from the manual (Section Libraries -> Decoration Library -> Marking Decorations -> Arbitrary Markings):

It is possible to give the mark option several times, which causes several markings to be applied. In this case, however, it is necessary that the positions on the path are in increasing order. That is, it is not allowed (and will result in chaos) to have a marking that lies earlier on the path to follow a marking that is later on the path.

In your code you have:

mark=at position 1 with {\arrow[semithick]{open triangle 60}},
mark=at position 0 with {\arrowreversed[semithick]{open triangle 60};}},

which violates this rule. Simply swap the lines to:

mark=at position 0 with {\arrowreversed[semithick]{open triangle 60};}},
mark=at position 1 with {\arrow[semithick]{open triangle 60}},

and the problem should be solved.

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.