TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

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);
share|improve this answer
See the options for the var arc example in the manual p.614. – percusse Aug 27 '12 at 11:57
shoudn't the name of the arrowhead be {|var}{var|}? And the triangles are not possible? What about var|<->var| – pluton Aug 27 '12 at 12:28
yes, I guess {|var}{var|} is prettier. Triangles... you mean the combined arrow? I've included a declaration for var|<...`>|var' – Sašo Živanović Aug 27 '12 at 12:48

Your Answer


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.