
\documentclass[oneside,12pt]{memoir}
%----------------------------------------------------------------
\usepackage[pagebackref=false,colorlinks,linkcolor=blue,citecolor=magenta]{hyperref}
%
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage{makeidx}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage[a4paper,vmargin=3cm,left=3cm,right=4cm]{geometry}
\usepackage{url}

%\usepackage{fancyhdr}
%\pagestyle{fancy}
%\usepackage{tocbibind}
%\usepackage{fancybox}
%---------------------------------------------------------------------
\usepackage{hyperref }
\usepackage{xepersian}
\settextfont[Scale=1]{XB Niloofar}
\setdigitfont[Scale=1]{XB Zar}
\setlatintextfont[Scale=1]{Times New Roman}
\defpersianfont\Nastaliq[Scale=1]{IranNastaliq}
\defpersianfont\Titre[Scale=1]{XB Titre}
%----------------------------------------------------------------
\theoremstyle{plain}
\newtheorem{thm}{قضیه}%[section]
\numberwithin{thm}{section}
\renewcommand{\thethm}{\arabic{thm}.\arabic{section}.\arabic{chapter}}
\newtheorem{lem}[thm]{لم}
\newtheorem{prop}[thm]{گزاره}
\newtheorem{cor}[thm]{نتیجه}
\theoremstyle{definition}
\newtheorem{dfn}[thm]{تعریف}
\newtheorem{exam}[thm]{مثال}
\newtheorem{rem}[thm]{ملاحظه}
%----------------------------------------------------------------
\renewcommand{\listfigurename}{فهرست شکل‌ها}
\renewcommand{\listtablename}{فهرست جدول‌ها}
\renewcommand{\bibname}{مراجع}
%
\newcommand{\Tableofcontents}{%
\clearpage\addtolength{\baselineskip}{0ex}
\tableofcontents
\clearpage\addtolength{\baselineskip}{0ex}}
%
\newcommand{\Listoffigures}{%
\clearpage\addtolength{\baselineskip}{0ex}
\listoffigures
\clearpage\addtolength{\baselineskip}{0ex}}
%
\newcommand{\Listoftables}{%
\clearpage\addtolength{\baselineskip}{0ex}
\listoftables
\clearpage\addtolength{\baselineskip}{0ex}}
%
%--------------------------------------------------------------------------------
%
\makechapterstyle{duchapstyle}{%
  \chapterstyle{default}
  \renewcommand*{\printchaptername}{\centering\huge\bfseries\chaptername}
    \renewcommand*{\chaptitlefont}{\normalfont\huge\Titre}
  \renewcommand*{\printchaptertitle}[1]{%
    \vskip\onelineskip\centering\chaptitlefont ##1}
  \renewcommand*{\afterchaptertitle}{%
    \vskip\onelineskip\vskip\afterchapskip}
  \setlength{\beforechapskip}{3\baselineskip}
  \renewcommand*{\printchapternonum}{%
    \vphantom{\chapnumfont One}
    \afterchapternum%
    \vskip\topskip}
  \setlength{\beforechapskip}{2\onelineskip}}
\chapterstyle{duchapstyle}
%
%------------------------------------------------------------------------------------
%
\numberwithin{figure}{chapter}
\numberwithin{table}{chapter}
\numberwithin{equation}{chapter}
%
\setcounter{secnumdepth}{2}
\renewcommand{\thesection}{\arabic{section}-\arabic{chapter}}
\renewcommand{\thesubsection}{\arabic{subsection}-\arabic{section}-\arabic{chapter}}
%
\renewcommand{\thefigure}{\arabic{figure}-\arabic{chapter}}
\renewcommand{\thetable}{\arabic{figure}-\arabic{chapter}}
%
\renewcommand{\baselinestretch}{1.4}
%
\newlength{\linespace}
\linespace=1ex
\newlength{\SKIP}
\SKIP=1ex
\newlength{\SKIPP}
\SKIPP=2ex
\newlength{\SKIPPP}
\SKIPPP=3ex

%--------------------------------------------------------------------------------------------------
\def\By{توسط}
\def\latinBy{By}
%--------------------------------------------------------------------------------------------------
\newcommand{\faculty}{}
\newcommand{\Faculty}[1]{\renewcommand{\faculty}{#1}}
%
\newcommand{\latinfaculty}{}
\newcommand{\LatinFaculty}[1]{\renewcommand{\latinfaculty}{#1}}
%
\newcommand{\subject}{}
\newcommand{\Subject}[1]{\renewcommand{\subject}{#1}}
%
\newcommand{\latinsubject}{}
\newcommand{\LatinSubject}[1]{\renewcommand{\latinsubject}{#1}}
%
\newcommand{\field}{}
\newcommand{\Field}[1]{\renewcommand{\field}{#1}}
%
\newcommand{\latinfield}{}
\newcommand{\LatinField}[1]{\renewcommand{\latinfield}{#1}}
%
\newcommand{\thesistitle}{}
\newcommand{\ThesisTitle}[1]{\renewcommand{\thesistitle}{#1}}
%
\newcommand{\latinthesistitle}{}
\newcommand{\LatinThesisTitle}[1]{\renewcommand{\latinthesistitle}{#1}}
%
\newcommand{\stname}{}
\newcommand{\StudentName}[1]{\renewcommand{\stname}{#1}}
%
\newcommand{\latinstname}{}
\newcommand{\LatinStudentName}[1]{\renewcommand{\latinstname}{#1}}
%
\newcommand{\supname}{}
\newcommand{\SupervisorName}[1]{\renewcommand{\supname}{#1}}
%
\newcommand{\latinsupname}{}
\newcommand{\LatinSupervisorName}[1]{\renewcommand{\latinsupname}{#1}}
%
\newcommand{\advname}{}
\newcommand{\AdvisorName}[1]{\renewcommand{\advname}{#1}}
%
\newcommand{\latinadvname}{}
\newcommand{\LatinAdvisorName}[1]{\renewcommand{\latinadvname}{#1}}
%
\newcommand{\thesisdate}{}
\newcommand{\ThesisDate}[1]{\renewcommand{\thesisdate}{#1}}
%
\newcommand{\latinthesisdate}{}
\newcommand{\LatinThesisDate}[1]{\renewcommand{\latinthesisdate}{#1}}
%
%-------------------------------------------------------------------------------------------------------------
%
\newcommand{\DOTS}{}
%
\newcommand{\tcmi}{}
\newcommand{\ThesisCommitteeMemberOne}[1]{\renewcommand{\tcmi}{\DOTS #1}}
%
\newcommand{\ltcmi}{}
\newcommand{\LatinThesisCommitteeMemberOne}[1]{\renewcommand{\ltcmi}{\DOTS #1}}
%
\newcommand{\tcmii}{}
\newcommand{\ThesisCommitteeMemberTwo}[1]{\renewcommand{\tcmii}{\DOTS #1}}
%
\newcommand{\ltcmii}{}
\newcommand{\LatinThesisCommitteeMemberTwo}[1]{\renewcommand{\ltcmii}{\DOTS #1}}
%
\newcommand{\tcmiii}{}
\newcommand{\ThesisCommitteeMemberThree}[1]{\renewcommand{\tcmiii}{\DOTS #1}}
%
\newcommand{\ltcmiii}{}
\newcommand{\LatinThesisCommitteeMemberThree}[1]{\renewcommand{\ltcmiii}{\DOTS #1}}
%
\newcommand{\tcmiv}{}
\newcommand{\ThesisCommitteeMemberFour}[1]{\renewcommand{\tcmiv}{\DOTS #1}}
%
\newcommand{\ltcmiv}{}
\newcommand{\LatinThesisCommitteeMemberFour}[1]{\renewcommand{\ltcmiv}{\DOTS #1}}
%
\newcommand{\tcmv}{}
\newcommand{\ThesisCommitteeMemberFive}[1]{\renewcommand{\tcmv}{\DOTS #1}}
%
\newcommand{\ltcmv}{}
\newcommand{\LatinThesisCommitteeMemberFive}[1]{\renewcommand{\ltcmv}{\DOTS #1}}
%
\newcommand{\tcmvi}{}
\newcommand{\ThesisCommitteeMemberSix}[1]{\renewcommand{\tcmvi}{\DOTS #1}}
%
\newcommand{\ltcmvi}{}
\newcommand{\LatinThesisCommitteeMemberSix}[1]{\renewcommand{\ltcmvi}{\DOTS #1}}
%-------------------------------------------------------------------------------------------------------------
%
\def\University{دانشگاه }
\def\LatinUniversity{ University}
%\def\Ministry{وزارت علوم، تحقیقات و فناوری}
\def\LatinMinistry{Ministry of Science, Research, and Technology}
\def\MsThesis{سمینار کارشناسی ارشد}
\def\LatinMsThesis{M.Sc. Thesis}
%
%-------------------------------------------------------------------------------------------------------------
%
\def\InTheNameofGodPage{
\clearpage\newpage
\thispagestyle{empty}
\vspace*{\stretch{1}}
\begin{center}
\def\InTheNameofGod{بسم اللّه الرحمن الرحیم} 
\Huge\Nastaliq
\InTheNameofGod
\end{center}
\vspace*{\stretch{3}}
\clearpage}
%
%-------------------------------------------------------------------------------------------------------------
\def\MakeTitlePage{%
\newpage
\thispagestyle{empty}
\begin{center}
{\large\Titre\Ministry}      
\par 
%
%\vspace*{\linespace}
%
\includegraphics[height=3.5cm]{style/logo} 
\par 
%
%\vspace*{\linespace}
%
{\large\Titre\University}    
\par 
%
%\vspace*{\linespace}
%
{\large\Titre\faculty}       
\par 
%
\vspace*{\fill}
%
{\LARGE\MsThesis}       
\par 
%
\vspace*{\SKIP}
%
{\LARGE\subject~(گرایش~\field)} 
\par
%
\vspace*{\fill}
%
\begin{quote}
\huge\Titre
%\addtolength{\baselineskip}{\linespace}
\begin{center} \thesistitle \end{center}
\end{quote}
%
\vspace*{\fill}
%
{\Large\By} 
\par
%
\vspace*{\linespace}
%
{\large\Titre\stname} 
\par
%
\vspace*{\fill}
%
{\Large استاد  راهنما} 
\par
%
\vspace*{\linespace}
%
{\large\Titre\supname} 
\par
%
\vspace*{\fill}
%
{\Large ا} 
\par
%
\vspace*{\linespace}
%
{\large\Titre\advname} 
\par
%
\vspace*{\fill}
%
{\Large\thesisdate} 
\end{center}
\vspace*{5mm}
%
\clearpage\newpage
\thispagestyle{empty}
\vspace*{\stretch{1}}
\begin{center}
\includegraphics[width=10cm]{style/god}
\end{center}
\vspace*{\stretch{3}}
\clearpage
}
%
%-------------------------------------------------------------------------------------------------------------
%
\def\MakeEvaluationPage{%
\clearpage\newpage
\thispagestyle{empty}
%
\begin{center}
\large\Titre به نام خدا
\end{center}
%
\vspace*{\fill}
%
\begin{quote}
\LARGE\Titre
  \begin{center} 
    %\addtolength{\baselineskip}{.5\linespace}
    \thesistitle 
  \end{center}
\end{quote}
%
\vspace*{\fill}
%
\begin{center}
\Large
{\bfseries \By} 
\par
%
\vspace*{\linespace}
%
\stname
\end{center}
%
\vspace*{\fill}
%
\begin{center}
\def\THESIS{پایان‌نامه}
{\bfseries\Large\THESIS} 
\par
%
\vspace*{\SKIP}
%
\begin{quote}
\centering\large
%\addtolength{\baselineskip}{.5\linespace}
ارائه شده به تحصیلات تکمیلی دانشگاه به عنوان بخشی از فعالیت‌های تحصیلی لازم برای
اخذ
\end{quote}
\end{center}
%
\vspace*{\fill}
%
\begin{center}
\def\In{در رشته}
{\bfseries\Large\In}
\par
%
\vspace*{\SKIPP}
%
{\Large\subject~(گرایش~\field)}
\par
\vspace*{\SKIPP}
%
{\def\From{از دانشگاه }
\Large\From}
%
\end{center}
%
\vspace*{\fill}
{
\large
ارزیابی و تأیید شده توسط کمیته پایان‌نامه  با درجه: (عالی ،  خوب، قابل قبول)
}
%
\par\vspace*{\SKIP}
%
{\renewcommand{\labelitemi}{}
\begin{itemize} 
\small
\item \tcmi
\item \tcmii
\item \tcmiii
\item \tcmiv
\item \tcmv
\item \tcmvi
\end{itemize}
}
%
\vspace*{\fill}
\begin{center}
{\Large\thesisdate} 
\end{center}
}
%
%--------------------------------------------------------------------------------------------------
%
\def\DedicationName{تقدیم به}
\newenvironment{Dedication}%
{\clearpage\thispagestyle{empty}
\par 
%
\vspace*{3\baselineskip}
%
\begin{center} 
\huge\Nastaliq\DedicationName
\end{center}
\vspace*{5ex}
\begin{quote}
}
{\end{quote}\newpage}
%
%-------------------------------------------------------------------------------------------------------------
%
\def\ThanksName{سپاسگزاری}
\newenvironment{Thanks}%
{\clearpage \thispagestyle{empty}
\par \vspace*{3\baselineskip}
\begin{center} 
\huge\Nastaliq \ThanksName
\end{center}
\vspace*{5ex}
\begin{quote}
}
{\end{quote}}
%
%-------------------------------------------------------------------------------------------------------------
%
\def\AbstractName{چکیده}
\newenvironment{AbstractPage}%
{\clearpage\newpage
\thispagestyle{empty}
%
\vspace*{5ex}
%
\begin{center} \Large\AbstractName \end{center}
%
\vspace*{5ex}
%
\begin{quote}
\LARGE\Titre %\addtolength{\baselineskip}{.5\linespace}
\begin{center} \thesistitle \end{center}
\end{quote}
%
\vspace*{4ex}
%
\begin{center} 
\def\BY{به وسیله‌ی:}
{\Large\BY}
\par
\vspace*{\SKIP}
{\Large\stname}
\end{center}
\vspace*{5ex}
\small}{\normalfont\normalsize\newpage}
%
%-----------------------------------------------------------------------------------------------------------------
%
\def\MakeLatinTitlePage{%
\clearpage\newpage 
\Latin
\thispagestyle{empty}
%
\begin{center}
{\large\bfseries\LatinMinistry}      
\par
%
\includegraphics[height=3.5cm]{style/logo} 
\par
%
{\large\bfseries\LatinUniversity}    
\par
\vspace*{-\linespace}
%
{\large\bfseries\latinfaculty}       
\par 
%
\vspace*{\fill}
%
{\Large\bfseries\LatinMsThesis}       
\par
%
\vspace*{\linespace}
%
{\LARGE In~\latinsubject~(\latinfield)} \par
%
\vspace*{\fill}
%
\begin{quote}
\Huge\bfseries\addtolength{\baselineskip}{-\linespace}
\begin{center} \latinthesistitle \end{center}
\end{quote}
%
\vspace*{\fill}
%
{\Large\bfseries\latinBy}
\par
\vspace*{\linespace}
%
{\LARGE\bfseries\latinstname} 
\par
%
\vspace*{\fill}
%
{\Large\bfseries Supervisor(s):} 
\par
\vspace*{\linespace}
%
{\LARGE\bfseries\latinsupname} 
\par
%
\vspace*{\fill}
%
{\Large\bfseries Advisor(s):} 
\par
\vspace{\linespace}
%
{\LARGE\bfseries\latinadvname} 
\par
%
\vspace*{\fill}
{\Large\latinthesisdate} 
\end{center}
\vspace*{5mm}}
%
%-------------------------------------------------------------------------------------------------------------
%
\def\LatinAbstractName{ABSTRACT}
\newenvironment{LatinAbstractPage}%
{\clearpage\Latin
\thispagestyle{empty}
\par \vspace*{5ex}
\begin{center} \bfseries\large\LatinAbstractName \end{center}
\vspace*{3ex}
%
\begin{quote}
\bfseries\LARGE%\addtolength{\baselineskip}{.5\linespace}
\begin{center} \latinthesistitle \end{center}
\end{quote}
%
\vspace*{3ex}
%
\begin{center} 
{\bfseries\large\latinBy}
\par
\vspace*{\linespace}
%
{\Large\bfseries\latinstname}
\end{center}
%
\vspace*{5ex}
%
}{\newpage}
%
%-------------------------------------------------------------------------------------------------------------
%
\def\MakeLatinEvaluationPage{%
\newpage\Latin
\thispagestyle{empty}
%
\begin{center}
\Large\bfseries In The Name of God
\end{center}
%
\vspace*{\fill}
%
\begin{quote}
\LARGE\bfseries
  \begin{center} 
    \addtolength{\baselineskip}{.5\linespace}
    \latinthesistitle 
  \end{center}
\end{quote}
%
\vspace*{\fill}
%
\begin{center}
\Large
{\bfseries\latinBy} \\ [1ex]
\latinstname
\end{center}
\vspace*{\fill}
\begin{center}
\large
{\bfseries\Large THESIS} \\ [1ex]
SUBMITTED TO THE SCHOOL OF GRADUATE STUDIES IN PARTIAL
FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER
OF SCIENCE (M.Sc.)
\end{center}
\vspace*{\fill}
\begin{center}
\Large 
{\bfseries In} \\ [1ex]
\latinsubject~(\latinfield)
\end{center}
\vspace*{\fill}
\begin{center}
\large
DAMGHAN UNIVERSITY% OF BASIC SCIENCES
\par
DAMGHAN, ISLAMIC REPUBLIC OF IRAN
\end{center}
\vspace*{\fill}
{EVALUATED AND APPROVED BY THE THESIS COMMITTEE AS:}
\par
\centerline{({\bfseries Excellent, Very Good, Good, Acceptable})}
\par
%
\vspace*{\fill}
%
{\renewcommand{\labelitemi}{}
\begin{itemize} 
\small
\item \ltcmi
\item \ltcmii
\item \ltcmiii
\item \ltcmiv
\item \ltcmv
\item \ltcmvi
\end{itemize}
}
%
\vspace*{\fill}
\begin{center}
{\Large\latinthesisdate} 
\end{center}
}
%
%-------------------------------------------------------------------------------------------------------------
\newcommand\persiangloss[2]{#1\dotfill\lr{#2}\\}
\newcommand\englishgloss[2]{#2\dotfill\lr{#1}\\}
%-------------------------------------------------------------------------------------------------------------
