%%
%%  This is file `MsThesis.cls',
%%  This file, with few changes, is adapted from the original files
%%  `xepersian-thesis.cls` by Vafa Khalighi and `VThesis.cls` by Vahid  DamanAfshan.
%%  It has recently been modified by Kambiz  Ahmadi.
%%  It is designed  for School of Mathematical Sciences and Statistics, University of Birjand.
%%  Copyright © 2011-2012 Vahid Damanafshan
%%  http://damanafshan.tk      
%%  http://forum.parsilatex.com
%% 
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{MsThesis}
              [2/1/2011 v0.3
 Persian thesis document class in XeLaTeX for University of Birjand theses/dissertations]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions
\LoadClass{book}
\def\university#1{\gdef\@university{#1}}
\def\department#1{\gdef\@department{#1}}
\def\degree#1{\gdef\@degree{#1}}
\def\thesisdate#1{\gdef\@thesisdate{#1}}
\newcommand{\firstsupervisor}[1]{\def\@firstsupervisor{#1}}
\newcommand{\secondsupervisor}[1]{\def\@secondsupervisor{#1}}
\newcommand{\firstadvisor}[1]{\def\@firstadvisor{#1}}
\newcommand{\secondadvisor}[1]{\def\@secondadvisor{#1}}
\def\name#1{\gdef\@name{#1}}
\def\surname#1{\gdef\@surname{#1}}
\def\keywords#1{\gdef\@keywords{#1}}
\def\fa-abstract#1{\gdef\@fa-abstract{#1}}
\def\faculty#1{\gdef\@faculty{#1}}
\def\subject#1{\gdef\@subject{#1}}
\def\field#1{\gdef\@field{#1}}
\def\department#1{\gdef\@department{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\latintitle#1{\gdef\@latintitle{#1}}
\def\latinauthor#1{\gdef\@latinauthor{#1}}
\def\latindegree#1{\gdef\@latindegree{#1}}
\def\latinfaculty#1{\gdef\@latinfaculty{#1}}
\def\latinthesisdate#1{\gdef\@latinthesisdate{#1}}
\def\latinsubject#1{\gdef\@latinsubject{#1}}
\def\latinfield#1{\gdef\@latinfield{#1}}
\def\firstlatinsupervisor#1{\gdef\@firstlatinsupervisor{#1}}
\def\secondlatinsupervisor#1{\gdef\@secondlatinsupervisor{#1}}
\def\firstlatinadvisor#1{\gdef\@firstlatinadvisor{#1}}
\def\secondlatinadvisor#1{\gdef\@secondlatinadvisor{#1}}
\def\latinname#1{\gdef\@latinname{#1}}
\def\latinsurname#1{\gdef\@latinsurname{#1}}
\def\en-abstract#1{\gdef\@en-abstract{#1}}
\def\latinkeywords#1{\gdef\@latinkeywords{#1}}
\def\latinuniversity#1{\gdef\@latinuniversity{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\if@mscthesis
\@mscthesisfalse
\DeclareOption{msc}{\@mscthesistrue}
\ProcessOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\if@mscthesis
\newcommand{\TY}{پایان‌نامه}
\else
\newcommand{\TY}{رساله}\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\newcommand{\vtitle}{\begin{titlepage}
%\topmargin=30pt
\vspace{-1.5cm}\centerline{{\includegraphics[height=4.7cm]{logo1}}}
{\large\@faculty\par
\vskip 0.8cm \@department}
\vskip 1.5cm
\centerline{\Large \bfseries}
 {\Huge\bfseries {\titr\baselineskip=1cm \@title}}\baselineskip=1.5cm\par
\vskip 2cm
 \baselineskip=.5cm
  \if@mscthesis
{\large\bfseries پایان‌نامه}
\else
{\large\bfseries رساله}
\fi
%\vskip .3cm
{\large\bfseries%\writtenfor
 \if@mscthesis
برای دریافت درجه کارشناسی ارشد
\else
برای دریافت درجه دکتری
\fi
}
\vskip 0.7cm
{\large\bfseries{در رشته}
 \bfseries\@subject%
%، گرایش
%\@field
}
\vskip 2.25cm
\par
{\Large\bfseries{\Large\bfseries   \@name\ \ \@surname}} 
 \vskip 1.75cm
 
\large
{\ifx\@firstsupervisor\undefined%
\ifx\@secondsupervisor\undefined%
\else\fi
\else
\ifx\@secondsupervisor\undefined%
استاد راهنما:
{\Large\bfseries\par\vskip .7cm
\@firstsupervisor}
\else
\large
استادان راهنما:
\par\vskip .7cm
{\Large\bfseries \@firstsupervisor{} \\[.3cm]\ \@secondsupervisor}
\fi\fi}
 \vskip 1.3cm
\par\large
{\ifx\@firstadvisor\undefined%
\ifx\@secondadvisor\undefined%
\else\fi
\else
\ifx\@secondadvisor\undefined
استاد مشاور:
{\Large\bfseries\par\vskip .7cm
\@firstadvisor}
\else

\large
استادان مشاور:
\par\vskip .7cm
{\Large\bfseries
\@firstadvisor{}\\[.3cm]\ \@secondadvisor}
\fi\fi}

\par
\vskip 20mm
%\vfill
{\large \@thesisdate}
%\vfill
\end{titlepage}%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\pagenumbering{harfi}
\thispagestyle{empty}
 \if@mscthesis
\includepdf{gmsc}
\else
\includepdf{gphd}\fi
\newpage
\includepdf{malekiat}
\newpage
\include{SET}%%%%% متن سپاس از خدا%%%%%%%
\newpage
\include{acknow}
\def\signature{\vspace{1cm}
\begin{flushleft}
{\nastaliq \scriptsize \@name\ \@surname \\
\@thesisdate}
\end{flushleft}}
\newpage
\include{SEP}
\newpage
\thispagestyle{plain}
\baselineskip=.7cm
\textbf{\Large{چکیده}}\par
\@fa-abstract
\\

{\bf \large
واژه‌های کلیدی:}
\@keywords
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\frame{\newpage
\thispagestyle{empty}
\begin{framed}\thispagestyle{empty}}
\def\endframe{\thispagestyle{empty}\end{framed}
\thispagestyle{empty}
\newpage
}
\def\abstractpage{\newpage
\thispagestyle{empty}
\vskip 15mm
\par
\begin{abstract}}
\def\endabstractpage{\end{abstract}
\newpage
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\latinabstract{\newpage
\thispagestyle{empty}
\vskip 15mm
\begin{center}{\Large\bfseries \@latintitle \\[5mm]}
{\bfseries Abstract}
\end{center}
\vspace{5mm}}
\def\endlatinabstract{\newpage}
\def\acknowledgementpage{\newpage
\thispagestyle{empty}
\vspace{1cm}
\par\noindent}
\def\endacknowledgementpage{\newpage}
\def\titlepage{\newpage\centering
  \thispagestyle{empty}
  \parindent 0pt \parskip 10pt plus 1fil minus 1fil
  \def\baselinestretch{1}\@normalsize\vbox to \vsize\bgroup\vbox to 9in\bgroup}
\def\endtitlepage{\par\kern 0pt\egroup\vss\egroup\newpage}

\def\abstract{\subsection*{\abstractname}\small
\@normalsize}
\def\endabstract{\par}

\font\titlefont=cmssbx10 scaled 2074
\font\supervisorfont=cmbxti10
 
 \newcommand{\latinvtitle}{%
\textbf{Abstract}\par
\@en-abstract
\\\vspace{0.2cm}


 {\bf{Keywords}:}
\@latinkeywords
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{titlepage}
\vspace{-1.5cm}{\includegraphics[height=4.7cm]{logo2}}
\centerline{\large\bfseries \@latinuniversity} 
\large\bfseries
\@latinfaculty\space 
\vskip 1.5cm
\baselineskip=.750cm
{\Huge \Time \@latintitle}
\baselineskip=.750cm \par
%\addtolength{\baselineskip}{-5mm}
\vskip 1.3cm
%{
 \if@mscthesis
A Thesis Submitted in Partial Fulfillment of
\\[.1cm]
 the Requirement  for the Degree of Master 
 \par \vskip 0.25cm
 of Science  in %\par \vskip 0.25cm
\else
A Thesis Submitted in Partial Fulfillment of 
\\[.1cm]
the Requirement for the Degree  of Doctor\par \vskip 0.25cm
 of Philosophy in \fi 
 {\large\bfseries \@latinsubject
 %, \@latinfield
 }
\vskip 1.2cm

{\bfseries }\par
{\Large %\supervisorfont
\rm\@latinname \; \@latinsurname}\par
\vskip 2cm
\large
{\ifx\@firstlatinsupervisor\undefined%
\ifx\@secondlatinsupervisor\undefined%
\else\fi
\else
\ifx\@secondlatinsupervisor\undefined%
Supervisor:\vskip 0.4cm
{\Large\bfseries\par
\@firstlatinsupervisor}
\else
\large
Supervisors:\vskip 0.4cm
\par
{\Large\bfseries \@firstlatinsupervisor{}\\[.3cm]\ \@secondlatinsupervisor}
\fi\fi}
\par
\vskip 1cm
\large
{\ifx\@firstlatinadvisor\undefined%
\ifx\@secondlatinadvisor\undefined%
\else\fi
\else
\ifx\@secondlatinadvisor\undefined%
Advisor:\vskip 0.4cm
{\Large\bfseries\par
\@firstlatinadvisor}
\else
\large
Advisors:\vskip 0.4cm
\par
{\Large\bfseries\@firstlatinadvisor{} \\[.3cm]\  \@secondlatinadvisor}
\fi\fi}
\par
\vskip 20mm

{\@latinthesisdate}
\par
\vfill
%
\end{titlepage}
}

\def\onvan{عنوان}
\def\eonvan{Title}


%% 
%% Copyright © 2011-2012      by Vahid Damanafshan     
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by Vahid Damanafshan.
%% Special thanks to Vafa Khalighi for his valuable hints.
%%
%% End of file `VThesis.cls'.
