texlive[44490] Master/texmf-dist: scratch (28may17)

commits+karl at tug.org commits+karl at tug.org
Tue Jun 6 01:21:13 CEST 2017


Revision: 44490
          http://tug.org/svn/texlive?view=revision&revision=44490
Author:   karl
Date:     2017-06-06 01:21:13 +0200 (Tue, 06 Jun 2017)
Log Message:
-----------
scratch (28may17)

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	2017-06-05 23:21:01 UTC (rev 44489)
+++ trunk/Master/texmf-dist/doc/latex/scratch/README	2017-06-05 23:21:13 UTC (rev 44490)
@@ -3,9 +3,9 @@
              L'extension
                scratch
                
-                v0.1
+                v0.2
 
-             16 mai 2017
+             28 mai 2017
 ___________________________________
 
 Authors   : Christian Tellechea

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	2017-06-05 23:21:01 UTC (rev 44489)
+++ trunk/Master/texmf-dist/doc/latex/scratch/scratch-fr.tex	2017-06-05 23:21:13 UTC (rev 44490)
@@ -139,7 +139,12 @@
 	\leftskip=.2\linewidth \rightskip=.2\linewidth \small
 	Cette extension permet de dessiner des empilements de blocs similaires \xE0 ceux que l'on trouve dans le logiciel de programmation \emph{visuelle} \xAB \SCRATCH\footnote{Le logiciel que l'on peut utiliser en ligne \xE0 \texttt{https://scratch.mit.edu/}} \xBB.
 \end{titlepage}
-\parindent1.5em
+\parindent0pt
+\section{Avant propos}
+La pr\xE9sente  extension \SCRATCH requiert les extensions \texttt{hlist} et \texttt{ti\textit kz}. Celles-ci sont automatiquement charg\xE9es par \SCRATCH.
+
+En raison de la r\xE9cente parution de \texttt{hlist}, post\xE9rieure au gel de \TeX live~2016, il peut \xEAtre n\xE9cessaire d'installer \xE0 la main l'extension \texttt{hlist}. Pour ce faire, il suffit de t\xE9l\xE9charger les fichiers \texttt{hlist.sty} et \texttt{hlist.tex} sur le CTAN et copier ces fichiers dans un endroit o\xF9 \LaTeX{} les voit; le r\xE9pertoire \texttt{texmf} personnel est tout indiqu\xE9 (il faut ensuite ex\xE9cuter la commande \texttt{texhash}), ou le r\xE9pertoire de compilation, pour une port\xE9e plus locale.
+
 \section{L'environnement \SCRATCH}
 Pour dessiner un programme comme le fait \SCRATCH, il faut ouvrir un environnement \xAB\SCRATCH\xBB et \xE9crire dans cet environnement les macros correspondant aux \emph{blocs} que l'on veut y mettre :
 
@@ -154,7 +159,7 @@
 Enfin, j'ai cherch\xE9 le bon compromis entre complexit\xE9 du code et qualit\xE9 des dessins obtenus avec cette extension: ils \emph{ressemblent} \xE0 ceux du logiciel \SCRATCH, mais le but de cette extension n'est \emph{pas} la ressemblance absolue au pixel pr\xE8s!
 
 \section{Les blocs normaux}
-Ces blocs sont les plus courants et poss\xE8dent une encoche d'emboitement, femelle en haut et m\xE2le en bas. Les macros permettant de dessiner ces blocs ont des noms de la forme \verb|\block<suffixe>| et ont un seul argument obligatoire qui est le texte que l'on souhaite mettre dans le bloc. Par exemple, un bloc bleu (correspondant au menu \xABmouvement\xBB) a un suffixe \suffixe{move}, et est dessin\xE9 gr\xE2ce \xE0 la macro \verb|\blocmove{<texte>}|. Ainsi, dans l'environnement \SCRATCH, \xE9crire \verb|\blockmove{Bonjour le monde}| donne
+Ces blocs sont les plus courants et poss\xE8dent une encoche d'emboitement, femelle en haut et m\xE2le en bas. Les macros permettant de dessiner ces blocs ont des noms de la forme \verb|\block<suffixe>| et ont un seul argument obligatoire qui est le texte que l'on souhaite mettre dans le bloc. Par exemple, un bloc bleu (correspondant au menu \xABmouvement\xBB) a un suffixe \suffixe{move}, et est dessin\xE9 gr\xE2ce \xE0 la macro \verb|\blockmove{<texte>}|. Ainsi, dans l'environnement \SCRATCH, \xE9crire \verb|\blockmove{Bonjour le monde}| donne
 \begin{center}\begin{scratch}\blockmove{Bonjour le monde}\end{scratch}\end{center}
 
 La police d'\xE9criture dans chaque bloc est la police \xAB \textsf{sans serif} \xBB en gras qui est d\xE9finie dans le document au moment o\xF9 l'environnement est appel\xE9 : pratiquement, cela signifie que les macros \verb|\sffamily| et \verb|\bfseries| sont ex\xE9cut\xE9es avant que le texte des blocs ne soit compos\xE9. Dans cette documentation, la police sans serif est \xAB\textsf{biolinum}\xBB.
@@ -400,8 +405,81 @@
 \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.
 
+\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.
+
+\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.
+
+\exemple/\begin{scratch}
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch} puis
+\begin{scratch}[print]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch}/
+
+\cleval{fill blocks}{bool\xE9en}
+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.
+
+\exemple/\begin{scratch}
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch} puis
+\begin{scratch}[print,fill blocks]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch} puis
+\begin{scratch}[print,fill blocks,fill gray=0.66]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch}/
+
+\cleval{text color}{couleur}
+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.
+
+\exemple/\begin{scratch}[print,fill blocks,fill gray=0.66]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\end{scratch} puis
+\begin{scratch}[print,fill blocks,fill gray=0.33,text color=white,flag gray=0.66]
+	\blockinit{Quand \greenflag est cliqu\xE9}
+	\blockpen{effacer tout}
+	\blockpen{relever le stylo}
+	\blockmove{ajouter \ovalnum{5} \xE0 \ovalvariable{abscisse}}
+\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.
+
 \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.
 
 Toute remarque, remont\xE9e de bug ---~je n'ose pas dire am\xE9lioration du code~---, demande d'impl\xE9mentation de fonctionnalit\xE9 est bien \xE9videmment bienvenue; j'invite les utilisateurs \xE0 m'en faire part \emph{via} email.
+
+\section{Historique}
+\paragraph{v0.1\quad 16/05/2017} Premi\xE8re version.
+\paragraph{v0.2\quad 28/05/2017} Pour une impression en noir et blanc, ajout de l'option \xAB\texttt{print}\xBB, suite \xE0 une demande de P.~\bsc{Celdran}. De cette option d\xE9coulent les options \xAB\texttt{fill blocks}\xBB, \xAB\texttt{fill gray}\xBB, \xAB\texttt{text color}\xBB, \xAB\texttt{flag gray}\xBB et \xAB\texttt{line gray}\xBB.
+	
+	Ajout \xE9galement de l'option \xAB\texttt{contrast}\xBB qui qualifie la diff\xE9rence de nuance entre les lignes de contraste des parties hautes et des parties basses.
+
 \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	2017-06-05 23:21:01 UTC (rev 44489)
+++ trunk/Master/texmf-dist/tex/latex/scratch/scratch.sty	2017-06-05 23:21:13 UTC (rev 44490)
@@ -4,9 +4,9 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                    %
 \def\scrname                   {scratch}                             %
-\def\scrver                      {0.1}                               %
+\def\scrver                      {0.2}                               %
 %                                                                    %
-\def\scrdate                 {2017/05/16}                            %
+\def\scrdate                 {2017/05/28}                            %
 %                                                                    %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
@@ -27,6 +27,7 @@
 % email: unbonpetit at openmailbox.org
 %        Commentaires, suggestions et signalement de bugs bienvenus !
 %        Comments, bug reports and suggestions are welcome.
+% Package URL: https://www.ctan.org/pkg/scratch
 % --------------------------------------------------------------------
 % L'extension scratch est compos\xE9e des 4 fichiers suivants :
 %   - code               : scratch.sty
@@ -53,15 +54,28 @@
 	corner             = 0.66667ex,% valeur du chanfrein
 	init arcangle      = 30,% angle d\xE9but et fin de l'arc
 	init arclength     = 5em,% longueur de l'arc
-	moreblock arcangle = 15,% angle de d\xE9part et arri\xE9ve des "more blmocks"
+	moreblock arcangle = 15,% angle de d\xE9part et arri\xE9ve des "more blocks"
+	contrast           = 20,% contraste des lignes de relief (0=aucun contraste, 100=noir/blanc)
+	print              = false,% impression noir et blanc ?
+	fill blocks        = false,% remplissage des blocks lorsque l'option "print" est vraie
+	fill gray          = 0.85,% taux de gris pour le remplissage si fill blocks est vraie
+	text color         = black,% couleur du texte lorsque l'option "print" est vraie
+	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
 }
 \expandafter\let\expandafter\resetscratch\csname hlst_[\scrname]\endcsname
-\def\setscratch#{\setKV[\scrname]}
-\def\setdefaultscratch#{\setKVdefault[\scrname]}
+\def\setscratch#1{\setKV[\scrname]{#1}\scr_setcolors}
+\def\setdefaultscratch#1{\setKVdefault[\scrname]{#1}\scr_setcolors}
+\def\scr_setcolors{%
+	\hlst_eearg{\definecolor{scr_fillgray}{gray}}{\useKV[\scrname]{fill gray}}%
+	\hlst_eearg{\definecolor{scr_linegray}{gray}}{\useKV[\scrname]{line gray}}%
+	\hlst_eearg{\definecolor{scr_flaggray}{gray}}{\useKV[\scrname]{flag gray}}%
+}
 
 \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}% TODO \xE0 modifier ?
-\def\scr_ovalstrut{\vphantom{lp}}% TODO c'est pas un peu petit en hauteur tout \xE7a ?
+\def\scr_ovalstrut{\vphantom{\`Alpgqyj}}% TODO c'est pas un peu petit en hauteur tout \xE7a ?
 \def\scr_cslet#1{\expandafter\let\csname#1\endcsname}
 \def\scr_csedef#1{\expandafter\edef\csname#1\endcsname}
 \newcount\scr_loopnest
@@ -73,7 +87,11 @@
 %                        dessine un bloc normal                        %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\scr_normalblock#1#2{% #1=couleur #2=texte
-	\def\current_bloccolor{#1}%
+	\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}!\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}%
@@ -81,21 +99,25 @@
 		\xdef\__boxwd{\the\wd\scr_box}%
 	};%
 	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
-	\draw[draw=none,fill=#1,yshift=\scr_yoffset,xshift=\scr_xoffset]
+	\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=white](texte){\sffamily\bfseries#2\scr_blockstrut};
-	\draw[draw=#1!80!black,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=#1!80!white,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);
+		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);
 	\advance\scr_yoffset\dimexpr-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth\relax
 	\gdef\scr_blockstop{0}%
 }
 \newcommand*\blockspace[1][1]{%
 	\advance\scr_yoffset#1\dimexpr-\scr_blockstruttotht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth\relax
-		\gdef\scr_blockstop{1}%
+	\gdef\scr_blockstop{1}%
 }
 \def\blockstop#1{% #1=texte
-	\def\current_bloccolor{scrcontrol}%
+	\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}%
@@ -103,12 +125,12 @@
 		\xdef\__boxwd{\the\wd\scr_box}%
 	};%
 	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
-	\draw[draw=none,fill=\current_bloccolor,yshift=\scr_yoffset,xshift=\scr_xoffset]
+	\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*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=white](texte){\sffamily\bfseries#1\scr_blockstrut};
-	\draw[draw=\current_bloccolor!80!black,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=\current_bloccolor!80!white,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);
+		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,-\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);
 	\advance\scr_yoffset\dimexpr-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner-\scr_linewidth\relax
 	\gdef\scr_blockstop{1}%
 }
@@ -116,7 +138,11 @@
 %                       dessine un bloc de d\xE9part                      %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\scr_initblock#1#2{%
-	\def\current_bloccolor{#1}%
+	\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}!\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}%
@@ -124,13 +150,12 @@
 		\xdef\__boxwd{\the\wd\scr_box}%
 	};%
 	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
-	\draw[draw=none,fill=\current_bloccolor,yshift=\scr_yoffset,xshift=\scr_xoffset]
+	\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=white](texte){\sffamily\bfseries#2\scr_blockstrut};
-	\draw[draw=\current_bloccolor!80!black,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=\current_bloccolor!80!white,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[draw=\current_bloccolor!80!white,yshift=\scr_yoffset,xshift=\scr_xoffset](\scr_xsep+\scr_initarclength,0)--(\scr_boxwd+2*\scr_xsep-\scr_corner,0)--++(\scr_corner,-\scr_corner);
+		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)--(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\relax
 	\gdef\scr_blockstop{0}%
 }
@@ -139,7 +164,6 @@
 %                    dessine un bloc de d\xE9finition                     %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\initmoreblocks#1{%
-	\def\current_bloccolor{scrmoreblocks}%
 	\node[at=(origin)](x){%
 		\setbox\scr_box\hbox{\begingroup\color{white}\sffamily\bfseries#1\scr_blockstrut\endgroup}%
 		\xdef\__boxht{\the\ht\scr_box}%
@@ -147,13 +171,19 @@
 		\xdef\__boxwd{\the\wd\scr_box}%
 	};%
 	\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
-	\draw[draw=none,fill=\current_bloccolor,yshift=\scr_yoffset,xshift=\scr_xoffset]
+	\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}%
+	\edef\current_linesurround{\ifboolKV[\scrname]{print}{scr_linegray!\scr_contrast!white}{scrmoreblocksurround}}%
+	\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}}%
+	\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=white](texte){\sffamily\bfseries#1\scr_blockstrut};
-	\draw[draw=\current_bloccolor!80!black,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);
-	\draw[draw=\current_bloccolor!80!white,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=scrmoreblocksurround,shorten <=-\scr_linewidth,shorten >=-\scr_linewidth](0,0)to[out=15,in=165](\scr_boxwd+2*\scr_xsep,0);
+		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);
+	\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\relax
 	\gdef\scr_blockstop{0}%
 }
@@ -168,11 +198,13 @@
 			\xdef\__boxwd{\the\wd\scr_box}%
 		};%
 		\let\scr_boxht\__boxht\let\scr_totht\__totht\let\scr_boxwd\__boxwd
-		\draw[draw=scrmoreblockcontour,line width=\scr_linewidth*2]
+		\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=white](moreblocksdef){\sffamily\bfseries#1\strut};
-	\end{tikzpicture}
+			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};
+	\end{tikzpicture}%
 }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -179,7 +211,6 @@
 %                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)
-	\def\current_bloccolor{scrcontrol}%
 	\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}%
@@ -209,7 +240,12 @@
 			\scr_csedef{bottomelsey\number\scr_loopnest}{\the\scr_yoffset}%
 		\fi
 		\advance\scr_yoffset by \dimexpr-\scr_blocminheight-\scr_linewidth\relax% \xE9paisseur de la branche du bas
-	\draw[draw=none,fill=scrcontrol](\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 "--\__/---------"
+	\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}}%
+	\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 "--\__/---------"
 	--++(\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,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth,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"
@@ -240,10 +276,10 @@
 	--(\csname toploopx\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname-\scr_corner)--cycle% remont\xE9e tout en haut et cycle
 	;%
 	\advance\scr_xoffset by -\scr_loopblockwidth
-	\draw[draw=scrcontrol!80!white](\scr_xoffset+\scr_corner,\scr_yoffset+\scr_linewidth)--++(-\scr_corner,\scr_corner)
+	\draw[draw=\scr_current_linelight](\scr_xoffset+\scr_corner,\scr_yoffset+\scr_linewidth)--++(-\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=scrcontrol!80!black](\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,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth,0)--++(-\scr_corner,-\scr_corner)--(\csname bottomifx\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomify\number\scr_loopnest\endcsname+\scr_corner);
-	\draw[draw=scrcontrol!80!white](\csname bottomifx\number\scr_loopnest\endcsname-\scr_linewidth,\csname bottomify\number\scr_loopnest\endcsname+\scr_corner)--++(\scr_corner,-\scr_corner)
+	\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,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth,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
@@ -251,7 +287,7 @@
 	\fi
 	--++(\scr_corner,-\scr_corner);
 	\edef\scr_tempname{\ifcat\relax\detokenize{#3}\relax bottomif\else bottomelse\fi}%
-	\draw[draw=scrcontrol!80!black](\csname \scr_tempname x\number\scr_loopnest\endcsname+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_loopblockwidth,\csname \scr_tempname y\number\scr_loopnest\endcsname-\scr_corner)--++(0,-\scr_loopblockheight-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)
+	\draw[draw=\scr_current_linedark](\csname \scr_tempname x\number\scr_loopnest\endcsname+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_loopblockwidth,\csname \scr_tempname y\number\scr_loopnest\endcsname-\scr_corner)--++(0,-\scr_loopblockheight-\scr_ysepsup-\scr_ysepinf+\scr_corner)--++(-\scr_corner,-\scr_corner)
 	\ifnum#4=1 %infiniteloop
 		--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*2,0)
 	\else
@@ -258,14 +294,14 @@
 		--++(-\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)
 	\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=white](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](texte){\sffamily\bfseries#1\scr_blockstrut};
 	\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=white](texte){\sffamily\bfseries\useKV[\scrname]{else word}};
-		\draw[draw=scrcontrol!80!black](\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,0)--++(-\scr_corner,-\scr_corner)% ligne Est "\ + | + /"
+		\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,0)--++(-\scr_corner,-\scr_corner)% ligne Est "\ + | + /"
 		--++(-\scr_corner*3,0)--++(-\scr_corner,\scr_corner)--++(-\scr_corner*3-\scr_linewidth,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=scrcontrol!80!white](\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
+		\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
@@ -273,8 +309,10 @@
 			\fi
 	\fi
 	\ifnum#5=1 %fleche
-		\draw[scrcontrol!80!black,line width=1.5pt,-{Triangle[length=1.25ex,width=1.5ex]},rounded corners=1pt](\scr_xoffset+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_ex*3.5+1pt,\scr_yoffset+\scr_linewidth+\scr_ysepinf-1.25pt)--++(\scr_loopblockheight,0)--++(0,\scr_loopblockheight+\scr_corner*0.5);
-		\draw[white,line width=1.5pt,-{Triangle[length=1.25ex,width=1.5ex]},rounded corners=1pt](\scr_xoffset+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_ex*3.5,\scr_yoffset+\scr_linewidth+\scr_ysepinf)--++(\scr_loopblockheight,0)--++(0,\scr_loopblockheight+\scr_corner*0.5);
+		\edef\scr_arrowcolor{\ifboolKV[\scrname]{print}{scr_flaggray}{scrcontrol}!80!black}%
+		\draw[\scr_arrowcolor,line width=1.5pt,-{Triangle[length=1.25ex,width=1.5ex]},rounded corners=1pt](\scr_xoffset+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_ex*3.5+1pt,\scr_yoffset+\scr_linewidth+\scr_ysepinf-1.25pt)--++(\scr_loopblockheight,0)--++(0,\scr_loopblockheight+\scr_corner*0.5);
+		\edef\scr_arrowcolor{\ifboolKV[\scrname]{print}{scr_flaggray}{white}}%
+		\draw[\scr_arrowcolor,line width=1.5pt,-{Triangle[length=1.25ex,width=1.5ex]},rounded corners=1pt](\scr_xoffset+\scr_xsep*2+\csname scr_txtloopwd\number\scr_loopnest\endcsname-\scr_ex*3.5,\scr_yoffset+\scr_linewidth+\scr_ysepinf)--++(\scr_loopblockheight,0)--++(0,\scr_loopblockheight+\scr_corner*0.5);
 	\fi
 	\xdef\scr_blockstop{\ifnum#4=1 1\else0\fi}%
 }
@@ -284,10 +322,15 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\scr_ovalbox#1#2{% #1=couleur remplissage et contour  #2=texte
 	\edef\scr_linewidth{\the\dimexpr\useKV[\scrname]{line width}\relax}%
+	\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}%
+	\edef\scr_current_linedark {\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\the\numexpr100-\useKV[\scrname]{contrast}\relax!black}%
+	\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
 	\begin{tikzpicture}[baseline=(x.base),x=1ex,y=1ex,inner ysep=0.25ex,inner xsep=0.1ex,line width=\scr_linewidth]
-		\node[rounded rectangle,draw=none,fill=#1,text=white](x){\sffamily\bfseries\relax#2\scr_ovalstrut};%
-		\draw[draw=#1!80!black](x.west)to[out=270,in=180](x.south west)--(x.south east)to[out=0,in=270](x.east);
-		\draw[draw=#1!80!white](x.west)to[out=90,in=180](x.north west)--(x.north east)to[out=0,in=90](x.east);
+		\node[rounded rectangle,draw=none,fill=\scr_current_fillcolor,text=\scr_current_textcolor](x){\sffamily\bfseries\relax#2\scr_ovalstrut};%
+		\draw[draw=\scr_current_linedark](x.west)to[out=270,in=180](x.south west)--(x.south east)to[out=0,in=270](x.east);
+		\draw[draw=\scr_current_linelight](x.west)to[out=90,in=180](x.north west)--(x.north east)to[out=0,in=90](x.east);
 	\end{tikzpicture}%
 }
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -294,37 +337,49 @@
 %                   dessine un triangle de s\xE9lection                   %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\scr_menuselectarrow{%
-	\tikz[baseline=-1ex,x=1ex,y=1ex,rounded corners=0pt]\draw[fill=\current_bloccolor!35!black,draw=none](0,0)--(1,0)--(0.5,-0.6)--cycle;%
+	\tikz[baseline=-1ex,x=1ex,y=1ex,rounded corners=0pt]\draw[fill=\scr_current_blockcolor!35!black,draw=none](0,0)--(1,0)--(0.5,-0.6)--cycle;%
 }
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                           dessine un menu                            %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\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]
-		\node[draw=none,inner xsep=0.2em,fill=\current_bloccolor!85!black](textmenu){\normalfont\sffamily#1\scr_ovalstrut\hskip.6666em \scr_menuselectarrow};
-		\draw[draw=\current_bloccolor!80!black,line width=0.5pt](textmenu.south west)--(textmenu.north west)--(textmenu.north east);
-		\draw[draw=\current_bloccolor!80!white,line width=0.5pt](textmenu.south west)--(textmenu.south east)--(textmenu.north east);
+	\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}%
+		\edef\scr_current_linedark {\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\the\numexpr100-\useKV[\scrname]{contrast}\relax!black}%
+		\edef\scr_current_textcolor{\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}%
+		\node[draw=none,inner xsep=0.2em,fill=\scr_current_fillcolor,text=\scr_current_textcolor](textmenu){\normalfont\sffamily#1\scr_ovalstrut\hskip.6666em \scr_menuselectarrow};
+		\draw[draw=\scr_current_linelight,line width=\scr_linewidth](textmenu.south west)--(textmenu.north west)--(textmenu.north east);
+		\draw[draw=\scr_current_linedark,line width=\scr_linewidth](textmenu.south west)--(textmenu.south east)--(textmenu.north east);
 	\end{tikzpicture}%
 }
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                          dessine un losange                          %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\scr_boolbox#1#2{%
+\def\scr_boolbox#1#2{% #1=couleur  #2=texte
 	\begingroup
 		\edef\scr_previouskern{\number\lastkern}%
 		\edef\scr_linewidth{\useKV[\scrname]{line width}}%
-		\def\current_bloccolor{#1}%
-		\setbox\scr_box\hbox{\begingroup\color{white}\bfseries\scr_ovalstrut\kern\scr_thesentinelkern sp #2\xdef\__tmpkern{\number\lastkern}\endgroup}%
-		\let\scr_endkern\__tmpkern
-		\edef\scr_totheight{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
-		\def\scr_sep{1pt}%
-		\edef\scr_retainedwd{\the\dimexpr\wd\scr_box\ifnum\scr_endkern=\scr_thesentinelkern-\scr_totheight/2+\scr_sep\fi\relax}%
-		\begin{tikzpicture}[baseline=(x.base),x=1ex,y=1ex,line width=\scr_linewidth/2]
-			\draw[draw=none,use as bounding box](\ifnum\scr_previouskern=\scr_thesentinelkern\space -\scr_sep\else -\scr_totheight/2\fi,-1pt)rectangle(\scr_retainedwd+\scr_totheight/2,\scr_totheight+1pt);
-			\draw[fill=#1,draw=none](\scr_sep,-\scr_sep)--++(\scr_retainedwd-\scr_sep*2,0)--++(\scr_totheight/2+\scr_sep,\scr_totheight/2+\scr_sep)--++(-\scr_totheight/2-\scr_sep,\scr_totheight/2+\scr_sep)--++(-\scr_retainedwd+\scr_sep*2,0)--++(-\scr_totheight/2-\scr_sep,-\scr_totheight/2-\scr_sep)--cycle;
-			\draw[#1!80!black](\scr_sep,-\scr_sep)--++(\scr_retainedwd-\scr_sep*2,0)--++(\scr_totheight/2+\scr_sep,\scr_totheight/2+\scr_sep);
-			\draw[#1!80!white](\scr_retainedwd-\scr_sep,\scr_totheight+\scr_sep)--++(-\scr_retainedwd+\scr_sep*2,0)--++(-\scr_totheight/2-\scr_sep,-\scr_totheight/2-\scr_sep);
-			\node[inner sep=0pt,outer sep=0pt,minimum size=0pt,draw=none,anchor=south west,text=white](x){\sffamily\bfseries\scr_ovalstrut\kern\scr_thesentinelkern sp #2};
+		\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}%
+		\edef\scr_current_linedark {\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}!\the\numexpr100-\useKV[\scrname]{contrast}\relax!black}%
+		\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=\scr_linewidth/2]
+			\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}%
+			\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)
+			\ifboolKV[\scrname]{print}{--(-\scr_totheight/2,\scr_totheight/2)}{};
+			\draw[\scr_current_linelight](\scr_retainedwd+\scr_totheight/2,\scr_totheight/2)--(\scr_retainedwd-\scr_boolsep,\scr_boolsep+\scr_totheight)--(\scr_boolsep,\scr_boolsep+\scr_totheight)
+			\ifboolKV[\scrname]{print}{--(-\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};%
 		\end{tikzpicture}%
 	\endgroup
 	\kern\scr_thesentinelkern sp
@@ -345,6 +400,7 @@
 	\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}}%
 	\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}}%
@@ -368,8 +424,8 @@
 \def\scr_blockmove{\scr_normalblock{scrmove}}
 \def\ovalmove{\scr_ovalbox{scrmove}}
 \def\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]
-		\node[rounded rectangle,draw=none,fill=white,text=black](x){\vphantom{0}\let\select\selectarrownum\normalfont#1};%
+	\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];}
@@ -387,6 +443,9 @@
 	\begin{tikzpicture}[inner xsep=0.2em,inner ysep=0pt,baseline=(text.base west)]
 		\node[fill=white,text=black](text){\normalfont\sffamily\strut#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); }
+			{}%
 	\end{tikzpicture}%
 }
 
@@ -431,7 +490,7 @@
 \def\scr_blockinit{\scr_initblock{screvent}}
 \definecolor{greenflag}{rgb}{0.2471,0.5529,0.0824}
 \def\greenflag{%
-	\tikz[baseline=2pt]\draw[fill=greenflag,draw=none,scale=.4,rotate=-12]
+	\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
 }
@@ -472,7 +531,6 @@
 \def\ovalmoreblocks{\scr_ovalbox{scrmoreblocksaux}}
 \def\scr_blockmoreblocks{\scr_normalblock{scrmoreblocks}}
 \def\boolmoreblocks{\scr_boolbox{scrmoreblocksaux}}
-
 \scr_restorecatcode
 \endinput
 
@@ -481,4 +539,7 @@
 | Version |    Date    | Changements                                          |
 |-----------------------------------------------------------------------------|
 |   0.1   | 16/05/2017 | Premi\xE8re version                                     |
+|-----------------------------------------------------------------------------|
+|   0.2   | 27/05/2017 | Ajout des options "constast" et print ainsi que      |
+|         |            | les options relatives \xE0 "print"                      |
 |-----------------------------------------------------------------------------|
\ No newline at end of file



More information about the tex-live-commits mailing list