# straight edge between big nodes in tikz

I have two rectangle nodes and want to put an edge between them. I want the edge have its arrow between the top center and the top left end of the lower node. I tried to do this with specifying in and out angle, however, this bends the line and makes the arrow look very ugly:

The code:

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\node[draw,rectangle] (u1) at (3,8) {run $A$};
\node[draw,rectangle,align=left] (nextYES) at (3,6.5) {choose $(x,y,z)\\in V_{\mathbb{H}^3{'}}$\\ with $|L(x,y,z)| > 1$};
\draw (u1) edge[->,>=latex,out=225,in=150] (nextYES);
\end{tikzpicture}
\end{frame}
\end{document}


Is there a way to make the edge straight, with the edge anchored at the current point (or somewhere nearby) and not turning the arrow at all?

Using in, out will result in a curved path; to get a staright line with the required specifications you have several possibilities:

1. Use the <point>.<angle> anchors:

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
*\begin{tikzpicture}
\node[draw,rectangle] (u1) at (3,8) {run $A$};
\node[draw,rectangle,align=left] (nextYES) at (3,6.5) {choose $(x,y,z)$\\in $V_{\mathbb{H}^3{'}}$\\ with $|L(x,y,z)| > 1$};
\draw (u1.230) edge[->,>=latex] (nextYES.140);
\end{tikzpicture}
\end{frame}
\end{document}


2. Use (possible shifts) and anchors:

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\node[draw,rectangle] (u1) at (3,8) {run $A$};
\node[draw,rectangle,align=left] (nextYES) at (3,6.5) {choose $(x,y,z)$\\in $V_{\mathbb{H}^3{'}}$\\ with $|L(x,y,z)| > 1$};
\draw (u1.south) edge[->,>=latex] (nextYES.north west);
\end{tikzpicture}
\end{frame}
\end{document}


\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\node[draw,rectangle] (u1) at (3,8) {run $A$};
\node[draw,rectangle,align=left] (nextYES) at (3,6.5) {choose $(x,y,z)$\\in $V_{\mathbb{H}^3{'}}$\\ with $|L(x,y,z)| > 1$};
\draw ([xshift=15pt]u1.south west) edge[->,>=latex] ([xshift=15pt]nextYES.north west);
\end{tikzpicture}
\end{frame}
\end{document}


3. Use the calc library to get some intermediate points (perhaps an overkill here):

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
\begin{frame}
\begin{tikzpicture}
\node[draw,rectangle] (u1) at (3,8) {run $A$};
\node[draw,rectangle,align=left] (nextYES) at (3,6.5) {choose $(x,y,z)$\\in $V_{\mathbb{H}^3{'}}$\\ with $|L(x,y,z)| > 1$};
\draw
( $(u1.south west)!0.25!(u1.south east)$ ) edge[->,>=latex]
( $(nextYES.north west)!0.15!(nextYES.north east)$ );
\end{tikzpicture}
\end{frame}
\end{document}


• (+1) Though I read the question differently.... – cfr Oct 1 '15 at 19:41

Perhaps you want straight lineS rather than a single line between one point and the other? For example:

The reason I suggest this is because I can see the logic of trying the in-out angles in this case.

If so, you might use something like this:

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\node[draw,rectangle] (u1) at (3,8) {run $A$};
\node[draw,rectangle,align=left] (nextYES) at (3,6.5) {choose $(x,y,z)$\\$in V_{\mathbb{H}^3{'}}$\\ with $|L(x,y,z)| > 1$};
\draw [->,>=latex] (u1.south) -- +(0,-5pt) -| ([xshift=5pt]nextYES.north west);
\end{tikzpicture}
\end{frame}
\end{document}


Note that you cannot use \\ within $...$. You need to exit maths mode, break the line and re-enter maths mode if a break is required.