% Author..........: C. Pierquet % licence.........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf % 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/03/30 0.1.3 Custom classic environments] %====HISTORIQUE % v 0.1.3 Environnement/Commande pour présentation d'un exercice % v 0.1.2 Crayon de compétences % v 0.1.1 Ajout de tableaux de compétences % v 0.1.0 Version initiale %====OPTIONS FR ET EN \newif\if@enum\@enumtrue% \DeclareOption{nonenum}{\@enumfalse}% \DeclareOption{noenum}{\@enumfalse}% \newif\if@tblr\@tblrtrue% \DeclareOption{nontblr}{\@tblrfalse}% \DeclareOption{notblr}{\@tblrfalse}% \newif\if@multicol\@multicoltrue% \DeclareOption{nonmulticol}{\@multicolfalse}% \DeclareOption{nomulticol}{\@multicolfalse}% \newif\if@xcolor\@xcolortrue% \DeclareOption{nonxcolor}{\@xcolorfalse}% \DeclareOption{noxcolor}{\@xcolorfalse}% \newif\if@fa\@fatrue% \DeclareOption{nonfa}{\@fafalse}% \DeclareOption{nofa}{\@fafalse}% \DeclareOption*{} \ProcessOptions\relax %====PACKAGES UTILES À CHARGER \if@xcolor \RequirePackage{xcolor} \fi \if@fa \RequirePackage{fontawesome5} \fi \if@enum \RequirePackage{enumitem} \fi \if@tblr \RequirePackage{tabularray} \fi \if@multicol \RequirePackage{multicol} \fi \RequirePackage{xintexpr} \RequirePackage{randomlist} \RequirePackage{simplekv} \RequirePackage{xstring} \RequirePackage{listofitems} \RequirePackage{calc} \RequirePackage{tikz} \usetikzlibrary{decorations.pathmorphing,positioning,shapes.misc,calc} %%----COMMANDES FR %====DECALER VERTICALEMENT, pas documenté pour le moment... \NewDocumentCommand\VCentrer{ O{-0.5} m }{% {\raisebox{#1\depth}{#2\vphantom{azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN0123456789}}}% } %====QCMs \defKV[reponsesqcm]{% NbCols=\def\RepQCMNbCol{#1},% PoliceLabels=\def\RepQCMFonte{#1},% EspacesCL=\def\RepQCMOffset{#1},% Labels=\def\RepQCMTypeLabel{#1},% EspaceLabels=\xdef\RepQCMSpace{#1},% Largeur=\def\RepQCMLarg{#1} } \setKVdefault[reponsesqcm]{% EspacesCL={6pt/2pt},% NbCols=4,% Filets=false,% PoliceLabels={\bfseries},% Labels={a.},% EspaceLabels=\kern5pt,% Swap=false,% Largeur=0.99\linewidth } \NewDocumentCommand\QCMFormatteLabel{ m m }{%1=typelabel,%3=caractère \IfSubStr{#1}{a}% {% {\RepQCMFonte\StrSubstitute{#1}{a}{#2}}% }% {}% \IfSubStr{#1}{A}% {% {\RepQCMFonte\StrSubstitute{#1}{A}{#2}}% }% {}% \IfSubStr{#1}{1}% {% {\RepQCMFonte\StrSubstitute{#1}{1}{#2}}% }% {}% } \NewDocumentCommand\ReponsesQCM{ O{} m D<>{} }{%1=nbcol,2=listeréponses \restoreKV[reponsesqcm]% \setKV[reponsesqcm]{#1}% \IfSubStr{\RepQCMOffset}{/}% {\StrCut{\RepQCMOffset}{/}{\RepQCMOffsetCol}{\RepQCMOffsetLgn}}% {\def\RepQCMOffsetCol{\RepQCMOffset}\def\RepQCMOffsetLgn{\RepQCMOffset}}% \setsepchar{§}% \readlist*\QCMListereponses{#2}% \def\QCMNbRep{\QCMListereponseslen}% %les items créés \IfSubStr{\RepQCMTypeLabel}{a}% {% \xdef\RepQCMLabelA{\QCMFormatteLabel{\RepQCMTypeLabel}{a}\RepQCMSpace}% \xdef\RepQCMLabelB{\QCMFormatteLabel{\RepQCMTypeLabel}{b}\RepQCMSpace}% \xdef\RepQCMLabelC{\QCMFormatteLabel{\RepQCMTypeLabel}{c}\RepQCMSpace}% \xdef\RepQCMLabelD{\QCMFormatteLabel{\RepQCMTypeLabel}{d}\RepQCMSpace}% }{}% \IfSubStr{\RepQCMTypeLabel}{A}% {% \xdef\RepQCMLabelA{\QCMFormatteLabel{\RepQCMTypeLabel}{A}\RepQCMSpace}% \xdef\RepQCMLabelB{\QCMFormatteLabel{\RepQCMTypeLabel}{B}\RepQCMSpace}% \xdef\RepQCMLabelC{\QCMFormatteLabel{\RepQCMTypeLabel}{C}\RepQCMSpace}% \xdef\RepQCMLabelD{\QCMFormatteLabel{\RepQCMTypeLabel}{D}\RepQCMSpace}% }{}% \IfSubStr{\RepQCMTypeLabel}{1}% {% \xdef\RepQCMLabelA{\QCMFormatteLabel{\RepQCMTypeLabel}{1}\RepQCMSpace}% \xdef\RepQCMLabelB{\QCMFormatteLabel{\RepQCMTypeLabel}{2}\RepQCMSpace}% \xdef\RepQCMLabelC{\QCMFormatteLabel{\RepQCMTypeLabel}{3}\RepQCMSpace}% \xdef\RepQCMLabelD{\QCMFormatteLabel{\RepQCMTypeLabel}{4}\RepQCMSpace}% }{}% %en fonction du nb de colonnes \IfEq{\QCMNbRep}{2}%2réponses {% \ifboolKV[reponsesqcm]{Filets}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \RepQCMLabelB\QCMListereponses[2] \\ \end{tblr}% }% {}% \IfEq{\QCMNbRep}{3}%3réponses {% \ifboolKV[reponsesqcm]{Filets}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{3}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{3}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \RepQCMLabelB\QCMListereponses[2] & \RepQCMLabelC\QCMListereponses[3] \\ \end{tblr}% }% {}% \IfEq{\QCMNbRep}{4}%4réponses {% \IfEq{\RepQCMNbCol}{4}%4colonnes {% \ifboolKV[reponsesqcm]{Filets}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{4}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{4}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \RepQCMLabelB\QCMListereponses[2] & \RepQCMLabelC\QCMListereponses[3] & \RepQCMLabelD\QCMListereponses[4] \\ \end{tblr}% }% {% \ifboolKV[reponsesqcm]{Filets}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \ifboolKV[reponsesqcm]{Swap}{\RepQCMLabelB\QCMListereponses[2]}{\RepQCMLabelC\QCMListereponses[3]} \\ \ifboolKV[reponsesqcm]{Swap}{\RepQCMLabelC\QCMListereponses[3]}{\RepQCMLabelB\QCMListereponses[2]} & \RepQCMLabelD\QCMListereponses[4] \\ \end{tblr}% }% }% {}% } %====CENTRAGE \newlength{\centeraltbef}%avant \newlength{\centeraltbeh}%après \defKV[myaltcenter]{Avant=\setlength{\centeraltbef}{#1},Apres=\setlength{\centeraltbeh}{#1}} \setKVdefault[myaltcenter]{Avant=0.33\baselineskip,Apres=0.33\baselineskip} \NewDocumentEnvironment{Centrage}{ O{} }% {\restoreKV[myaltcenter]\setKV[myaltcenter]{#1}\par\kern\centeraltbef\centering}% {\par\kern\centeraltbeh} %====MULTICOLS \NewDocumentCommand\CoeffEspaceMulticols{ O{1} }{% \setlength{\multicolsep}{12pt plus 4pt minus 3pt}% \IfStrEq{#1}{1.25}{\setlength{\multicolsep}{15pt plus 5pt minus 3.75pt}}{}% 125% of orig. values \IfStrEq{#1}{0.75}{\setlength{\multicolsep}{9pt plus 3pt minus 2.25pt}}{}% 75% of orig. values \IfStrEq{#1}{0.66}{\setlength{\multicolsep}{8pt plus 2.67pt minus 2pt}}{}% 66% of orig. values \IfStrEq{#1}{0.50}{\setlength{\multicolsep}{6pt plus 2pt minus 1.5pt}}{}% 50% of orig. values \IfStrEq{#1}{0.33}{\setlength{\multicolsep}{4pt plus 1.33pt minus 1pt}}{}% 33% of orig. values \IfStrEq{#1}{0.25}{\setlength{\multicolsep}{3pt plus 1pt minus 0.75pt}}{}% 25% of orig. values \IfStrEq{#1}{0}{\setlength{\multicolsep}{0pt}}{}% 0% of orig. values } \setKVdefault[multicolsperso]{% Type=texte,% CoeffEspVert=0.50,% EpTrait=0pt } \NewDocumentEnvironment{MultiCols}{ O{} r() D<>{} }% {% \useKVdefault[multicolsperso]% \setKV[multicolsperso]{#1}% \CoeffEspaceMulticols[\useKV[multicolsperso]{CoeffEspVert}]% \setlength{\columnseprule}{\useKV[multicolsperso]{EpTrait}}% \begin{multicols}{#2}% \IfStrEq{\useKV[multicolsperso]{Type}}{enum}{\begin{enumerate}[#3]}{}% \IfStrEq{\useKV[multicolsperso]{Type}}{item}{\begin{itemize}[#3]}{}% }% {% \IfStrEq{\useKV[multicolsperso]{Type}}{enum}{\end{enumerate}}{}% \IfStrEq{\useKV[multicolsperso]{Type}}{item}{\end{itemize}}{}% \end{multicols}% \CoeffEspaceMulticols[1]% \setlength{\columnseprule}{0pt}% } %====ITEMCHOICE \NewDocumentCommand\CreerListeItems{ m m m }{%1=liste,%2=macro,3=nomliste \@ifIsList{#3}% {La liste \texttt{#3} existe déjà, svp choisir un autre nom.}% {\xdef#2{#1}\NewList{#3}}% } \defKV[itemchoisir]{% Type=\def\ChoixTypeSerie{#1} } \setKVdefault[itemchoisir]{% Alea=false,% Type=enum } \NewDocumentCommand\ListeChoixItems{ O{} m m r() D<>{} }{%1=options,2=série des items,3=nomsérie,4=liste choix,5=options enum %on teste si la liste considérée existe... \@ifIsList{#3}% {% \restoreKV[itemchoisir]% \setKV[itemchoisir]{#1}% \ClearList{#3}% %création de la liste \ifboolKV[itemchoisir]{Alea}% {% \xintFor* ##1 in {\xintCSVtoList{#2}}\do{\InsertRandomItem{#3}{##1}} }% {% \xintFor* ##1 in {\xintCSVtoList{#2}}\do{\InsertLastItem{#3}{##1}} }% %création de l'environnement \IfStrEq{\ChoixTypeSerie}{enum}% {\begin{enumerate}[#5]}{}% \IfStrEq{\ChoixTypeSerie}{item}% {\begin{itemize}[#5]}{}% \IfSubStr{\ChoixTypeSerie}{MultiCols}% {% \StrBetween[1,2]{\ChoixTypeSerie}{/}{/}[\ChoixTypeMulticols]% \StrBehind[2]{\ChoixTypeSerie}{/}[\NbMulticols]% \begin{MultiCols}[Type=\ChoixTypeMulticols](\NbMulticols)<#5>% }{}% %items choisis \ifboolKV[itemchoisir]{Alea}% {% \xintFor* ##1 in {\xintSeq{0}{\xinteval{#4-1}}}\do{\GetItem{#3}{##1}{ItemChoisi}\item \ItemChoisi} }% {% \xintFor* ##1 in {\xintCSVtoList{#4}}\do{\GetItem{#3}{\xinteval{##1-1}}{ItemChoisi}\item \ItemChoisi} } %fin de l'environnement \IfStrEq{\ChoixTypeSerie}{enum}% {\end{enumerate}}{} \IfStrEq{\ChoixTypeSerie}{item} {\end{itemize}}{}% \IfSubStr{\ChoixTypeSerie}{MultiCols}% {\end{MultiCols}}{}% }% {% La liste \texttt{#3} n'existe pas, veuillez la créer avec la macro \texttt{\textbackslash CreerListeItems}.% }% } %====TABLEAU DE COMPÉTENCES %patch fa vcenter \NewDocumentCommand{\vcenterfa}{ O{} m }{$\vcenter{\hbox{\faIcon[#1]{#2}}}$} %labelnote \def\LabelNoteComp{Note} %listeniveaux \def\LstDeuxNiv{NA § A} \def\LstTroisNiv{NA § ECA § A} \def\LstQuatreNiv{NA § PA § ECA § A} %noticeniveaux \def\NoticeDeuxNiv{Non acquis § Acquis} \def\NoticeTroisNiv{Non acquis § En cours d'acquis. § Acquis} \def\NoticeQuatreNiv{Non acquis § Part. acquis § En cours d'acquis. § Acquis} %nivparbatteries \def\DeuxNivBatterie{\vcenterfa[solid]{battery-quarter} § \vcenterfa[solid]{battery-full}} \def\TroisNivBatterie{\vcenterfa[solid]{battery-quarter} § \vcenterfa[solid]{battery-half} § \vcenterfa[solid]{battery-full}} \def\QuatreNivBatterie{\vcenterfa[solid]{battery-empty} § \vcenterfa[solid]{battery-quarter} § \vcenterfa[solid]{battery-half} § \vcenterfa[solid]{battery-full}} %nivparsmileys \def\DeuxNivSmiley{\vcenterfa[regular]{angry} § \vcenterfa[regular]{smile}} \def\TroisNivSmiley{\vcenterfa[regular]{angry} § \vcenterfa[regular]{frown} § \vcenterfa[regular]{smile}} \def\QuatreNivSmiley{\vcenterfa[regular]{angry} § \vcenterfa[regular]{frown} § \vcenterfa[regular]{smile} § \vcenterfa[regular]{grin}} % ========================tableau compétences \defKV[tblcomp]{% Largeur=\def\COMPETlargeur{#1},% LargeurNivs=\def\COMPETlargeurs{#1},% Niveaux=\def\COMPETniveaux{#1},% NoticeNiveaux=\def\COMPETnoticeniveaux{#1},% Titre=\def\COMPETtitre{#1},% PolTitre=\def\COMPETlegende{#1},% PolComp=\def\COMPETcomp{#1},% PolNotice=\def\COMPETnotice{#1},% LigneSep=\def\COMPETsep{#1} } \setKVdefault[tblcomp]{% Largeur=0.95\linewidth,% LargeurNivs={0.75cm § 1.25cm},%niv + note Niveaux={NA § ECA § A},% NoticeNiveaux={Non acquis § En cours d'acquisition § Acquis},% Titre=DS01,% PolTitre=\small\sffamily\bfseries,% PolNotice=\small\sffamily\bfseries,% PolComp=\small\sffamily,% LigneSep=2pt,% CouleurNotice=black,% CouleurNiveaux=black,% CouleurFond=lightgray!25,% Note=true,% Notice=true } %pour créer le body du tableau (j'ai encore du mal avec ça...) \long\def\tblcompaddto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} \NewDocumentCommand{\TableauCompetences}{ O{} m }{%1=options,2=liste compétences \useKVdefault[tblcomp]% \setKV[tblcomp]{#1}% on paramètres les nouvelles clés et on les simplifie \setsepchar{§}% \readlist*\ListeCompetences{#2}% \readlist*\ListeNiveaux{\COMPETniveaux}% \readlist*\ListeLargeurs{\COMPETlargeurs}% \readlist*\ListeNoticeNiveaux{\COMPETnoticeniveaux}% \def\CPtabledatacomp{}% \xintifboolexpr{\ListeNiveauxlen == 2}%avec 3 niveaux de compétences {% \ifboolKV[tblcomp]{Note}% {% \tblcompaddto\CPtabledatacomp{\COMPETtitre & \ListeNiveaux[1] & \ListeNiveaux[2] & \LabelNoteComp \\}% \xintFor* ##1 in {\xintSeq{1}{\ListeCompetenceslen}}\do{% \tblcompaddto\CPtabledatacomp{\ListeCompetences[\the\numexpr\therownum-1\relax] & & & \\}% }% \ifboolKV[tblcomp]{Notice}% {% \tblcompaddto\CPtabledatacomp{{\ListeNiveaux[1]} : {\ListeNoticeNiveaux[1]} / {\ListeNiveaux[2]} : {\ListeNoticeNiveaux[2]} & & & \\} %creation du tableau note+notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{2}{Q[c,b,\ListeLargeurs[1]]}Q[c,b,\ListeLargeurs[2]]},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Y}={font=\COMPETcomp},% row{Z}={font=\COMPETnotice,fg=\useKV[tblcomp]{CouleurNotice}},% cell{2}{Z}={r=\the\numexpr\ListeCompetenceslen+1\relax}{},% cell{Z}{1}={c=3}{} }% \CPtabledatacomp \end{tblr}% }% {% %creation du tableau note-notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{2}{Q[c,b,\ListeLargeurs[1]]}Q[c,b,\ListeLargeurs[2]]},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Z}={font=\COMPETcomp},% cell{2}{Z}={r=\the\numexpr\ListeCompetenceslen\relax}{} }% \CPtabledatacomp \end{tblr}% }% }% {% \tblcompaddto\CPtabledatacomp{\COMPETtitre & \ListeNiveaux[1] & \ListeNiveaux[2] \\}% \xintFor* ##1 in {\xintSeq{1}{\ListeCompetenceslen}}\do{% \tblcompaddto\CPtabledatacomp{\ListeCompetences[\the\numexpr\therownum-1\relax] & & \\}% }% \ifboolKV[tblcomp]{Notice}% {% \tblcompaddto\CPtabledatacomp{{\ListeNiveaux[1]} : {\ListeNoticeNiveaux[1]} / {\ListeNiveaux[2]} : {\ListeNoticeNiveaux[2]} & & \\} %creation du tableau -note+notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{2}{Q[c,b,\ListeLargeurs[1]]}},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Y}={font=\COMPETcomp},% row{Z}={font=\COMPETnotice,fg=\useKV[tblcomp]{CouleurNotice}},% cell{Z}{1}={c=3}{} }% \CPtabledatacomp \end{tblr}% }% {% %creation du tableau -note-notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{2}{Q[c,b,\ListeLargeurs[1]]}},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Z}={font=\COMPETcomp} }% \CPtabledatacomp \end{tblr}% }% }% }% {}% \xintifboolexpr{\ListeNiveauxlen == 3}%avec 3 niveaux de compétences {% \ifboolKV[tblcomp]{Note}% {% \tblcompaddto\CPtabledatacomp{\COMPETtitre & \ListeNiveaux[1] & \ListeNiveaux[2] & \ListeNiveaux[3] & \LabelNoteComp \\}% \xintFor* ##1 in {\xintSeq{1}{\ListeCompetenceslen}}\do{% \tblcompaddto\CPtabledatacomp{\ListeCompetences[\the\numexpr\therownum-1\relax] & & & & \\}% }% \ifboolKV[tblcomp]{Notice}% {% \tblcompaddto\CPtabledatacomp{{\ListeNiveaux[1]} : {\ListeNoticeNiveaux[1]} / {\ListeNiveaux[2]} : {\ListeNoticeNiveaux[2]} / {\ListeNiveaux[3]} : {\ListeNoticeNiveaux[3]} & & & & \\} %creation du tableau note+notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{3}{Q[c,b,\ListeLargeurs[1]]}Q[c,b,\ListeLargeurs[2]]},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Y}={font=\COMPETcomp},% row{Z}={font=\COMPETnotice,fg=\useKV[tblcomp]{CouleurNotice}},% cell{2}{Z}={r=\the\numexpr\ListeCompetenceslen+1\relax}{},% cell{Z}{1}={c=4}{} }% \CPtabledatacomp \end{tblr}% }% {% %creation du tableau note-notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{3}{Q[c,b,\ListeLargeurs[1]]}Q[c,b,\ListeLargeurs[2]]},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Z}={font=\COMPETcomp},% cell{2}{Z}={r=\the\numexpr\ListeCompetenceslen\relax}{} }% \CPtabledatacomp \end{tblr}% }% }% {% \tblcompaddto\CPtabledatacomp{\COMPETtitre & \ListeNiveaux[1] & \ListeNiveaux[2] & \ListeNiveaux[3] \\}% \xintFor* ##1 in {\xintSeq{1}{\ListeCompetenceslen}}\do{% \tblcompaddto\CPtabledatacomp{\ListeCompetences[\the\numexpr\therownum-1\relax] & & & \\}% }% \ifboolKV[tblcomp]{Notice}% {% \tblcompaddto\CPtabledatacomp{{\ListeNiveaux[1]} : {\ListeNoticeNiveaux[1]} / {\ListeNiveaux[2]} : {\ListeNoticeNiveaux[2]} / {\ListeNiveaux[3]} : {\ListeNoticeNiveaux[3]} & & & \\} %creation du tableau -note+notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{3}{Q[c,b,\ListeLargeurs[1]]}},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Y}={font=\COMPETcomp},% row{Z}={font=\COMPETnotice,fg=\useKV[tblcomp]{CouleurNotice}},% cell{Z}{1}={c=4}{} }% \CPtabledatacomp \end{tblr}% }% {% %creation du tableau -note-notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{3}{Q[c,b,\ListeLargeurs[1]]}},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Z}={font=\COMPETcomp} }% \CPtabledatacomp \end{tblr}% }% }% }% {}% \xintifboolexpr{\ListeNiveauxlen == 4}%maintenant avec 4 niveaux de compétences {% \ifboolKV[tblcomp]{Note}% {% \tblcompaddto\CPtabledatacomp{\COMPETtitre & \ListeNiveaux[1] & \ListeNiveaux[2] & \ListeNiveaux[3] & \ListeNiveaux[4] & \LabelNoteComp \\}% \xintFor* ##1 in {\xintSeq{1}{\ListeCompetenceslen}}\do{% \tblcompaddto\CPtabledatacomp{\ListeCompetences[\the\numexpr\therownum-1\relax] & & & & & \\}% }% \ifboolKV[tblcomp]{Notice}% {% \tblcompaddto\CPtabledatacomp{{\ListeNiveaux[1]} : {\ListeNoticeNiveaux[1]} / {\ListeNiveaux[2]} : {\ListeNoticeNiveaux[2]} / {\ListeNiveaux[3]} : {\ListeNoticeNiveaux[3]} / {\ListeNiveaux[4]} : {\ListeNoticeNiveaux[4]} & & & & & \\} %creation du tableau note+notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{4}{Q[c,b,\ListeLargeurs[1]]}Q[c,b,\ListeLargeurs[2]]},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Y}={font=\COMPETcomp},% row{Z}={font=\COMPETnotice,fg=\useKV[tblcomp]{CouleurNotice}},% cell{2}{Z}={r=\the\numexpr\ListeCompetenceslen+1\relax}{},% cell{Z}{1}={c=5}{} }% \CPtabledatacomp \end{tblr}% }% {% %creation du tableau note-notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{4}{Q[c,b,\ListeLargeurs[1]]}Q[c,b,\ListeLargeurs[2]]},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Z}={font=\COMPETcomp},% cell{2}{Z}={r=\the\numexpr\ListeCompetenceslen\relax}{} }% \CPtabledatacomp \end{tblr}% }% }% {% \tblcompaddto\CPtabledatacomp{\COMPETtitre & \ListeNiveaux[1] & \ListeNiveaux[2] & \ListeNiveaux[3] & \ListeNiveaux[4] \\}% \xintFor* ##1 in {\xintSeq{1}{\ListeCompetenceslen}}\do{% \tblcompaddto\CPtabledatacomp{\ListeCompetences[\the\numexpr\therownum-1\relax] & & & & \\}% }% \ifboolKV[tblcomp]{Notice}% {% \tblcompaddto\CPtabledatacomp{{\ListeNiveaux[1]} : {\ListeNoticeNiveaux[1]} / {\ListeNiveaux[2]} : {\ListeNoticeNiveaux[2]} / {\ListeNiveaux[3]} : {\ListeNoticeNiveaux[3]} / {\ListeNiveaux[4]} : {\ListeNoticeNiveaux[4]} & & & & \\} %creation du tableau -note+notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{4}{Q[c,b,\ListeLargeurs[1]]}},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Y}={font=\COMPETcomp},% row{Z}={font=\COMPETnotice,fg=\useKV[tblcomp]{CouleurNotice}},% cell{Z}{1}={c=5}{} }% \CPtabledatacomp \end{tblr}% }% {% %creation du tableau -note-notice \begin{tblr}[expand=\CPtabledatacomp]% {% width={\COMPETlargeur},% hlines,vlines,colspec={X[l,b]*{4}{Q[c,b,\ListeLargeurs[1]]}},% rowsep=\COMPETsep,% row{1}={font=\COMPETlegende,fg=\useKV[tblcomp]{CouleurNiveaux},bg=\useKV[tblcomp]{CouleurFond}},% row{2-Z}={font=\COMPETcomp} }% \CPtabledatacomp \end{tblr}% }% }% }% {}% } %====PENSKILLS \defKV[tachescrayon]{% PoliceCateg=\def\pentaksfontcateg{#1},% PoliceBloc=\def\pentaksfontblock{#1},% Couleurs=\def\pentakscolors{#1},% LargeurBloc=\def\pentakswidth{#1}, Echelle=\def\pentakscale{#1} } \setKVdefault[tachescrayon]{% PoliceCateg=\bfseries\sffamily,% PoliceBloc=\small\ttfamily,% %Couleurs={"yellow/black","orange/black","magenta/black","cyan/black","teal/black","brown/black"},% Couleurs={yellow/black,orange/black,magenta/black,cyan/black,teal/black,brown/black},% LargeurBloc=5cm,% Echelle=1,% NoirBlanc=false } \NewDocumentCommand\CrayonDeCompetences{ O{} D<>{} m }{% \restoreKV[tachescrayon]% \setKV[tachescrayon]{#1}% %liste des couleurs, via listofitems ? \readlist*\lstColors{\pentakscolors}% %\edef\lstColors{\pentakscolors}% \begin{tikzpicture}% [line width=0.25\pgflinewidth,scale=\pentakscale,transform shape,#2,pics/fancy box/.style={code={% \path (0,0) coordinate (C0); \foreach \Item/\Text [count=\Count starting from 0] in {#3} {% \ifboolKV[tachescrayon]{NoirBlanc}% {% \def\mybackcolor{gray}\def\myfontcolor{black} }% {% \itemtomacro\lstColors[\the\numexpr\Count+1\relax]\mycolor \IfSubStr{\mycolor}{/}% {% \StrCut{\mycolor}{/}{\mybackcolor}{\myfontcolor}% }% {% \def\mybackcolor{\mycolor}\def\myfontcolor{black}% }% }% \node[rounded rectangle,rounded rectangle left arc=none,draw=\mybackcolor,fill=\mybackcolor,anchor=north west,font=\pentaksfontcateg,text=\myfontcolor,outer sep=0pt,inner sep=0.75ex] (RR\Count) at (C\Count) {\vphantom{pL}\Item}; \node[line width={\pentakscale*3\pgflinewidth},anchor=north west,below right={\pentakscale*1ex} of RR\Count.south west,draw,text width=\pentakswidth,font=\pentaksfontblock,inner sep=0.75ex] (T\Count) {\Text}; \coordinate[below left={\pentakscale*1ex} of T\Count.south west] (C\the\numexpr\Count+1\relax); \filldraw[\mybackcolor] ([xshift=-1ex]C\Count) rectangle (C\the\numexpr\Count+1\relax); \filldraw[\mybackcolor] ([xshift=-3ex]C\Count) rectangle ([xshift=-2ex]C\the\numexpr\Count+1\relax); \filldraw[\mybackcolor!50!white] ([xshift=-2ex]C\Count) rectangle ([xshift=-1ex]C\the\numexpr\Count+1\relax); \ifnum\Count=0 \shade[ball color=\mybackcolor!75] ([shift={(-3ex-\pentakscale*0.5\pgflinewidth,\pentakscale*0.5\pgflinewidth)}]C\Count) to[out=90,in=90]++(3ex+\pentakscale*\pgflinewidth,0) ; \fi \xdef\myCount{\Count}%last index } \ifboolKV[tachescrayon]{NoirBlanc}% {% \def\mylastbackcolor{gray} \filldraw[lightgray!15] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; }% {% \itemtomacro\lstColors[\the\numexpr\myCount+1\relax]\mylastcolor \IfSubStr{\mylastcolor}{/}% {% \StrBefore{\mylastcolor}{/}[\mylastbackcolor]% }% {% \def\mylastbackcolor{\mylastcolor}% }% \filldraw[brown!10] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; }% \filldraw[\mylastbackcolor] ([shift={(-3ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; \filldraw[\mylastbackcolor] ([shift={(-1ex+\pgflinewidth,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; \filldraw[\mylastbackcolor!50!white] ([shift={(-2ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex,-0.5ex) to[out=0,in=-90]++ (0.5ex,0.5ex) -- cycle ; \filldraw[line join=cap,gray,fill=gray] (aux1) -- (aux2) -- (aux3); }}] \pic{fancy box={#2}}; \end{tikzpicture}% } %====EXERCICE PERSO \newcounter{numeroexo} \setcounter{numeroexo}{0} \newlength{\eptraitexo} \setlength{\eptraitexo}{1.1pt} \newlength{\eptraitexospace} \setlength{\eptraitexospace}{1.5\eptraitexo} \newlength{\tmp@image@hauteur@totale} \newlength{\tmp@image@profondeur} \colorlet{macouleurexo}{blue!50!black} \newcommand\tmpstyleexo{\bfseries\LARGE\sffamily}% \newcommand\tmplabelexo{Exercice~}% \defKV[globalstyleexo]{% Libelle=\renewcommand\tmplabelexo{#1},% Couleur=\colorlet{macouleurexo}{#1},% Police=\renewcommand\tmpstyleexo{#1},% EpTrait=\setlength{\eptraitexo}{#1} } \setKVdefault[globalstyleexo]{% Libelle={Exercice~},% Couleur={blue!50!black},% Police={\bfseries\LARGE\sffamily},% EpTrait={1.1pt} } \NewDocumentCommand\StyleEnvtExo{ O{} }{% \restoreKV[globalstyleexo]% \setKV[globalstyleexo]{#1}% } \NewDocumentCommand\StyleEnvtExoDefaut{ }{% \restoreKV[globalstyleexo]% } \defKV[EnvtExercice]{% 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} } \setKVdefault[EnvtExercice]{ Type=Classique,% ComplementTitre={},% CodeDebut={},% %Couleur=macouleurexo,% EchelleImage=1.15,% Compteur=true,% Decoration={},% Trait=plein } \NewDocumentEnvironment{EnvtExo}{ !O{} }% {% \useKVdefault[EnvtExercice]% \setKV[EnvtExercice]{#1}% \addtocounter{numeroexo}{1}% \ifboolKV[EnvtExercice]{Compteur}{}{\addtocounter{numeroexo}{-1}}% \def\hrulefill{\leavevmode\leaders\hrule height \eptraitexo\hfill\kern\z@}%épaisseur \noindent\begingroup\color{macouleurexo}% \IfStrEq{\EnvtExoType}{Classique}%OK exo°____vide {% %label avec numéro et complément \tmpstyleexo\tmplabelexo\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% {pointilles}{\,\dotfill}% {dashilles}{\,\hdashrule{\fill}{\eptraitexo}{\eptraitexospace}}% {non}{\hfill}% }% %décoration éventuelle \IfSubStr{\EnvtExoDeco}{Icone}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoIcon]% \,\scalebox{0.85}[0.85]{\EnvtExoIcon}% }{}% \IfSubStr{\EnvtExoDeco}{Ceinture}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoCouleur]% \,\CeintureCouleur{\EnvtExoCouleur}% }{}% \IfSubStr{\EnvtExoDeco}{Chrono}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoChrono]% \,\pictochrono[ColTime=macouleurexo!50]{\EnvtExoChrono}% }{}% \IfSubStr{\EnvtExoDeco}{Points}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoPts]% \IfStrEq{\EnvtExoPts}{1}{\def\pts{point}}{\def\pts{points}}% \,(\EnvtExoPts\ \pts)% }{}% \IfSubStr{\EnvtExoDeco}{Image}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoImg]% \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% }{}% \IfSubStr{\EnvtExoType}{Perso}%OK perso____déco {% \StrBehind{\EnvtExoType}{/}[\EnvtExoLabel]% %label avec numéro et complément \tmpstyleexo\EnvtExoLabel\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% {pointilles}{\,\dotfill}% {dashilles}{\,\hdashrule{\fill}{\eptraitexo}{\eptraitexospace}}% {non}{\hfill}% }% %décoration éventuelle \IfSubStr{\EnvtExoDeco}{Icone}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoIcon]% \,\scalebox{0.85}[0.85]{\EnvtExoIcon}% }{}% \IfSubStr{\EnvtExoDeco}{Ceinture}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoCouleur]% \,\CeintureCouleur{\EnvtExoCouleur}% }{}% \IfSubStr{\EnvtExoDeco}{Chrono}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoChrono]% \,\pictochrono[ColTime=macouleurexo!50]{\EnvtExoChrono}% }{}% \IfSubStr{\EnvtExoDeco}{Points}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoPts]% \IfStrEq{\EnvtExoPts}{1}{\def\pts{point}}{\def\pts{points}}% \,(\EnvtExoPts\ \pts)% }{}% \IfSubStr{\EnvtExoDeco}{Image}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoImg]% \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% }{}% \endgroup% \def\hrulefill{\leavevmode\leaders\hrule height 0.4pt\hfill\kern\z@}% \par% \EnvtExoCodeAvant% }% {}% \NewDocumentCommand\TitreExo{ !O{} }{% \useKVdefault[EnvtExercice]% \setKV[EnvtExercice]{#1}% \addtocounter{numeroexo}{1}% \ifboolKV[EnvtExercice]{Compteur}{}{\addtocounter{numeroexo}{-1}}% \def\hrulefill{\leavevmode\leaders\hrule height \eptraitexo\hfill\kern\z@}%épaisseur \noindent\begingroup\color{macouleurexo}% \IfStrEq{\EnvtExoType}{Classique}%OK exo°____vide {% %label avec numéro et complément \tmpstyleexo\tmplabelexo\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% {pointilles}{\,\dotfill}% {dashilles}{\,\hdashrule{\fill}{\eptraitexo}{\eptraitexospace}}% {non}{\hfill}% }% %décoration éventuelle \IfSubStr{\EnvtExoDeco}{Icone}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoIcon]% \,\scalebox{0.85}[0.85]{\EnvtExoIcon}% }{}% \IfSubStr{\EnvtExoDeco}{Ceinture}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoCouleur]% \,\CeintureCouleur{\EnvtExoCouleur}% }{}% \IfSubStr{\EnvtExoDeco}{Chrono}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoChrono]% \,\pictochrono[ColTime=macouleurexo!50]{\EnvtExoChrono}% }{}% \IfSubStr{\EnvtExoDeco}{Points}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoPts]% \IfStrEq{\EnvtExoPts}{1}{\def\pts{point}}{\def\pts{points}}% \,(\EnvtExoPts\ \pts)% }{}% \IfSubStr{\EnvtExoDeco}{Image}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoImg]% \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% }{}% \IfSubStr{\EnvtExoType}{Perso}%OK perso____déco {% \StrBehind{\EnvtExoType}{/}[\EnvtExoLabel]% %label avec numéro et complément \tmpstyleexo\EnvtExoLabel\ifboolKV[EnvtExercice]{Compteur}{\thenumeroexo}{}\EnvtExoCpltTitre% %trait éventuel \IfStrEqCase{\EnvtExoTrait}{% {plein}{\,\hrulefill}% {pointilles}{\,\dotfill}% {dashilles}{\,\hdashrule{\fill}{\eptraitexo}{\eptraitexospace}}% {non}{\hfill}% }% %décoration éventuelle \IfSubStr{\EnvtExoDeco}{Icone}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoIcon]% \,\scalebox{0.85}[0.85]{\EnvtExoIcon}% }{}% \IfSubStr{\EnvtExoDeco}{Ceinture}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoCouleur]% \,\CeintureCouleur{\EnvtExoCouleur}% }{}% \IfSubStr{\EnvtExoDeco}{Chrono}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoChrono]% \,\pictochrono[ColTime=macouleurexo!50]{\EnvtExoChrono}% }{}% \IfSubStr{\EnvtExoDeco}{Points}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoPts]% \IfStrEq{\EnvtExoPts}{1}{\def\pts{point}}{\def\pts{points}}% \,(\EnvtExoPts\ \pts)% }{}% \IfSubStr{\EnvtExoDeco}{Image}% {% \StrBehind{\EnvtExoDeco}{/}[\EnvtExoImg]% \settototalheight{\tmp@image@hauteur@totale}{\hbox{\tmpstyleexo qB}}% \,$\vcenter{\hbox{\includegraphics[height=\EnvtExoScaleImg\tmp@image@hauteur@totale]{\EnvtExoImg}}}$% }{}% }{}% \endgroup% \def\hrulefill{\leavevmode\leaders\hrule height 0.4pt\hfill\kern\z@}% \par% \EnvtExoCodeAvant% } %%----COMMANDES EN %====QCMs \defKV[answersmcq]{% NumCols=\def\RepQCMNbCol{#1},% FontLabels=\def\RepQCMFonte{#1},% SpaceCR=\def\RepQCMOffset{#1},% Labels=\def\RepQCMTypeLabel{#1},% SpaceLabels=\xdef\RepQCMSpace{#1},% Width=\def\RepQCMLarg{#1} } \setKVdefault[answersmcq]{% SpaceCR={6pt/2pt},% NumCols=4,% Lines=false,% FontLabels={\bfseries},% Labels={a.},% SpaceLabels=\kern5pt,% Swap=false,% Width=0.99\linewidth } \NewDocumentCommand\MCQFormatLabel{ m m }{%1=typelabel,%3=caractère \IfSubStr{#1}{a}% {% {\RepQCMFonte\StrSubstitute{#1}{a}{#2}}% }% {}% \IfSubStr{#1}{A}% {% {\RepQCMFonte\StrSubstitute{#1}{A}{#2}}% }% {}% \IfSubStr{#1}{1}% {% {\RepQCMFonte\StrSubstitute{#1}{1}{#2}}% }% {}% } \NewDocumentCommand\AnswersMCQ{ O{} m D<>{} }{%1=nbcol,2=listeréponses \restoreKV[answersmcq]% \setKV[answersmcq]{#1}% \IfSubStr{\RepQCMOffset}{/}% {\StrCut{\RepQCMOffset}{/}{\RepQCMOffsetCol}{\RepQCMOffsetLgn}}% {\def\RepQCMOffsetCol{\RepQCMOffset}\def\RepQCMOffsetLgn{\RepQCMOffset}}% \setsepchar{§}% \readlist*\QCMListereponses{#2}% \def\QCMNbRep{\QCMListereponseslen}% %les items créés \IfSubStr{\RepQCMTypeLabel}{a}% {% \xdef\RepQCMLabelA{\MCQFormatLabel{\RepQCMTypeLabel}{a}\RepQCMSpace}% \xdef\RepQCMLabelB{\MCQFormatLabel{\RepQCMTypeLabel}{b}\RepQCMSpace}% \xdef\RepQCMLabelC{\MCQFormatLabel{\RepQCMTypeLabel}{c}\RepQCMSpace}% \xdef\RepQCMLabelD{\MCQFormatLabel{\RepQCMTypeLabel}{d}\RepQCMSpace}% }{}% \IfSubStr{\RepQCMTypeLabel}{A}% {% \xdef\RepQCMLabelA{\MCQFormatLabel{\RepQCMTypeLabel}{A}\RepQCMSpace}% \xdef\RepQCMLabelB{\MCQFormatLabel{\RepQCMTypeLabel}{B}\RepQCMSpace}% \xdef\RepQCMLabelC{\MCQFormatLabel{\RepQCMTypeLabel}{C}\RepQCMSpace}% \xdef\RepQCMLabelD{\MCQFormatLabel{\RepQCMTypeLabel}{D}\RepQCMSpace}% }{}% \IfSubStr{\RepQCMTypeLabel}{1}% {% \xdef\RepQCMLabelA{\MCQFormatLabel{\RepQCMTypeLabel}{1}\RepQCMSpace}% \xdef\RepQCMLabelB{\MCQFormatLabel{\RepQCMTypeLabel}{2}\RepQCMSpace}% \xdef\RepQCMLabelC{\MCQFormatLabel{\RepQCMTypeLabel}{3}\RepQCMSpace}% \xdef\RepQCMLabelD{\MCQFormatLabel{\RepQCMTypeLabel}{4}\RepQCMSpace}% }{}% %en fonction du nb de colonnes \IfEq{\QCMNbRep}{2}%2réponses {% \ifboolKV[answersmcq]{Lines}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \RepQCMLabelB\QCMListereponses[2] \\ \end{tblr}% }% {}% \IfEq{\QCMNbRep}{3}%3réponses {% \ifboolKV[answersmcq]{Lines}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{3}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{3}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \RepQCMLabelB\QCMListereponses[2] & \RepQCMLabelC\QCMListereponses[3] \\ \end{tblr}% }% {}% \IfEq{\QCMNbRep}{4}%4réponses {% \IfEq{\RepQCMNbCol}{4}%4colonnes {% \ifboolKV[answersmcq]{Lines}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{4}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{4}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \RepQCMLabelB\QCMListereponses[2] & \RepQCMLabelC\QCMListereponses[3] & \RepQCMLabelD\QCMListereponses[4] \\ \end{tblr}% }% {% \ifboolKV[answersmcq]{Lines}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,hlines,vlines,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% {\begin{tblr}{rowsep=\RepQCMOffsetLgn,colsep=\RepQCMOffsetCol,width=\RepQCMLarg,colspec={*{2}{X[b,l]}},#3}}% \RepQCMLabelA\QCMListereponses[1] & \ifboolKV[answersmcq]{Swap}{\RepQCMLabelB\QCMListereponses[2]}{\RepQCMLabelC\QCMListereponses[3]} \\ \ifboolKV[answersmcq]{Swap}{\RepQCMLabelC\QCMListereponses[3]}{\RepQCMLabelB\QCMListereponses[2]} & \RepQCMLabelD\QCMListereponses[4] \\ \end{tblr}% }% }% {}% } %====ITEMCHOICE \NewDocumentCommand\CreateItemsList{ m m m }{%1=liste,%2=macro,3=nomliste \@ifIsList{#3}% {The list \texttt{#3} already exists, pick an other name.}% {\xdef#2{#1}\NewList{#3}}% } \defKV[itemchoice]{% Type=\def\ChoixTypeSerie{#1} } \setKVdefault[itemchoice]{% Random=false,% Type=enum } \NewDocumentCommand\ListItemsChoice{ O{} m m r() D<>{} }{%1=options,2=série des items,3=nomsérie,4=liste choix,5=options enum %on teste si la liste considérée existe... \@ifIsList{#3}% {% \restoreKV[itemchoice]% \setKV[itemchoice]{#1}% \ClearList{#3}% %création de la liste \ifboolKV[itemchoice]{Random}% {% \xintFor* ##1 in {\xintCSVtoList{#2}}\do{\InsertRandomItem{#3}{##1}} }% {% \xintFor* ##1 in {\xintCSVtoList{#2}}\do{\InsertLastItem{#3}{##1}} }% %création de l'environnement \IfStrEq{\ChoixTypeSerie}{enum}% {\begin{enumerate}[#5]}{}% \IfStrEq{\ChoixTypeSerie}{item}% {\begin{itemize}[#5]}{}% \IfSubStr{\ChoixTypeSerie}{MultiCols}% {% \StrBetween[1,2]{\ChoixTypeSerie}{/}{/}[\ChoixTypeMulticols]% \StrBehind[2]{\ChoixTypeSerie}{/}[\NbMulticols]% \begin{MultiCols}[Type=\ChoixTypeMulticols](\NbMulticols)<#5>% }{}% %items choisis \ifboolKV[itemchoice]{Random}% {% \xintFor* ##1 in {\xintSeq{0}{\xinteval{#4-1}}}\do{\GetItem{#3}{##1}{ItemChoisi}\item \ItemChoisi} }% {% \xintFor* ##1 in {\xintCSVtoList{#4}}\do{\GetItem{#3}{\xinteval{##1-1}}{ItemChoisi}\item \ItemChoisi} } %fin de l'environnement \IfStrEq{\ChoixTypeSerie}{enum}% {\end{enumerate}}{} \IfStrEq{\ChoixTypeSerie}{item} {\end{itemize}}{}% \IfSubStr{\ChoixTypeSerie}{MultiCols}% {\end{MultiCols}}{}% }% {% The list \texttt{#3} doesn't exist, please use \texttt{\textbackslash CreerListeItems} to create it.% }% } %====PENSKILLS \defKV[pentasks]{% FontCateg=\def\pentaksfontcateg{#1},% FontBlock=\def\pentaksfontblock{#1},% Colors=\def\pentakscolors{#1},% BlockWidth=\def\pentakswidth{#1}, Scale=\def\pentakscale{#1} } \setKVdefault[pentasks]{% FontCateg=\bfseries\sffamily,% FontBlock=\small\ttfamily,% %Colors={"yellow/black","orange/black","magenta/black","cyan/black","teal/black","brown/black"},% Colors={yellow/black,orange/black,magenta/black,cyan/black,teal/black,brown/black},% BlockWidth=5cm,% Scale=1,% BlackWhite=false } \NewDocumentCommand\PencilSkills{ O{} D<>{} m }{% \restoreKV[pentasks]% \setKV[pentasks]{#1}% %\edef\lstColors{\pentakscolors}% \readlist*\lstColors{\pentakscolors}% \begin{tikzpicture}% [line width=0.25\pgflinewidth,scale=\pentakscale,transform shape,#2,pics/fancy box/.style={code={% \path (0,0) coordinate (C0); \foreach \Item/\Text [count=\Count starting from 0] in {#3} {% \ifboolKV[pentasks]{BlackWhite}% {% \def\mybackcolor{gray}\def\myfontcolor{black} }% {% %\pgfmathsetmacro{\mycolor}{{\lstColors}[\Count]} \itemtomacro\lstColors[\the\numexpr\Count+1\relax]\mycolor \IfSubStr{\mycolor}{/}% {% \StrCut{\mycolor}{/}{\mybackcolor}{\myfontcolor}% }% {% \def\mybackcolor{\mycolor}\def\myfontcolor{\mycolor}% }% }% \node[rounded rectangle,rounded rectangle left arc=none,draw=\mybackcolor,fill=\mybackcolor,anchor=north west,font=\pentaksfontcateg,text=\myfontcolor,outer sep=0pt,inner sep=0.75ex] (RR\Count) at (C\Count) {\vphantom{pL}\Item}; \node[line width={\pentakscale*3\pgflinewidth},anchor=north west,below right={\pentakscale*1ex} of RR\Count.south west,draw,text width=\pentakswidth,font=\pentaksfontblock,inner sep=0.75ex] (T\Count) {\Text}; \coordinate[below left={\pentakscale*1ex} of T\Count.south west] (C\the\numexpr\Count+1\relax); \filldraw[\mybackcolor] ([xshift=-1ex]C\Count) rectangle (C\the\numexpr\Count+1\relax); \filldraw[\mybackcolor] ([xshift=-3ex]C\Count) rectangle ([xshift=-2ex]C\the\numexpr\Count+1\relax); \filldraw[\mybackcolor!50!white] ([xshift=-2ex]C\Count) rectangle ([xshift=-1ex]C\the\numexpr\Count+1\relax); \ifnum\Count=0 \shade[ball color=\mybackcolor!75] ([shift={(-3ex-\pentakscale*0.5\pgflinewidth,\pentakscale*0.5\pgflinewidth)}]C\Count) to[out=90,in=90]++(3ex+\pentakscale*\pgflinewidth,0) ; % (C\Count); \fi \xdef\myCount{\Count}%last index } \ifboolKV[pentasks]{BlackWhite}% {% \def\mylastbackcolor{gray} \filldraw[lightgray!15] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; }% {% %\pgfmathsetmacro{\mylastcolor}{{\lstColors}[\myCount]} \itemtomacro\lstColors[\the\numexpr\myCount+1\relax]\mylastcolor \IfSubStr{\mylastcolor}{/}% {% \StrBefore{\mylastcolor}{/}[\mylastbackcolor]% }% {% \def\mylastbackcolor{\mylastcolor}% }% \filldraw[brown!10] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; }% \filldraw[\mylastbackcolor] ([shift={(-3ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; \filldraw[\mylastbackcolor] ([shift={(-1ex+\pgflinewidth,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; \filldraw[\mylastbackcolor!50!white] ([shift={(-2ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex,-0.5ex) to[out=0,in=-90]++ (0.5ex,0.5ex) -- cycle ; \filldraw[line join=cap,gray,fill=gray] (aux1) -- (aux2) -- (aux3); }}] \pic{fancy box={#2}}; \end{tikzpicture}% } \endinput