diff options
Diffstat (limited to 'macros/latex/contrib/customenvs/tex/customenvs.sty')
-rw-r--r-- | macros/latex/contrib/customenvs/tex/customenvs.sty | 319 |
1 files changed, 318 insertions, 1 deletions
diff --git a/macros/latex/contrib/customenvs/tex/customenvs.sty b/macros/latex/contrib/customenvs/tex/customenvs.sty index e444e4e1f0..b58ff0ca36 100644 --- a/macros/latex/contrib/customenvs/tex/customenvs.sty +++ b/macros/latex/contrib/customenvs/tex/customenvs.sty @@ -2,9 +2,10 @@ % licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{customenvs}[2023/10/22 0.1.0 Custom classic environments] +\ProvidesPackage{customenvs}[2023/10/25 0.1.1 Custom classic environments] %====HISTORIQUE +% v 0.1.1 Ajout de tableaux de compétences % v 0.1.0 Version initiale %====OPTIONS FR ET EN @@ -17,10 +18,22 @@ \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 @@ -264,6 +277,310 @@ }% } +%====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}% + }% + }% + }% + {}% +} + %%----COMMANDES EN %====QCMs |