%%
%% This is file `diyanat-style.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xepersian.dtx  
%%  modify the vahid-thesis.cls
%%   __________________________________
%%   Copyright © 2008-2009 Vafa Khalighi
%%  
%%   Edited by Vahid Damanafshan    <vdamanafshan@yahoo.com>
%%  
%%   License information appended.
%% 
%% 

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{diyanat-style}[2009/02/09 v0.1  Persian thesis document class in XeLaTeX]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions
\LoadClass{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%بسته های مورد استفاده

% در ورژن جدید زی‌پرشین برای تایپ متن‌های ریاضی، این سه بسته، حتماً باید فراخوانی شود
\usepackage{amsthm,amssymb,amsmath}
% بسته‌ای برای تنطیم حاشیه‌های بالا، پایین، چپ و راست صفحه
\usepackage[top=35mm, bottom=30mm, left=25mm, right=25mm]{geometry}
% بسته‌‌ای برای ظاهر شدن شکل‌ها و تصاویر متن
\usepackage{color,graphicx}
% بسته‌‌ای برای چاپ شدن خودکار تعداد صفحات در صفحه «معرفی پایان‌نامه»
%\usepackage{lastpage}
% بسته‌‌ای برای ایجاد دیاگرام‌های مختلف
%\usepackage[all]{xy}
% بسته‌ و دستوراتی برای ایجاد لینک‌های رنگی با امکان جهش
%\usepackage[pdftex]{hyperref}
\usepackage[pagebackref=true,colorlinks,linkcolor=blue,citecolor=magenta]{hyperref}
% چنانچه قصد پرینت گرفتن نوشته خود را دارید، خط بالا را غیرفعال و  از دستور زیر استفاده کنید چون در صورت استفاده از دستور زیر‌‌، لینک‌ها به رنگ سیاه ظاهر خواهند شد که برای پرینت گرفتن، مناسب‌تر است
%\usepackage[pagebackref=false]{hyperref}
% بسته‌ای برای ایجاد جعبه و کادر
\usepackage{fancybox}
% بسته‌ لازم برای تنظیم سربرگ‌ها
\usepackage{fancyhdr}
% بسته‌ای برای ظاهر شدن «مراجع» و «نمایه» در فهرست مطالب
\usepackage{tocbibind}
\usepackage{pifont}

\usepackage{xcolor}
% دستورات مربوط به ایجاد نمایه
\usepackage{makeidx}
%\usepackage{natbib}
\usepackage{xepersian}
%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\university#1{\gdef\@university{#1}}
\def\department#1{\gdef\@department{#1}}
\def\degree#1{\gdef\@degree{#1}}
\def\thesisdate#1{\gdef\@thesisdate{#1}}
\def\supervisor#1{\gdef\@supervisor{#1}}
\def\advisor#1{\gdef\@advisor{#1}}
\def\tit#1{\gdef\@tit{#1}}
\def\type#1{\gdef\@type{#1}}
\def\city#1{\gdef\@city{#1}}
\def\faculty#1{\gdef\@faculty{#1}}
\def\subject#1{\gdef\@subject{#1}}
\def\field#1{\gdef\@field{#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%ساخت نمایه و تنظیمات فایل پی دی اف و رنگ ارجاعات
\makeindex

\hypersetup{
pdfstartview=FitH,
pagebackref=true,
hyperfigures=true,
colorlinks=true,
backref=true,
pagebackref=true,
linkcolor=blue,
anchorcolor=green,
citecolor=magenta,
pdftoolbar=true
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% فراخوانی بسته زی‌پرشین و تعریف قلم فارسی و انگلیسی
\settextfont[Scale=1.2]{XB Niloofar}
\setlatintextfont[Scale=1.1]{Linux Libertine}
%\setlatintextfont[Scale=1.1]{Times New Roman}
% از revision 118 زی‌پرشین به بعد، وارد کردن دستور زیر لازم نیست. توجه داشته باشید که در صورت  غیرفعال کردن این دستور،
% از فونت پیش‌فرض لاتک برای کلمات انگلیسی استفاده خواهد شد
%\setlatintextfont[ExternalLocation,BoldFont={lmroman10-bold},BoldItalicFont={lmroman10-bolditalic},ItalicFont={lmroman10-italic}]{lmroman10-regular}
% چنانچه می‌خواهید اعداد در فرمول‌ها، فارسی باشد، خط زیر را نیز فعال کنید
%\setdigitfont[Scale=1.1]{XB Zar}
% تعریف قلم‌های فارسی و انگلیسی اضافی برای استفاده در بعضی از قسمت‌های متن
%\defpersianfont\ziba[Scale=1.5]{XP Ziba}
\defpersianfont\nastaliq[Scale=3]{IranNastaliq}
\defpersianfont\titr[Scale=1]{XB Titre}
\defpersianfont\traffic[Scale=1]{B Traffic}
\defpersianfont\sols[Scale=1]{XB Sols}
\defpersianfont\niloofar[Scale=1]{XB Niloofar}
\defpersianfont\farsifontsayeh[Scale=1]{XB Kayhan Sayeh}
%\defpersianfont\farsifontsayeh2[Scale=1.4]{XB Kayhan Sayeh}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%تنظیمات مربوط به لغت نامه 
\newcommand\persiangloss[2]{#1\dotfill\lr{#2}\\}
\newcommand\englishgloss[2]{#2\dotfill\lr{#1}\\}
% نحوه ی نمایش شماره ی اشکال، جداول و معادلات
\numberwithin{table}{chapter}
\numberwithin{figure}{chapter}
\numberwithin{equation}{chapter}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% تعریف رنگ ها
\definecolor{seccolor}{rgb}{.41,0.20,0}
\definecolor{chapcolor}{rgb}{.34,0.10,.34}
\definecolor{semcolor}{rgb}{.35,0,.70}
%\definecolor{fehcolor}{cyan}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% نحوه ی نمایش عنوان فصل ها
\renewcommand*\@makechapterhead[1]{%
  \vspace*{5\p@}%
  {\parindent \z@ \raggedleft \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \huge \bfseries\sols\color{chapcolor} \@chapapp\space \thechapter
        \par\nobreak
        \vskip 30\p@
    \fi
    \interlinepenalty\@M
     \bfseries #1\par\nobreak
    \vskip 40\p@}
\noindent\colorbox{chapcolor}{\hspace{340}}\vskip 80  }
%\rule[-1ex]{100mm}{5pt}\\[2.5ex]\hfill}

% تنظیم نحوه ی ظاهر شدن عنوان فهرست و فهرست اشکال و جداول
\renewcommand*\@makeschapterhead[1]{%
  \vspace*{30\p@}%
  {\parindent \z@ \raggedleft
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries\color{blue}  #1\par\nobreak
    \vskip 40\p@
  }}
% تعریف رنگ و فونت مربوط به بخش های
\let\LaTeX@startsection\@startsection
\renewcommand{\@startsection}[6]{\LaTeX@startsection%
{#1}{#2}{#3}{#4}{#5}{\color{seccolor}#6}}

%%%%%%%%%%%%%%%%%%%%%%%%%%
%تعریف و نحوه ظاهر شدن عنوان قضیه‌ها، تعریف‌ها، مثال‌ها و ...
%\theoremstyle{definition}
%\newtheorem{definition}[definition]{تعریف}
%\newtheorem{cryptosys}[definition]{ 
سیستم رمزنگاری%
%}
%\theoremstyle{theorem}
%\newtheorem{theorem}[definition]{قضیه}
%\newtheorem{lemma}[definition]{لم}
%\newtheorem{proposition}[definition]{گزاره}
%\newtheorem{corollary}[definition]{نتیجه}
%\newtheorem{remark}[definition]{ملاحظه}
%\theoremstyle{definition}
%\newtheorem{example}[definition]{مثال}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% آوردن دکمه های آکروبات در متن
%\newcommand{\navbar}{%
%\Acrobatmenu{FirstPage}{$\Leftarrololkw$}
%\Acrobatmenu{PrevPage}{$\leftarrow$}
%\Acrobatmenu{NextPage}{$\rightarrow$}
%\Acrobatmenu{LastPage}{$\Rightarrow$}
%\Acrobatmenu{Close}{$\bullet$}
%}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% تعیین سربرگ
\pagestyle{fancy}
% with this we ensure that the chapter and section
% headings are in lowercase.
\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection\ #1}}
        
\fancyhf{} % delete current header and footer
\fancyhead[LO,RE]{\bfseries\textcolor[rgb]{0 ,.3 ,0}\thepage}
\fancyhead[RO]{\bfseries\textcolor[rgb]{0 ,.3 ,0}\rightmark}
\fancyhead[LE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{.5pt} % space for the rule
\fancypagestyle{plain}{%
   \fancyhead{} % get rid of headers on plain pages
   \renewcommand{\headrulewidth}{0pt} % and the line2page
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% طرح چند الگوی خط

\definecolor{notecolor}{rgb}{.50,0,.50}
\newcommand{ \noteemph}[1]{
\vspace*{2.5ex minus 1.5ex}
\begin{center}
\farsifontsayeh\large\textcolor{notecolor}{{#1}}
\end{center}
\vspace*{2ex minus 1.5ex}}

\definecolor{defencolor}{rgb}{.99,0.50,0}
\definecolor{defpacolor}{rgb}{.10,0.55,0.24}

\newcommand{\semph}[1]{\textcolor{semcolor}{\textbf{#1}}}
\newcommand{\defen}[1]{\textcolor{defencolor}{\textbf{\lr{#1}}}}
\newcommand{\deffa}[1]
{\noindent\vspace{3ex}\\\textcolor{defencolor}{\huge\ding{46}\;\small\ziba\textbf{#1}}\vspace{2ex}\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\idx}[1]{\index{#1}#1}


\newcommand{\pfeat}{\item[\LARGE\color{blue}\ding{44}]}
\newcommand{\nfeat}{\item[\Large\color{red}\ding{247}]}
\newcommand{\adv}{\item[\large\color{blue}\ding{51}]}
\newcommand{\dis}{\item[\large\color{blue}\ding{55}]}
\newcommand{\defpa}{\item[\Large\color{defpacolor}\ding{45}]}
\newcommand{\defcom}{\item[\Large\color{magenta}\ding{101}]}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% تعاریف و نحوه ی ساخت صفحه ی شروع 
\definecolor{authorcol}{rgb}{.51,0,.51}
\def\maketit{
\begin{titlepage}
\vspace*{\stretch{.1}}
\includegraphics[height=3.8cm]{pic/arm}
\newlength{\centeroffset}
\setlength{\centeroffset}{-0.5\oddsidemargin}
\addtolength{\centeroffset}{0.5\evensidemargin}
%\addtolength{\textwidth}{-\centeroffset}
\thispagestyle{empty}

\vspace*{\stretch{1.5}}
\noindent\hspace*{\centeroffset}\makebox[0pt][l]{\begin{minipage}{\textwidth}
\flushleft
{\nastaliq\Huge\bfseries\textcolor{magenta}\@title \\[.5ex]
 }
\noindent\color{gray}{\rule[-1ex]{\textwidth}{5pt}\\[2.5ex]
\hfill\femph{\farsifontsayeh\Large\@type }}
\end{minipage}}

\vspace{\stretch{2}}
\\[35mm]
\noindent\hspace*{\centeroffset}\makebox[0pt][l]{
\begin{minipage}{\textwidth}
\flushleft\textcolor{authorcol}{\bfseries {\@author\\[2.5ex]} 
{\textcolor{authorcol}{\@supervisor\\[2.5ex]}}
{\textcolor{authorcol}\@thesisdate}\\}
\end{minipage}}
\vspace{\stretch{2}}

\end{titlepage}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% 
%% Copyright © 2008-2009      by Vafa Khalighi     <vafa@users.berlios.de>
%% 
%% 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 Vafa Khalighi.
%% 
%% 
%% 
%% 
%%
%% End of file `xepersian-thesis.cls'.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
