%this is a very simple document using xepersian package 
%Isfahan University of Technology (IUT)

\documentclass[a4paper]{report}
\usepackage{graphicx}
\usepackage{booktabs}


\usepackage{multirow}

\usepackage{tabularx}




\usepackage{amsmath}   % From the American Mathematical Society
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{amstext}
\usepackage{amscd}
\usepackage{amsopn}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{xfrac}









\usepackage[top=3cm, bottom=2.5cm, left=2.5cm, right=3cm]{geometry}


\usepackage{hyperref} % PDF links
\usepackage{xepersian}
\usepackage{xecolour}
\settextfont[Scale=1]{XB Zar} 
\setlatintextfont{Times New Roman}
\setdigitfont[Scale=1]{XB Zar}

\renewcommand{\baselinestretch}{2.1}



\makeatletter
\def\caption{\@ifstar\starcaption\notstarcaption}
\def\starcaption{%
   \ifx\@captype\@undefined
     \@latex@error{\noexpand\caption outside float}\@ehd
     \expandafter\@gobble
   \else
     \refstepcounter\@captype
     \expandafter\@firstofone
   \fi
   {\@dblarg{\@starcaption\@captype}}%
}
\def\notstarcaption{%
   \ifx\@captype\@undefined
     \@latex@error{\noexpand\caption outside float}\@ehd
     \expandafter\@gobble
   \else
     \refstepcounter\@captype
     \expandafter\@firstofone
   \fi
   {\@dblarg{\@caption\@captype}}%
}
\long\def\@starcaption#1[#2]#3{%
  \par
  \addcontentsline{\csname ext@#1\endcsname}{#1}%
    {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
  \begingroup
    \@parboxrestore
    \if@minipage
      \@setminipage
    \fi
    \normalsize
    \@makecaption{\csname #1name\endcsname}{\ignorespaces #3}\par
  \endgroup}
\makeatother


\renewcommand{\bibname}{فهرست مراجع}
\renewcommand{\chaptername}{فصل}
\renewcommand{\contentsname}{\centering{ فهرست مطالب}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%\numberwithin{figure}{chapter}
%\numberwithin{table}{chapter}

\begin{document}

\pagenumbering{arabic}

\newgeometry{top=3cm, bottom=2.5cm, left=2.5cm, right=3cm}
\DeclareMathSizes{17}{17}{17}{17}



\clearpage
\vspace{3cm}
\chapter{تستتستتستتستتستتستتستتستتست}
 
 
\section{تست}

\subsection{تستتستتستتست}
 



تستتستتستتستتستتستتستتستتست

 تستتستتست (جدول \ref{tabex3})
 
 تستتستتست (جدول \ref{tabex4})

\begin{table}[!h]\label{tabex3}
\centering
\caption{\small تست 2 }
\begin{tabular}{|c|}
  \hline
  تست \\
  \hline
\end{tabular}
\end{table}

تستتستتستتستتستتستتست

\begin{table}[!h]
\centering
\caption{\small تست 2 }
\begin{tabular}{|c|}
  \hline
  تست \\
  \hline
\end{tabular}
\label{tabex4}
\end{table}



\end{document}