[Tex/LaTex] positioning text in tikz drawings

tikz-pgf

All,

I'd like to position my text in a tikz picture such that it does not interfere with the lines drawn. I am new to tikz so bear with me on the coding.

This is my code

\begin{tikzpicture} % STYLES \tikzset{
    ellips/.style={ellipse, minimum width=100pt,
    align=center,node distance=3cm,fill=black!10,inner sep=5pt,text width=2.5cm,minimum 
    height=2.0cm,>=stealth'} }

\node [ellips](Choices) {Strategic Choices}; 
\node [above=2cm of Choices](dummy) {}; 
\node [ellips, force, left=1.5cm of dummy] (Institutions) {Institutions}; 
\node [ellips, force, right=1.5cm of dummy] (Organisations) {Organisations};

% Draw the links between  
\path[<->,thick]   
     (Choices) edge node[anchor=center, text width=3.5cm, left, midway] {Industry conditions and firm-specific resources}  (Institutions)   
     (Choices) edge node[anchor=center, text width=3.5cm, right, midway] {Formal and informal constraints} (Organisations)  
     (Institutions) edge  node [midway, below] {interaction} node[midway, above] {Dynamic} (Organisations);

\end{tikzpicture}

This gives the following result

enter image description here

Best Answer

The auto placement tries to guess the best positioning for a node in a path, so that the text of the node does not overlap the path.

In general auto to puts the text at the left of the direction in which the path is traversed. So for the path from (Institutions) to (Organization), auto will put the text above. For the path from (Choices) to (Institutions), it will use below left, and for the path from (Choices) to (Organizations) it will use above left.

Since the last one is not what we want, we can draw the last path from (Organizations) to (Choices), instead, to get the text at the desired place:

%In the preamble
\usetikzlibrary{shapes.geometric,arrows,positioning}

\begin{tikzpicture}[force/.style={},
    ellips/.style={ellipse, minimum width=100pt,
    align=center,node distance=3cm,fill=black!10,inner sep=5pt,text width=2.5cm,minimum 
    height=2.0cm,>=stealth'}
]

\node [ellips](Choices) {Strategic Choices}; 
\node [above=2cm of Choices](dummy) {}; 
\node [ellips, force, left=1.5cm of dummy] (Institutions) {Institutions}; 
\node [ellips, force, right=1.5cm of dummy] (Organisations) {Organisations};

% Draw the links between  
\path[<->,thick]   
     (Choices) edge node[anchor=center, text width=3.5cm, auto, midway] {Industry conditions and firm-specific resources}  (Institutions)   
     (Organisations) edge node[anchor=center, text width=3.5cm, auto, midway] {Formal and informal constraints} (Choices)  
     (Institutions) edge  node [midway, below] {interaction} node[above, midway] {Dynamic} (Organisations);
\end{tikzpicture}

Result

Related Question