diff options
Diffstat (limited to 'macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex')
-rw-r--r-- | macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex b/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex index cdd853a8fa..336b10651d 100644 --- a/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex +++ b/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex @@ -106,6 +106,7 @@ \readlist*\PfCOrdreOperations{\faa}% \readlist*\PfCListeCibleNombres{\PfCFooNombres}% \readlist*\PfCListeCibleOperations{\PfCCQOListeOperations}% + \reademptyitems% % On détermine les solutions \xdef\PfCListeSolution{\fpeval{\PfCCibleQO-\PfCListeCibleNombres[1]}}% \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO-\PfCListeCibleNombres[2]}}% @@ -130,16 +131,17 @@ \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{/}[\PfCTestSlash]% \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{d}[\PfCTestDE]% \xintifboolexpr{\PfCTestDE==0}{% - \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\times\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}% - \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[8]}}\times\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}% + \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\PfCSymbolTimes\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}% + \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[8]}}\PfCSymbolTimes\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}% }{% - \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\xintifboolexpr{\PfCTestEtoile==0}{\div}{\xintifboolexpr{\PfCTestSlash==0}{\times}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}% - \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[\PfCCibleRang]}}\xintifboolexpr{\PfCTestEtoile==0}{\div}{\xintifboolexpr{\PfCTestSlash==0}{\times}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}% + \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\xintifboolexpr{\PfCTestEtoile==0}{\PfCSymbolDiv}{\xintifboolexpr{\PfCTestSlash==0}{\PfCSymbolTimes}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}% + \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[\PfCCibleRang]}}\xintifboolexpr{\PfCTestEtoile==0}{\PfCSymbolDiv}{\xintifboolexpr{\PfCTestSlash==0}{\PfCSymbolTimes}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}% }% }% \setsepchar{,}\ignoreemptyitems% \readlist*\PfCCibleQOListeEnonce{\PfCFooRetiensTout}% \readlist*\PfCCibleQOListeSolution{\PfCFooRetiensToutAvecSol}% + \reademptyitems \foreachitem\compteur\in\PfCCibleQOListeEnonce{\expandafter\UpdatetoksCibleQO\compteur\nil}% \foreachitem\compteur\in\PfCCibleQOListeSolution{\expandafter\UpdatetoksCibleQOO\compteur\nil}% \BuildCibleQuatreOperations{\PfCCibleQO}{\the\toklistecibleA}{\the\toklistecibleab}{\useKV[CibleQO]{Style}}% @@ -232,44 +234,44 @@ trace Op[k] shifted A[k]; endfor; \end{mplibcode} - \else - \begin{mpost}[mpsettings={\BuildCibleQOCode;Rayon:=\useKV[CibleQO]{Rayon};boolean Solution;Solution=\useKV[CibleQO]{Solution};}] - string Style; - Style=#4; - Cible=#1; - - picture Op[]; - - if Solution: - LectureOperationsPDF(#3) - else: - LectureOperationsPDF(#2) - fi; - - path cc; - pair O,A[]; - O=(0,0); - picture CIBLE; - CIBLE=image(label(LATEX("\Huge\bfseries"&decimal(Cible)),O)); - draw CIBLE; - cc=cercles(O,Rayon); - path Fleche; - for k=0 upto 7: - A[k]=1.1[O,pointarc(cc,k*45)]; - Fleche:=((0,0)--(center Op[k] shifted A[k])) cutbefore cercles(O,0.45*Rayon) cutafter (polygone(llcorner Op[k],lrcorner Op[k],urcorner Op[k],ulcorner Op[k]) shifted A[k]); - if Style="<->": - drawdblarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche); - elseif Style="<-": - drawarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche); - elseif Style="->": - drawarrow (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche); - elseif Style="-": - draw (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche); - elseif Style="--": - label(LATEX("$=$") rotated (k*45) ,point(0.5*length Fleche) of Fleche); - fi; - trace Op[k] shifted A[k]; - endfor; - \end{mpost} +% \else +% \begin{mpost}[mpsettings={\BuildCibleQOCode;Rayon:=\useKV[CibleQO]{Rayon};boolean Solution;Solution=\useKV[CibleQO]{Solution};}] +% string Style; +% Style=#4; +% Cible=#1; +% +% picture Op[]; +% +% if Solution: +% LectureOperationsPDF(#3) +% else: +% LectureOperationsPDF(#2) +% fi; +% +% path cc; +% pair O,A[]; +% O=(0,0); +% picture CIBLE; +% CIBLE=image(label(LATEX("\noexpand\Huge\noexpand\bfseries"&decimal(Cible)),O)); +% draw CIBLE; +% cc=cercles(O,Rayon); +% path Fleche; +% for k=0 upto 7: +% A[k]=1.1[O,pointarc(cc,k*45)]; +% Fleche:=((0,0)--(center Op[k] shifted A[k])) cutbefore cercles(O,0.45*Rayon) cutafter (polygone(llcorner Op[k],lrcorner Op[k],urcorner Op[k],ulcorner Op[k]) shifted A[k]); +% if Style="<->": +% drawdblarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche); +% elseif Style="<-": +% drawarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche); +% elseif Style="->": +% drawarrow (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche); +% elseif Style="-": +% draw (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche); +% elseif Style="--": +% label(LATEX("$=$") rotated (k*45) ,point(0.5*length Fleche) of Fleche); +% fi; +% trace Op[k] shifted A[k]; +% endfor; +% \end{mpost} \fi% }% |