\documentclass[a4paper,12pt]{book}
\usepackage{graphicx, caption} 
\usepackage{color}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{subfigure}
\usepackage{fancyhdr,xspace,amsmath,amssymb,xepersian}
\usepackage{sidecap,lscape}
\usepackage{times}
\usepackage{amsopn,amstext,amsfonts,amsbsy}


\usepackage{pfnote}

\usepackage{booktabs}
\usepackage{perpage}
\usepackage{zref-perpage}
\zmakeperpage{footnote}

\MakePerPage{footnote}


\renewcommand{\baselinestretch}{1.9}

\settextfont[Scale=1.1]{B Zar}
\setlatintextfont{Times New Roman}
\setdigitfont{Yas}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\newenvironment{alteralgorithm}{}{}
\newcommand{\altercaption}[1]{\refstepcounter{algorithm}%
\noindent\hrule height .8pt
\smallskip\noindent
\textbf{الگوریتم \thealgorithm} #1
\hrule}


%\newtheorem{figure}{شکل}[chapter]
\newtheorem{definition}{تعریف}[section]
%\newtheorem{definition}{تعریف}[chapter]
\newtheorem{theorem}[definition]{قضیه}
\newtheorem{lemma}[definition]{لم}
%\newtheorem{def}[definition]{تعریف}
\newtheorem{proposition}[definition]{نکته}
\newtheorem{corollary}[definition]{نتیجه}
\newtheorem{remark}[definition]{توجه}
%\newtheorem{example}[definition]{مثال}
\newcounter{Examplecount}[chapter]
\setcounter{Examplecount}{0}
\newenvironment{example}
{\noindent  \refstepcounter{Examplecount}{\textbf{مثال}} \textbf{\arabic{Examplecount}.\thechapter}. }


%\renewcommand\proofname{\textbf{برهان}}
%\newenvironment{proof}{{\bf اثبات. }  \rm }{\hfill{$\Box$}\\}
%\renewcommand{\theequation}{\thechapter-\rl{\arabic{equation}}}
\renewcommand{\theequation}{\thechapter.\rl{\arabic{equation}}}
%\renewcommand{\thetable}{\thechapter.\rl{\arabic{table}}}
%\renewcommand\listsymbolname{\textbf{نماد ها}}
%\renewcommand{\thefigure}{\thechapter.\rl{\arabic{figure}}}

\newcounter{Tablecount}[chapter]
\setcounter{Tablecount}{0}
\newenvironment{tab}
{\noindent  \refstepcounter{Tablecount}{\textbf{جدول}} \textbf{\arabic{Tablecount}.\thechapter}. }



% دستوری برای تعریف واژه‌نامه انگلیسی به فارسی
\newcommand\persiangloss[2]{#1\dotfill\lr{#2}\\}
% دستوری برای تعریف واژه‌نامه فارسی به انگلیسی
\newcommand\englishgloss[2]{#2\dotfill\lr{#1}\\}
% دستوری برای نمادهای مورد استفاده شده در پایان نامه





\def\addsymbol #1:#2#3{$#1$ \> \parbox{5in}{#2 \dotfill \pageref{#3}}\\}
\def\symboldisplay#1{\label{#1}}

