[Tex/LaTex] tikz: arrow tips |<->|

tikz-arrowstikz-pgf

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}

Best Answer

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

Related Question