\documentclass[openany‎, ‎12pt]{book}
\author{مهدی}
\title{{\LARGE مقدمه‌ای بر کاربرد روش اجزاء محدود در پدیده‌های انتقال}}
\date{}
%\usepackage{hyperref}
\usepackage{bidicode}
%\usepackage{verbatim}
\usepackage{makeidx}
\makeindex
\usepackage{amssymb,amsmath,amsthm,graphicx}
\usepackage{xepersian} 
\usepackage{fontspec}
\usepackage[top=3.5cm, bottom=3cm, left=3.75cm, right=3cm]{geometry}
\usepackage{float}
%\usepackage{titlesec}
%\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{-6pt plus 2pt minus 2pt}
%\settextfont[Scale=1]{XB Niloofar}%B Nazanin}
\setlatintextfont{Times New Roman}
\setdigitfont{Arial}
\usepackage{setspace}
\usepackage{ulem}
%\settextfont[Scale=1.5]{B Nazanin}
%\setlatintextfont[Scale=1.5]{Times New Roman}
%\setdigitfont[Scale=1.5]{Arial}
\DefaultMathsDigits
\usepackage{lipsum}
%\usepackage[no-math]{fontspec}
\usepackage{xltxtra}
\usepackage{polyglossia,hijrical}
%\usepackage{bidi}
\setdefaultlanguage{farsi}
\setotherlanguage{english}
\setotherlanguage[calendar=gregorian,locale=mashriq]{arabic}
\setromanfont[Scale=1.5]{Nimbus Roman No9 L}
\defaultfontfeatures{Scale=MatchLowercase}
\setmonofont[Scale=1.5]{DejaVu Sans Mono}
\setsansfont[Scale=1.5]{DejaVu Sans}
\newfontfamily\farsifont[Script=Arabic,Scale=1.2]{Yas}%{Nazli}
\newfontfamily\farsifonttt[Script=Arabic,Scale=1.2]{Yas}%{B Zar}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Yas}%{Nazli}
%--------------------------------------------
%\settextfont[Scale=1.1]{B Nazanin}
%\setlatintextfont[Scale=1.1]{Times New Roman}
%\setlatintextfont[Scale=1.1]{Junicode}
%\setlatintextfont[Scale=1.1]{Linux Libertine}
%\setpookfont[Scale=1.1]{B Nazanin}
%\setsayehfont[Scale=1.1]{B Nazanin}
%\defpersianfont\lotoos[Scale=1.1]{B Nazanin}
%---------------------------------------------
\parindent 0pt
\makeatletter
\def\thickhrule{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\position{\centering}
%% Note the difference between the commands the one is 
%% make and the other one is makes
\renewcommand{\@makechapterhead}[1]{%
  \vspace*{10\p@}%
  {\parindent \z@ \position \reset@font
        {\Huge \scshape  \thechapter }
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \thickhrule
        \par\nobreak
        \vspace*{2\p@}%
        {\Huge \bfseries #1\par\nobreak}
        \par\nobreak
        \vspace*{2\p@}%
        \thickhrule
    \vskip 40\p@
    \vskip 100\p@
  }}

%% This uses makes

\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \position \reset@font
        {\Huge \scshape \vphantom{\thechapter}}
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \thickhrule
        \par\nobreak
        \vspace*{2\p@}%
        {\Huge \bfseries #1\par\nobreak}
        \par\nobreak
        \vspace*{2\p@}%
        \thickhrule
    \vskip 100\p@
  }}
  %------------------------------ HEADER ------------------------------------
\usepackage{fancyhdr}
\makeatletter
\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} 
\renewcommand{\sectionmark}[1]{\markright{#1}{}} %{\thesection{} #1}} 
\lhead[\fancyplain{}{\textfarsi{\bfseries\thepage}}] 
{\fancyplain{}{\bfseries\rightmark}} 
\rhead[\fancyplain{}{\bfseries\leftmark}] 
{\fancyplain{}{\textfarsi{\bfseries\thepage}}} 
\cfoot[]{} 
\addtolength{\headheight}{2pt} %first value 1.6 
\pagestyle{fancy} 
% with this we ensure that the chapter and section 
% headings are in lowercase. 
\renewcommand{\chaptermark}[1]{% 
\markboth{#1}{}} 
\renewcommand{\sectionmark}[1]{% 
\markright{#1}{}} %{\thesection\ #1}} 
\fancyhf{} % delete current header and footer 
\fancyhead[LE]{\if@rl\farsifont\bfseries\thepage\else\RL{\farsifont\bfseries\leftmark}\fi} 
\fancyhead[RO]{\if@rl\farsifont\bfseries\thepage\else\RL{\farsifont\bfseries\rightmark}\fi} 
\fancyhead[LO]{\if@rl\farsifont\bfseries\rightmark\else\RL{\farsifont\bfseries\thepage}\fi} 
\fancyhead[RE]{\if@rl\farsifont\bfseries\leftmark\else\RL{\farsifont\bfseries\thepage}\fi} 
\renewcommand{\headrulewidth}{0.75pt} %first value 0.5
\renewcommand{\footrulewidth}{0pt} 
\addtolength{\headheight}{0.5pt} % space for the rule 
\fancypagestyle{plain}{% 
\fancyhead{} % get rid of headers on plain pages 
\renewcommand{\headrulewidth}{0pt} % and the line 
}
\makeatother
%----------------------------------------- END ----------------------------------
\theoremstyle{definition}
\newtheorem{exmp}{مثال}[chapter]
\newtheorem{exer}{تمرین}[chapter]
\DeclareMathSizes{25}{25}{25}{25}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\begin{document}
%\begin{small}
\begin{spacing}{2}
\maketitle
\end{spacing}
\setcounter{page}{1}
\pagenumbering{alph}
\newpage
\begin{spacing}{1.5}
\tableofcontents
\end{spacing}
\newpage
\setcounter{page}{1}
\pagenumbering{arabic}

\part{پیش‌نیازها}
\chapter{مقدمات}
\section{پیش درآمد}
\setcounter{page}{1}
\pagenumbering{arabic}
\begin{spacing}{2}
{
\begin{latin}
\begin{verbatim}
This is verbatim enviorment
This is verbatim enviorment
This is verbatim enviorment
This is verbatim enviorment
\end{verbatim}
\end{latin}
روش اجزاء محدود از جمله روشهای کارآمد برای مدلسازی و شبیه‌سازی در علوم و مهندسی بوده که امروزه نیز کاربردهای بسیار گسترده‌ای پیدا کرده است. پایه‌های اولیه این روش در سال ۱۹۴۱ و ۱۹۴۲ توسط الکساندر هرینیکوف \LTRfootnote{{Alexander Hrennikoff}} و ریچارد کورانت\LTRfootnote{Richard Courant} گذاشته شد. در سال ۱۹۴۷ زینکویچ\LTRfootnote{Zienkiewicz}، که پدر روش اجزاء محدود شناخته می‌شود، روشهای ارایه شده توسط هرینکوف و کورانت را تلفیق نمود و به این ترتیب روش اجزاء محدود پا به عرصه وجود گذاشت و به جوامع علمی معرفی گردید. روش اجزاء محدود امروزه به کلیدی‌ترین ابزار در طراحی و مهندسی تبدیل شده است که بدون آن طراحی و ساخت بسیاری از شاهکارهای مهندسی قابل تصور نبوده است.
\end{spacing}
\end{document}