5

I want to use a variant of |<->| in my draw command, but I want the tips to be the stealth arrow head. Unfortunately, |stealth-stealth| isn't understood in the draw options command.

How can I have stealth arrow heads?

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \draw[|stealth-stealth|] (0, 0) -- (1, 0);
  \draw[| stealth-stealth |] (0, 0) -- (1, 0);
\end{tikzpicture}
\end{document}
3
  • Does it work if you use: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \begin{scope}[>=stealth] \draw[|<->|] (0, 0) -- (1, 0); \draw[|<->|] (0, 0) -- (1, 0); \end{scope} \end{tikzpicture} \end{document} ?
    – Pier Paolo
    Commented Aug 29, 2014 at 18:58
  • @PierPaolo yes but I used stealth instead of latex
    – dustin
    Commented Aug 29, 2014 at 19:04
  • It was a typo on my part, I later corrected the code. Does it work with stealth?
    – Pier Paolo
    Commented Aug 29, 2014 at 19:05

1 Answer 1

6

With tikz version 3, you can do this:

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
  \draw[|{Stealth}-{Stealth}|] (0, 0) -- (1, 0);
  \draw[||{Stealth}-{Stealth}||] (0, 1) -- (1, 1);    %% || will produce thicker pipe
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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