\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{3ndpatchwork}[Mid 2023 Third patchwork]

% https://www.overleaf.com/latex/templates/lecture-outline-template/zprvgkrcwhmv
% https://www.overleaf.com/latex/templates/sticky-notes/ftrvjddrmbwx
% https://www.overleaf.com/latex/templates/fun-template-1/drwvdzsrpgzz

\usepackage{amsmath,amsthm,amssymb, dsfont, geometry, cancel, float, wrapfig, bbding} % Le dernier c'est pour \donc
\usepackage[italicdiff]{physics}
\usepackage{empheq}
% Pour les postits
%\usepackage{adjustbox, wrapfig}
%\usepackage[most]{tcolorbox}
\usepackage{multirow} % Pour les tableaux avec cellules sur plusieurs colonnes https://www.tablesgenerator.com/
\usepackage{enumitem,bm}

\geometry{tmargin=.75in, bmargin=.75in, lmargin=.75in, rmargin = .75in}
\setlength{\parindent}{0pt}


\usepackage[T1]{fontenc}
\usepackage[french]{babel}

% Mémo : matrix, pmatrix, bmatrix, Bmatrix, vmatrix, Vmatrix
% None, parentheses, brackets, curly brackets, vertical, 2x vertical bar


\usepackage{pgfplots,tikz}
\usepgfplotslibrary{external}
\tikzexternalize[prefix=tikz-figures/]
\usetikzlibrary{calc, positioning, intersections}

\pgfmathdeclarefunction{gauss}{2}{\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}}

\setlist[itemize]{label=\textbullet}
\setlist{leftmargin=5mm}

%%%%%%%%%%  INDEX  %%%%%%%%%%


\usepackage{euscript}


\usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}
\usepackage{calc, makeidx, titletoc, hyperref, bookmark, mathptmx}
\hypersetup{hidelinks}


\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
	% display heading, like subsubsection
	{-3.25ex\@plus -1ex \@minus -.2ex}%
	{1.5ex \@plus .2ex}%
	{\normalfont\normalsize\bfseries}}



%%%%%%%%%  COULEURS  %%%%%%%%%





\definecolor{BgYellow}{HTML}{FFF59C}
\definecolor{FrameYellow}{HTML}{F7A600}

\definecolor{jaune}{RGB}{248, 194, 145}
\definecolor{bleu}{RGB}{34, 166, 179}
\definecolor{rouge}{RGB}{215, 56, 104}
\definecolor{vert}{RGB}{22, 160, 133}
\definecolor{gris}{RGB}{52, 73, 94}




\newcommand{\defi}{{\color{vert}\bfseries Définition : }}
\newcommand{\defs}{{\color{vert}\bfseries Définitions : }}
\newcommand{\prop}{{\color{rouge}\bfseries Propriété : }}
\newcommand{\props}{{\color{rouge}\bfseries Propriétés : }}
\newcommand{\thm}{{\color{rouge}\bfseries Théorème : }}
\newcommand{\fo}{{\color{rouge}\bfseries Formule : }}
\newcommand{\ex}{{\color{black}\bfseries Exemple : }}
\newcommand{\exs}{{\color{black}\bfseries Exemples : }}
\newcommand{\exo}{{\color{black}\bfseries Exercice : }}
\newcommand{\prob}{{\color{black}\bfseries Problème : }}
\newcommand{\dem}{{\color{black}\bfseries Démonstration : }}
\newcommand{\atta}{{\color{jaune}\bfseries Attention : }}
\newcommand{\rem}{{\color{jaune}\bfseries Remarque : }}
\newcommand{\rap}{{\color{jaune}\bfseries Rappel : }}
\newcommand{\nota}{{\color{jaune}\bfseries Notation : }}

\newcommand{\rouge}[1]{{\color{rouge}\bfseries #1}}
\newcommand{\noir}[1]{{\color{black}\bfseries #1}}
\newcommand{\verte}[1]{{\color{vert}\bfseries #1}}
\newcommand{\jaune}[1]{{\color{jaune}\bfseries #1}}



%%%%%%%%% OPTIONS  %%%%%%%%%

\newcommand{\chepa}{}

\DeclareOption{chapitres}{
	\makeatletter
	% we use \prefix@<level> only if it is defined
	\renewcommand{\@seccntformat}[1]{%
		\ifcsname prefix@#1\endcsname
		\csname prefix@#1\endcsname
		\else
		\csname the#1\endcsname\quad
		\fi}
	% define \prefix@section
	\newcommand\prefix@section{Chapitre \thesection : }
	\makeatother
}
\DeclareOption{sections}{
	\makeatletter
	% we use \prefix@<level> only if it is defined
	\renewcommand{\@seccntformat}[1]{%
		\ifcsname prefix@#1\endcsname
		\csname prefix@#1\endcsname
		\else
		\csname the#1\endcsname\quad
		\fi}
	% define \prefix@section
	\newcommand\prefix@section{Section \thesection : }
	\makeatother
}
\DeclareOption{chepa}{
	\renewcommand\chepa{%
		\makebox[1.4em][c]{%
			\makebox[0pt][c]{\raisebox{.1em}{\small!}}%
			\makebox[0pt][c]{\color{red}\Large$\bigtriangleup$}}}%
}
\DeclareOption{english}{
	\renewcommand{\defi}{{\color{vert}\bfseries Definition: }}
	\renewcommand{\defs}{{\color{vert}\bfseries Definitions: }}
	\renewcommand{\prop}{{\color{rouge}\bfseries Property: }}
	\renewcommand{\props}{{\color{rouge}\bfseries Properties: }}
	\renewcommand{\thm}{{\color{rouge}\bfseries Theorem: }}
	\renewcommand{\fo}{{\color{rouge}\bfseries Formula: }}
	\renewcommand{\ex}{{\color{black}\bfseries Example: }}
	\renewcommand{\exs}{{\color{black}\bfseries Examples: }}
	\renewcommand{\exo}{{\color{black}\bfseries Exercice: }}
	\renewcommand{\prob}{{\color{black}\bfseries Problem: }}
	\renewcommand{\dem}{{\color{black}\bfseries Proof: }}
	\renewcommand{\atta}{{\color{jaune}\bfseries Warning: }}
	\renewcommand{\rem}{{\color{jaune}\bfseries Note: }}
	\renewcommand{\rap}{{\color{jaune}\bfseries Reminder: }}
	\renewcommand{\nota}{{\color{jaune}\bfseries Notation: }}
}
\ProcessOptions\relax

% \setcounter{section}{5} % MIEUX

\newcommand\warning{%
	\makebox[1.4em][c]{%
		\makebox[0pt][c]{\raisebox{.1em}{\small!}}%
		\makebox[0pt][c]{\color{red}\Large$\bigtriangleup$}}}%
	


%%%%%%%%%%  IMAGES & COLONNES %%%%%%%%%%




\newcommand{\img}[2]{\includegraphics[width=#2]{Annexes/#1.png}}
\newcommand{\imgtxt}[2]{\begin{minipage}{.35\textwidth}\includegraphics[width=\textwidth]{Annexes/#1.png}\end{minipage}\hfill\begin{minipage}{.6\textwidth}#2\end{minipage}}
\newcommand{\txtimg}[2]{\begin{minipage}{.6\textwidth}#1\end{minipage}\hfill\begin{minipage}{.35\textwidth}\includegraphics[width=\textwidth]{Annexes/#2.png}\end{minipage}}
\newcommand{\txtimgp}[4]{\begin{minipage}{#3}#1\end{minipage}\hfill\begin{minipage}{#4}\includegraphics[width=\textwidth]{Annexes/#2.png}\end{minipage}}
\newcommand{\txttxt}[2]{\begin{minipage}{.5\textwidth}#1\end{minipage}\hfill\begin{minipage}{.5\textwidth}#2\end{minipage}}
\newcommand{\txttxtp}[3]{\begin{minipage}{\textwidth-0.5cm-#3}#1\end{minipage}\hfill\begin{minipage}{#3}#2\end{minipage}}


\newcommand{\timg}[3]{\begin{minipage}{\textwidth-0.5cm-#3}#1\end{minipage}\hfill\begin{minipage}{#3}\img{#2}{#3}\end{minipage}}



%%%%%%%%%% REDÉFINITIONS  %%%%%%%%%%




\let\phi\varphi
\let\bar\overline
\let\vec\overrightarrow
\renewcommand{\deg}{^\circ}
\newcommand{\forceindent}{\leavevmode{\parindent=1.5em\indent}}




%%%%%%%%%% RACCOURCIS  %%%%%%%%%%




\newcommand{\lin}{\mathcal{L}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\K}{\mathbb{K}}
\newcommand{\hil}{\joli{H}}
\newcommand{\pnt}{\boldsymbol{\cdot}}
\newcommand{\circonf}{\mathbin{\char`\^}}
\newcommand{\grandefleche}{\longrightarrow}
\newcommand{\gf}{\longrightarrow}
\newcommand{\GrandeFleche}[1]{\xrightarrow{\hspace*{#1cm}}}
\newcommand{\fleche}{\rightarrow}
\newcommand{\fleched}{\leftarrow}
\newcommand{\traitfleche}{\longmapsto}
\newcommand{\tf}{\longmapsto}
\newcommand{\inclu}{\subset}
\newcommand{\Inclu}{\Subset}
\newcommand{\inter}{\cap}
\newcommand{\coeur}{ \quad \text{\Heart}}
\newcommand{\union}{\cup}
\newcommand{\incluegal}{\subseteq}
\newcommand{\inclupasegal}{\subsetneq}
\newcommand{\rond}{\circ}
\newcommand{\doublefleche}{\longleftrightarrow}
\newcommand{\equivalent}{\Leftrightarrow}
\newcommand{\supeq}{\ge}
\newcommand{\infeq}{\le}
\newcommand{\diff}{\ne}
\newcommand{\equival}{\Leftrightarrow}
\newcommand{\moins}{\backslash}
\newcommand{\perpe}{\bot}
\newcommand{\bx}{\barre{x}}
\newcommand{\vectoriel}{\wedge}
\newcommand{\pr}{\oplus}
\newcommand{\incluenvers}{\supset}
\newcommand{\ssi}{\textit{ssi }}
\newcommand{\gradd}{\vect{grad}~}
\newcommand{\comma}{, }
\newcommand{\equals}{= }
\newcommand{\1}{\mathds{1}}
\newcommand{\donc}{{\color{rouge}\HandRight~ }}
\newcommand{\doncc}{\HandRight~ }
\newcommand{\0}{\emptyset}


% Peigne de Dirac
\input cyracc.def
\font\tencyr=wncysc10
\def\cyr{\tencyr\cyracc}
\def\pdirac{\mbox{\cyr SH}}


\newcommand{\chapeau}[1]{\widehat{#1}}
\newcommand{\sous}[2]{\underset{#2}{#1}}
\newcommand{\sur}[2]{\overset{#2}{#1}}
\newcommand{\Sur}[2]{\begin{matrix}#1\\#2\end{matrix}}
\newcommand{\barre}[1]{\overline{#1}}
\newcommand{\cpl}[1]{\underline{#1}} % Complexe
%\newcommand{\joliOLD}[1]{\textcursive{#1}} % mathcal aussi utilisé
\newcommand{\joli}[1]{\EuScript{#1}}
\newcommand{\ch}[1]{\left[#1\right]}
\newcommand{\chff}[1]{\left[#1\right]}
\newcommand{\chf}[1]{\begin{bmatrix}#1\end{bmatrix}}
\newcommand{\chfo}[1]{\left[#1\right[}
\newcommand{\chof}[1]{\left]#1\right]}
\newcommand{\choo}[1]{\left]#1\right[}
\newcommand{\systemd}[1]{\left|\begin{array}{l}#1\end{array}\right.}
\newcommand{\systemb}[1]{\left\{\begin{array}{l}#1\end{array}\right.}
\newcommand{\parmi}[2]{\left(\begin{array}{rcl}#1\\#2\end{array}\right)}
\newcommand{\vecteur}[1]{~\begin{array}{|lcl}#1\end{array}}
\newcommand{\matrice}[1]{\begin{pmatrix}#1\end{pmatrix}}
\newcommand{\matriced}[1]{\begin{vmatrix}#1\end{vmatrix}}
\newcommand{\mtrx}[1]{\begin{matrix}#1\end{matrix}}
\newcommand{\ave}[1]{\langle #1 \rangle}
\newcommand{\A}{\text{\r{A}}}
%\newcommand{\gros}[1]{{\displaystyle #1 }} % Big inline formula
