[Tex/LaTex] tikz dead end arrow

edgetikz-arrows

In tikz, I am looking for a "dead end" arrow (not literally an arrow), like this:

enter image description here

Is there a arrow specification option similar to [->,>=latex] that draws such a line? I usually use this kind of drawing style:

\node[draw,rectangle] (x) at (0,0) {node};
\node (y) at (0,-1) {};
\draw (x) edge[<options>] (y);

If not, how would you solve it? I want both the vertical and horizontal line be anchored to some invisible node, so that I can move the node afertwards for repositioning purposes without fiddling with the lines manually. If I move the invisible node to either side, the dead-end-edge shall behave like normal edges and result in a straight but angular edge connecting both nodes. The orthogonality of the end shall be kept.

Unfortunately I don't know how this kind of edge is called, so I don't know what to search for in the existing questions.

Best Answer

There is an old arrow tip for just this, |. E.g. \draw [-|] (0,0) -- (1,1);

For all things arrow tips, see section 16.5 Reference: Arrow Tips in the manual. It describes the arrows.meta library. This library introduces a slightly different way of defining arrow tips, -{Bar[]}, where the brackets can contain options for customizing the arrow tip.

enter image description here

\documentclass{article} 
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw,rectangle] (x) at (0,0) {node};
\node (y) at (0,-1) {};
\draw [-|] (x) edge (y);
\end{tikzpicture}
\end{document}
Related Question