Well, I don't know why it is happening but I know where it is happening. The arrowhead stealth'
is the culprit and amazingly it gets affected by the line
\renewcommand{\baselinestretch}{2}
regardless of the amount put inside the definition. You don't see that with other arrow heads. It happens with arrows library specific arrows. Here is a much simpler MWE (I wish you did this for us but anyway)
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\node[draw] (A) {$q_a$};
\node[draw] (B) at (1,0) {a};
\draw[-stealth'](A) -- (B);
\end{tikzpicture}
\renewcommand{\baselinestretch}{2}
\begin{tikzpicture}
\node[draw] (A) {$q_a$};
\node[draw] (B) at (1,0) {a};
\draw[-stealth'](A) -- (B);
\end{tikzpicture}
\end{document}
David Carlisle also indicated that there is a font selection issue or absence of it for reasons beyond me. Hence,
\renewcommand{\baselinestretch}{2}\selectfont
brings the arrow back to the node border. But I don't know what it breaks....
Long story short this is very likely to be related to the way how \nullfont
declaration is invoked. For example, putting \selectfont\nullfont
as the first code inside the TikZ picture also removes the artifact. So at some point before TikZ starts to do its job font selection should be finished so that one can switch to the \nullfont
properly.
Thus, David's comment below is very important.
I don't really get the question so I hope this is what you wanted. If you include a full document (such that we copy paste and see the problem on our systems) things are much more easier.
Here, you can change the default setting within a scope but your block
style had a node distance
which was resetting every time it is issued. I've made it 2mm such that we can see the difference easier.
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,shapes.geometric,positioning}
\begin{document}
\begin{tikzpicture}[decision/.style={diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt},
block/.style ={rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, minimum height=2em},
cloud/.style ={draw, ellipse, minimum height=2em},
line/.style ={draw,-latex'},
node distance = 1cm,
auto]
\node [block] (1st) {1st};
\node [block, right= of 1st] (2nd1) {2nd1};
\begin{scope}[node distance=2mm and 10mm]%Here we change it for everything inside this scope
\node [block, above= of 2nd1] (2nd2) {2nd2};
\node [block, below= of 2nd1] (2nd3) {2nd3};
\node [block, right= of 2nd1] (3rd1) {3rd1};
\node [block, above= of 3rd1] (3rd2) {3rd2};
\node [block, above= of 3rd2] (3rd3) {3rd3};
\end{scope}
\node [block, below= of 3rd1] (3rd4) {3rd4};
\node [block, below= of 3rd4] (3rd5) {3rd5};
\path [line] (1st) -- (2nd1);
\path [line] (2nd1) -- (2nd2);
\path [line] (2nd1) -- (2nd3);
\path [line] (2nd2) -- (3rd3);
\path [line] (2nd1) -- (3rd1);
\path [line] (1st) -- (2nd1);
\end{tikzpicture}
\end{document}
Best Answer
Setting
label distance
I think.