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}
  • 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 Aug 29 '14 at 18:58
  • @PierPaolo yes but I used stealth instead of latex – dustin Aug 29 '14 at 19:04
  • It was a typo on my part, I later corrected the code. Does it work with stealth? – Pier Paolo Aug 29 '14 at 19:05
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.