\documentclass[a4paper,14pt,twoside]{book}
\usepackage{amsthm,amssymb,amsmath}
 
% setting the margins of page
%\usepackage[top=2.5cm, right=5cm, bottom=2.8cm, left=2cm]{geometry}

%help: \usepackage[top=Bcm, bottom=Hcm, outer=Ccm, inner=Acm,
%		 heightrounded, marginparwidth=Ecm, marginparsep=Dcm]{geometry}
\usepackage{lipsum}
\usepackage{marginnote}
\usepackage[top=1.5cm, bottom=2.5cm, outer=7cm, inner=2cm, heightrounded, marginparwidth=4.5cm, marginparsep=0.5cm]{geometry}


\usepackage{makeidx} 
\makeindex

\usepackage{graphicx ,xcolor ,picinpar ,mdframed,longtable}
\usepackage{float,wrapfig}

\usepackage{multicol}


% footnote: =====================================================
%  برای اینکه پاورقی‌ها در هر صفحه ای از 1 شروع شوند 
\usepackage{perpage} %the perpage package
\MakePerPage{footnote} %the perpage package command
%\renewcommand{\thefootnote}{\arabic{footnote}} 	Arabic numerals, e.g., 1, 2, 3...
%\renewcommand{\thefootnote}{\roman{footnote}} 	Roman numerals (lowercase), e.g., i, ii, iii...
%\renewcommand{\thefootnote}{\Roman{footnote}} 	Roman numerals (uppercase), e.g., I, II, III...
%\renewcommand{\thefootnote}{\alph{footnote}} 	Alphabetic (lowercase), e.g., a, b, c...
%\renewcommand{\thefootnote}{\Alph{footnote}} 	Alphabetic (uppercase), e.g., A, B, C...
%\renewcommand{\thefootnote}{\fnsymbol{footnote}} 	A sequence of nine symbols (try it and see!)

%\usepackage{dblfnote} % دو ستون کردن پاورقی‌ها 

%=====================================================
\usepackage[version=0.96]{pgf}

\usepackage{tikz}
% for equation guids.
\usepackage{tkz-linknodes}

\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,matrix,petri,calendar,folding }
\usepackage{verbatim}
\usepackage{enumerate}

\newcommand{\GraphNodeDistance}{1 cm}
\newcommand{\GraphNodeSize}{15 pt}
\newcommand{\GraphInnerSep}{0.5 pt}
\newcommand{\GraphLineWidth}{0.9 pt}

\newcommand{\ShapeBackColor}{15}
\newcommand{\ShapeBorder}{50}


%=====================================================


%\usepackage{lastpage}

%x بسته‌ و دستوراتی برای ایجاد لینک‌های رنگی با امکان جهش
\usepackage[pagebackref=true,colorlinks,linkcolor=blue,citecolor=magenta]{hyperref}
\hypersetup{ 
pdfmenubar=false, pdfstartview=FitH, pdfpagemode=FullScreen,colorlinks=true,linkcolor=blue, anchorcolor=green, citecolor=magenta, urlcolor=cyan, filecolor=magenta, pdftoolbar=true, pdfpagemode=UseOutlines,
}%x چنانچه قصد پرینت گرفتن نوشته خود را دارید، خط بالا را غیرفعال و  از دستور زیر استفاده کنید چون در صورت استفاده از دستور زیر‌‌، 
%x لینک‌ها به رنگ سیاه ظاهر خواهند شد و برای پرینت گرفتن، مناسب‌تر خواهد بود
%\usepackage[pagebackref=false]{hyperref}

 % package for changing Headings style
\usepackage{fancyhdr}
\usepackage{fancybox}
%\usepackage{fix}

%
\renewcommand\headrulewidth{.1pt}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}}  % برای نام فصل‌ها در سربرگ 
\fancyhead[LO,RE]{\small\nouppercase{\rightmark}}
\fancyhead[RO,LE]{\small\nouppercase{\leftmark}}

%
\def\arraystretch{1.2}

%\def\blsfactorfront{1.5}
%\def\blsfactormain{1.5}

%\usepackage{xy}
\usepackage[nottoc]{tocbibind}
%% Glossaaires ========================================= 
\usepackage[xindy={language=persian,codepage=utf8},toc,hyperfirst=true]{glossaries}


%
\renewcommand\glsnamefont[1]{\rm #1}
\newglossarystyle{mylistFa}{%
    \glossarystyle{listgroup}
    \renewcommand*{\glossaryentryfield}[5]{%
     	\item[\glstarget{##1}{##2}, ##5] \dotfill\space ##3}
}
%
\newglossarystyle{mylistEn}{%
    \glossarystyle{listgroup}
    \renewcommand*{\glsgroupheading}[1]{\begin{LTR} \section*{\lr{\glsgetgrouptitle{##1}}} \end{LTR}}
    \renewcommand*{\glossaryentryfield}[5]{%
     	\item[\glstarget{##1}{##2} ] \dotfill\space \rl{##3}}
}

% دستورات زير بري واژه نامه است 
\renewcommand{\glossaryname}{واژه‌نامهٔ فارسی به انگلیسی و نمایه}
\newglossary[epg]{eng2per}{eps}{epo}{واژه‌نامهٔ انگلیسی به فارسی}
\GlsSetXdyLanguage[eng2per]{english}
\makeglossaries
%\glsdisablehyper
\renewcommand\glsdisplayfirst[4]{\textbf{#1}}
\newcommand\gi[1]{\gls{#1}\index{\glsentrysort{#1}@\glsentrytext{#1}}}
\newcommand\gn[1]{\glsentrytext{#1}}


%% XePersian =========================================== 
\usepackage{xepersian}
% دستورات زیر برای تعیین فونت حروف فارسی و اعداد است و به دل خواه شما می‌تواند تغییر کند. (البته نباید استفاده کرد زیرا 
%بعضی مواقع در هایپرلینک کردن گلاسوری ها دچار اشتباه می‌شود. اگر این دو خط غیر فعال باشند خود پکیج زی پرشین از فونت‌های:
% F:\TeXLive_Portable2011\2011\texmf-dist\fonts\opentype\public
%استفاده می‌کند.

%\settextfont[Scale=1.1]{B Zar}
%\setdigitfont[Scale=1.1]{B Zar}
%\DefaultMathsDigits اعداد ریاضی لاتین شود


\setlatintextfont[ExternalLocation,BoldFont={lmroman10-bold},BoldItalicFont={lmroman10-bolditalic},ItalicFont={lmroman10-italic}]{lmroman10-regular}
\defpersianfont\nastaliq[Scale=2]{IranNastaliq}
\defpersianfont\titr[Scale=1]{B Titr}
\defpersianfont\traffic[Scale=1]{B Traffic}
%%============================================ 
 
%
\def\thesection{\arabic{section}-\thechapter}
\def\theequation{\arabic{equation}-\thechapter}
%\numberwithin{equation}{section}
%========================================= 
\makeatletter
\def\@mymakeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedleft
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
   \vskip 20\p@
  }}
\renewenvironment{theindex}
{
      \twocolumn\@mymakeschapterhead{\indexname}%
      \@mkboth{\MakeUppercase\indexname} {\MakeUppercase\indexname}%
      \thispagestyle{plain}\parindent\z@
      \parskip\z@ \@plus .3\p@\relax
      \columnseprule \z@
      \columnsep 35\p@
      \let\item\@idxitem
}
{\if@restonecol\twocolumn\else\clearpage\fi}
               
%\renewcommand\printindex{\newpage%
%\immediate\closeout\@indexfile
%\immediate\write18{xindy -L persian -C utf8 -M texindy \jobname.idx}
%\@input@{\jobname.ind}
%}

 
%%======================================== Main body
%
\input{mystyle}

\begin{document}
\reversemarginpar 

\include{Chapters/Chapter-Introduction}
 
\end{document}



