I am drawing two nodes and an arrow between these nodes with
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[node distance=5cm]
% nodes
\node [draw] (A) {A};
\node [draw, right=of A] (B) {B};
% arrows
\draw [->] (A) -- node [above, midway] {Some text} (B);
\end{tikzpicture}
\end{document}
Using \draw [->] (A) -- node [above, midway] {Some text} (B);
I can write text above the arrow; however, the text doesn't respect the configured node distance. Can I set the distance between the arrow and the text?
Best Answer
You will have to shift the label. They are not controlled by the node distance.
Chose one approach:
The one you like, you might apply be adding e.g.
\begin{tikzpicture}[every label/.append style={above=5cm}]