diff options
Diffstat (limited to 'macros/latex/contrib/customenvs')
-rw-r--r-- | macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf | bin | 116272 -> 182916 bytes | |||
-rw-r--r-- | macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex | 83 | ||||
-rw-r--r-- | macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf | bin | 519283 -> 1399073 bytes | |||
-rw-r--r-- | macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex | 92 | ||||
-rw-r--r-- | macros/latex/contrib/customenvs/doc/envtexo_exemples.tex | 160 | ||||
-rw-r--r-- | macros/latex/contrib/customenvs/tex/customenvs.sty | 323 |
6 files changed, 569 insertions, 89 deletions
diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf Binary files differindex c4a06de15b..f1bf30aacc 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex index 4bc63e0c5f..b8352c628d 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex @@ -34,8 +34,8 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.3} -\def\TPdate{30/03/2024} +\def\TPversion{0.1.4} +\def\TPdate{04/04/2024} \usepackage{tcolorbox} \sethlcolor{lightgray!25} \NewDocumentCommand\MontreCode{ m }{% @@ -111,6 +111,8 @@ \section{History} +\verb|v0.1.4|~:~~~~Create a SMS conversation + \verb|v0.1.3|~:~~~~Environment for exercise(s) (in french doc) \verb|v0.1.2|~:~~~~Pencil of skills @@ -357,7 +359,7 @@ The idea is to : \begin{itemize} \item present of list of categories and skills ; - \item prensented like a pencil. + \item presented like a pencil. \end{itemize} The code (within CC-BY-SA 4.0 license) is adapted from : @@ -420,4 +422,79 @@ The last argument, mandatory and between \MontreCode{(...)} give the list of cat Search/Skill 1\\Skill 2,Model/{Skill 1\\Skill 2}} \end{demohigh} +\pagebreak + +\section{SMS conversation} + +\subsection{Global use} + +The idea is to present a conversation of SMS. + +\begin{codehigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25] +\begin{ChatSMS}[keys]{name} + \InSMS(*){time}{msg} + \OutSMS*(*){time}{msg} +\end{ChatSMS} +\end{codehigh} + +The style is globally fixed, but there's some customization available. + +\subsection{The environment} + +Available \MontreCode{keys} are : + +\begin{itemize} + \item \MontreCode{height} : height of the window (auto or specific) ; \MontreCode{auto} by default + \item \MontreCode{width} : width of the window ; \MontreCode{7cm} by default + \item \MontreCode{margin} : margin (L or R) for the bubble \MontreCode{1.5cm} by default + \item \MontreCode{color} : \textit{main} color (banner) ; \MontreCode{teal!75!cyan!75!white} by default ; + \item \MontreCode{colback} : color for background ; \MontreCode{lightgray!5} by default + \item \MontreCode{colorin} : color for incoming SMS ; \MontreCode{lime!25} by default + \item \MontreCode{colorout} : color for outcoming SMS ; \MontreCode{teal!25} by default + \item \MontreCode{writetxt} : text of sending zone ; \MontreCode{Write} by default + \item \MontreCode{fonttxt} : bubble's font ; \MontreCode{\textbackslash normalfont} by default + \item \MontreCode{avatar} : avatar of contact ; \MontreCode{\textbackslash faAddressCard} by default + \item \MontreCode{dispavatar} : boolean for displaying avatar near the bubbles ; \MontreCode{false} by default + \item \MontreCode{blackwhite} : boolean pour black\&white. \MontreCode{false} by default +\end{itemize} + +The argument, mandatory and between \MontreCode{(...)} give the name of the contact. + +\subsection{Macros for the bubbles} + +Regarding the bubble creation commands, \MontreCode{\textbackslash InSMS} and \MontreCode{\textbackslash OutSMS}: + +\begin{itemize} + \item the \textit{starred} version does not display the \textit{checkmarks} of \textit{good reception}; + \item the first mandatory argument is the time to display ; + \item the second mandatory argument is the message to display (including multi-lines). +\end{itemize} + +\subsection{Examples} + +\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25] +%with a personal image +\begin{ChatSMS}% + [width=6cm,fonttxt=\sffamily,height=10cm,avatar=img/android,dispavatar]{CP} + \InSMS{19:23}{Hi !} + \OutSMS{19:23}{Hi !\\ How are you ?} + \InSMS{19:25}{Just a problem with a math question\ldots} + \OutSMS{19:26}{Wanna help ??} + \InSMS{19:28}{Yes, I need to compute $\mathsf{\int_{0}^{1} x^2e^{-x}\,dx}$\ldots} + \OutSMS*{19:30}{Take care !!} +\end{ChatSMS} +\end{demohigh} + +\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25] +\begin{ChatSMS}% + [width=8cm,fonttxt=\sffamily,avatar=\faCanadianMapleLeaf,blackwhite]{CP} + \InSMS{19:23}{Hi !} + \OutSMS{19:23}{Hi !\\ How are you ?} + \InSMS{19:25}{Just a problem with a math question\ldots} + \OutSMS{19:26}{Wanna help ??} + \InSMS{19:28}{Yes, I need to compute $\mathsf{\int_{0}^{1} x^2e^{-x}\,dx}$\ldots} + \OutSMS*{19:30}{Take care !!} +\end{ChatSMS} +\end{demohigh} + \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf Binary files differindex c81bd43b7f..87d7507f61 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex index 650bb37932..9cdaeadf73 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex @@ -39,9 +39,9 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.3} -\def\TPdate{30 mars 2024} -\usepackage[most]{tcolorbox} +\def\TPversion{0.1.4} +\def\TPdate{4 avril 2024} +\usepackage{tcolorbox} \tcbuselibrary{listingsutf8} \newtcblisting{DemoCode}[1]{% enhanced,width=0.95\linewidth,center,% @@ -66,10 +66,10 @@ keywordstyle={\color{violet}},% classoffset=2,% alsoletter={-},% - morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences,\CrayonDeCompetences,\StyleEnvtExo,\StyleEnvtExoDefaut,\TitreExo,\ipsum},% + morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences,\CrayonDeCompetences,\StyleEnvtExo,\StyleEnvtExoDefaut,\TitreExo,\ipsum,EnvSMS,\SMSrec,\SMSenv},% keywordstyle={\color{green!50!black}},% classoffset=3,% - morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,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},% + morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,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},% keywordstyle={\color{orange}} },% #1 @@ -788,6 +788,88 @@ L'argument, obligatoire et entre \MontreCode{\{...\}} est la liste des catégori \pagebreak +\section{Fenêtre type conversation instantanée} + +\subsection{Principe et fonctionnement} + +L'idée est de proposer un environnement pour créer une fenêtre type \textit{conversation instantanée}, basée sur \MontreCode{tcolorbox}. + +\begin{DemoCode}{listing only} +\begin{EnvSMS}[Clés]{nom} + \SMSrec(*){heure}{msg} + \SMSenv(*){heure}{msg} +\end{EnvSMS} +\end{DemoCode} + +\begin{DemoCode}{} +\begin{EnvSMS}{\LaTeX} + \SMSrec{19:23}{Salut !} + \SMSenv{19:23}{Salut!\\ Comment ça va~?} +\end{EnvSMS} +\end{DemoCode} + +La forme générale est fixée, et seuls quelques éléments de personnalisation(s) sont modifiables. + +\subsection{L'environnement} + +Les \MontreCode{clés} disponibles pour l'environnement, à donner entre \MontreCode{[...]}, sont : + +\begin{itemize} + \item \MontreCode{Hauteur} : hauteur de la fenêtre (automatique ou spécifique) ; \MontreCode{auto} par défaut + \item \MontreCode{Largeur} : largeur de la fenêtre (un minimum de 5 cm est conseillé) ; \MontreCode{7cm} par défaut + \item \MontreCode{Marge} : marge (G ou D) pour les bulles \MontreCode{1.5cm} par défaut + \item \MontreCode{Couleur} : couleur \textit{principale} (bandeau) ; \MontreCode{teal!75!cyan!75!white} par défaut ; + \item \MontreCode{CouleurFond} : couleur du fond ; \MontreCode{lightgray!5} par défaut + \item \MontreCode{CouleurR} : couleur des bulles de réception ; \MontreCode{lime!25} par défaut + \item \MontreCode{CouleurE} : couleur des bulles d'envoi ; \MontreCode{teal!5} par défaut + \item \MontreCode{TxtEcrire} : texte dans la zone d'envoi ; \MontreCode{Écrire} par défaut + \item \MontreCode{PoliceTxt} : police des textes ; \MontreCode{\textbackslash normalfont} par défaut + \item \MontreCode{Avatar} : avatar du contact ; \MontreCode{\textbackslash faAddressCard} par défaut + \item \MontreCode{AffAvatar} : booléen pour ajouter l'avatar aux bulles de réception ; \MontreCode{false} par défaut + \item \MontreCode{NoirBlanc} : booléen pour forcer un affichage N\&B. \MontreCode{false} par défaut +\end{itemize} + +L'argument, obligatoire et entre \MontreCode{\{...\}}, est le nom du contact à afficher. + +\subsection{Les commandes de création des bulles} + +En ce qui concerne les commandes de création des bulles, \MontreCode{\textbackslash SMSrec} et \MontreCode{\textbackslash SMSenv} : + +\begin{itemize} + \item la version \textit{étoilée} n'affiche pas les \textit{coches} de \textit{bonne réception} ; + \item le premier argument obligatoire est l'heure à afficher ; + \item le deuxième argument obligatoire est le message à afficher (y compris multi-lignes). +\end{itemize} + +\subsection{Exemples} + +\begin{DemoCode}{} +%avec une image personnelle +\begin{EnvSMS}% + [Largeur=5cm,Hauteur=13cm,AffAvatar,Avatar=Image/avatar]{CP} + \SMSrec{19:23}{Salut !} + \SMSenv{19:23}{Salut!\\ Comment ça va~?} + \SMSrec{19:25}{Je n'arrive pas à un truc en maths\ldots} + \SMSenv{19:26}{Tu veux un coup de main ??} + \SMSrec{19:28}{Oui, faut qu'je calcule $\int_{0}^{1} x^2e^{-x}\,dx$\ldots} + \SMSenv*{19:30}{Je m'en occupe !!} +\end{EnvSMS} +\end{DemoCode} + +\begin{DemoCode}{} +\begin{EnvSMS}% + [Largeur=8cm,PoliceTxt=\sffamily,NoirBlanc]{CP} + \SMSrec{19:23}{Salut !} + \SMSenv{19:23}{Salut!\\ Comment ça va~?} + \SMSrec{19:25}{Je n'arrive pas à un truc en maths\ldots} + \SMSenv{19:26}{Tu veux un coup de main ??} + \SMSrec{19:28}{Oui, faut que je calcule $\mathsf{\int_{0}^{1} x^2e^{-x}\,dx}$\ldots} + \SMSenv*{19:30}{Je m'en occupe !!} +\end{EnvSMS} +\end{DemoCode} + +\pagebreak + \section{Titre d'exercices} \subsection{Principe et définition du style global} diff --git a/macros/latex/contrib/customenvs/doc/envtexo_exemples.tex b/macros/latex/contrib/customenvs/doc/envtexo_exemples.tex index bc9bf990f7..e782579dec 100644 --- a/macros/latex/contrib/customenvs/doc/envtexo_exemples.tex +++ b/macros/latex/contrib/customenvs/doc/envtexo_exemples.tex @@ -1,80 +1,80 @@ -% !TeX TXS-program:compile = txs:///arara -% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} -% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') - -\documentclass[a5paper,11pt]{article} -\usepackage[margin=1cm]{geometry} -\usepackage{customenvs} -%facultatif, pour les décorations -\usepackage{graphicx} -\usepackage{dashrulex} -\usepackage{coloredbelts} -\usepackage{pictochrono} -%mise en page -\usepackage{ipsum} -\setlength{\parindent}{0pt} - -\begin{document} - -\begin{EnvtExo}%exo1 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Trait=pointilles]%exo2 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Trait=dashilles]%exo3 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Decoration=Icone/\faPython]%exo4 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Decoration=Ceinture/rouge]%exo5 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Decoration=Chrono/20]%exo6 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Decoration=Image/goku_ssj4]%exo7 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Decoration=Image/sseiya_shura]%exo8 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Decoration=Points/7]%exo9 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Type=Perso/{Titre perso }]%exo10 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\StyleEnvtExo[Couleur=red,Police=\bfseries\ttfamily,EpTrait=2pt,Libelle={Exercice n°}] - -\begin{EnvtExo}[Decoration=Icone/\faAddressBook]%exo11 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\begin{EnvtExo}[Type=Perso/{Titre perso },Decoration=Chrono/25,Couleur=red,Trait=dashilles]%exo12 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\StyleEnvtExoDefaut - -\begin{EnvtExo}% - [Type=Perso/{Titre perso~},Decoration=Image/goku_ssj4,Trait=non,Compteur=false]%exo13 - \ipsum<Lang=FR,Type=sent> -\end{EnvtExo} - -\TitreExo[Type=Perso/{Annexe Exercice 3},Compteur=false,Decoration=Image/sseiya_aiolos]%exo14 - -\ipsum<Lang=FR,Type=sent> - -\end{document} +% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
+
+\documentclass[a5paper,11pt]{article}
+\usepackage[margin=1cm]{geometry}
+\usepackage{customenvs}
+%facultatif, pour les décorations
+\usepackage{graphicx}
+\usepackage{dashrulex}
+\usepackage{coloredbelts}
+\usepackage{pictochrono}
+%mise en page
+\usepackage{ipsum}
+\setlength{\parindent}{0pt}
+
+\begin{document}
+
+\begin{EnvtExo}%exo1
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Trait=pointilles]%exo2
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Trait=dashilles]%exo3
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Decoration=Icone/\faPython]%exo4
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Decoration=Ceinture/rouge]%exo5
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Decoration=Chrono/20]%exo6
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Decoration=Image/goku_ssj4]%exo7
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Decoration=Image/sseiya_shura]%exo8
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Decoration=Points/7]%exo9
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Type=Perso/{Titre perso }]%exo10
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\StyleEnvtExo[Couleur=red,Police=\bfseries\ttfamily,EpTrait=2pt,Libelle={Exercice n°}]
+
+\begin{EnvtExo}[Decoration=Icone/\faAddressBook]%exo11
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\begin{EnvtExo}[Type=Perso/{Titre perso },Decoration=Chrono/25,Couleur=red,Trait=dashilles]%exo12
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\StyleEnvtExoDefaut
+
+\begin{EnvtExo}%
+ [Type=Perso/{Titre perso~},Decoration=Image/goku_ssj4,Trait=non,Compteur=false]%exo13
+ \ipsum<Lang=FR,Type=sent>
+\end{EnvtExo}
+
+\TitreExo[Type=Perso/{Annexe Exercice 3},Compteur=false,Decoration=Image/sseiya_aiolos]%exo14
+
+\ipsum<Lang=FR,Type=sent>
+
+\end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/customenvs/tex/customenvs.sty b/macros/latex/contrib/customenvs/tex/customenvs.sty index 08083eb103..ee8f4427a2 100644 --- a/macros/latex/contrib/customenvs/tex/customenvs.sty +++ b/macros/latex/contrib/customenvs/tex/customenvs.sty @@ -3,9 +3,10 @@ % 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}[2024/03/30 0.1.3 Custom classic environments] +\ProvidesPackage{customenvs}[2024/04/04 0.1.4 Custom classic environments] %====HISTORIQUE +% v 0.1.4 Commande (en/fr) pour du texte dans une boîte arrondie, de hauteur 'figée' + 'Chat' SMS % v 0.1.3 Environnement/Commande pour présentation d'un exercice % v 0.1.2 Crayon de compétences % v 0.1.1 Ajout de tableaux de compétences @@ -54,6 +55,8 @@ \RequirePackage{calc} \RequirePackage{tikz} \usetikzlibrary{decorations.pathmorphing,positioning,shapes.misc,calc} +\usepackage{tcolorbox} +\tcbuselibrary{skins} %%----COMMANDES FR @@ -913,6 +916,179 @@ \EnvtExoCodeAvant% } +%====BOITE ARRONDIE +\newlength{\tmpheightbox} +\defKV[BoiteArrondie]{EspH=\def\RoundedBoxDelta{#1},Style=\def\RoundedBoxStyle{#1}} +\setKVdefault[BoiteArrondie]{% + Fond=red,% + Texte=white,% + EspH=0.25em,% + Style=rect +} +\NewDocumentCommand\BoiteArrondie{ O{} m O{char} }{% + \restoreKV[BoiteArrondie]% + \setKV[BoiteArrondie]{#1}% + \settototalheight{\tmpheightbox}{\hbox{(EazertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN)#2}}%hauteur globale + \IfStrEqCase{\RoundedBoxStyle}{% + {rect}{\tikz[remember picture,baseline=(#3.base)]{\node[minimum height=\tmpheightbox,shape=rectangle,rounded corners=0.25em,fill={\useKV[BoiteArrondie]{Fond}},inner sep=0.75pt,outer sep=0pt,text={\useKV[BoiteArrondie]{Texte}}] (#3) {\vphantom{(qE)}\kern\RoundedBoxDelta#2\kern\RoundedBoxDelta};}}% + {cercle}{\tikz[remember picture,baseline=(#3.base)]{\node[shape=circle,minimum height=\tmpheightbox,fill={\useKV[BoiteArrondie]{Fond}},inner sep=0.75pt,outer sep=0pt,text={\useKV[BoiteArrondie]{Texte}}] (#3) {\vphantom{(qE)}#2};}}% + }\relax +} + +%%====Chat SMS + +%===Données utiles +\newlength{\WidthofSMS} +\newlength{\HeightofSMS} +\newlength{\OffsetofSMS} +\newlength{\WidthofSMSavatar} +\newlength{\MarginofSMSavatar} +\colorlet{smscolp}{teal!75!cyan!75!white} +\colorlet{smscoltitle}{white} + +%===Styles [FR/EN] +\tcbset{SMSglobal/.style={ + enhanced,arc=0pt,outer arc=0pt,colback=\ProjectSmsColback,toptitle=0.3cm,bottomtitle=0.3cm,title={\null}, + overlay={ + %la barre de titre + \node[anchor=east,smscoltitle,font=\large] at ([xshift=-1mm]title.east) {\faVideo~~\faPhone*~~\faEllipsisV}; + \node[draw=none,anchor=west,inner sep=1pt,text=smscoltitle,font=\large] at ([xshift=1mm]title.west) (picture) {\ProjectSmsAvat}; + \node[draw=none,anchor=west,text=smscoltitle,font=\large,text depth=0pt,inner sep=1pt] at (picture.east) {\sffamily\bfseries\vphantom{pB}\NameofSMS} ; + %le bas + \draw[line width=0.85pt,darkgray] ([yshift=1cm]frame.south west) -- ([yshift=1cm]frame.south east); + \node[draw=smscolp!75!black,top color=lightgray!40,bottom color=lightgray!40,middle color=white,line width=1pt,rounded corners=2pt,text width={{\WidthofSMS-2.5cm}},minimum height=0.75cm,font=\large\ProjectSmsFonte,text=darkgray,inner xsep=6pt] at ([shift={(0,0.5cm)}]frame.south) {\textcolor{gray}{\rule[-0.1cm]{1pt}{0.5cm}}\,\ProjectSmsWrite}; + \node[draw=none,font=\LARGE,text=darkgray!50,anchor=east,align=center] at ([shift={(-1mm,0.5cm)}]frame.south east) (send) {\faPaperPlane}; + \node[draw=none,font=\LARGE,text=darkgray!50,anchor=west,align=center] at ([shift={(1mm,0.5cm)}]frame.south west) (add) {\faPlusCircle}; + }, + boxrule=0.85pt,colframe=darkgray, + title style={top color=smscolp!90!black,bottom color=smscolp!90!black,middle color=smscolp!75}, + bottom=1.15cm,top=0mm,left=1mm,right=1mm + } +} + +%===Keys [FR] +\defKV[ProjetSMS]{% + Hauteur=\def\ProjectSmsHeight{#1},% + Largeur=\setlength{\WidthofSMS}{#1},% + Marge=\setlength{\OffsetofSMS}{#1},% + Couleur=\colorlet{smscolp}{#1},% + CouleurFond=\def\ProjectSmsColback{#1},% + CouleurR=\def\ProjectSmsColIn{#1},% + CouleurE=\def\ProjectSmsColOut{#1},% + CouleurTitre=\colorlet{smscoltitle}{#1},% + PoliceTxt=\def\ProjectSmsFonte{#1},% + Avatar=\def\ProjectSmsAvatar{#1},% + TxtEcrire=\def\ProjectSmsWrite{#1} +} +\setKVdefault[ProjetSMS]{% + Hauteur=auto,% + Largeur=7cm,% + Marge=1.5cm,% + CouleurFond={lightgray!5},% + CouleurR=lime!25,% + CouleurE=teal!25,% + TxtEcrire={Écrire\ldots},% + PoliceTxt=\normalfont,% + Avatar=\faAddressCard,% + AffAvatar=false,% + NoirBlanc=false +} + +%===Envt [FR] +\NewDocumentEnvironment{EnvSMS}{ O{} m } +{ + \restoreKV[ProjetSMS]% + \setKV[ProjetSMS]{#1}% + \def\NameofSMS{#2}% + \IfSubStr{\ProjectSmsAvatar}{Image}% + {% + \StrBehind{\ProjectSmsAvatar}{/}[\tmpimgavatar]% + \def\ProjectSmsAvat{\includegraphics[height=0.5cm]{\tmpimgavatar}}% + \ifboolKV[ProjetSMS]{AffAvatar}% + {% + \setlength{\WidthofSMSavatar}{\widthof{\includegraphics[height=0.5\baselineskip]{\tmpimgavatar}}}% + \setlength{\MarginofSMSavatar}{\WidthofSMSavatar+2pt}% + }% + {% + \setlength{\MarginofSMSavatar}{0pt}% + }% + }% + {% + \def\ProjectSmsAvat{\ProjectSmsAvatar}% + \ifboolKV[ProjetSMS]{AffAvatar}% + {% + \setlength{\WidthofSMSavatar}{\widthof{\tiny\ProjectSmsAvatar}}% + \setlength{\MarginofSMSavatar}{\WidthofSMSavatar+2pt}% + }% + {% + \setlength{\MarginofSMSavatar}{0pt}% + }% + }% + \IfStrEq{\ProjectSmsHeight}{auto}% + {% + \tcbset{SMSsize/.style={width=\WidthofSMS}}% + }% + {% + \setlength{\HeightofSMS}{\ProjectSmsHeight}% + \tcbset{SMSsize/.style={width=\WidthofSMS,height=\HeightofSMS,valign=bottom}}% + }% + \ifboolKV[ProjetSMS]{NoirBlanc}% + {% + \colorlet{smscolp}{lightgray!25}% + \def\ProjectSmsColback{lightgray!5}% + \def\ProjectSmsColIn{lightgray!10}% + \def\ProjectSmsColOut{lightgray!10}% + \colorlet{smscoltitle}{gray}% + }% + {}% + \tcolorbox[SMSsize,SMSglobal]% +} +{ + \endtcolorbox% +} + +%===Macros [FR] +\NewDocumentCommand\SMSrec{ s m m }{% + \ifboolKV[ProjetSMS]{AffAvatar}% + {% + \IfSubStr{\ProjectSmsAvatar}{Image}% + {% + \tcbset{SMSAffLogo/.style={left skip=\MarginofSMSavatar,overlay={\node[anchor=north east] at ([yshift={1mm+1pt}]interior.north west) {\includegraphics[height=0.5\baselineskip]{\tmpimgavatar}};}}}% + }% + {% + \tcbset{SMSAffLogo/.style={left skip=\MarginofSMSavatar,overlay={\node[anchor=north east,font=\tiny,text=gray] at ([yshift={1mm+1pt}]interior.north west) {\ProjectSmsAvatar};}}}% + }% + }% + {% + \tcbset{SMSAffLogo/.style={}}% + }% + \tcbox[enhanced,interior code={},before skip=0.5mm,after skip=0.5mm,halign=left,left=1.5mm,right=1.5mm, + frame code={ + \filldraw[\ProjectSmsColIn,draw=black,rounded corners=4pt] + (frame.south east) rectangle (frame.north west) ; + }, + width={\WidthofSMS-\OffsetofSMS},top=1mm,bottom=1mm, + capture=minipage,fontupper=\small\ProjectSmsFonte, + attach boxed title to top left, + coltitle=black,fonttitle=\scriptsize\sffamily, + boxed title style={size=fbox,bottom=0pt,boxsep=2pt,frame empty,interior empty}, + title={\@ifpackageloaded{babel}{\NoAutoSpacing#2}{#2}\IfBooleanTF{#1}{$\cdot$\scalebox{0.6}[0.6]{\faCheckCircle[regular]\!\faCheckCircle[regular]}~}{}},left=1mm,right=1mm,boxsep=0mm,SMSAffLogo]{#3}% +} +\NewDocumentCommand\SMSenv{ s m m }{% + \tcbox[enhanced,interior code={},before skip=0.5mm,after skip=0.5mm,halign=left,left=1.5mm,right=1.5mm, + frame code={ + \filldraw[\ProjectSmsColOut,draw=black,rounded corners=4pt] + (frame.south east) rectangle (frame.north west) ; + }, + width={\WidthofSMS-\OffsetofSMS},top=1mm,bottom=1mm,flush right, + capture=minipage,fontupper=\small\ProjectSmsFonte, + attach boxed title to top right, + coltitle=black,fonttitle=\scriptsize\sffamily, + boxed title style={size=fbox,bottom=0pt,boxsep=2pt,frame empty,interior empty}, + title={\@ifpackageloaded{babel}{\NoAutoSpacing#2}{#2}\IfBooleanTF{#1}{}{$\cdot$\scalebox{0.6}[0.6]{\faCheckCircle[regular]\!\faCheckCircle[regular]}~}},left=1mm,right=1mm,boxsep=0mm]{#3}% +} + + %%----COMMANDES EN %====QCMs @@ -1169,4 +1345,149 @@ \end{tikzpicture}% } +%====ROUNDED BOX +\defKV[RoundedBox]{hmargin=\def\RoundedBoxDelta{#1},style=\def\RoundedBoxStyle{#1}} +\setKVdefault[RoundedBox]{% + bg=red,% + txt=white,% + hmargin=0.25em,% + style=rect +} + + + +\NewDocumentCommand\RoundedBox{ O{} m O{char} }{% + \restoreKV[RoundedBox]% + \setKV[RoundedBox]{#1}% + \settototalheight{\tmpheightbox}{\hbox{(EazertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN)#2}}%hauteur globale + \IfStrEqCase{\RoundedBoxStyle}{% + {rect}{\tikz[remember picture,baseline=(#3.base)]{\node[minimum height=\tmpheightbox,shape=rectangle,rounded corners=0.25em,fill={\useKV[RoundedBox]{bg}},inner sep=0.75pt,outer sep=0pt,text={\useKV[RoundedBox]{txt}}] (#3) {\vphantom{(qE)}\kern\RoundedBoxDelta#2\kern\RoundedBoxDelta};}}% + {circle}{\tikz[remember picture,baseline=(#3.base)]{\node[minimum height=\tmpheightbox,shape=circle,fill={\useKV[RoundedBox]{bg}},inner sep=0.75pt,outer sep=0pt,text={\useKV[RoundedBox]{txt}}] (#3) {\vphantom{(qE)}#2};}}% + }\relax +} + +%====Chat SMS +%===Keys [EN] +\defKV[ProjectSMS]{% + height=\def\ProjectSmsHeight{#1},% + width=\setlength{\WidthofSMS}{#1},% + margin=\setlength{\OffsetofSMS}{#1},% + color=\colorlet{smscolp}{#1},% + colback=\def\ProjectSmsColback{#1},% + colorin=\def\ProjectSmsColIn{#1},% + colorout=\def\ProjectSmsColOut{#1},% + coltitle=\colorlet{smscoltitle}{#1},% + fonttxt=\def\ProjectSmsFonte{#1},% + avatar=\def\ProjectSmsAvatar{#1},% + writetxt=\def\ProjectSmsWrite{#1} +} +\setKVdefault[ProjectSMS]{% + height=auto,% + width=7cm,% + margin=1.5cm,% + colback=lightgray!5,% + colorin=lime!25,% + colorout=teal!25,% + writetxt={Write\ldots},% + fonttxt=\normalfont,% + avatar=\faAddressCard,% + dispavatar=false,% + blackwhite=false +} + +%===Envt [EN] +\NewDocumentEnvironment{ChatSMS}{ O{} m } +{ + \restoreKV[ProjectSMS]% + \setKV[ProjectSMS]{#1}% + \def\NameofSMS{#2}% + \IfSubStr{\ProjectSmsAvatar}{img}% + {% + \StrBehind{\ProjectSmsAvatar}{/}[\tmpimgavatar]% + \def\ProjectSmsAvat{\includegraphics[height=0.5cm]{\tmpimgavatar}}% + \ifboolKV[ProjectSMS]{dispavatar}% + {% + \setlength{\WidthofSMSavatar}{\widthof{\includegraphics[height=0.5\baselineskip]{\tmpimgavatar}}}% + \setlength{\MarginofSMSavatar}{\WidthofSMSavatar+2pt}% + }% + {% + \setlength{\MarginofSMSavatar}{0pt}% + }% + }% + {% + \def\ProjectSmsAvat{\ProjectSmsAvatar}% + \ifboolKV[ProjectSMS]{dispavatar}% + {% + \setlength{\WidthofSMSavatar}{\widthof{\tiny\ProjectSmsAvatar}}% + \setlength{\MarginofSMSavatar}{\WidthofSMSavatar+2pt}% + }% + {% + \setlength{\MarginofSMSavatar}{0pt}% + }% + }% + \IfStrEq{\ProjectSmsHeight}{auto}% + {% + \tcbset{SMSsize/.style={width=\WidthofSMS}}% + }% + {% + \setlength{\HeightofSMS}{\ProjectSmsHeight}% + \tcbset{SMSsize/.style={width=\WidthofSMS,height=\HeightofSMS,valign=bottom}}% + }% + \ifboolKV[ProjectSMS]{blackwhite}% + {% + \colorlet{smscolp}{lightgray!25}% + \def\ProjectSmsColback{lightgray!5}% + \def\ProjectSmsColIn{lightgray!10}% + \def\ProjectSmsColOut{lightgray!10}% + \colorlet{smscoltitle}{gray}% + }% + {}% + \tcolorbox[SMSsize,SMSglobal]% +} +{ + \endtcolorbox% +} + +%===Macros [EN] +\NewDocumentCommand\InSMS{ s m m }{% + \ifboolKV[ProjectSMS]{dispavatar}% + {% + \IfSubStr{\ProjectSmsAvatar}{img}% + {% + \tcbset{SMSAffLogo/.style={left skip=\MarginofSMSavatar,overlay={\node[anchor=north east] at ([yshift={1mm+1pt}]interior.north west) {\includegraphics[height=0.5\baselineskip]{\tmpimgavatar}};}}}% + }% + {% + \tcbset{SMSAffLogo/.style={left skip=\MarginofSMSavatar,overlay={\node[anchor=north east,font=\tiny,text=gray] at ([yshift={1mm+1pt}]interior.north west) {\ProjectSmsAvatar};}}}% + }% + }% + {% + \tcbset{SMSAffLogo/.style={}}% + }% + \tcbox[enhanced,interior code={},before skip=0.5mm,after skip=0.5mm,halign=left,left=1.5mm,right=1.5mm, + frame code={ + \filldraw[\ProjectSmsColIn,draw=black,rounded corners=4pt] + (frame.south east) rectangle (frame.north west) ; + }, + width={\WidthofSMS-\OffsetofSMS},top=1mm,bottom=1mm, + capture=minipage,fontupper=\small\ProjectSmsFonte, + attach boxed title to top left, + coltitle=black,fonttitle=\scriptsize\sffamily, + boxed title style={size=fbox,bottom=0pt,boxsep=2pt,frame empty,interior empty}, + title={#2\IfBooleanTF{#1}{$\cdot$\scalebox{0.6}[0.6]{\faCheckCircle[regular]\!\faCheckCircle[regular]}~}{}},left=1mm,right=1mm,boxsep=0mm,SMSAffLogo]{#3}% +} +\NewDocumentCommand\OutSMS{ s m m }{% + \tcbox[enhanced,interior code={},before skip=0.5mm,after skip=0.5mm,halign=left,left=1.5mm,right=1.5mm, + frame code={ + \filldraw[\ProjectSmsColOut,draw=black,rounded corners=4pt] + (frame.south east) rectangle (frame.north west) ; + }, + width={\WidthofSMS-\OffsetofSMS},top=1mm,bottom=1mm,flush right, + capture=minipage,fontupper=\small\ProjectSmsFonte, + attach boxed title to top right, + coltitle=black,fonttitle=\scriptsize\sffamily, + boxed title style={size=fbox,bottom=0pt,boxsep=2pt,frame empty,interior empty}, + title={#2\IfBooleanTF{#1}{}{$\cdot$\scalebox{0.6}[0.6]{\faCheckCircle[regular]\!\faCheckCircle[regular]}~}},left=1mm,right=1mm,boxsep=0mm]{#3}% +} + + \endinput
\ No newline at end of file |