I am trying to draw state transitions using tikz, and place the reasons for those transitions on the arrows between states. The problem is that the text is not aligned on the arrows, and while in and of itself that is not terrible, things like the following happen (which are).
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{automata,positioning,arrows}
\begin{document}
\begin{tikzpicture}[shorten >=2pt,node distance=4cm,on grid,auto]
\node[state] (Rd) {Ready};
\node[state] (Rn) [above right =of Rd] {Run};
\node[state] (Bl) [below right =of Rd] {Blocked};
\node[state] (Nr) [below right =of Rn] {Dead};
\path[->]
(Rd) edge node {Given a timeslice} (Rn)
(Rd) edge node {Asks for I/O} (Bl)
(Rd) edge node {Gets killed by kernel} (Nr)
(Bl) edge node {Out of memory} (Nr);
\end{tikzpicture}
\end{document}

Adding the [midway,sloped] option to the path options gives the follow, so its closer, but still wrong:

How can I get the text to autmatically rotate to be "on" the arrow (just above or below and parallel, there will be no loops if that matters).
I looked at Curved text (on multiple lines) within curved arrow using tikz, but was unable to get it to work in may case.

text widthto auto wrap thetimeslicelabel, which is pretty easy to do manually. – Peter Grill Feb 21 '13 at 06:30