\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{mathweb}[%
  2024/04/10\space v2.00\space
  mathweb document class. St\'ephane Pasquet for mathweb.fr%
]

\LoadClass[12pt,a4paper,openany]{book}
\RequirePackage[table]{xcolor}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[french]{babel}
\RequirePackage[bmargin = 30mm, tmargin = 2cm, lmargin = 2cm, rmargin = 2cm]{geometry}
\RequirePackage{eso-pic}
\RequirePackage{tikz,pgf}
	\usetikzlibrary{calc,decorations.pathmorphing,shapes.geometric,spy,shapes.symbols,shadows}
	\usetikzlibrary{decorations.pathreplacing,calligraphy} 
	% pour faire des accolades -- ex: \draw [decorate,decoration = {calligraphic brace,amplitude=10pt,raise=3pt}] (5.5,3) --  (5.5,0);
\RequirePackage{fancyhdr}
\RequirePackage{titletoc}
\RequirePackage[newlinetospace]{titlesec}
\RequirePackage[upright]{fourier}
\RequirePackage{duerer}
\RequirePackage{emerald}
\RequirePackage{varwidth}
\RequirePackage{tcolorbox}
	\tcbuselibrary{skins,breakable,theorems,listingsutf8,xparse,external}
	\tcbset{external/prefix=python/}
\RequirePackage{enumitem}
\RequirePackage{minitoc}	
	\renewcommand{\mtctitle}{} 
	\mtcsetrules{minitoc}{off}
\RequirePackage{cellspace}
	\setlength{\cellspacebottomlimit}{3pt}
	\setlength{\cellspacetoplimit}{3pt}
	% patch
	\let\@startpbox@action\@startpbox
	% fin du patch
\RequirePackage{ulem}
\RequirePackage{pas-math,pas-tableur}
\RequirePackage{multicol,multirow}
\RequirePackage{cancel}
\RequirePackage{numprint}
\RequirePackage{tkz-tab,tkz-fct,tkz-euclide}
\RequirePackage{tabularx}
\RequirePackage{etoolbox}
\RequirePackage{xstring}
\RequirePackage{diagbox}
\RequirePackage{systeme}
\RequirePackage{eurosym}
\RequirePackage{xlop}
\RequirePackage{fontawesome}
\RequirePackage[colorlinks=true,linkcolor=orange]{hyperref}

\setlength{\parindent}{0pt}

\input{mathweb.colors}
\input{mathweb.couverture}
\input{mathweb.shadow}
\input{mathweb.pagestyle.chapter}
\input{mathweb.pagestyle.main}
\input{mathweb.pagestyle.exercices}
\input{mathweb.pagestyle.sections}
\input{mathweb.skins.boxes}
\input{mathweb.lists}
\input{mathweb.toc}
\input{mathweb.listings}
%\input{mathweb.part}
\input{mathweb.algoeuclide}

\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

%

\let\oldmainmatter\mainmatter
\renewcommand{\mainmatter}{\oldmainmatter\pagestyle{main}}

\let\oldfrontmatter\frontmatter
\renewcommand{\frontmatter}{\oldfrontmatter\pagestyle{maintoc}}

\newif\ifback
\backfalse
\let\oldbackmatter\backmatter
\renewcommand{\backmatter}{\oldbackmatter\backtrue}

\newcommand{\partie}[1]{\bgroup\fontfamily{lmss}\selectfont\large\textcolor{black}{Partie #1}\egroup\vskip5mm}
\DeclareMathOperator{\card}{Card}
\AtEndDocument{%
	\addtocontents{toc}{\protect\vspace*{1cm}}%
	\putnbexosintoc%
}

%%% repère 

\newcommand{\rep}[4]{% xmin,ymin,xmax,ymax
\draw[gray,dashed] (#1,#2) grid (#3,#4);
\draw[->,>=stealth'] (#1,0) -- (#3,0);
\draw[->,>=stealth'] (0,#2) -- (0,#4);
\draw[thick,red,->,>=stealth'] (0,0) -- (1,0) node[midway,below] {$\vv{\imath}$};
\draw[thick,red,->,>=stealth'] (0,0) -- (0,1) node[midway,left] {$\vv{\jmath}$};
\node[below left] at (0,0) {O};
\clip (#1,#2) rectangle (#3,#4);
}

\newcommand{\youtube}[1] {}

\newcommand{\IMGerreur}{\includegraphics[width=16px]{erreur.png}}
