\documentclass[12pt]{book}
\usepackage{hyperref}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage{graphicx}
\usepackage{cite}
\usepackage[fleqn]{amsmath}
\usepackage{amsmath,amssymb,latexsym}

% پکیج هایی برای اینکه در فهرست مطالب بنویسه مثلا فصل اول خط بعد  عنوان فصل
%\usepackage{fmtcount}
\usepackage{titlesec}
\usepackage{fmtcount}
%\renewcommand\thechapter{\Numberstring{chapter}}
%\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
%اضافه کردن فهرست منابع به فهرست مطالب به طوریکه شکل و جدول وارد فهرست منابع نشود
 \usepackage[nottoc,notlof,notlot]{tocbibind}
 
%----------- پکیج برای شماره فصل در فهرست به حروف
\usepackage{titletoc}
\usepackage{ptext}
%--------

%\usepackage{mathabx}
\usepackage[table,xcdraw]{xcolor}
% تعیین فاصله بین پاراگراف‌ها
 %\setlength{\parskip}{0.5cm}

\usepackage{rotating}
\usepackage{pdfpages}
\usepackage{tabularray}
\usepackage{multirow}
\usepackage{multicol}
\usepackage[short]{optidef}
\usepackage{ptext}
\usepackage[justification=centering]{caption}
\usepackage{longtable}  
\usepackage{enumitem} 
%\captionsetup{belowskip=0pt,aboveskip=0pt}
%\captionsetup{skip=1pt}
%start paragraph with to raftagi
\usepackage{indentfirst}
%\setlatintextfont{times}
%\usepackage[fontsize={12,20},Kashida]{xepersian}
%\KashidaOn
\usepackage{fancyhdr}
\usepackage{titlesec}


%مخصوص تنظیمات فهرست

\usepackage{tocloft}


\usepackage[fontsize={12,20}]{xepersian}
\settextfont{Nazli}
\setmathdigitfont{Nazli}
%\settextfont{Nazanin}
%\setmathdigitfont{Nazanin}
\SepMark{-}

% حذف شماره صفحه از صفحه‌ی اول عنوان
\makeatletter
\bidi@patchcmd{\chapter}{plain}{empty}{}{}
\makeatother



% با حروف نوشتن شماره‌ی فصل‌ها
\makeatletter
\bidi@patchcmd{\@makechapterhead}{\thechapter}{\tartibi{chapter}}{}{}
\bidi@patchcmd{\chaptermark}{\thechapter}{\tartibi{chapter}}{}{}
\makeatother




% تغییر اندازه فونت عنوان فصل، بخش ها و زیر بخش ها 
\titleformat{\chapter}[display]
{\fontsize{16pt}{20pt}\selectfont\bfseries}{\chaptertitlename\ \tartibi{chapter}}{20pt}{\fontsize{16pt}{15pt}\selectfont\bfseries}
\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\fontsize{12}{15}\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\normalfont\fontsize{12}{15}\bfseries}{\thesubsection}{1em}{}

%اضافه شدن خط تیره به انتهای شماره گذاری ها در بخش ها و زیر بخش
\SepMark{-}
\makeatletter
\renewcommand{\thesection}{\arabic{chapter}\@SepMark\arabic{section}\@SepMark}
\renewcommand{\thesubsection}{\arabic{chapter}\@SepMark\arabic{section}\@SepMark\arabic{subsection}\@SepMark}
\renewcommand{\thesubsubsection}{\arabic{chapter}\@SepMark\arabic{section}\@SepMark\arabic{subsection}\@SepMark\arabic{subsubsection}\@SepMark}
%\renewcommand{\thefigure}{\arabic{chapter}\@SepMark\arabic{section}\@SepMark}
%\renewcommand{\thefigure}{\arabic{chapter}\@SepMark \arabic{figure}\@SepMark}
\makeatother




\def\@seccntformat#1{\csname the#1\endcsname\@SepMark\quad}


% بولد کردن فونتی که مشکل بولد شدن داره مثل نازلی

\settextfont[%
BoldFont={Nazli},%
BoldFeatures={FakeBold=1},%
ItalicFont={Nazli},%
ItalicFeatures={FakeSlant=.3},%
BoldItalicFont={Nazli},%
BoldItalicFeatures={FakeSlant=.3,FakeBold=1}%
]{Nazli}

% تنظیمات سربرگ صفحات پایان نامه برای زوج و فرد صفحات
\usepackage[fit]{truncate}

%\pagestyle{fancy}





% شروع شماره گذاری حرفی در ابتدا با ی- چون چکیده دو صفحه ای با ح و ط شروع شده برای قبل از این
\makeatletter
\newcommand*{\@newAbjad}[1]{%
	\ifcase#1\or ی\or ک\or ل\or م%
	\or ن\or س\or ع\or ف\or ص%
	\or ق\or ر\or ش\or ت\or ث%
	\or خ\or ذ\or ض\or ظ\or غ%
	\or گ\or چ\or پ\or ژ%
	\else\@ctrerr\fi}
\newcommand*{\newAbjad}[1]{\expandafter\@newAbjad\csname c@#1\endcsname}
\makeatother


\begin{document}
		
	
	%---------------------------------------------------------------

‎\pagenumbering{newAbjad}

% حذف سربرگ از فهرست


\renewcommand{\listfigurename}{فهرست شکل‌ها}
\renewcommand{\listtablename}{فهرست جدول‌ها}
\addtocontents{toc}{\textbf{عنوان}~\hfill\textbf{صفحه}\par\rule{\linewidth}{0pt}\par}
\addtocontents{lof}{\textbf{عنوان}~\hfill\textbf{صفحه}\par\rule{\linewidth}{0pt}\par}
\addtocontents{lot}{\textbf{عنوان}~\hfill\textbf{صفحه}\par\rule{\linewidth}{0pt}\par}

%تنظیمات فهرست مطالب سایز و فونت
% table of contents ---> toc
\renewcommand{\cfttoctitlefont}{\hfill\fontsize{12pt}{15pt}\selectfont\bfseries}
\renewcommand{\cftaftertoctitle}{\hfill}

% list of figures ---> lof
\renewcommand{\cftloftitlefont}{\hfill\fontsize{12pt}{15pt}\selectfont\bfseries}
\renewcommand{\cftafterloftitle}{\hfill}

% list of tables ---> lot
\renewcommand{\cftlottitlefont}{\hfill\fontsize{12pt}{15pt}\selectfont\bfseries}
\renewcommand{\cftafterlottitle}{\hfill}

\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\normalsize\bfseries}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}



% تعیین استایل برای صفحه ی فهرست تا سربرگ نخورد
\pagestyle{plain}


% فهرست مطالب

%   شماره گذاری عنوان فصل به حروف در فهرست و دو  پکیج هم بالا داره فراخوانی شده فصل و عنوان فصل جدا نوشته شود. مشکل پیش آمده فقط همتراز نشدن شماره های جلوی اونهاست
\titlecontents{chapter}% <section-type>
[0pt]% <left>
{}% <above-code>
{\chaptername\ \tartibinumeral\thecontentslabel\hspace{0.3em}\titlerule*[0.8pc]{.}\contentspage\endgraf}
%{\bfseries\chaptername\ \tartibinumeral \thecontentslabel\quad\hfil}% <numbered-entry-format>
{}% <numberless-entry-format>
{\titlerule*[0.8pc]{.}\contentspage\endgraf}% <filler-page-format>


\tableofcontents


\newpage

%نوشتن کلمه شکل و جدول ابتدای عنوان فهرست شکلها و جدولها
{%
	\let\oldnumberline\numberline%
	\renewcommand{\numberline}{\tablename~\oldnumberline}%
	\listoftables%
}
\newpage
{%
	\let\oldnumberline\numberline%
	\renewcommand{\numberline}{\figurename~\oldnumberline}%
	\listoffigures%
}




\clearpage

% ادامه شماره گذاری با عدد در فصل‌ها
\pagenumbering{arabic}
% اضافه کردن سربرگ در فصل‌ها
\pagestyle{fancy}

% حذف شماره صفحه و سربرگ از صفحه‌ی قبل از شروع فصل
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
	\hbox{}
	\thispagestyle{empty}
	\newpage
	\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother


% تنظیمات سربرگ برای صفحات فرد و زوج
\fancyhead{}
\fancyfoot{}
%\fancyheadoffset[RO,LE]{10pt}
%\fancyheadinit{\small\sffamily}
\fancyhead[RE]{ \leftmark} 
\fancyhead[RE]{{\truncate{0.8\headwidth}{\leftmark}}}
%\fancyhead[LE]{\leftmark}
\fancyhead[LE]{رساله دکتری}
\fancyhead[RO]{
	ارائه‌ی روشی جدید با هدف مکان‌یابی}
\fancyfoot[C]{\thepage}


\include{chapter_x}


\pagestyle{plain}

\renewcommand*{\bibname}{فهرست منابع}

\bibliographystyle{ieeetr}
%\pagenumbering{arabic}
\bibliography{TestRef}



\end{document}