\usepackage[left=1.2cm,right=1.2cm,top=1.6cm,bottom=2.2cm]{geometry}
\usepackage[x11names,usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{na-box}
\usepackage{yagusylo}
\usepackage{rotating}
\usepackage{url}
\usepackage{hyperref}
%\usepackage[pages=all]{background}
\hypersetup{pdfstartview=FitH,colorlinks=true, linkcolor=blue, urlcolor=red}
\usepackage{titlesec}
\usepackage{varwidth}
\usepackage[listings]{tcolorbox}
\usepackage{esvect}
\usepackage{tcolorbox, graphicx,  tikz}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[tikz]{bclogo}
\usepackage{pgf,tikz}  
\usepackage{calc,tikz}
\usepackage{contour}
\usetikzlibrary[shadings]
\usetikzlibrary{decorations.footprints}
\usetikzlibrary{shadows}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{shapes.symbols}
\tcbuselibrary{listings,breakable}
\usetikzlibrary{shapes.callouts}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes,shadings,shadows,shapes.geometric,decorations,positioning,arrows,decorations.pathmorphing}
\usetikzlibrary{calc,fadings,shapes.geometric,shapes.misc, decorations.pathmorphing,shadows}
 \tcbuselibrary{skins,breakable}
\usetikzlibrary{calc}
\tcbuselibrary{listings}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{tkz-tab}
\usepackage{array,tabularx}
\usepackage{fancybox}
\usepackage{multido}
\usepackage{etex}
\usepackage{amsmath,amsfonts,amssymb,mathrsfs} 
\usepackage{fourier}
\tcbuselibrary{listings,breakable,skins}
\usepackage{esvect}
\usepackage{fancyhdr}
\usepackage{ulem}  
\usepackage{tikz}
\usepackage{listings}
%\backgroundsetup{
	%scale=1,
	%opacity=1.0,
%	angle=0,
	%color=black,
	%contents={%
		%\ifodd\value{page}
			%\includegraphics[width=\paperwidth]{sss}
			%\else
			%\includegraphics[width=\paperwidth]{sss}
		%\fi
		%}
	%}
\tikzset{caixa/.style=
	{draw=green, top color=pink, bottom  color=white,shading angle=45,%rounded corners=5pt, inner xsep=5pt, inner ysep=6pt, outer ysep=10pt,drop shadow
	}
}
\tikzset{mdfshadow/.style={drop shadow=}}%

%%%this works well
\mdfdefinestyle{caixa}{userdefinedwidth=0.98\textwidth,%
	font=\small,%
	shadow=true,%
	shadowsize=5pt,%
	roundcorner=5pt,%
	align=center,%
	%leftmargin=0.3\textwidth,%
	%rightmargin=0.3\textwidth,%
	linecolor=green,%
	innerleftmargin=4pt,%
	innerrightmargin=4pt,
	apptotikzsetting
	={\tikzset{mdfbackground/.append style=caixa} }}
\tcbuselibrary{listings,breakable,skins}
\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
\setdefaultlanguage[calendar=gregorian,locale=algeria]{arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.4]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.4]{Amiri}
\newfontfamily
\bantiii[Script=Arabic,Scale=1.6]{Arial}
\newfontfamily
\bantii[Script=Arabic,Scale=1]{Arial}
\newfontfamily
\bantia[Script=Arabic,Scale=1.2]{Arial}
\newfontfamily\arabicfonttt[Scale=1]{Latin Modern Mono}
\newfontfamily\arabicfontttt[Scale=2]{Latin Modern Mono}
\newfontfamily
\dfont[Script=Arabic,Scale=1.5]{Amiri}
\setotherlanguage{french}
\usepackage[novoc]{arabxetex}
\DeclareGraphicsRule{.mps}{eps}{*}{}   
\newenvironment{NA}{%
\begin{bclogo}[logo = \bccrayon ,couleur=Gold,couleurBarre = red!50!black, arrondi = 0, ombre = false]{ \color{green!50!black}{\textarabic{ ملاحظة هامة  }}}%
}
{%
\end{bclogo}
}  
\newenvironment{NAA}{%
\begin{bclogo}[logo = \bcattention ,couleur=CadetBlue1,couleurBarre = red!30!black, arrondi = 0.1, ombre = true]{ \color{magenta}{\textarabic{تنبيه}}}%
}
{%
\end{bclogo}
}  
\newtcblisting{myboxx}{
	enhanced,
	frame style={	
			left color=blue,
			right color=blue},
	boxrule=0.7pt,
	colback=blue,
	breakable,
	listing options={escapeinside={*}{*},
		 texcsstyle=*\color{red!40!black},
basicstyle=\setLTR\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},
		numberstyle=\tiny\color{red!75!black}},
	interior style={
		draw=blue!50!black,
		top color=yellow!15,
		bottom color=white},
	  segmentation style={
		draw=blue!50!black,
		solid,
		decorate,
		decoration={random steps,segment length=3mm}
}} 

\newtcblisting{mybox}{
enhanced,
colback=SpringGreen!20,
colframe=red!50!black,breakable,
bicolor,colbacklower=white,
listing options={language={[LaTeX]TeX},escapeinside={*}{*},
texcsstyle=*\color{red!50!black},
basicstyle=\setLTR\arabicfonttt,
numbers=none,
breaklines=true,
keywordstyle=\color{blue},
commentstyle=\color{gray},
moretexcs={},
morekeywords={begin, end, draw,fill,tcbuselibrary,
filldraw,shadedraw,shade,usetikzlibrary,foreach,clip,plot ,grid,rectangle,cycle,circle,path,pgfmathsetmacro
,radiusSmall}, % you can add what you need  
frame=none,
}}
\newtcblisting{boxn}{
enhanced,
 text side listing,
colback=SpringGreen,
colframe=red!50!black,breakable,
bicolor,colbacklower=white,
listing options={language={[LaTeX]TeX},escapeinside={*}{*},
texcsstyle=*\color{red!50!black},
basicstyle=\setLTR\arabicfonttt,
numbers=none,
breaklines=true,
keywordstyle=\color{blue},
commentstyle=\color{gray},
moretexcs={},
morekeywords={begin, end, draw,fill,tcbuselibrary,
filldraw,shadedraw,shade,usetikzlibrary,foreach,clip,plot ,grid,rectangle,cycle,circle,path,pgfmathsetmacro
,radiusSmall}, % you can add what you need  
frame=none,
}}
\newtcblisting{boxlis}{
enhanced,
colback=Aqua!60,
colframe=red!50!black,breakable,
listing only,
listing options={language={[LaTeX]TeX},escapeinside={*}{*},
texcsstyle=*\color{red!50!black},
basicstyle=\setLTR\arabicfonttt,
numbers=none,
breaklines=true,
keywordstyle=\color{blue},
commentstyle=\color{gray},
moretexcs={setdefaultlanguage,setdefaultlanguage,newfontfamily
,textarabic,hfill,uline,bf,breakbox,env,XeLaTeX,textfrench,underline,ztotpages,cfoot,rfoot,lfoot,chead,lhead,rhead, AtBeginDocument,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}
\definecolor{lawn}{rgb}{0.49,0.95,0.85}
\definecolor{box}{rgb}{0.72,1.00,1.00}
\definecolor{bclogo}{rgb}{0.73,0.00,0.73}
\definecolor{d}{rgb}{0.73,1.00,0.73}
\definecolor{hyp}{rgb}{0.00,0.00,0.59}
\definecolor{sec}{rgb}{0.44,0.00,0.22}
% fontes section
\def\sectiontitle@font{\dfont \selectfont}
\def\subsectiontitle@font{\dfont \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{sec}
	\sectiontitle@font
}
{
\raisebox{\decalnumsec}
{%
\begin{tikzpicture}
\node (numsec) {\sectiontitle@font\thesection};
\node [top color=SpringGreen, shading angle=45,star,drop shadow] at  (numsec) {\bantiii\thesection};
\end{tikzpicture}
}
}
{\spacetitlesec}
{}
\titleformat{\subsection}[block]
{%
	\bfseries
	\color{magenta!80!black}
	\subsectiontitle@font
}
{
\raisebox{\decalnumsubsec}
{%
\begin{tikzpicture}
\node (numsubsec) { \subsectiontitle@font\RL{\thesubsection}};
\node [top color=blue!50!white, shading angle=90,ellipse,drop shadow] at  (numsec) {\bantiii \RL{\thesubsection}};
\end{tikzpicture}
}
}
{\spacetitlesubsec}
{}
\definecolor{monstertandark}{HTML}{F0DBB5}	
\newcommand*{\E}{\ensuremath{\mathrm{e}}}
%Peach!20
\colorlet{codebackground}{LightBlue!30!white}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\baselinestretch}{1.4}
%\tcbset{arc,arc is angular} 
\newcommand{\naams}[1]{\fcolorbox{brown}{brown}{{\color{white}\textbf{#1}}}}
\newtcolorbox{molahadaT}[1][]{enhanced,breakable,
  before skip=2mm,after skip=3mm,
  boxrule=0.4pt,left=5mm,right=0.7cm,top=1mm,bottom=1mm,
   interior style image=lazz.png,
  colframe=blue!50!black,
  sharp corners,rounded corners=southwest,arc is angular,arc=3mm,
  underlay={%
    \path[fill=tcbcol@back!80!black] ([yshift=3mm]interior.south west)--++(+0.4,+0.1)--++(-0.1,-0.4);
    \path[draw=tcbcol@frame,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south west)--++(+0.4,+0.1)--++(-0.1,-0.4);
    },
  drop fuzzy shadow,#1}
\newtcolorbox{paperbox}[2][]{
	frame hidden,
	boxrule=0pt,
	breakable,
	enhanced,
	before skip=11pt plus 1pt,
	toptitle=3mm,
	boxsep=0.25ex,
	left=8pt,
	right=8pt,
	fonttitle= \Large \waalidfontta \selectfont\scshape\bfseries\color{blue!50!black},
	fontupper=\sffamily \selectfont,
	title=#2,
	arc=0mm,
	parbox = false,
	borderline north={1pt}{-0.5pt}{black},
	borderline south={1pt}{-0.5pt}{black},
	interior style image=goldshade.png,
	colframe=monstertandark,
	title style image=goldshade.png,
	fuzzy shadow={0mm}{-3.5pt}{-0.5pt}{0.4mm}{black!60!white},
	overlay={
		\fill [fill=black] (frame.south west) -- ++(7pt,0) -- ++(0,-5pt) -- cycle;
		\fill [fill=black] (frame.north west) -- ++(7pt,0) -- ++(0,5pt) -- cycle;
		\fill [fill=black] (frame.north east) -- ++(-7pt,0) -- ++(0,5pt) -- cycle;
		\fill [fill=black] (frame.south east) -- ++(-7pt,0) -- ++(0,-5pt) -- cycle;
		},
	after={\vspace{10pt plus 1pt}\noindent},
	#1
}  
\makeatletter
\newtcolorbox{algeriabox}[2][]{%
enhanced,
breakable,
colback=white,
colframe=blue!30!black,
attach boxed title to top right={yshift=-2pt}, title={#2},
boxrule=0pt,
boxed title style={%
    sharp corners, 
    rounded corners=northeast, 
    colback=tcbcol@frame, 
    boxrule=0pt},
sharp corners=north,
overlay unbroken={%
    \path[fill=tcbcol@back] 
        ([xshift=2pt]title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west) |- 
        ([xshift=2pt]title.south west)--cycle;
    \path[fill=tcbcol@frame] (title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west)
        [rounded corners=\kvtcb@arc] |- 
        (title.north-|frame.north) 
        [sharp corners] -| (title.south west);
    \draw[line width=.5mm, rounded corners=\kvtcb@arc, 
        tcbcol@frame] 
        (title.north east) rectangle 
        (frame.south west);
}, 
overlay first={%
    \path[fill=tcbcol@back] 
        ([xshift=2pt]title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west) |- 
        ([xshift=2pt]title.south west)--cycle;
    \path[fill=tcbcol@frame] (title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west)
        [rounded corners=\kvtcb@arc] |- 
        (title.north-|frame.north) 
        [sharp corners] -| (title.south west);
    \draw[line width=.5mm, rounded corners=\kvtcb@arc, 
        tcbcol@frame] 
        (frame.south west) |- (title.north) -| 
        (frame.south east);
}, 
overlay middle={%
    \draw[line width=.5mm, tcbcol@frame] 
    (frame.north west)--(frame.south west) 
    (frame.north east)--(frame.south east);
}, 
overlay last={%
    \draw[line width=.5mm, rounded corners=\kvtcb@arc, 
        tcbcol@frame] 
        (frame.north west) |- (frame.south) -|
        (frame.north east);
}, 
#1
}
\newtcolorbox{naas}[2][]{%
enhanced,
breakable,
colback=white,
colframe=blue!30!black,
attach boxed title to top right={yshift=-2pt}, title={#2},
boxrule=0pt,
boxed title style={%
    sharp corners, 
    rounded corners=northeast, 
    colback=tcbcol@frame, 
    boxrule=0pt},
sharp corners=north,
overlay unbroken={%
    \path[fill=tcbcol@back] 
        ([xshift=2pt]title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west) |- 
        ([xshift=2pt]title.south west)--cycle;
    \path[fill=tcbcol@frame] (title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west)
        [rounded corners=\kvtcb@arc] |- 
        (title.north-|frame.north) 
        [sharp corners] -| (title.south west);
    \draw[line width=.5mm, rounded corners=\kvtcb@arc, 
        tcbcol@frame] 
        (title.north east) rectangle 
        (frame.south west);
}, 
overlay first={%
    \path[fill=tcbcol@back] 
        ([xshift=2pt]title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west) |- 
        ([xshift=2pt]title.south west)--cycle;
    \path[fill=tcbcol@frame] (title.south west) 
        to[out=180, in=0] ([xshift=-1.5cm]title.west)--
        (title.west-|frame.west)
        [rounded corners=\kvtcb@arc] |- 
        (title.north-|frame.north) 
        [sharp corners] -| (title.south west);
    \draw[line width=.5mm, rounded corners=\kvtcb@arc, 
        tcbcol@frame] 
        (frame.south west) |- (title.north) -| 
        (frame.south east);
}, 
overlay middle={%
    \draw[line width=.5mm, tcbcol@frame] 
    (frame.north west)--(frame.south west) 
    (frame.north east)--(frame.south east);
}, 
overlay last={%
    \draw[line width=.5mm, rounded corners=\kvtcb@arc, 
        tcbcol@frame] 
        (frame.north west) |- (frame.south) -|
        (frame.north east);
}, 
#1
}
\definecolor{myblue}{RGB}{40,96,139}
\definecolor{fondpaille}{cmyk}{0,0,0.1,0}
\makeatother
\parindent=0pt
%\pagecolor{brown!10}
\tcbset{arc=2mm}
\makeatletter%
\renewcommand\tableofcontents%
{%
  %\section*{\contentsname}%
  \@mkboth{%
  \MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
  \@starttoc{toc}%
}
\rightfootnoterule
\newcommand{\widecheckperso}[1]{%
3 \overset{\rotatebox{180}{$\widehat{\hphantom{#1}}$}}{#1}}
\newcommand{\colorUL}[1][black]
{%
\bgroup%
\ifdim\ULdepth=\maxdimen
  \settodepth\ULdepth{(j}%
  \advance\ULdepth.4pt
\fi
\markoverwith{\kern0em\vtop{%
\kern\ULdepth {%
\color{#1}\hrule   width .4em}}%
\kern0em}\ULon}

\newcommand{\colorULdotted}[1][black]
{%
\bgroup%
\ifdim\ULdepth=\maxdimen
  \settodepth\ULdepth{(j}%
  \advance\ULdepth.4pt
\fi
\markoverwith{\kern0em\vtop{%
\kern\ULdepth {%
\color{#1}\hrule width .6em}}
\kern0em}\ULon}
\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}}
 \def\mosqdoor{%
{15}% Horizontal center
{0}b{15}\\% Text begins at x=15, y=0
{1}t{13}{4}\\%
{2}t{10.5}{9}\\%
{3}t{8.5}{13}\\%
{4}t{7.2}{15.6}\\%
{5}t{6.3}{17.4}\\%
{6}t{5.5}{19}\\%
{7}t{4.8}{20.4}\\%
{8}t{4.3}{21.4}\\%
{9}t{4.1}{21.8}\\%
{9.5}t{3.9}{22.2}\\%
{10}t{4.1}{21.8}\\%
{11}t{4.3}{21.4}\\%
{12}t{4.5}{21}\\%
{13}t{5}{20}\\%
{14}t{5.8}{18.4}\\%
{15}t{7}{16}\\%
{17}t{7}{16}\\%
{18}t{7}{16}\\% <<
{18.1}t{6}{18}\\%
{19}t{6}{18}\\%
{20}t{5}{20}\\%
{29}t{5}{20}\\%
{30}e{15}%
}
\newcommand{\bola}{\tikz \node [shading angle=45,shading=ball , ball color=yellow,semicircle,drop shadow] at (0,0) { \bantii \thepage};}
\newcommand{\etoile}[1]{\tikz \node [ shading angle=45,top color=CadetBlue1,star,star points=6,drop shadow] at (0,0) { #1};}
\newcommand{\mos}[1]{\tikz \node [ shading angle=45,shading=ball , ball color=LightSlateBlue ,rectangle,rounded corners=5pt,drop shadow] at (0,0) { #1};}
\newcommand{\nono}[1]{\tikz \node [ shading angle=45,shading=ball , ball color=Aquamarine1 ,starburst,drop shadow] at (0,0) { #1};}
\newcommand{\nona}[1]{\tikz\node [shading=ball , ball color=Aquamarine1,draw,thick, minimum height=1cm, minimum width=3cm,
      decorate, decoration={random steps,segment length=3pt,amplitude=1pt}]
      {#1};}
    
\newcommand{\draalg}{\begin{tikzpicture}[scale=0.8]
  % Use wikipedia's dimensions
  \filldraw[fill=white](0,0) rectangle (12, 8);
  \fill[fill=ForestGreen,draw=black](0,0) rectangle (6, 8);
  \draw(9,7)node[right]{\small \textarabic{تحيا الجزائر}};
  \fill[red] (6,4) circle (1.5);
  \begin{scope}
  \clip (0,0) rectangle (6,8);
  \fill[ForestGreen] (6.4,4) circle (1.2);
  \end{scope}
  \begin{scope}
  \clip (6,0) rectangle (12,8);
  \fill[white] (6.4,4) circle (1.2);
  \end{scope}
  \node[star,fill=red, minimum size=1.4cm, rotate=-18, star point ratio=2.617,inner sep=0pt,xshift=1.5mm] at (6.4,4) {};
  % Star point ratio is GoldenRatio^2 (1.618^2)
\end{tikzpicture}}


