5

Consider the following MWE:

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows,arrows.meta}
        \begin{document}
    \begin{tikzpicture}[>=angle 90 ]
\draw[|<->|]            (0,0) -- (3,  0) node[right] {1};
\draw[{Bar[]<->Bar[]}]  (0,-1) -- (3,-1) node[right] {2};
\draw[{Bar[]Straight Barb[]-Straight Barb[]Bar[]}]   
                        (0,-2) -- (3,-2) node[right] {3};
    \end{tikzpicture}
        \end{document}

enter image description here

Questions:

  1. why all arrow head are not equal?

  2. how to re-size Bar[], that its length and width will be doubled?

In TikZ manual (pp 201) is stated (in description for Barbed arrows tips): "All of these arrow tips can be configured and resized in many different ways as described in the following.", but put a length or with for Bar gives an error,

5
  • which arrow head is not equal? They seem to be all the same size to me. For the length and width options, you are missing some brackets, I think it should be {Bar[]<}-{>Bar[]} and {Bar[]Straight Barb[]}-{Straight Barb[]Bar[]}
    – d-cmst
    Dec 27, 2014 at 10:35
  • dcmst, the size are equal, but the position differ. The line 2 and 3 are equal (expected) but he arrow is for line width separated form Bar, what is not a case at line 1. In the case, that the Bar in line 2 or 3 can be resized, I like to have arrow till to bar. Additional curly brackets, as you suggested, doesnt change anything.
    – Zarko
    Dec 27, 2014 at 11:02
  • I see what you mean now. For the missing brackets, I mean that {Bar[width=1cm]<}-{>Bar[]} works, while {Bar[width=1cm]<->Bar[]} does not (this is for your second question).
    – d-cmst
    Dec 27, 2014 at 11:06
  • sorry, before I overlook that behind of editor I had open in Adobe Reader XI a pdf image, which prevent to update image in Sumatra (which I normally use) ... After resetting of PC the image is as you describe. Thank you to solve my problem!
    – Zarko
    Dec 27, 2014 at 11:20
  • no problem. I edited the title so that (hopefully) the question will be helpful to more future readers. Feel free to rollback my edit if you disagree.
    – d-cmst
    Dec 27, 2014 at 11:24

1 Answer 1

6

To get rid of the gap between arrows cap use a . between them:

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows,arrows.meta}
        \begin{document}
    \begin{tikzpicture}[>=angle 90 ]
\draw[|<->|]            (0,0) -- (3,  0) node[right] {1};
\draw[{Bar[].<}-{>.Bar[]}]  (0,-.2) -- (3,-.2) node[right] {2};
\draw[{Bar[].Straight Barb[]}-{Straight Barb[].Bar[]}]   
                        (0,-.4) -- (3,-.4) node[right] {3};
    \end{tikzpicture}
        \end{document}

enter image description here

To increase the width of Bar use {Bar[width=<your value>].<}-{>.Bar[]}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .