\documentclass[11pt,a4paper]{book}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{xepersian}
\tikzstyle{bag} = [text centered]
\begin{document}
$$\displaystyle\bigcup_{\tiny\textrm{\rl{تمام متغیرها}}}$$
این مثال را در نمودار \ref{R} می‌توانید ببینید.
\begin{figure}[!hbtp]
\begin{latin}
\begin{center}
\begin{tikzpicture}
	\node (0) at (0,1.5) [bag] {A};
	\node (1) at (2,1.5) [bag] {B};
	\node (2) at (5,0) [bag] {this is a book};
	\node (3) at (5,3) [bag] {C};
	\node (4) at (8,1.5) [bag] {D};
	\draw [->] (0) to (1);
	\draw [->] (1) to node [auto,swap] {$f$} (2);
	\draw [->] (1) to node [auto] {$g$} (3);
	\draw [->] (2) to node [auto,swap] {$h_1$} (4);
	\draw [->] (3) to node [auto] {$h_2$} (4);
\end{tikzpicture}
\end{center}
\end{latin}
\caption{\small نمودار مورد نیاز\label{R}}
\end{figure}
\end{document}