I am quite happy with the |<->| arrowhead in Tikz but I would like to control the length of the |. Is there a simple way to achieve this? In tikz.code.tex, I could find


which is somehow related to the question but it looks like in pgflibraryarrows.code.tex there is nothing to grab. It would be nice if this | length could be a parameter.

1 Answer 1


A much improved answer, thanks to percusse's information that arrowhead parameters can be set (and read) using \pgfsetarrowoption (and \pgfgetarrowoptions).

The declaration below is adjusted from pgf's declaration of |.



  \draw[var|-|var] (0,0)--(1,1);
  \draw[var|<->|var] (1,0)--(2,1);
  • 1
    See the options for the var arc example in the manual p.614.
    – percusse
    Commented Aug 27, 2012 at 11:57
  • shoudn't the name of the arrowhead be {|var}{var|}? And the triangles are not possible? What about var|<->var|
    – pluton
    Commented Aug 27, 2012 at 12:28
  • 1
    yes, I guess {|var}{var|} is prettier. Triangles... you mean the combined arrow? I've included a declaration for var|<...`>|var' Commented Aug 27, 2012 at 12:48

You must log in to answer this question.

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