summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/profcollege/PfCRapido.tex
blob: cb24c2b40439aa07fe3ae824272099a50b3d106f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
%%%
% Rapido
%%%
\def\filedateRapido{2024/08/04}%
\def\fileversionRapido{0.1}%
\message{-- \filedateRapido\space v\fileversionRapido}%
%
%% D'après https://www.facebook.com/groups/994675223903586/user/100017057226847
%% et une programmation de Laurent Lassale-Carrere
\newcounter{PfCnexo}
\newtcolorbox[use counter=PfCnexo,number format=\arabic]{RapidoBox}{%
  % Titre
  colbacktitle=white,
  fonttitle=\color{black}\Large\bfseries,
  toptitle=1mm,
  bottomtitle=1mm,
  bottom=1mm,
  title={\useKV[ClesRapido]{Titre}},
  %% Cadre principal
  enhanced,
  width=\WidthRapido,
  colback=white,
  valign=top,
  drop lifted shadow
}
\newtcolorbox{QuestionBox}{enhanced,nobeforeafter,size=small,sidebyside adapt=left}
\newtcolorbox{QuestionReponse}{enhanced,nobeforeafter,upperbox=invisible,colback=white,width=1.5cm,grow to left by=3mm,grow to right by=3mm,height=10mm}

\setKVdefault[ClesRapido]{Debut=false,Largeur=0.9\linewidth,Titre={Rapido n°\thetcbcounter\hfill Date :\hspace*{2.5cm}}}%
\defKV[ClesRapido]{Numero=\setKV[ClesRapido]{Debut=true}}

\newlength{\WidthRapido}

\newcommand\Rapido[2][]{% numéro
\useKVdefault[ClesRapido]%
\setKV[ClesRapido]{#1}%
%
\ifboolKV[ClesRapido]{Debut}{%
  \setcounter{PfCnexo}{\fpeval{\useKV[ClesRapido]{Numero}-1}}
}{}%
\setlength{\WidthRapido}{\useKV[ClesRapido]{Largeur}}%
%
\reademptyitems
\setsepchar[*]{§*/}%
\readlist*\ListeRapido{#2}%
\begin{RapidoBox}
  \xintFor* ##1 in {\xintSeq {1}{\ListeRapidolen}}\do{%
    \tcbsidebyside[%
    sidebyside adapt=right,
    bicolor,
    colback=white,colbacklower=yellow!10!white,
    nobeforeafter,
    top=0mm,left=1mm,
    grow to left by=3mm,
    grow to right by=3mm,
    bottom=0mm
    ]{%
      \ListeRapido[##1,1]
    }{%
      \ListeRapido[##1,2]
    }
  }%
\end{RapidoBox}
}%

\newcommand\BoiteRapido[1]{%
  \ifx\bla#1\bla%
  \tcbox[BoiteExpression]{\phantom{100000}}%
  \else%
  \tcbox[BoiteExpression]{#1}%
  \fi
}%