I am learning how to make flow chart in tikz. In this MWE
\documentclass[crop,tikz]{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
\tikzstyle{NODE} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, draw=black, fill=red!10]
\begin{tikzpicture}[node distance=2cm]
\node (A1) [NODE] {my first node};
\node (A2) [NODE,below of=A1] {my second node};
\node (A3) [NODE,below of=A2] {is it true?};
\node (A4) [NODE,left of=A3,yshift=-2cm] {we get here if true};
\node (A5) [NODE,right of=A3,yshift=-2cm] {we get here if false};
\draw [->,thick] (A1.south) -| (A2.north);
\draw [->,thick] (A2.south) -| (A3.north);
\draw [->,thick] (A3.south) -| node[anchor=south] {YES} (A4.north);
\draw [->,thick] (A3.south) -| node[anchor=south] {NO} (A5.north);
\end{tikzpicture}
\end{document}
It gives
I am not sure what is the correct way to produce this instead (which I did using paint.exe for illustration)
Do I need to make a hidden node below A3 first? in order to make the edges as shown? Or is there a better and canonical way to do this? I do not want the edges to be sloping, I like to use straight edges only. I know I could do this
\draw [->,thick] (A1.south) -| (A2.north);
\draw [->,thick] (A2.south) -| (A3.north);
\draw [->,thick] (A3.south) -- node[anchor=south] {YES} (A4.north);
\draw [->,thick] (A3.south) -- node[anchor=south] {NO} (A5.north);
And get
But I like the straight edges more.
Can one make a node in tikz that has no size and do not show, and use it just as place holder to in order to make edges to it?




