diff options
Diffstat (limited to 'macros/latex/contrib/customenvs/tex/customenvs.sty')
-rw-r--r-- | macros/latex/contrib/customenvs/tex/customenvs.sty | 1162 |
1 files changed, 1149 insertions, 13 deletions
diff --git a/macros/latex/contrib/customenvs/tex/customenvs.sty b/macros/latex/contrib/customenvs/tex/customenvs.sty index e63ea57f84..a54da462ab 100644 --- a/macros/latex/contrib/customenvs/tex/customenvs.sty +++ b/macros/latex/contrib/customenvs/tex/customenvs.sty @@ -3,9 +3,15 @@ % source pencil...: CC-BY-SA 4.0 https://tex.stackexchange.com/questions/504092/replicating-a-fancy-bordered-text-style-in-latex/504145#504145 \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{customenvs}[2024/06/03 0.1.7 Custom classic environments] +\ProvidesPackage{customenvs}[2024/09/14 0.2.3 Custom classic environments] %====HISTORIQUE +% v 0.2.3 Panneau autoroutier + Panneau Soldes +% v 0.2.2 Flèche évasée, en TikZ +% v 0.2.1 Modification mineure de la gestion des étoiles tikz (baseline) + grille auto tikzpicture +% v 0.2.0 Ajout d'étoiles pour les difficultés d'exercices (2 versions) +% v 0.1.9 tkzBanner + tkzBannerTri + includegraphicsfill +% v 0.1.8 Nutriscore % v 0.1.7 Style perso pour les vignettes % v 0.1.6 DisplaySkip patch + Patchs pas-tableur % v 0.1.5 Boxes for exam title + circled numbers + Vignettes + Small simple boxes creation @@ -676,7 +682,155 @@ } %====EXERCICE PERSO +\newlength{\largstarsempty} +\newlength{\largstarsmid} +\newlength{\largstarfull} +\newlength{\largmaxstars} + +%commande annexe tkzlevelstars [en] + [fr] +\usetikzlibrary{shapes.geometric} + +\newlength{\tmphauteuretoiles} +\newlength{\tmpprofondeuretoiles} +\newlength{\tmpoffsetetoiles}\setlength{\tmpoffsetetoiles}{0.25pt} + +\defKV[levelstars]{% + colframe=\def\tkzLevelStarsColor{#1}, + colback=\def\tkzLevelStarsColorBg{#1}, + offset=\setlength{\tmpoffsetetoiles}{#1}, + maxlevel=\def\tkzLevelStarsMaxLevel{#1} +} + +\setKVdefault[levelstars]{% + colframe=black, + colback=gray, + offset={0.025em}, + maxlevel=3, + valign=true +} + +\NewDocumentCommand{\tkzLevelStars}{ O{} m }{% + %lectures des clés + \restoreKV[levelstars]% + \setKV[levelstars]{#1}% + %dimensions + \settototalheight{\tmphauteuretoiles}{\hbox{azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN}}% + \setlength{\tmphauteuretoiles}{0.95\tmphauteuretoiles}% + \ifboolKV[levelstars]{valign}% + {% + \settodepth{\tmpprofondeuretoiles}{\hbox{azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN}}% + \begin{tikzpicture}[baseline={-1.25\tmpprofondeuretoiles},fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\tmphauteuretoiles},line width={0.04\tmphauteuretoiles}] + }% + {% + \begin{tikzpicture}[fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\tmphauteuretoiles},line width={0.04\tmphauteuretoiles}] + }% + \foreach \X in {1,...,\tkzLevelStarsMaxLevel}{% + \xdef\tmpxfill{\xintfloateval{min(1,max(1+#2-\X,0))}}% + %\pgfmathsetmacro{\tmpxfill}{min(1,max(1+#2-\X,0))} + \path ({\X*(\tmphauteuretoiles+\tmpoffsetetoiles)},0) node[star,draw,star point height={0.25\tmphauteuretoiles},minimum size={\tmphauteuretoiles},inner sep=0pt,path picture={\fill (path picture bounding box.south west) rectangle ([xshift=\tmpxfill*0.9515*\tmphauteuretoiles]path picture bounding box.north west);}]{}; + } + \end{tikzpicture}% +} + +\defKV[tkznivetoiles]{% + Couleur=\def\tkzLevelStarsColor{#1}, + CouleurFond=\def\tkzLevelStarsColorBg{#1}, + Offset=\setlength{\tmpoffsetetoiles}{#1}, + NiveauMax=\def\tkzLevelStarsMaxLevel{#1} +} + +\setKVdefault[tkznivetoiles]{% + Couleur=black, + CouleurFond=gray, + Offset={0.025em}, + NiveauMax=3, + AlignV=true +} + +\NewDocumentCommand{\tkzEtoiles}{ O{} m }{% + %lectures des clés + \restoreKV[tkznivetoiles]% + \setKV[tkznivetoiles]{#1}% + %dimensions + \settototalheight{\tmphauteuretoiles}{\hbox{azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN}}% + \setlength{\tmphauteuretoiles}{0.95\tmphauteuretoiles}% + \ifboolKV[tkznivetoiles]{AlignV}% + {% + \settodepth{\tmpprofondeuretoiles}{\hbox{azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN}}% + \begin{tikzpicture}[baseline={-1.25\tmpprofondeuretoiles},fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\tmphauteuretoiles},line width={0.04\tmphauteuretoiles}] + }% + {% + \begin{tikzpicture}[fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\tmphauteuretoiles},line width={0.04\tmphauteuretoiles}] + }% + \foreach \X in {1,...,\tkzLevelStarsMaxLevel}{% + \xdef\tmpxfill{\xintfloateval{min(1,max(1+#2-\X,0))}}% + %\pgfmathsetmacro{\tmpxfill}{min(1,max(1+#2-\X,0))} + \path ({\X*(\tmphauteuretoiles+\tmpoffsetetoiles)},0) node[star,draw,star point height={0.25\tmphauteuretoiles},minimum size={\tmphauteuretoiles},inner sep=0pt,path picture={\fill (path picture bounding box.south west) rectangle ([xshift=\tmpxfill*0.9515*\tmphauteuretoiles]path picture bounding box.north west);}]{}; + } + \end{tikzpicture}% +} + +%commande annexe ;-) +\NewDocumentCommand\NiveauDiffExos{ O{3} m }{%avec des demis ?? + %les tailles de boîtes + \settowidth{\largstarsempty}{{\faStar[regular]}}% + \settowidth{\largstarsmid}{{\faIcon{star-half-alt}}}% + \settowidth{\largstarfull}{{\faStar}}% + \pgfmathsetlength{\largmaxstars}{max(\largstarsempty,\largstarsmid,\largstarfull)}% + %les calculs intermédiaires + \xintifboolexpr{#1 < 0}{\xdef\tmpstarsmax{3}}{\xdef\tmpstarsmax{#1}}%on met à 3 si pas valide + \xintifboolexpr{#2 >= 0 'and' #2 <= \tmpstarsmax 'and' isint(2*#2) == 1}{\xdef\tmpstars{#2}}{\xdef\tmpstars{0}}%on met à zéro si pas valide + % + \xintifboolexpr{isint(\tmpstars) == 1}% + {% + \xdef\tmpstarsexosfull{\tmpstars}% + \xdef\tmpstarsexosmid{0}% + \xdef\tmpstarsexosempty{\xinteval{\tmpstarsmax-\tmpstars}}% + }% + {% + \xdef\tmpstarsexosmid{1}% + \xdef\tmpstarsexosfull{\xinteval{(\tmpstars-0.5)}}% + \xdef\tmpstarsexosempty{\xinteval{\tmpstarsmax-1-\tmpstarsexosfull}}% + }% + %affichage des full + \xintifboolexpr{\tmpstarsexosfull > 0}{\xintFor* ##1 in {\xintSeq{1}{\tmpstarsexosfull}}\do{\makebox[\largmaxstars][c]{\faStar}}}{}% + %affichage des mid + \xintifboolexpr{\tmpstarsexosmid > 0}{\xintFor* ##1 in {\xintSeq{1}{\tmpstarsexosmid}}\do{\makebox[\largmaxstars][c]{\faIcon{star-half-alt}}}}{}% + %affichage des vides + \xintifboolexpr{\tmpstarsexosempty > 0}{\xintFor* ##1 in {\xintSeq{1}{\tmpstarsexosempty}}\do{\makebox[\largmaxstars][c]{\faStar[regular]}}}{}% +} + +%commande annexe [en] ;-) +\NewDocumentCommand\DiffLevelStars{ O{3} m }{%avec des demis ?? + %les tailles de boîtes + \settowidth{\largstarsempty}{{\faStar[regular]}}% + \settowidth{\largstarsmid}{{\faIcon{star-half-alt}}}% + \settowidth{\largstarfull}{{\faStar}}% + \pgfmathsetlength{\largmaxstars}{max(\largstarsempty,\largstarsmid,\largstarfull)}% + %les calculs intermédiaires + \xintifboolexpr{#1 < 0}{\xdef\tmpstarsmax{3}}{\xdef\tmpstarsmax{#1}}%on met à 3 si pas valide + \xintifboolexpr{#2 >= 0 'and' #2 <= \tmpstarsmax 'and' isint(2*#2) == 1}{\xdef\tmpstars{#2}}{\xdef\tmpstars{0}}%on met à zéro si pas valide + % + \xintifboolexpr{isint(\tmpstars) == 1}% + {% + \xdef\tmpstarsexosfull{\tmpstars}% + \xdef\tmpstarsexosmid{0}% + \xdef\tmpstarsexosempty{\xinteval{\tmpstarsmax-\tmpstars}}% + }% + {% + \xdef\tmpstarsexosmid{1}% + \xdef\tmpstarsexosfull{\xinteval{(\tmpstars-0.5)}}% + \xdef\tmpstarsexosempty{\xinteval{\tmpstarsmax-1-\tmpstarsexosfull}}% + }% + %affichage des full + \xintifboolexpr{\tmpstarsexosfull > 0}{\xintFor* ##1 in {\xintSeq{1}{\tmpstarsexosfull}}\do{\makebox[\largmaxstars][c]{\faStar}}}{}% + %affichage des mid + \xintifboolexpr{\tmpstarsexosmid > 0}{\xintFor* ##1 in {\xintSeq{1}{\tmpstarsexosmid}}\do{\makebox[\largmaxstars][c]{\faIcon{star-half-alt}}}}{}% + %affichage des vides + \xintifboolexpr{\tmpstarsexosempty > 0}{\xintFor* ##1 in {\xintSeq{1}{\tmpstarsexosempty}}\do{\makebox[\largmaxstars][c]{\faStar[regular]}}}{}% +} +%code ppal \newcounter{numeroexo} \setcounter{numeroexo}{0} \newlength{\eptraitexo} @@ -687,6 +841,8 @@ \newlength{\tmp@image@profondeur} \colorlet{macouleurexo}{blue!50!black} +\colorlet{macouleurexodeco}{blue!50!black} +\colorlet{macouleurexodecofond}{blue!50!black} \newcommand\tmpstyleexo{\bfseries\LARGE\sffamily}% \newcommand\tmplabelexo{Exercice~}% @@ -694,15 +850,21 @@ \defKV[globalstyleexo]{% Libelle=\renewcommand\tmplabelexo{#1},% Couleur=\colorlet{macouleurexo}{#1},% + CouleurDeco=\colorlet{macouleurexodeco}{#1},% + CouleurFondDeco=\colorlet{macouleurexodecofond}{#1},% Police=\renewcommand\tmpstyleexo{#1},% - EpTrait=\setlength{\eptraitexo}{#1} + EpTrait=\setlength{\eptraitexo}{#1},% + EchelleEtoiles=\def\tmpscalestarsexos{#1} } \setKVdefault[globalstyleexo]{% Libelle={Exercice~},% Couleur={blue!50!black},% + CouleurDeco={blue!50!black},% + CouleurFondDeco={macouleurexodeco!50},% Police={\bfseries\LARGE\sffamily},% - EpTrait={1.1pt} + EpTrait={1.1pt},% + EchelleEtoiles=0.85 } \NewDocumentCommand\StyleEnvtExo{ O{} }{% @@ -717,20 +879,20 @@ Type=\def\EnvtExoType{#1},% ComplementTitre=\def\EnvtExoCpltTitre{#1},% CodeDebut=\def\EnvtExoCodeAvant{#1},% - %Couleur=\def\EnvtExoCouleur{#1},% EchelleImage=\def\EnvtExoScaleImg{#1},% Decoration=\def\EnvtExoDeco{#1},% - Trait=\def\EnvtExoTrait{#1} + Trait=\def\EnvtExoTrait{#1},% + Etoiles=\def\EnvtExoEtoiles{#1} } \setKVdefault[EnvtExercice]{ Type=Classique,% ComplementTitre={},% CodeDebut={},% - %Couleur=macouleurexo,% EchelleImage=1.15,% Compteur=true,% Decoration={},% - Trait=plein + Trait=plein,% + Etoiles={} } \NewDocumentEnvironment{EnvtExo}{ !O{} }% @@ -745,18 +907,32 @@ {% %label avec numéro et complément \tmpstyleexo\tmplabelexo\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% + %étoiles eventuelles + \IfStrEq{\EnvtExoEtoiles}{}{}% + {% + \,(\IfSubStr{\EnvtExoEtoiles}{§}% + {% + \StrCut{\EnvtExoEtoiles}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoEtoiles}% + }% + )% + }% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% {pointilles}{\,\dotfill}% {dashilles}{\,\hdashrule{\fill}{\eptraitexo}{\eptraitexospace}}% {non}{\hfill}% + {aucun}{~}% }% %décoration éventuelle \IfSubStr{\EnvtExoDeco}{Icone}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoIcon]% - \,\scalebox{0.85}[0.85]{\EnvtExoIcon}% + \,\textcolor{macouleurexodeco}{\scalebox{0.85}[0.85]{\EnvtExoIcon}}% }{}% \IfSubStr{\EnvtExoDeco}{Ceinture}% {% @@ -766,13 +942,13 @@ \IfSubStr{\EnvtExoDeco}{Chrono}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoChrono]% - \,\pictochrono[ColTime=macouleurexo!50]{\EnvtExoChrono}% + \,\pictochrono[ColTime=macouleurexodeco!50]{\EnvtExoChrono}% }{}% \IfSubStr{\EnvtExoDeco}{Points}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoPts]% \IfStrEq{\EnvtExoPts}{1}{\def\pts{point}}{\def\pts{points}}% - \,(\EnvtExoPts\ \pts)% + \,\textcolor{macouleurexodeco}{(\EnvtExoPts\ \pts)}% }{}% \IfSubStr{\EnvtExoDeco}{Image}% {% @@ -780,12 +956,49 @@ \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% + \IfSubStr{\EnvtExoDeco}{faEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSubStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos[\EnvtExoStarTot]{\EnvtExoStarNb}}}% + }% + {% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos{\EnvtExoStars}}}% + }% + }{}% + \IfSubStr{\EnvtExoDeco}{tkzEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSubStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoStars}% + }% + }{}% }{}% \IfSubStr{\EnvtExoType}{Perso}%OK perso____déco {% \StrBehind{\EnvtExoType}{/}[\EnvtExoLabel]% %label avec numéro et complément \tmpstyleexo\EnvtExoLabel\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% + %étoiles eventuelles + \IfStrEq{\EnvtExoEtoiles}{}{}% + {% + \,(\IfSubStr{\EnvtExoEtoiles}{§}% + {% + \StrCut{\EnvtExoEtoiles}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoEtoiles}% + }% + )% + }% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% @@ -797,7 +1010,7 @@ \IfSubStr{\EnvtExoDeco}{Icone}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoIcon]% - \,\scalebox{0.85}[0.85]{\EnvtExoIcon}% + \,\textcolor{macouleurexodeco}{\scalebox{0.85}[0.85]{\EnvtExoIcon}}% }{}% \IfSubStr{\EnvtExoDeco}{Ceinture}% {% @@ -807,13 +1020,13 @@ \IfSubStr{\EnvtExoDeco}{Chrono}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoChrono]% - \,\pictochrono[ColTime=macouleurexo!50]{\EnvtExoChrono}% + \,\pictochrono[ColTime=macouleurexodeco!50]{\EnvtExoChrono}% }{}% \IfSubStr{\EnvtExoDeco}{Points}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoPts]% \IfStrEq{\EnvtExoPts}{1}{\def\pts{point}}{\def\pts{points}}% - \,(\EnvtExoPts\ \pts)% + \,\textcolor{macouleurexodeco}{(\EnvtExoPts\ \pts)}% }{}% \IfSubStr{\EnvtExoDeco}{Image}% {% @@ -821,6 +1034,30 @@ \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% + \IfSubStr{\EnvtExoDeco}{faEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSuStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos[\EnvtExoStarTot]{\EnvtExoStarNb}}}% + }% + {% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos{\EnvtExoStars}}}% + }% + }{}% + \IfSubStr{\EnvtExoDeco}{tkzEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSubStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoStars}% + }% + }{}% }{}% \endgroup% \def\hrulefill{\leavevmode\leaders\hrule height 0.4pt\hfill\kern\z@}% @@ -840,6 +1077,19 @@ {% %label avec numéro et complément \tmpstyleexo\tmplabelexo\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% + %étoiles eventuelles + \IfStrEq{\EnvtExoEtoiles}{}{}% + {% + \,(\IfSubStr{\EnvtExoEtoiles}{§}% + {% + \StrCut{\EnvtExoEtoiles}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoEtoiles}% + }% + )% + }% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% @@ -875,12 +1125,49 @@ \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% + \IfSubStr{\EnvtExoDeco}{faEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSuStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos[\EnvtExoStarTot]{\EnvtExoStarNb}}}% + }% + {% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos{\EnvtExoStars}}}% + }% + }{}% + \IfSubStr{\EnvtExoDeco}{tkzEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSubStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoStars}% + }% + }{}% }{}% \IfSubStr{\EnvtExoType}{Perso}%OK perso____déco {% \StrBehind{\EnvtExoType}{/}[\EnvtExoLabel]% %label avec numéro et complément \tmpstyleexo\EnvtExoLabel\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% + %étoiles eventuelles + \IfStrEq{\EnvtExoEtoiles}{}{}% + {% + \,(\IfSubStr{\EnvtExoEtoiles}{§}% + {% + \StrCut{\EnvtExoEtoiles}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoEtoiles}% + }% + )% + }% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% @@ -916,6 +1203,30 @@ \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% + \IfSubStr{\EnvtExoDeco}{faEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSuStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos[\EnvtExoStarTot]{\EnvtExoStarNb}}}% + }% + {% + \textcolor{macouleurexodeco}{\scalebox{\tmpscalestarsexos}[\tmpscalestarsexos]{\NiveauDiffExos{\EnvtExoStars}}}% + }% + }{}% + \IfSubStr{\EnvtExoDeco}{tkzEtoiles}% + {% + \StrBehind{\EnvtExoDeco}{/}[\EnvtExoStars]% + \IfSubStr{\EnvtExoStars}{§}% + {% + \StrCut{\EnvtExoStars}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond,NiveauMax=\EnvtExoStarTot]{\EnvtExoStarNb}% + }% + {% + \tkzEtoiles[Couleur=macouleurexodeco,CouleurFond=macouleurexodecofond]{\EnvtExoStars}% + }% + }{}% }{}% \endgroup% \def\hrulefill{\leavevmode\leaders\hrule height 0.4pt\hfill\kern\z@}% @@ -1095,6 +1406,93 @@ title={\@ifpackageloaded{babel}{\NoAutoSpacing#2}{#2}\IfBooleanTF{#1}{}{$\cdot$\scalebox{0.6}[0.6]{\faCheckCircle[regular]\!\faCheckCircle[regular]}~}},left=1mm,right=1mm,boxsep=0mm]{#3}% } +%====Nutriscore +\definecolor{couleurNS1}{RGB}{45,126,67} +\definecolor{couleurNS2}{RGB}{151,186,56} +\definecolor{couleurNS3}{RGB}{240,202,13} +\definecolor{couleurNS4}{RGB}{213,123,26} +\definecolor{couleurNS5}{RGB}{197,52,25} +\tikzset{noeudNS/.style={pos=0.5,xscale=\echellexNS*\hauteurNS,yscale=\echelleyNS*\hauteurNS}} + +\defKV[NUTRISCORE]{% + Hauteur=\pgfmathsetmacro{\hauteurNS}{#1},% + Ratio=\pgfmathsetmacro{\ratiolargeurbandeNS}{#1},% + Symboles=\def\lettresNS{#1},% + Legende=\def\legendeNS{#1},% + Police=\def\fonteNS{#1},% + Couleurs=\def\couleursNS{#1},% + EchelleSymboles=\def\echellesymbNS{#1},% + CouleurFond=\def\coulbgNS{#1} +} +\setKVdefault[NUTRISCORE]{% + Hauteur=1,% + Ratio={0.6},% + Symboles={A,B,C,D,E},% + Legende={score},% + Police=\sffamily\bfseries,% + AffLegende=true,% + Couleurs={couleurNS1,couleurNS2,couleurNS3,couleurNS4,couleurNS5},% + EchelleSymboles={1.25,1.65},% + CouleurFond=white +} + +\NewDocumentCommand\BandeauScore{ O{} D<>{} m }{% + \restoreKV[NUTRISCORE]% + \setKV[NUTRISCORE]{#1}% + \IfEq{#3}{}% + {% + \xdef\numcasNS{0}% + }% + {% + \xdef\numcasNS{#3}% + }% + \readlist\letterListNS{\lettresNS}% + \xdef\nbcasesNS{\letterListNSlen}% + \readlist\colorListNS{\couleursNS}% + \xdef\nbcouleursNS{\colorListNSlen}% + \pgfmathsetmacro{\largeurcaseNS}{\hauteurNS*\ratiolargeurbandeNS}% + \pgfmathsetmacro{\largeurbandeNS}{\largeurcaseNS*\nbcasesNS}% + \pgfmathsetmacro{\margeNS}{0.225*\largeurcaseNS/2.4}% + \IfSubStr{\echellesymbNS}{,}% + {% + \StrCut{\echellesymbNS}{,}{\echellexNS}{\echelleyNS}% + }% + {% + \xdef\echellexNS{\echellesymbNS}\xdef\echelleyNS{\echellesymbNS}% + }% + \begin{tikzpicture}[font=\fonteNS,#2] + %---test + \filldraw[white,rounded corners=\fpeval{5*\largeurcaseNS*\ratiolargeurbandeNS}mm,line width=\fpeval{1.5*\largeurcaseNS*\ratiolargeurbandeNS}mm,opacity=0] ({-\margeNS},{-\margeNS}) rectangle++ (\nbcasesNS*\largeurcaseNS+2*\margeNS,\hauteurNS+2*\margeNS) ; + %---testfin + \begin{scope} + \clip[rounded corners=\fpeval{5*\largeurcaseNS*\ratiolargeurbandeNS}mm] (0,0) rectangle (\largeurbandeNS,\hauteurNS); + \foreach \tmpiii in {1,...,\letterListNSlen}{% + \ifnum\tmpiii=\numcasNS + \else + \ifnum\tmpiii>\nbcouleursNS + \fill[draw=none,lightgray] ({(\tmpiii-1)*\largeurcaseNS},0) rectangle ++(\largeurcaseNS,\hauteurNS) node[noeudNS,white,opacity=0.66]{\letterListNS[\tmpiii]}; + \else + \fill[draw=none,{\colorListNS[\tmpiii]}] ({(\tmpiii-1)*\largeurcaseNS},0) rectangle ++(\largeurcaseNS,\hauteurNS) node[noeudNS,white,opacity=0.66]{\letterListNS[\tmpiii]}; + \fi + \fi + }% + \end{scope} + \xintifboolexpr{\numcasNS >=1 'and' \numcasNS <= \nbcasesNS }% + {% + \begin{scope} + %\clip (-\margeNS,-\margeNS) rectangle++ (\largeurbandeNS+2*\margeNS,\hauteurNS+2*\margeNS); + \draw[draw=\coulbgNS,rounded corners=\fpeval{7.25*\largeurcaseNS*\ratiolargeurbandeNS}mm,line width=\fpeval{1.5*\largeurcaseNS*\ratiolargeurbandeNS}mm,fill={\colorListNS[#3]}] ({(\numcasNS-1)*\largeurcaseNS-\margeNS},{-\margeNS}) rectangle++ (\largeurcaseNS+2*\margeNS,\hauteurNS+2*\margeNS) node[noeudNS,white]{\letterListNS[\numcasNS]}; + \end{scope} + }% + {% + }% + %légende + \ifboolKV[NUTRISCORE]{AffLegende}% + {% + \node[above right=1pt,gray,scale=\fpeval{0.5*\hauteurNS},inner sep=1pt] at ({0.125*\margeNS},1.02*\hauteurNS) {\vphantom{QÉ}\MakeUppercase{\legendeNS}}; + }{}% + \end{tikzpicture}% +} %%----COMMANDES EN @@ -1932,4 +2330,742 @@ \fi +%====BannerScore +\definecolor{colorNS1}{RGB}{45,126,67} +\definecolor{colorNS2}{RGB}{151,186,56} +\definecolor{colorNS3}{RGB}{240,202,13} +\definecolor{colorNS4}{RGB}{213,123,26} +\definecolor{colorNS5}{RGB}{197,52,25} +\tikzset{nodeNS/.style={pos=0.5,xscale=\echellexNS*\hauteurNS,yscale=\echelleyNS*\hauteurNS}} + +\defKV[NUTRISCOREEN]{% + Height=\pgfmathsetmacro{\hauteurNS}{#1},% + Ratio=\pgfmathsetmacro{\ratiolargeurbandeNS}{#1},% + Symbols=\def\lettresNS{#1},% + Legend=\def\legendeNS{#1},% + Font=\def\fonteNS{#1},% + Colors=\def\couleursNS{#1},% + ScaleSymbols=\def\echellesymbNS{#1},% + Colbg=\def\coulbgNS{#1} +} +\setKVdefault[NUTRISCOREEN]{% + Height=1,% + Ratio={0.6},% + Symbols={A,B,C,D,E},% + Legend={score},% + Font=\sffamily\bfseries,% + ShowLegend=true,% + Colors={colorNS1,colorNS2,colorNS3,colorNS4,colorNS5},% + ScaleSymbols={1.25,1.65},% + Colbg=white +} + +\NewDocumentCommand\ScoreBanner{ O{} D<>{} m }{% + \restoreKV[NUTRISCOREEN]% + \setKV[NUTRISCOREEN]{#1}% + \IfEq{#3}{}% + {% + \xdef\numcasNS{0}% + }% + {% + \xdef\numcasNS{#3}% + }% + \readlist\letterListNS{\lettresNS}% + \xdef\nbcasesNS{\letterListNSlen}% + \readlist\colorListNS{\couleursNS}% + \xdef\nbcouleursNS{\colorListNSlen}% + \pgfmathsetmacro{\largeurcaseNS}{\hauteurNS*\ratiolargeurbandeNS}% + \pgfmathsetmacro{\largeurbandeNS}{\largeurcaseNS*\nbcasesNS}% + \pgfmathsetmacro{\margeNS}{0.225*\largeurcaseNS/2.4}% + \IfSubStr{\echellesymbNS}{,}% + {% + \StrCut{\echellesymbNS}{,}{\echellexNS}{\echelleyNS}% + }% + {% + \xdef\echellexNS{\echellesymbNS}\xdef\echelleyNS{\echellesymbNS}% + }% + \begin{tikzpicture}[font=\fonteNS,#2] + %---test + \filldraw[white,rounded corners=\fpeval{5*\largeurcaseNS*\ratiolargeurbandeNS}mm,line width=\fpeval{1.5*\largeurcaseNS*\ratiolargeurbandeNS}mm,opacity=0] ({-\margeNS},{-\margeNS}) rectangle++ (\nbcasesNS*\largeurcaseNS+2*\margeNS,\hauteurNS+2*\margeNS) ; + %---testfin + \begin{scope} + \clip[rounded corners=\fpeval{5*\largeurcaseNS*\ratiolargeurbandeNS}mm] (0,0) rectangle (\largeurbandeNS,\hauteurNS); + \foreach \iii in {1,...,\letterListNSlen}{% + \ifnum\iii=\numcasNS + \else + \ifnum\iii>\nbcouleursNS + \fill[draw=none,lightgray] ({(\iii-1)*\largeurcaseNS},0) rectangle ++(\largeurcaseNS,\hauteurNS) node[noeudNS,white,opacity=0.66]{\letterListNS[\iii]}; + \else + \fill[draw=none,{\colorListNS[\iii]}] ({(\iii-1)*\largeurcaseNS},0) rectangle ++(\largeurcaseNS,\hauteurNS) node[noeudNS,white,opacity=0.66]{\letterListNS[\iii]}; + \fi + \fi + }% + \end{scope} + \xintifboolexpr{\numcasNS >=1 'and' \numcasNS <= \nbcasesNS }% + {% + \begin{scope} + %\clip (-\margeNS,-\margeNS) rectangle++ (\largeurbandeNS+2*\margeNS,\hauteurNS+2*\margeNS); + \draw[draw=\coulbgNS,rounded corners=\fpeval{7.25*\largeurcaseNS*\ratiolargeurbandeNS}mm,line width=\fpeval{1.5*\largeurcaseNS*\ratiolargeurbandeNS}mm,fill={\colorListNS[#3]}] ({(\numcasNS-1)*\largeurcaseNS-\margeNS},{-\margeNS}) rectangle++ (\largeurcaseNS+2*\margeNS,\hauteurNS+2*\margeNS) node[noeudNS,white]{\letterListNS[#3]}; + \end{scope} + }% + {}% + %légende + \ifboolKV[NUTRISCOREEN]{ShowLegend}% + {% + \node[above right=1pt,gray,scale=\fpeval{0.5*\hauteurNS},inner sep=1pt] at ({0.125*\margeNS},1.02*\hauteurNS) {\MakeUppercase{\legendeNS}}; + }{}% + \end{tikzpicture}% +} + +%====vincludegraphics [fr] +\newlength{\tmp@includegraphics@vfill@offset} + +\defKV[vfillincludegphcs]{vOffset=\setlength\tmp@includegraphics@vfill@offset{#1},vCentrer=\def\tmpincludegpvcenter{#1}} +\setKVdefault[vfillincludegphcs]{vRemplir=false,vOffset=0pt,vCentrer=n} + +\NewDocumentCommand\InsererImage{ D<>{} O{} m }{% + \restoreKV[vfillincludegphcs]% + \setKV[vfillincludegphcs]{#1}% + \ifboolKV[vfillincludegphcs]{vRemplir}% + {% + \IfStrEqCase{\tmpincludegpvcenter}{% + {m}{\vfill\includegraphics[height=\dimexpr\pagegoal-\pagetotal-\tmp@includegraphics@vfill@offset\relax,#2]{#3}\vfill}% + {h}{\includegraphics[height=\dimexpr\pagegoal-\pagetotal-\tmp@includegraphics@vfill@offset\relax,#2]{#3}\vfill}% + {b}{\vfill\includegraphics[height=\dimexpr\pagegoal-\pagetotal-\tmp@includegraphics@vfill@offset\relax,#2]{#3}}% + {n}{\includegraphics[height=\dimexpr\pagegoal-\pagetotal-\tmp@includegraphics@vfill@offset\relax,#2]{#3}}% + }[{\includegraphics[height=\dimexpr\pagegoal-\pagetotal-\tmp@includegraphics@vfill@offset\relax,#2]{#3}}]% + }% + {% + \includegraphics[#2]{#3}% + }% +} + +%===tkzBanner mixte +\defKV[tkzBannerKeys]{% + maincolor=\def\tkzBannermaincol{#1} +} + +\setKVdefault[tkzBannerKeys]{% + height=2.1cm,% + width=\linewidth,% + collight=teal!25,% + colmedium=teal!75,% + coldark=teal,% + coltxt=white,% + fonttxt=\sffamily\bfseries,% + swap=false,% + maincolor={},% + num=true +} + +\NewDocumentCommand\tkzBanner{ O{} m m }{% + \noindent% + \restoreKV[tkzBannerKeys]% + \setKV[tkzBannerKeys]{#1}% + \pgfmathsetmacro{\tkzBannerscale}{\useKV[tkzBannerKeys]{width}/\linewidth}% + \begin{tikzpicture} + \IfEq{\tkzBannermaincol}{}% + {% + \tikzset{tkzbannerdark/.style={\useKV[tkzBannerKeys]{coldark}}} + \tikzset{tkzbannermedium/.style={\useKV[tkzBannerKeys]{colmedium}}} + \tikzset{tkzbannerlight/.style={\useKV[tkzBannerKeys]{collight}}} + }% + {% + \tikzset{tkzbannerdark/.style={\tkzBannermaincol}} + \tikzset{tkzbannermedium/.style={\tkzBannermaincol!75}} + \tikzset{tkzbannerlight/.style={\tkzBannermaincol!25}} + }% + %coordinates + \coordinate (tkzBanner-NW) at (0,{\useKV[tkzBannerKeys]{height}}) ; + \coordinate (tkzBanner-SW) at (0,0) ; + \coordinate (tkzBanner-NE) at ({\useKV[tkzBannerKeys]{width}},{\useKV[tkzBannerKeys]{height}}) ; + \coordinate (tkzBanner-SE) at ({\useKV[tkzBannerKeys]{width}},0) ;% + %swap or note + \ifboolKV[tkzBannerKeys]{swap}% + {% + \coordinate (tkzBanner-A) at ($(tkzBanner-SE)!0.57!(tkzBanner-SW)$) ; + \coordinate (tkzBanner-B) at ($(tkzBanner-NE)!0.91!(tkzBanner-NW)$) ; + \coordinate (tkzBanner-C) at ($(tkzBanner-NE)!0.92!(tkzBanner-NW)$) ; + \coordinate (tkzBanner-D) at ($(tkzBanner-SE)!0.63!(tkzBanner-SW)$) ; + }% + {% + \coordinate (tkzBanner-A) at ($(tkzBanner-SW)!0.57!(tkzBanner-SE)$) ; + \coordinate (tkzBanner-B) at ($(tkzBanner-NW)!0.91!(tkzBanner-NE)$) ; + \coordinate (tkzBanner-C) at ($(tkzBanner-NW)!0.92!(tkzBanner-NE)$) ; + \coordinate (tkzBanner-D) at ($(tkzBanner-SW)!0.63!(tkzBanner-SE)$) ; + }% + %drawing + \fill[tkzbannerdark] (0,0) rectangle ({\useKV[tkzBannerKeys]{width}},{\useKV[tkzBannerKeys]{height}}); + \ifboolKV[tkzBannerKeys]{swap}% + {% + \fill[tkzbannerlight] (tkzBanner-A) to[bend left=8] (tkzBanner-B) -- (tkzBanner-C) to[bend right=7] (tkzBanner-D) -- cycle ; + \fill[tkzbannermedium] (tkzBanner-C) to[bend right=7] (tkzBanner-D) -- (tkzBanner-SW) |- cycle ; + }% + {% + \fill[tkzbannerlight] (tkzBanner-A) to[bend right=8] (tkzBanner-B) -- (tkzBanner-C) to[bend left=7] (tkzBanner-D) -- cycle ; + \fill[tkzbannermedium] (tkzBanner-C) to[bend left=7] (tkzBanner-D) -- (tkzBanner-SE) |- cycle ; + }% + %nodes + \ifboolKV[tkzBannerKeys]{swap}% + {% + \node[inner sep=2pt,text={\useKV[tkzBannerKeys]{coltxt}},below left,font={\useKV[tkzBannerKeys]{fonttxt}},scale={2*\tkzBannerscale}] at (tkzBanner-NE) {\vphantom{qÉ}#2}; + \ifboolKV[tkzBannerKeys]{num}% + {% + \node[inner sep=2pt,text={\useKV[tkzBannerKeys]{coltxt}},above right,font={\useKV[tkzBannerKeys]{fonttxt}},scale={1.25*\tkzBannerscale}] at (tkzBanner-SW) {\vphantom{qÉ}#3}; + }% + {}% + }% + {% + \ifboolKV[tkzBannerKeys]{num}% + {% + \node[inner sep=2pt,text={\useKV[tkzBannerKeys]{coltxt}},above left,font={\useKV[tkzBannerKeys]{fonttxt}},scale={1.25*\tkzBannerscale}] at (tkzBanner-SE) {\vphantom{qÉ}#3}; + }% + {}% + \node[inner sep=2pt,text={\useKV[tkzBannerKeys]{coltxt}},below right,font={\useKV[tkzBannerKeys]{fonttxt}},scale={2*\tkzBannerscale}] at (tkzBanner-NW) {\vphantom{qÉ}#2}; + }% + \end{tikzpicture}% +} + +%====titre stylisé [fr], à voir avec part ?? +\newlength{\tmp@tkzbanner@autowidthtype} +\setlength\tmp@tkzbanner@autowidthtype{2.5em} +\newlength{\tmp@tkzbanner@autowidthnum} +\setlength\tmp@tkzbanner@autowidthnum{2em} +\newlength{\tmp@tkzbanner@marginoffsetbanner} +\setlength\tmp@tkzbanner@marginoffsetbanner{2pt} +\newlength{\tmp@tkzbanner@autowidth} +\setlength\tmp@tkzbanner@autowidth{2.5em} + +\defKV[tkzBannerpartKeys]{% + maincolor=\def\tkzBannermaintricol{#1},% + logo=\def\tkzBannermaintrilogo{#1},% + type=\def\tkzBannermaintritype{#1},% + blockwidth=\def\tkzBannermaintriblockwidth{#1},% + customtype=\def\tkzBannermaintritypelibre{#1} +} + +\setKVdefault[tkzBannerpartKeys]{% + height=2.5em,% + width={\linewidth-0.5pt},% + blockwidth=2.75em,% + collight=darkgray!25,% + colmedium=darkgray!50,% + coldark=darkgray,% + coltxt=white,% + fonttxt=\sffamily\bfseries,% + swap=false,% + maincolor={},% + logo={},% + type={},% + num=true, + dispblock=true,% + customtype={} +} + +\NewDocumentCommand\tkzBannerTri{ O{} m m }{% + %#1 := clés + %#2 := numéro + %#3 := titre + \noindent% + \restoreKV[tkzBannerpartKeys]% + \setKV[tkzBannerpartKeys]{#1}% + \pgfmathsetmacro{\tkzBannertriscale}{0.75*(\useKV[tkzBannerpartKeys]{height})/1.25cm}% + \pgfmathsetmacro{\scaletypedoctribanner}{1.05*0.75*(\useKV[tkzBannerpartKeys]{height})/1.25cm}% + \pgfmathsetmacro{\scaletypedoctribannernum}{2.5*0.75*(\useKV[tkzBannerpartKeys]{height})/1.25cm}% + \pgfmathsetmacro{\tkzBannertriangle}{0.10*(\useKV[tkzBannerpartKeys]{height})/(\useKV[tkzBannerpartKeys]{width})}% + \IfEq{\tkzBannermaintriblockwidth}{auto}% + {% + \settowidth{\tmp@tkzbanner@autowidthtype}{\scalebox{\scaletypedoctribanner}[\scaletypedoctribanner]{\sffamily\bfseries\vphantom{qÉ}\tkzBannermaintritype}}% + \addtolength{\tmp@tkzbanner@autowidthtype}{4pt}% + \settowidth{\tmp@tkzbanner@autowidthnum}{\scalebox{\scaletypedoctribannernum}[\scaletypedoctribannernum]{\sffamily\bfseries\vphantom{qÉ}00}}% + \addtolength{\tmp@tkzbanner@autowidthnum}{4pt}% + \pgfmathsetlength{\tmp@tkzbanner@autowidth}{max(\tmp@tkzbanner@autowidthtype,\tmp@tkzbanner@autowidthnum)}% + }% + {% + \setlength\tmp@tkzbanner@autowidth{\tkzBannermaintriblockwidth}% + }% + \begin{tikzpicture} + \IfEq{\tkzBannermaintricol}{}% + {% + \tikzset{tkzbannertridark/.style={\useKV[tkzBannerpartKeys]{coldark}}} + \tikzset{tkzbannertrimedium/.style={\useKV[tkzBannerpartKeys]{colmedium}}} + \tikzset{tkzbannertrilight/.style={\useKV[tkzBannerpartKeys]{collight}}} + }% + {% + \tikzset{tkzbannertridark/.style={\tkzBannermaintricol}} + \tikzset{tkzbannertrimedium/.style={\tkzBannermaintricol!50}} + \tikzset{tkzbannertrilight/.style={\tkzBannermaintricol!25}} + }% + %coordinates + \coordinate (tkzBannerTri-NW) at (0,{\useKV[tkzBannerpartKeys]{height}}) ; + \coordinate (tkzBannerTri-SW) at (0,0) ; + \coordinate (tkzBannerTri-NE) at ({\useKV[tkzBannerpartKeys]{width}},{\useKV[tkzBannerpartKeys]{height}}) ; + \coordinate (tkzBannerTri-SE) at ({\useKV[tkzBannerpartKeys]{width}},0) ;% + \coordinate (tkzBannerTri-SWd) at ($(tkzBannerTri-SW)!0.05!(tkzBannerTri-NW)$) ;% + \coordinate (tkzBannerTri-SEd) at ($(tkzBannerTri-SE)!0.15!(tkzBannerTri-NE)$) ;% + %drawing & shadow + \fill[lightgray!75] ([yshift=-1pt]tkzBannerTri-SWd) -- ([yshift=-1pt]tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ; + \ifboolKV[tkzBannerpartKeys]{swap}% + {% + \fill[white] (tkzBannerTri-SWd) -- (tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ; + \draw[line width=1pt,tkzbannertridark] ([shift={(0.5pt,-0.5pt)}]tkzBannerTri-NW) -| ([shift={(-0.5pt,0)}]tkzBannerTri-SEd) -- (tkzBannerTri-SWd) ; + }% + {% + \fill[tkzbannertrimedium] (tkzBannerTri-SWd) -- (tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ; + }% + \ifboolKV[tkzBannerpartKeys]{dispblock}% + {% + \begin{scope} + \clip ($(tkzBannerTri-SW)!0.0375!(tkzBannerTri-NW)$) -- ($(tkzBannerTri-SE)!0.1375!(tkzBannerTri-NE)$) -- (tkzBannerTri-NE) -| cycle ; + %light + \fill[tkzbannertrilight] (tkzBannerTri-NW) --++ ({\tmp@tkzbanner@autowidth+2*\tmp@tkzbanner@marginoffsetbanner},0) -- ({\tmp@tkzbanner@autowidth+2*\tmp@tkzbanner@marginoffsetbanner+1em},{0.5*(\useKV[tkzBannerpartKeys]{height})}) -- ({\tmp@tkzbanner@autowidth+2*\tmp@tkzbanner@marginoffsetbanner},0) -- (tkzBannerTri-SW) -- cycle ; + \end{scope} + \begin{scope} + \clip ($(tkzBannerTri-SW)!0.025!(tkzBannerTri-NW)$) -- ($(tkzBannerTri-SE)!0.125!(tkzBannerTri-NE)$) -- (tkzBannerTri-NE) -| cycle ; + %medium + \fill[tkzbannertrimedium] (tkzBannerTri-NW) --++ ({\tmp@tkzbanner@autowidth+\tmp@tkzbanner@marginoffsetbanner},0) -- ({\tmp@tkzbanner@autowidth+\tmp@tkzbanner@marginoffsetbanner+1em},{0.5*(\useKV[tkzBannerpartKeys]{height})}) -- ({\tmp@tkzbanner@autowidth+\tmp@tkzbanner@marginoffsetbanner},0) -- (tkzBannerTri-SW) -- cycle ; + \end{scope} + \begin{scope} + \clip ($(tkzBannerTri-SW)!0.0125!(tkzBannerTri-NW)$) -- ($(tkzBannerTri-SE)!0.1125!(tkzBannerTri-NE)$) -- (tkzBannerTri-NE) -| cycle ; + %dark + \fill[tkzbannertridark] (tkzBannerTri-NW) --++ ({\tmp@tkzbanner@autowidth},0) -- ({\tmp@tkzbanner@autowidth+1em},{0.5*(\useKV[tkzBannerpartKeys]{height})}) -- ({\tmp@tkzbanner@autowidth},0) -- (tkzBannerTri-SW) -- cycle ; + \IfEq{\tkzBannermaintritypelibre}{}% + {% + \ifboolKV[tkzBannerpartKeys]{num}% + {% + \IfEq{\tkzBannermaintritype}{}% + {% + \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp@tkzbanner@autowidth},{0.5*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}#2}; + }% + {% + \node[inner sep=2pt,below=1pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={1.05*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp@tkzbanner@autowidth},{\useKV[tkzBannerpartKeys]{height}}) {\vphantom{qÉ}\tkzBannermaintritype}; + \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp@tkzbanner@autowidth},{0.425*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}#2}; + }% + }% + {}% + }% + {% + \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp@tkzbanner@autowidth},{0.5*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}\tkzBannermaintritypelibre}; + }% + \end{scope} + }% + {}% + %nodes + \begin{scope} + \clip (tkzBannerTri-SWd) -- (tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ; + \ifboolKV[tkzBannerpartKeys]{swap}% + {% + \node[inner sep=2pt,right,text=\tkzBannermaintricol,font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.75*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({\tmp@tkzbanner@autowidth+2*\tmp@tkzbanner@marginoffsetbanner+1.25em},{0.5*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}#3}; + %logo + \IfEq{\tkzBannermaintrilogo}{}% + {}% + {% + \node[inner sep=2pt,left,text=\tkzBannermaintricol,font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({\useKV[tkzBannerpartKeys]{width}},{0.55*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}\tkzBannermaintrilogo}; + }% + }% + {% + \node[inner sep=2pt,right,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.75*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({\tmp@tkzbanner@autowidth+2*\tmp@tkzbanner@marginoffsetbanner+1.25em},{0.5*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}#3}; + %logo + \IfEq{\tkzBannermaintrilogo}{}% + {}% + {% + \node[inner sep=2pt,left,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({\useKV[tkzBannerpartKeys]{width}},{0.55*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}\tkzBannermaintrilogo}; + }% + }% + \end{scope} + \end{tikzpicture}% +} + +%====grille automatique tikz ? +\NewDocumentCommand\tkzGrilleAuto{ s O{thin,lightgray} m }{% + \IfBooleanT{#1}{\filldraw (0,0) circle[radius=2pt] ;} + \StrCut{#3}{§}{\tkzautogridx}{\tkzautogridy}% + \draw[xstep=\tkzautogridx,ystep=\tkzautogridy,#2] (current bounding box.south west) grid (current bounding box.north east) ; +} +\NewDocumentCommand\tkzAutoGrid{ s O{thin,lightgray} m }{% + \IfBooleanT{#1}{\filldraw (0,0) circle[radius=2pt] ;} + \StrCut{#3}{§}{\tkzautogridx}{\tkzautogridy}% + \draw[xstep=\tkzautogridx,ystep=\tkzautogridy,#2] (current bounding box.south west) grid (current bounding box.north east) ; +} + +\tikzset{grilleauto/.store in=\tkzautogrid,grilleauto/.default={},grilleauto={}} +\tikzset{autogrid/.store in=\tkzautogrid,autogrid/.default={},autogrid={}} + +\NewDocumentCommand\tkzAutoGridActivate{ s }{% + \@ifundefined{tkzautogrid}% + {}% + {% + \tikzset{every picture/.style={% + execute at end picture={% + \IfEq{\tkzautogrid}{}{}{\IfBooleanTF{#1}{\tkzGrilleAuto*{\tkzautogrid}}{\tkzGrilleAuto{\tkzautogrid}}}% + }, + }, + }% + }% +} + +\NewDocumentCommand\tkzAutoGridLocal{ s }{% + \@ifundefined{tkzautogrid}% + {}% + {% + \tikzset{execute at end picture={% + \IfEq{\tkzautogrid}{}{}{\IfBooleanTF{#1}{\tkzGrilleAuto*{\tkzautogrid}}{\tkzGrilleAuto{\tkzautogrid}}}% + }, + }, + }% +} + +%====FLÈCHE ÉVASÉE [FR] +\usetikzlibrary{arrows,arrows.meta} + +\defKV[FlecheEvasee]{% + Couleur=\def\FlecheEvaseeCouleur{#1},% + TailleFleche=\def\FlecheEvaseeFleche{#1},% + Direction=\def\FlecheEvaseeDirectionAngle{#1},% + Coeff=\def\FlecheEvaseeCoeff{#1},% + TypeFleche=\def\FlecheEvaseeType{#1},% + Epaisseur=\def\FlecheEvaseeEpaisseur{#1},% + LineCap=\def\FlecheEvaseeLineCap{#1} +} +\setKVdefault[FlecheEvasee]{% + Couleur=black,% + TailleFleche=auto,% + Direction={},% + Coeff=4,% + TypeFleche=Latex,% + Deplacement=false,% + Epaisseur=0.5mm,% + LineCap=butt +} + +\NewDocumentCommand\tkzFlecheEvasee{ O{} m m }{%1=options,2=début,3=fin + \restoreKV[FlecheEvasee]% + \setKV[FlecheEvasee]{#1}% + \begin{scope}[line width=0.05mm] + \IfStrEq{\FlecheEvaseeFleche}{auto}% + {% + \xdef\FlecheEvaseeH{2*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur}% + \xdef\FlecheEvaseeW{2.1*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur}% + }% + {% + \StrCut{\FlecheEvaseeFleche}{/}{\FlecheEvaseeH}{\FlecheEvaseeW}% + }% + \IfEq{\FlecheEvaseeDirectionAngle}{}% + {% + \xdef\FlecheEvaseeDirection{}\xdef\FlecheEvaseeAngle{0}% + }% + {% + \StrCut{\FlecheEvaseeDirectionAngle}{/}{\FlecheEvaseeDirection}{\FlecheEvaseeAngle}% + }% + %coordonnées + \coordinate (TMPDEPART) at (#2) ; + \ifboolKV[FlecheEvasee]{Deplacement}% + {% + \coordinate (TMPARRIVEE) at ($(TMPDEPART)+(#3)$) ; + }% + {% + \coordinate (TMPARRIVEE) at (#3) ; + } + \pgfmathanglebetweenpoints{\pgfpointanchor{TMPDEPART}{center}}{\pgfpointanchor{TMPARRIVEE}{center}}% + \edef\tmpangle{\pgfmathresult}% + %nœuds + \IfEq{\FlecheEvaseeDirection}{right}% + {% + \coordinate (TMPDG) at ([shift={({90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPDD) at ([shift={({-90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPF) at ($(TMPARRIVEE)+({\FlecheEvaseeAngle+\tmpangle+180}:\FlecheEvaseeH)$) ; + \coordinate (TMPFG) at ($(TMPARRIVEE)+({\FlecheEvaseeAngle+\tmpangle+180}:\FlecheEvaseeH)+({\FlecheEvaseeAngle+\tmpangle-90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPFD) at ($(TMPARRIVEE)+({\FlecheEvaseeAngle+\tmpangle+180}:\FlecheEvaseeH)+({\FlecheEvaseeAngle+\tmpangle+90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \IfStrEq{\FlecheEvaseeType}{Stealth}% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length={1.5*\FlecheEvaseeH},width={1.1*\FlecheEvaseeW}]}] (TMPF)--(TMPARRIVEE) ; + }% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length=\FlecheEvaseeH,width=\FlecheEvaseeW]}] (TMPF)--(TMPARRIVEE) ; + }% + \filldraw[line cap=\FlecheEvaseeLineCap,\FlecheEvaseeCouleur] (TMPDD) to[bend right=\FlecheEvaseeAngle] (TMPFG) -- (TMPFD) to[bend left=\FlecheEvaseeAngle] (TMPDG) --cycle ; + }% + {}% + \IfEq{\FlecheEvaseeDirection}{left}% + {% + \coordinate (TMPDG) at ([shift={({90+\tmpangle+\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPDD) at ([shift={({-90+\tmpangle+\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPF) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)$) ; + \coordinate (TMPFG) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({180+\tmpangle-\FlecheEvaseeAngle+90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPFD) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({180+\tmpangle-\FlecheEvaseeAngle-90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \IfStrEq{\FlecheEvaseeType}{Stealth}% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length={1.5*\FlecheEvaseeH},width={1.1*\FlecheEvaseeW}]}] (TMPF)--(TMPARRIVEE) ; + }% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length=\FlecheEvaseeH,width=\FlecheEvaseeW]}] (TMPF)--(TMPARRIVEE) ; + }% + \filldraw[line cap=\FlecheEvaseeLineCap,\FlecheEvaseeCouleur] (TMPDD) to[bend left=\FlecheEvaseeAngle] (TMPFG) -- (TMPFD) to[bend right=\FlecheEvaseeAngle] (TMPDG) --cycle ; + }% + {}% + \IfEq{\FlecheEvaseeDirection}{}% + {% + \coordinate (TMPF) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)$) ; + \coordinate (TMPDG) at ([shift={({90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPFG) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({-90+\tmpangle-\FlecheEvaseeAngle}:{-0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPFD) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({-90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPDD) at ([shift={({-90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \IfStrEq{\FlecheEvaseeType}{Stealth}% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length={1.5*\FlecheEvaseeH},width={1.1*\FlecheEvaseeW}]}] (TMPF)--(TMPARRIVEE) ; + }% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length=\FlecheEvaseeH,width=\FlecheEvaseeW]}] (TMPF)--(TMPARRIVEE) ; + }% + \filldraw[line cap=\FlecheEvaseeLineCap,\FlecheEvaseeCouleur] (TMPDG) to (TMPFG) -- (TMPFD) to (TMPDD) --cycle ; + }% + {}% + \end{scope} +} + +%====FLÈCHE ÉVASÉE [EN] +\defKV[flaredarrow]{% + color=\def\FlecheEvaseeCouleur{#1},% + arrowsize=\def\FlecheEvaseeFleche{#1},% + bend=\def\FlecheEvaseeDirectionAngle{#1},% + factor=\def\FlecheEvaseeCoeff{#1},% + arrowstyle=\def\FlecheEvaseeType{#1},% + thickness=\def\FlecheEvaseeEpaisseur{#1},% + linecap=\def\FlecheEvaseeLineCap{#1} +} +\setKVdefault[flaredarrow]{% + color=black,% + arrowsize=auto,% + bend={},% + factor=4,% + arrowstyle=Latex,% + move=false,% + thickness=0.5mm,% + linecap=butt +} + +\NewDocumentCommand\tkzFlaredArrow{ O{} m m }{%1=options,2=début,3=fin + \restoreKV[flaredarrow]% + \setKV[flaredarrow]{#1}% + \begin{scope}[line width=0.05mm] + \IfStrEq{\FlecheEvaseeFleche}{auto}% + {% + \xdef\FlecheEvaseeH{2*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur}% + \xdef\FlecheEvaseeW{2.1*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur}% + }% + {% + \StrCut{\FlecheEvaseeFleche}{/}{\FlecheEvaseeH}{\FlecheEvaseeW}% + }% + \IfEq{\FlecheEvaseeDirectionAngle}{}% + {% + \xdef\FlecheEvaseeDirection{}\xdef\FlecheEvaseeAngle{0}% + }% + {% + \StrCut{\FlecheEvaseeDirectionAngle}{/}{\FlecheEvaseeDirection}{\FlecheEvaseeAngle}% + }% + %coordonnées + \coordinate (TMPDEPART) at (#2) ; + \ifboolKV[flaredarrow]{move}% + {% + \coordinate (TMPARRIVEE) at ($(TMPDEPART)+(#3)$) ; + }% + {% + \coordinate (TMPARRIVEE) at (#3) ; + } + \pgfmathanglebetweenpoints{\pgfpointanchor{TMPDEPART}{center}}{\pgfpointanchor{TMPARRIVEE}{center}}% + \edef\tmpangle{\pgfmathresult}% + %nœuds + \IfEq{\FlecheEvaseeDirection}{right}% + {% + \coordinate (TMPDG) at ([shift={({90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPDD) at ([shift={({-90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPF) at ($(TMPARRIVEE)+({\FlecheEvaseeAngle+\tmpangle+180}:\FlecheEvaseeH)$) ; + \coordinate (TMPFG) at ($(TMPARRIVEE)+({\FlecheEvaseeAngle+\tmpangle+180}:\FlecheEvaseeH)+({\FlecheEvaseeAngle+\tmpangle-90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPFD) at ($(TMPARRIVEE)+({\FlecheEvaseeAngle+\tmpangle+180}:\FlecheEvaseeH)+({\FlecheEvaseeAngle+\tmpangle+90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \IfStrEq{\FlecheEvaseeType}{Stealth}% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length={1.5*\FlecheEvaseeH},width={1.1*\FlecheEvaseeW}]}] (TMPF)--(TMPARRIVEE) ; + }% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length=\FlecheEvaseeH,width=\FlecheEvaseeW]}] (TMPF)--(TMPARRIVEE) ; + }% + \filldraw[line cap=\FlecheEvaseeLineCap,\FlecheEvaseeCouleur] (TMPDD) to[bend right=\FlecheEvaseeAngle] (TMPFG) -- (TMPFD) to[bend left=\FlecheEvaseeAngle] (TMPDG) --cycle ; + }% + {}% + \IfEq{\FlecheEvaseeDirection}{left}% + {% + \coordinate (TMPDG) at ([shift={({90+\tmpangle+\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPDD) at ([shift={({-90+\tmpangle+\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPF) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)$) ; + \coordinate (TMPFG) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({180+\tmpangle-\FlecheEvaseeAngle+90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPFD) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({180+\tmpangle-\FlecheEvaseeAngle-90}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \IfStrEq{\FlecheEvaseeType}{Stealth}% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length={1.5*\FlecheEvaseeH},width={1.1*\FlecheEvaseeW}]}] (TMPF)--(TMPARRIVEE) ; + }% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length=\FlecheEvaseeH,width=\FlecheEvaseeW]}] (TMPF)--(TMPARRIVEE) ; + }% + \filldraw[line cap=\FlecheEvaseeLineCap,\FlecheEvaseeCouleur] (TMPDD) to[bend left=\FlecheEvaseeAngle] (TMPFG) -- (TMPFD) to[bend right=\FlecheEvaseeAngle] (TMPDG) --cycle ; + }% + {}% + \IfEq{\FlecheEvaseeDirection}{}% + {% + \coordinate (TMPF) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)$) ; + \coordinate (TMPDG) at ([shift={({90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \coordinate (TMPFG) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({-90+\tmpangle-\FlecheEvaseeAngle}:{-0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPFD) at ($(TMPARRIVEE)+({180+\tmpangle-\FlecheEvaseeAngle}:\FlecheEvaseeH)+({-90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeCoeff*\FlecheEvaseeEpaisseur})$) ; + \coordinate (TMPDD) at ([shift={({-90+\tmpangle-\FlecheEvaseeAngle}:{0.5*\FlecheEvaseeEpaisseur})}]TMPDEPART) ; + \IfStrEq{\FlecheEvaseeType}{Stealth}% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length={1.5*\FlecheEvaseeH},width={1.1*\FlecheEvaseeW}]}] (TMPF)--(TMPARRIVEE) ; + }% + {% + \draw[\FlecheEvaseeCouleur,->,-{\FlecheEvaseeType[length=\FlecheEvaseeH,width=\FlecheEvaseeW]}] (TMPF)--(TMPARRIVEE) ; + }% + \filldraw[line cap=\FlecheEvaseeLineCap,\FlecheEvaseeCouleur] (TMPDG) to (TMPFG) -- (TMPFD) to (TMPDD) --cycle ; + }% + {}% + \end{scope} +} + +%====PANO AUTOROUTE +\newlength{\PanoTorouteStretch} +\newlength{\PanoTorouteOffsetArrow} + +\defKV[PanoAutoroute]{% + Fleches=\def\PanoTorouteArrow{#1},% + CouleurFond=\def\PanoTorouteCoul{#1},% + CouleurTitre=\def\PanoTorouteCoulTitre{#1},% + Police=\def\PanoTorouteFonte{#1},% + PoliceCartouche=\def\PanoTorouteFonteTitre{#1},% + TypeFleche=\def\PanoTorouteStyleArrow{#1},% + EspacementV=\setlength{\PanoTorouteStretch}{#1},% + OffsetFleches=\setlength{\PanoTorouteOffsetArrow}{#1} +} + +\setKVdefault[PanoAutoroute]{% + Fleches=0,% + CouleurFond=blue,% + CouleurTitre=red,% + Largeur=10cm,% + Police=\LARGE\bfseries\sffamily,% + PoliceCartouche=\Large\bfseries\sffamily,% + TypeFleche={\scalebox{1.33}[1.25]{\faArrowDown}},% + EspacementV={2.5mm},% + OffsetFleches={5mm},% + Dernier=true +} + +\NewDocumentEnvironment{PanneauAutoroute}{ O{} D<>{} m }% +{% + \restoreKV[PanoAutoroute]% + \setKV[PanoAutoroute]{#1} + \IfEq{#3}{}% + {% + \tcolorbox[enhanced,width={\useKV[PanoAutoroute]{Largeur}},fontupper=\PanoTorouteFonte,colback=\PanoTorouteCoul,colframe=\PanoTorouteCoul!5!white,coltext=white,sharp corners,boxsep=1mm,left=1mm,right=1mm,top=1mm,bottom=1mm,#2] + }% + {% + \tcolorbox[enhanced,width={\useKV[PanoAutoroute]{Largeur}},fontupper=\PanoTorouteFonte,colback=\PanoTorouteCoul,colframe=\PanoTorouteCoul!5!white,coltext=white,sharp corners,boxsep=1mm,left=1mm,right=1mm,top=1mm,bottom=1mm,attach boxed title to top center,fonttitle=\PanoTorouteFonteTitre,coltitle=white,boxed title style={colback=\PanoTorouteCoulTitre,size=small,sharp corners,left=0mm,right=0mm,colframe=\PanoTorouteCoulTitre!5!white},title={#3},#2] + }% + \baselineskip=-1000pt\lineskip=\PanoTorouteStretch\lineskiplimit=\maxdimen% +}% +{% + \ifnum\PanoTorouteArrow>0 + + \medskip + \hspace*{\PanoTorouteOffsetArrow}\foreach \i in {1,...,\PanoTorouteArrow}{\hfill\PanoTorouteStyleArrow}\hfill\hspace*{\PanoTorouteOffsetArrow} + \fi% + \endtcolorbox% + % + \ifboolKV[PanoAutoroute]{Dernier}{}{\vspace*{\dimexpr-\baselineskip-0.5mm\relax}}% +} + +\NewDocumentCommand\VilleDist{ s m m }{% + \IfBooleanTF{#1}% + {% + #2\hfill~#3 + }% + {% + #2\hfill~#3\\ + }% +} + +%====PANOSOLDES +\newlength{\tmphautbannsold} +\newlength{\tmphautbannsoldextra} +\newlength{\tmplargbannsold} +\newlength{\tmplargasold} +\newlength{\tmplargbsold} +\newlength{\tmplargtotsold} +\newlength{\tmpoffsetbannsold} +\newlength{\tmphautlignesol} +\newlength{\tmphautsoles} + +\def\labelancienprix{Ancien Prix~:~} +\def\labelnouveauprix{Nouveau Prix~:~} +\def\labelreduction{SOLDES~:~} + +\defKV[PanoSoldes]{% + Couleur=\def\panosoldescolor{#1},% + Largeur=\def\panosoldeswidth{#1},% + PoliceEntete=\def\panosoldesfonthaut{#1},% + PolicePrix=\def\panosoldesfontprix{#1},% + PoliceReduc=\def\panosoldesfontreduc{#1},% + OffsetReduc=\setlength{\tmpoffsetbannsold}{#1},% + Titre=\def\panosoldestitre{#1},% + AgrandirReduc=\setlength{\tmphautbannsoldextra}{#1} +} + +\setKVdefault[PanoSoldes]{% + Couleur=gray, + Largeur=auto, + PoliceEntete=\large\bfseries,% + PolicePrix=\footnotesize,% + PoliceReduc=\large\bfseries,% + Titre=GRANDE DÉMARQUE,% + OffsetReduc=1.25cm,% + AgrandirReduc=0mm +} + +\NewDocumentCommand\AfficheSoldes{ O{} m m m }{% + \restoreKV[PanoSoldes]% + \setKV[PanoSoldes]{#1}% + %calcul de la largeur + \IfEq{\panosoldeswidth}{auto}% + {% + \settowidth{\tmplargbannsold}{{\panosoldesfontreduc\labelreduction-999X}}%largeur avec un peu de marge dûe à la rotation + \settowidth{\tmplargasold}{{\panosoldesfontprix\labelancienprix99999X}}%largeur avec un peu de marge dûe au prix "élastique" + \settowidth{\tmplargbsold}{{\panosoldesfontprix\labelnouveauprix99999X}}%largeur avec un peu de marge dûe au prix "élastique" + \pgfmathsetlength{\tmplargtotsold}{max(\tmplargbannsold,\tmplargasold,\tmplargbsold)+1mm}%on rajoute encore un peu de marge pour être sûr + }% + {% + \setlength{\tmplargtotsold}{\panosoldeswidth}% + }% + %calcul de la hauteur + \settototalheight{\tmphautlignesol}{\panosoldesfontprix\labelancienprix\labelnouveauprix0,123456789X}% + \settototalheight{\tmphautbannsold}{\panosoldesfontreduc\labelreduction-0,123456789X}% + \addtolength{\tmphautbannsold}{6mm+\tmphautbannsoldextra}% + \setlength{\tmphautsoles}{2\tmphautlignesol}% + \addtolength{\tmphautsoles}{\tmpoffsetbannsold+2mm}% + \addtolength{\tmphautsoles}{\tmphautbannsold}% + %boîte + \tcolorbox[% + enhanced,nobeforeafter,width=\tmplargtotsold,text height=\tmphautsoles,boxrule=0.5mm,boxsep=0.5mm,title={\panosoldestitre},halign title=flush center,colframe=\panosoldescolor,colback=white,top=1.25mm,bottom=1.25mm,left=1.25mm,right=1.25mm,fonttitle=\panosoldesfonthaut,% + overlay={% + \begin{tcbclipframe} + \draw ([shift={(1.25mm,-2mm)}]interior.north west) node[anchor=north west,font=\panosoldesfontprix,inner sep=0pt] {Ancien prix : {#2}} ; + \draw ([shift={(-1.25mm,2.5mm)}]interior.south east) node[anchor=south east,left,font=\panosoldesfontprix,inner sep=0pt] {Nouveau prix : {#3}} ; + %bannière (cf Séb Lozano) + \fill[line cap=rect,\panosoldescolor] ([shift={(0,2.5mm+\tmphautlignesol)}]interior.south west)--([shift={(0,2.5mm+\tmphautlignesol+\tmpoffsetbannsold)}]interior.south east)--++(0,\tmphautbannsold)--([shift={(0,2.5mm+\tmphautlignesol+\tmphautbannsold)}]interior.south west) ; + %petit filet + \draw[white,semithick] ([shift={(0,2.5mm+\tmphautlignesol+1pt)}]interior.south west)--([shift={(0,2.5mm+\tmphautlignesol+\tmpoffsetbannsold+1pt)}]interior.south east)--++(0,\tmphautbannsold-2pt)--([shift={(0,2.5mm+\tmphautlignesol+\tmphautbannsold-1pt)}]interior.south west)--cycle ; + %label + \draw[draw=none] ([shift={(0,2.5mm+\tmphautlignesol+0.5\tmphautbannsold)}]interior.south west) -- ([shift={(0,2.5mm+\tmphautlignesol+\tmpoffsetbannsold+0.5\tmphautbannsold)}]interior.south east) node[midway,sloped,font=\panosoldesfontreduc,text=white] {SOLDES : {#4}} ; + \end{tcbclipframe}% + }% + ]% + \endtcolorbox% +} + \endinput
\ No newline at end of file |