TikZ-PGF – Book Design and Chapter Numbering

book-designtikz-pgf

I'm trying to replicate this design but I'm struggling to do it.
Any advice ?
enter image description here

This is what I tried

\documentclass[a4paper,12pt]{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm,mathrsfs}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[left=3cm,right=2.5cm,top=3.5cm,bottom=2.5cm]{geometry}
\usepackage[most]{tcolorbox}
\tcbuselibrary{skins}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{shadows,shapes,shadows.blur,shapes.symbols,positioning}
\usetikzlibrary{calc,shadows,shapes,shadows.blur}
\usepackage{eso-pic}
\usepackage{tikzpagenodes}
\renewcommand*\sfdefault{ugq}
%============================================
%======================================
\definecolor{pBlue}{RGB}{102, 53, 153}
%==================================
%==========================================================
\definecolor{myblue}{HTML}{1D2A6E}
\definecolor{myred}{HTML}{A97E77}
\definecolor{mybrown}{HTML}{B35823}
\definecolor{gold}{HTML}{B48920}
\definecolor{myorange}{HTML}{ED8C2B}
\definecolor{col}{RGB}{45, 136, 119}
\definecolor{MainRed}{rgb}{.8, .1, .1}
\definecolor{winered}{rgb}{0.5,0,0}
%==========================================================
\def\cola{pink!50!purple}
\def\colb{cyan!80!blue}
%==================================================
\definecolor{titleboxcolor}{RGB}{199,232,250}
\definecolor{darkblue}{RGB}{59,134,215}
%===================================
%=========================================
%======================================
\definecolor{pBlue}{RGB}{102, 53, 153}
%==================================
%==========================================================
\definecolor{myblue}{HTML}{1D2A6E}
\definecolor{myred}{HTML}{A97E77}
\definecolor{mybrown}{HTML}{B35823}
\definecolor{gold}{HTML}{B48920}
\definecolor{myorange}{HTML}{ED8C2B}
\definecolor{col}{RGB}{45, 136, 119}
\definecolor{MainRed}{rgb}{.8, .1, .1}
\definecolor{winered}{rgb}{0.5,0,0}
%==========================================================
%===========================================
\makeatletter
\newtcolorbox[auto counter]{exo}[2][]{%
enhanced, 
breakable,
before skip=1.5cm ,
after skip=1.5cm ,
colback=white,
frame hidden,
top=.75cm,
attach boxed title to top left, 
boxed title style={empty},
overlay={%
\begin{scope}
\node[circle,fill=green!90!black,minimum size=8mm] (circ) at (frame.north west) {};
\node[fill=green,anchor=west,minimum height=8mm,minimum width=2.5cm,font=\large\bfseries\color{white}] at (circ) {Exercice};
\node[fill=white,line width=2pt,circle,draw=green,minimum size=1cm,right=1.9cm of circ,font=\LARGE\sffamily\color{black!20!teal}] (num) {\thetcbcounter};
\node[rounded rectangle, rounded rectangle west arc=0pt, minimum height=0.7cm,fill=black!20!teal,font=\large\bfseries\color{white}, drop shadow={opacity=.5,shadow xshift=0pt},right=.5cm of num]  {#2};
%=====================
\draw[line width=1.5pt, black!20!teal]
([shift={(-20pt, 13pt)}]frame.north west) coordinate (iniPoint)
-- (iniPoint|-frame.south west)
-- ([xshift=-30pt]frame.south east)
to[out=0, in=-90] ([yshift=30pt]frame.south east)
-- (frame.north east) -- ++(-2.5, 0) coordinate (endPoint) -- ++(-3pt, 3pt) -- ++(-3pt, -3pt)
-- ++(3pt, -3pt) -- (endPoint);
\draw[line width=1.5pt, black!20!teal] ([xshift=4pt]iniPoint) -- ++(-8pt, 0);
\draw [line width=1.5pt, black!20!teal] (iniPoint) ++(-6pt, -10pt) -- ++(12pt, 0);
\draw[line width=1.5pt, black!20!teal] (iniPoint) ++(-6pt, -14pt)-- ++(12pt, 0);
\end{scope} 
}, 
#1
}
\makeatother
%===============================================
%===========================================
\tikzset{
    page/.style={
        color  = white ,
        fill   = green ,
        font   =\bfseries\fontsize{25}{25}\selectfont\sffamily ,
        minimum size = .5in ,
        yshift = 0.5in
    }
}
%---------------------------------------------
%===========================================
%===============================================
\newcommand{\SideBarNew}{\AddToShipoutPicture{
        \begin{tikzpicture}[remember picture,overlay]
        %\draw[pBlue] (current page.north west)--([shift={(1.5,0)}]current page.north west){[rounded corners=5pt]--++(0,-13)--++(-120:2)}
        %|-(current page.south west)--cycle;
        \fill [orange]
        ($(current page.north east)+(-1.2,-1)$){--++(-17,0)--++(0,-1.5)} --++(17,0)--cycle;
        %=======================================================
        \fill [green]
        ($(current page.north east)+(-1.2,-1)$);
        \fill [green]
        ($(current page.north east)+(-1.2,-1)$){--++(-2,0)--++(0,-1.5)} --++(2,0)--cycle;   
        \node[white] at([shift={(-4.25,-1.25)}]current page.north east){\centering\fontsize{15}{15}\scshape\bfseries\selectfont{}};
        %=========================================================
        \draw[line width=1.5pt, black!20!teal]
        ([shift={(-.75, -.75)}]current page.north east) coordinate (A)|-([xshift=2cm,yshift=1cm]current page.south west)
        to[out=180, in=-90] ([xshift=1cm,yshift=2cm]current page.south west)coordinate (B)
        -- ([yshift=-1cm]B|-current page.north west)--++(1,0)coordinate (C);
        \draw[black!20!teal,line width=4pt] (C)-- ++(10pt, 10pt) -- ++(10pt, -10pt)
        -- ++(-10pt, -10pt)--cycle;
        %=================================================
        \draw[line width=3pt, black!20!teal] ([xshift=-12pt]A) -- ++(24pt, 0);
        \draw [line width=1.5pt, black!20!teal] (A) ++(6pt, -10pt) -- ++(-12pt, 0);
        \draw[line width=1.5pt, black!20!teal] (A) ++(6pt, -14pt)-- ++(-12pt, 0);
        %================================================
        \node[right,page] at ([yshift=-5pt]current page.south)
        {\thepage} ;
        %============================================
        \fill[green] (current page.north west)--([shift={(.5,0)}]current page.north west){--++(0,-14)--++(-120:.75)}
        |-(current page.south west)--cycle;
        %=====================================
        \fill[col]([xshift=6pt]current page.south west) rectangle ++(6,.8);
        \node[white] at([shift={(3,.4)}]current page.south west){{\Large\bfseries{footer}}};
        \end{tikzpicture}
}}
\newcommand{\SideBarNewCurrent}{\AddToShipoutPicture*{%
}}

%start label for new stuff
\newcommand{\NEW}{\SideBarNew}
%=================================================
\begin{document}
\pagestyle{empty}
\NEW

\begin{exo}{Convergence faible dans un espace pr\'ehilbertien}
Soit $H$ un espace pr\'ehilbertien r\'eel et soit $(x_n)_{n\ge0}$ une suite d'\'el\'ements de $H$.
\begin{enumerate}
\item Montrer que si $(x_n)_{n\ge0}$ converge faiblement, alors la limite est unique.
\item Montrer que si $(x_n)_{n\ge0}$ converge fortement alors $(x_n)_{n\ge0}$ converge 
\end{enumerate}
\end{exo}
\end{document}

And this is the result

enter image description here

I would like to do the same thing for the top of the page (Facebook logo, blue square: Level…) and the design and numbering of the chapters as in the initial image. And the same thing for the footer without forgetting the police used.

In fact I want exactly the same thing as in this image.

enter image description here

Best Answer

Hope this is what you want:

\documentclass[a4paper,12pt]{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm,mathrsfs}
%\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[left=3cm,right=2.5cm,top=3.5cm,bottom=2.5cm]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
%\tcbuselibrary{skins}
%\usepackage{tikz}
\usetikzlibrary{calc,shadows,shapes,shadows.blur,shapes.symbols,positioning}
\usepackage{eso-pic}
%\usepackage{tikzpagenodes}
\renewcommand*\sfdefault{ugq}
%============================================
%======================================
\definecolor{pBlue}{RGB}{102, 53, 153}
%==================================
%==========================================================
\definecolor{myblue}{HTML}{1D2A6E}
\definecolor{myred}{HTML}{A97E77}
\definecolor{mybrown}{HTML}{B35823}
\definecolor{gold}{HTML}{B48920}
\definecolor{myorange}{HTML}{ED8C2B}
\definecolor{col}{RGB}{45, 136, 119}
\definecolor{MainRed}{rgb}{.8, .1, .1}
\definecolor{winered}{rgb}{0.5,0,0}
%==========================================================
\def\cola{pink!50!purple}
\def\colb{cyan!80!blue}
%==================================================
\definecolor{titleboxcolor}{RGB}{199,232,250}
\definecolor{darkblue}{RGB}{59,134,215}
%===================================
\newtcolorbox[auto counter]{exo}[2][]{%
enhanced, 
breakable,
before skip=1.5cm ,
after skip=1.5cm ,
colback=white,
frame hidden,
top=.75cm,
attach boxed title to top left, 
boxed title style={empty},
overlay={%
\begin{scope}
\node[circle,fill=green!90!black,minimum size=8mm] (circ) at (frame.north west) {};
\node[fill=green,anchor=west,minimum height=8mm,minimum width=2.5cm,font=\large\bfseries\color{white}] at (circ) {Exercice};
\node[fill=white,line width=2pt,circle,draw=green,minimum size=1cm,right=1.9cm of circ,font=\LARGE\sffamily\color{black!20!teal}] (num) {\thetcbcounter};
\node[rounded rectangle, rounded rectangle west arc=0pt, minimum height=0.7cm,fill=black!20!teal,font=\large\bfseries\color{white}, drop shadow={opacity=.5,shadow xshift=0pt},right=.5cm of num]  {#2};
%=====================
\draw[line width=1.5pt, black!20!teal]
([shift={(-20pt, 13pt)}]frame.north west) coordinate (iniPoint)
-- (iniPoint|-frame.south west)
-- ([xshift=-30pt]frame.south east)
to[out=0, in=-90] ([yshift=30pt]frame.south east)
-- (frame.north east) -- ++(-2.5, 0) coordinate (endPoint) -- ++(-3pt, 3pt) -- ++(-3pt, -3pt)
-- ++(3pt, -3pt) -- (endPoint);
\draw[line width=1.5pt, black!20!teal] ([xshift=4pt]iniPoint) -- ++(-8pt, 0);
\draw [line width=1.5pt, black!20!teal] (iniPoint) ++(-6pt, -10pt) -- ++(12pt, 0);
\draw[line width=1.5pt, black!20!teal] (iniPoint) ++(-6pt, -14pt)-- ++(12pt, 0);
\end{scope} 
}, 
#1
}
%===========================================
\tikzset{
    page/.style={
        color  = white ,
        fill   = green ,
        font   =\bfseries\fontsize{25}{25}\selectfont\sffamily ,
        minimum size = .5in ,
        yshift = 0.5in
    }
}
%===============================================
\usepackage{fontawesome5}
\renewcommand{\chaptermark}[1]{%
\markboth{\sffamily\bfseries\color{Blue}#1}{}%
}
\renewcommand{\sectionmark}[1]{%
\markright{\sffamily\bfseries\color{white}#1}%
}

\newcommand{\SideBarNew}{\AddToShipoutPicture{
        \begin{tikzpicture}[remember picture,overlay]
        %\draw[pBlue] (current page.north west)--([shift={(1.5,0)}]current page.north west){[rounded corners=5pt]--++(0,-13)--++(-120:2)}
        %|-(current page.south west)--cycle;
        \node (orangebox) [minimum width=17cm,minimum height=1.5cm, fill=orange,draw=none, line width=0pt,align=center,anchor=north east] at ($(current page.north east)+(-1.2,-1)$) {\leftmark\\\rightmark};
        \node [draw=none,line width=0pt,fill=green,anchor=north east] at ($(current page.north east)+(-1.2,-1)$)[font=\color{white}\fontsize{1.3cm}{1.3cm}\selectfont,minimum height=1.5cm,minimum width=2cm] {\ifnum\value{chapter}<10 0\fi\thechapter};
        \node [above=5pt of orangebox,inner sep=0pt] {\parbox{17cm}{\sffamily$\color{Cyan}\blacksquare$ Niveau : $2^e$ Bac.SM\hfill {\color{blue}\faFacebook}\space X-MATH\'EMATIQUES\hfill$\color{Cyan}\blacksquare$ Prof : Yassine Aouami}};
        %=========================================================
        \draw[line width=1.5pt, black!20!teal]
        ([shift={(-.75, -.75)}]current page.north east) coordinate (A)|-([xshift=2cm,yshift=1cm]current page.south west)
        to[out=180, in=-90] ([xshift=1cm,yshift=2cm]current page.south west)coordinate (B)
        -- ([yshift=-1cm]B|-current page.north west)--++(1,0)coordinate (C);
        \draw[black!20!teal,line width=4pt] (C)-- ++(10pt, 10pt) -- ++(10pt, -10pt)
        -- ++(-10pt, -10pt)--cycle;
        %=================================================
        \draw[line width=3pt, black!20!teal] ([xshift=-12pt]A) -- ++(24pt, 0);
        \draw [line width=1.5pt, black!20!teal] (A) ++(6pt, -10pt) -- ++(-12pt, 0);
        \draw[line width=1.5pt, black!20!teal] (A) ++(6pt, -14pt)-- ++(-12pt, 0);
        %================================================
        \node[right,page] at ([yshift=-5pt]current page.south)
        {\thepage} ;
        %============================================
        \fill[green] (current page.north west)--([shift={(.5,0)}]current page.north west){--++(0,-14)--++(-120:.75)}
        |-(current page.south west)--cycle;
        %=====================================
        \fill[col]([xshift=6pt]current page.south west) rectangle ++(6,.8);
        \node[white] at([shift={(3,.4)}]current page.south west){{\Large\bfseries{footer}}};
        \end{tikzpicture}
}}
\newcommand{\SideBarNewCurrent}{\AddToShipoutPicture*{%
}}

%start label for new stuff
\newcommand{\NEW}{\SideBarNew}
\makeatletter
\let\ps@plain\ps@empty
\makeatother
%=================================================
\begin{document}
\pagestyle{empty}
\NEW
\setcounter{chapter}{4}
\chapter{Function logarithmes et exponentielles}
\section{Feuille d'exercices \texttt{\#}03}\clearpage

\begin{exo}{Convergence faible dans un espace pr\'ehilbertien}
Soit $H$ un espace pr\'ehilbertien r\'eel et soit $(x_n)_{n\ge0}$ une suite d'\'el\'ements de $H$.
\begin{enumerate}
\item Montrer que si $(x_n)_{n\ge0}$ converge faiblement, alors la limite est unique.
\item Montrer que si $(x_n)_{n\ge0}$ converge fortement alors $(x_n)_{n\ge0}$ converge 
\end{enumerate}
\end{exo}
\clearpage
\section{Feuille d'exercices \texttt{\#}04}
\end{document}

enter image description here