texlive[74869] Master/texmf-dist: customenvs (6apr25)
commits+karl at tug.org
commits+karl at tug.org
Mon Apr 7 21:47:27 CEST 2025
Revision: 74869
https://tug.org/svn/texlive?view=revision&revision=74869
Author: karl
Date: 2025-04-07 21:47:26 +0200 (Mon, 07 Apr 2025)
Log Message:
-----------
customenvs (6apr25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.pdf
trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex
trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.pdf
trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex
trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex 2025-04-07 19:47:17 UTC (rev 74868)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex 2025-04-07 19:47:26 UTC (rev 74869)
@@ -34,13 +34,14 @@
\usepackage[margin=1.5cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.3.1}
-\def\TPdate{13/02/2025}
+\def\TPversion{0.3.3}
+\def\TPdate{07/04/2025}
\usepackage{tcolorbox}
\sethlcolor{lightgray!25}
\NewDocumentCommand\MontreCode{ m }{%
\hl{\vphantom{\texttt{pf}}\texttt{#1}}%
}
+\usepackage[auto]{contour}
\usepackage{babel}
@@ -111,6 +112,10 @@
\section{History}
+\verb|v0.3.3|~:~~~Annotate image
+
+\verb|v0.3.2|~:~~~Alt version of title banner
+
\verb|v0.3.1|~:~~~Box for MCQ
\verb|v0.3.0|~:~~~Bugfix with \textsf{beamer}
@@ -603,7 +608,7 @@
\end{codehigh}
\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25]
-\tkzBannerTri{01}{Titre du document}
+\tkzBannerTri{01}{Title of document}
\end{demohigh}
Available \MontreCode{keys} are :
@@ -624,6 +629,7 @@
\item \MontreCode{dispblock} (\MontreCode{true} by default)
\item \MontreCode{num} (\MontreCode{true} by default)
\item \MontreCode{customtype}
+ \item \MontreCode{custommulti} (\MontreCode{false} by default)
\end{itemize}
\subsection{Examples}
@@ -658,7 +664,11 @@
{7}{My doc}
\end{demohigh}
-It's possible to redefine \MontreCode{\textbackslash part} (for example).
+\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25]
+\tkzBannerTriAlt
+ [maincolor=violet,type=UE3.1,blockwidth=1.25cm,logo=\faGraduationCap,height=1.25cm]
+ {TP}{My doc}
+\end{demohigh}
\pagebreak
@@ -854,4 +864,41 @@
\tkzspeedometer[Size=5cm,Mark=2.25,Colors=teal/magenta]{6}
\end{demohigh}
+\subsection{Annotate an image}
+
+The idea is to provide a way of annotating an image, using an environment and a command which are linked to \TikZ.
+
+\begin{codehigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25]
+\begin{imgannotate}[keys][includegraphics options]{imagefile with extension}
+ \puttxtonimg[tikz node options]{coordinates}{txt}
+ \puttxtonimg*[tikz node options]{coordinates within percentage}{txt}
+\end{imgannotate}
+%====keys
+%clip=... : boolean for clipping img
+%node=... : node name for reusing (remember picture)
+%grid=... : optionnal value for showing helping grid
+%subgrid=... : integer value for subgrid
+%gridcolor=...: grid color
+\end{codehigh}
+
+\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25]
+%\usepackage[auto,outline]{contour}
+\begin{imgannotate}[grid=1][height=4cm]{example-image.png}
+ \puttxtonimg[scale=5,rotate=30]
+ {1,1}{\contourlength{0.05em}\color{white}\contour{black}{$\pi$}}
+ \puttxtonimg*[scale=1.5,rotate=-15]
+ {0.66,0.75}{\contourlength{0.025em}\color{violet}\contour{yellow}{Pythagore}}
+\end{imgannotate}
+\end{demohigh}
+
+\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25]
+\begin{imgannotate}[node=IMGTEST][height=5cm]<rotate=10>{example-image-golden.pdf}
+ %tikz usual commands
+ \draw (IMGTEST.center) node[above=5mm,font=\Huge\ttfamily\bfseries,text=blue] {TEST1} ;
+ \draw (IMGTEST.north west) node[draw,thick,red,inner sep=0.5mm,below right=2.5mm,font=\LARGE\sffamily\bfseries,text=red] {TEST2} ;
+\end{imgannotate}
+\end{demohigh}
+
+
+
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex 2025-04-07 19:47:17 UTC (rev 74868)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex 2025-04-07 19:47:26 UTC (rev 74869)
@@ -39,8 +39,8 @@
\usepackage[margin=1.5cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.3.1}
-\def\TPdate{13 février 2025}
+\def\TPversion{0.3.3}
+\def\TPdate{7 avril 2025}
\usepackage{tcolorbox}
\tcbuselibrary{listingsutf8}
%\usepackage{eurosym}
@@ -69,10 +69,10 @@
keywordstyle={\color{violet}},%
classoffset=2,%
alsoletter={-},%
- morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences,\CrayonDeCompetences,\StyleEnvtExo,\StyleEnvtExoDefaut,\TitreExo,\ipsum,EnvSMS,\SMSrec,\SMSenv,BoiteSimple,\SujetTitreExo,\CircledNumber,\AffVignette,\BoiteArrondie,\ChangerDisplaySkip,\celcouleur,\celfusion,\lignetxt,\colonnetxt,\celnumbreak,\celtxt,\BandeauScore,\InsererImage,\tkzBannerTri,\NiveauDiffExos,\tkzEtoiles,\tkzGrilleAuto,\tkzAutoGridLocal,\tkzAutoGridActivate,\tkzFlecheEvasee,PanneauAutoroute,\AfficheSoldes,\tbcmarker,\VilleDist,\RoueNiveaux,EnvRoueNiveaux,\PlacerIconeNiveau,\PlacerIconesNiveaux,\MiniCompteurNiveaux,\tkzspeedometer},%
+ morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences,\CrayonDeCompetences,\StyleEnvtExo,\StyleEnvtExoDefaut,\TitreExo,\ipsum,EnvSMS,\SMSrec,\SMSenv,BoiteSimple,\SujetTitreExo,\CircledNumber,\AffVignette,\BoiteArrondie,\ChangerDisplaySkip,\celcouleur,\celfusion,\lignetxt,\colonnetxt,\celnumbreak,\celtxt,\BandeauScore,\InsererImage,\tkzBannerTri,\tkzBannerTriAlt,\NiveauDiffExos,\tkzEtoiles,\tkzGrilleAuto,\tkzAutoGridLocal,\tkzAutoGridActivate,\tkzFlecheEvasee,PanneauAutoroute,\AfficheSoldes,\tbcmarker,\VilleDist,\RoueNiveaux,EnvRoueNiveaux,\PlacerIconeNiveau,\PlacerIconesNiveaux,\MiniCompteurNiveaux,\tkzspeedometer,AnnoterImage,\PlacerTxtSurImg},%
keywordstyle={\color{green!50!black}},%
classoffset=3,%
- morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,Melange,PoliceLabels,EspaceLabels,Swap,Type,CoeffEspVert,EpTrait,Alea,LargeurNivs,Niveaux,NoticeNiveaux,Titre,PolTitre,PolNotice,PolComp,LigneSep,CouleurNotice,CouleurNiveaux,CouleurFond,Note,Notice,PoliceCateg,PoliceBloc,Couleurs,LargeurBloc,Echelle,NoirBlanc,Libelle,EpTrait,Police,Type,ComplementTitre,Titre,CodeDebut,Couleur,EchelleImage,Decoration,Trait,Avatar,AffAvatar,NoirBlanc,CouleurE,CouleurR,CouleurFond,Hauteur,Largeur,PoliceTxt,CouleurTitre,AlignH,bg,txt,bthick,bcol,raise,Type,EspH,Fond,Texte,Style,Dense,Avant,AvantS,Apres,ApresS,Global,align,width,Legende,CouleurFond,Hauteur,Ratio,AffLegende,Couleurs,EchelleSymboles,Symboles,vRemplir,vOffset,vCentrer,height,width,blockwidth,collight,colmedium,coldar,coltxt,fonttxt,swap,maincolor,logo,type,num,dispblock,customtype,Couleur,AlignV,Offset,NiveauMax,pasX,pasY,grilleauto,TailleFleche,Direction,Coeff,TypeFleche,Deplacement,LineCap,Epaisseur,CouleurCartouche,Fleches,CouleurFond,CouleurTitre,PoliceCartouche,TypeFleche,EspacementV,OffsetFleches,Dernier,PoliceEntete,PolicePrix,PoliceReduc,OffsetReduc,AgrandirReduc,Rayon,Police,ListeNiveaux,Marqueur,Pos,Echelle,Couleurs,Taille},%
+ morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,Melange,PoliceLabels,EspaceLabels,Swap,Type,CoeffEspVert,EpTrait,Alea,LargeurNivs,Niveaux,NoticeNiveaux,Titre,PolTitre,PolNotice,PolComp,LigneSep,CouleurNotice,CouleurNiveaux,CouleurFond,Note,Notice,PoliceCateg,PoliceBloc,Couleurs,LargeurBloc,Echelle,NoirBlanc,Libelle,EpTrait,Police,Type,ComplementTitre,Titre,CodeDebut,Couleur,EchelleImage,Decoration,Trait,Avatar,AffAvatar,NoirBlanc,CouleurE,CouleurR,CouleurFond,Hauteur,Largeur,PoliceTxt,CouleurTitre,AlignH,bg,txt,bthick,bcol,raise,Type,EspH,Fond,Texte,Style,Dense,Avant,AvantS,Apres,ApresS,Global,align,width,Legende,CouleurFond,Hauteur,Ratio,AffLegende,Couleurs,EchelleSymboles,Symboles,vRemplir,vOffset,vCentrer,height,width,blockwidth,collight,colmedium,coldar,coltxt,fonttxt,swap,maincolor,logo,type,num,dispblock,customtype,Couleur,AlignV,Offset,NiveauMax,pasX,pasY,grilleauto,TailleFleche,Direction,Coeff,TypeFleche,Deplacement,LineCap,Epaisseur,CouleurCartouche,Fleches,CouleurFond,CouleurTitre,PoliceCartouche,TypeFleche,EspacementV,OffsetFleches,Dernier,PoliceEntete,PolicePrix,PoliceReduc,OffsetReduc,AgrandirReduc,Rayon,Police,ListeNiveaux,Marqueur,Pos,Echelle,Couleurs,Taille,custommulti,Noeud,Grille,SousGrille,CouleurGrille,Clip},%
keywordstyle={\color{orange}}
},%
#1
@@ -81,6 +81,7 @@
\NewDocumentCommand\MontreCode{ m }{%
\hl{\vphantom{\texttt{pf}}\texttt{#1}}%
}
+\usepackage[auto,outline]{contour}
\usepackage{babel}
@@ -152,6 +153,10 @@
\section{Historique}
+\verb|v0.3.3|~:~~~Annoter une image
+
+\verb|v0.3.2|~:~~~Version alternative de la bannière \textsf{Tri}
+
\verb|v0.3.1|~:~~~Ajout des cases à cocher pour les \textsf{QCM}
\verb|v0.3.0|~:~~~Compatibilité accrue avec \textsf{beamer}
@@ -1587,6 +1592,7 @@
\item \MontreCode{dispblock} : booléen pour afficher le bloc de gauche (actif par défaut)
\item \MontreCode{num} : booléen pour afficher le numéro (actif par défaut)
\item \MontreCode{customtype} : texte personnalisé éventuel du bloc gauche
+ \item \MontreCode{custommulti} : booléen pour un texte personnalisé éventuel du bloc gauche sur deux lignes
\end{itemize}
\begin{DemoCode}{}
@@ -1619,25 +1625,41 @@
{7}{Mon document}
\end{DemoCode}
-Il est de ce fait \textit{normalement} possible (à vérifier quand même\ldots) de modifier le comportement de la commande \MontreCode{\textbackslash part}, dans l'optique de l'utilisation avec une table des matières notamment.
+Il est de ce fait \textit{normalement} possible (à vérifier quand même avec une insertion dans une \textsf{toc}\ldots) de modifier le comportement de la commande \MontreCode{\textbackslash part}, dans l'optique de l'utilisation avec une table des matières notamment.
+%\begin{DemoCode}{}
+%%redéfinition de \part avec gestion de la version étoilée
+%\RenewDocumentCommand\part{ s m D<>{} }{%
+% \addtocounter{part}{1}%
+% \IfBooleanTF{#1}%
+% {%
+% \tkzBannerTri[#3,num=false]{\thepart}{#2}%
+% }%
+% {%
+% \tkzBannerTri[#3]{\thepart}{#2}%
+% %\addcontentsline{toc}{part}{#2}%éventuellement
+% }%
+%}
+%%modification de la numérotation, avec forçage du 0
+%\renewcommand\thepart{\ifnum\value{part}<10\relax0\fi\arabic{part}}
+%
+%\part{Éléments de logique}<type=TP,logo=\faAirbnb>
+%\end{DemoCode}
+
+\pagebreak
+
+À noter qu'il existe une commande \textit{alternative}, avec un fonctionnement légèrement différent, puisque la hauteur de la bannière et la largeur du bloc sont fixés, de sorte que les labels s'adaptent automatiquement.
+
+Les \MontreCode{clés} sont les mêmes, le fonctionnement global également, à l'exception de la clé \MontreCode{[customtype]} en mode \MontreCode{custommulti} qui doit être donné sous la forme \MontreCode{[customtype=L1+L2]}.
+
\begin{DemoCode}{}
-%redéfinition de \part avec gestion de la version étoilée
-\RenewDocumentCommand\part{ s m D<>{} }{%
- \addtocounter{part}{1}%
- \IfBooleanTF{#1}%
- {%
- \tkzBannerTri[#3,num=false]{\thepart}{#2}%
- }%
- {%
- \tkzBannerTri[#3]{\thepart}{#2}%
- %\addcontentsline{toc}{part}{#2}%éventuellement
- }%
-}
-%modification de la numérotation, avec forçage du 0
-\renewcommand\thepart{\ifnum\value{part}<10\relax0\fi\arabic{part}}
+\tkzBannerTriAlt
+ [maincolor=magenta,logo=\faSchool,type=INTERRO]
+ {05}{Mon document}
-\part{Éléments de logique}<type=TP,logo=\faAirbnb>
+\tkzBannerTriAlt
+ [maincolor=violet,swap,logo=\faSchool,customtype={INTERRO+DE COURS},custommulti,blockwidth=1.25cm]
+ {}{Probabilités (v1)}
\end{DemoCode}
\pagebreak
@@ -2014,4 +2036,50 @@
\end{tikzpicture}
\end{DemoCode}
+\pagebreak
+
+\subsection{Annoter une image}
+
+L'idée est de proposer de quoi annoter une image, en utilisant un environnement et une commande qui sont liés à \TikZ.
+
+\begin{DemoCode}{listing only}
+\begin{AnnoterImage}[clés][options includegraphics]{image}
+ \PlacerTxtSurImg[options node tikz]{coordonnées}{texte}
+ \PlacerTxtSurImg*[options node tikz]{coordonnées en pourcentage}{texte}
+ %code tikz
+\end{AnnoterImage}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%\usepackage[auto,outline]{contour}
+\begin{AnnoterImage}[Grille=0.5][height=4cm]{example-image.png}
+ \PlacerTxtSurImg[scale=5,rotate=30]
+ {1,1}{\contourlength{0.05em}\color{white}\contour{black}{$\pi$}}
+ \PlacerTxtSurImg*[scale=1.5,rotate=-15]
+ {0.66,0.75}{\contourlength{0.025em}\color{violet}\contour{yellow}{Pythagore}}
+\end{AnnoterImage}
+\end{DemoCode}
+
+Concernant l'environnement, les \MontreCode{clés} disponibles (premier argument), à donner entre \MontreCode{[...]}, sont :
+
+\begin{itemize}
+ \item \MontreCode{Noeud=...} : nom du nœud créé (si réutilisation avec un \texttt{remember picture}) ;
+ \item \MontreCode{Grille=...} : Grille éventuelle d'aide (en unité) (\MontreCode{vide} par défaut) ;
+ \item \MontreCode{SousGrille=...} : sous-grille éventuelle (\MontreCode{4} par défaut) ;
+ \item \MontreCode{CouleurGrille=...} : couleur de la grille d'aide (\MontreCode{teal} par défaut) ;
+ \item \MontreCode{Clip=...} : booléen pour fixer les annotations à l'intérieur de l'image (\MontreCode{true}).
+\end{itemize}
+
+Le deuxième argument, optionnel et entre \MontreCode{[...]}, correspond aux options spécifiques liées à \MontreCode{includegraphics}.
+
+Le fichier est à préciser avec sont extension, car le code se charge de vérifier que le fichier existe.
+
+\begin{DemoCode}{}
+\begin{AnnoterImage}[Noeud=TESTIMG][height=3.75cm]<rotate=15>{example-image-golden.pdf}
+ %commandes manuelles
+ \draw (TESTIMG.center) node[above=5mm,font=\Huge\ttfamily\bfseries,text=blue] {TEST1} ;
+ \draw (TESTIMG.north west) node[draw,thick,red,inner sep=0.5mm,below right=2.5mm,font=\LARGE\sffamily\bfseries,text=red] {TEST2} ;
+\end{AnnoterImage}
+\end{DemoCode}
+
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty 2025-04-07 19:47:17 UTC (rev 74868)
+++ trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty 2025-04-07 19:47:26 UTC (rev 74869)
@@ -3,9 +3,11 @@
% source pencil...: CC-BY-SA 4.0 https://tex.stackexchange.com/questions/504092/replicating-a-fancy-bordered-text-style-in-latex/504145#504145
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{customenvs}[2025/02/13 0.3.1 Custom classic environments]
+\ProvidesPackage{customenvs}[2025/04/07 0.3.3 Custom classic environments]
%====HISTORIQUE
+% v 0.3.3 Write on image
+% v 0.3.2 Alt version of tkztribanner
% v 0.3.1 CheckBox for MCQ + enhancements for bannerTri
% v 0.3.0 Beamer compatibility (?)
% v 0.2.8 Position absolue d'un objet dans une page
@@ -72,6 +74,9 @@
\RequirePackage{simplekv}
\RequirePackage{xstring}
\RequirePackage{listofitems}
+\RequirePackage{settobox}
+\RequirePackage{adjustbox}
+\RequirePackage{ifthen}
\RequirePackage{calc}
\RequirePackage{tikz}
\usetikzlibrary{decorations.pathmorphing,positioning,shapes.misc,calc}
@@ -2734,7 +2739,8 @@
type=\def\tkzBannermaintritype{#1},%
blockwidth=\def\tkzBannermaintriblockwidth{#1},%
customtype=\def\tkzBannermaintritypelibre{#1},%
- fonttxt=\def\tkzBannermainfonttype{#1}
+ fonttxt=\def\tkzBannermainfonttype{#1},%
+ posnum=\def\tkzBannermainposnum{#1}
}
\setKVdefault[tkzBannerpartKeys]{%
@@ -2752,7 +2758,9 @@
type={},%
num=true,
dispblock=true,%
- customtype={}
+ customtype={},%
+ custommulti=false,%
+ posnum=0.425
}
\NewDocumentCommand\tkzBannerTri{ O{} m m }{%
@@ -2832,13 +2840,19 @@
}%
{%
\node[inner sep=2pt,below=1pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={1.05*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp at tkzbanner@autowidth},{\useKV[tkzBannerpartKeys]{height}}) {\vphantom{qÉ}\tkzBannermaintritype};
- \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp at tkzbanner@autowidth},{0.425*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}#2};
+ \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp at tkzbanner@autowidth},{\tkzBannermainposnum*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}#2};
}%
}%
{}%
}%
{%
- \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp at tkzbanner@autowidth},{0.5*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}\tkzBannermaintritypelibre};
+ \ifboolKV[tkzBannerpartKeys]{custommulti}%
+ {%
+ \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={1.75*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)},text width=\tmp at tkzbanner@autowidth,align=center] at ({0.5*\tmp at tkzbanner@autowidth},{0.5*(\useKV[tkzBannerpartKeys]{height})}) {\tkzBannermaintritypelibre};
+ }%
+ {%
+ \node[inner sep=2pt,text={\useKV[tkzBannerpartKeys]{coltxt}},font={\useKV[tkzBannerpartKeys]{fonttxt}},scale={2.5*\tkzBannertriscale},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp at tkzbanner@autowidth},{0.5*(\useKV[tkzBannerpartKeys]{height})}) {\vphantom{qÉ}\tkzBannermaintritypelibre};
+ }%
}%
\end{scope}
}%
@@ -3745,4 +3759,359 @@
}%
}
+%====TITLE v2 (with better texts)
+\newsavebox\tmpmybox
+\newlength\tmpmywidthbox
+\newlength\tmpmytotheightbox
+\newlength\tmpfixedwidth
+
+\NewDocumentCommand\resizeiflarger{ s m m m }{%
+ %#2 = content
+ %#3 = fixed height
+ %#4 = var width
+ \setlength\tmpfixedwidth{#4}%
+ \IfBooleanTF{#1}%
+ {%
+ \savebox{\tmpmybox}{\resizebox*{!}{#3}{#2}}%
+ \settowidth{\tmpmywidthbox}{\usebox{\tmpmybox}}%on stocke la largeur
+ \ifthenelse{\tmpmywidthbox < \tmpfixedwidth}%
+ {%
+ \usebox{\tmpmybox}%
+ }%
+ {%
+ \resizebox*{\tmpfixedwidth}{#3}{#2}%
+ }%
+ }%
+ {%
+ \savebox{\tmpmybox}{\resizebox{!}{#3}{#2}}%
+ \settowidth{\tmpmywidthbox}{\usebox{\tmpmybox}}%on stocke la largeur
+ \ifthenelse{\tmpmywidthbox < \tmpfixedwidth}%
+ {%
+ \usebox{\tmpmybox}%
+ }%
+ {%
+ \resizebox{\tmpfixedwidth}{#3}{#2}%
+ }%
+ }%
+}
+
+\newlength\tmp at tkzbanneralt@height
+\newlength{\tmp at tkzbanneralt@autowidthtype}
+\setlength\tmp at tkzbanneralt@autowidthtype{2.5em}
+\newlength{\tmp at tkzbanneralt@autowidthnum}
+\setlength\tmp at tkzbanneralt@autowidthnum{2em}
+\newlength{\tmp at tkzbanneralt@marginoffsetbanner}
+\setlength\tmp at tkzbanneralt@marginoffsetbanner{2pt}
+\newlength{\tmp at tkzbanneralt@autowidth}
+\newlength\tmp at tkzbanneralt@txtheight
+\newlength\tmp at tkzbanneralt@txtmarginhblock
+\newlength\tmp at tkzbanneralt@txtheightsmall
+\newlength\tmp at tkzbanneralt@txtheightbig
+\newlength\tmp at tkzbanneralt@titlewidth
+
+\def\tmp at tkzbanneralt@scalemain{0.75}
+\def\tmp at tkzbanneralt@scalesmall{0.25}
+\def\tmp at tkzbanneralt@scalesnum{0.5}
+%\xdef\tmp at tkzbanneralt@offsetmargin{\fpeval{(1-\tmp at tkzbanneralt@scalesmall-\tmp at tkzbanneralt@scalesnum)/3}}
+
+\defKV[tkzBannerpartAltKeys]{%
+ height=\setlength\tmp at tkzbanneralt@height{#1},%
+ maincolor=\def\tkzBannermaintricol{#1},%
+ logo=\def\tkzBannermaintrilogo{#1},%
+ type=\def\tkzBannermaintritype{#1},%
+ blockwidth=\setlength\tmp at tkzbanneralt@autowidth{#1},%
+ customtype=\def\tkzBannermaintritypelibre{#1},%
+ fonttxt=\def\tkzBannermainfonttype{#1}
+}
+
+\setKVdefault[tkzBannerpartAltKeys]{%
+ height=1cm,%
+ width={\linewidth-0.5pt},%
+ blockwidth=1cm,%
+ collight=darkgray!25,%
+ colmedium=darkgray!50,%
+ coldark=darkgray,%
+ coltxt=white,%
+ fonttxt=\sffamily\bfseries,%
+ swap=false,%
+ maincolor={},%
+ logo={},%
+ type={},%
+ num=true,
+ customtype={},%
+ custommulti=false
+}
+
+\NewDocumentCommand\tkzBannerTriAlt{ O{} m m }{%
+ %#1 := clés
+ %#2 := numéro
+ %#3 := titre
+ \noindent%
+ \restoreKV[tkzBannerpartAltKeys]%
+ \setKV[tkzBannerpartAltKeys]{#1}%
+ %on commence par faire les calculs d'échelle des labels
+ \setlength\tmp at tkzbanneralt@txtheight{\tmp at tkzbanneralt@scalemain\tmp at tkzbanneralt@height}%
+ \setlength\tmp at tkzbanneralt@txtheightsmall{\tmp at tkzbanneralt@scalesmall\tmp at tkzbanneralt@height}%
+ \setlength\tmp at tkzbanneralt@txtheightbig{\tmp at tkzbanneralt@scalesnum\tmp at tkzbanneralt@height}%
+ \xdef\tmp at tkzbanneralt@offsetmargin{\fpeval{(1-\tmp at tkzbanneralt@scalesmall-\tmp at tkzbanneralt@scalesnum)/3}}%
+ \setlength\tmp at tkzbanneralt@txtmarginhblock{\tmp at tkzbanneralt@offsetmargin\tmp at tkzbanneralt@height}%
+ \pgfmathsetmacro{\tkzBannertriangle}{0.10*(\useKV[tkzBannerpartKeys]{height})/(\useKV[tkzBannerpartKeys]{width})}%
+ \IfEq{\tkzBannermaintrilogo}{}%OK
+ {%
+ \setlength\tmp at tkzbanneralt@titlewidth{\linewidth-\tmp at tkzbanneralt@autowidth-2\tmp at tkzbanneralt@marginoffsetbanner-3.5mm}%
+ }%
+ {%
+ \setlength\tmp at tkzbanneralt@titlewidth{\linewidth-\tmp at tkzbanneralt@autowidth-2\tmp at tkzbanneralt@marginoffsetbanner-3.5mm-\tmp at tkzbanneralt@height}%
+ }%
+ %l'environnement tikzpicture
+ \begin{tikzpicture}
+ \IfEq{\tkzBannermaintricol}{}%
+ {%
+ \tikzset{tkzbannertridark/.style={\useKV[tkzBannerpartAltKeys]{coldark}}}
+ \tikzset{tkzbannertrimedium/.style={\useKV[tkzBannerpartAltKeys]{colmedium}}}
+ \tikzset{tkzbannertrilight/.style={\useKV[tkzBannerpartAltKeys]{collight}}}
+ }%
+ {%
+ \tikzset{tkzbannertridark/.style={\tkzBannermaintricol}}
+ \tikzset{tkzbannertrimedium/.style={\tkzBannermaintricol!50}}
+ \tikzset{tkzbannertrilight/.style={\tkzBannermaintricol!25}}
+ }%
+ %coordinates
+ \coordinate (tkzBannerTri-NW) at (0,{\useKV[tkzBannerpartAltKeys]{height}}) ;
+ \coordinate (tkzBannerTri-SW) at (0,0) ;
+ \coordinate (tkzBannerTri-NE) at ({\useKV[tkzBannerpartAltKeys]{width}},{\useKV[tkzBannerpartAltKeys]{height}}) ;
+ \coordinate (tkzBannerTri-SE) at ({\useKV[tkzBannerpartAltKeys]{width}},0) ;%
+ \coordinate (tkzBannerTri-SWd) at ($(tkzBannerTri-SW)!0.05!(tkzBannerTri-NW)$) ;%
+ \coordinate (tkzBannerTri-SEd) at ($(tkzBannerTri-SE)!0.15!(tkzBannerTri-NE)$) ;%
+ %drawing & shadow
+ \fill[lightgray!75] ([yshift=-1pt]tkzBannerTri-SWd) -- ([yshift=-1pt]tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ;
+ \ifboolKV[tkzBannerpartAltKeys]{swap}%
+ {%
+ \fill[white] (tkzBannerTri-SWd) -- (tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ;
+ \draw[line width=1pt,tkzbannertridark] ([shift={(0.5pt,-0.5pt)}]tkzBannerTri-NW) -| ([shift={(-0.5pt,0)}]tkzBannerTri-SEd) -- (tkzBannerTri-SWd) ;
+ }%
+ {%
+ \fill[tkzbannertrimedium] (tkzBannerTri-SWd) -- (tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ;
+ }%
+ \begin{scope}
+ \clip ($(tkzBannerTri-SW)!0.0375!(tkzBannerTri-NW)$) -- ($(tkzBannerTri-SE)!0.1375!(tkzBannerTri-NE)$) -- (tkzBannerTri-NE) -| cycle ;
+ %light
+ \fill[tkzbannertrilight] (tkzBannerTri-NW) --++ ({\tmp at tkzbanneralt@autowidth+2*\tmp at tkzbanneralt@marginoffsetbanner},0) -- ({\tmp at tkzbanneralt@autowidth+2*\tmp at tkzbanneralt@marginoffsetbanner+3.5mm},{0.5*(\useKV[tkzBannerpartAltKeys]{height})}) -- ({\tmp at tkzbanneralt@autowidth+2*\tmp at tkzbanneralt@marginoffsetbanner},0) -- (tkzBannerTri-SW) -- cycle ;
+ \end{scope}
+ \begin{scope}
+ \clip ($(tkzBannerTri-SW)!0.025!(tkzBannerTri-NW)$) -- ($(tkzBannerTri-SE)!0.125!(tkzBannerTri-NE)$) -- (tkzBannerTri-NE) -| cycle ;
+ %medium
+ \fill[tkzbannertrimedium] (tkzBannerTri-NW) --++ ({\tmp at tkzbanneralt@autowidth+\tmp at tkzbanneralt@marginoffsetbanner},0) -- ({\tmp at tkzbanneralt@autowidth+\tmp at tkzbanneralt@marginoffsetbanner+3.5mm},{0.5*(\useKV[tkzBannerpartAltKeys]{height})}) -- ({\tmp at tkzbanneralt@autowidth+\tmp at tkzbanneralt@marginoffsetbanner},0) -- (tkzBannerTri-SW) -- cycle ;
+ \end{scope}
+ \begin{scope}
+ \clip ($(tkzBannerTri-SW)!0.0125!(tkzBannerTri-NW)$) -- ($(tkzBannerTri-SE)!0.1125!(tkzBannerTri-NE)$) -- (tkzBannerTri-NE) -| cycle ;
+ %dark
+ \fill[tkzbannertridark] (tkzBannerTri-NW) --++ ({\tmp at tkzbanneralt@autowidth},0) -- ({\tmp at tkzbanneralt@autowidth+3.5mm},{0.5*(\useKV[tkzBannerpartAltKeys]{height})}) -- ({\tmp at tkzbanneralt@autowidth},0) -- (tkzBannerTri-SW) -- cycle ;
+ \end{scope}
+ %le label du titre (OK)
+ \begin{scope}
+ \clip (tkzBannerTri-SWd) -- (tkzBannerTri-SEd) -- (tkzBannerTri-NE) -| cycle ;
+ \ifboolKV[tkzBannerpartAltKeys]{swap}%
+ {%
+ \node[inner sep=1.25pt,right,text=\tkzBannermaintricol,font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({\tmp at tkzbanneralt@autowidth+2*\tmp at tkzbanneralt@marginoffsetbanner+4mm},{0.52*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizeiflarger*{\tkzBannermainfonttype\vphantom{qÉ}#3}{\tmp at tkzbanneralt@txtheight}{\tmp at tkzbanneralt@titlewidth}};%
+ %{\resizebox*{!}{\tmp at tkzbanneralt@txtheight}{\vphantom{qÉ}#3}};
+ %logo
+ \IfEq{\tkzBannermaintrilogo}{}%OK
+ {}%
+ {%
+ \node[inner sep=1.25pt,left=2pt,text=\tkzBannermaintricol,font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({\useKV[tkzBannerpartAltKeys]{width}},{0.55*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizebox*{!}{0.9\tmp at tkzbanneralt@txtheight}{\vphantom{qÉ}\tkzBannermaintrilogo}};
+ }%
+ }%
+ {%
+ \node[inner sep=1.25pt,right,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({\tmp at tkzbanneralt@autowidth+2*\tmp at tkzbanneralt@marginoffsetbanner+4mm},{0.52*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizeiflarger*{\tkzBannermainfonttype\vphantom{qÉ}#3}{\tmp at tkzbanneralt@txtheight}{\tmp at tkzbanneralt@titlewidth}};%
+ %{\resizebox*{!}{\tmp at tkzbanneralt@txtheight}{\vphantom{qÉ}#3}};
+ %logo
+ \IfEq{\tkzBannermaintrilogo}{}%OK
+ {}%
+ {%
+ \node[inner sep=1.25pt,left=2pt,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({\useKV[tkzBannerpartAltKeys]{width}},{0.55*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizebox*{!}{0.9\tmp at tkzbanneralt@txtheight}{\vphantom{qÉ}\tkzBannermaintrilogo}};
+ }%
+ }%
+ \end{scope}
+ %les labels gauches, en test
+ \begin{scope}
+ \clip ($(tkzBannerTri-SW)!0.0125!(tkzBannerTri-NW)$) -- ($(tkzBannerTri-SE)!0.1125!(tkzBannerTri-NE)$) -- (tkzBannerTri-NE) -| cycle ;
+ \IfEq{\tkzBannermaintritypelibre}{}%
+ {%
+ \ifboolKV[tkzBannerpartAltKeys]{num}%
+ {%
+ \IfEq{\tkzBannermaintritype}{}%
+ {%
+ %Numéro tout seul (OK)
+ \node[inner sep=0pt,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({0.55*\tmp at tkzbanneralt@autowidth},{0.5*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizeiflarger{\tkzBannermainfonttype #2}{\tmp at tkzbanneralt@txtheightbig}{0.925\tmp at tkzbanneralt@autowidth}};% {\resizebox*{0.9\tmp at tkzbanneralt@autowidth}{!}{#2}};
+ }%
+ {%
+ %Label OK & Numéro OK
+ \node[text depth=0pt,inner sep=0pt,below=1.25\tmp at tkzbanneralt@txtmarginhblock,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp at tkzbanneralt@autowidth},{\useKV[tkzBannerpartAltKeys]{height}}) {\resizeiflarger*{\vphantom{qB}\tkzBannermaintritype}{\tmp at tkzbanneralt@txtheightsmall}{0.925\tmp at tkzbanneralt@autowidth}} ;%{\resizebox*{!}{\tmp at tkzbanneralt@txtheightsmall}{\vphantom{qB}\tkzBannermaintritype}};
+ \node[inner sep=0pt,above=0.95\tmp at tkzbanneralt@txtmarginhblock,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({0.5*\tmp at tkzbanneralt@autowidth},0) {\resizeiflarger*{\vphantom{qB}#2}{\tmp at tkzbanneralt@txtheightbig}{0.925\tmp at tkzbanneralt@autowidth}} ;% {\resizebox*{!}{\tmp at tkzbanneralt@txtheightbig}{\vphantom{qB}#2}};
+ }%
+ }%
+ {}%
+ }%
+ {%
+ \ifboolKV[tkzBannerpartAltKeys]{custommulti}%
+ {%
+ %2 Lignes (OK)
+ \StrCut{\tkzBannermaintritypelibre}{+}{\tkzBannermaintritypelibreA}{\tkzBannermaintritypelibreB}%
+ \node[inner sep=1.25pt,above,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)},text width=0.925\tmp at tkzbanneralt@autowidth,align=center] at ({0.525*\tmp at tkzbanneralt@autowidth},{0.5*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizeiflarger{\vphantom{qB}\tkzBannermaintritypelibreA}{\tmp at tkzbanneralt@txtheightsmall}{0.925\tmp at tkzbanneralt@autowidth}};
+ \node[inner sep=1.25pt,below,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)},text width=0.925\tmp at tkzbanneralt@autowidth,align=center] at ({0.525*\tmp at tkzbanneralt@autowidth},{0.5*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizeiflarger{\vphantom{qB}\tkzBannermaintritypelibreB}{\tmp at tkzbanneralt@txtheightsmall}{0.925\tmp at tkzbanneralt@autowidth}};
+ }%
+ {%
+ %une ligne (OK)
+ \node[inner sep=1.25pt,text={\useKV[tkzBannerpartAltKeys]{coltxt}},font={\useKV[tkzBannerpartAltKeys]{fonttxt}},rotate={atan(\tkzBannertriangle)}] at ({0.525*\tmp at tkzbanneralt@autowidth},{0.5*(\useKV[tkzBannerpartAltKeys]{height})}) {\resizeiflarger{\vphantom{qB}\tkzBannermaintritypelibre}{\tmp at tkzbanneralt@txtheightsmall}{0.925\tmp at tkzbanneralt@autowidth}};
+ }%
+ }%
+ \end{scope}
+ \end{tikzpicture}%
+}
+
+%====Write on images
+\newcommand\cecalcwidthnodetikz[2]{%
+ \pgfpointdiff{\pgfpointanchor{#1}{east}}{\pgfpointanchor{#1}{west}}%
+ \pgf at xa=\pgf at x
+ \pgf at ya=\pgf at y
+ % to convert from pt to cm
+ \pgfmathparse{veclen(\pgf at xa,\pgf at ya)/28.45274}%
+ \global\let#2\pgfmathresult%
+}
+\newcommand\cecalcheightnodetikz[2]{%
+ \pgfpointdiff{\pgfpointanchor{#1}{south}}{\pgfpointanchor{#1}{north}}%
+ \pgf at xa=\pgf at x
+ \pgf at ya=\pgf at y
+ % to convert from pt to cm
+ \pgfmathparse{veclen(\pgf at xa,\pgf at ya)/28.45274}%
+ \global\let#2\pgfmathresult%
+}
+
+\defKV[writeonimg]{%
+ Noeud=\def\writeonimgnode{#1},%
+ node=\def\enwriteonimgnode{#1},%
+ Grille=\def\writeonimggrid{#1},%
+ grid=\def\enwriteonimggrid{#1},%
+ SousGrille=\def\writeonimgsubgrid{#1},%
+ subgrid=\def\enwriteonimgsubgrid{#1},%
+ CouleurGrille=\def\writeonimggridcolor{#1},%
+ gridcolor=\def\enwriteonimggridcolor{#1}
+}
+\setKVdefault[writeonimg]{%
+ Clip=true,clip=true,%
+ Noeud=MonImage,node=MyImg,%
+ Grille={},grid={},%
+ SousGrille=4,subgrid=4,%
+ CouleurGrille=teal,gridcolor=teal
+}
+
+\NewDocumentEnvironment{AnnoterImage}{ O{} O{} D<>{} m }%
+{%
+ \restoreKV[writeonimg]%
+ \setKV[writeonimg]{#1}%
+ \IfFileExists{#4}%
+ {%
+ \begin{tikzpicture}[transform shape,#3]
+ \node[shape=rectangle,inner sep=0pt,anchor=south west](\writeonimgnode){\includegraphics[#2]{#4}};
+ \useasboundingbox (\writeonimgnode.south west) rectangle (\writeonimgnode.north east) ;
+ \cecalcwidthnodetikz{\writeonimgnode}{\mytmpwidth}
+ \cecalcheightnodetikz{\writeonimgnode}{\mytmpheight}%
+ \IfStrEq{\writeonimggrid}{}%
+ {}%
+ {%
+ \draw[{\writeonimggridcolor},very thin,xstep=\fpeval{1/(\writeonimgsubgrid)*\writeonimggrid}cm,ystep=\fpeval{1/(\writeonimgsubgrid)*\writeonimggrid}cm,opacity=0.75] (\writeonimgnode.south west) grid (\writeonimgnode.north east) ;
+ \draw[{\writeonimggridcolor},thick,xstep=\writeonimggrid cm,ystep=\writeonimggrid cm,opacity=0.75] (\writeonimgnode.south west) grid (\writeonimgnode.north east) ;
+ \foreach \x in {0,\writeonimggrid,...,\mytmpwidth}{%
+ \draw (\x,0) node[draw,fill=white,inner sep=0.5pt,font=\tiny,rotate=90,anchor=west] {\x} ;
+ \draw (\x,\mytmpheight) node[draw,fill=white,inner sep=0.5pt,font=\tiny,rotate=90,anchor=east] {\x} ;
+ }
+ \foreach \y in {0,\writeonimggrid,...,\mytmpheight}{%
+ \draw (0,\y) node[draw,fill=white,inner sep=0.5pt,font=\tiny,right] {\y} ;
+ \draw (\mytmpwidth,\y) node[draw,fill=white,inner sep=0.5pt,font=\tiny,left] {\y} ;
+ }
+ }%
+ \ifboolKV[writeonimg]{Clip}%
+ {%
+ \clip (\writeonimgnode.south west) rectangle (\writeonimgnode.north east) ;
+ }%
+ {}%
+ }%
+ {%
+ {\setlength\fboxsep{1pt}\fbox{\tiny\ttfamily XXX}}%
+ }%
+}%
+{%
+ \IfFileExists{#4}%
+ {%
+ \end{tikzpicture}%
+ }%
+ {}%
+}%
+
+\NewDocumentCommand\PlacerTxtSurImg{ s O{} m m }{%
+ \IfBooleanTF{#1}%
+ {%
+ \StrCut{#3}{,}{\writeonimgxpercent}{\writeonimgypercent}%
+ \draw ({\writeonimgxpercent*\mytmpwidth},{\writeonimgypercent*\mytmpheight}) node[#2] {#4} ;
+ }%
+ {%
+ \draw (#3) node[#2] {#4} ;
+ }%
+}
+
+\NewDocumentEnvironment{imgannotate}{ O{} O{} D<>{} m }%
+{%
+ \restoreKV[writeonimg]%
+ \setKV[writeonimg]{#1}%
+ \IfFileExists{#4}%
+ {%
+ \begin{tikzpicture}[transform shape,#3]
+ \node[shape=rectangle,inner sep=0pt,anchor=south west](\enwriteonimgnode){\includegraphics[#2]{#4}};
+ \useasboundingbox (\enwriteonimgnode.south west) rectangle (\enwriteonimgnode.north east) ;
+ \cecalcwidthnodetikz{\enwriteonimgnode}{\mytmpwidth}
+ \cecalcheightnodetikz{\enwriteonimgnode}{\mytmpheight}%
+ \IfStrEq{\enwriteonimggrid}{}%
+ {}%
+ {%
+ \draw[{\enwriteonimggridcolor},very thin,xstep=\fpeval{1/(\enwriteonimgsubgrid)*\enwriteonimggrid}cm,ystep=\fpeval{1/(\enwriteonimgsubgrid)*\enwriteonimggrid}cm,opacity=0.75] (\enwriteonimgnode.south west) grid (\enwriteonimgnode.north east) ;
+ \draw[{\enwriteonimggridcolor},thick,xstep=\enwriteonimggrid cm,ystep=\enwriteonimggrid cm,opacity=0.75] (\enwriteonimgnode.south west) grid (\enwriteonimgnode.north east) ;
+ \foreach \x in {0,\enwriteonimggrid,...,\mytmpwidth}{%
+ \draw (\x,0) node[draw,fill=white,inner sep=0.5pt,font=\tiny,rotate=90,anchor=west] {\x} ;
+ \draw (\x,\mytmpheight) node[draw,fill=white,inner sep=0.5pt,font=\tiny,rotate=90,anchor=east] {\x} ;
+ }
+ \foreach \y in {0,\enwriteonimggrid,...,\mytmpheight}{%
+ \draw (0,\y) node[draw,fill=white,inner sep=0.5pt,font=\tiny,right] {\y} ;
+ \draw (\mytmpwidth,\y) node[draw,fill=white,inner sep=0.5pt,font=\tiny,left] {\y} ;
+ }
+ }%
+ \ifboolKV[writeonimg]{clip}%
+ {%
+ \clip (\enwriteonimgnode.south west) rectangle (\enwriteonimgnode.north east) ;
+ }%
+ {}%
+ }%
+ {%
+ {\setlength\fboxsep{1pt}\fbox{\tiny\ttfamily XXX}}%
+ }%
+}%
+{%
+ \IfFileExists{#4}%
+ {%
+ \end{tikzpicture}%
+ }%
+ {}%
+}%
+
+\NewDocumentCommand\puttxtonimg{ s O{} m m }{%
+ \IfBooleanTF{#1}%
+ {%
+ \StrCut{#3}{,}{\writeonimgxpercent}{\writeonimgypercent}%
+ \draw ({\writeonimgxpercent*\mytmpwidth},{\writeonimgypercent*\mytmpheight}) node[#2] {#4} ;
+ }%
+ {%
+ \draw (#3) node[#2] {#4} ;
+ }%
+}
+
\endinput
\ No newline at end of file
More information about the tex-live-commits
mailing list.