\tcbuselibrary{listings}
\usetikzlibrary{decorations.pathmorphing}

% Code LaTeX

\tcbset{codeTEX/.style={
	sharp corners=all,
	before skip=1em,
	after skip=1em,
	enhanced,
	frame style={	
			left color=yellow!75!black,
			right color=yellow!20},
	interior style={
		top color=yellow!10,
		bottom color=yellow!20},
	boxrule=0.7pt,
	fonttitle={\sffamily\bfseries\color{black}},
	listing only,
	left=6mm,
	listing options={
            inputencoding=utf8,
            extendedchars=true,
            literate={é}{{\'e}}1 {è}{{\`e}}1 {ê}{{\^e}}1 {ë}{{\"e}}1 {É}{{\'E}}1 {È}{{\`E}}1 {Ê}{{\^E}}1 {Ë}{{\"E}}1,
            basicstyle=\ttfamily\fontsize{9}{9}\selectfont,
            keywordstyle=\color{blue},
            numbers=none,
            language=TeX,
            breaklines=true,
            morekeywords={globalpath,begin,newenvironment,newcommand,bfseries,color,sffamily,ttfamily,setlength,documentclass,usepackage,fontfamily,selectfont,Large,textbf},
            numberstyle=\tiny\color{red!75!black},
            escapeinside={(*@}{@*)},
        },
	breakable
	}
}

% Titre de la documentation

\tcbset{head/.style={
	enhanced,
	hbox,
	tikznode,
	left=8mm,
	right=8mm,
	boxrule=0.4pt,
  colback=white,
  colframe=gray,
  drop lifted shadow=black!50!yellow,
  before=\par\vspace*{5mm},
  after=\par\bigskip,
  interior style={
		draw=white,
		top color=white,
		bottom color=white}
	}
}

% TOC

\tcbset{toc/.style={
	breakable,
	enhanced jigsaw,
	title={\color{yellow}Sommaire},
	fonttitle=\bfseries\Large,
  colback=yellow!10!white,
  colframe=red!50!black,
  before=\par\bigskip\noindent,
  interior style={
  	fill overzoom image=goldshade.png,
  	fill image opacity=0.25},
  colbacktitle=yellow!20,
  enlargepage flexible=\baselineskip,
  pad at break*=3mm,
  attach boxed title to top center={
  	yshift=1mm-\tcboxedtitleheight,
  	yshifttext=1mm-\tcboxedtitleheight},
  	boxed title style={
        frame code={
            \path[fill=orange!30!black] ([yshift=-1mm,xshift=-1mm]frame.north west)
                arc[start angle=0,end angle=180,radius=1mm] ([yshift=-1mm,xshift=1mm]frame.north east)
                arc[start angle=180,end angle=0,radius=1mm];
            \path[left color=orange!60!black,right color=orange!65!black,middle color=orange!80!black] ([xshift=-2mm]frame.north west)
                -- ([xshift=2mm]frame.north east)[rounded corners=1mm]
                -- ([xshift=1mm,yshift=-1mm]frame.north east)
                -- (frame.south east) -- (frame.south west)-- ([xshift=-1mm,yshift=-1mm]frame.north west)[sharp corners]-- cycle;
        },
        interior engine=empty
    },
  drop fuzzy shadow
	}
}