% IUT-Thesis v2.0

% این قالب بر اساس فرمت پایان‌نامه‌ها و رساله‌های تحصیلات تکمیلی دانشگاه صنعتی اصفهان تهیه شده است.

% توصیه می‌شود که از توزیع تک‌لایو (TexLive) استفاده شود:
% http://tug.org/texlive/acquire-iso.html

% موفق باشید.
% امین فخاری
% ‌دی‌ماه 1394
% a101.fakhari@gmail.com
% -----------------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{IUT-Thesis}[2016/01/01 IUT-Thesis Package]

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Packages ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\usepackage{amsthm,amsmath,amssymb,amsfonts,bm,upgreek}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{color}
\usepackage{sectsty}
\usepackage{titlesec}
\usepackage{caption}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage{notoccite}
\usepackage[bottom]{footmisc}
\usepackage{zref-perpage}
\usepackage{tocloft}
\usepackage{unicode-math}
\usepackage{array}
\usepackage{hyperref}
\usepackage{cite}
\usepackage{enumitem}
\usepackage{subfig}
\usepackage{fancyhdr}
\usepackage{indentfirst}
\usepackage{fontspec}
\usepackage{xepersian}

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Settings ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\settextfont[Scale=1.3, ItalicFont=*, ItalicFeatures={FakeSlant=0.32}, BoldItalicFont=* Bold, BoldItalicFeatures={FakeSlant=0.32}]{B Zar}
\setlatintextfont[Scale=1.2]{Times New Roman}

\defpersianfont\BZarScaleOne[Scale=1]{B Zar}
\deflatinfont\TimesNewRomanScaleOne[Scale=1]{Times New Roman}

\makeatletter
\def\abjad@zero{}
\def\abj@num@i#1{%
  \ifcase#1\or الف\or ب\or ج\or د%
           \or ه‍\or و\or ز\or ح\or ط\fi
  \ifnum#1=\z@\abjad@zero\fi}
\def\abj@num@ii#1{%
  \ifcase#1\or ی\or ک\or ل\or م\or ن%
           \or س\or ع\or ف\or ص\fi
  \ifnum#1=\z@\fi\abj@num@i}
\def\abj@num@iii#1{%
  \ifcase#1\or ق\or ر\or ش\or ت\or ث%
            \or خ\or ذ\or ض\or ظ\fi
  \ifnum#1=\z@\fi\abj@num@ii}
\def\abj@num@iv#1{%
  \ifcase#1\or غ\fi
  \ifnum#1=\z@\fi\abj@num@iii}
   \let\@latinalph\@alph%
   \let\@latinAlph\@Alph%
\def\PersianAlphs{%
   \let\@alph\abjadnumeral%
   \let\@Alph\abjadnumeral}
\def\LatinAlphs{%
   \let\@alph\@latinalph%
   \let\@Alph\@latinAlph}
\PersianAlphs
\makeatother

%%
\setlength\intextsep{2\baselineskip plus 2mm minus 1mm}
\setlength\textfloatsep{3\baselineskip plus 2mm minus 1mm}
\setlength\floatsep{3\baselineskip}
\setlength{\tabcolsep}{1.5mm}
\renewcommand{\arraystretch}{1.5}
\DeclareCaptionFont{MyFont}{\fontsize{11pt}{0}\selectfont \BZarScaleOne} % Zar 11
\DeclareCaptionLabelSeparator{MySeparator}{\,-\,}
\captionsetup{margin=5mm, font=MyFont, labelsep=MySeparator}

\captionsetup[figure]{aboveskip=2mm}
\captionsetup[figure]{belowskip=-\baselineskip}
\captionsetup[table]{aboveskip=2mm}
\captionsetup[table]{belowskip=\baselineskip}

%%
\setmathfont[version=lm]{Latin Modern Math}
\mathversion{lm}
\DeclareMathSizes{10}{12}{10}{8} % Font 12
\DefaultMathsDigits
\setlength{\mathindent}{0.5cm}

\AtBeginDocument{
\abovedisplayskip=\baselineskip
\belowdisplayskip=\baselineskip
\abovedisplayshortskip=\baselineskip
\belowdisplayshortskip=\baselineskip
}

\setlength\mathsurround{1pt}
\delimitershortfall=-3pt

%%
\geometry{top=3cm, bottom=2.5cm, left=2.5cm, right=3cm, headsep=1cm}

%%
\definecolor{darkblue}{rgb}{0,0,0.5}
\definecolor{darkred}{rgb}{0.5,0,0}
\hypersetup{colorlinks=true, linkcolor=darkblue, citecolor=darkred, urlcolor=darkblue, bookmarks, bookmarksdepth=3}

%%
\SepMark{-}

%%
\renewcommand*{\citedash}{-}

\makeatletter
\def\@cite#1#2{[{#1\if@tempswa ,~#2\fi}]}
\makeatother

%%
\setlength{\parindent}{5mm}

%%
\newtheoremstyle{mystyle}%
  {}%                                     
  {}%                                    
  {\itshape}%                             
  {}%                                     
  {\fontsize{12pt}{0}\selectfont \bfseries \BZarScaleOne} 
  {.}%                                    
  { }%                                    
  {}%

\theoremstyle{mystyle}
\newtheorem{theorem}{قضیه}[chapter]
\renewcommand\qedsymbol{$\blacksquare$}
\newtheorem{remark}{تبصره}[chapter]
\newtheorem{reminder}{یادآوری}[chapter]

%%
\titleformat{\chapter}[display]
{\fontsize{13pt}{0}\selectfont  \flushleft  \bfseries \BZarScaleOne} % Zar 13
{\chaptertitlename\ \tartibi{chapter}}{0.3cm}{\fontsize{13pt}{0}\selectfont \BZarScaleOne} % Zar 13

\sectionfont{\fontsize{12pt}{\baselineskip}\selectfont \BZarScaleOne} % Zar 12
\subsectionfont{\fontsize{11pt}{\baselineskip}\selectfont \BZarScaleOne} % Zar 11
\subsubsectionfont{\fontsize{11pt}{\baselineskip}\selectfont \BZarScaleOne} % Zar 11

\titlespacing*{\chapter}{0pt}{2.5cm}{8cm}
\titlespacing*{\section}{0pt}{1.2\baselineskip}{0pt}
\titlespacing*{\subsection}{0pt}{1.1\baselineskip}{0pt}
\titlespacing*{\subsubsection}{0pt}{1\baselineskip}{0pt}

\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
	\thispagestyle{empty}%
	\global\@topnum\z@
	\@afterindentfalse
	\secdef\@chapter\@schapter}
\makeatother

\setcounter{secnumdepth}{3}

%%
\setlist[enumerate]{noitemsep, topsep=0pt}
\setlist[itemize]{noitemsep, topsep=0pt}
\setlist[description]{noitemsep, topsep=0pt}

%%
\zmakeperpage{footnote}
\setlength{\footnotesep}{0.4cm}
\renewcommand{\footnotesize}{\fontsize{8pt}{0}\selectfont} 
\renewcommand{\thefootnote}{\fontsize{6.5pt}{0}\selectfont\arabic{footnote}}
\setlength{\footnotemargin}{0.2cm}

%%
\setcounter{tocdepth}{2}
\setlength{\cftbeforetoctitleskip}{0cm}
\setlength{\cftbeforeloftitleskip}{0cm}
\setlength{\cftbeforelottitleskip}{0cm}

\setlength{\cftaftertoctitleskip}{1cm}
\setlength{\cftafterloftitleskip}{1cm}
\setlength{\cftafterlottitleskip}{1cm}

\renewcommand{\cfttoctitlefont}{\hspace{6.5cm} \fontsize{12pt}{0}\selectfont \bfseries \BZarScaleOne} % Zar 12
\renewcommand{\cftloftitlefont}{\hspace{6.5cm} \fontsize{12pt}{0}\selectfont \bfseries \BZarScaleOne} % Zar 12
\renewcommand{\cftlottitlefont}{\hspace{6.5cm} \fontsize{12pt}{0}\selectfont \bfseries \BZarScaleOne} % Zar 12

\renewcommand{\listfigurename}{فهرست اشکال}

\renewcommand{\cftfigpresnum}{شکل }
\renewcommand{\cftfigaftersnum}{:}

\renewcommand{\cfttabpresnum}{جدول }
\renewcommand{\cfttabaftersnum}{:}

\renewcommand{\cftchapfont}{\bfseries \fontsize{10pt}{0}\selectfont \BZarScaleOne} % Zar 10
\renewcommand{\cftsecfont}{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand{\cftsubsecfont}{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand{\cftsubsubsecfont}{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand{\cftfigfont}{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand{\cfttabfont}{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12

\renewcommand\cftchappagefont{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand\cftsecpagefont{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand\cftsubsecpagefont{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand\cftsubsubsecpagefont{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand\cftfigpagefont{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12
\renewcommand\cfttabpagefont{\fontsize{12pt}{0}\selectfont \BZarScaleOne} % Zar 12

\renewcommand\cftchapafterpnum{\vspace{0cm}}
\renewcommand\cftsecafterpnum{\vspace{0cm}}
\renewcommand\cftsubsecafterpnum{\vspace{0cm}}
\renewcommand\cftsubsubsecafterpnum{\vspace{0cm}}

\renewcommand{\cftdotsep}{0.2}

\setlength\cftchapindent{0cm}
\setlength\cftsecindent{0cm}
\setlength\cftsubsecindent{0.35cm}
\setlength\cftsubsubsecindent{0cm}
\setlength\cftfigindent{0cm}
\setlength\cfttabindent{0cm}

\makeatletter
\renewcommand{\numberline}[1]{%
  \@cftbsnum #1\@cftasnum\hspace*{2mm}\@cftasnumb%
}
\makeatother

\addtocontents{toc}{~\underline{\textbf{\fontsize{10pt}{0}\selectfont {\BZarScaleOne عنــوان}}}\hfill\underline{\textbf{\fontsize{10pt}{0}\selectfont {\BZarScaleOne صفحه}}}\vspace{0.2cm}\protect\par} % Zar 10

\addtocontents{lof}{~\underline{\textbf{\fontsize{10pt}{0}\selectfont {\BZarScaleOne عنــوان}}}\hfill\underline{\textbf{\fontsize{10pt}{0}\selectfont {\BZarScaleOne صفحه}}}\vspace{-0.1cm}\protect\par} % Zar 10

\addtocontents{lot}{~\underline{\textbf{\fontsize{10pt}{0}\selectfont {\BZarScaleOne عنــوان}}}\hfill\underline{\textbf{\fontsize{10pt}{0}\selectfont {\BZarScaleOne صفحه}}}\vspace{-0.1cm}\protect\par} % Zar 10

\renewcommand\cftchapaftersnum{:}
\makeatletter
\bidi@patchcmd{\Hy@org@chapter}{%
	\addcontentsline{toc}{chapter}%
	{\protect\numberline{\thechapter}#1}%
}{%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\chaptername~\tartibi{chapter}}#1}%
}{}{}
\makeatother

%%
\makeatletter

\def\DepartmentFa#1{\gdef\@DepartmentFa{#1}}
\def\@DepartmentFa{}

\def\TitleFa#1{\gdef\@TitleFa{#1}}
\def\@TitleFa{}

\def\ThesisTypeFa#1{\gdef\@ThesisTypeFa{#1}}
\def\@ThesisTypeFa{}

\def\DegreeFa#1{\gdef\@DegreeFa{#1}}
\def\@DegreeFa{}

\def\FieldFa#1{\gdef\@FieldFa{#1}}
\def\@FieldFa{}

\def\YourFullnameFa#1{\gdef\@YourFullnameFa{#1}}
\def\@YourFullnameFa{}

\def\YourEmailAddress#1{\gdef\@YourEmailAddress{#1}}
\def\@YourEmailAddress{}

\def\FirstSupervisorFa#1{\gdef\@FirstSupervisorFa{#1}}
\def\@FirstSupervisorFa{}

\def\SecondSupervisorFa#1{\gdef\ST@SecondSupervisorFa{#1}}
\def\@SecondSupervisorFa{}

\def\FirstAdvisorFa#1{\gdef\@FirstAdvisorFa{#1}}
\def\@FirstAdvisorFa{}

\def\SecondAdvisorFa#1{\gdef\ST@SecondAdvisorFa{#1}}
\def\@SecondAdvisorFa{}

\def\FirstExaminerFa#1{\gdef\ST@FirstExaminerFa{#1}}
\def\@FirstExaminerFa{}

\def\SecondExaminerFa#1{\gdef\ST@SecondExaminerFa{#1}}
\def\@SecondExaminerFa{}

\def\ThirdExaminerFa#1{\gdef\ST@ThirdExaminerFa{#1}}
\def\@ThirdExaminerFa{}

\def\FourthExaminerFa#1{\gdef\ST@FourthExaminerFa{#1}}
\def\@FourthExaminerFa{}

\def\FifthExaminerFa#1{\gdef\ST@FifthExaminerFa{#1}}
\def\@FifthExaminerFa{}

\def\DeanOfDepartmentFa#1{\gdef\@DeanOfDepartmentFa{#1}}
\def\@DeanOfDepartmentFa{}

\def\YearFa#1{\gdef\@YearFa{#1}}
\def\@YearFa{}

\def\DateFa#1{\gdef\@DateFa{#1}}
\def\@DateFa{}

\def\Prefix#1{\gdef\@Prefix{#1}}
\def\@Prefix{}

\def\DepartmentEn#1{\gdef\@DepartmentEn{#1}}
\def\@DepartmentEn{}

\def\TitleEn#1{\gdef\@TitleEn{#1}}
\def\@TitleEn{}

\def\DegreeEn#1{\gdef\@DegreeEn{#1}}
\def\@DegreeEn{}

\def\YourFullnameEn#1{\gdef\@YourFullnameEn{#1}}
\def\@YourFullnameEn{}

\def\DateEn#1{\gdef\@DateEn{#1}}
\def\@DateEn{}

\def\FirstSupervisorEn#1{\gdef\@FirstSupervisorEn{#1}}
\def\@FirstSupervisorEn{}

\def\SecondSupervisorEn#1{\gdef\ST@SecondSupervisorEn{#1}}
\def\@SecondSupervisorEn{}

\def\FirstAdvisorEn#1{\gdef\@FirstAdvisorEn{#1}}
\def\@FirstAdvisorEn{}

\def\SecondAdvisorEn#1{\gdef\ST@SecondAdvisorEn{#1}}
\def\@SecondAdvisorEn{}

\def\FirstExaminerEn#1{\gdef\ST@FirstExaminerEn{#1}}
\def\@FirstExaminerEn{}

\def\SecondExaminerEn#1{\gdef\ST@SecondExaminerEn{#1}}
\def\@SecondExaminerEn{}

\def\ThirdExaminerEn#1{\gdef\ST@ThirdExaminerEn{#1}}
\def\@ThirdExaminerEn{}

\def\FourthExaminerEn#1{\gdef\ST@FourthExaminerEn{#1}}
\def\@FourthExaminerEn{}

\def\FifthExaminerEn#1{\gdef\ST@FifthExaminerEn{#1}}
\def\@FifthExaminerEn{}

\def\DeanOfDepartmentEn#1{\gdef\@DeanOfDepartmentEn{#1}}
\def\@DeanOfDepartmentEn{}

\def\FirstSupervisorEmailAddress#1{\gdef\@FirstSupervisorEmailAddress{#1}}
\def\@FirstSupervisorEmailAddress{}

\def\SecondSupervisorEmailAddress#1{\gdef\@SecondSupervisorEmailAddress{#1}}
\def\@SecondSupervisorEmailAddress{}

\makeatother

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Title Page ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\makeatletter
\newcommand{\MakeTitlePage}{
\clearpage
\thispagestyle{empty}
\newgeometry{left=3cm, right=3cm, top=2cm, bottom=2.5cm}
{\BZarScaleOne
\begin{center}
\includegraphics[scale=0.05]{Settings/IUT_Logo.pdf}
\\
{\fontsize{10pt}{0}\selectfont % Zar 10
\textbf{
دانشگاه صنعتی اصفهان
}}\\[0.35cm]
{\fontsize{14pt}{0}\selectfont \@DepartmentFa}\\ % Zar 14
\vspace*{\fill}
{\fontsize{16pt}{0}\selectfont \textbf{\@TitleFa}}\\ % Zar 16
\vspace*{\fill}
{\fontsize{16pt}{0}\selectfont \@ThesisTypeFa~\@DegreeFa~\@FieldFa}\\[1.5cm] % Zar 16
{\fontsize{12pt}{0}\selectfont \textbf{\@YourFullnameFa}}\\ % Zar 12
\vspace*{\fill}
\ifx\ST@SecondSupervisorFa\undefined
{\fontsize{14pt}{0}\selectfont
استاد راهنما
} \else {\fontsize{14pt}{0}\selectfont
استادهای راهنما
}\fi \\[0.4cm] % Zar 14
\ifx\ST@SecondSupervisorFa\undefined
{\fontsize{12pt}{0}\selectfont \textbf{\@FirstSupervisorFa}}
\else {\fontsize{12pt}{0}\selectfont \textbf{\@FirstSupervisorFa~~و~~\ST@SecondSupervisorFa}} \fi \\% Zar 12
\vspace*{\fill}
{\fontsize{10pt}{0pt}\selectfont \textbf{\@YearFa}} % Zar 10
\end{center}
}
\restoregeometry
}
\makeatother

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Signature Page - Farsi ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcounter{RowNoFa}
\newcommand\RowNumberFa{\stepcounter{RowNoFa}\arabic{RowNoFa}}

\makeatletter
\newcommand{\MakeFarsiSignaturePage}{
\clearpage
\thispagestyle{empty}
\newgeometry{left=3cm, right=3cm, top=2cm, bottom=2.5cm}
{\BZarScaleOne
\begin{center}
\includegraphics[scale=0.05]{Settings/IUT_Logo.pdf}
\\
{\fontsize{10pt}{0}\selectfont % Zar 10
\textbf{
دانشگاه صنعتی اصفهان
}}\\[0.35cm]
{\fontsize{14pt}{0}\selectfont \@DepartmentFa}\\ % Zar 14
\vspace*{\fill}
{\fontsize{16pt}{0}\selectfont \@ThesisTypeFa~\@DegreeFa~رشته~\@FieldFa~\@Prefix~\@YourFullnameFa
\\[0.5cm] 
تحت عنوان
}\\ % Zar 16
\vspace*{\fill}
{\fontsize{14pt}{0}\selectfont \textbf{\@TitleFa}} % Zar 14
\vspace*{\fill}
\end{center}
{\fontsize{13pt}{0}\selectfont % Zar 13
در تاریخ
~\@DateFa~
توسط کمیته تخصصی زیر مورد بررسی و تصویب نهایی قرار گرفت:‎\\
\vspace{0.5cm}

\noindent
\begin{tabular}{rrr}
\RowNumberFa - &
استاد راهنمای \@ThesisTypeFa &
\hspace{2cm}\@FirstSupervisorFa\\[0.7cm]
\ifx\ST@SecondSupervisorFa\undefined \else
\RowNumberFa - &
استاد راهنمای \@ThesisTypeFa &
\hspace{2cm}\ST@SecondSupervisorFa\\[0.7cm]\fi
\RowNumberFa - &
استاد مشاور \@ThesisTypeFa &
\hspace{2cm}\@FirstAdvisorFa\\[0.7cm]
\ifx\ST@SecondAdvisorFa\undefined \else
\RowNumberFa - &
استاد مشاور \@ThesisTypeFa &
\hspace{2cm}\ST@SecondAdvisorFa\\[0.7cm]\fi
\ifx\ST@FirstExaminerFa\undefined \else
\RowNumberFa - &
استاد داور &
\hspace{2cm}\ST@FirstExaminerFa\\[0.7cm]\fi
\ifx\ST@SecondExaminerFa\undefined \else
\RowNumberFa - &
استاد داور &
\hspace{2cm}\ST@SecondExaminerFa\\[0.7cm]\fi
\ifx\ST@ThirdExaminerFa\undefined \else
\RowNumberFa - &
استاد داور &
\hspace{2cm}\ST@ThirdExaminerFa\\[0.7cm]\fi
\ifx\ST@FourthExaminerFa\undefined \else
\RowNumberFa - &
استاد داور &
\hspace{2cm}\ST@FourthExaminerFa\\[0.7cm]\fi
\ifx\ST@FifthExaminerFa\undefined \else
\RowNumberFa - &
استاد داور &
\hspace{2cm}\ST@FifthExaminerFa\\[0.7cm]\fi
\multicolumn{2}{r}{سرپرست تحصیلات تکمیلی دانشکده} &
\hspace{2cm}\@DeanOfDepartmentFa
\end{tabular}
}}
\restoregeometry
}
\makeatother

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ CopyRight Page ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcommand{\MakeCopyRightPage}{
\clearpage
\thispagestyle{empty}
\vspace*{\fill}
\hspace*{\fill}
\begin{minipage}{9cm}
{\BZarScaleOne
{\fontsize{14pt}{0.9cm}\selectfont  % Zar 14
\noindent
{\bfseries
کليه‌ی حقوق مادی مترتب بر نتايج مطالعات، ابتکارات و نوآوری‌های ناشی از تحقيق موضوع اين پايان‌نامه (رساله) متعلق به دانشگاه صنعتی اصفهان است.

}}}
\end{minipage}
\hspace*{\fill}
\vspace*{\fill}
}

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Table of Contents ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcommand{\MakeTableOfContents}{
\clearpage
\newgeometry{top=3cm, left=2.5cm, right=3cm, bottom=3cm, footskip=2cm}
\baselineskip=0.6cm
\phantomsection
\addcontentsline{toc}{section}{فهرست مطالب}‎
\tableofcontents
\restoregeometry
}

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ List of Figures ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcommand{\MakeListOfFigures}{
\clearpage
\newgeometry{top=3cm, left=2.5cm, right=3cm, bottom=3cm, footskip=2cm}
\baselineskip=0.6cm
\phantomsection
\addcontentsline{toc}{section}{فهرست اشکال}‎
\listoffigures
\restoregeometry
}

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ List of Tables ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcommand{\MakeListOfTables}{
\clearpage
\newgeometry{top=3cm, left=2.5cm, right=3cm, bottom=3cm, footskip=2cm}
\baselineskip=0.6cm
\phantomsection
\addcontentsline{toc}{section}{فهرست جداول}‎
\listoftables
\restoregeometry
}

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Farsi Abstract Page ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\makeatletter
\def\AbstractFa#1{\gdef\@AbstractFa{#1}}
\def\@AbstractFa{}

\def\KeywordsFa#1{\gdef\@KeywordsFa{#1}}
\def\@KeywordsFa{}
\makeatother

\makeatletter
\newcommand{\MakeFarsiAbstract}{
\clearpage
\thispagestyle{empty}
\phantomsection
\vspace*{\fill}
\addcontentsline{toc}{section}{چکیده}‎
\baselineskip=0.7cm
{\BZarScaleOne
{\fontsize{11pt}{0}\selectfont \par\noindent \textbf{چکیده}\\ \@AbstractFa \\ \textbf{کلمات کلیدی}\\ \@KeywordsFa} % Zar 11
}
}
\makeatother

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ English Abstract Page ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\makeatletter
\def\AbstractEn#1{\gdef\@AbstractEn{#1}}
\def\@AbstractEn{}

\def\KeywordsEn#1{\gdef\@KeywordsEn{#1}}
\def\@KeywordsEn{}
\makeatother

\makeatletter
\newcommand{\MakeEnglishAbstract}{
\clearpage
\thispagestyle{empty}
\begin{latin}
\baselineskip=0.6cm
{\TimesNewRomanScaleOne
\begin{center}
{\fontsize{14pt}{0}\selectfont \textbf{\@TitleEn}}\\ % TNR 14
\vspace{1.5cm}
{\fontsize{14pt}{0}\selectfont \@YourFullnameEn}\\ % TNR 14
{\fontsize{11pt}{0}\selectfont \@YourEmailAddress}\\ % TNR 11
\vspace{0.6cm}
{\fontsize{12pt}{0}\selectfont \@DateEn} \\ % TNR 12
{\fontsize{12pt}{0}\selectfont \@DepartmentEn}\\ % TNR 12
{\fontsize{12pt}{0}\selectfont Isfahan University of Technology, Isfahan 84156-83111, Iran}\\ % TNR 12
{\fontsize{12pt}{0}\selectfont Degree: \@DegreeEn \hfill Language: Farsi}\\ % TNR 12
\end{center}
{\fontsize{11pt}{0}\selectfont \noindent
\ifx\ST@SecondSupervisorEn\undefined \textbf{Supervisor:~\@FirstSupervisorEn,~\@FirstSupervisorEmailAddress.} \else
\textbf{
\begin{tabular}{@{}ll}
Supervisors:&\@FirstSupervisorEn,~\@FirstSupervisorEmailAddress.\\[0.2cm]
&\ST@SecondSupervisorEn,~\@SecondSupervisorEmailAddress.
\end{tabular}
}\fi }\\ % TNR 11
\vspace*{\fill}
}

\baselineskip=0.5cm
{\TimesNewRomanScaleOne
{\fontsize{10pt}{0}\selectfont \par\noindent \textbf{Abstract}\\ \@AbstractEn \\ \textbf{Keywords}\\ \@KeywordsEn} % TNR 10
}
\end{latin}
}
\makeatother

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Signature Page - English ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcounter{RowNoEn}
\newcommand\RowNumberEn{\stepcounter{RowNoEn}\arabic{RowNoEn}}

\makeatletter
\newcommand{\MakeEnglishSignaturePage}{
\clearpage
\thispagestyle{empty}
\newgeometry{left=3cm, right=3cm, top=2cm, bottom=2.5cm}
\begin{latin}
{\TimesNewRomanScaleOne
\begin{center}
\includegraphics[scale=0.05]{Settings/IUT_Logo.pdf}
\\
{\fontsize{14pt}{0}\selectfont \textbf{Isfahan University of Technology}}\\[0.2cm] % TNR 14
{\fontsize{12pt}{0}\selectfont \@DepartmentEn}\\ % TNR 12
\vspace*{\fill}
{\fontsize{16pt}{0}\selectfont \textbf{\@TitleEn}}\\ % TNR 16
\vspace*{\fill}
{\fontsize{12pt}{0}\selectfont A Thesis}\\[0.1cm] % TNR 12
{\fontsize{12pt}{0}\selectfont Submitted in partial fulfillment of the requirements}\\[0.1cm] % TNR 12
{\fontsize{12pt}{0}\selectfont for the degree of \@DegreeEn}\\ % TNR 12
\vspace*{\fill}
{\fontsize{12pt}{0}\selectfont \textbf{By\\[0.25cm] \@YourFullnameEn}} % TNR 12
\end{center}
\vspace*{\fill}
{\fontsize{12pt}{0}\selectfont Evaluated and Approved by the Thesis Committee, on \@DateEn \\ % TNR 12
\vspace{0.6cm}

\noindent
\begin{tabular}{ll}
\RowNumberEn - &  \@FirstSupervisorEn~(Supervisor)\\[0.6cm]
\ifx\ST@SecondSupervisorEn\undefined \else
\RowNumberEn - &  \ST@SecondSupervisorEn~(Supervisor)\\[0.6cm]\fi
\RowNumberEn - &  \@FirstAdvisorEn~(Advisor)\\[0.6cm]
\ifx\ST@SecondAdvisorEn\undefined \else
\RowNumberEn - &  \ST@SecondAdvisorEn~(Advisor)\\[0.6cm]\fi
\ifx\ST@FirstExaminerEn\undefined \else
\RowNumberEn - &  \ST@FirstExaminerEn~(Examiner)\\[0.6cm]\fi
\ifx\ST@SecondExaminerEn\undefined \else
\RowNumberEn - &  \ST@SecondExaminerEn~(Examiner)\\[0.6cm]\fi
\ifx\ST@ThirdExaminerEn\undefined \else
\RowNumberEn - &  \ST@ThirdExaminerEn~(Examiner)\\[0.6cm]\fi
\ifx\ST@FourthExaminerEn\undefined \else
\RowNumberEn - &  \ST@FourthExaminerEn~(Examiner)\\[0.6cm]\fi
\ifx\ST@FifthExaminerEn\undefined \else
\RowNumberEn - &  \ST@FifthExaminerEn~(Examiner)\\[0.6cm]\fi
\multicolumn{2}{l}{Department Graduate Coordinator:~\@DeanOfDepartmentEn}
\end{tabular}
}}
\end{latin}
\restoregeometry
}
\makeatother

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ Appendices ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcommand{\MakeAppendices}{
\clearpage

\appendix

\setcounter{chapter}{3}
\setcounter{table}{0}
\setcounter{figure}{0}
\setcounter{equation}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{reminder}{0}

\phantomsection

\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
\chapter*{پیوست‌ها}
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}

\addcontentsline{toc}{chapter}{پیوست‌ها}‎
}

% ░░░░░░░▒▒▒▒▒▒▓▓▓▓ References ▓▓▓▓▒▒▒▒▒▒░░░░░░░
\newcommand{\MakeReferences}{
\clearpage
\titlespacing*{\chapter}{0pt}{-\baselineskip}{0.5cm}
\fontsize{11pt}{14.4}\selectfont
\renewcommand{\bibname}{{مراجع}\hfill}
}
