| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: lualatex: {shell: no, synctex: no, interaction: batchmode} |
| 3 |
% arara: lualatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') |
| 4 |
|
| 5 |
\documentclass[french,11pt,a4paper]{article} |
| 6 |
%\usepackage[utf8]{inputenc} |
| 7 |
%\usepackage[T1]{fontenc} |
| 8 |
%\usepackage{amssymb} |
| 9 |
\usepackage{amssymb} |
| 10 |
\usepackage{fontspec} |
| 11 |
\setmonofont[Scale=MatchLowercase]{Inconsolatazi4} |
| 12 |
\usepackage[normalulem]{CreationBoites} |
| 13 |
\usepackage{xstring} |
| 14 |
\usepackage{enumitem} |
| 15 |
%\RequirePackage[normalem]{ulem} |
| 16 |
\usepackage{soul} |
| 17 |
\usepackage{codehigh} |
| 18 |
\usepackage{multicol} |
| 19 |
\usepackage{tabularray} |
| 20 |
\usepackage{lipsum} |
| 21 |
\usepackage{fancyvrb} |
| 22 |
\usepackage{fancyhdr} |
| 23 |
\fancyhf{} |
| 24 |
\renewcommand{\headrulewidth}{0pt} |
| 25 |
%\rhead{\sffamily\small\affloetalab[Legende]} |
| 26 |
\lfoot{\sffamily\small [CreationBoites]} |
| 27 |
\cfoot{\sffamily\small - \thepage{} -} |
| 28 |
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} |
| 29 |
\usepackage{hologo} |
| 30 |
\providecommand\tikzlogo{Ti\textit{k}Z} |
| 31 |
\providecommand\TeXLive{\TeX{}Live\xspace} |
| 32 |
\providecommand\PSTricks{\textsf{PSTricks}\xspace} |
| 33 |
\let\pstricks\PSTricks |
| 34 |
\let\TikZ\tikzlogo |
| 35 |
|
| 36 |
\usepackage{hyperref} |
| 37 |
\urlstyle{same} |
| 38 |
\hypersetup{pdfborder=0 0 0} |
| 39 |
\usepackage[margin=1.5cm]{geometry} |
| 40 |
\setlength{\parindent}{0pt} |
| 41 |
|
| 42 |
\sethlcolor{lightgray!25} |
| 43 |
\NewDocumentCommand\MontreCode{ m }{% |
| 44 |
\hl{\vphantom{\texttt{pf}}\texttt{#1}}% |
| 45 |
} |
| 46 |
|
| 47 |
\CreationBoite[blue]{BoiteDeDemo}{CompteurBoiteDemo}{\faIcons}{Boîte Démo/Boîtes Démos} |
| 48 |
\CreationBoite[red]{BoiteDanger}{CompteurBoiteDanger}{\twemoji{warning}}{Danger/Dangers}[colback=red!10] |
| 49 |
\CreationBoiteAlt[orange]{montestcadre}{cpttestcadre}{Boîte Démo Alt}{Boîtes Démo Alt}{$\blacktriangleright$\,} |
| 50 |
|
| 51 |
\usepackage{babel} |
| 52 |
|
| 53 |
\begin{document} |
| 54 |
|
| 55 |
\pagestyle{fancy} |
| 56 |
|
| 57 |
\thispagestyle{empty} |
| 58 |
|
| 59 |
\begin{center} |
| 60 |
\begin{minipage}{0.88\linewidth} |
| 61 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 62 |
\begin{center} |
| 63 |
\begin{tabular}{c} |
| 64 |
{\Huge \texttt{CreationBoites}}\\ |
| 65 |
\\ |
| 66 |
{\LARGE Création \textit{semi-}automatique de boîtes \textit{tcbox}} \\ |
| 67 |
\\ |
| 68 |
{\LARGE avec quelques éléments de personnalisation.} \\ |
| 69 |
\\ |
| 70 |
{\small \texttt{Version \cbpackageversion{} -- \cbpackagedate}} |
| 71 |
\end{tabular} |
| 72 |
\end{center} |
| 73 |
\end{tcolorbox} |
| 74 |
\end{minipage} |
| 75 |
\end{center} |
| 76 |
|
| 77 |
\begin{center} |
| 78 |
\begin{tabular}{c} |
| 79 |
\texttt{Cédric Pierquet}\\ |
| 80 |
{\ttfamily c pierquet -- at -- outlook . fr}\\ |
| 81 |
%\texttt{\url{https://forge.apps.education.fr/pierquetcedric/packages-latex}}\\ |
| 82 |
\texttt{\url{https://github.com/cpierquet/latex-packages/tree/main/creationboites}} |
| 83 |
\end{tabular} |
| 84 |
\end{center} |
| 85 |
|
| 86 |
\hrule |
| 87 |
|
| 88 |
\vfill |
| 89 |
|
| 90 |
\begin{tcolorbox}[colframe=lightgray,colback=white] |
| 91 |
\begin{BoiteDeDemo} |
| 92 |
\lipsum[1][1] |
| 93 |
\end{BoiteDeDemo} |
| 94 |
|
| 95 |
\begin{BoiteDeDemo}[Compteur=false] |
| 96 |
\lipsum[1][1] |
| 97 |
\end{BoiteDeDemo} |
| 98 |
|
| 99 |
\begin{BoiteDeDemo}[Pluriel] |
| 100 |
\lipsum[1][1] |
| 101 |
\end{BoiteDeDemo} |
| 102 |
|
| 103 |
\begin{BoiteDeDemo}[SousTitre={Un petit sous-titre}] |
| 104 |
\lipsum[1][1] |
| 105 |
\end{BoiteDeDemo} |
| 106 |
|
| 107 |
\begin{BoiteDeDemo}[ComplementTitre={ - Un complément de titre}]%noter l'espace ;-) |
| 108 |
\lipsum[1][1] |
| 109 |
\end{BoiteDeDemo} |
| 110 |
|
| 111 |
\begin{BoiteDeDemo}[ModifLabel={ super important}]%noter l'espace ;-) |
| 112 |
\lipsum[1][1] |
| 113 |
\end{BoiteDeDemo} |
| 114 |
|
| 115 |
\begin{BoiteDeDemo}[Logo={example-image}] |
| 116 |
\lipsum[1][1] |
| 117 |
\end{BoiteDeDemo} |
| 118 |
|
| 119 |
\begin{BoiteDeDemo}[Icone={\faLightbulb}] |
| 120 |
\lipsum[1][1] |
| 121 |
\end{BoiteDeDemo} |
| 122 |
|
| 123 |
\begin{BoiteDanger}[Compteur=false,Emoji=snake] |
| 124 |
\lipsum[1][1] |
| 125 |
\end{BoiteDanger} |
| 126 |
\end{tcolorbox} |
| 127 |
|
| 128 |
\begin{tcolorbox}[colframe=lightgray,colback=white] |
| 129 |
\begin{montestcadre}[SouligneLabel] |
| 130 |
\lipsum[1][1] |
| 131 |
\end{montestcadre} |
| 132 |
\end{tcolorbox} |
| 133 |
|
| 134 |
\vfill~ |
| 135 |
|
| 136 |
\pagebreak |
| 137 |
|
| 138 |
\phantomsection |
| 139 |
|
| 140 |
\hypertarget{matoc}{} |
| 141 |
|
| 142 |
\tableofcontents |
| 143 |
|
| 144 |
\vspace*{5mm} |
| 145 |
|
| 146 |
\hrule |
| 147 |
|
| 148 |
\pagebreak |
| 149 |
|
| 150 |
\section{Le package CreationBoites} |
| 151 |
|
| 152 |
\subsection{Idées} |
| 153 |
|
| 154 |
L'idée est de proposer un moyen de \textit{générer} des boîtes simples, créées grâce à \MontreCode{tcolorbox}, de manière \textit{semi}-automatisée. |
| 155 |
|
| 156 |
\smallskip |
| 157 |
|
| 158 |
Chaque boîte sera définie -- avec un style global -- via : |
| 159 |
|
| 160 |
\begin{itemize} |
| 161 |
\item un \textbf{nom} (pour l'environnement) ; |
| 162 |
\item un nom de \textbf{compteur} pour la numéroter ; |
| 163 |
\item une \textbf{couleur} (optionnelle et noire par défaut) ; |
| 164 |
\item une \textbf{icône} ou un \textbf{logo} ou un \textbf{emoji} ; |
| 165 |
\item un \textbf{label} (singulier ou pluriel). |
| 166 |
\end{itemize} |
| 167 |
|
| 168 |
\medskip |
| 169 |
|
| 170 |
Il ne faut pas voir ce package comme un outil avancé de création, \MontreCode{tcolorbox} étant déjà suffisamment complet pour que l'utilisateur puisse faire tout ce dont il a envie, mais comme un \textit{assistant simple} pour créer des boîtes pour des supports de cours par exemple ! |
| 171 |
|
| 172 |
\subsection{Les couleurs} |
| 173 |
|
| 174 |
De manière expérimentale, la création de chaque boîte va également : |
| 175 |
|
| 176 |
\begin{itemize} |
| 177 |
\item créer un nom de couleur de \textit{bordure} ; |
| 178 |
\item créer un nom de couleur de \textit{fond} (titre ou boîte en fonction du style) ; |
| 179 |
\item permettre d'utiliser la couleur courante de \textit{bordure} ou de \textit{fond} via des couleurs \textit{génériques}. |
| 180 |
\end{itemize} |
| 181 |
|
| 182 |
Les couleurs \textit{courantes} (à l'intérieur d'une boîte) sont définies par \MontreCode{cbcoulbord} et \MontreCode{cbcoulfond}. |
| 183 |
|
| 184 |
\subsection{Chargement} |
| 185 |
|
| 186 |
Le package se charge dans le préambule, via \MontreCode{\textbackslash usepackage\{CreationBoites\}}. |
| 187 |
|
| 188 |
Les seuls packages chargés sont : |
| 189 |
|
| 190 |
\begin{itemize} |
| 191 |
\item \MontreCode{tcolorbox} (avec les libraires \MontreCode{fitting,skins}) ; |
| 192 |
\item \MontreCode{fontawesome}, \MontreCode{simplekv}, \MontreCode{twemojis} ;% et \MontreCode{xstring} ; |
| 193 |
\item la librairie \MontreCode{breakable} avec l'option \MontreCode{[breakable]} de chargement du package ; |
| 194 |
\item le package \MontreCode{ulem} avec les options \MontreCode{[ulem]} ou \MontreCode{[normalulem]} de chargement du package. |
| 195 |
\end{itemize} |
| 196 |
|
| 197 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 198 |
\usepackage{CreationBoites} %version classique, avec fa5, par défaut |
| 199 |
\usepackage[nonfa]{CreationBoites} %sans fa |
| 200 |
\usepackage[fa6]{CreationBoites} %version avec fa6 |
| 201 |
\usepackage[fa7]{CreationBoites} %version avec fa7 |
| 202 |
\end{codehigh} |
| 203 |
|
| 204 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 205 |
\usepackage[breakable]{CreationBoites} %version avec breakable |
| 206 |
\end{codehigh} |
| 207 |
|
| 208 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 209 |
\usepackage[ulem]{CreationBoites} %version avec ulem |
| 210 |
\usepackage[normalulem]{CreationBoites} %version avec [normalem]ulem |
| 211 |
\end{codehigh} |
| 212 |
|
| 213 |
\pagebreak |
| 214 |
|
| 215 |
\subsection{Fonctionnement basique} |
| 216 |
|
| 217 |
Le package propose deux macros principales : |
| 218 |
|
| 219 |
\begin{itemize} |
| 220 |
\item \MontreCode{\textbackslash CreationBoite} pour créer les différentes boîtes/environnements ; |
| 221 |
\item \MontreCode{\textbackslash ParamBoites} pour une modification \textit{globale} de certains paramètres des boîtes (polices et marges). |
| 222 |
\end{itemize} |
| 223 |
|
| 224 |
\medskip |
| 225 |
|
| 226 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 227 |
\CreationBoite[Couleur]{Nom}{Compteur}{Icône}{Libellés}[options tcbox] |
| 228 |
\ParamBoites[Clés] |
| 229 |
\end{codehigh} |
| 230 |
|
| 231 |
\medskip |
| 232 |
|
| 233 |
La couleur de la bordure (pour réutilisation) est donc définie de manière globale par \MontreCode{cbcoulbord<Nom>}. |
| 234 |
|
| 235 |
La couleur du fond (pour réutilisation) est donc définie de manière globale par \MontreCode{cbcoulfond<Nom>}. |
| 236 |
|
| 237 |
\medskip |
| 238 |
|
| 239 |
Ainsi, les exemples de boîtes données sur la page de garde ont été créées grâce à : |
| 240 |
|
| 241 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 242 |
\CreationBoite% |
| 243 |
[blue] %Couleur de base |
| 244 |
{BoiteDeDemo} %Nom de l'environnement |
| 245 |
{CompteurBoiteDemo} %Compteur |
| 246 |
{\faIcons} %Icône |
| 247 |
{Boîte Démo/Boîtes Démos} %Libellés (sing/plur) |
| 248 |
|
| 249 |
\CreationBoite% |
| 250 |
[red] %Couleur de base |
| 251 |
{BoiteDanger} %Nom de l'environnement |
| 252 |
{CompteurBoiteDanger} %Compteur |
| 253 |
{\twemoji{warning}} %Emoji |
| 254 |
{Danger/Dangers} %Libellés (sing/plur) |
| 255 |
[colback=red!10] %options tcbox spécifiques pour la boîte Danger |
| 256 |
\end{codehigh} |
| 257 |
|
| 258 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 259 |
\setcounter{CompteurBoiteDemo}{0} |
| 260 |
\setcounter{CompteurBoiteDanger}{0} |
| 261 |
\begin{BoiteDeDemo} |
| 262 |
\lipsum[1][1] |
| 263 |
\end{BoiteDeDemo} |
| 264 |
|
| 265 |
\begin{BoiteDanger} |
| 266 |
\lipsum[2][1] |
| 267 |
\end{BoiteDanger} |
| 268 |
\end{demohigh} |
| 269 |
|
| 270 |
Dans ce cas la boîte est créée grâce à la syntaxe suivante : |
| 271 |
|
| 272 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 273 |
\begin{NomEnv}[Clés]<Options tcbox> |
| 274 |
... |
| 275 |
\end{NomEnv} |
| 276 |
\end{codehigh} |
| 277 |
|
| 278 |
\pagebreak |
| 279 |
|
| 280 |
\section{Utilisation basique} |
| 281 |
|
| 282 |
\subsection{Style global de la boîte} |
| 283 |
|
| 284 |
Le style global des boîtes est défini par : |
| 285 |
|
| 286 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 287 |
\tcbset{baseboite/.style={ |
| 288 |
enhanced,sharp corners=uphill,boxrule=\eptraitboite,% |
| 289 |
before skip=0.5em,after skip=0.5em,% |
| 290 |
colback=white,top=4mm,% |
| 291 |
left={\margeboite-\margeinttitreboite-\eptraitboite},% |
| 292 |
right={\margeboite-\margeinttitreboite-\eptraitboite} |
| 293 |
}% |
| 294 |
} |
| 295 |
\end{codehigh} |
| 296 |
|
| 297 |
À noter que le \MontreCode{\textbackslash margeboite-\textbackslash margeinttitreboite-\textbackslash eptraitboite} vient : |
| 298 |
|
| 299 |
\begin{itemize} |
| 300 |
\item des \MontreCode{\textbackslash margeinttitreboite} du paramètre \MontreCode{inner sep} du nœud Ti\textit{k}Z ; |
| 301 |
\item des \MontreCode{\textbackslash eptraitboite} du paramètre \MontreCode{boxrule} de la boîte \textit{titre}. |
| 302 |
\end{itemize} |
| 303 |
|
| 304 |
\subsection{Paramétrage simple de la boîte} |
| 305 |
|
| 306 |
Il est possible de rajouter ou modifier quelques éléments de chaque boîte (les clés suivantes sont cumulables) : |
| 307 |
|
| 308 |
\begin{itemize} |
| 309 |
\item un \textsf{sous-titre} (couleur \textsf{rouge foncé}) peut être ajouté (en haut à droite de la boîte), via la clé \MontreCode{[SousTitre=...]} ; |
| 310 |
\item le label peut être modifié : |
| 311 |
\begin{itemize} |
| 312 |
\item le compteur peut être désactivé, grâce à la clé \MontreCode{[Compteur=false]} ; |
| 313 |
\item la clé \MontreCode{[Pluriel]} force le pluriel du label ; |
| 314 |
\item un complément peut être rajouté entre le label et le compteur grâce à la clé \MontreCode{[ModifLabel=...]} ; |
| 315 |
\item un complément peut être rajouté après le compteur grâce à la clé \MontreCode{[ComplementTitre=...]} ; |
| 316 |
\end{itemize} |
| 317 |
\item une petite image (type \textit{filigrane}) peut être rajoutée (de hauteur 24pt et pivotée de 45° dans le sens horaire par défaut), dans le coin \textit{bas-droite} de la boîte : |
| 318 |
\begin{itemize} |
| 319 |
\item en spécifiant l'image grâce à la clé \MontreCode{[Logo=...]} ; |
| 320 |
\item en spécifiant hauteur/rotation/opacité grâce aux clés \MontreCode{[HauteurLogo=...]} , \MontreCode{[RotationLogo=...]} et \MontreCode{[OpaciteLogo=...]} ; |
| 321 |
\end{itemize} |
| 322 |
\item un petit emoji (type \textit{filigrane}) peut être rajoutée (de hauteur 24pt et pivotée de 45° dans le sens horaire par défaut), dans le coin \textit{bas-droite} de la boîte : |
| 323 |
\begin{itemize} |
| 324 |
\item en spécifiant l'emoji grâce à la clé \MontreCode{[Emoji=...]} ; |
| 325 |
\item en spécifiant hauteur/rotation/opacité grâce aux clés \MontreCode{[HauteurLogo=...]} , \MontreCode{[RotationLogo=...]} et \MontreCode{[OpaciteLogo=...]} ; |
| 326 |
\end{itemize} |
| 327 |
\item une petit logo (type \textsf{fontawesome5}) peut être rajoutée (d'échelle 1 et pivotée de 30° dans le sens horaire par défaut), dans le coin \textit{bas-droite} de la boîte : |
| 328 |
\begin{itemize} |
| 329 |
\item en spécifiant l'image grâce à la clé \MontreCode{[Icone=...]} ; |
| 330 |
\item en spécifiant échelle/rotation/opacité grâce aux clés \MontreCode{[EchelleIcone=...]} , \MontreCode{[RotationIcone=...]} et \MontreCode{[OpaciteIcone=...]}. |
| 331 |
\end{itemize} |
| 332 |
\end{itemize} |
| 333 |
|
| 334 |
Dans le cas de l'utilisation de \MontreCode{[Logo=...]}/\MontreCode{[Icone=...]}/\MontreCode{[Emoji=...]}, il est également possible de spécifier la position relative par rapport au coin inférieur droit, via la clé \MontreCode{[OffsetDeco=\{xoffset,yoffset\}]} (valant \MontreCode{\{-10pt,10pt\}} par défaut). |
| 335 |
|
| 336 |
\medskip |
| 337 |
|
| 338 |
Des options spécifiques \MontreCode{tcolorbox} peuvent être passées en option à l'environnement, elles sont à mettre entre \MontreCode{<...>} avant le corps de l'environnement. |
| 339 |
|
| 340 |
\pagebreak |
| 341 |
|
| 342 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 343 |
\setcounter{CompteurBoiteDemo}{0} |
| 344 |
\begin{BoiteDeDemo}[Compteur=false] |
| 345 |
\lipsum[1][1-2] |
| 346 |
\end{BoiteDeDemo} |
| 347 |
\end{demohigh} |
| 348 |
|
| 349 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 350 |
\begin{BoiteDeDemo}[Pluriel]<width=0.5\linewidth> |
| 351 |
On peut utiliser la couleur de \textcolor{cbcoulbord}{bordure} et la couleur de \fcolorbox{cbcoulbord}{cbcoulfond}{fond du titre}. |
| 352 |
|
| 353 |
Il est possible d'utiliser la \textcolor{cbcoulbordmontestcadre}{couleur} de la boîte \texttt{montestcadre}. |
| 354 |
\end{BoiteDeDemo} |
| 355 |
\end{demohigh} |
| 356 |
|
| 357 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 358 |
\begin{BoiteDeDemo}[SousTitre={Un petit sous-titre}] |
| 359 |
\lipsum[1][1-2] |
| 360 |
\end{BoiteDeDemo} |
| 361 |
\end{demohigh} |
| 362 |
|
| 363 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 364 |
\begin{BoiteDeDemo}[ComplementTitre={ - Un complément de titre}]%noter l'espace ;-) |
| 365 |
\lipsum[1][1-2] |
| 366 |
\end{BoiteDeDemo} |
| 367 |
\end{demohigh} |
| 368 |
|
| 369 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 370 |
\begin{BoiteDeDemo}[ModifLabel={ super important}]%noter l'espace ;-) |
| 371 |
\lipsum[1][1-2] |
| 372 |
\end{BoiteDeDemo} |
| 373 |
\end{demohigh} |
| 374 |
|
| 375 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 376 |
\begin{BoiteDeDemo}[Logo={example-image}] |
| 377 |
\lipsum[1][3-4] |
| 378 |
\end{BoiteDeDemo} |
| 379 |
\end{demohigh} |
| 380 |
|
| 381 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 382 |
\begin{BoiteDeDemo}[Logo={example-image},HauteurLogo=5mm,RotationLogo=10] |
| 383 |
\lipsum[1][3-4] |
| 384 |
\end{BoiteDeDemo} |
| 385 |
\end{demohigh} |
| 386 |
|
| 387 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 388 |
\begin{BoiteDeDemo}[Icone={\faYoutube},EchelleIcone=1.25,RotationIcone=15] |
| 389 |
\lipsum[1][3-4] |
| 390 |
\end{BoiteDeDemo} |
| 391 |
\end{demohigh} |
| 392 |
|
| 393 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 394 |
\begin{BoiteDeDemo}[Emoji={snake},RotationIcone=15] |
| 395 |
\lipsum[1][3-4] |
| 396 |
\end{BoiteDeDemo} |
| 397 |
\end{demohigh} |
| 398 |
|
| 399 |
Et en \textit{cumulant} des clés de personnalisation on peut obtenir : |
| 400 |
|
| 401 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 402 |
\begin{BoiteDeDemo}[% |
| 403 |
ModifLabel={s super importants},ComplementTitre={ (vraiment super importants)},% |
| 404 |
SousTitre={- Source -},Compteur=false,Logo={example-image-a},% |
| 405 |
HauteurLogo=1cm,RotationLogo=15,OpaciteLogo=1 |
| 406 |
] |
| 407 |
\lipsum[2][1-4] |
| 408 |
\end{BoiteDeDemo} |
| 409 |
\end{demohigh} |
| 410 |
|
| 411 |
\pagebreak |
| 412 |
|
| 413 |
\subsection{Personnalisation \textit{intermédiaire}} |
| 414 |
|
| 415 |
Il est possible de paramétrer \textit{facilement} certaines options, via la commande \MontreCode{\textbackslash ParamBoites[...]} : |
| 416 |
|
| 417 |
\begin{itemize} |
| 418 |
\item la police du label grâce à la clé \MontreCode{[PoliceTitre=...]} (\verb*|\bfseries\sffamily| par défaut) ; |
| 419 |
\item la police du sous-titre grâce à la clé \MontreCode{[PoliceSousTitre=...]} (\verb*|\small\bfseries\sffamily| par défaut) ; |
| 420 |
\item la couleur de base du sous-titre grâce à la clé \MontreCode{[CouleurSousTitre=...]} (\verb*|red| par défaut) ; |
| 421 |
\item les marges gauche et droite grâce à la clé \MontreCode{[Marge=...]} (\verb*|4mm| par défaut) ; |
| 422 |
\item l'épaisseur des bordures grâce à la clé \MontreCode{[EpaisseurBordure=...]} (\verb*|1.25pt| par défaut) ; |
| 423 |
\item la marge spécifique pour la boîte \textit{titre} grâce à clé \MontreCode{[MargeTitre=...]} (\verb*|3pt| par défaut). |
| 424 |
\end{itemize} |
| 425 |
|
| 426 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 427 |
\ParamBoites[% |
| 428 |
Marge=2cm,MargeTitre=2mm,% |
| 429 |
PoliceTitre=\large\bfseries\ttfamily,% |
| 430 |
PoliceSousTitre=\scriptsize\bfseries\sffamily,% |
| 431 |
CouleurSousTitre=orange] |
| 432 |
\end{codehigh} |
| 433 |
|
| 434 |
\ParamBoites[Marge=2cm,MargeTitre=2mm,PoliceTitre=\large\bfseries\ttfamily,PoliceSousTitre=\scriptsize\bfseries\sffamily,CouleurSousTitre=orange] |
| 435 |
|
| 436 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 437 |
\begin{BoiteDeDemo}[SousTitre={- Un petit sous-titre -}] |
| 438 |
\lipsum[1][1-2] |
| 439 |
\end{BoiteDeDemo} |
| 440 |
\end{demohigh} |
| 441 |
|
| 442 |
On peut revenir aux paramètres par défaut grâce à la commande \MontreCode{\textbackslash ParamBoites} (sans argument). |
| 443 |
|
| 444 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 445 |
\ParamBoites |
| 446 |
\begin{BoiteDeDemo}[SousTitre={- Un petit sous-titre -}] |
| 447 |
\lipsum[1][1-2] |
| 448 |
\end{BoiteDeDemo} |
| 449 |
\end{demohigh} |
| 450 |
|
| 451 |
\pagebreak |
| 452 |
|
| 453 |
\section{Utilisation avancée} |
| 454 |
|
| 455 |
\subsection{Styles spécifiques} |
| 456 |
|
| 457 |
Il est possible quand même de modifier \textit{en profondeur} les boîtes créées, en redéfinissant les commandes suivantes via \verb*|\RenewDocumentCommand| : |
| 458 |
|
| 459 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 460 |
%\usepackage{xstring} |
| 461 |
\NewDocumentCommand\TitreBoite{ m m m m }{% |
| 462 |
%1=couleur |
| 463 |
%2=icone |
| 464 |
%3=nom |
| 465 |
%4=compteur |
| 466 |
% \BoxModifLabel = texte entre label et compteur |
| 467 |
% \BoxCpltTitle = Texte après le compteur |
| 468 |
\node[inner sep=\margeinttitreboite,rounded corners=3pt,draw=#1,line width=\eptraitboite,% |
| 469 |
rectangle,fill=#1!5!white,anchor=west,xshift=\margeboite,text=black,% |
| 470 |
font=\policetitreboite]% |
| 471 |
at (frame.north west) |
| 472 |
{% |
| 473 |
\,\CreaBoitesIfNoValueOrEmptyTF{#2}{}{{\tailleiconeboite#2}~}\vphantom{Ppé}% |
| 474 |
\ifboolKV[Boites]{Pluriel}{\StrBehind{#3}{/}}{\StrBefore{#3}{/}}% |
| 475 |
\IfStrEq{\BoxModifLabel}{}{}{\BoxModifLabel}\ifboolKV[Boites]{Compteur}{~#4}{}% |
| 476 |
\IfStrEq{\BoxCpltTitle}{}{}{\BoxCpltTitle}\,% |
| 477 |
} ; |
| 478 |
} |
| 479 |
\end{codehigh} |
| 480 |
|
| 481 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 482 |
\NewDocumentCommand\SousTitreBoite{ }{%\BoxSubTitle = Sous-titre |
| 483 |
\node[fill=white,anchor=east,xshift=-\margeboite,text=red!75!black,% |
| 484 |
font=\policesoustitreboite] at (frame.north east) % |
| 485 |
{\vphantom{Ppé}\BoxSubTitle} ; |
| 486 |
} |
| 487 |
\end{codehigh} |
| 488 |
|
| 489 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 490 |
\NewDocumentCommand\LogoCoinDroit{ }{% |
| 491 |
\begin{tcbclipinterior} |
| 492 |
\node[opacity=\BoxOpaciteLogo,rotate=-\BoxRotationLogo]% |
| 493 |
at ($(interior.south east)+(\BoxOffsetLogo)$) % |
| 494 |
{\includegraphics[height=\BoxHauteurLogo]{\BoxLogo}};% |
| 495 |
\end{tcbclipinterior}% |
| 496 |
} |
| 497 |
\end{codehigh} |
| 498 |
|
| 499 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 500 |
\NewDocumentCommand\IconeCoinDroit{ }{% |
| 501 |
\begin{tcbclipinterior} |
| 502 |
\node[opacity=\BoxOpaciteIcone,rotate=-\BoxRotationIcone,scale=\BoxEchelleIcone]% |
| 503 |
at ($(interior.south east)+(\BoxOffsetLogo)$){\BoxIcone}; |
| 504 |
\end{tcbclipinterior}% |
| 505 |
} |
| 506 |
\end{codehigh} |
| 507 |
|
| 508 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 509 |
\NewDocumentCommand\EmojiCoinDroit{ }{% |
| 510 |
\begin{tcbclipinterior} |
| 511 |
\node[opacity=\BoxOpaciteIcone,rotate=-\BoxRotationIcone]% |
| 512 |
at ($(interior.south east)+(\BoxOffsetLogo)$){\twemoji[height=\BoxHauteurLogo]{\BoxLogoEmoji}}; |
| 513 |
\end{tcbclipinterior}% |
| 514 |
} |
| 515 |
\end{codehigh} |
| 516 |
|
| 517 |
\pagebreak |
| 518 |
|
| 519 |
\subsection{Exemple de personnalisations avancées} |
| 520 |
|
| 521 |
Par exemple, on peut modifier globalement le comportement de la boîte : |
| 522 |
|
| 523 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 524 |
%\usepackage{xstring} |
| 525 |
\tcbset{baseboite/.style={ |
| 526 |
enhanced,boxrule=0.75pt,% |
| 527 |
center,width=0.75\linewidth,% |
| 528 |
before skip=1em,after skip=1em,% |
| 529 |
colback=white,top=4mm,left=1mm,right=1mm |
| 530 |
}% |
| 531 |
} |
| 532 |
\RenewDocumentCommand\TitreBoite{ m m m m }{% |
| 533 |
\node[inner sep=2pt,draw=#1,line width=0.75pt,rounded corners,% |
| 534 |
rectangle,fill=white,anchor=center,xshift=-1cm,text=black,% |
| 535 |
font=\policetitreboite]% |
| 536 |
at (frame.north) |
| 537 |
{% |
| 538 |
~#2 #3\ifboolKV[Boites]{Compteur}{~#4}{}\IfStrEq{\BoxCpltTitle}{}{}{\BoxCpltTitle}~ |
| 539 |
} ; |
| 540 |
} |
| 541 |
\RenewDocumentCommand\SousTitreBoite{ }{% |
| 542 |
\node[fill=white,anchor=center,% |
| 543 |
font=\policesoustitreboite] at (frame.south) {\vphantom{pP}\BoxSubTitle} ; |
| 544 |
} |
| 545 |
\ParamBoites[PoliceTitre=\bfseries,PoliceSousTitre=\small\sffamily] |
| 546 |
\CreationBoite{BoxDef}{CompteurDefi}{\faAddressBook}{Définition} |
| 547 |
\CreationBoite[lime]{BoxProp}{CompteurProp}{\faAmbulance}{Propriété}[colback=lime!25] |
| 548 |
\end{codehigh} |
| 549 |
|
| 550 |
\tcbset{baseboite/.style={ |
| 551 |
enhanced,boxrule=0.75pt,% |
| 552 |
center,width=0.75\linewidth,% |
| 553 |
before skip=1em,after skip=1em,% |
| 554 |
colback=white,top=4mm,left=1mm,right=1mm |
| 555 |
}% |
| 556 |
} |
| 557 |
|
| 558 |
\RenewDocumentCommand\TitreBoite{ m m m m }{% |
| 559 |
\node[inner sep=2pt,draw=#1,line width=0.75pt,rounded corners,% |
| 560 |
rectangle,fill=white,anchor=center,text=black,% |
| 561 |
font=\policetitreboite]% |
| 562 |
at (frame.north) |
| 563 |
{% |
| 564 |
~#2 #3\ifboolKV[Boites]{Compteur}{~#4}{}\IfStrEq{\BoxCpltTitle}{}{}{\BoxCpltTitle}~ |
| 565 |
} ; |
| 566 |
} |
| 567 |
|
| 568 |
\RenewDocumentCommand\SousTitreBoite{ }{% |
| 569 |
\node[fill=white,anchor=center,% |
| 570 |
font=\policesoustitreboite] at (frame.south) % |
| 571 |
{\vphantom{pP}\BoxSubTitle} ; |
| 572 |
} |
| 573 |
|
| 574 |
\ParamBoites[PoliceTitre=\bfseries,PoliceSousTitre=\small\sffamily] |
| 575 |
|
| 576 |
\CreationBoite{BoxDef}{CompteurDefi}{\faAddressBook}{Définition} |
| 577 |
\CreationBoite[lime]{BoxProp}{CompteurProp}{\faAmbulance}{Propriété}[colback=lime!25] |
| 578 |
|
| 579 |
\begin{demohigh} |
| 580 |
On va montrer en situation : |
| 581 |
|
| 582 |
\begin{BoxDef}[ComplementTitre={ (importante)},SousTitre={- Fin -}] |
| 583 |
\lipsum[1][1-2] |
| 584 |
\end{BoxDef} |
| 585 |
|
| 586 |
\begin{BoxProp}[ComplementTitre={ (très importante)},Compteur=false] |
| 587 |
\lipsum[1][3-4] |
| 588 |
\end{BoxProp} |
| 589 |
|
| 590 |
Voili voilà ! |
| 591 |
\end{demohigh} |
| 592 |
|
| 593 |
\pagebreak |
| 594 |
|
| 595 |
\subsection{Galerie pour des boîtes à destination de cours} |
| 596 |
|
| 597 |
Pour les exemples suivants, les paramètres et styles ont été remis par défaut. |
| 598 |
|
| 599 |
Toute couleur (\MontreCode{xcolor} n'est pas chargé avec des options spécifiques) peut être utilisée pour créer une boîte. |
| 600 |
|
| 601 |
\tcbset{baseboite/.style={ |
| 602 |
enhanced,sharp corners=uphill,boxrule=1.25pt,% |
| 603 |
before skip=0.5em,after skip=0.5em,% |
| 604 |
colback=white,top=4mm,left={\margeboite-4.25pt},right={\margeboite-4.25pt} |
| 605 |
}% |
| 606 |
} |
| 607 |
|
| 608 |
\RenewDocumentCommand\TitreBoite{ m m m m }{% |
| 609 |
%1=couleur |
| 610 |
%2=icone |
| 611 |
%3=nom |
| 612 |
%4=compteur |
| 613 |
% \BoxModifLabel = texte entre label et compteur |
| 614 |
% \BoxCpltTitle = Texte après le compteur |
| 615 |
\node[inner sep=3pt,rounded corners=3pt,draw=#1,line width=1.25pt,% |
| 616 |
rectangle,fill=#1!5!white,anchor=west,xshift=\margeboite,text=black,% |
| 617 |
font=\policetitreboite]% |
| 618 |
at (frame.north west) |
| 619 |
{% |
| 620 |
\,\CreaBoitesIfNoValueOrEmptyTF{#2}{}{{\small#2}~}\vphantom{Ppé}% |
| 621 |
\ifboolKV[Boites]{Pluriel}{\StrBehind{#3}{/}}{\StrBefore{#3}{/}}% |
| 622 |
\IfStrEq{\BoxModifLabel}{}{}{\BoxModifLabel}\ifboolKV[Boites]{Compteur}{~#4}{}% |
| 623 |
\IfStrEq{\BoxCpltTitle}{}{}{\BoxCpltTitle}\,% |
| 624 |
} ; |
| 625 |
} |
| 626 |
|
| 627 |
\RenewDocumentCommand\SousTitreBoite{ }{%\BoxSubTitle = Sous-titre |
| 628 |
\node[fill=white,anchor=east,xshift=-\margeboite,text=red!75!black,% |
| 629 |
font=\policesoustitreboite] at (frame.north east) % |
| 630 |
{\vphantom{Ppé}\BoxSubTitle} ; |
| 631 |
} |
| 632 |
|
| 633 |
\RenewDocumentCommand\LogoCoinDroit{ }{% |
| 634 |
\begin{tcbclipinterior}% |
| 635 |
\node[opacity=\BoxOpaciteLogo,rotate=-\BoxRotationLogo]% |
| 636 |
at ($(interior.south east)+(-10pt,10pt)$) % |
| 637 |
{\includegraphics[height=\BoxHauteurLogo]{\BoxLogo}};% |
| 638 |
\end{tcbclipinterior}% |
| 639 |
} |
| 640 |
|
| 641 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 642 |
\ParamBoites %on remet à 0 les paramètres |
| 643 |
\CreationBoite[teal]{EnvDefi}{CptDefi}{\faIcon[regular]{comment-dots}}{Définition/Définitions} |
| 644 |
\CreationBoite[yellow]{EnvHumour}{CptHumour}{\faIcon[regular]{laugh-wink}}{Humour/Humours} |
| 645 |
\CreationBoite[violet]{EnvProp}{CptProp}{\faCog}{Propriété/Propriétés} |
| 646 |
\CreationBoite[red]{EnvThm}{CptThm}{\faBullhorn}{Théorème/Théorèmes}[colback=red!10] |
| 647 |
\CreationBoite[blue]{EnvRmq}{CptRmq}{\faHandPointRight[regular]}{Remarque/Remarques} |
| 648 |
|
| 649 |
\begin{EnvDefi} |
| 650 |
\lipsum[1][3-4] |
| 651 |
\end{EnvDefi} |
| 652 |
|
| 653 |
\begin{EnvHumour} |
| 654 |
\lipsum[2][3-4] |
| 655 |
\end{EnvHumour} |
| 656 |
|
| 657 |
\begin{EnvProp} |
| 658 |
\lipsum[2][3-4] |
| 659 |
\end{EnvProp} |
| 660 |
|
| 661 |
\begin{EnvThm} |
| 662 |
\lipsum[2][3-4] |
| 663 |
\end{EnvThm} |
| 664 |
|
| 665 |
\begin{EnvRmq}[Pluriel,Logo={example-image-1x1},SousTitre={ - Fondamentales -}] |
| 666 |
\lipsum[3][1-7] |
| 667 |
\end{EnvRmq} |
| 668 |
\end{demohigh} |
| 669 |
|
| 670 |
\pagebreak |
| 671 |
|
| 672 |
\section{Styles alternatifs} |
| 673 |
|
| 674 |
\subsection{Style alternatif v1} |
| 675 |
|
| 676 |
\subsubsection{Idées} |
| 677 |
|
| 678 |
L'idée est de proposer un style alternatif, avec moins de \textit{fioritures}. |
| 679 |
|
| 680 |
Le style global est : |
| 681 |
|
| 682 |
\begin{itemize} |
| 683 |
\item fond légèrement coloré ; |
| 684 |
\item bordure gauche ; |
| 685 |
\item personnalisation du titre. |
| 686 |
\end{itemize} |
| 687 |
|
| 688 |
Pour le moment, deux modèles d'utilisation du compteur sont disponibles : |
| 689 |
|
| 690 |
\begin{itemize} |
| 691 |
\item une version avec compteur global ; |
| 692 |
\item une version avec compteur réinitialisé par section. |
| 693 |
\end{itemize} |
| 694 |
|
| 695 |
{\footnotesize \faBomb}~Dans le cas où un autre comportement du compteur est attendu, il est tout à fait possible de récupérer le code source de la macro de création, et de l'adapter. |
| 696 |
|
| 697 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 698 |
%version avec compteur 'global' |
| 699 |
\CreationBoiteAlt% |
| 700 |
[Couleur]% |
| 701 |
{Nom}% |
| 702 |
{Compteur}% |
| 703 |
{Label singulier} |
| 704 |
{Label pluriel} |
| 705 |
[options tcbox] |
| 706 |
|
| 707 |
%version avec compteur 'lié' à 'section' |
| 708 |
\CreationBoiteAltResetSection% |
| 709 |
[Couleur]% |
| 710 |
{Nom}% |
| 711 |
{Compteur}% |
| 712 |
{Label singulier} |
| 713 |
{Label pluriel} |
| 714 |
[options tcbox] |
| 715 |
\end{codehigh} |
| 716 |
|
| 717 |
La boîte ainsi créée a la syntaxe suivante. |
| 718 |
|
| 719 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 720 |
\begin{monenvt}[clés] |
| 721 |
... |
| 722 |
\end{monenvt} |
| 723 |
|
| 724 |
%-- Les clés disponibles sont : |
| 725 |
% ComplementTitre = {} (entre le label et le compteur) |
| 726 |
% SousTitre = {} (après le compteur, en italique) |
| 727 |
% Compteur = true |
| 728 |
% Pluriel = false |
| 729 |
% SouligneLabel = false (il faut charger ulem dans ce cas !) |
| 730 |
\end{codehigh} |
| 731 |
|
| 732 |
\subsubsection{Exemples} |
| 733 |
|
| 734 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 735 |
\setKVdefault[cpaltboites]{SouligneLabel=true} %souligné par défaut |
| 736 |
\CreationBoiteAltResetSection%avec compteur lié à la section |
| 737 |
[red]{testintro}{cptintro}{Intro}{Intros}{$\blacktriangleright$\,} |
| 738 |
\CreationBoiteAlt%avec compteur global |
| 739 |
[teal]{testcadre}{cbcptcadre}{Cadre}{Cadres}{$\blacktriangleright$\,} |
| 740 |
|
| 741 |
\begin{testintro} |
| 742 |
\lipsum[1][1-2] |
| 743 |
\end{testintro} |
| 744 |
|
| 745 |
\begin{testintro}[ComplementTitre={ super importante},SousTitre={ (essentiel)}] |
| 746 |
\lipsum[1][1-2] |
| 747 |
\end{testintro} |
| 748 |
|
| 749 |
\begin{testcadre} |
| 750 |
\lipsum[1][5-6] |
| 751 |
\end{testcadre} |
| 752 |
|
| 753 |
\renewcommand\policetitreboite{\itshape\scshape} |
| 754 |
\begin{testcadre}[Pluriel] |
| 755 |
On essaye avec les couleurs stockées, comme celle de \textcolor{cbcoulbord}{la bordure}. |
| 756 |
\end{testcadre} |
| 757 |
\end{demohigh} |
| 758 |
|
| 759 |
\subsubsection{Définitions des paramètres} |
| 760 |
|
| 761 |
Les boîtes \texttt{Alt} sont définies grâce aux définitions suivantes : |
| 762 |
|
| 763 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 764 |
\tcbset{basecpcours/.style={ |
| 765 |
enhanced,empty,size=small,boxsep=2.25pt,top=0pt,bottom=2.25pt,left=2.25pt,right=2.25pt, |
| 766 |
overlay={% |
| 767 |
\fill[#1!2.5] (frame.north west) rectangle (frame.south east) ; |
| 768 |
\draw[line width=1.5pt,#1] (frame.north west) -- (frame.south west) ; |
| 769 |
} |
| 770 |
} |
| 771 |
} |
| 772 |
|
| 773 |
\newcommand\policetitreboite{\bfseries\sffamily} |
| 774 |
\end{codehigh} |
| 775 |
|
| 776 |
\pagebreak |
| 777 |
|
| 778 |
\subsection{Style alternatif v2} |
| 779 |
|
| 780 |
\subsubsection{Idées} |
| 781 |
|
| 782 |
L'idée est de proposer un style autre alternatif, inspiré d'un travail d'\textsf{Arnaud Blas}. |
| 783 |
|
| 784 |
Le style global est : |
| 785 |
|
| 786 |
\begin{itemize} |
| 787 |
\item bordure arrondie suivant titre et boîte ; |
| 788 |
\item personnalisation du titre. |
| 789 |
\end{itemize} |
| 790 |
|
| 791 |
Pour le moment, deux modèles d'utilisation du compteur sont disponibles : |
| 792 |
|
| 793 |
\begin{itemize} |
| 794 |
\item une version avec compteur global ; |
| 795 |
\item une version avec compteur réinitialisé par section. |
| 796 |
\end{itemize} |
| 797 |
|
| 798 |
{\footnotesize \faBomb}~Dans le cas où un autre comportement du compteur est attendu, il est tout à fait possible de récupérer le code source de la macro de création, et de l'adapter. |
| 799 |
|
| 800 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 801 |
%version avec compteur 'global' |
| 802 |
\CreationBoiteAAlt% |
| 803 |
[Couleur]% |
| 804 |
{Nom}% |
| 805 |
{Compteur}% |
| 806 |
{Label singulier} |
| 807 |
{Label pluriel} |
| 808 |
[options tcbox] |
| 809 |
|
| 810 |
%version avec compteur 'lié' à 'section' |
| 811 |
\CreationBoiteAAltResetSection% |
| 812 |
[Couleur]% |
| 813 |
{Nom}% |
| 814 |
{Compteur}% |
| 815 |
{Label singulier} |
| 816 |
{Label pluriel} |
| 817 |
[options tcbox] |
| 818 |
\end{codehigh} |
| 819 |
|
| 820 |
La boîte ainsi créée a la syntaxe suivante. |
| 821 |
|
| 822 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 823 |
\begin{monenvt}[clés] |
| 824 |
... |
| 825 |
\end{monenvt} |
| 826 |
|
| 827 |
%-- Les clés disponibles sont : |
| 828 |
% ComplementTitre = {} (entre le label et le compteur) |
| 829 |
% SousTitre = {} (après le compteur, en italique) |
| 830 |
% Compteur = true |
| 831 |
% Pluriel = false |
| 832 |
% SouligneLabel = false (il faut charger ulem dans ce cas !) |
| 833 |
% EpaisseurSouligne = 1pt |
| 834 |
% Fond = false (white si true) |
| 835 |
% Ombre = false (uniquement en mode Fond) |
| 836 |
\end{codehigh} |
| 837 |
|
| 838 |
\subsubsection{Exemples} |
| 839 |
|
| 840 |
\setKVdefault[abaltboites]{SouligneLabel=true} %souligné par défaut |
| 841 |
\CreationBoiteAAlt% |
| 842 |
[blue]{abdef}{abdef}{Définition}{Définitions}{$\blacktriangleright$\,} |
| 843 |
\CreationBoiteAAlt% |
| 844 |
[red]{abprop}{abprop}{Propriété}{Propriétés}{$\blacktriangleright$\,} |
| 845 |
\CreationBoiteAAlt% |
| 846 |
[orange]{abthm}{abthm}{Théorème}{Théorèmes}{$\blacktriangleright$\,} |
| 847 |
\CreationBoiteAAlt% |
| 848 |
[teal]{abexo}{abexo}{Exercice}{Exercices}{$\blacktriangleright$\,} |
| 849 |
|
| 850 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 851 |
\setKVdefault[abaltboites]{SouligneLabel=true} %souligné par défaut |
| 852 |
\CreationBoiteAAlt% |
| 853 |
[blue]{abdef}{abdef}{Définition}{Définitions}{$\blacktriangleright$\,} |
| 854 |
\CreationBoiteAAlt% |
| 855 |
[red]{abprop}{abprop}{Propriété}{Propriétés}{$\blacktriangleright$\,} |
| 856 |
\CreationBoiteAAlt% |
| 857 |
[orange]{abthm}{abthm}{Théorème}{Théorèmes}{$\blacktriangleright$\,} |
| 858 |
\CreationBoiteAAlt% |
| 859 |
[teal]{abexo}{abexo}{Exercice}{Exercices}{$\blacktriangleright$\,} |
| 860 |
\end{codehigh} |
| 861 |
|
| 862 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 863 |
\begin{abdef}% |
| 864 |
[Pluriel,Compteur=false,ComplementTitre={ introductives},% |
| 865 |
SousTitre={ (importantes ?)}] |
| 866 |
\lipsum[1][1-3] |
| 867 |
|
| 868 |
Et on peut récupérer la couleur courante du \textsf{\textcolor{cbcoulbord}{bord}} (avec \MontreCode{cbcoulbord}) ou du \textsf{\textcolor{cbcoultitre}{titre}} (avec \MontreCode{cbcoultitre}). |
| 869 |
\end{abdef} |
| 870 |
|
| 871 |
\begin{abprop} |
| 872 |
\lipsum[1][1-3] |
| 873 |
\end{abprop} |
| 874 |
|
| 875 |
\begin{abthm} |
| 876 |
\lipsum[1][1-3] |
| 877 |
\end{abthm} |
| 878 |
\end{demohigh} |
| 879 |
|
| 880 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10,style/demo=yellow!10] |
| 881 |
\begin{abexo} |
| 882 |
\lipsum[1][1-3] |
| 883 |
\end{abexo} |
| 884 |
|
| 885 |
\begin{abexo}[Fond] |
| 886 |
\lipsum[1][1-3] |
| 887 |
\end{abexo} |
| 888 |
|
| 889 |
\begin{abexo}[Fond,Ombre] |
| 890 |
\lipsum[1][1-3] |
| 891 |
\end{abexo} |
| 892 |
\end{demohigh} |
| 893 |
|
| 894 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 895 |
\renewcommand\policetitreboite{\itshape\scshape} |
| 896 |
\begin{abprop}[Pluriel] |
| 897 |
On essaye avec les couleurs stockées, comme celle de \textcolor{cbcoulbord}{la bordure}. |
| 898 |
\end{abprop} |
| 899 |
\end{demohigh} |
| 900 |
|
| 901 |
\subsubsection{Définitions des paramètres} |
| 902 |
|
| 903 |
Les boîtes \texttt{AAlt} sont définies grâce aux définitions suivantes : |
| 904 |
|
| 905 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 906 |
\tcbset{abbaseboite/.style={%#1 = color |
| 907 |
enhanced,empty,% |
| 908 |
attach boxed title to top left={yshift=-2.5mm}, |
| 909 |
left=1mm,right=2mm,bottom=1mm,top=1.75mm, |
| 910 |
boxed title style={empty,size=small,top=0pt,bottom=0pt}, |
| 911 |
varwidth boxed title=0.66\linewidth, |
| 912 |
frame code={ |
| 913 |
\path (title.east|-frame.north) coordinate (aux); |
| 914 |
\path[draw=#1,line width=1pt, rounded corners=3pt] |
| 915 |
(frame.west) |- ([xshift=-2.5mm]title.north east) to[out=0, in=180] ([xshift=7.5mm]aux)-|([xshift=-1pt]frame.east)|-([yshift=1pt]frame.south)-|cycle; |
| 916 |
}, |
| 917 |
} |
| 918 |
} |
| 919 |
\end{codehigh} |
| 920 |
|
| 921 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 922 |
\tcbset{abbaseboitefond/.style={%#1 = color |
| 923 |
enhanced,empty,% |
| 924 |
attach boxed title to top left={yshift=-2.5mm}, |
| 925 |
left=1mm,right=2mm,bottom=1mm,top=1.75mm, |
| 926 |
boxed title style={empty,size=small,top=0pt,bottom=0pt}, |
| 927 |
varwidth boxed title=0.66\linewidth, |
| 928 |
frame code={ |
| 929 |
\path (title.east|-frame.north) coordinate (aux); |
| 930 |
\path[draw=#1,fill=white,line width=1pt, rounded corners=3pt, abbaseboiteombre] |
| 931 |
(frame.west) |- ([xshift=-2.5mm]title.north east) to[out=0, in=180] ([xshift=7.5mm]aux)-|([xshift=-1pt]frame.east)|-([yshift=1pt]frame.south)-|cycle; |
| 932 |
}, |
| 933 |
} |
| 934 |
} |
| 935 |
|
| 936 |
\newcommand\policetitreboite{\bfseries\sffamily} |
| 937 |
\end{codehigh} |
| 938 |
|
| 939 |
\pagebreak |
| 940 |
|
| 941 |
\subsection{Macro unique de génération} |
| 942 |
|
| 943 |
Une macro \textit{unique} existe, afin de créer la boîte en fonction : |
| 944 |
|
| 945 |
\begin{itemize} |
| 946 |
\item du \textsf{style} ; |
| 947 |
\item du \textsf{compteur} si possible. |
| 948 |
\end{itemize} |
| 949 |
|
| 950 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 951 |
\GenereBoite<clés>% |
| 952 |
[Couleur]% |
| 953 |
{Nom}% |
| 954 |
{Compteur}% |
| 955 |
{Label singulier} |
| 956 |
{Label pluriel} |
| 957 |
[options tcbox] |
| 958 |
|
| 959 |
% ===== <clés> : |
| 960 |
% style = parmi cp/default/ab/ha/tx (cp) |
| 961 |
% reset section = booléen pour le compteur (false) |
| 962 |
\end{codehigh} |
| 963 |
|
| 964 |
\setKVdefault[cpaltboites]{SouligneLabel=true,Fond,Ombre} %souligné par défaut |
| 965 |
\GenereBoite<style=ab>% |
| 966 |
[red]{genintro}{genintro}{Intro}{Intros}{$\blacktriangleright$\,} |
| 967 |
\GenereBoite<style=cp>% |
| 968 |
[teal]{gencadre}{gencadre}{Cadre}{Cadres}{$\blacktriangleright$\,} |
| 969 |
\GenereBoite<style=default>% |
| 970 |
[orange]{genprop}{genprop}{Propriété}{Propriété}{$\blacktriangleright$} |
| 971 |
|
| 972 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 973 |
\setKVdefault[cpaltboites]{SouligneLabel=true,Fond,Ombre} %souligné par défaut |
| 974 |
\GenereBoite<style=ab>% |
| 975 |
[red]{genintro}{genintro}{Intro}{Intros}{$\blacktriangleright$\,} |
| 976 |
\GenereBoite<style=cp>% |
| 977 |
[teal]{gencadre}{gencadre}{Cadre}{Cadres}{$\blacktriangleright$\,} |
| 978 |
\GenereBoite<style=default>% |
| 979 |
[orange]{genprop}{genprop}{Propriété}{Propriété}{$\blacktriangleright$} |
| 980 |
\end{codehigh} |
| 981 |
|
| 982 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 983 |
\begin{genintro} |
| 984 |
\lipsum[1][1] |
| 985 |
\end{genintro} |
| 986 |
|
| 987 |
\begin{gencadre} |
| 988 |
\lipsum[2][1] |
| 989 |
\end{gencadre} |
| 990 |
|
| 991 |
\begin{genprop} |
| 992 |
\lipsum[3][1] |
| 993 |
\end{genprop} |
| 994 |
\end{demohigh} |
| 995 |
|
| 996 |
\pagebreak |
| 997 |
|
| 998 |
\subsection{Utilisation d'un compteur personnalisé} |
| 999 |
|
| 1000 |
IL est également possible (c'est une fonctionnalité encore en version \textit{beta}) de spécifier un \textsf{compteur} existant et personnalisé (qui doit donc \textit{exister}) dans les boîtes, accessible via la clé \MontreCode{[CompteurPerso=...]}. |
| 1001 |
|
| 1002 |
\smallskip |
| 1003 |
|
| 1004 |
Le trousseau de clés pour les boîtes \textit{classiques} est \MontreCode{[Boites]}, alors que celui pour les autres est \MontreCode{[cpaltboites]}. |
| 1005 |
|
| 1006 |
\newcounter{moncompteurglobal} |
| 1007 |
\GenereBoite<style=default>[orange]{TestA}{TestA}{Propriété}{Propriétés}{$\blacktriangleright$} |
| 1008 |
\GenereBoite<style=default>[gray]{TestB}{TestB}{Définition}{Définitions}{$\blacktriangleright$} |
| 1009 |
\GenereBoite<style=default>[teal]{TestC}{TestC}{Remarque}{Remarques}{$\blacktriangleright$} |
| 1010 |
\setKVdefault[Boites]{CompteurPerso=moncompteurglobal} |
| 1011 |
|
| 1012 |
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 1013 |
\newcounter{moncompteurglobal} |
| 1014 |
\GenereBoite<style=default>% |
| 1015 |
[orange]{TestA}{TestA}{Propriété}{Propriétés}{$\blacktriangleright$} |
| 1016 |
\GenereBoite<style=default>% |
| 1017 |
[gray]{TestB}{TestB}{Définition}{Définitions}{$\blacktriangleright$} |
| 1018 |
\GenereBoite<style=default>% |
| 1019 |
[teal]{TestC}{TestC}{Remarque}{Remarques}{$\blacktriangleright$} |
| 1020 |
\setKVdefault[Boites]{CompteurPerso=moncompteurglobal} |
| 1021 |
\end{codehigh} |
| 1022 |
|
| 1023 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 1024 |
\begin{TestA} |
| 1025 |
\lipsum[1][3-4] |
| 1026 |
\end{TestA} |
| 1027 |
\begin{TestB} |
| 1028 |
\lipsum[2][3-4] |
| 1029 |
\end{TestB} |
| 1030 |
\begin{TestC} |
| 1031 |
\lipsum[2][3-4] |
| 1032 |
\end{TestC} |
| 1033 |
\begin{TestB} |
| 1034 |
\lipsum[2][3-4] |
| 1035 |
\end{TestB} |
| 1036 |
\begin{TestC}[Pluriel,Logo={example-image-1x1},SousTitre={ - Fondamentales -}] |
| 1037 |
\lipsum[3][1-7] |
| 1038 |
\end{TestC} |
| 1039 |
\end{demohigh} |
| 1040 |
|
| 1041 |
\pagebreak |
| 1042 |
|
| 1043 |
\section{Galerie} |
| 1044 |
|
| 1045 |
\setKVdefault[cpaltboites]{SouligneLabel=false} %souligné par défaut |
| 1046 |
|
| 1047 |
\subsection{Design : cp} |
| 1048 |
|
| 1049 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 1050 |
\GenereBoite<style=cp>% |
| 1051 |
[red]{testA}{testA}{Label}{Labels}{$\blacktriangleright$\,} |
| 1052 |
|
| 1053 |
\begin{testA} |
| 1054 |
\lipsum[1][1-5] |
| 1055 |
\end{testA} |
| 1056 |
\end{demohigh} |
| 1057 |
|
| 1058 |
\subsection{Design : ab} |
| 1059 |
|
| 1060 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 1061 |
\GenereBoite<style=ab>% |
| 1062 |
[red]{testB}{testB}{Label}{Labels}{$\blacktriangleright$\,} |
| 1063 |
|
| 1064 |
\begin{testB} |
| 1065 |
\lipsum[1][1-5] |
| 1066 |
\end{testB} |
| 1067 |
\end{demohigh} |
| 1068 |
|
| 1069 |
\subsection{Design : ha} |
| 1070 |
|
| 1071 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 1072 |
\GenereBoite<style=ha>% |
| 1073 |
[red]{testC}{testC}{Label}{Labels}{$\blacktriangleright$\,} |
| 1074 |
|
| 1075 |
\begin{testC} |
| 1076 |
\lipsum[1][1-5] |
| 1077 |
\end{testC} |
| 1078 |
\end{demohigh} |
| 1079 |
|
| 1080 |
\subsection{Design : tx} |
| 1081 |
|
| 1082 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 1083 |
\GenereBoite<style=tx>% |
| 1084 |
[red]{testD}{testD}{Label}{Labels}{$\blacktriangleright$\,} |
| 1085 |
|
| 1086 |
\begin{testD} |
| 1087 |
\lipsum[1][1-5] |
| 1088 |
\end{testD} |
| 1089 |
\end{demohigh} |
| 1090 |
|
| 1091 |
\subsection{Design : default} |
| 1092 |
|
| 1093 |
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] |
| 1094 |
\GenereBoite<style=default>% |
| 1095 |
[red]{testE}{testE}{Label}{Labels}{$\blacktriangleright$\,} |
| 1096 |
|
| 1097 |
\begin{testE} |
| 1098 |
\lipsum[1][1-5] |
| 1099 |
\end{testE} |
| 1100 |
\end{demohigh} |
| 1101 |
|
| 1102 |
\pagebreak |
| 1103 |
|
| 1104 |
\section{Historique} |
| 1105 |
|
| 1106 |
\verb|v0.20c|~:~~~~Possibilité d'utiliser un compteur personnalisé |
| 1107 |
|
| 1108 |
\verb|v0.20b|~:~~~~Ajout d'autres styles alternatifs + macro unifiée de création |
| 1109 |
|
| 1110 |
\verb|v0.20a|~:~~~~Ajout d'un mode de sauvegarde des couleurs à l'intérieur des boîtes |
| 1111 |
|
| 1112 |
\verb|v0.1.9|~:~~~~Bugfix avec \texttt{AltBoite} et compteur... |
| 1113 |
|
| 1114 |
\verb|v0.1.8|~:~~~~Ajout d'un style alternatif 'épuré' (\texttt{CreationBoiteAlt}) |
| 1115 |
|
| 1116 |
\verb|v0.1.7|~:~~~~Suppression de la dépendance à \texttt{xstring} |
| 1117 |
|
| 1118 |
\verb|v0.1.6|~:~~~~Pré-compatibilité avec \texttt{fontawesome7} |
| 1119 |
|
| 1120 |
\verb|v0.1.5|~:~~~~Correction des espacements |
| 1121 |
|
| 1122 |
\verb|v0.1.4|~:~~~~Possibilité de rajouter des options \textsf{tcbox} lors de la création des boîtes |
| 1123 |
|
| 1124 |
\verb|v0.1.3|~:~~~~Compatibilité avec \texttt{twemojis} |
| 1125 |
|
| 1126 |
\verb|v0.1.2|~:~~~~Pré-compatibilité avec \texttt{fontawesome6} |
| 1127 |
|
| 1128 |
\verb|v0.1.1|~:~~~~Correction d'un bug avec \texttt{[breakable]} + Clés pour des \texttt{[Icone]} |
| 1129 |
|
| 1130 |
\verb|v0.1.0|~:~~~~Version initiale |
| 1131 |
|
| 1132 |
\vspace*{15mm} |
| 1133 |
|
| 1134 |
\pagebreak |
| 1135 |
|
| 1136 |
\end{document} |