\usepackage{amsthm,amssymb,amsmath,mathrsfs}
\usepackage{setspace}
\usepackage[top=30mm, bottom=25mm, left=25mm, right=30mm]{geometry}
\usepackage{titlesec}
\usepackage{color,graphicx}
\usepackage{framed} 
\usepackage{lastpage}
\usepackage[arc,all]{xy}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\usepackage{fancyhdr}
\usepackage[nottoc]{tocbibind}
\usepackage{makeidx}
\makeindex
\RequirePackage[para*,perpage]{ednotes}
\SetFootnoteHook{\setRTL}
\DeclareNewFootnote[para]{O}[fnsymbol]
\renewcommand{\extrafootnoterule}{}
\SelectFootnoteRule[0]{extra}
\SetFootnoteHook{\setLTR}
\DeclareNewFootnote[para]{C}[arabic]
\usepackage{perpage}
\MakePerPage{footnote}
\usepackage{supertabular}
\usepackage{xepersian}
\settextfont[Scale=1.1]{XB Zar}
\setdigitfont[Scale=1]{XB Zar}
\setlatintextfont[Scale=1.05]{Times New Roman}
\defpersianfont\nastaliq[Scale=1.5]{IranNastaliq}
\theoremstyle{plain}
\newtheorem{nok}{نکته}[section]
\theoremstyle{definition}
\newtheorem{theorem}[nok]{قضیّه}
\theoremstyle{definition}
\newtheorem{lemma}[nok]{لم}
\theoremstyle{definition}
\newtheorem{prop}[nok]{گزاره}
\theoremstyle{definition}
\newtheorem{coro}[nok]{نتیجه}
\theoremstyle{definition}
\newtheorem{remark}[nok]{تبصره}
\theoremstyle{definition}
\newtheorem{definition}[nok]{تعریف}
\theoremstyle{definition}
\newtheorem{ex}[nok]{مثال}
\renewcommand\proofname{\textbf{برهان‌\mbox{}.}}
\renewcommand{\bibname}{منابع و مآخذ}
\newcommand\persiangloss[2]{#1\dotfill\lr{#2}\\}
\newcommand\englishgloss[2]{#2\dotfill\lr{#1}\\}
\graphicspath{{images/}}
\makeatletter
\renewcommand*\l@chapter[2]{
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{1.5em}
    \begingroup
      \parindent \z@ \if@RTL\leftskip\else\rightskip\fi \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\if@RTL\rightskip\else\leftskip\fi\@tempdima
      \hskip -\if@RTL\rightskip\else\leftskip\fi
      #1\nobreak\leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfill \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}
\renewcommand\tableofcontents{
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \centerline{\huge\bfseries\contentsname
        \@mkboth{
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \vskip 40\p@
    \@starttoc{toc}
    \if@restonecol\twocolumn\fi
    } 
\newcommand{\thickhline}{
    \noalign {\ifnum 0=`}\fi \hrule height 1pt
    \futurelet \reserved@a \@xhline
}

