%%% VARS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \def\chapitreNr{6}
    \def\chapitreTitre{La tension électrique}
    \def\titre{Fiche d'exercice}
    \def\classe{4\textsuperscript{e}}
    \def\allowedBlankSpace{2cm}
%%% END VARS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt,a4paper]{article}
\usepackage[margin=1cm,includehead,includefoot,footskip=9.5pt]{geometry}
\usepackage{amsmath,amssymb ,amsfonts,xcolor,tikz}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{ifthen}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{needspace}
\usetikzlibrary{calc}
\usepackage{enumitem}
\usepackage[most]{tcolorbox}
\usepackage{fontspec}
\usepackage[siunitx,european, straightvoltages,RPvoltages]{circuitikz}
\usepackage{svg}
\usepackage{float}
\usepackage{lastpage}
\usepackage{tabularx}


\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

%%% COLORS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \definecolor{col1}{RGB}{12, 102, 98}
    \definecolor{col2}{RGB}{50, 50, 50}
    \definecolor{col3}{RGB}{100, 100, 100}
    \definecolor{col4}{RGB}{10, 100, 100}
%%% END COLORS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\raggedright
%%% FONTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setmainfont{Gillius ADF No2}
%\setmainfont{Liberation Sans}[Scale=0.85]
%\setromanfont{Roboto}
%\setromanfont{Gillius ADF No2}
%\setsansfont{Roboto}
%%% END FONTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlist{nolistsep}

%%% HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \setlength{\headheight}{15pt}
    \pagestyle{fancy}
    \fancyhf{}
    \rhead{\chapitreNr.\ \chapitreTitre}
    \lhead{
    \tikz[baseline=(char.base)]\node[anchor=north west, fill,rectangle, rounded corners,inner xsep=7pt, fill=black!30,text=black](char){\classe};%}
       \quad \titre\ \ifthenelse{\pageref{LastPage}<2}{}{\thepage /\pageref{LastPage}}
        }
    \rfoot{\tiny 2021-2022}
%%% END HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%% SIDE TITLE %%%%%%%%%
%    \usepackage{eso-pic}
%    \AddToShipoutPictureBG{
%    \begin{tikzpicture}[remember picture,overlay]
%    \fill[col2] (current page.north west)--++(0.9,0)--++(0,-7.5)to[out=-90,in=0]++(-0.9,-0.5)--cycle;
%    \node[white,rotate=90] at([shift={(0.45,-4.7)}]current page.north west){{\Large \textbf{\sffamily Exercices \chapitreNr. \ \chapitreTitre}}};
%    \end{tikzpicture}
%    }
%%%%%%%%% END SIDE TITLE %%%%%%%%%

%%% SET LENGTH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \setlength{\headsep}{5pt}
    \setlength{\columnsep}{.5cm}
    \setlength{\columnseprule}{0.1pt}
    \setlength{\parindent}{0pt}%
    \setlength{\marginparsep}{0cm}

%%% END SET LENGTH %%%%%%%%%%%%%%%%%%%%%%%%%

\newcounter{exo}
%%% MACROS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	\newcommand{\note}[1]{
	\begin{tcolorbox}[colback=col4!30,frame hidden,sharp corners,
    boxrule=0pt,leftrule=4pt,colframe=col4]
	#1
	\end{tcolorbox}
	}
	\newcommand{\dexo}[1]{
	
	
		\begin{tcolorbox}[breakable,sharp corners, enhanced,frame hidden,boxsep=0pt,
		colback=black!5,boxsep=3pt,
		left=2pt,right=0pt,top=0pt,bottom=0pt]
	    \ifthenelse{\equal{#1}{}}{\begin{wrapfigure}[2]{l}{1.2cm}\vspace{-\baselineskip}}

	           \begin{tikzpicture}	
    	        
    	   
    	        
        	    \node[rectangle,fill=black!40,draw=white,text=white,minimum width = 1.4cm,minimum height = .8cm] (r) at (0,0) {\large\bfseries\textbf{\centering\stepcounter{exo}\ifthenelse{\arabic{exo}<10}{\chapitreNr.0\arabic{exo}}{\chapitreNr.\arabic{exo}}}};
        	    
        	       \ifthenelse{\equal{#1}{}}{}{
    	        \node[anchor=west, xshift=.8cm,font=\sffamily\bfseries]{\large#1};}  
    	        
        	    
    	        \end{tikzpicture}
    	        \ifthenelse{\equal{#1}{}}{
    	     \end{wrapfigure}   
    	        }
	      
		
%	\begin{tcolorbox}[breakable, enhanced,frame hidden,colback=white,boxsep=0pt,left=0pt,right=0pt,top=0pt,bottom=0pt]
%\begin{wrapfigure}{l}{0.3\textwidth}
%\begin{tikzpicture}
    
    
 %   \node[draw,rectangle, minimum height=2\baselineskip] at (0,0){label};
%    	\node[fill=black!50,font=\sffamily\bfseries, anchor=west,text width=1cm,text badly centered](A){{\color{white} \textbf{\centering\stepcounter{exo}\ifthenelse{\arabic{exo}<10}{\chapitreNr.0\arabic{exo}}{\chapitreNr.\arabic{exo}}}}};

    	%\ifthenelse{\equal{#1}{}}{}{\node[xshift=2.1cm,font=\sffamily\bfseries]{\large#1};}    	
    	%\end{tikzpicture}
    	%\end{wrapfig}
%    	\ifthenelse{\equal{#1}{}}{}{\\}
    	
	}
	
	\def\fexo{\end{tcolorbox}\pagebreak[3]\needspace{\allowedBlankSpace}
	}
	
	\def\dquest{\begin{enumerate}[noitemsep,leftmargin=*,label=\textbf{\arabic*.}]}
	
	\def\fquest{\end{enumerate}}
	\def\fin{\end{document}}
    \newcommand*\circled[1]{\tikz[baseline=(char.base)]{
    \node[shape=circle,fill=black!30,text=white,draw=white,inner sep=2pt] (char) {#1};}}
%%% END MACROS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{multicols}{2}


%%% CONTENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\dexo{}
Trois lampes ont été oubliées sur une paillasse. Emma doit les ranger mais leurs valeurs nominales ont été effacées.
Elle est certaine d’avoir les lampes suivantes : « 3,5 V • 100 mA », « 3,5 V • 300 mA » et « 12V • 100 mA ».
Emma dispose, en plus des trois lampes, d’un multimètre, de fils de connexion et d’une pile plate.\par
Expliquer, en proposant un protocole expérimental, comment doit procéder Emma pour identifier chaque lampe.
\fexo

\dexo{}
Solal réalise le circuit suivant avec un moteur (M), un interrupteur (K) et un générateur (G). L'interrupteur est fermé.

\includegraphics[width=0.9\columnwidth]{exp_img1.png}\par
\dquest
\item
Compléter le tableau suivant :\par
\noindent\begin{tabular}{|C{1.8cm}|C{1.8cm}|C{1.8cm}|C{1.8cm}|}
\hline
$U_{G}$ & $U_K$ & $U_{M}$ & $I$ \\
\hline
                  &                           &               &  \\
\hline
\end{tabular}

\item
Que deviennent ces mesures si Solal ouvre l'interrupteur ?
\fquest
\fexo


\end{multicols}

\fin