diff options
author | Karl Berry <karl@freefriends.org> | 2023-06-05 20:29:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-06-05 20:29:08 +0000 |
commit | 179187d74abc05f053189a67f14090652a3d94a6 (patch) | |
tree | e89a2d67032b697ac20aa129a44ea92fcb9e06fe | |
parent | 7ba898d6dafbaaee70e414650d5355a028e8ac20 (diff) |
postit (5jun23)
git-svn-id: svn://tug.org/texlive/trunk@67284 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/postit/postit-doc.pdf | bin | 438342 -> 494921 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/postit/postit-doc.tex | 295 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/postit/postit.sty | 519 |
3 files changed, 733 insertions, 81 deletions
diff --git a/Master/texmf-dist/doc/latex/postit/postit-doc.pdf b/Master/texmf-dist/doc/latex/postit/postit-doc.pdf Binary files differindex ba919f1d19d..369fc1219d3 100644 --- a/Master/texmf-dist/doc/latex/postit/postit-doc.pdf +++ b/Master/texmf-dist/doc/latex/postit/postit-doc.pdf diff --git a/Master/texmf-dist/doc/latex/postit/postit-doc.tex b/Master/texmf-dist/doc/latex/postit/postit-doc.tex index cc6611fadff..f9ee072286e 100644 --- a/Master/texmf-dist/doc/latex/postit/postit-doc.tex +++ b/Master/texmf-dist/doc/latex/postit/postit-doc.tex @@ -4,8 +4,8 @@ \documentclass[french,a4paper,11pt]{article} \usepackage[margin=2cm,includefoot]{geometry} -\def\TPversion{0.1} -\def\TPdate{31 Mai 2023} +\def\TPversion{0.1.1} +\def\TPdate{5 juin 2023} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb} @@ -54,6 +54,12 @@ \AddThinSpaceBeforeFootnotes \FrenchFootnotes +\usepackage{listings} + +\usepackage{newverbs} +\newverbcommand{\motcletex}{\color{cyan!75!black}}{} +\newverbcommand{\packagetex}{\color{violet!75!black}}{} + \tcbuselibrary{listingsutf8} \newtcblisting{DemoCode}[1][]{% enhanced,width=0.95\linewidth,center,% @@ -81,7 +87,7 @@ morekeywords={PostIt,\MiniPostIt},% keywordstyle={\color{green!50!black}},% classoffset=3,% - morekeywords={Couleur,CouleurAttache,Attache,Largeur,Hauteur,Inclinaison,Ombre,Coin,DecalAttache,AlignementH,AlignementV,AlignementPostIt,Bordure},% + morekeywords={Couleur,CouleurAttache,Attache,Largeur,Hauteur,Inclinaison,Ombre,Coin,DecalAttache,AlignementH,AlignementV,AlignementPostIt,Bordure,ExtraMargeDroite,Rendu,Titre,PoliceTitre},% keywordstyle={\color{orange}} },% #1 @@ -102,7 +108,7 @@ } } -\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}} +\newcommand\Cle[1]{{\small\sffamily\textlangle \textcolor{orange}{#1}\textrangle}} \newcommand\cmaj[1]{\tcbox[vignetteMaJ]{#1}\xspace} \begin{document} @@ -126,7 +132,7 @@ \\ {\LARGE Des petits Post-It,} \\ \\ - {\LARGE avec \textsf{tcolorbox}.} \\ + {\LARGE avec \textsf{tcolorbox} ou \textsf{Ti\textit{k}Z}.} \\ \end{tabular} \bigskip @@ -159,11 +165,11 @@ Ceci est un petit Post-It ! Pour rappeler par exemple que \[(a+b)^2=a^2+2ab+b^2.\] \end{PostIt} -\begin{PostIt}[Largeur=8cm,Couleur=orange,Attache=Non,Inclinaison=-5,Coin,AlignementPostIt=center] +\begin{PostIt}[Rendu=tikz,Largeur=8cm,Couleur=orange,Attache=Trombone,CouleurAttache=blue,Inclinaison=-5,AlignementPostIt=center,Titre={- Titre -},PoliceTitre={\color{blue!50!black}\bfseries\small\sffamily}] \lipsum[1][1-4] \end{PostIt} \hfill -\begin{PostIt}[Hauteur=6cm,AlignementV=center,Couleur=pink,Attache=Trombone,CouleurAttache=blue,Inclinaison=15,Coin,AlignementPostIt=center] +\begin{PostIt}[Hauteur=6cm,AlignementV=center,Couleur=pink,Attache=Non,CouleurAttache=blue,Inclinaison=15,Coin,AlignementPostIt=center,Attache=Scotch] \lipsum[1][1-4] \end{PostIt} @@ -198,6 +204,10 @@ \section{Historique} +\verb|v0.1.1|~:~~~~Ajout d'un \motcletex!\vphantom! pour les \textit{mini-}Post-It (hauteur \textit{uniforme}) + Correction de bugs. + +\verb| |~:~~~~Moteurs de rendu alternatif en \TikZ{} + Ajout d'un titre éventuel . + \verb|v0.1.0|~:~~~~Version initiale. \newpage @@ -207,7 +217,7 @@ \subsection{Introduction} \begin{noteblock} -Le package propose de quoi afficher, dans son document \LaTeX, un Post-It (créé à l'aide de \texttt{tcolorbox}), avec la possibilité : +Le package propose de quoi afficher, dans son document \LaTeX, un Post-It (créé à l'aide de \packagetex!tcolorbox! ou de \packagetex!tikz!), avec la possibilité : \begin{itemize} \item de spécifier les dimensions, la couleur ; @@ -215,7 +225,7 @@ Le package propose de quoi afficher, dans son document \LaTeX, un Post-It (créà \item de personnaliser les bordure et le coin. \end{itemize} -Le package propose également de quoi créer un \textit{mini-}Post-It (créé à l'aide d'une \texttt{tcbox}), avec la possibilité de gérer la couleur et l'ombre. +Le package propose également de quoi créer un \textit{mini-}Post-It (créé à l'aide d'une \motcletex!tcbox!), avec la possibilité de gérer la couleur et l'ombre. \end{noteblock} \subsection{Chargement du package, packages utilisés} @@ -223,7 +233,7 @@ Le package propose également de quoi créer un \textit{mini-}Post-It (créé à \begin{importantblock} Le package se charge, de manière classique, dans le préambule. -Il n'existe pas d'option pour le package, et \texttt{xcolor} n'est pas chargé. +Il n'existe pas d'option pour le package, et \packagetex!xcolor! n'est pas chargé. \end{importantblock} \begin{DemoCode}[listing only] @@ -233,11 +243,17 @@ Il n'existe pas d'option pour le package, et \texttt{xcolor} n'est pas chargé. \end{DemoCode} \begin{noteblock} -\textsf{postit} charge les packages suivantes : +\packagetex!postit! charge les packages suivantes : \begin{itemize} - \item \texttt{tcolorbox} avec la librairie \texttt{\textit{tcbox}.skins} ; - \item \texttt{xstring} et \texttt{simplekv}. + \item \packagetex!tcolorbox! avec la librairie \packagetex!tcbox.skins! ; + \item les librairies \packagetex!tikz! : + \begin{itemize} + \item \packagetex!tikz.calc! ; + \item \packagetex!tikz.decorations! ; + \item \packagetex!tikz.decorations.pathmorphing! ; + \end{itemize} + \item \packagetex!settobox!, \packagetex!xstring! et \packagetex!simplekv!. \end{itemize} Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} ou \textsf{xelatex}. @@ -246,7 +262,7 @@ Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdfl \subsection{Compatibilité} \begin{cautionblock} -Si un autre package charge \texttt{tcolorbox}, et notamment avec l'option \Cle{[most]}, il vaut mieux charger \texttt{postit} après, afin d'éviter un \textsf{option clash error\ldots}. +Si un autre package charge \packagetex!tcolorbox!, et notamment avec l'option \Cle{[most]}, il vaut mieux charger \packagetex!postit! après, afin d'éviter un \motcletex!option clash error...!. \end{cautionblock} \begin{DemoCode}[listing only] @@ -266,9 +282,9 @@ Si un autre package charge \texttt{tcolorbox}, et notamment avec l'option \Cle{[ \subsection{Environnement et fonctionnement global} \begin{cautionblock} -L'environnement dédié à la création du Post-It est \texttt{PostIt}. +L'environnement dédié à la création du Post-It est \packagetex!PostIt!. -Il fonctionne avec un système de clés, entre \texttt{[...]} et il est possible, entre \texttt{<...>} de spécifier des options à la \textsf{tcbox}, en langage \textsf{tcbox} ! +Il fonctionne avec un système de clés, entre \texttt{[...]} et il est possible, entre \texttt{<...>} de spécifier des options à la \motcletex!tcbox!, en langage \textsf{tcbox} (inutile avec le rendu en \motcletex!tikz!) ! \end{cautionblock} \begin{DemoCode}[listing only] @@ -279,39 +295,57 @@ Il fonctionne avec un système de clés, entre \texttt{[...]} et il est possible \end{DemoCode} \begin{noteblock} -Comme indiqué dans l'introduction, le Post-It est créé à l'aide d'un environnement \textsf{tcbox}. +Comme indiqué dans l'introduction, le Post-It est créé à l'aide d'un environnement \motcletex!tcbox! ou d'un environnement \motcletex!tikz!. -La majorité des (multiples) paramètres d'une \textsf{tcbox} sont fixés par le code, mais il est possible de spécifier certaines caractéristiques esthétiques du Post-It ! +La majorité des (multiples) paramètres d'une \motcletex!tcbox! et d'une figuure \motcletex!tikz! sont fixés par le code, mais il est possible de spécifier certaines caractéristiques esthétiques du Post-It ! \end{noteblock} \begin{DemoCode}[] -%sortie par défaut, avec un paragraphe issu du package lipsum +%sortie par défaut (rendu tcbox), avec un paragraphe issu du package lipsum \begin{PostIt} \lipsum[1][1-2] \end{PostIt} \end{DemoCode} +\begin{DemoCode}[] +%sortie rendu tikz, avec un paragraphe issu du package lipsum +\begin{PostIt}[Rendu=tikz] + \lipsum[1][1-2] +\end{PostIt} +%sortie rendu tikzv2, avec un paragraphe issu du package lipsum +\begin{PostIt}[Rendu=tikzv2] + \lipsum[1][1-2] +\end{PostIt} +\end{DemoCode} + \begin{tipblock} -Les éventuelles couleurs choisies devront être données de manière \textit{unique}, sans utiliser les \textit{mélanges} (avec \texttt{CouleurA!...!CouleurB}) que propose le package \texttt{xcolor}. +Les éventuelles couleurs choisies devront être données de manière \textit{unique}, sans utiliser les \textit{mélanges} (avec \motcletex|CouleurA!...!CouleurB|) que propose le package \packagetex!xcolor!. Toutefois, toute couleur précédemment définie pourra être utilisée pour le Post-It. \end{tipblock} \begin{tipblock} -Le Post-It créé pourra être intégré dans une \textsf{minipage} ou un \textsf{wrapstuff} si besoin. +Le Post-It créé pourra être intégré dans une \motcletex!minipage! ou un \motcletex!wrapstuff! si besoin. -Pour l'alignement horizontal, il est conseillé d'utiliser des commandes dédiées comme \texttt{\textbackslash hfill} ou des envrionnements dédiées comme \texttt{flush...}. +Pour l'alignement horizontal, il est conseillé d'utiliser des commandes dédiées comme \motcletex!\hfill! ou des environnements dédiés comme \motcletex!flush...!. \end{tipblock} +\begin{warningblock} +Avec une \textit{attache} qui "déborde" verticalement (rendu \textsf{tcbox}), il sera sans doute nécessaire d'ajuster l'espacement vertical précédant le Post-It pour éviter un éventuel chevauchement. +\end{warningblock} + \subsection{Clés et options} \begin{tipblock} Le premier argument, optionnel et entre \texttt{[...]}, propose les \Cle{clés} suivantes : \begin{itemize} - \item \Cle{Largeur} : largeur du Post-It ; \hfill{}défaut : \Cle{6cm} + \item \Cle{Largeur} : largeur (en cm) du Post-It ; \hfill{}défaut : \Cle{6cm} \item \Cle{Couleur} : couleur du Post-It (la bordure sera plus foncée) ; \hfill{}défaut : \Cle{yellow} - \item \Cle{Hauteur} : hauteur du Post-It (par défaut elle est \textit{automatique}) ; \hfill{}défaut : \Cle{auto} + \item \Cle{Hauteur} : hauteur (en cm si déclarée) du Post-It (par défaut elle est \textit{automatique}) ; + + \hfill{}défaut : \Cle{auto} + \item \cmaj{0.1.1} \Cle{Rendu} : moteur du rendu parmi \Cle{tcbox / tikz / tikv2} ; \hfill{}défaut : \Cle{tcbox} \item \Cle{Inclinaison} : inclinaison du Post-It ; \hfill{}défaut : \Cle{0} \item \Cle{Ombre} : booléen pour afficher une ombre portée ; \hfill{}défaut : \Cle{true} \item \Cle{Bordure} : booléen pour afficher une fine bordure ; \hfill{}défaut : \Cle{true} @@ -320,7 +354,12 @@ Le premier argument, optionnel et entre \texttt{[...]}, propose les \Cle{clés} \hfill{}défaut : \Cle{Punaise} \item \Cle{CouleurAttache} : couleur de l'attache ; \hfill{}défaut : \Cle{red} - \item \Cle{DecalAttache} : décalage horizontal de l'attache par rapport à sa position initiale (au centre pour la punaise, à 1~cm du bord droit pour le trombone) ; + \item \Cle{DecalAttache} : décalage horizontal (sans unité, mais en cm) de l'attache par rapport à sa position initiale (au centre pour la punaise, à 1~cm du bord droit pour le trombone) ; + + \hfill{}défaut : \Cle{0} + \item \cmaj{0.1.1} \Cle{Titre} : rajouter un titre (en 1ère ligne et/ou sous l'Attache) ; \hfill{}défaut : \Cle{vide} + \item \cmaj{0.1.1} \Cle{PoliceTitre} : police du titre ; \hfill{}défaut : \Cle{\textbackslash normalfont\textbackslash normalfont} + \item \cmaj{0.1.1} \Cle{ExtraMargeDroite} : rajoute (en rendu \packagetex!tikz!, et en cm) une marge à droite ; \hfill{}défaut : \Cle{0cm} \item \Cle{AlignementV} : gère l'alignement vertical dans le Post-It (parmi \Cle{top/center/bottom}) ; @@ -337,18 +376,35 @@ Le premier argument, optionnel et entre \texttt{[...]}, propose les \Cle{clés} \end{tipblock} \begin{tipblock} -Le second argument, optionnel et entre \texttt{<...>} correspond à des options spécifiques à passer à la \textsf{tcolorbox}, en langage \textsf{tcbox}. +Le second argument, optionnel et entre \texttt{<...>} correspond à des options spécifiques à passer à la \motcletex!tcolorbox!, en langage \textsf{tcbox} (inutile si le rendu est \motcletex!tikz!). Elles permettent de modifier localement des options non paramétrées par des clés présentées précédemment. \end{tipblock} \begin{DemoCode}[] -\begin{PostIt} +\begin{PostIt}%moteur de rendu tcbox (défaut) [Couleur=cyan,Attache=Trombone,Largeur=10cm,Inclinaison=10]<center,right=1.5cm> \lipsum[1][1-3] \end{PostIt} \end{DemoCode} +\begin{DemoCode}[] +\hfill\begin{PostIt}%moteur de rendu tikz + [Rendu=tikz,Couleur=violet,Largeur=9cm,Inclinaison=-10,Attache=Trombone, + CouleurAttache=black,ExtraMargeDroite=1cm,Titre={Petit Titre}, + PoliceTitre={\color{white}\bfseries\small\sffamily}] +\lipsum[1][1-3] +\end{PostIt}\hfill~ +\end{DemoCode} + +\begin{DemoCode}[] +\hfill\begin{PostIt}%moteur de rendu tikzv2 + [Rendu=tikzv2,Couleur=orange,Largeur=9cm,Inclinaison=-10,Attache=Scotch, Titre={Essai}, + PoliceTitre={\color{blue!50!black}\bfseries\itshape\small\ttfamily}] +\lipsum[1][1-3] +\end{PostIt}\hfill~ +\end{DemoCode} + \pagebreak \subsection{Exemples} @@ -365,17 +421,48 @@ Elles permettent de modifier localement des options non paramétrées par des cl \end{DemoCode} \begin{DemoCode}[] +%usepackage{wrapstuff} +\begin{wrapstuff}[r,top=1] +\begin{PostIt}[Inclinaison=5,Rendu=tikz,Couleur=pink, CouleurAttache=blue,Bordure=false] +\lipsum[1][1-2] +\end{PostIt} +\end{wrapstuff} + +\lipsum[1] +\end{DemoCode} + +\begin{DemoCode}[] +%usepackage{wrapstuff} +\begin{wrapstuff}[r,top=1] +\begin{PostIt}[Inclinaison=5,Rendu=tikzv2,Attache=Scotch,Couleur=pink] +\lipsum[1][1-2] +\end{PostIt} +\end{wrapstuff} + +\lipsum[1] +\end{DemoCode} + +\begin{DemoCode}[] Un petit Post-It aligné à droite, et centré verticalement : % -\hfill\begin{PostIt}[Inclinaison=-10,Couleur=orange,Largeur=5cm,Hauteur=5cm, AlignementV=center,Coin,CouleurAttache=yellow, DecalAttache=-1cm,AlignementPostIt=center] +\hfill\begin{PostIt}[Inclinaison=-10,Couleur=orange,Largeur=5cm,Hauteur=5cm, AlignementV=center,Coin,CouleurAttache=yellow, DecalAttache=-1,AlignementPostIt=center] \textsf{\small\lipsum[1][1-2]} \[\mathsf{\displaystyle\sum_{k=1}^{n} k = \dfrac{n(n+1)}{2}}\] - \end{PostIt} \end{DemoCode} -\vfill~ +%\begin{DemoCode}[] +%Un petit Post-It aligné à droite, et centré verticalement : +%% +%\hfill\begin{PostIt}[Inclinaison=-10,Couleur=orange,Largeur=5cm,Hauteur=5cm, AlignementV=center,Rendu=tikz,Attache=Non,AlignementPostIt=center] +% +%\textsf{\small\lipsum[1][1-2]} +%\[\mathsf{\displaystyle\sum_{k=1}^{n} k = \dfrac{n(n+1)}{2}}\] +%\end{PostIt} +%\end{DemoCode} +% +%\vfill~ \pagebreak @@ -390,7 +477,11 @@ Elle fonctionne sous forme autonome, avec uniquement la couleur en \Cle{option}. \smallskip -Cette fois-ci le \textit{mini-} Post-It est créé à l'aide d'une commande \textsf{tcbox}. +Cette fois-ci le \textit{mini-} Post-It est créé à l'aide d'une commande \motcletex!tcbox!. + +\smallskip + +Les dimensions ne sont pas modifiables, et un \motcletex!\vphantom! est inséré au début de la \motcletex!tcbox! afin d'harmoniser la hauteur. \end{cautionblock} \begin{DemoCode}[listing only] @@ -410,9 +501,149 @@ La couleur (\Cle{yellow}), est gérée par l'argument optionnel entre \texttt{[. \begin{DemoCode}[] On va travailler sur une équation diophantienne du type $ax+by=c$. -On va utiliser le \MiniPostIt*[orange]{théorème de Bezout} puis le \MiniPostIt{théorème de Gauss}. +On va utiliser le \MiniPostIt*[orange]{théorème de Bezout}, le \MiniPostIt{théorème de Gauss} sans oublier la \MiniPostIt*[cyan]{réciproque}. Le schéma de résolution est classique, et assez simple à appréhender ! \end{DemoCode} +\pagebreak + +\section{Résumé des styles} + +\subsection{Moteur de rendu tcbox} + +\begin{DemoCode}[text only] +\hfill\begin{PostIt} +\texttt{Ombre/Épingle/Bordure} +\end{PostIt} +\begin{PostIt}[Ombre=false] +\texttt{Épingle/Bordure} +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Bordure=false] +\texttt{Ombre/Épingle} +\end{PostIt} +\begin{PostIt}[Bordure=false,Ombre=false] +\texttt{Épingle} +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Attache=Trombone] +\texttt{Ombre/Trombone/Bordure}\\ +~ +\end{PostIt} +\begin{PostIt}[Attache=Scotch] +\texttt{Ombre/Scotch/Bordure}\\ +~ +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Attache=Non] +\texttt{Ombre/Bordure} +\end{PostIt} +\begin{PostIt}[Coin,Attache=Non] +\texttt{Ombre/Bordure/Coin} +\end{PostIt}\hfill~ + +\vspace{1cm} + +\hfill\begin{PostIt}[Titre={Lipsum[1][1-4]},PoliceTitre={\large\sffamily},Inclinaison=5,Couleur=pink,Hauteur=6cm,Attache=Scotch,AlignementV=center,Coin] +\lipsum[1][1-4] +\end{PostIt}\hfill~ +\end{DemoCode} + +\pagebreak + +\subsection{Moteur de rendu tikz} + +\begin{DemoCode}[text only] +\hfill\begin{PostIt}[Rendu=tikz] +\texttt{Ombre/Épingle/Bordure} +\end{PostIt} +\begin{PostIt}[Ombre=false,Rendu=tikz] +\texttt{Épingle/Bordure} +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Bordure=false,Rendu=tikz] +\texttt{Ombre/Épingle} +\end{PostIt} +\begin{PostIt}[Bordure=false,Ombre=false,Rendu=tikz] +\texttt{Épingle} +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Attache=Trombone,Rendu=tikz] +\texttt{Ombre/Trombone/Bordure}\\ +~ +\end{PostIt} +\begin{PostIt}[Attache=Scotch,Rendu=tikz] +\texttt{Ombre/Scotch/Bordure}\\ +~ +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Attache=Non,Rendu=tikz] +\texttt{Ombre/Bordure} +\end{PostIt}\hfill~ + +\vspace{1cm} + +\hfill\begin{PostIt}[Rendu=tikz,Titre={Lipsum[1][1-4]},PoliceTitre={\large\sffamily},Inclinaison=5,Couleur=pink,Hauteur=6cm,Attache=Scotch,AlignementV=center,Coin] +\lipsum[1][1-4] +\end{PostIt}\hfill~ +\end{DemoCode} + +\subsection{Moteur de rendu tikzv2} + +\begin{DemoCode}[text only] +\hfill\begin{PostIt}[Rendu=tikzv2] +\texttt{Ombre/Épingle/Bordure} +\end{PostIt} +\begin{PostIt}[Ombre=false,Rendu=tikzv2] +\texttt{Épingle/Bordure} +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Bordure=false,Rendu=tikzv2] +\texttt{Ombre/Épingle} +\end{PostIt} +\begin{PostIt}[Bordure=false,Ombre=false,Rendu=tikzv2] +\texttt{Épingle} +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Attache=Trombone,Rendu=tikzv2] +\texttt{Ombre/Trombone/Bordure}\\ +~ +\end{PostIt} +\begin{PostIt}[Attache=Scotch,Rendu=tikzv2] +\texttt{Ombre/Scotch/Bordure}\\ +~ +\end{PostIt}\hfill~ + +\medskip + +\hfill\begin{PostIt}[Attache=Non,Rendu=tikzv2] +\texttt{Ombre/Bordure} +\end{PostIt}\hfill~ + +\vspace{1cm} + +\hfill\begin{PostIt}[Rendu=tikzv2,Titre={Lipsum[1][1-4]},PoliceTitre={\large\sffamily},Inclinaison=5,Couleur=pink,Hauteur=6cm,Attache=Scotch,AlignementV=center,Coin] +\lipsum[1][1-4] +\end{PostIt}\hfill~ +\end{DemoCode} + + + \end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/postit/postit.sty b/Master/texmf-dist/tex/latex/postit/postit.sty index 76497257dfa..13dbd10ace7 100644 --- a/Master/texmf-dist/tex/latex/postit/postit.sty +++ b/Master/texmf-dist/tex/latex/postit/postit.sty @@ -3,15 +3,32 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{postit}[2023/05/31 0.1.0 Utiliser des post-it] +\ProvidesPackage{postit}[2023/06/05 0.1.1 Utiliser des post-it] +%0.1.1 Ajout d'un \vphantom pour les mini-post-it + moteur de rendu tikz en supplément %0.1.0 Version initiale %------Packages utiles \RequirePackage{tcolorbox} \RequirePackage{simplekv} \RequirePackage{xstring} +\RequirePackage{settobox} %------Librairies \tcbuselibrary{skins} +\usetikzlibrary{calc,positioning,decorations,decorations.pathmorphing} + +%------variables utiles +\newsavebox{\maboitepostit} +\newlength{\HauteurEssaiTexte} +\def\OffsetOmbreA{3pt} +\def\OffsetOmbreB{2pt} +\def\OffsetOmbreC{1pt} +\def\MarginHGPostIt{0.25} +\def\MarginHDPostIt{0.55} +\def\MarginVHPostIt{3mm} +\def\MarginVBPostIt{2mm} +\def\LargeurStotch{2.5} +\def\HauteurScotch{1} +\def\PostItBorder{0.1mm} %------Clés \defKV[postit]{% @@ -25,7 +42,11 @@ Attache=\def\PostItDeco{#1},% AlignementV=\def\PostItAlignV{#1},% AlignementH=\def\PostItAlignH{#1},% - AlignementPostIt=\def\PostItAlignPostIt{#1} + AlignementPostIt=\def\PostItAlignPostIt{#1},% + Rendu=\def\PostItRender{#1},% + ExtraMargeDroite=\def\PostItExtraMargin{#1},% + Titre=\def\PostItTitre{#1},% + PoliceTitre=\def\PostItPoliceTitre{#1} } \setKVdefault[postit]{% @@ -36,41 +57,54 @@ EchelleAttache=1,% Ombre=true,% Hauteur=auto,% - DecalAttache=0cm,% + DecalAttache=0,% Attache=Punaise,% AlignementV=top,% AlignementH=justify,% AlignementPostIt=bottom,% Bordure=true,% - Coin=false + Coin=false,% + Rendu=tcbox,% + ExtraMargeDroite=0cm,% + Titre={},% + PoliceTitre=\normalfont\normalsize } %------Style principal tcolorbox \tcbset{testpostit/.style={% - on line,enhanced,colback=\PostItCoul!50,colframe=\PostItCoul!50!black,boxrule=\PostItBorder,width=\PostItLarg,sharp corners,halign=\PostItAlignH,valign=\PostItAlignV,% + on line,enhanced,colframe=\PostItCoul!50!black,boxrule=\PostItBorder,width=\PostItLarg,sharp corners,halign=\PostItAlignH,valign=\PostItAlignV,% + %colback=\PostItCoul!50,% finish={\CommandeDecoration},tikz={rotate=\PostItIncline,transform shape},% box align=\PostItAlignPostIt,% + interior style={top color=\PostItCoul!50,bottom color=\PostItCoul!33},% nobeforeafter }% } %------Gestion du coin \NewDocumentCommand\CoinPostIt{ }{% - \path[line width=\PostItBorder,fill=\PostItCoul!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2); + \path[line width=\PostItBorder,fill=\PostItCoul!66] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2); \path[line width=\PostItBorder,draw=\PostItCoul!50!black,shorten <=-0.05mm,shorten >=-0.05mm,color=\PostItCoul!50!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2); } %------Gestion du trombone \NewDocumentCommand\TrombonePostIt{ }{% - \begin{scope}[shift={([xshift={-1cm+\PostItDeclClip}]frame.north east)},rotate=-15,scale={\PostItCoulScaleClip*0.55},line cap=round] + \begin{scope}[shift={([xshift={-1cm+\PostItDeclClip cm}]frame.north east)},rotate=-15,scale={\PostItCoulScaleClip*0.55},line cap=round] \draw[line width=0.81mm,draw=\PostItCoulClip!66] (0,0) --++ (0,0.0) arc (180:0:3.5mm) --++ (0,-1.75) arc (0:-180:3mm) --++ (0,1.25) ; \draw[line width=0.27mm,draw=\PostItCoulClip!33] (0,0) --++ (0,0.0) arc (180:0:3.5mm) --++ (0,-1.75) arc (0:-180:3mm) --++ (0,1.25) ; \end{scope} } +%------Gestion du scotch +\NewDocumentCommand\ScotchPostIt{ }{% + \begin{scope}[shift={([xshift=\PostItDeclClip cm]frame.north)},scale={\PostItCoulScaleClip*0.65},line cap=round,rotate=3] + \draw[thin,gray!50,fill=lightgray,fill opacity=0.75] ({-0.5*\LargeurStotch},{-0.5*\HauteurScotch}) to ({0.5*\LargeurStotch},{-0.5*\HauteurScotch}) decorate [decoration={zigzag,segment length=2pt,amplitude=0.5pt}] {to ({0.5*\LargeurStotch},{0.5*\HauteurScotch})} to ({-0.5*\LargeurStotch},{0.5*\HauteurScotch}) decorate [decoration={zigzag,segment length=2pt,amplitude=0.5pt}] {to cycle} ; + \end{scope} +} + %------Gestion de la punaise \NewDocumentCommand\EpinglePostIt{ }{% - \begin{scope}[shift={([xshift=\PostItDeclClip,yshift=-0.5cm]frame.north)},scale={\PostItCoulScaleClip*0.55},rotate=-40] + \begin{scope}[shift={([xshift=\PostItDeclClip cm,yshift=-0.5cm]frame.north)},scale={\PostItCoulScaleClip*0.55},rotate=-40] \begin{scope}[rotate=-35] \draw[blue!10!gray,line cap=round,line width=2pt] (0,0) -- ++(90:0.85); \fill[blue!10!gray,scale=0.5] (90:0.85) ellipse (.65cm and .3cm) ; @@ -81,58 +115,444 @@ \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ellipse (.65cm and .3cm) ; \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ++(0,0.4) ellipse (.2 and .4); \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ++(0,0.8) ellipse (.4 and .3); - \end{scope} } %------Environnement principal -\NewDocumentEnvironment{PostIt}{ O{} D<>{} }% +\NewDocumentEnvironment{PostIt}{ O{} D<>{} +b }% {% \restoreKV[postit]% \setKV[postit]{#1}% - %choix de la déco et paramètrage - \def\CommandeDecoration{\EpinglePostIt}% - \def\MarginOffsetV{4mm}% - \IfStrEq{\PostItDeco}{Trombone}% - {\def\CommandeDecoration{\TrombonePostIt}\def\MarginOffsetV{0mm}}% - {}% - \IfStrEq{\PostItDeco}{Non}% - {\def\CommandeDecoration{}\def\MarginOffsetV{0mm}}% - {}% - %cas de la bordure - \ifboolKV[postit]{Bordure}% - {% - \def\PostItBorder{0.1mm}% - \tcbset{bordure/.style={}}% - }% + \IfStrEq{\PostItRender}{tcbox}% {% - \def\PostItBorder{0mm}% - \tcbset{bordure/.style={frame hidden}}% - }% - %cas du coin - \ifboolKV[postit]{Coin}% + %choix de la déco et paramètrage + \def\CommandeDecoration{\EpinglePostIt}% + \def\MarginOffsetV{4mm}% + \IfStrEq{\PostItDeco}{Trombone}% + {\def\CommandeDecoration{\TrombonePostIt}\def\MarginOffsetV{0mm}}% + {}% + \IfStrEq{\PostItDeco}{Scotch}% + {\def\CommandeDecoration{\ScotchPostIt}\def\MarginOffsetV{1mm}}% + {}% + \IfStrEq{\PostItDeco}{Non}% + {\def\CommandeDecoration{}\def\MarginOffsetV{0mm}}% + {}% + %cas de la bordure + \ifboolKV[postit]{Bordure}% + {% + \def\PostItBorder{0.1mm}% + \tcbset{bordure/.style={}}% + }% + {% + \def\PostItBorder{0mm}% + \tcbset{bordure/.style={frame hidden}}% + }% + %cas du coin + \ifboolKV[postit]{Coin}% + {% + \tcbset{coincoin/.style={rounded corners=southeast,arc is angular,arc=3mm,underlay={\CoinPostIt}}}% + }% + {% + \tcbset{coincoin/.style={}}% + }% + %en fonction de hauteur auto ou non + \IfStrEq{\PostItHauteur}{auto}% + {% + \ifboolKV[postit]{Ombre}% + {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,drop fuzzy shadow,top={2mm+\MarginOffsetV}]}% + {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,top={2mm+\MarginOffsetV}]}% + }% + {% + \ifboolKV[postit]{Ombre}% + {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,drop fuzzy shadow,height=\PostItHauteur,top={2mm+\MarginOffsetV}]}% + {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,height=\PostItHauteur,top={2mm+\MarginOffsetV}]}% + }% + \IfStrEq{\PostItTitre}{}% + {}% + {% + \hfill{}{\PostItPoliceTitre\PostItTitre}\hfill~\\% + }% + #3% + \end{tcolorbox}% + }{}% + \IfStrEq{\PostItRender}{tikz}% {% - \tcbset{coincoin/.style={rounded corners=southeast,arc is angular,arc=3mm,underlay={\CoinPostIt}}}% - }% + \StrDel{\PostItLarg}{cm}[\PostItLarg]% + \StrDel{\PostItExtraMargin}{cm}[\PostItExtraMargin]% + \def\LargeurTextePostIt{\fpeval{\PostItLarg-\MarginHGPostIt-\MarginHDPostIt}}% + \def\TextePostIt{% + \IfStrEq{\PostItTitre}{}{}{\hfill{}{\PostItPoliceTitre\PostItTitre}\hfill~\\}% + #3% + }% + \IfStrEq{\PostItHauteur}{auto}% + {% + \sbox{\maboitepostit}{\parbox{\LargeurTextePostIt cm}{\TextePostIt}}% + \settoboxtotalheight{\HauteurEssaiTexte}{\maboitepostit}% + \addtolength\HauteurEssaiTexte{\MarginVHPostIt}\addtolength\HauteurEssaiTexte{\MarginVBPostIt}% + \IfStrEq{\PostItDeco}{Scotch}% + {\addtolength\HauteurEssaiTexte{0.4cm}}% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {\addtolength\HauteurEssaiTexte{0.2cm}}% + {}% + \IfStrEq{\PostItDeco}{Punaise}% + {\addtolength\HauteurEssaiTexte{0.6cm}}% + {}% + \IfStrEq{\PostItDeco}{Non}% + {\addtolength\HauteurEssaiTexte{0.2cm}}% + {}% + \def\hauteur{\the\HauteurEssaiTexte}% + }% + {% + \def\hauteur{\PostItHauteur}% + }% + \def\OptionTikzPostIt{current bounding box.south}% + \IfStrEq{\PostItAlignPostIt}{center}% + {\def\OptionTikzPostIt{current bounding box.center}}{}% + \IfStrEq{\PostItAlignPostIt}{top}% + {\def\OptionTikzPostIt{current bounding box.north}}{}% + \begin{tikzpicture}[baseline=(\OptionTikzPostIt),rotate=\PostItIncline,line join=bevel,line cap=round] + %tracé + %ombre1/2/3 + \ifboolKV[postit]{Ombre}% + {% + \draw[draw=none,fill=gray,semithick,fill=gray,fill opacity=0.5] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=104] ++ ($({0.15},{-\hauteur+0.15})+(\OffsetOmbreA,-\OffsetOmbreA)$) + to[out=182,in=-2] ++ ({-0.15-\PostItLarg-\PostItExtraMargin},{0.13}) + -- cycle ; + \draw[draw=none,fill=gray!50!black,semithick,fill=gray!50!black,fill opacity=0.5] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=104] ++ ($({0.15},{-\hauteur+0.15})+(\OffsetOmbreB,-\OffsetOmbreB)$) + to[out=182,in=-2] ++ ({-0.15-\PostItLarg-\PostItExtraMargin},{0.13}) + -- cycle ; + \draw[draw=none,fill=black,semithick,fill=black,fill opacity=0.5] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=104] ++ ($({0.15},{-\hauteur+0.15})+(\OffsetOmbreC,-\OffsetOmbreC)$) + to[out=182,in=-2] ++ ({-0.15-\PostItLarg-\PostItExtraMargin},{0.13}) + -- cycle ; + }% + {}% + %postit + \ifboolKV[postit]{Bordure} + {% + \shadedraw[draw=\PostItCoul!50!black,line width=0.1mm,top color=\PostItCoul!50,bottom color=\PostItCoul!33] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=104] ++ ({0.15},{-\hauteur+0.15}) + to[out=182,in=-2] ++ ({-0.15-\PostItLarg-\PostItExtraMargin},{0.13}) + -- cycle ; + }% + {% + \shadedraw[draw=none,top color=\PostItCoul!50,bottom color=\PostItCoul!33] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=104] ++ ({0.15},{-\hauteur+0.15}) + to[out=182,in=-2] ++ ({-0.15-\PostItLarg-\PostItExtraMargin},{0.13}) + -- cycle ; + }% + \IfStrEq{\PostItHauteur}{auto}% + {% + \IfStrEq{\PostItDeco}{Punaise}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.4cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Non}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Scotch}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.2cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + {% + \IfStrEq{\PostItAlignV}{top} + {% + \IfStrEq{\PostItDeco}{Punaise}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.4cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Non}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Scotch}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.2cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + {}% + \IfStrEq{\PostItAlignV}{center} + {% + \IfStrEq{\PostItDeco}{Punaise}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur-\MarginVHPostIt-0.2cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Non}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Scotch}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + {}% + \IfStrEq{\PostItAlignV}{bottom} + {% + \draw ({0.5*\PostItLarg},{-\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,above=0.6cm,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + %affichage de la punaise + \IfStrEq{\PostItDeco}{Punaise}% + {% + \begin{scope}[shift={(0.5*\PostItLarg+0.5*\PostItExtraMargin+\PostItDeclClip,-0.49)},scale={0.55},rotate=-40] + \begin{scope}[rotate=-35] + \draw[blue!10!gray,line cap=round,line width=2pt] (0,0) -- ++(90:0.85); + \fill[blue!10!gray,scale=0.5] (90:0.85) ellipse (.65cm and .3cm) ; + \fill[blue!10!gray,scale=0.5] (90:0.85) ++(0,0.4) ellipse (.2 and .4); + \fill[blue!10!gray,scale=0.5] (90:0.85) ++(0,0.8) ellipse (.4 and .3); + \end{scope} + \draw[line cap=round,line width=2pt] (0,0) -- ++(90:0.85); + \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ellipse (.65cm and .3cm) ; + \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ++(0,0.4) ellipse (.2 and .4); + \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ++(0,0.8) ellipse (.4 and .3); + \end{scope} + }% + {}% + %affichage du trombone + \IfStrEq{\PostItDeco}{Trombone}% + {% + \begin{scope}[shift={(\PostItLarg+\PostItExtraMargin-1+\PostItDeclClip,0)},rotate=-15,scale={\PostItCoulScaleClip*0.55},line cap=round] + \draw[line width=0.81mm,draw=\PostItCoulClip!66] (0,0) --++ (0,0.0) arc (180:0:3.5mm) --++ (0,-1.75) arc (0:-180:3mm) --++ (0,1.25) ; + \draw[line width=0.27mm,draw=\PostItCoulClip!33] (0,0) --++ (0,0.0) arc (180:0:3.5mm) --++ (0,-1.75) arc (0:-180:3mm) --++ (0,1.25) ; + \end{scope} + }% + {}% + %affichage du scotch + \IfStrEq{\PostItDeco}{Scotch}% + {% + \begin{scope}[shift={(0.5*\PostItLarg+0.5*\PostItExtraMargin+\PostItDeclClip,0)},scale={0.65},rotate=3,line cap=round] + \draw[thin,gray!50,fill=lightgray,fill opacity=0.75] ({-0.5*\LargeurStotch},{-0.5*\HauteurScotch}) to ({0.5*\LargeurStotch},{-0.5*\HauteurScotch}) decorate [decoration={zigzag,segment length=2pt,amplitude=0.5pt}] {to ({0.5*\LargeurStotch},{0.5*\HauteurScotch})} to ({-0.5*\LargeurStotch},{0.5*\HauteurScotch}) decorate [decoration={zigzag,segment length=2pt,amplitude=0.5pt}] {to cycle} ; + \end{scope} + }% + {}% + \end{tikzpicture}% + }{}% + \IfStrEq{\PostItRender}{tikzv2}% {% - \tcbset{coincoin/.style={}}% - }% - %en fonction de hauteur auto ou non - \IfStrEq{\PostItHauteur}{auto}% - {% - \ifboolKV[postit]{Ombre}% - {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,drop fuzzy shadow,top={2mm+\MarginOffsetV}]}% - {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,top={2mm+\MarginOffsetV}]}% - }% - {% - \ifboolKV[postit]{Ombre}% - {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,drop fuzzy shadow,height=\PostItHauteur,top={2mm+\MarginOffsetV}]}% - {\begin{tcolorbox}[testpostit,#2,bordure,coincoin,height=\PostItHauteur,top={2mm+\MarginOffsetV}]}% - }% + \StrDel{\PostItLarg}{cm}[\PostItLarg]% + \StrDel{\PostItExtraMargin}{cm}[\PostItExtraMargin]% + \def\LargeurTextePostIt{\fpeval{\PostItLarg-\MarginHGPostIt-\MarginHDPostIt}}% + \def\TextePostIt{% + \IfStrEq{\PostItTitre}{}{}{\hfill{}{\PostItPoliceTitre\PostItTitre}\hfill~\\}% + #3% + }% + \IfStrEq{\PostItHauteur}{auto}% + {% + \sbox{\maboitepostit}{\parbox{\LargeurTextePostIt cm}{\TextePostIt}}% + \settoboxtotalheight{\HauteurEssaiTexte}{\maboitepostit}% + \addtolength\HauteurEssaiTexte{\MarginVHPostIt}\addtolength\HauteurEssaiTexte{\MarginVBPostIt}% + \IfStrEq{\PostItDeco}{Scotch}% + {\addtolength\HauteurEssaiTexte{0.4cm}}% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {\addtolength\HauteurEssaiTexte{0.2cm}}% + {}% + \IfStrEq{\PostItDeco}{Punaise}% + {\addtolength\HauteurEssaiTexte{0.6cm}}% + {}% + \IfStrEq{\PostItDeco}{Non}% + {\addtolength\HauteurEssaiTexte{0.2cm}}% + {}% + \def\hauteur{\the\HauteurEssaiTexte}% + }% + {% + \def\hauteur{\PostItHauteur}% + }% + \def\OptionTikzPostIt{current bounding box.south}% + \IfStrEq{\PostItAlignPostIt}{center}% + {\def\OptionTikzPostIt{current bounding box.center}}{}% + \IfStrEq{\PostItAlignPostIt}{top}% + {\def\OptionTikzPostIt{current bounding box.north}}{}% + \begin{tikzpicture}[baseline=(\OptionTikzPostIt),rotate=\PostItIncline,line join=bevel,line cap=round] + %tracé + %ombre1/2/3 + \ifboolKV[postit]{Ombre}% + {% + \draw[draw=none,fill=gray,semithick,fill=gray,fill opacity=0.5] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=91] ++ ($({0.05},{-\hauteur-0.05})+(2pt,-2pt)$) + --++ ($({-\PostItLarg-\PostItExtraMargin-0.1},{0})+(-4pt,0)$) + to[out=89,in=-90] (0,0) ; + \draw[draw=none,fill=gray!50!black,semithick,fill=gray!50!black,fill opacity=0.5] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=91] ++ ($({0.05},{-\hauteur-0.05})+(1.25pt,-1.25pt)$) + --++ ($({-\PostItLarg-\PostItExtraMargin-0.1},{0})+(-2.5pt,0)$) + to[out=89,in=-90] (0,0) ; + \draw[draw=none,fill=black,semithick,fill=black,fill opacity=0.5] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=91] ++ ($({0.05},{-\hauteur-0.05})+(0.5pt,-0.5pt)$) + --++ ($({-\PostItLarg-\PostItExtraMargin-0.1},{0})+(-1pt,0)$) + to[out=89,in=-90] (0,0) ; + }% + {}% + %postit + \ifboolKV[postit]{Bordure} + {% + \shadedraw[draw=\PostItCoul!50!black,line width=0.1mm,top color=\PostItCoul!50,bottom color=\PostItCoul!33] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=91] ++ ({0.05},{-\hauteur-0.05}) + --++ ({-\PostItLarg-\PostItExtraMargin-0.1},{0}) + to[out=89,in=-90] (0,0) ; + }% + {% + \shadedraw[draw=none,top color=\PostItCoul!50,bottom color=\PostItCoul!33] + (0,0) --++ ({\PostItLarg+\PostItExtraMargin},0) + to[out=-90,in=91] ++ ({0.05},{-\hauteur-0.05}) + --++ ({-\PostItLarg-\PostItExtraMargin-0.1},{0}) + to[out=89,in=-90] (0,0) ; + }% + \IfStrEq{\PostItHauteur}{auto}% + {% + \IfStrEq{\PostItDeco}{Punaise}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.4cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Non}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Scotch}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.2cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + {% + \IfStrEq{\PostItAlignV}{top} + {% + \IfStrEq{\PostItDeco}{Punaise}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.4cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Non}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Scotch}% + {% + \draw ({0.5*\PostItLarg},{-\MarginVHPostIt-0.2cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,below,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + {}% + \IfStrEq{\PostItAlignV}{center} + {% + \IfStrEq{\PostItDeco}{Punaise}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur-\MarginVHPostIt-0.2cm}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Non}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Trombone}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + \IfStrEq{\PostItDeco}{Scotch}% + {% + \draw ({0.5*\PostItLarg},{-0.5*\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + {}% + \IfStrEq{\PostItAlignV}{bottom} + {% + \draw ({0.5*\PostItLarg},{-\hauteur}) node[text width=\LargeurTextePostIt cm,rotate=\PostItIncline,above=0.6cm,align=\PostItAlignH,inner sep=0pt] {\TextePostIt} ; + }% + {}% + }% + %affichage de la punaise + \IfStrEq{\PostItDeco}{Punaise}% + {% + \begin{scope}[shift={(0.5*\PostItLarg+0.5*\PostItExtraMargin+\PostItDeclClip,-0.49)},scale={0.55},rotate=-40] + \begin{scope}[rotate=-35] + \draw[blue!10!gray,line cap=round,line width=2pt] (0,0) -- ++(90:0.85); + \fill[blue!10!gray,scale=0.5] (90:0.85) ellipse (.65cm and .3cm) ; + \fill[blue!10!gray,scale=0.5] (90:0.85) ++(0,0.4) ellipse (.2 and .4); + \fill[blue!10!gray,scale=0.5] (90:0.85) ++(0,0.8) ellipse (.4 and .3); + \end{scope} + \draw[line cap=round,line width=2pt] (0,0) -- ++(90:0.85); + \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ellipse (.65cm and .3cm) ; + \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ++(0,0.4) ellipse (.2 and .4); + \fill[ball color=\PostItCoulClip!66,scale=0.5] (90:0.85) ++(0,0.8) ellipse (.4 and .3); + \end{scope} + }% + {}% + %affichage du trombone + \IfStrEq{\PostItDeco}{Trombone}% + {% + \begin{scope}[shift={(\PostItLarg+\PostItExtraMargin-1+\PostItDeclClip,0)},rotate=-15,scale={\PostItCoulScaleClip*0.55},line cap=round] + \draw[line width=0.81mm,draw=\PostItCoulClip!66] (0,0) --++ (0,0.0) arc (180:0:3.5mm) --++ (0,-1.75) arc (0:-180:3mm) --++ (0,1.25) ; + \draw[line width=0.27mm,draw=\PostItCoulClip!33] (0,0) --++ (0,0.0) arc (180:0:3.5mm) --++ (0,-1.75) arc (0:-180:3mm) --++ (0,1.25) ; + \end{scope} + }% + {}% + %affichage du scotch + \IfStrEq{\PostItDeco}{Scotch}% + {% + \begin{scope}[shift={(0.5*\PostItLarg+0.5*\PostItExtraMargin+\PostItDeclClip,0)},scale={0.65},rotate=3,line cap=round] + \draw[thin,gray!50,fill=lightgray,fill opacity=0.75] ({-0.5*\LargeurStotch},{-0.5*\HauteurScotch}) to ({0.5*\LargeurStotch},{-0.5*\HauteurScotch}) decorate [decoration={zigzag,segment length=2pt,amplitude=0.5pt}] {to ({0.5*\LargeurStotch},{0.5*\HauteurScotch})} to ({-0.5*\LargeurStotch},{0.5*\HauteurScotch}) decorate [decoration={zigzag,segment length=2pt,amplitude=0.5pt}] {to cycle} ; + \end{scope} + }% + {}% + \end{tikzpicture}% + }{}% }% -{% - \end{tcolorbox}% -} +{}% %------Style principal minitcbox \tcbset{testminipostit/.style={% @@ -148,6 +568,7 @@ \NewTCBox{\MiniPostIt}{ s O{yellow} }{% testminipostit,colback=#2!50,colframe=#2!50!black,rounded corners=southeast,arc is angular,arc=2mm,% + before upper=\vphantom{pL}, underlay={ \path[line width=0.1mm,fill=#2!80!black] ([yshift=2mm]interior.south east)--++(-0.25,-0.1)--++(0.05,-0.1); \path[line width=0.1mm,draw=#2!50!black,shorten <=-0.05mm,shorten >=-0.05mm,color=#2!50!black] ([yshift=2mm]interior.south east)--++(-0.25,-0.1)--++(0.05,-0.1); |