texlive[52250] Master/texmf-dist: scratch3 (1oct19)
commits+karl at tug.org
commits+karl at tug.org
Tue Oct 1 23:20:30 CEST 2019
Revision: 52250
http://tug.org/svn/texlive?view=revision&revision=52250
Author: karl
Date: 2019-10-01 23:20:30 +0200 (Tue, 01 Oct 2019)
Log Message:
-----------
scratch3 (1oct19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/scratch3/README
trunk/Master/texmf-dist/doc/latex/scratch3/scratch3-fr.pdf
trunk/Master/texmf-dist/doc/latex/scratch3/scratch3-fr.tex
trunk/Master/texmf-dist/tex/latex/scratch3/scratch3.sty
Modified: trunk/Master/texmf-dist/doc/latex/scratch3/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scratch3/README 2019-10-01 21:20:16 UTC (rev 52249)
+++ trunk/Master/texmf-dist/doc/latex/scratch3/README 2019-10-01 21:20:30 UTC (rev 52250)
@@ -3,9 +3,9 @@
L'extension
scratch3
- v0.13
+ v0.14
- 1er juillet 2019
+ 1er octobre 2019
___________________________________
Author : Christian Tellechea
Modified: trunk/Master/texmf-dist/doc/latex/scratch3/scratch3-fr.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/scratch3/scratch3-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scratch3/scratch3-fr.tex 2019-10-01 21:20:16 UTC (rev 52249)
+++ trunk/Master/texmf-dist/doc/latex/scratch3/scratch3-fr.tex 2019-10-01 21:20:30 UTC (rev 52250)
@@ -320,6 +320,14 @@
Un autre : \booloperator{\booloperator{\ovalvariable{varx} > \ovalnum{1}}
et \booloperator{\ovalvariable{varx} < \ovalnum{5}}}./
+La macro \verb|\boolempty[<dimension>]| permet de tracer un losange vide. L'argument optionnel est une \verb|<dimension>| qui vaut \verb|2em| par d\xE9faut.
+
+\exemple/\begin{scratch}
+ \blockifelse{si \boolempty[3em] alors}
+ {\blocklook{dire \ovalnum{le test est vrai}}}
+ {\blocklook{dire \ovalnum{le test est faux}}}
+\end{scratch}/
+
\section{Les blocs de fin}
Ces blocs sont susceptibles de clore un algorithme et n'ont donc pas d'encoche m\xE2le dans leur partie basse. Ils ne peuvent \xEAtre que du type \suffixe{control} et sont dessin\xE9s avec la macro \verb|\blockstop{<texte>}|
@@ -437,6 +445,12 @@
\cleval{scale}{coefficient}\label{cle-scale}
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].
+Les blocs ovales ou losanges, qui peuvent se trouver \xE0 l'ext\xE9rieur de l'environnement scrtach, sont affect\xE9s par la valeur de \texttt{scale} :
+
+\exemple/\setscratch{scale=1}\xC9chelle 1 : \ovalvariable{var} et \booloperator{\ovalmove{abscisse x} < \ovalnum{7}}\par
+\xC9chelle 0.75 :\setscratch{scale=.75} : \ovalvariable{var} et \booloperator{\ovalmove{abscisse x} < \ovalnum{7}}\par
+\xC9chelle 1.25 :\setscratch{scale=1.25} : \ovalvariable{var} et \booloperator{\ovalmove{abscisse x} < \ovalnum{7}}/
+
\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. La valeur est ramen\xE9e si n\xE9cessaire dans l'intervalle [20 ; 40].
@@ -579,7 +593,7 @@
\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.
+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 autant \xE0 ma programmation hasardeuse 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 \xE0 \texttt{unbonpetit at netc.fr}
@@ -595,7 +609,13 @@
>Correction d'un bug dans \verb|\ovalnum|;
>Correction d'un bug dans \verb|\scr_ovalbox|.
\end{version}
-\begin{version}{0.12}{01/07/2019}
+\begin{version}{0.13}{01/07/2019}
>Mise en place de \verb|\relax| pour \xE9viter le bug de \verb|\lastkern| avec Xe\LaTeX.
\end{version}
+\begin{version}{0.14}{01/10/2019}
+ >Gestion de l'\xE9chelle (via cl\xE9 "\texttt{scale}") am\xE9lior\xE9e.
+ >Hors de l'environnement, les ovales et les losanges sont affect\xE9s par la cl\xE9 "\texttt{scale}" si elle est sp\xE9cifi\xE9e via \verb|\setscratch|.
+ >Erreur de trac\xE9 corrig\xE9e dans \verb|\scr_blockloop|.
+ >Nouveau losange vide : \verb|\boolempty[<dimension>]|.
+\end{version}
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/scratch3/scratch3.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/scratch3/scratch3.sty 2019-10-01 21:20:16 UTC (rev 52249)
+++ trunk/Master/texmf-dist/tex/latex/scratch3/scratch3.sty 2019-10-01 21:20:30 UTC (rev 52250)
@@ -1,3 +1,4 @@
+% !BIB TS-program =
% !TeX encoding = ISO-8859-1
% Ce fichier contient le code de l'extension "scratch3"
%
@@ -4,9 +5,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
\def\scrname{ scratch3 }%
-\def\scrver { 0.13 }%
+\def\scrver { 0.14 }%
% %
-\def\scrdate{ 2019/07/01 }%
+\def\scrdate{ 2019/10/01 }%
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -19,7 +20,7 @@
% Repository : https://framagit.org/unbonpetit/scratch3/tree/master
% Copyright : Christian Tellechea 2019
% Licence : Released under the LaTeX Project Public License v1.3c
-% or later, see http://www.latex-project.org/lppl.txt
+% or later, see http://www.latex-project.org/lppl.txtf
% Files : 1) scratch3.sty
% 2) scratch3-fr.tex
% 3) scratch3-fr.pdf
@@ -70,7 +71,12 @@
num start = 1 ,% num\xE9ro de d\xE9part
baseline = 1 ,% alignement sur le 1er bloc (en partant du haut)
}
-\newcommand*\numblock[1]{\color{black}\footnotesize\bfseries#1}
+\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}
@@ -111,6 +117,8 @@
\fi
\fi
}
+\newif\if_inpicture
+\_inpicturefalse
\newcount\scr_loopnest
\newcount\scr_blocknum
\newbox \scr_box
@@ -135,6 +143,7 @@
\kern.6em
\fi
\useKV[\scrname]{pre text}%
+ \_inpicturetrue
#2%
\scr_blockstrut
}%
@@ -147,16 +156,27 @@
\edef\scr_boxht{\the\ht\scr_box}%
\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
\draw[
- draw={\ifboolKV[\scrname]{print}{scr_linegray!\scr_contrast!black}{#1dd}},
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray!\scr_contrast!black}
+ {#1dd}
+ },
line width=\scr_linewidth,
- rounded corners=0.4*\scr_ex,
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{#1}},
+ rounded corners=0.4*\scr_ex*\scr_scale,
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray}
+ {none}%
+ }
+ {#1}%
+ },
yshift=\scr_yoffset,
xshift=\scr_xoffset
]
(0,0)--++(0.66666*\scr_notch,0)--++(\scr_corner,-\scr_corner)--++(\scr_notch,0)--++(\scr_corner,\scr_corner)--++(\scr_boxwd+2*\scr_xsep-\scr_corner*2-\scr_notch*1.66666,0)% ligne sup
--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner)% ligne est
- --++(-\scr_boxwd-2*\scr_xsep+\scr_corner*2+\scr_notch*1.66666,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-0.66666*\scr_notch,0)% logne sud
+ --++(-\scr_boxwd-2*\scr_xsep+\scr_corner*2+\scr_notch*1.66666,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-0.66666*\scr_notch,0)% ligne sud
--cycle;
\node[
at=(origin),
@@ -164,7 +184,11 @@
anchor=base west,
xshift=\scr_xoffset+\scr_xsep,
yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(txt\number\scr_blocknum)
{\scr_currentstuff};
@@ -205,10 +229,21 @@
\edef\scr_boxht{\the\ht\scr_box}%
\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
\draw[
- draw={\ifboolKV[\scrname]{print}{scr_linegray!\scr_contrast!black}{\scr_current_blockcolor dd}},
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray!\scr_contrast!black}
+ {\scr_current_blockcolor dd}%
+ },
line width=\scr_linewidth,
- rounded corners=0.4*\scr_ex,
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}},
+ rounded corners=0.4*\scr_ex*\scr_scale,
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray}
+ {none}%
+ }
+ {\scr_current_blockcolor}%
+ },
yshift=\scr_yoffset,
xshift=\scr_xoffset
]
@@ -220,7 +255,11 @@
anchor=base west,
xshift=\scr_xoffset+\scr_xsep,
yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(txt\number\scr_blocknum)
{\scr_currentstuff};
@@ -247,6 +286,7 @@
\def\scr_current_blockcolor{#1}%
\def\scr_currentstuff{%
\useKV[\scrname]{pre text}%
+ \_inpicturetrue
#2%
\scr_blockstrut
}%
@@ -259,10 +299,21 @@
\edef\scr_boxht{\the\ht\scr_box}%
\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
\draw[
- draw={\ifboolKV[\scrname]{print}{scr_linegray!\scr_contrast!black}{#1dd}},
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray!\scr_contrast!black}
+ {#1dd}%
+ },
line width=\scr_linewidth,
- rounded corners=0.4*\scr_ex,
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}},
+ rounded corners=0.4*\scr_ex*\scr_scale,
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray}
+ {none}%
+ }
+ {\scr_current_blockcolor}%
+ },
yshift=\scr_yoffset,
xshift=\scr_xoffset
]
@@ -275,7 +326,11 @@
anchor=base west,
xshift=\scr_xoffset+\scr_xsep,
yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(txt\number\scr_blocknum)
{\scr_currentstuff};
@@ -301,6 +356,7 @@
\newcommand*\initmoreblocks[1]{%
\def\scr_currentstuff{%
\useKV[\scrname]{pre text}%
+ \_inpicturetrue
#1%
\scr_blockstrut
}%
@@ -314,14 +370,25 @@
\edef\scr_totht{\the\dimexpr\ht\scr_box+\dp\scr_box\relax}%
\def\scr_current_blockcolor{scrmoreblocks}%
\draw[
- draw={\ifboolKV[\scrname]{print}{scr_linegray!\scr_contrast!black}{\scr_current_blockcolor dd}},
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}},
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray!\scr_contrast!black}
+ {\scr_current_blockcolor dd}%
+ },
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray}
+ {none}%
+ }
+ {\scr_current_blockcolor}%
+ },
yshift=\scr_yoffset,
xshift=\scr_xoffset,
- rounded corners=0.4*\scr_ex
+ rounded corners=0.4*\scr_ex*\scr_scale
]
- (0,-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner)[rounded corners=2*\scr_ex]--(0,0)--(\scr_boxwd+2*\scr_xsep,0)% ligne sup
- [rounded corners=0.4*\scr_ex]--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner)% ligne est
+ (0,-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner)[rounded corners=2*\scr_ex*\scr_scale]--(0,0)--(\scr_boxwd+2*\scr_xsep,0)% ligne sup
+ [rounded corners=0.4*\scr_ex*\scr_scale]--++(0,-\scr_totht-\scr_ysepsup-\scr_ysepinf-\scr_corner)% ligne est
--++(-\scr_boxwd-2*\scr_xsep+\scr_corner*2+\scr_notch*1.66666,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-.66666*\scr_notch,0)% ligne sud
--cycle
node[
@@ -330,7 +397,11 @@
anchor=base west,
xshift=\scr_xoffset+\scr_xsep,
yshift=\scr_yoffset-\scr_boxht-\scr_corner-\scr_ysepsup,
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(txt\number\scr_blocknum)
{\scr_currentstuff};
@@ -370,6 +441,7 @@
\setbox\scr_box\hbox{%
\pgfinterruptpicture
\useKV[\scrname]{pre text}%
+ \_inpicturetrue
#1%
\scr_blockstrut
\endpgfinterruptpicture
@@ -435,8 +507,15 @@
\draw[
draw=\scr_current_linecolor,
line width=\scr_linewidth,
- rounded corners=0.4*\scr_ex,
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}}
+ rounded corners=0.4*\scr_ex*\scr_scale,
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray}
+ {none}%
+ }
+ {\scr_current_blockcolor}%
+ }
]
(\csname toploopx\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname)--++(0.66666*\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*2-\scr_notch*1.66666,0)% ligne sup
--++(0,-\csname scr_txtlooptotht\number\scr_loopnest\endcsname-\scr_ysepsup-\scr_ysepinf-\scr_corner)% ligne est "|"
@@ -463,7 +542,7 @@
\else
--++(-\csname scr_txtloopwd\number\scr_loopnest\endcsname-2*\scr_xsep+\scr_corner*2+\scr_notch*1.66666,0)--++(-\scr_corner,-\scr_corner)--++(-\scr_notch,0)--++(-\scr_corner,\scr_corner)--++(-.66666*\scr_notch,0)% ligne Sud "\--\__/---------"
\fi
- --(\csname toploopx\number\scr_loopnest\endcsname,\csname toploopy\number\scr_loopnest\endcsname-\scr_corner)--cycle;% remont\xE9e tout en haut et cycle
+ --cycle;% remont\xE9e tout en haut et cycle ## bugfix 0.14
\advance\scr_xoffset\dimexpr-\scr_loopblockwidth\relax
\csname scr_numblockif\number\scr_loopnest\endcsname% num\xE9rote ou pas le texte dans le bandeau du haut
\node[
@@ -472,10 +551,19 @@
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={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(txt\csname blocnum\number\scr_loopnest\endcsname)
- {\useKV[\scrname]{pre text}#1\scr_blockstrut};
+ {%
+ \useKV[\scrname]{pre text}%
+ \_inpicturetrue
+ #1%
+ \scr_blockstrut
+ };
\ifcat\relax\detokenize{#3}\relax\else
\node[
at=(origin),
@@ -483,10 +571,17 @@
anchor=base west,
xshift=\csname toploopx\number\scr_loopnest\endcsname+\scr_xsep,
yshift=\csname bottomify\number\scr_loopnest\endcsname-\scr_loopblockheight-\scr_corner,
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(txt\csname blocelsenum\number\scr_loopnest\endcsname)
- {\useKV[\scrname]{pre text}\useKV[\scrname]{else word}};
+ {%
+ \useKV[\scrname]{pre text}%
+ \useKV[\scrname]{else word}%
+ };
\csname scr_numblockelse\number\scr_loopnest\endcsname% num\xE9rotation bloc else ou pas
\fi
\ifnum#5=1 %fleche
@@ -495,7 +590,7 @@
\scr_arrowcolor,
line width=1.5pt,
-{Triangle[length=\scr_scale*1.25ex,width=\scr_scale*1.5ex]},
- rounded corners=1pt
+ rounded corners=1pt*\scr_scale
]
(\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}}% colmeur de la fl\xE8che
@@ -503,7 +598,7 @@
\scr_arrowcolor,
line width=\scr_scale*1.5pt,
-{Triangle[length=\scr_scale*1.25ex,width=\scr_scale*1.5ex]},
- rounded corners=1pt
+ rounded corners=1pt*\scr_scale
]
(\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
@@ -525,6 +620,7 @@
\scr_normalizedec\scr_contrast contrast[0,100]%
\edef\scr_contrast{\number\numexpr100-\scr_contrast}%
\fi
+ \if_inpicture\def\scr_scale{1}\else\scr_normalizedec\scr_scale scale[0.2,5]\fi
\begin{tikzpicture}[
baseline=(x.base),
x=1ex,
@@ -531,18 +627,38 @@
y=1ex,
inner ysep=0.25ex,
inner xsep=0.1ex,
- line width={\the\dimexpr\useKV[\scrname]{line width}\relax}
+ line width={\the\dimexpr\useKV[\scrname]{line width}\relax},
+ scale=\scr_scale,
+ every node/.style={scale=\scr_scale}
]
\node[
line width={\the\dimexpr\useKV[\scrname]{line width}\relax},
rounded rectangle,
- draw={\ifboolKV[\scrname]{print}{scr_linegray!\scr_contrast!black}{#2dd}},
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray\if1#1!85!black\fi}{none}}{\scr_current_blockcolor\if1#1d\fi}},
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray!\scr_contrast!black}
+ {#2dd}%
+ },
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray\if1#1!85!black\fi}
+ {none}%
+ }
+ {\scr_current_blockcolor\if1#1d\fi}%
+ },
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(x)
{%
- \useKV[\scrname]{pre text}\relax\scr_ovalstrut\kern\scr_ovalsentinel sp
+ \useKV[\scrname]{pre text}\relax
+ \scr_ovalstrut
+ \kern\scr_ovalsentinel sp
+ \_inpicturetrue
#3%
\relax% pour contourner bug dans XeLaTeX
\if1#1% si triangle de s\xE9lection
@@ -565,7 +681,7 @@
baseline=-1ex,
x=1.5ex,
y=1.5ex,
- rounded corners=1.5pt
+ rounded corners=1.5pt*\scr_scale
]
\draw[
fill=white,
@@ -577,24 +693,43 @@
% dessine un menu %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*\selectmenu[1]{% #1=texte du menu (sera compos\xE9 et suivi du triangle de s\xE9lection)
+ \if_inpicture\def\scr_scale{1}\else\scr_normalizedec\scr_scale scale[0.2,5]\fi
\begin{tikzpicture}[
anchor=base west,
baseline=(textmenu.base west),
outer sep=0pt,
inner sep=0pt,
- minimum size=0pt
+ minimum size=0pt,
+ scale=\scr_scale,
+ every node/.style={scale=\scr_scale}
]
\node[
rectangle,
- rounded corners=1.5pt,
- draw={\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor dd}},
+ rounded corners=1.5pt*\scr_scale,
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray}
+ {\scr_current_blockcolor dd}%
+ },
inner sep=0.2em,
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray!85!black}{none}}{\scr_current_blockcolor}},
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray!85!black}
+ {none}%
+ }
+ {\scr_current_blockcolor}%
+ },
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(textmenu)
{%
\useKV[\scrname]{pre text}%
+ \_inpicturetrue
#1%
\scr_ovalstrut
\hskip.6666em
@@ -613,6 +748,7 @@
\edef\_{\the\dimexpr.53033\dimexpr \scr_linewidth\relax\relax}%
\def\scr_current_blockcolor{#1}%
\edef\scr_boolsep{\useKV[\scrname]{bool sep}}%
+ \if_inpicture\def\scr_scale{1}\else\scr_normalizedec\scr_scale scale[0.2,5]\fi
\begin{tikzpicture}[
inner sep=0pt,
outer sep=0pt,
@@ -619,7 +755,9 @@
minimum size=0pt,
baseline=(x.base),
line width=\scr_linewidth,
- rounded corners=0pt% BUGFIX 0.11
+ rounded corners=0pt,% BUGFIX 0.11
+ scale=\scr_scale,
+ every node/.style={scale=\scr_scale}
]
\setbox\scr_box\hbox{%
\pgfinterruptpicture
@@ -626,7 +764,12 @@
\useKV[\scrname]{pre text}%
\scr_ovalstrut
\kern\scr_boolsentinel sp
- #2%
+ \_inpicturetrue
+ \if_boolempty
+ \vrule width#2 height0pt depth0pt\relax
+ \else
+ #2%
+ \fi
\xdef\scr_endkern{\number\lastkern}%
\endpgfinterruptpicture
}%
@@ -638,8 +781,19 @@
]
(\ifnum\scr_previouskern=\scr_boolsentinel-\scr_boolsep*.41421\else -\scr_totheight/2\fi,-\scr_boolsep)rectangle(\scr_retainedwd+\scr_totheight/2,\scr_totheight+\scr_boolsep);%
\draw[
- fill={\ifboolKV[\scrname]{print}{\ifboolKV[\scrname]{fill blocks}{scr_fillgray}{none}}{\scr_current_blockcolor}},
- draw={\ifboolKV[\scrname]{print}{scr_linegray}{#1dd}}
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {\ifboolKV[\scrname]{fill blocks}
+ {scr_fillgray\if_boolempty!85!black\fi}
+ {none}%
+ }
+ {\scr_current_blockcolor}%
+ },
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray}
+ {#1dd}%
+ }
]
(\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;%
\node[
@@ -648,7 +802,11 @@
minimum size=0pt,
draw=none,
anchor=south west,
- text={\ifboolKV[\scrname]{print}{\useKV[\scrname]{text color}}{white}}
+ text={%
+ \ifboolKV[\scrname]{print}
+ {\useKV[\scrname]{text color}}
+ {white}%
+ }
]
(x)
{%
@@ -656,11 +814,17 @@
\scr_ovalstrut
\kern\_%
\kern\scr_boolsentinel sp
- #2%
+ \_inpicturetrue
+ \if_boolempty
+ \vrule width#2 height0pt depth0pt\relax
+ \else
+ #2%
+ \fi
\kern\_%
};%
\end{tikzpicture}%
\endgroup
+ \_boolemptyfalse
\kern\scr_boolsentinel sp
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -704,6 +868,9 @@
\definecolor{penline} {HTML}{595e73}%
\definecolor{penblue} {HTML}{4c8eea}%
\definecolor{penvline} {HTML}{0da57a}%
+\definecolor{boolempty} {HTML}{cf8b17}% new 0.14
+\definecolor{boolemptyd} {HTML}{cf8b17}% new 0.14
+\definecolor{boolemptydd} {HTML}{cf8b17}% new 0.14
\newenvironment{scratch}[1][]
{\skv_ifempty{#1}{}{\setscratch{#1}}%
@@ -710,19 +877,19 @@
\sffamily
\edef\scr_ex{\the\dimexpr1ex\relax}% valeur d'1ex pour le trac\xE9 de la fl\xE8che
\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]%
- \scr_normalizedim\scr_numsep num sep[0pt,\scr_em*3/2]%
- \scr_normalizedec\scr_contrast contrast[0,100]%
+ \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]%
+ \scr_normalizedim\scr_numsep num sep [0pt,\scr_em*3/2]%
+ \scr_normalizedec\scr_contrast contrast [0,100]%
\edef\scr_contrast{\number\numexpr100-\scr_contrast}%
\edef\scr_minwd{\the\dimexpr\scr_corner*4+\scr_notch*3-\scr_xsep*2}%
\edef\scr_valign{\useKV[\scrname]{baseline}}%
@@ -729,15 +896,23 @@
\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
- \let\namemoreblocks\scr_namemoreblocks
+ \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
+ \let\namemoreblocks \scr_namemoreblocks
\scr_xoffset0pt \scr_yoffset0pt
\catcode`\:12 \catcode`\;12 \catcode`\!12 \catcode`\?12 \catcode`\_12
\csname skv_\if c\expandafter\scr_firsttonil\scr_valign c\_nil first\else second\fi\endcsname
@@ -750,19 +925,21 @@
\begin{tikzpicture}[
baseline=(txt\scr_valign.base),
}%
- transform shape,
+ scale=\scr_scale,
+ every node/.style={scale=\scr_scale},
line width=\scr_linewidth,
inner sep=0pt,
outer sep=0pt,
minimum size=0pt,
- line cap=round,
- scale=\scr_scale
+ line cap=round
]
+ \_inpicturetrue
\node[shape=coordinate](origin){};% origine
}%
{%
\end{tikzpicture}%
\scr_scratchend
+ \_inpicturefalse% par pure s\xE9curit\xE9
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -786,6 +963,7 @@
\else
\def\scr_current_blockcolor{black}%
\fi
+ \if_inpicture\def\scr_scale{1}\else\scr_normalizedec\scr_scale scale[0.2,5]\fi
\begin{tikzpicture}[
baseline=(x.base),
x=1ex,
@@ -792,12 +970,18 @@
y=1ex,
inner ysep=0.25ex,
inner xsep=0.1ex,
- line width=\scr_linewidth
+ line width=\scr_linewidth,
+ scale=\scr_scale,
+ every node/.style={scale=\scr_scale}
]
\node[
line width=\scr_linewidth,
rounded rectangle,
- draw={\ifboolKV[\scrname]{print}{scr_linegray}{\scr_current_blockcolor}},
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray}
+ {\scr_current_blockcolor}%
+ },
fill=white,
text=black
]
@@ -806,6 +990,7 @@
\useKV[\scrname]{pre text}\relax
\scr_ovalstrut
\kern\scr_ovalsentinel sp
+ \_inpicturetrue
#1%
\relax% pour contourner bug dans XeLaTeX
\ifnum\lastkern=\scr_ovalsentinel\relax\expandafter\scr_execfirst\else\expandafter\scr_execsecond\fi
@@ -818,7 +1003,10 @@
\endgroup
\kern\scr_ovalsentinel sp
}
-\def\turn_arrow#1{\tikz[baseline=.25ex,x=6.5ex,y=6.5ex,#1]\draw[-{Triangle[angle=45:0.5ex 0.5ex,flex]},line width=.3333ex](0,0) arc[start angle=-80,end angle=190,radius=1ex];}
+\def\turn_arrow#1{%
+ \tikz[baseline=.25ex,x=6.5ex,y=6.5ex,#1]
+ \draw[-{Triangle[angle=45:0.5ex 0.5ex,flex]},line width=.3333ex](0,0) arc[start angle=-80,end angle=190,radius=1ex];%
+}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% menu apparence %
@@ -847,7 +1035,7 @@
\def\scr_drawpen{% dessin du crayon
\begin{tikzpicture}[
rotate=45,
- rounded corners=.4pt,
+ rounded corners=.4pt*\scr_scale,
line width=.5pt,
x=5ex,
y=5ex,
@@ -858,19 +1046,27 @@
]
\draw[
penline,
- fill={\ifboolKV[\scrname]{print}{scr_linegray}{penblue}}
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray}
+ {penblue}%
+ }
]
(0,0)--(22:0.1)..controls(0.13,0.04)and(0.13,-0.04)..(-22:0.1)[sharp corners]--cycle;
\draw[
penline,
fill=white,
- rounded corners=.2pt
+ rounded corners=.2pt*\scr_scale
]
- (22:0.1)--(22:0.2)[rounded corners=0.05pt]--(.56,.07492)..controls(.62,0.04)and(.62,-0.04)..(.56,-.07492)[rounded corners=2pt]--(-22:.2)[rounded corners=0.05pt]--(-22:0.1)..controls(0.13,-0.04)and(0.13,0.04)..(22:0.1);
+ (22:0.1)--(22:0.2)[rounded corners=0.05pt*\scr_scale]--(.56,.07492)..controls(.62,0.04)and(.62,-0.04)..(.56,-.07492)[rounded corners=2pt*\scr_scale]--(-22:.2)[rounded corners=0.05pt*\scr_scale]--(-22:0.1)..controls(0.13,-0.04)and(0.13,0.04)..(22:0.1);
\draw[
penline,
- fill={\ifboolKV[\scrname]{print}{scr_linegray}{penblue}},
- rounded corners=.2pt
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {scr_linegray}
+ {penblue}%
+ },
+ rounded corners=.2pt*\scr_scale
]
(.56,.07492)--(.88,.07492)..controls(.92,0.04)and(.92,-0.04)..(0.88,-.07492)[sharp corners]--(.56,-.07492)..controls(.62,-0.04)and(.62,0.04)..cycle;
\draw[penline](.84,0.07492)..controls(.7,.24)and(.58,0.02)..(.5,0.16);
@@ -923,7 +1119,9 @@
}%
}
\newcommand*\boollist{\scr_boolbox{scrlist}}
-
+\newif\if_boolempty
+\_boolemptyfalse
+\newcommand*\boolempty[1][2em]{\_boolemptytrue\scr_boolbox{boolempty}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% menu \xE9v\xE9nement %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -938,8 +1136,16 @@
]
\draw[
line width=\scr_linewidth,
- draw={\ifboolKV[\scrname]{print}{scr_flaggray}{flagcontour}},
- fill={\ifboolKV[\scrname]{print}{scr_flaggray!85!white}{greenflag}}
+ draw={%
+ \ifboolKV[\scrname]{print}
+ {scr_flaggray}
+ {flagcontour}%
+ },
+ fill={%
+ \ifboolKV[\scrname]{print}
+ {scr_flaggray!85!white}
+ {greenflag}%
+ }
]
(0,0.95)..controls(.4,1.4) and (.7,.7)..(1,1)--(1,.4)..controls(.7,0.1)and(.4,.8)..(0,.4)--cycle;
\filldraw[{\ifboolKV[\scrname]{print}{scr_flaggray}{flagcontour}}]
@@ -1017,4 +1223,12 @@
| | | * bug corrig\xE9 dans \scr_ovalbox |
|---------+------------+------------------------------------------------------|
| 0.13 | 01/07/2019 | * \relax ajout\xE9s pour \xE9viter le bug de XeLaTeX |
-| | | concernant \lastkern |
\ No newline at end of file
+| | | concernant \lastkern |
+|---------+------------+------------------------------------------------------|
+| 0.14 | 01/10/2019 | * gestion de l'\xE9chelle (via cl\xE9 "scale") am\xE9lior\xE9e |
+| | | * hors de l'environnement, les ovales et les losanges|
+| | | sont affect\xE9s par la cl\xE9 scale si elle est |
+| | | sp\xE9cifi\xE9e via \setscratch |
+| | | * erreur de trac\xE9 corrig\xE9e dans \scr_blockloop |
+| | | * nouveau losange vide : \boolempty[<dimension>] |
+|---------+------------+------------------------------------------------------|
\ No newline at end of file
More information about the tex-live-commits
mailing list