I'm new to LaTeX and I'm trying to work out how I can configure TikZ to position the text ON the connecting lines (rather than beside it) in this flowchart and then give that text a filled white background rectangle.
My issue mainly comes from the fact that I can't associate a style with the text node inside the line (I can't do [text]) and I don't know how to do substyles with \tikzstyle to match a node that doesn't have a style associated with it (in CSS this would be .line > node or something like that).
I'm sure this is a really really simple question, but Google unfortunately seems to have no answers to it!
Can anyone help?
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, text centered , -latex']
\tikzstyle{line node} = [draw, fill=white, font=\tiny ]
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
minimum height=2em]
\begin{center}
\begin{tikzpicture}[node distance = 3cm, auto]
% Place nodes.
\node [] (_split01) {};
\node [block, left of=_split01, node distance = 2cm] (program) {Program};
\node [block, right of=_split01, node distance = 2cm] (unit) {Unit};
\node [block, below of=_split01] (procedure) {Procedure};
\node [block, left of=procedure] (entrypoint) {Entry Point};
\node [block, right of=procedure] (function) {Function};
\node [block, below of=procedure] (block) {Block};
\node [block, below of=block] (statement) {Statement};
\node [below of=statement] (_split02) {};
\node [block, left of=_split02, node distance = 2cm] (assignment) {Assignment Statement};
\node [block, right of=_split02, node distance = 2cm] (expression) {Expression Statement};
% Connect nodes.
\path [line] (program) -- node {References} (unit);
\path [line] (program) -- node {Defines and Calls} (entrypoint);
\path [line] (program) -- node {Defines} (procedure);
\path [line] (program) -- node {Defines} (function);
\path [line] (unit) -- node {Defines} (procedure);
\path [line] (unit) -- node {Defines} (function);
\path [line] (entrypoint) -- (block);
\path [line] (procedure) -- (block);
\path [line] (function) -- (block);
\end{tikzpicture}
\end{center}

