\usepackage{amsthm,amssymb,amsmath}
\usepackage{fancybox,fancyhdr,setspace,tocbibind,calc}
\usepackage[absolute]{textpos}
\usepackage{graphicx}
\usepackage{makeidx}
\makeindex
\usepackage{syntonly}
\usepackage[colorlinks,linkcolor=blue,citecolor=magenta,urlcolor=green]{hyperref}
\usepackage{arydshln}
\usepackage{rotating}
\usepackage[xindy]{glossaries}
\usepackage{xepersian}
\setdigitfont{Yas}
\settextfont[Scale=1.3]{B Lotus}
\setlatintextfont[Scale=1.25]{Cambria}
\setlatintextfont[ExternalLocation,BoldFont={lmroman10-bold},BoldItalicFont={lmroman10-bolditalic},ItalicFont={lmroman10-italic}]{lmroman10-regular}
\usepackage[font={small},labelfont={bf},labelsep= space,labelformat=default,format=plain]{caption}
\defpersianfont\nastaliq[Scale=1.5]{IranNastaliq}
\defpersianfont\titr[Scale=1]{B Zar}
\defpersianfont\traffic[Scale=1]{B Traffic}
\pagestyle{fancy}
% with this we ensure that the chapter and section
% headings are in lowercase.\ref{}
\renewcommand{\chaptermark}[1]{%
        \markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
        \markright{\thesection\ #1}}
\fancyhf{} % delete current header and footer
\fancyhead[RO]{\leftmark\slshape}

\fancyhead[LE]{\rightmark\slshape}

\fancyhead[RE,LO]{\thepage\slshape }
\renewcommand{\headrulewidth}{0pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\theoremstyle{definition}
\newtheorem{definition}{تعریف}[section]
\theoremstyle{theorem}
\newtheorem{theorem}[definition]{قضیه}
\newtheorem{lemma}[definition]{لم}
\newtheorem{proposition}[definition]{گزاره}
\newtheorem{corollary}[definition]{نتیجه}
\theoremstyle{definition}
\newtheorem{example}{مثال}[section]
\newtheorem*{solution}{جواب}
\newtheorem*{remark}{نكته}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\bt}{\begin{theorem}}
\newcommand{\et}{\end{theorem}}
\newcommand{\bp}{\begin{proof}}
\newcommand{\ep}{\end{proof}}
\newcommand{\be}{\begin{example}}
\newcommand{\ee}{\end{example}}
\newcommand{\bs}{\begin{solution}}
\newcommand{\es}{\end{solution}}
\newcommand{\bd}{\begin{definition}}
\newcommand{\ed}{\end{definition}}
\newcommand{\ba}{\begin{align}}
\newcommand{\ea}{\end{align}}
\newcommand{\beq}{\begin{equation}}
\newcommand{\eeq}{\end{equation}}
\newcommand{\To}{\longrightarrow}
\renewcommand\proofname{\textbf{برهان}}
\renewcommand{\bibname}{مراجع}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\numberwithin{figure}{chapter}
\numberwithin{equation}{section}
\numberwithin{table}{chapter}