Reputation: 349
I would like to add an arrow from Variable 5 to the middle of the arrow that connects Variable 2 and Variable 3.
\documentclass[jou]{apa7}
\usepackage[american]{babel}
\usetikzlibrary{positioning}
\tikzset{mynode/.style={draw,text width=1.90cm,align=center}
}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\node[mynode] (v1){Variable 1};
\node[mynode,below left=of v1](v2) {Variable 2};
\node[mynode,below right=of v1](v3) {Variable 3};
\node[mynode,below = 2.5cm of v1] (v4){Variable 4};
\node[mynode, above right=of v1](v5) {Variable 5};
\draw[-latex] (v2.north) -- node[auto,] {a} (v1.west);
\draw[-latex] (v1.east) -- node[auto,] {b} (v3.north);
\draw[-latex] (v2.east) -- node[below, align=center] {c} (v3.west);
\draw[-latex] (v2.south) -- node[below=3mm, align=center] {d} (v4.west);
\draw[-latex] (v3.south) -- node[below=3mm, align=center] {e} (v4.east);
\draw[-latex] (v5.south) -- node[auto,]{f} (v3.north);
\end{tikzpicture}
\end{figure}
\end{document}
Upvotes: 1
Views: 3278
Reputation: 38748
You can use the calc
library to calculate the middle between the nodes v2
and v3
:
\documentclass[jou]{apa7}
\usepackage[american]{babel}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\tikzset{mynode/.style={draw,text width=1.90cm,align=center}
}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\node[mynode] (v1){Variable 1};
\node[mynode,below left=of v1](v2) {Variable 2};
\node[mynode,below right=of v1](v3) {Variable 3};
\node[mynode,below = 2.5cm of v1] (v4){Variable 4};
\node[mynode, above right=of v1](v5) {Variable 5};
\draw[-latex] (v2.north) -- node[auto,] {a} (v1.west);
\draw[-latex] (v1.east) -- node[auto,] {b} (v3.north);
\draw[-latex] (v2.east) -- node[below, align=center] {c} (v3.west);
\draw[-latex] (v2.south) -- node[below=3mm, align=center] {d} (v4.west);
\draw[-latex] (v3.south) -- node[below=3mm, align=center] {e} (v4.east);
\draw[-latex] (v5.south) -- node[auto,]{f} (v3.north);
\draw[-latex] (v5.south) -- ($(v2)!.5!(v3)$);
\end{tikzpicture}
\end{figure}
\end{document}
Upvotes: 2