Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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

share|improve this answer

You can use below left and below right. But make sure your MWE is compilable. It's missing many items required.

%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, below left, midway] {Industry conditions and firm-specific resources}  (Institutions)   
     (Choices) edge node[anchor=center, text width=3.5cm, below right, midway] {Formal and informal constraints} (Organisations)  
     (Institutions) edge  node [midway, below] {interaction} node[midway, above] {Dynamic} (Organisations);

\end{tikzpicture}

enter image description here

share|improve this answer
    
Nice and clean thanks for the swift reply –  wierts Jun 30 '13 at 10:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.