This is my tikz code :
\documentclass[a4paper,10pt]{article}
\usepackage{verbatim}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=7 cm,
semithick, scale = 0.6, transform shape]
\node[initial,state] (A) {$s_0$};
\node[state] (B) [above right of=A] {$s_1$};
\node[state] (C) [below right of=A] {$s_2$};
\node[state] (D) [below right of=B] {$s_3$};
\node[state] (E) [above right of=D] {$s_4$};
\node[state] (F) [below right of=D] {$s_5$};
\path (A) edge [left] node {$0$ $ \rightarrow $ [$x$ = $x.0.0$] } (B)
edge [left] node {$1$ $ \rightarrow $ [$x$ = $x.0.1$] } (C)
(B) edge [loop above] node {$0$ $ \rightarrow\\ $ [$x$ = $x.0$] } (B)
edge [bend right,left] node {$1$ $ \rightarrow $ [$x$ = $x.1$] } (C)
edge [] node {$\$$ $ \rightarrow $ [$x$ = $x.0.\$$] } (D);
\end{tikzpicture}
\end{document}
I am getting this :

My doubts are :
- Right now all labels are exactly at center of any arrow. How to change its position?
- I gave
\\within the label description. Still it didn't show in new line. For example,(B) edge [loop above] node {$0$ $ \rightarrow\\$ [$x$ = $x.0$] } (B). I have given\\after\rightarrow(ie$ \rightarrow\\$). Still everything coming in the same line. How to give a line break there?
Thanks
