texlive[47360] Master/texmf-dist: scratch (7apr18)

commits+karl at tug.org commits+karl at tug.org
Sat Apr 7 22:58:58 CEST 2018


Revision: 47360
          http://tug.org/svn/texlive?view=revision&revision=47360
Author:   karl
Date:     2018-04-07 22:58:58 +0200 (Sat, 07 Apr 2018)
Log Message:
-----------
scratch (7apr18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/scratch/README
    trunk/Master/texmf-dist/doc/latex/scratch/scratch-fr.pdf
    trunk/Master/texmf-dist/doc/latex/scratch/scratch-fr.tex
    trunk/Master/texmf-dist/tex/latex/scratch/scratch.sty

Modified: trunk/Master/texmf-dist/doc/latex/scratch/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scratch/README	2018-04-07 20:58:43 UTC (rev 47359)
+++ trunk/Master/texmf-dist/doc/latex/scratch/README	2018-04-07 20:58:58 UTC (rev 47360)
@@ -3,14 +3,14 @@
             L'extension
               scratch
 
-               v0.33
+               v0.4
 
-         30 d\'ecembre 2017
+           8 avril 2018
 ___________________________________
 
-Authors   : Christian Tellechea
+Author    : Christian Tellechea
 Maintainer: Christian Tellechea
-E-mail    : unbonpetit at openmailbox.org     (CT)
+E-mail    : unbonpetit at netc.fr     (CT)
             Commentaires, signalements de bugs et
             suggestions bienvenus
 Licence   : Released under the LaTeX Project Public License v1.3c or

Modified: trunk/Master/texmf-dist/doc/latex/scratch/scratch-fr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/scratch/scratch-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scratch/scratch-fr.tex	2018-04-07 20:58:43 UTC (rev 47359)
+++ trunk/Master/texmf-dist/doc/latex/scratch/scratch-fr.tex	2018-04-07 20:58:58 UTC (rev 47360)
@@ -131,7 +131,8 @@
 	\begingroup
 		\centering
 		\null\vskip.25\vsize
-		{\large\bfseries L'extension pour \LaTeX\par \Huge \scrname\par}
+		{\large\bfseries L'extension pour \LaTeX\medbreak
+		\Huge \begin{scratch}[line width=1.5pt]\blockmove\scrname\end{scratch}\par}
 		\bigbreak
 		v \scrver
 		\smallbreak
@@ -157,7 +158,7 @@
 	macros pour dessiner des blocs
 \end{scratch}|
 
-Comme le savent ceux qui enseignent l'algorithmique et la programmation avec le tr\xE8s-\xE0-la-mode\footnote{Je ne d\xE9teste rien de plus comme langage de programmation que ce \emph{truc} vaguement graphique, ultra limit\xE9 et contre-productif dans l'apprentissage du codage qu'est scratch et que l'\xE9ducation nationale veut \xE0 tout prix imposer. Je ne compte bien \xE9videmment pas me plier \xE0 ce nouveau dogme ridicule et ne l'utiliserai ni ne l'enseignerai; je consid\xE8re que les \xE9l\xE8ves m\xE9ritent mieux que scratch --~ADA par exemple~-- comme entr\xE9e dans le monde de la programmation. Ceci dit, coder cette extension a \xE9t\xE9 un petit amusement.} logiciel \xAB \SCRATCH \xBB, les programmes sont construits avec des briques, appel\xE9s \xABblocs\xBB, qui peuvent s'emboiter les uns sur les autres. Ces blocs sont de plusieurs couleurs, chacune correspondant \xE0 un type d'instruction que l'on retrouve dans les menus de \SCRATCH.
+Comme le savent ceux qui enseignent l'algorithmique et la programmation avec le tr\xE8s-\xE0-la-mode\footnote{Je ne d\xE9teste rien de plus comme langage de programmation que ce \emph{truc} vaguement graphique, ultra limit\xE9 et contre-productif dans l'apprentissage du codage qu'est \SCRATCH et que l'\xE9ducation nationale veut \xE0 tout prix imposer. Je ne compte bien \xE9videmment pas me plier \xE0 ce nouveau dogme ridicule et ne l'utiliserai ni ne l'enseignerai; je consid\xE8re que les \xE9l\xE8ves m\xE9ritent mieux que \SCRATCH --~ADA par exemple~-- comme entr\xE9e dans le monde de la programmation. Ceci dit, coder cette extension a \xE9t\xE9 un petit amusement.} logiciel \xAB \SCRATCH \xBB, les programmes sont construits avec des briques, appel\xE9s \xABblocs\xBB, qui peuvent s'emboiter les uns sur les autres. Ces blocs sont de plusieurs couleurs, chacune correspondant \xE0 un type d'instruction que l'on retrouve dans les menus de \SCRATCH.
 
 J'ai pris le parti d'\xE9crire des macros ayant comme argument le texte qui figure dans le bloc. Ce faisant, on a plus de libert\xE9 que dans \SCRATCH o\xF9 les blocs ont des textes pr\xE9d\xE9finis, mais cette libert\xE9 permet d'utiliser cette extension quelle que soit la langue dans laquelle on \xE9crit.
 
@@ -216,7 +217,8 @@
 	           y: \ovaloperator{\ovalnum{4} * \ovalsensing{souris y}}}
 \end{scratch}
 
-Toutes les macros ayant pour pr\xE9fixe \verb|\oval| sont utilisables \emph{en dehors} de l'environnement \texttt{scratch}, la preuve : voici \ovalvariable{une variable} et \ovaloperator{un op\xE9rateur}./
+Toutes les macros ayant pour pr\xE9fixe \verb|\oval| sont utilisables \emph{en dehors} de l'environnement
+scratch, la preuve : voici \ovalvariable{une variable} et \ovaloperator{un op\xE9rateur}./
 
 \section{Les blocs de d\xE9but}
 Ces blocs sont de la couleur \suffixe{event} pour la plupart (macro \verb|\blockinit|), mais il existe aussi un bloc de d\xE9but de couleur \suffixe{control} (macro \verb|\blockinitclone|). Le drapeau vert est dessin\xE9 avec la macro \verb|\greenflag|.
@@ -381,40 +383,43 @@
 Repr\xE9sente est le mot qui est ins\xE9r\xE9 dans la branche \xAB else \xBB d'un bloc de test.
 
 \cleval{x sep}{dimension}
-Repr\xE9sente l'espace horizontale ins\xE9r\xE9e entre les bords droit et gauche du texte du bloc et les bords droits et gauche du bloc.
+Repr\xE9sente l'espace horizontale ins\xE9r\xE9e entre les bords droit et gauche du texte du bloc et les bords droits et gauche du bloc. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [3pt ; 1em].
 
 \cleval{y sepsup}{dimension}
-Repr\xE9sente l'espace verticale ins\xE9r\xE9e entre le bas de l'encoche femelle et le bord sup\xE9rieur du texte du bloc.
+Repr\xE9sente l'espace verticale ins\xE9r\xE9e entre le bas de l'encoche femelle et le bord sup\xE9rieur du texte du bloc. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [3pt ; 3ex].
 
 \cleval{y sepinf}{dimension}
-Repr\xE9sente l'espace verticale ins\xE9r\xE9e entre le bas du bloc et le bord inf\xE9rieur du texte du bloc.
+Repr\xE9sente l'espace verticale ins\xE9r\xE9e entre le bas du bloc et le bord inf\xE9rieur du texte du bloc. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [3pt ; 3ex].
 
 \cleval{line width}{dimension}
-Repr\xE9sente l'\xE9paisseur des lignes de relief des blocs et le double des lignes de relief des losanges bool\xE9ens.
+Repr\xE9sente l'\xE9paisseur des lignes de relief des blocs et le double des lignes de relief des losanges bool\xE9ens. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0pt ; 5pt].
 
 \cleval{loop width}{dimension}
-Repr\xE9sente est la largeur de la barre verticale des blocs de r\xE9p\xE9tition ou de test.
+Repr\xE9sente est la largeur de la barre verticale des blocs de r\xE9p\xE9tition ou de test. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [3pt ; 3em].
 
 \cleval{loop height}{dimension}
-Repr\xE9sente est l'\xE9paisseur des barres horizontales \xAB else \xBB et inf\xE9rieure des blocs de r\xE9p\xE9tition ou de test.
+Repr\xE9sente est l'\xE9paisseur des barres horizontales \xAB else \xBB et inf\xE9rieure des blocs de r\xE9p\xE9tition ou de test. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [3pt ; 3ex].
 
 \cleval{corner}{dimension}
-Repr\xE9sente la dimension des chanfreins des blocs. Cette dimension est utilis\xE9e proportionnellement pour le placement horizontal, l'\xE9paisseur et la largeur des encoches des blocs.
+Repr\xE9sente la dimension des chanfreins des blocs. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0.33333ex ; 1ex].
 
+\cleval{notch}{dimension}
+Repr\xE9sente la largeur des encoches. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0.33333em ; 3em].
+
 \cleval{scale}{coefficient}\label{cle-scale}
-Repr\xE9sente l'\xE9chelle \xE0 laquelle est repr\xE9sent\xE9 le dessin.
+Repr\xE9sente l'\xE9chelle \xE0 laquelle est repr\xE9sent\xE9 le dessin. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0.2 ; 5].
 
 \cleval{init arcangle}{angle}
-Repr\xE9sente l'angle avec l'horizontale de l'arc de cercle trac\xE9 dans la partie haute des blocs de d\xE9part.
+Repr\xE9sente l'angle avec l'horizontale de l'arc de cercle trac\xE9 dans la partie haute des blocs de d\xE9part. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [20 ; 40].
 
 \cleval{init arclength}{dimension}
-Repr\xE9sente la longueur horizontale de l'arc de cercle trac\xE9 dans la partie haute des blocs de d\xE9part.
+Repr\xE9sente la longueur horizontale de l'arc de cercle trac\xE9 dans la partie haute des blocs de d\xE9part. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [3em ; 8em].
 
 \cleval{moreblock arcangle}{angle}
-Repr\xE9sente l'angle avec l'horizontale de l'arc de cercle trac\xE9 dans la partie haute des blocs de de type \xAB moreblock\xBB.
+Repr\xE9sente l'angle avec l'horizontale de l'arc de cercle trac\xE9 dans la partie haute des blocs de de type \xAB moreblock\xBB. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [10 ; 20].
 
 \cleval{contrast}{entier}
-Cet entier, compris entre 0 et 100 inclus, qualifie la diff\xE9rence de teintes entre les lignes de relief trac\xE9es autour des blocs. L'entier 0 signifie \xABaucun contraste\xBB (teintes identiques) tandis que que 100 signifie \xABcontraste maximal\xBB auquel cas les lignes claires, qui se situent sur la partie haute des blocs, sont blanches et les lignes fonc\xE9es sont noires.
+Cet entier, compris entre 0 et 100 inclus, qualifie la diff\xE9rence de teintes entre les lignes de relief trac\xE9es autour des blocs. L'entier 0 signifie \xABaucun contraste\xBB (teintes identiques) tandis que que 100 signifie \xABcontraste maximal\xBB auquel cas les lignes claires, qui se situent sur la partie haute des blocs, sont blanches et les lignes fonc\xE9es sont noires. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0 ; 100].
 
 \cleval{print}{bool\xE9en}
 Lorsque ce bool\xE9en est vrai, les dessins se font en noir et blanc de fa\xE7on \xE0 pouvoir \xEAtre dirig\xE9s vers une impression en noir et blanc.
@@ -436,7 +441,7 @@
 Ce bool\xE9en n'est pris en compte que lorsque le bool\xE9en \verb|print| est vrai. Si \verb|fill blocks| est vrai, tous les dessins (sauf les ovales contenant des nombres) seront remplis avec un gris choisi avec la cl\xE9 suivante.
 
 \cleval{fill gray}{taux de gris}
-Lorsque \verb|fill blocks| est vrai, ce taux de blanc dans le gris (nombre compris entre 0 pour noir et 1 pour blanc) est utilis\xE9 pour d\xE9finir une couleur de remplissage des dessins.
+Lorsque \verb|fill blocks| est vrai, ce taux de blanc dans le gris (nombre compris entre 0 pour noir et 1 pour blanc) est utilis\xE9 pour d\xE9finir une couleur de remplissage des dessins. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0 ; 1].
 
 \exemple/\begin{scratch}
 	\blockinit{Quand \greenflag est cliqu\xE9}
@@ -461,7 +466,7 @@
 Lorsque \verb|fill blocks| est vrai, cette couleur sera utilis\xE9e pour le texte des blocs.
 
 \cleval{flag gray}{taux de gris}
-Lorsque \verb|print| est vrai, ce taux de gris est utilis\xE9 pour la couleur du drapeau trac\xE9 avec \verb|\greenflag| ainsi que pour la fl\xE8che se trouvant au bas des blocs de r\xE9p\xE9tition.
+Lorsque \verb|print| est vrai, ce taux de gris est utilis\xE9 pour la couleur du drapeau trac\xE9 avec \verb|\greenflag| ainsi que pour la fl\xE8che se trouvant au bas des blocs de r\xE9p\xE9tition. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0 ; 1].
 
 \exemple/\begin{scratch}[print,fill blocks,fill gray=0.66]
 	\blockinit{Quand \greenflag est cliqu\xE9}
@@ -477,8 +482,77 @@
 \end{scratch}/
 
 \cleval{line gray}{taux de gris}
-Lorsque \verb|print| est vrai, ce taux de gris est utilis\xE9 pour la couleur des lignes de relief.
+Lorsque \verb|print| est vrai, ce taux de gris est utilis\xE9 pour la couleur des lignes de relief. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0 ; 1].
 
+\cleval{num blocks}{bool\xE9en}
+Lorsque ce bool\xE9en est vrai, les blocs sont num\xE9rot\xE9s.
+
+\cleval{num sep}{dimension}
+Cette cl\xE9 contient l'espacement entre les num\xE9ros de blocs et leur fronti\xE8re gauche. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [0pt ; 1.5em].
+
+\cleval{num start}{entier}
+Cette cl\xE9 contient le premier num\xE9ro du bloc.
+
+La macro \verb|\numblock| est charg\xE9e d'imprimer les num\xE9ros de ligne. Elle admet un argument (le num\xE9ro de ligne) et permet, lorsqu'elle est red\xE9finie, de personnaliser la num\xE9rotation : choix de la couleur, de la police, de sa taille et des effets applicables \xE0 son argument. Par d\xE9faut, cette macro est d\xE9finie par
+\begin{center}
+	\verb|\newcommand*\numblock[1]{\color{black}\footnotesize\bfseries#1}|
+\end{center}
+
+Dans l'environnement \SCRATCH, entre des instructions \SCRATCH, on peut activer ou d\xE9sactiver la num\xE9rotation \emph{pour le dessin en cours} \xE0 l'aide de
+\begin{center}
+	\verb|\setscratch{num blocks=<bool\xE9en>}|
+\end{center}
+
+\exemple/\begin{scratch}[num blocks]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch} puis
+\renewcommand*\numblock[1]{\color{blue!80}\itshape#1}
+\begin{scratch}[num blocks,num start=3]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch}
+puis
+\renewcommand*\numblock[1]{\fboxsep=0.5pt\fbox{\bfseries#1}}
+\begin{scratch}[num blocks=false]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\setscratch{num blocks=true}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch}/
+
+\cleval{baseline}{alignement}
+Cette cl\xE9 contient la consigne d'alignement du dessin tout entier, c'est-\xE0-dire :
+\begin{itemize}
+	\item la lettre \xAB\verb|c|\xBB auquel cas, le dessin est centr\xE9 sur la ligne de base
+	\item un entier qui sp\xE9cifie un num\xE9ro de bloc existant : la num\xE9rotation est coh\xE9rente avec l'entier initial contenu dans la cl\xE9 \verb|num start|. Dans ce cas, la ligne de base choisie est celle du texte contenu dans le bloc portant le num\xE9ro choisi.
+\end{itemize}
+
+\exemple/D\xE9faut : \begin{scratch}
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch}
+bloc 3 : \begin{scratch}[baseline=3]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch}
+centr\xE9
+\begin{scratch}[baseline=c]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch}/
+
 \section{Mot de la fin}
 Le code de cette extension d\xE9montre mon immense ignorance de ti\textit kz/pgf et les m\xE9thodes de programmation qui lui sont propres que, d\xE9cid\xE9ment, je ne comprendrai jamais! C'est sans doute le trop grand \xE9loignement avec la logique de \TeX{} et la documentation de ti\textit kz/pgf, aussi indigeste qu'illisible, qui explique cette incompatibilit\xE9 d'humeur et mon d\xE9sint\xE9r\xEAt \xE0 l'\xE9gard de ti\textit kz. Toujours est-il que cette extension fonctionne, avec une lenteur certaine que j'attribue \xE0 ma programmation hasardeuse ainsi qu'\xE0 la lenteur intrins\xE8que de ti\textit kz.
 
@@ -514,4 +588,15 @@
 \begin{version}{0.33}{30/12/2017}
 	>Correction d'un bug signal\xE9 par I. \textsc{Eble} : l'affichage des losanges, boites de texte, ovales n'est pas correct dans les blocs lorsque \verb|scale| est diff\xE9rente de 1.
 \end{version}
+
+\begin{version}{0.4}{08/04/2018}
+	>Possibilit\xE9 de num\xE9roter les blocs, requ\xEAte de Fabrice \textsc{Bavoil}.
+	>Augmentation automatique de la taille horizontale d'un bloc si le texte qu'il contient est trop court, bug signal\xE9 par Fabrice \textsc{Bavoil}.
+	>Possibilit\xE9 de choisir la ligne de base du dessin \SCRATCH, requ\xEAte de Fabrice \textsc{Bavoil}.
+	>Gr\xE2ce \xE0 une cl\xE9 secr\xE8te, les \xAB losanges \xBB n'ont plus une infime fraction de trait qui se chevauche avec les \verb|\txtbox| ou \verb|\selectmenu| int\xE9rieurs qui se trouvent en d\xE9but ou fin de texte. Les ultra-perfectionnistes sont enfin combl\xE9s !
+	>Param\xE8tres born\xE9s (pour la plupart) et ramen\xE9s dans le domaine de fonctionnement --~ou du raisonnable~-- si n\xE9cessaire.
+	>Suppression du \verb|\normalsize| qui emp\xEAchait la prise en compte de la taille de la police en cours.
+	>Nouvelle cl\xE9 \xABnotch\xBB pour sp\xE9cifier la longueur du trait horizontal des encoches.
+	>Nettoyage du code.
+\end{version}
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/scratch/scratch.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/scratch/scratch.sty	2018-04-07 20:58:43 UTC (rev 47359)
+++ trunk/Master/texmf-dist/tex/latex/scratch/scratch.sty	2018-04-07 20:58:58 UTC (rev 47360)
@@ -4,9 +4,9 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                    %
 \def\scrname                   {scratch}                             %
-\def\scrver                      {0.33}                              %
+\def\scrver                      {0.4}                               %
 %                                                                    %
-\def\scrdate                  {2017/12/30}                           %
+\def\scrdate                  {2018/04/08}                           %
 %                                                                    %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
@@ -13,12 +13,11 @@
 % --------------------------------------------------------------------
 % Author     : Christian Tellechea
 % Status     : Maintained
-% Maintainer : Christian Tellechea
 % Email      : unbonpetit at netc.fr
 % Package URL: https://www.ctan.org/pkg/scratch
 % Bug tracker: https://framagit.org/unbonpetit/scratch/issues
 % Repository : https://framagit.org/unbonpetit/scratch/tree/master
-% Copyright  : Christian Tellechea 2017
+% Copyright  : Christian Tellechea 2017-2018
 % Licence    : Released under the LaTeX Project Public License v1.3c
 %              or later, see http://www.latex-project.org/lppl.txt
 % Files      : 1) scratch.sty
@@ -32,8 +31,8 @@
 \usepgflibrary{shapes.misc,arrows.meta}
 \usetikzlibrary{bending}
 
-\expandafter\edef\csname scr\string_restorecatcode\endcsname{\catcode`\noexpand\_=\the\catcode`\_\relax}
-\catcode`\_11
+\expandafter\edef\csname scr\string_restorecatcode\endcsname{\catcode`\noexpand\_=\the\catcode`\_\relax\catcode`^^*=\the\catcode`^^*\relax}
+\catcode`\_11 \catcode`^^*=^^w
 % Les r\xE9glages par d\xE9faut (modifiables avec \setdefaultscratch)
 \setKVdefault[\scrname]{
 	else word          = sinon,% mot dans branche "else"
@@ -44,6 +43,7 @@
 	loop width         = 3ex,% \xE9paisseur de la barre verticale \xE0 gauche d'un bloc de boucle
 	loop height        = 1.75ex,% hauteur de la barre du else et la barre finale
 	corner             = 0.66667ex,% valeur du chanfrein
+	notch              = 1em,% longueur des encoches
 	scale              = 1,% \xE9chelle du dessin
 	init arcangle      = 30,% angle d\xE9but et fin de l'arc
 	init arclength     = 5em,% longueur de l'arc
@@ -56,22 +56,34 @@
 	flag gray          = 0.33,% taux de gris pour le drapeau lorsque l'option "print" est vraie
 	line gray          = 0.4,% taux de gris pour les lignes lorsque l'option "print" est vraie
 	bool sep           = 1.25pt,% s\xE9paration entre les blocs bool\xE9ens imbriqu\xE9s
+	num blocks         = false,% num\xE9rotation des blocs
+	num sep            = 3pt,% s\xE9paration entre bord gauche et num\xE9rotation
+	num start          = 1,% num\xE9ro de d\xE9part
+	baseline           = 1,% alignement sur le 1er bloc (en partant du haut)
+	jj"jj61jj6ojj)jj,jj`jj-odjj65jj3dfjj!jj,jj73jj%
 }
-\def\resetscratch{\csname skv_[\scrname]\endcsname\scr_setcolors}
-\def\setscratch#1{\setKV[\scrname]{#1}\scr_setcolors}
-\def\setdefaultscratch#1{\setKVdefault[\scrname]{#1}\scr_setcolors}
+\newcommand*\numblock[1]{\color{black}\footnotesize\bfseries#1}
+\newcommand*\resetscratch{\csname skv_[\scrname]\endcsname\scr_setcolors}
+\newcommand*\setscratch[1]{\setKV[\scrname]{#1}\scr_setcolors}
+\newcommand*\setdefaultscratch[1]{\setKVdefault[\scrname]{#1}\scr_setcolors}
 \def\scr_setcolors{%
-	\skv_eearg{\definecolor{scr_fillgray}{gray}}{\useKV[\scrname]{fill gray}}%
-	\skv_eearg{\definecolor{scr_linegray}{gray}}{\useKV[\scrname]{line gray}}%
-	\skv_eearg{\definecolor{scr_flaggray}{gray}}{\useKV[\scrname]{flag gray}}%
+	\scr_normalizedec\scr_fillgray fill gray[0,1]\skv_exparg{\definecolor{scr_fillgray}{gray}}\scr_fillgray
+	\scr_normalizedec\scr_linegray line gray[0,1]\skv_exparg{\definecolor{scr_linegray}{gray}}\scr_linegray
+	\scr_normalizedec\scr_flaggray flag gray[0,1]\skv_exparg{\definecolor{scr_flaggray}{gray}}\scr_flaggray
 }
 
 \def\scr_thesentinelkern{17}% nombre de "sp" sentinelle pour les booleanbox. Personne n'utilise 17sp j'esp\xE8re ?
 \def\scr_blockstrut{\vrule height2.1ex depth.9ex width0pt\relax}
-\def\scr_ovalstrut{\vphantom{\`Alpgqyj}}
+\def\scr_ovalstrut{\vphantom{\`Ag}}
 \def\scr_cslet#1{\expandafter\let\csname#1\endcsname}
+\def\scr_csdef#1{\expandafter\def\csname#1\endcsname}
 \def\scr_csedef#1{\expandafter\edef\csname#1\endcsname}
+\def\scr_maxdim(#1,#2){\the\dimexpr\ifdim\dimexpr#1-(#2)\relax<0pt #2\else#1\fi\relax}
+\def\scr_normalizedec#1#2[#3,#4]{\edef#1{\useKV[\scrname]{#2}}\ifdim#1pt<#3pt \def#1{#3}\else\ifdim#1pt>#4pt \def#1{#4}\fi\fi}
+\def\scr_normalizedim#1#2[#3,#4]{\edef#1{\the\dimexpr\useKV[\scrname]{#2}}\ifdim\dimexpr#1-(#3)\relax<0pt \edef#1{\the\dimexpr#3}\else\ifdim\dimexpr#1-(#4)\relax>0pt \edef#1{\the\dimexpr#4}\fi\fi}
+\def\scr_firsttonil#1#2\_nil{#1}
 \newcount\scr_loopnest
+\newcount\scr_blocknum
 \newbox\scr_box
 \newdimen\scr_yoffset
 \newdimen\scr_xoffset
@@ -85,19 +97,20 @@
 	\edef\scr_current_linelight{\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!white}%
 	\edef\scr_current_linedark {\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!black}%
 	\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
-	\node[at=(origin)](x){%
-		\setbox\scr_box\hbox{\begingroup\color{white}\sffamily\bfseries#2\scr_blockstrut\endgroup}%
-		\xdef\__boxht{\the\ht\scr_box}%
-		\xdef\__totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-		\xdef\__boxwd{\the\wd\scr_box}%
-	};%
-	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
+	\setbox\scr_box\hbox{\pgfinterruptpicture\color{white}\sffamily\bfseries#2\scr_blockstrut\endpgfinterruptpicture}%
+	\edef\scr_boxwd{\scr_maxdim(\wd\scr_box,\scr_minwd)}%
+	\edef\scr_boxht{\the\ht\scr_box}%
+	\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
 	\draw[draw=none,fill=\scr_current_fillcolor,yshift=\scr_yoffset,xshift=\scr_xoffset]
-		(\scr_corner,0)--++(\scr_corner*3,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*10,0)--++(\scr_corner,-\scr_corner)% ligne sup
-		--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--cycle
-		node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](texte){\sffamily\bfseries#2\scr_blockstrut};
-	\draw[draw=\scr_current_linedark,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_boxwd+\scr_xsep*2,-\scr_corner)--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0);
-	\draw[draw=\scr_current_linelight,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_corner,-\scr_corner-\scr_ysepsup-\scr_totht-\scr_ysepinf)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--++(\scr_corner,\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*10,0)--++(\scr_corner,-\scr_corner);
+		(\scr_corner,0)--++(\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*4-\scr_notch*2,0)--++(\scr_corner,-\scr_corner)% ligne sup
+		--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--cycle;
+	\node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](txt\number\scr_blocknum){\sffamily\bfseries#2\scr_blockstrut};
+	\ifboolKV[\scrname]{num blocks}
+		{\node[at=(origin),draw=none,anchor=base east,xshift=-\scr_numsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup](num){\skv_exparg\numblock{\number\scr_blocknum}};}
+		{}%
+	\advance\scr_blocknum1
+	\draw[draw=\scr_current_linedark,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_boxwd+\scr_xsep*2,-\scr_corner)--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0);
+	\draw[draw=\scr_current_linelight,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_corner,-\scr_corner-\scr_ysepsup-\scr_totht-\scr_ysepinf)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--++(\scr_corner,\scr_corner)--++(\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*4-\scr_notch*2,0)--++(\scr_corner,-\scr_corner);
 	\advance\scr_yoffset\dimexpr-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth+\scr_extraoffset\relax
 	\gdef\scr_blockstop{0}%
 }
@@ -105,25 +118,27 @@
 	\advance\scr_yoffset#1\dimexpr-\scr_blockstruttotht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth+\scr_extraoffset\relax
 	\gdef\scr_blockstop{1}%
 }
-\def\blockstop#1{% #1=texte
+\newcommand*\blockstop[1]{% #1=texte
 	\def\scr_current_blockcolor{scrcontrol}%
 	\edef\scr_current_fillcolor{\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}}%
 	\edef\scr_current_linelight{\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!white}%
 	\edef\scr_current_linedark {\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!black}%
 	\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
-	\node[at=(origin)](x){%
-		\setbox\scr_box\hbox{\begingroup\color{white}\sffamily\bfseries#1\scr_blockstrut\endgroup}%
-		\xdef\__boxht{\the\ht\scr_box}%
-		\xdef\__totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-		\xdef\__boxwd{\the\wd\scr_box}%
-	};%
-	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
+	\setbox\scr_box\hbox{\pgfinterruptpicture\color{white}\sffamily\bfseries#1\scr_blockstrut\endpgfinterruptpicture}%
+	\edef\scr_boxwd{\scr_maxdim(\wd\scr_box,\scr_minwd)}%
+	\edef\scr_boxht{\the\ht\scr_box}%
+	\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
 	\draw[draw=none,fill=\scr_current_fillcolor,yshift=\scr_yoffset,xshift=\scr_xoffset]
-		(\scr_corner,0)--++(\scr_corner*3,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*10,0)--++(\scr_corner,-\scr_corner)% ligne sup
+		(\scr_corner,0)--++(\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*4-\scr_notch*2,0)--++(\scr_corner,-\scr_corner)% ligne sup
 		--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*2,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--cycle
-		node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](texte){\sffamily\bfseries#1\scr_blockstrut};
+		node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](txt\number\scr_blocknum){\sffamily\bfseries#1\scr_blockstrut};
+	\ifboolKV[\scrname]{num blocks}
+		{\node[at=(origin),draw=none,anchor=base east,xshift=-\scr_numsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup](num){\skv_exparg\numblock{\number\scr_blocknum}};
+		}
+		{}%
+	\advance\scr_blocknum1
 	\draw[draw=\scr_current_linedark,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_boxwd+\scr_xsep*2,-\scr_corner)--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*2,0);
-	\draw[draw=\scr_current_linelight,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_corner,-\scr_corner*2-\scr_ysepsup-\scr_totht-\scr_ysepinf+\scr_corner)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--++(\scr_corner,\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*10,0)--++(\scr_corner,-\scr_corner);
+	\draw[draw=\scr_current_linelight,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_corner,-\scr_corner*2-\scr_ysepsup-\scr_totht-\scr_ysepinf+\scr_corner)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--++(\scr_corner,\scr_corner)--++(\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*4-\scr_notch*2,0)--++(\scr_corner,-\scr_corner);
 	\advance\scr_yoffset\dimexpr-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth+\scr_extraoffset\relax
 	\gdef\scr_blockstop{1}%
 }
@@ -136,18 +151,19 @@
 	\edef\scr_current_linelight{\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!white}%
 	\edef\scr_current_linedark {\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!black}%
 	\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
-	\node[at=(origin)](x){%
-		\setbox\scr_box\hbox{\begingroup\color{white}\sffamily\bfseries#2\scr_blockstrut\endgroup}%
-		\xdef\__boxht{\the\ht\scr_box}%
-		\xdef\__totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-		\xdef\__boxwd{\the\wd\scr_box}%
-	};%
-	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
+	\setbox\scr_box\hbox{\pgfinterruptpicture\color{white}\sffamily\bfseries#2\scr_blockstrut\endpgfinterruptpicture}%
+	\edef\scr_boxwd{\scr_maxdim(\wd\scr_box,\scr_xsep+\scr_initarclength+\scr_em)}%
+	\edef\scr_boxht{\the\ht\scr_box}%
+	\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
 	\draw[draw=\scr_current_fillcolor,fill=\scr_current_fillcolor,yshift=\scr_yoffset,xshift=\scr_xoffset]
 		(0,0)to[out=\scr_initarcangle,in=180-\scr_initarcangle](\scr_xsep+\scr_initarclength,0)--(\scr_boxwd+2*\scr_xsep-\scr_corner,0)--++(\scr_corner,-\scr_corner)% ligne sup
-		--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf)--cycle
-		node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](texte){\sffamily\bfseries#2\scr_blockstrut};
-	\draw[draw=\scr_current_linedark,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_boxwd+\scr_xsep*2,-\scr_corner)--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0);
+		--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf)--cycle
+		node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](txt\number\scr_blocknum){\sffamily\bfseries#2\scr_blockstrut};
+	\ifboolKV[\scrname]{num blocks}
+		{\node[at=(origin),draw=none,anchor=base east,xshift=-\scr_numsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup](num){\skv_exparg\numblock{\number\scr_blocknum}};}
+		{}%
+	\advance\scr_blocknum1
+	\draw[draw=\scr_current_linedark,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_boxwd+\scr_xsep*2,-\scr_corner)--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0);
 	\draw[draw=\scr_current_linelight,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_corner,-\scr_corner-\scr_ysepsup-\scr_totht-\scr_ysepinf)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf)--(0,0)to[out=\scr_initarcangle,in=180-\scr_initarcangle](\scr_xsep+\scr_initarclength,0)--(\scr_boxwd+2*\scr_xsep-\scr_corner,0)--++(\scr_corner,-\scr_corner);
 	\advance\scr_yoffset\dimexpr-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth+\scr_extraoffset\relax
 	\gdef\scr_blockstop{0}%
@@ -156,14 +172,11 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                    dessine un bloc de d\xE9finition                     %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\initmoreblocks#1{%
-	\node[at=(origin)](x){%
-		\setbox\scr_box\hbox{\begingroup\color{white}\sffamily\bfseries#1\scr_blockstrut\endgroup}%
-		\xdef\__boxht{\the\ht\scr_box}%
-		\xdef\__totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-		\xdef\__boxwd{\the\wd\scr_box}%
-	};%
-	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
+\newcommand*\initmoreblocks[1]{%
+	\setbox\scr_box\hbox{\pgfinterruptpicture\color{white}\sffamily\bfseries#1\scr_blockstrut\endpgfinterruptpicture}%
+	\edef\scr_boxwd{\scr_maxdim(\wd\scr_box,\scr_minwd+\scr_em*2)}%
+	\edef\scr_boxht{\the\ht\scr_box}%
+	\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
 	\def\scr_current_blockcolor{scrmoreblocks}%
 	\edef\scr_current_fillcolor{\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}}%
 	\edef\scr_current_linelight{\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!white}%
@@ -172,71 +185,80 @@
 	\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
 	\draw[draw=\scr_current_fillcolor,fill=\scr_current_fillcolor,yshift=\scr_yoffset,xshift=\scr_xoffset]
 		(0,0)to[out=\scr_moreblockarcangle,in=180-\scr_moreblockarcangle](\scr_boxwd+2*\scr_xsep,0)% ligne sup
-		--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf)--cycle
-		node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](texte){\sffamily\bfseries#1\scr_blockstrut};
-	\draw[draw=\scr_current_linedark,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_boxwd+\scr_xsep*2,0)--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0);
+		--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf)--cycle
+		node[at=(origin),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](txt\number\scr_blocknum){\sffamily\bfseries#1\scr_blockstrut};
+	\ifboolKV[\scrname]{num blocks}
+		{\node[at=(origin),draw=none,anchor=base east,xshift=-\scr_numsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup](num){\skv_exparg\numblock{\number\scr_blocknum}};}
+		{}%
+	\advance\scr_blocknum1
+	\draw[draw=\scr_current_linedark,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_boxwd+\scr_xsep*2,0)--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0);
 	\draw[draw=\scr_current_linelight,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_corner,-\scr_corner-\scr_ysepsup-\scr_totht-\scr_ysepinf)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf)--(0,0);
 	\draw[line width=1.5pt,draw=\current_linesurround,shorten <=-\scr_linewidth,shorten >=-\scr_linewidth](0,0)to[out=15,in=165](\scr_boxwd+2*\scr_xsep,0);
 	\advance\scr_yoffset\dimexpr-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth+\scr_extraoffset\relax
 	\gdef\scr_blockstop{0}%
 }
-\def\namemoreblocks#1{%
+\newcommand*\namemoreblocks[1]{%
 	\begin{tikzpicture}[baseline=(moreblocksdef.base)]
 		\def\scr_ysepinf{2pt}\def\scr_ysepsup{2pt}%
-		\edef\scr_xsep{\the\dimexpr\scr_xsep*3/2\relax}%
-		\node(moreblocksdefaux){%
-			\setbox\scr_box\hbox{\begingroup\color{white}\sffamily\bfseries#1\strut\endgroup}%
-			\xdef\__boxht{\the\ht\scr_box}%
-			\xdef\__totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-			\xdef\__boxwd{\the\wd\scr_box}%
-		};%
-		\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
+		\edef\scr_xsep{\the\dimexpr\scr_em/2\relax}\edef\scr_minwd{\the\dimexpr\scr_corner*4+\scr_notch*3-\scr_xsep*2}%
+		\setbox\scr_box\hbox{\pgfinterruptpicture\color{white}\sffamily\bfseries\scr_blockstrut#1\endpgfinterruptpicture}%
+		\edef\scr_boxwd{\scr_maxdim(\wd\scr_box,\scr_minwd)}%
+		\edef\scr_boxht{\the\ht\scr_box}%
+		\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}
 		\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
 		\edef\current_contourcolor{\ifboolKV[\scrname]{print}{scr_linegray!\scr_contrast!white}{scrmoreblockcontour}}%
 		\draw[draw=\current_contourcolor,line width=\scr_linewidth*2]
-			(\scr_corner,0)--++(\scr_corner*3,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*10,0)--++(\scr_corner,-\scr_corner)% ligne sup
-			--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(0,\scr_totht+\scr_ysepsup+\scr_ysepinf-\scr_corner)--cycle
-			node[at=(moreblocksdefaux),draw=none,anchor=base west,xshift=\scr_xoffset+\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](moreblocksdef){\sffamily\bfseries#1\strut};
+			(0,-\scr_corner)--(\scr_corner,0)--++(\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*4-\scr_notch*2,0)--++(\scr_corner,-\scr_corner)% ligne sup
+			--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--cycle
+			node[draw=none,anchor=base west,xshift=\scr_xsep,yshift=\scr_yoffset-\scr_boxht-\scr_ysepsup,text=\scr_current_textcolor](moreblocksdef){\sffamily\bfseries\scr_blockstrut#1};
 	\end{tikzpicture}%
 }
 
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                dessine un bloc de r\xE9p\xE9tition ou test                 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\scr_blockloop#1#2#3#4#5{% #1=texte  #2=instructions sup  #3=instructions inf #4=boucle infinie (1 ou 0)  #5=fleche de r\xE9p\xE9tition (1 ou 0)
 	\edef\scr_blocminheight{\dimexpr\scr_loopblockheight+\scr_ysepinf+\scr_ysepsup+\scr_corner\relax}% hauteur minimale d'un bloc normal
-	\node[at=(origin)](x){%
-		\setbox\scr_box\hbox{\begingroup\color{white}\sffamily\bfseries#1\scr_blockstrut\endgroup}%
-		\xdef\__boxht{\the\ht\scr_box}%
-		\xdef\__totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-		\xdef\__boxwd{\the\wd\scr_box}%
-	};%
-	\scr_cslet{scr_txtloopht\number\scr_loopnest}\__boxht
-	\scr_cslet{scr_txtlooptotht\number\scr_loopnest}\__totht
-	\scr_cslet{scr_txtloopwd\number\scr_loopnest}\__boxwd
+	\setbox\scr_box\hbox{\pgfinterruptpicture\color{white}\sffamily\bfseries#1\scr_blockstrut\endpgfinterruptpicture}%
+	\scr_csedef{scr_txtloopwd\number\scr_loopnest}{\scr_maxdim(\wd\scr_box,\scr_minwd+\scr_corner*4+\scr_notch*2)}%
+	\scr_csedef{scr_txtloopht\number\scr_loopnest}{\the\ht\scr_box}%
+	\scr_csedef{scr_txtlooptotht\number\scr_loopnest}{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
 	\scr_csedef{toploopx\number\scr_loopnest}{\the\scr_xoffset}% coordonn\xE9es du point nord-west
 	\scr_csedef{toploopy\number\scr_loopnest}{\the\scr_yoffset}%
-		\advance\scr_xoffset\scr_loopblockwidth
-		\advance\scr_yoffset\dimexpr-\scr_corner-\scr_ysepsup-\csname scr_txtlooptotht\number\scr_loopnest\endcsname-\scr_ysepinf-\scr_linewidth+\scr_extraoffset\relax
+	\scr_csedef{blocnum\number\scr_loopnest}{\number\scr_blocknum}%
+	\advance\scr_xoffset\scr_loopblockwidth
+	\advance\scr_yoffset\dimexpr-\scr_corner-\scr_ysepsup-\csname scr_txtlooptotht\number\scr_loopnest\endcsname-\scr_ysepinf-\scr_linewidth+\scr_extraoffset\relax
+	\ifboolKV[\scrname]{num blocks}
+		{\scr_csdef{scr_numblockif\number\scr_loopnest}{\node[at=(origin),draw=none,anchor=base east,xshift=-\scr_numsep,yshift=\csname toploopy\number\scr_loopnest\endcsname-\csname scr_txtloopht\number\scr_loopnest\endcsname-\scr_corner-\scr_ysepsup](num){\skv_eearg\numblock{\csname blocnum\number\scr_loopnest\endcsname}};}%
+		}
+		{\scr_cslet{scr_numblockif\number\scr_loopnest}\empty}%
+	\advance\scr_loopnest1
+	\advance\scr_blocknum1
+	\advance\scr_xoffset-\scr_extraoffset
+	#2%
+	\advance\scr_xoffset\scr_extraoffset
+	\advance\scr_loopnest-1
+	\expandafter\let\csname scr_blockstopif_\number\scr_loopnest\endcsname\scr_blockstop
+	\scr_csedef{bottomifx\number\scr_loopnest}{\the\scr_xoffset}%
+	\scr_csedef{bottomify\number\scr_loopnest}{\the\scr_yoffset}%
+	\ifcat\relax\detokenize{#3}\relax\else% si instruction #3
+		\advance\scr_yoffset\dimexpr-\scr_blocminheight-\scr_linewidth+\scr_extraoffset\relax% \xE9paisseur th\xE9orique de la branche "sinon"
+		\scr_csedef{blocelsenum\number\scr_loopnest}{\number\scr_blocknum}%
+		\ifboolKV[\scrname]{num blocks}
+			{\scr_csdef{scr_numblockelse\number\scr_loopnest}{\node[at=(origin),draw=none,anchor=base east,xshift=-\scr_numsep,yshift=\csname bottomify\number\scr_loopnest\endcsname-\scr_loopblockheight-\scr_corner](num){\skv_eearg\numblock{\csname blocelsenum\number\scr_loopnest\endcsname}};}
+			}
+			{\scr_cslet{scr_numblockelse\number\scr_loopnest}\empty}%
 		\advance\scr_loopnest1
+		\advance\scr_blocknum1
 		\advance\scr_xoffset-\scr_extraoffset
-		#2%
+		#3%
 		\advance\scr_xoffset\scr_extraoffset
 		\advance\scr_loopnest-1
-		\expandafter\let\csname scr_blockstopif_\number\scr_loopnest\endcsname\scr_blockstop
-		\scr_csedef{bottomifx\number\scr_loopnest}{\the\scr_xoffset}%
-		\scr_csedef{bottomify\number\scr_loopnest}{\the\scr_yoffset}%
-		\ifcat\relax\detokenize{#3}\relax\else% si instruction #3
-			\advance\scr_yoffset\dimexpr-\scr_blocminheight-\scr_linewidth+\scr_extraoffset\relax% \xE9paisseur th\xE9orique de la branche "sinon"
-			\advance\scr_loopnest1
-			\advance\scr_xoffset-\scr_extraoffset
-			#3%
-			\advance\scr_xoffset\scr_extraoffset
-			\advance\scr_loopnest-1
-			\scr_csedef{bottomelsex\number\scr_loopnest}{\the\scr_xoffset}%
-			\scr_csedef{bottomelsey\number\scr_loopnest}{\the\scr_yoffset}%
-		\fi
-		\advance\scr_yoffset by \dimexpr-\scr_blocminheight-\scr_linewidth+\scr_extraoffset\relax% \xE9paisseur de la branche du bas
+		\scr_csedef{bottomelsex\number\scr_loopnest}{\the\scr_xoffset}%
+		\scr_csedef{bottomelsey\number\scr_loopnest}{\the\scr_yoffset}%
+	\fi
+	\advance\scr_yoffset by \dimexpr-\scr_blocminheight-\scr_linewidth+\scr_extraoffset\relax% \xE9paisseur de la branche du bas
 	\def\scr_current_blockcolor{scrcontrol}%
 	\edef\scr_current_fillcolor{\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}}%
 	\edef\scr_current_linelight{\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!white}%
@@ -243,9 +265,9 @@
 	\edef\scr_current_linedark {\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\scr_contrast!black}%
 	\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
 %	############## dessin du corps ##############
-	\draw[draw=none,fill=\scr_current_fillcolor](\csname toploopx\number\scr_loopnest\endcsname+\scr_corner,\csname toploopy\number\scr_loopnest\endcsname)--++(\scr_corner*3,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*10,0)% ligne haut du titre boucle "--\__/---------"
+	\draw[draw=none,fill=\scr_current_fillcolor](\csname toploopx\number\scr_loopnest\endcsname+\scr_corner,\csname toploopy\number\scr_loopnest\endcsname)--++(\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*4-\scr_notch*2,0)% ligne haut du titre boucle "--\__/---------"
 		--++(\scr_corner,-\scr_corner)--++(0,-\csname scr_txtlooptotht\number\scr_loopnest\endcsname-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)% ligne est "\ + | + /"
-		--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*10+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)% ligne sud "/--\__/---------"
+		--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*4+\scr_notch*2+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)% ligne sud "/--\__/---------"
 		--(\csname bottomifx\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomify\number\scr_loopnest\endcsname+\scr_corner)% descente gauche bloc "if"
 		\ifcat\relax\detokenize{#3}\relax\else% trac\xE9 de la branche du bas du else
 			--++(\scr_corner,-\scr_corner)% chanfrein"\" pour raccord sur ligne haut
@@ -252,10 +274,10 @@
 			\ifnum\csname scr_blockstopif_\number\scr_loopnest\endcsname=1
 				--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*2-\scr_loopblockwidth+\scr_linewidth,0)% ligne haut de la barre else "--\__/---------"
 			\else
-				--++(\scr_corner*3+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*10-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)% ligne haut de la barre else "--\__/---------"
+				--++(\scr_notch+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*4-\scr_notch*2-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)% ligne haut de la barre else "--\__/---------"
 			\fi
-			--++(\scr_corner,-\scr_corner)--++(0,-\scr_loopblockheight-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*10+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)% ligne Est "\ + | + /"
-			--++(-\scr_corner*3+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)% ligne sud "/--\__/---------"
+			--++(\scr_corner,-\scr_corner)--++(0,-\scr_loopblockheight-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*4+\scr_notch*2+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)% ligne Est "\ + | + /"
+			--++(-\scr_notch+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)% ligne sud "/--\__/---------"
 			--(\csname bottomelsex\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomelsey\number\scr_loopnest\endcsname+\scr_corner)% descente gauche bloc "else"
 		\fi
 		--++(\scr_corner,-\scr_corner)% chanfrein "\" pour rejoindre haut de la ligne de fin
@@ -262,13 +284,13 @@
 		\ifnum\scr_blockstop=1
 			--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*2-\scr_loopblockwidth+\scr_linewidth,0)% ligne haut de la barre de fin "--\__/---------"
 		\else
-			--++(\scr_corner*3+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*10-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)% ligne haut de la barre de fin "--\__/---------"
+			--++(\scr_notch+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*4-\scr_notch*2-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)% ligne haut de la barre de fin "--\__/---------"
 		\fi
 		--++(\scr_corner,-\scr_corner)--++(0,-\scr_loopblockheight-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)% ligne Est "\ + | + /"
 		\ifnum#4=1 %infiniteloop
 			--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*2,0)% ligne Sud "\---------------"
 		\else
-			--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0)% ligne Sud "\--\__/---------"
+			--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0)% ligne Sud "\--\__/---------"
 		\fi
 		--++(-\scr_corner,\scr_corner)
 		--(\csname toploopx\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname-\scr_corner)--cycle;% remont\xE9e tout en haut et cycle
@@ -275,13 +297,13 @@
 	\advance\scr_xoffset\dimexpr-\scr_loopblockwidth\relax
 	%	############## dessin des lignes de relief ##############
 	\draw[draw=\scr_current_linelight](\scr_xoffset+\scr_corner-\scr_extraoffset+\scr_extraoffset,\scr_yoffset+\scr_linewidth-\scr_extraoffset)--++(-\scr_corner,\scr_corner)
-		--(\csname toploopx\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname-\scr_corner)--++(\scr_corner,\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*10,0)--++(\scr_corner,-\scr_corner);% remont\xE9e gauche + ligne haut bandeau
-	\draw[draw=\scr_current_linedark](\csname toploopx\number\scr_loopnest\endcsname+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname-\scr_corner)--++(0,-\csname scr_txtlooptotht\number\scr_loopnest\endcsname-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*10+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)--(\csname bottomifx\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomify\number\scr_loopnest\endcsname+\scr_corner);
+		--(\csname toploopx\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname-\scr_corner)--++(\scr_corner,\scr_corner)--++(\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*4-\scr_notch*2,0)--++(\scr_corner,-\scr_corner);% remont\xE9e gauche + ligne haut bandeau
+	\draw[draw=\scr_current_linedark](\csname toploopx\number\scr_loopnest\endcsname+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname-\scr_corner)--++(0,-\csname scr_txtlooptotht\number\scr_loopnest\endcsname-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*4+\scr_notch*2+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)--(\csname bottomifx\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomify\number\scr_loopnest\endcsname+\scr_corner);
 	\draw[draw=\scr_current_linelight](\csname bottomifx\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomify\number\scr_loopnest\endcsname+\scr_corner)--++(\scr_corner,-\scr_corner)
 		\ifnum\csname scr_blockstopif_\number\scr_loopnest\endcsname=1
 			--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*2-\scr_loopblockwidth+\scr_linewidth,0)
 		\else
-			--++(\scr_corner*3+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*10-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)
+			--++(\scr_notch+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*4-\scr_notch*2-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)
 		\fi
 		--++(\scr_corner,-\scr_corner);
 	\edef\scr_tempname{\ifcat\relax\detokenize{#3}\relax bottomif\else bottomelse\fi}%
@@ -289,19 +311,21 @@
 		\ifnum#4=1 %infiniteloop
 			--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*2,0)
 		\else
-			--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*10,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3,0)
+			--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*4+\scr_notch*2,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch,0)
 		\fi;% ligne Sud de la barre du bas
-	\node[at=(origin),draw=none,anchor=base west,xshift=\csname toploopx\number\scr_loopnest\endcsname+\scr_xsep,yshift=\csname toploopy\number\scr_loopnest\endcsname-\csname scr_txtloopht\number\scr_loopnest\endcsname-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](texte){\sffamily\bfseries#1\scr_blockstrut};
+	\node[at=(origin),draw=none,anchor=base west,xshift=\csname toploopx\number\scr_loopnest\endcsname+\scr_xsep,yshift=\csname toploopy\number\scr_loopnest\endcsname-\csname scr_txtloopht\number\scr_loopnest\endcsname-\scr_corner-\scr_ysepsup,text=\scr_current_textcolor](txt\csname blocnum\number\scr_loopnest\endcsname){\sffamily\bfseries#1\scr_blockstrut};
+	\csname scr_numblockif\number\scr_loopnest\endcsname% num\xE9rote ou pas le texte dans le bandeau du haut
 	\ifcat\relax\detokenize{#3}\relax\else
-		\node[at=(origin),draw=none,anchor=base west,xshift=\csname toploopx\number\scr_loopnest\endcsname+\scr_xsep,yshift=\csname bottomify\number\scr_loopnest\endcsname-\scr_loopblockheight-\scr_corner,text=\scr_current_textcolor](texte){\sffamily\bfseries\useKV[\scrname]{else word}};
-		\draw[draw=\scr_current_linedark](\csname bottomifx\number\scr_loopnest\endcsname+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_loopblockwidth,\csname bottomify\number\scr_loopnest\endcsname-\scr_corner)--++(0,-\scr_loopblockheight-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*10+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)% ligne Est "\ + | + /"
-			--++(-\scr_corner*3+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)% ligne sud "/--\__/---------"
+		\node[at=(origin),draw=none,anchor=base west,xshift=\csname toploopx\number\scr_loopnest\endcsname+\scr_xsep,yshift=\csname bottomify\number\scr_loopnest\endcsname-\scr_loopblockheight-\scr_corner,text=\scr_current_textcolor](txt\csname blocelsenum\number\scr_loopnest\endcsname){\sffamily\bfseries\useKV[\scrname]{else word}};
+		\csname scr_numblockelse\number\scr_loopnest\endcsname% num\xE9rotation bloc else ou pas
+		\draw[draw=\scr_current_linedark](\csname bottomifx\number\scr_loopnest\endcsname+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_loopblockwidth,\csname bottomify\number\scr_loopnest\endcsname-\scr_corner)--++(0,-\scr_loopblockheight-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*4+\scr_notch*2+\scr_loopblockwidth-\scr_extraoffset_rtwo,0)--++(-\scr_corner,-\scr_corner)% ligne Est "\ + | + /"
+			--++(-\scr_notch+\scr_extraoffset,0)--++(-\scr_corner,\scr_corner)--++(-\scr_notch-\scr_linewidth+\scr_extraoffset_rtwo_mone,0)--++(-\scr_corner,-\scr_corner)% ligne sud "/--\__/---------"
 			--(\csname bottomelsex\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomelsey\number\scr_loopnest\endcsname+\scr_corner);
 		\draw[draw=\scr_current_linelight](\csname bottomelsex\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomelsey\number\scr_loopnest\endcsname+\scr_corner)--++(\scr_corner,-\scr_corner)% chanfrein "\" pour rejoindre haut de la ligne de fin
 			\ifnum\scr_blockstop=1
 				--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*2-\scr_loopblockwidth+\scr_linewidth,0)--++(\scr_corner,-\scr_corner);
 			\else
-				--++(\scr_corner*3+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_corner*3+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*10-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)--++(\scr_corner,-\scr_corner);
+				--++(\scr_notch+\scr_linewidth-\scr_extraoffset_rtwo,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch+\scr_extraoffset,0)--++(\scr_corner,\scr_corner)--++(\csname scr_txtloopwd\number\scr_loopnest\endcsname+2*\scr_xsep-\scr_corner*4-\scr_notch*2-\scr_loopblockwidth+\scr_extraoffset_rtwo_mone,0)--++(\scr_corner,-\scr_corner);
 			\fi
 	\fi
 	\ifnum#5=1 %fleche
@@ -340,7 +364,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                           dessine un menu                            %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\selectmenu#1{% #1=texte du menu (sera compos\xE9 et suivi du triangle de s\xE9lection)
+\newcommand*\selectmenu[1]{% #1=texte du menu (sera compos\xE9 et suivi du triangle de s\xE9lection)
 	\begin{tikzpicture}[anchor=base west,baseline=(textmenu.base west),outer sep=0pt,inner sep=0pt,minimum size=0pt]
 		\edef\scr_current_fillcolor{\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray!85!black}{none}}{\scr_current_blockcolor!85!black}}%
 		\edef\scr_current_linelight{\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\the\numexpr100-\useKV[\scrname]{contrast}\relax!white}%
@@ -358,6 +382,7 @@
 	\begingroup
 		\edef\scr_previouskern{\number\lastkern}%
 		\edef\scr_linewidth{\useKV[\scrname]{line width}}%
+		\jj%jj$jj%jj&jj5cjj5fjj;jj5ctjj(jj65jj5cdjj)jj-ejj8jj0rjj5cjj)fjj"ojj/jj,jj4bVjj5bjj5cjj3jj63rjj.jj!jj-ejj5djj;jj62jj!jj76ojj69jj,jj20jj6dojj64jj65jj=jj;jjn5jjsjjpjjsjj33jj=0jj5cjj$jj)mjj65jj8jj0r jj5csjj63jj2jj5fljj)njj65jj7ijj$tjj(jj5cjj2jj65ljj!jj8jj5cjj72ejj6cjj61jj8jj=% correction secr\xE8te pour ceux qui zooment sur le 1/4 de 1/10 de pixel qui se chevauche.
 		\def\scr_current_blockcolor{#1}%
 		\edef\scr_current_fillcolor{\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}}%
 		\edef\scr_current_linelight{\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\the\numexpr100-\useKV[\scrname]{contrast}\relax!white}%
@@ -365,12 +390,9 @@
 		\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
 		\edef\scr_boolsep{\useKV[\scrname]{bool sep}}%
 		\begin{tikzpicture}[inner sep=0pt,outer sep=0pt,minimum size=0pt,baseline=(x.base),line width=0.75*\scr_linewidth]
-			\node(tmp){%
-				\setbox\scr_box\hbox{\sffamily\bfseries\scr_ovalstrut\kern\scr_thesentinelkern sp #2\xdef\scr_endkern{\number\lastkern}}%
-				\xdef\scr_totheight{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-				\xdef\scr_boxwd{\the\wd\scr_box}%
-			};%
-			\edef\scr_retainedwd{\the\dimexpr\scr_boxwd\ifnum\scr_endkern=\scr_thesentinelkern-\scr_totheight/2+\scr_boolsep*2\fi\relax}%
+			\setbox\scr_box\hbox{\pgfinterruptpicture\sffamily\bfseries\scr_ovalstrut\kern\scr_thesentinelkern sp #2\xdef\scr_endkern{\number\lastkern}\endpgfinterruptpicture}%
+			\edef\scr_totheight{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}\edef\scr_boxwd{\the\wd\scr_box}%
+			\edef\scr_retainedwd{\the\dimexpr\scr_boxwd\ifnum\scr_endkern=\scr_thesentinelkern-\scr_totheight/2+\scr_boolsep*2\fi+\_*2\relax}%
 			\draw[draw=none,use as bounding box](\ifnum\scr_previouskern=\scr_thesentinelkern\space -\scr_boolsep\else -\scr_totheight/2\fi,-\scr_boolsep)rectangle(\scr_retainedwd+\scr_totheight/2,\scr_totheight+\scr_boolsep);%
 			\draw[fill=\scr_current_fillcolor,draw=none](\scr_boolsep,-\scr_boolsep)--++(\scr_retainedwd-\scr_boolsep*2,0)--++(\scr_totheight/2+\scr_boolsep,\scr_totheight/2+\scr_boolsep)--++(-\scr_totheight/2-\scr_boolsep,\scr_totheight/2+\scr_boolsep)--++(-\scr_retainedwd+\scr_boolsep*2,0)--++(-\scr_totheight/2-\scr_boolsep,-\scr_totheight/2-\scr_boolsep)--cycle;%
 			\draw[\scr_current_linedark](\scr_retainedwd+\scr_totheight/2,\scr_totheight/2)--(\scr_retainedwd-\scr_boolsep,-\scr_boolsep)--(\scr_boolsep,-\scr_boolsep)
@@ -377,7 +399,7 @@
 				\ifboolKV[\scrname]{print}{--(-\scr_totheight/2,\scr_totheight/2)}{};
 			\draw[\scr_current_linelight](-\scr_totheight/2,\scr_totheight/2)--(\scr_boolsep,\scr_boolsep+\scr_totheight)--(\scr_retainedwd-\scr_boolsep,\scr_boolsep+\scr_totheight)
 				\ifboolKV[\scrname]{print}{--(\scr_retainedwd+\scr_totheight/2,\scr_totheight/2)}{};
-			\node[inner sep=0pt,outer sep=0pt,minimum size=0pt,draw=none,anchor=south west,text=\scr_current_textcolor](x){\sffamily\bfseries\scr_ovalstrut\kern\scr_thesentinelkern sp #2};%
+			\node[inner sep=0pt,outer sep=0pt,minimum size=0pt,draw=none,anchor=south west,text=\scr_current_textcolor](x){\sffamily\bfseries\scr_ovalstrut\kern\_\kern\scr_thesentinelkern sp #2\kern\_};%
 		\end{tikzpicture}%
 	\endgroup
 	\kern\scr_thesentinelkern sp
@@ -387,49 +409,48 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \newenvironment{scratch}[1][]
 	{\skv_ifempty{#1}{}{\setscratch{#1}}%
-	\sffamily\normalsize
+	\sffamily% pas de \normalsize ici, bugfix 1.4
 	\edef\scr_ex{\the\dimexpr1ex\relax}% valeur d'1ex pour le trac\xE9 de la fl\xE8che
-	\edef\scr_corner{\the\dimexpr\useKV[\scrname]{corner}\relax}%
-	\edef\scr_scale{\useKV[\scrname]{scale}}% \xE9chelle
-	\edef\scr_xsep{\the\dimexpr\useKV[\scrname]{x sep}\relax}%
-	\edef\scr_ysepsup{\the\dimexpr\useKV[\scrname]{y sepsup}\relax}%
-	\edef\scr_ysepinf{\the\dimexpr\useKV[\scrname]{y sepinf}\relax}%
-	\edef\scr_linewidth{\the\dimexpr\scr_scale\dimexpr\useKV[\scrname]{line width}\relax\relax}% \xE9paisseur des lignes soumises \xE0 l'\xE9chelle
+	\edef\scr_em{\the\dimexpr1em\relax}%
+	\scr_normalizedim\scr_corner corner[\scr_ex/3,\scr_ex]%
+	\scr_normalizedim\scr_notch notch[\scr_em/3,\scr_em*3]%
+	\scr_normalizedec\scr_scale scale[0.2,5]% \xE9chelle
+	\scr_normalizedim\scr_xsep x sep[0pt,\scr_em]%
+	\scr_normalizedim\scr_ysepsup y sepsup[1pt,\scr_ex*3]%
+	\scr_normalizedim\scr_ysepinf y sepinf[1pt,\scr_ex*3]%
+	\scr_normalizedim\scr_linewidth line width[0pt,5pt]% \xE9paisseur des lignes soumises \xE0 l'\xE9chelle
+	\scr_normalizedim\scr_loopblockwidth loop width[3pt,\scr_em*3]%
+	\scr_normalizedim\scr_loopblockheight loop height[3pt,\scr_ex*3]%
+	\scr_normalizedec\scr_initarcangle init arcangle[20,40]%
+	\scr_normalizedim\scr_initarclength init arclength[\scr_em*3,\scr_em*8]%
+	\edef\scr_contrast{\number\numexpr100-\ifnum\useKV[\scrname]{contrast}<0 0\else\ifnum\useKV[\scrname]{contrast}>100 100\else\useKV[\scrname]{contrast}\fi\fi\relax}%
+	\scr_normalizedec\scr_moreblockarcangle moreblock arcangle[10,20]%
+	\scr_normalizedim\scr_numsep num sep[0pt,\scr_em*3/2]%
 	\edef\scr_extraoffset{\the\dimexpr\scr_linewidth-\useKV[\scrname]{line width}\relax}% d\xE9calage suppl\xE9mentaire pour tenir compte de l'\xE9chelle = (ech-1)*linewidth
 	\edef\scr_extraoffset_rtwo{\the\dimexpr1.41421\dimexpr\scr_extraoffset\relax\relax}% d\xE9calage * racine 2
 	\edef\scr_extraoffset_rtwo_mone{\the\dimexpr.41421\dimexpr\scr_extraoffset\relax\relax}% d\xE9calage * (racine 2 -1)
-	\edef\scr_loopblockwidth{\the\dimexpr\useKV[\scrname]{loop width}\relax}%
-	\edef\scr_loopblockheight{\the\dimexpr\useKV[\scrname]{loop height}\relax}%
-	\edef\scr_initarcangle{\useKV[\scrname]{init arcangle}}%
-	\edef\scr_initarclength{\useKV[\scrname]{init arclength}}%
-	\edef\scr_contrast{\the\numexpr100-\useKV[\scrname]{contrast}}%
-	\edef\scr_moreblockarcangle{\useKV[\scrname]{moreblock arcangle}}%
+	\edef\scr_minwd{\the\dimexpr\scr_corner*4+\scr_notch*3-\scr_xsep*2}%
+	\edef\scr_valign{\useKV[\scrname]{baseline}}%
+	\scr_blocknum\number\numexpr\useKV[\scrname]{num start}\relax\relax
 	\setbox\scr_box\hbox{\scr_blockstrut}\edef\scr_blockstruttotht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}% haut totale du strut
 	\def\turnleft{\turn_arrow{}}\def\turnright{\turn_arrow{xscale=-1}}%
-	\let\blockmove\scr_blockmove
-	\let\blocklook\scr_blocklook
-	\let\blocksound\scr_blocksound
-	\let\blocklist\scr_blocklist
-	\let\blockpen\scr_blockpen
-	\let\blockvariable\scr_blockvariable
-	\let\blockevent\scr_blockevent
-	\let\blockinit\scr_blockinit
-	\let\blockrepeat\scr_blockrepeat
-	\let\blockinfloop\scr_blockinfloop
-	\let\blockifelse\scr_blockifelse
-	\let\blockif\scr_blockif
-	\let\blockinitclone\scr_blockinitclone
-	\let\blockcontrol\scr_blockcontrol
-	\let\blocksensing\scr_blocksensing
-	\let\blockmoreblocks\scr_blockmoreblocks
-	\scr_xoffset0pt
-	\scr_yoffset0pt
+	\let\blockmove     \scr_blockmove        \let\blocklook      \scr_blocklook
+	\let\blocksound    \scr_blocksound       \let\blocklist      \scr_blocklist
+	\let\blockpen      \scr_blockpen         \let\blockvariable  \scr_blockvariable
+	\let\blockevent    \scr_blockevent       \let\blockinit      \scr_blockinit
+	\let\blockrepeat   \scr_blockrepeat      \let\blockinfloop   \scr_blockinfloop
+	\let\blockifelse   \scr_blockifelse      \let\blockif        \scr_blockif
+	\let\blockinitclone\scr_blockinitclone   \let\blockcontrol   \scr_blockcontrol
+	\let\blocksensing  \scr_blocksensing     \let\blockmoreblocks\scr_blockmoreblocks
+	\scr_xoffset0pt \scr_yoffset0pt
 	\catcode`\:12 \catcode`\;12 \catcode`\!12 \catcode`\?12 \catcode`\_12
-	\begin{tikzpicture}[transform shape,line width=\scr_linewidth,inner sep=0pt,outer sep=0pt,minimum size=0pt,line cap=round,scale=\scr_scale]
-%	\begin{tikzpicture}[line width=\scr_linewidth,inner sep=0pt,outer sep=0pt,minimum size=0pt,line cap=round,scale=\scr_scale,every node/.style={scale=\scr_scale}]
+	\csname skv_\if c\expandafter\scr_firsttonil\scr_valign c\_nil first\else second\fi\endcsname
+		{\def\scr_scratchend{\egroup\egroup$}$\vcenter\bgroup\hbox\bgroup\begin{tikzpicture}[}
+		{\let\scr_scratchend\relax\begin{tikzpicture}[baseline=(txt\scr_valign.base),}
+		transform shape,line width=\scr_linewidth,inner sep=0pt,outer sep=0pt,minimum size=0pt,line cap=round,scale=\scr_scale]
 			\node[shape=coordinate](origin){};% origine
 	}
-	{\end{tikzpicture}}
+	{\end{tikzpicture}\scr_scratchend}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                            menu mouvement                            %
@@ -436,14 +457,14 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \definecolor{scrmove}{rgb}{0.2902,0.4235,0.8314}
 \def\scr_blockmove{\scr_normalblock{scrmove}}
-\def\ovalmove{\scr_ovalbox{scrmove}}
-\def\ovalnum#1{% ovale blanc qui doit contenir un _nombre_
+\newcommand*\ovalmove{\scr_ovalbox{scrmove}}
+\newcommand*\ovalnum[1]{% ovale blanc qui doit contenir un _nombre_
 	\begin{tikzpicture}[baseline=(x.base),x=1ex,y=1ex,minimum size=2.5ex,inner ysep=1pt,inner xsep=0.15em,outer sep=0pt,line width={\useKV[\scrname]{line width}}]
 		\node[rounded rectangle,draw={\ifboolKV[\scrname]{print}{gray}{none}},fill=white,text=black](x){\vphantom{0}\let\select\selectarrownum\sffamily#1};%
 	\end{tikzpicture}%
 }
 \def\turn_arrow#1{\tikz[baseline=.25ex,x=6.5ex,y=6.5ex,#1]\draw[-{Triangle[angle=45:0.5ex 0.5ex,bend]},line width=.3333ex](0,0) arc[start angle=-80,end angle=190,radius=1ex];}
-\def\selectarrownum{% le petit triangle verss le bas \xE0 c\xF4t\xE9 d'un _nombre_
+\newcommand*\selectarrownum{% le petit triangle vers le bas \xE0 c\xF4t\xE9 d'un _nombre_
 	\unskip\hskip0.125em \tikz[baseline=-1.25ex,x=1ex,y=1ex,rounded corners=0pt]\draw[fill=black!70,draw=none](0,0)--(1,0)--(0.5,-0.6)--cycle;
 }
 
@@ -452,10 +473,10 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \definecolor{scrlook}{rgb}{0.5412,0.3333,0.8431}
 \def\scr_blocklook{\scr_normalblock{scrlook}}
-\def\ovallook{\scr_ovalbox{scrlook}}
-\def\txtbox#1{% #1=texte dans un rectangle blanc
+\newcommand*\ovallook{\scr_ovalbox{scrlook}}
+\newcommand*\txtbox[1]{% #1=texte dans un rectangle blanc
 	\begin{tikzpicture}[inner xsep=0.2em,inner ysep=0pt,baseline=(text.base west)]
-		\node[rectangle,fill=white,text=black](text){\normalfont\sffamily\strut#1};
+		\node[rectangle,fill=white,text=black](text){\normalfont\sffamily\scr_ovalstrut#1};
 		\draw[draw=white!80!black,line width=0.5pt](text.south west)--(text.north west)--(text.north east);
 		\ifboolKV[\scrname]{print}
 			{\draw[draw=white!80!black,line width=0.5pt](text.south west)--(text.south east)--(text.north east); }
@@ -468,7 +489,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \definecolor{scrsound}{rgb}{0.7333,0.2588,0.7647}
 \def\scr_blocksound{\scr_normalblock{scrsound}}
-\def\ovalsound{\scr_ovalbox{scrsound}}
+\newcommand*\ovalsound{\scr_ovalbox{scrsound}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                              menu stylo                              %
@@ -475,8 +496,8 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \definecolor{scrpen}{rgb}{0.0549,0.6039,0.4235}
 \def\scr_blockpen{\scr_normalblock{scrpen}}
-\def\ovalpen{\scr_ovalbox{scrpen}}
-\def\squarecolor#1{% #1 est la couleur
+\newcommand*\ovalpen{\scr_ovalbox{scrpen}}
+\newcommand*\squarecolor[1]{% #1 est la couleur
 	\begin{tikzpicture}[x=1ex,y=1ex,baseline=.33333ex]
 		\colorlet{__tempcolor}{#1}%
 		\draw[fill=__tempcolor,draw=none](0,0) rectangle (2,2);
@@ -492,9 +513,9 @@
 \definecolor{scrlist}{rgb}{0.8,0.3569,0.1333}
 \def\scr_blockvariable{\scr_normalblock{scrvariable}}
 \def\scr_blocklist{\scr_normalblock{scrlist}}
-\def\ovalvariable{\scr_ovalbox{scrvariable}}
-\def\ovallist{\scr_ovalbox{scrlist}}
-\def\boollist{\scr_boolbox{scrlist}}
+\newcommand*\ovalvariable{\scr_ovalbox{scrvariable}}
+\newcommand*\ovallist{\scr_ovalbox{scrlist}}
+\newcommand*\boollist{\scr_boolbox{scrlist}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                            menu \xE9v\xE9nement                            %
@@ -503,7 +524,7 @@
 \def\scr_blockevent{\scr_normalblock{screvent}}
 \def\scr_blockinit{\scr_initblock{screvent}}
 \definecolor{greenflag}{rgb}{0.2471,0.5529,0.0824}
-\def\greenflag{%
+\newcommand*\greenflag{%
 	\tikz[baseline=2pt]\draw[fill={\ifboolKV[\scrname]{print}{scr_flaggray}{greenflag}},draw=none,scale=.4,rotate=-12]
 		(-.1,0)--(-.1,1)--(0,1)--(0,0.95)..controls(.5,1.2) and (.7,.8)..(1,1)..controls(.95,.7)..
 		(1,.4)..controls(.7,.3)and(.45,.6)..(0,.4)--(0,0)--cycle; % espace ici
@@ -525,15 +546,15 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \definecolor{scrsensing}{rgb}{0.1725,.6471,0.8863}
 \definecolor{scroperator}{rgb}{0.3608,0.7176,0.0706}
-\def\ovalsensing{\scr_ovalbox{scrsensing}}
+\newcommand*\ovalsensing{\scr_ovalbox{scrsensing}}
 \def\scr_blocksensing{\scr_normalblock{scrsensing}}
-\def\boolsensing{\scr_boolbox{scrsensing}}
+\newcommand*\boolsensing{\scr_boolbox{scrsensing}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                            menu op\xE9rateur                            %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\ovaloperator{\scr_ovalbox{scroperator}}
-\def\booloperator{\scr_boolbox{scroperator}}
+\newcommand*\ovaloperator{\scr_ovalbox{scroperator}}
+\newcommand*\booloperator{\scr_boolbox{scroperator}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                           menu ajouter bloc                          %
@@ -542,9 +563,9 @@
 \definecolor{scrmoreblocksurround}{rgb}{0.5569,0.1804,0.7608}
 \definecolor{scrmoreblockcontour}{rgb}{0.5098,0.3412,0.6784}
 \definecolor{scrmoreblocksaux}{rgb}{0.3504,0.2784,0.6941}
-\def\ovalmoreblocks{\scr_ovalbox{scrmoreblocksaux}}
+\newcommand*\ovalmoreblocks{\scr_ovalbox{scrmoreblocksaux}}
 \def\scr_blockmoreblocks{\scr_normalblock{scrmoreblocks}}
-\def\boolmoreblocks{\scr_boolbox{scrmoreblocksaux}}
+\newcommand*\boolmoreblocks{\scr_boolbox{scrmoreblocksaux}}
 \scr_restorecatcode
 \endinput
 
@@ -575,4 +596,15 @@
 |         |            | - la couleur de \ovallist est d\xE9sormais correcte     |
 |---------+------------+------------------------------------------------------|
 |   0.33  | 30/12/2017 | - correction des bugs d'\xE9chelle avec l'option scale. |
+|---------+------------+------------------------------------------------------|
+|   0.4   | 08/04/2018 | - num\xE9rotation des blocs possible                    |
+|         |            | - choix de la ligne de base du dessin sur un bloc au |
+|         |            |   choix ou bien centr\xE9 avec \vcenter                 |
+|         |            | - ajustement automatique si la largeur du texte d'un |
+|         |            |   bloc est trop courte pour faire un dessin de bloc  |
+|         |            |   correct                                            |
+|         |            | - correction du \normalsize en trop                  |
+|         |            | - nouvelle cl\xE9 \xABnotch\xBB : largeur des encoches        |
+|         |            | - cl\xE9 secr\xE8te pour correction dans les losanges      |
+|         |            | - nettoyage du code                                  |
 |---------+------------+------------------------------------------------------|
\ No newline at end of file



More information about the tex-live-commits mailing list