\lstset{
    language=[LaTeX]TeX,escapeinside={*}{*},
  texcsstyle=*\color{red!40!black},
basicstyle=\ttfamily,
numbers=none,
	frame=none,
	rulesepcolor=\color{blue},
	rulecolor=\color{blue},
	framexleftmargin=10pt ,
breaklines=true,
keywordstyle=\color{blue},
commentstyle=\color{gray},
moretexcs={setdefaultlanguage,newfontfamily
, AtBeginDocument,arabicfon,lyfont},
morekeywords={begin, end, draw,fill,tcbuselibrary,
filldraw,shadedraw,shade,usetikzlibrary,foreach,clip,plot ,grid,rectangle,cycle,circle,path,pgfmathsetmacro
,radiusSmall},}
\usepackage{polyglossia}
\makeatletter 
\AtBeginDocument{\bidi@isloaded[]{arabxetex}}
\makeatother
\newfontfamily\arabicfont[Script=Arabic,Scale=1.4]{DecoType Naskh}
\newfontfamily
\corna[Script=Arabic,Scale=5]{CornPop}
\newfontfamily
\leter[Script=Arabic,Scale=1.5]{Mcs Book Title 3}
\newfontfamily
\bantise[Script=Arabic,Scale=2]{Mcs Letter Word 5}
\newfontfamily
\nk[Script=Arabic,Scale=1]{Arial}
\newfontfamily\arabicfonttt{Latin Modern Mono}
\newfontfamily\arabicfontttt[Scale=2]{Latin Modern Mono}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.4]{Amiri}
\newfontfamily\not[Script=Arabic,Scale=1.5]{Aref Ruqaa}
\newfontfamily\fontislam[Script=Arabic,Scale=5]{AGA Islamic Phrases}
\newfontfamily
\waalidfontta[Script=Arabic,Scale=1.5]{Amiri}
\setdefaultlanguage[calendar=gregorian,locale=algeria]{arabic}
\setotherlanguage{french}
\usepackage[novoc]{arabxetex}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\headrulewidth}{0pt}
\newtcblisting{boxlis}{
enhanced,
drop fuzzy shadow,
colback=DarkSlateGray1!20!white,
colframe=blue,breakable,
listing only,
listing options={language={[LaTeX]TeX},escapeinside={*}{*},
texcsstyle=*\color{red!50!black},
basicstyle=\setLTR\ttfamily,
numbers=none,
breaklines=true,
keywordstyle=\color{blue},
commentstyle=\color{gray},
moretexcs={setdefaultlanguage,setdefaultlanguage,newfontfamily
,textarabic,hfill,posaa,posbb,posbe,posbf,
posbc,posbd,naborder,corna,
bordertitle,uline,bf,XeLaTeX,textfrench,underline,ztotpages,cfoot,rfoot,lfoot,chead,lhead,rhead, AtBeginDocument,def ,Nline,Nplot,arabicfon,usetikzlibrary,setotherlanguage,lyfont,arabicfontsf,arabicfont},
morekeywords={begin,end,draw,fill}, % you can add what you need  
frame=none,
}}
\definecolor{section@title@color}{cmyk}{1,0.2,0.3,0.1}
\definecolor{subsection@title@color}{cmyk}{0,0.6,0.9,0}
\definecolor{shadow@color}{cmyk}{.07,0,0,0.49}
% fontes section
\renewcommand\thesubsection{\arabic{subsection}.\thesection}
\def\sectiontitle@font{\not \selectfont}
\def\subsectiontitle@font{\waalidfontta \selectfont}
\newlength\decalnumsec
\newlength\decalnumsubsec
\setlength{\decalnumsec}{-0.5em}
\setlength{\decalnumsubsec}{-0.5em}
\newlength\decalxtitlesubsec
\setlength{\decalxtitlesubsec}{\parindent}
% Espace entre le numéro de section et le titre
\newlength\spacetitlesec
\newlength\spacetitlesubsec
\setlength{\spacetitlesec}{0.2em}
\setlength{\spacetitlesubsec}{0.2em}
\titleformat{\section}[block]
{%
	\bfseries\Large
	\color{NavyBlue}
	\sectiontitle@font
}
{
\raisebox{\decalnumsec}
{%
\begin{tikzpicture}
\node (numsec) {\sectiontitle@font\thesection};
\fill[rounded corners=4pt,fill=NavyBlue!40] ($(numsec.north west)+(2pt,-2pt)$) -- ($(numsec.north east)+(+2mm,-3mm)+(2pt,-2pt)$) -- ($(numsec.south east)+(2pt,-2pt)$) -- ($(numsec.south west)+(-1mm,-2mm)+(2pt,-2pt)$) -- cycle;
\shadedraw[rounded corners=4pt,shading=ball,ball color=NavyBlue] (numsec.north west) -- ($(numsec.north east)+(+2mm,-3mm)$) -- (numsec.south east) -- ($(numsec.south west)+(-1mm,-2mm)$) -- cycle;
\node[white] at (numsec) {\not \thesection};
\node [above right,anchor= east] (titre) at ($(numsec.west)+(-.4,-.2)$) {\large\bfseries \textarabic{\not #1}};
\node [yscale=-0.7, scope fading=south, opacity=0.4, above] at ($(titre.south)+(0,0.3)$) {\large\bfseries \textarabic{\not  #1}};
\end{tikzpicture}
}
}
{\spacetitlesec}
{}
\titleformat{\subsection}[block]
{%
	\bfseries
	\color{DarkOrchid2}
	\subsectiontitle@font
}
{
\raisebox{\decalnumsubsec}
{%
\begin{tikzpicture}
\node (numsubsec) { \subsectiontitle@font\RL{\thesubsection}};
\fill[rounded corners=2pt,fill=DarkOrchid2!40] ($(numsubsec.north west)+(2pt,-2pt)$) -- ($(numsubsec.north east)+(1mm,0mm)+(2pt,-2pt)$) -- ($(numsubsec.south east)+(2pt,-2pt)$) -- ($(numsubsec.south west)+(-1mm,0)+(2pt,-2pt)$) -- cycle;
\fill[rounded corners=2pt,fill=DarkOrchid2] (numsubsec.north west) -- ($(numsubsec.north east)+(1mm,0mm)$) -- (numsubsec.south east) -- ($(numsubsec.south west)+(-1mm,0)$) -- cycle;
\node[Tomato4] at (numsec) {\waalidfontta \RL{\thesubsection}};
\node [above right,anchor= east] (titre) at ($(numsec.west)+(-.4,-.2)$) {\large\bfseries \textarabic{\nk #1}};
\node [yscale=-0.8, scope fading=south, opacity=0.4, above] at ($(titre.south)+(0,0.3)$) {\large\bfseries \textarabic{\nk  #1}};
\end{tikzpicture}
}
}
{\spacetitlesubsec}
{}
\colorlet{codebackground}{LightBlue!30!white}
\renewcommand{\baselinestretch}{1.4}
\tcbset{arc,arc is angular} 
\newcommand{\naams}[1]{\fcolorbox{SlateBlue3}{SlateBlue3}{{\color{white}\textbf{#1}}}}
\newcommand{\page}{\newpage \fancyfoot[L]{{
 \naams{\textbf{0\thepage}}}}
  \fancyfoot[C]{}
   \fancyfoot[R]{} \rhead{} \chead{} \parindent 0pt \renewcommand{\footrulewidth}{1.4pt} }\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\headrule}{{\color{SlateBlue3}%
\hrule width\headwidth height\headrulewidth }}
\renewcommand{\footrule}{{\color{SlateBlue3}%
\hrule width\headwidth height\headrulewidth }} 
\definecolor{myblue}{RGB}{40,96,139}
\definecolor{fondpaille}{cmyk}{0,0,0.1,0}
\makeatother
\parindent=0pt
%\pagecolor{brown!10}
\tcbset{arc=1mm}
\makeatletter%
\renewcommand\tableofcontents%
{%
  %\section*{\contentsname}%
  \@mkboth{%
  \MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
  \@starttoc{toc}%
}
\rightfootnoterule
\newenvironment{reflet}[1]
{
\begin{center}
\begin{tikzpicture}[inner sep=3pt]
\node[scale=1.4,above,yslant=0]{#1};
\node[scale=1.4,above,yslant=0,
yscale=-1,scope fading=south,
opacity=0.4]{#1};
\end{tikzpicture}
}
{
\end{center}}
\newtcolorbox{Rappel}[1][]{breakable,
enhanced,
colback={green!70!white},
colupper=white,
fontupper=\large,
notitle ,
sharp corners,
colframe=brown!70!black,
boxrule=2mm,
drop fuzzy shadow,
underlay={{size=2mm, 
    inside node=frame, raised color=brown!70!black}},
#1}