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 am using tkz-euclide package and I am drawing a figure where I would like to put two arrows in the center of the line, exactly as seen in this figure:

enter image description here

Ideally, I may want to create a single arrow, two arrows, three arrows, etc. in the center of a line, so a generalized solution would be great.

share|improve this question
    
    
Welcome to TeX.sx! Could you come up with a minimal working example (MWE), i.e. an example that has the lines already drawn? –  Qrrbrbirlbel Dec 2 '12 at 19:46
add comment

1 Answer 1

up vote 8 down vote accepted

Notes

  • The \tkzMarkSegments[<opt>]{…} macros offer the ability to mark= with |, ||, o, s, etc.
    Refer to the tkz-euclide manual for more information (12.3 “Marquer un segment \tkzMarkSegment” and 12.4 “Marquer des segments \tkzMarkSegments”).
  • I haven’t fount a way to be able to use, say, mark=>, which is the reason I provide the
  • arrowMe style.
  • thick is only one of many ways to make a arrow head bigger, this isn't the best, for further reference, take a look at
  • Double arrows are provided by the universal > arrow or with the \pgfarrowsdeclaredouble macro.
  • Triple arrow can be declared with \pgfarrowsdeclaretriple macro.
  • Quadruple arrow can be declared with doubling the double arrow tip.
    With the example given you can see that the end of the arrow’s tip is actually at the specified position (here pos=.5) and not the middle of the arrow, which is the reason I prefer to use the method I described in another answer of mine, but the explained decoration doesn’t work so good with \tkz*Segment so the fallback would be to explicitly \draw the line.
  • See the related question where different ways of marking with an arrow are provided:

Code

\documentclass[tikz,border=2pt]{standalone}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{decorations.markings,arrows}
\tikzset{
    arrowMe/.style={
        postaction=decorate,
        decoration={
            markings,
            mark=at position .5 with {\arrow[thick]{#1}}
        }
    }
}
\pgfarrowsdeclaredouble{<<s}{>>s}{stealth}{stealth}%   double stealth
\pgfarrowsdeclaretriple{<<<s}{>>>s}{stealth}{stealth}% triple stealth
\pgfarrowsdeclaredouble{<<<<s}{>>>>s}{<<s}{>>s}%    quadruple stealth
\begin{document}
\begin{tikzpicture}
    \tkzDefPoint(0,0){D}
    \tkzDefPoint(2,4){A}
    \tkzDefPoint(7,4){B}
    \tkzDefPoint(5,0){C}
    \tkzDefPoint(3.5,2){E}
    \tkzDefPoint(6,2){BC}% only to show the quadruple arrow
    \tkzLabelPoints[left](A,D)
    \tkzLabelPoints[right](B,C)
    \tkzLabelPoints[left=5pt](E)
    \tkzDrawSegments(B,D A,C)
    \tkzMarkSegments[mark=|](B,E D,E)
    \tkzMarkSegments[mark=||](A,E C,E)
    \tkzDrawSegments[arrowMe=stealth](A,B D,C)
    \tkzDrawSegments[>=stealth,arrowMe=>>](D,A C,B)
    \tkzDrawSegment[arrowMe=>>>>s](BC,E)% only to show the quadruple arrow
\end{tikzpicture}
\end{document}

Output

enter image description here

share|improve this answer
    
This is very useful to me, however, I am still unsure how to add 3 arrows to a line –  James Dec 2 '12 at 23:36
1  
@James See my updated answer. For quintuple arrows (or others you can’t create with double and triple combination) there is \pgfarrowsdeclarecombine which can be found in the PGF manual under 74.3 “Declaring a Derived Arrow Tip Kind”. –  Qrrbrbirlbel Dec 3 '12 at 2:19
add comment

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.