| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} |
| 3 |
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} |
| 4 |
|
| 5 |
\documentclass[11pt,a4paper]{ltxdoc} |
| 6 |
\usepackage{bera} |
| 7 |
\usepackage{inconsolata} |
| 8 |
\usepackage[T1]{fontenc} |
| 9 |
\usepackage[scale=0.875]{cabin} |
| 10 |
\usepackage[bm]{mathador} |
| 11 |
\usepackage{fancyvrb} |
| 12 |
\usepackage{fancyhdr} |
| 13 |
\usepackage{tabularray} |
| 14 |
\usepackage{fontawesome5} |
| 15 |
\fancyhf{} |
| 16 |
\renewcommand{\headrulewidth}{0pt} |
| 17 |
\lfoot{\sffamily\small [mathador]} |
| 18 |
\cfoot{\sffamily\small - \thepage{} -} |
| 19 |
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} |
| 20 |
\usepackage{hologo} |
| 21 |
\providecommand\tikzlogo{Ti\textit{k}Z} |
| 22 |
\providecommand\TeXLive{\TeX{}Live\xspace} |
| 23 |
\let\TikZ\tikzlogo |
| 24 |
|
| 25 |
\usepackage{hyperref} |
| 26 |
\urlstyle{same} |
| 27 |
\hypersetup{pdfborder=0 0 0} |
| 28 |
\usepackage[margin=2cm]{geometry} |
| 29 |
\setlength{\parindent}{0pt} |
| 30 |
\def\TPversion{0.1.1} |
| 31 |
\def\TPdate{24/09/2025} |
| 32 |
\usepackage{tcolorbox} |
| 33 |
\tcbuselibrary{breakable,skins,hooks,listingsutf8} |
| 34 |
%\usepackage{soul} |
| 35 |
%\sethlcolor{lightgray!25} |
| 36 |
|
| 37 |
\lstset{ |
| 38 |
language=[LaTeX]TeX,% |
| 39 |
basicstyle=\ttfamily,% |
| 40 |
keywordstyle={\color{blue}},% |
| 41 |
classoffset=0,% |
| 42 |
keywords={},% |
| 43 |
alsoletter={-},% |
| 44 |
keywordstyle={\color{blue}},% |
| 45 |
classoffset=1,% |
| 46 |
alsoletter={-},% |
| 47 |
morekeywords={mathador},% |
| 48 |
keywordstyle={\color{violet}},% |
| 49 |
classoffset=2,% |
| 50 |
alsoletter={-},% |
| 51 |
morekeywords={\PlateauMathador,\DeMathador,\CibleMathador,\TirageDesMathador},% |
| 52 |
keywordstyle={\color{green!50!black}},% |
| 53 |
classoffset=3,% |
| 54 |
morekeywords={},% |
| 55 |
keywordstyle={\color{orange}} |
| 56 |
} |
| 57 |
|
| 58 |
\newtcblisting{DemoCode}[1]{% |
| 59 |
enhanced,width=\linewidth,% |
| 60 |
bicolor,size=title,% |
| 61 |
colback=cyan!10!white,% |
| 62 |
colbacklower=cyan!5!white,% |
| 63 |
colframe=cyan!75!black,% |
| 64 |
listing options={% |
| 65 |
breaklines=true,% |
| 66 |
breakatwhitespace=true,% |
| 67 |
style=tcblatex,basicstyle=\small\ttfamily,% |
| 68 |
tabsize=4,% |
| 69 |
commentstyle={\itshape\color{gray}}, |
| 70 |
keywordstyle={\color{blue}},% |
| 71 |
classoffset=0,% |
| 72 |
keywords={\tikzset,\usepackage,\definecolor,\includegraphics,xstring,listofitems,\readlist,\showitems,\xintFor,\xintSeq},% |
| 73 |
alsoletter={-},% |
| 74 |
keywordstyle={\color{blue}},% |
| 75 |
classoffset=1,% |
| 76 |
alsoletter={-},% |
| 77 |
morekeywords={mathador},% |
| 78 |
keywordstyle={\color{violet}},% |
| 79 |
classoffset=2,% |
| 80 |
alsoletter={-},% |
| 81 |
morekeywords={\PlateauMathador,\DeMathador,\CibleMathador,\TirageDesMathador},% |
| 82 |
keywordstyle={\color{green!50!black}},% |
| 83 |
classoffset=3,% |
| 84 |
morekeywords={},% |
| 85 |
keywordstyle={\color{orange}} |
| 86 |
},% |
| 87 |
#1 |
| 88 |
} |
| 89 |
|
| 90 |
\newtcbinputlisting\DemoCodeFile[1]{% |
| 91 |
enhanced,width=\linewidth,% |
| 92 |
bicolor,size=title,% |
| 93 |
colback=lightgray!10!white,% |
| 94 |
colbacklower=lightgray!5!white,% |
| 95 |
colframe=lightgray!75!black,% |
| 96 |
listing options={% |
| 97 |
breaklines=true,% |
| 98 |
breakatwhitespace=true,% |
| 99 |
style=tcblatex, |
| 100 |
basicstyle=\scriptsize\ttfamily,% |
| 101 |
tabsize=4,% |
| 102 |
commentstyle={\itshape\color{gray}},% |
| 103 |
%lastline=148 |
| 104 |
},% |
| 105 |
breakable, |
| 106 |
listing only,% |
| 107 |
listing file={#1} |
| 108 |
} |
| 109 |
|
| 110 |
\NewDocumentCommand\ShowCode{ m }{% |
| 111 |
\lstinline{#1}% |
| 112 |
} |
| 113 |
|
| 114 |
\usepackage[french]{babel} |
| 115 |
|
| 116 |
\begin{document} |
| 117 |
|
| 118 |
\thispagestyle{empty} |
| 119 |
|
| 120 |
\begin{center} |
| 121 |
\begin{minipage}{0.88\linewidth} |
| 122 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 123 |
\begin{center} |
| 124 |
\renewcommand{\arraystretch}{1.25}% |
| 125 |
\begin{tabular}{c} |
| 126 |
{\Huge \texttt{mathador}}\\ |
| 127 |
\\ |
| 128 |
{\LARGE De commandes pour travailler avec le} \\ |
| 129 |
{\LARGE jeu Mathador : plateau / dés / tirage.} \\ |
| 130 |
\\ |
| 131 |
{\small \texttt{Version \TPversion{} -- \TPdate}} |
| 132 |
\end{tabular} |
| 133 |
\end{center} |
| 134 |
\end{tcolorbox} |
| 135 |
\end{minipage} |
| 136 |
\end{center} |
| 137 |
|
| 138 |
\begin{center} |
| 139 |
\begin{tabular}{c} |
| 140 |
\texttt{Cédric Pierquet} : {\ttfamily c pierquet -- at -- outlook . fr}\\ |
| 141 |
\texttt{\url{https://github.com/cpierquet/latex-packages/tree/main//mathador}} \\ |
| 142 |
\end{tabular} |
| 143 |
\end{center} |
| 144 |
|
| 145 |
\hrule |
| 146 |
|
| 147 |
\begin{center} |
| 148 |
\begin{tabular}{c} |
| 149 |
{\ttfamily Auteur du jeu : Éric Trouillot}\\ |
| 150 |
{\ttfamily Éditeur du jeu : Réseau Canopé (\url{https://www.mathador.fr})} |
| 151 |
\end{tabular} |
| 152 |
\end{center} |
| 153 |
|
| 154 |
\hrule |
| 155 |
|
| 156 |
\vfill |
| 157 |
|
| 158 |
\begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only} |
| 159 |
\PlateauMathador{1,6,19,7,12}{39} |
| 160 |
\end{tcblisting} |
| 161 |
|
| 162 |
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] |
| 163 |
\hfill\PlateauMathador{1,6,19,7,12}{39}\hfill\null |
| 164 |
\end{tcolorbox} |
| 165 |
|
| 166 |
\begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only} |
| 167 |
\TirageDesMathador{39}{1}{6}{7}{12}{19} |
| 168 |
\end{tcblisting} |
| 169 |
|
| 170 |
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] |
| 171 |
\hfill\TirageDesMathador{39}{1}{6}{7}{12}{19}\hfill\null |
| 172 |
\end{tcolorbox} |
| 173 |
|
| 174 |
\vfill\null |
| 175 |
|
| 176 |
\pagebreak |
| 177 |
|
| 178 |
\phantomsection |
| 179 |
|
| 180 |
\hypertarget{matoc}{} |
| 181 |
|
| 182 |
\tableofcontents |
| 183 |
|
| 184 |
\vspace*{5mm} |
| 185 |
|
| 186 |
%\hrule |
| 187 |
|
| 188 |
\pagebreak |
| 189 |
|
| 190 |
\section{Introduction} |
| 191 |
|
| 192 |
\subsection{Le jeu du Mathador} |
| 193 |
|
| 194 |
Présentation issue du site \url{https://www.mathador.fr}: |
| 195 |
|
| 196 |
\begin{tcolorbox}[enhanced,colback=orange!15,colframe=orange!75!black,fontupper=\small\itshape\sffamily,width=0.75\linewidth,center,watermark opacity=0.1,watermark zoom=0.95,watermark graphics={mathadorlogo.pdf}] |
| 197 |
\textbf{Le principe : lancez les dés !} |
| 198 |
|
| 199 |
Ils vous donnent 1 nombre-cible (entre 0 et 99) et 5 nombres à utiliser pour l'atteindre. |
| 200 |
|
| 201 |
Vous avez les 4 opérations pour y arriver, mais attention : le temps est limité et les opérations rapportent des points\ldots |
| 202 |
|
| 203 |
Ces 6 dés donnent des milliers de \textit{compte-est-bon}. Pour chacun, jusqu'à des centaines de réponses différentes : de quoi se remuer les méninges et chercher la stratégie qui vous fera gagner ! |
| 204 |
\end{tcolorbox} |
| 205 |
|
| 206 |
Les éléments graphiques ont été repris du site officiel, et adaptés/transcrits en langage \TikZ. |
| 207 |
|
| 208 |
\subsection{Crédits, mentions légales} |
| 209 |
|
| 210 |
\og \textsf{Mathador} est une marque protégée de Monsieur Eric Trouillot et de Réseau Canopé. |
| 211 |
|
| 212 |
Eric Trouillot est le concepteur du jeu \textsf{Mathador} dont vous pouvez retrouver toute l’actualité sur le site \url{www.mathador.fr}. |
| 213 |
|
| 214 |
Ce package \LaTeX\ est une ressource indépendante non affiliée à \url{www.mathador.fr}. \fg |
| 215 |
|
| 216 |
\subsection{Chargement, packages utiles} |
| 217 |
|
| 218 |
Pour charger le package \texttt{mathador}, il suffit de placer, dans le préambule : |
| 219 |
|
| 220 |
\begin{DemoCode}{listing only} |
| 221 |
%version 'normale' |
| 222 |
\usepackage{mathador} |
| 223 |
%version avec le package bm pour les opérateurs en gras |
| 224 |
\usepackage[bm]{mathador} |
| 225 |
%version sans la librairie tikz.babel |
| 226 |
\usepackage[nonbabel]{mathador} |
| 227 |
\end{DemoCode} |
| 228 |
|
| 229 |
Les packages utilisés sont \ShowCode{tikz}, \ShowCode{ifthen}, \ShowCode{listofitems}, \ShowCode{simplekv} et éventuellement \ShowCode{bm}. |
| 230 |
|
| 231 |
\subsection{Idées globales} |
| 232 |
|
| 233 |
Les éléments textuels sont automatiquement adaptés aux dimensions du plateau et des cases. |
| 234 |
|
| 235 |
Les styles sont fixés, mais peuvent être redéfinis |
| 236 |
|
| 237 |
\begin{DemoCode}{listing only} |
| 238 |
%====COULEURS PRINCIPALES |
| 239 |
\definecolor{mathadorppal}{HTML}{392b58} |
| 240 |
\definecolor{mathadorsecond}{HTML}{4b3971} |
| 241 |
\definecolor{mathadorjaune}{HTML}{dfc447} |
| 242 |
\definecolor{mathadorcible}{HTML}{e1c444} |
| 243 |
\definecolor{mathadorrose}{HTML}{c25a75} |
| 244 |
\definecolor{mathadorvert}{HTML}{aaa640} |
| 245 |
\definecolor{mathadorbleu}{HTML}{69acbd} |
| 246 |
%====COULEURS PASTELS |
| 247 |
\definecolor{mathadorppalpastel}{HTML}{D9E8FF} |
| 248 |
\definecolor{mathadorsecondpastel}{HTML}{EDF4FF} |
| 249 |
%====STYLES TIKZ |
| 250 |
\tikzset{mathadorpolice/.style={font=\sffamily}} |
| 251 |
\tikzset{mathadorpolicegras/.style={font=\bfseries\sffamily}} |
| 252 |
\end{DemoCode} |
| 253 |
|
| 254 |
Les opérateurs mathématiques sont, par défaut, en \ShowCode{\\mathsf}, mais il peuvent être redéfinis. |
| 255 |
|
| 256 |
\begin{DemoCode}{listing only} |
| 257 |
%====OPÉRATEURS |
| 258 |
\newcommand\intmathadorgrassf[1]{% |
| 259 |
\@ifpackageloaded{bm}{$\bm{\mathsf{#1}}$}{$\mathsf{#1}$}% |
| 260 |
} |
| 261 |
\def\mathadorplussymb{\intmathadorgrassf{\vphantom{-\times\div+}+}} |
| 262 |
\def\mathadormoinssymb{\intmathadorgrassf{\vphantom{-\times\div+}-}} |
| 263 |
\def\mathadorfoissymb{\intmathadorgrassf{\vphantom{-\times\div+}\times}} |
| 264 |
\def\mathadordivsymb{\intmathadorgrassf{\vphantom{-\times\div+}\div}} |
| 265 |
\end{DemoCode} |
| 266 |
|
| 267 |
\section{Les commandes} |
| 268 |
|
| 269 |
\subsection{Le plateau} |
| 270 |
|
| 271 |
La commande pour créer le plateau de jeu est : |
| 272 |
|
| 273 |
\begin{DemoCode}{listing only} |
| 274 |
\PlateauMathador[clés]<options tikz>{valeurs (5)}{valeur cible} |
| 275 |
\end{DemoCode} |
| 276 |
|
| 277 |
Les \textsf{clés} disponibles sont : |
| 278 |
|
| 279 |
\begin{itemize} |
| 280 |
\item \ShowCode{rayon} : rayon du plateau\hfill(\ShowCode{5cm} par défaut) |
| 281 |
\item \ShowCode{logo} : booléen pour afficher le logo\hfill(\ShowCode{true} par défaut) |
| 282 |
\item \ShowCode{epaisseur} : épaisseur (\texttt{auto} ou \texttt{longueur})\hfill(\ShowCode{auto} par défaut) |
| 283 |
\item \ShowCode{ombre} : booléen pour afficher une ombre\hfill(\ShowCode{true} par défaut) |
| 284 |
\item \ShowCode{impression} : booléen pour un mode NB\hfill(\ShowCode{false} par défaut) |
| 285 |
\item \ShowCode{pastels} : booléen pour un mode pastel \textit{bleu} si \ShowCode{impression=true} \hfill(\ShowCode{false} par défaut) |
| 286 |
\end{itemize} |
| 287 |
|
| 288 |
\begin{DemoCode}{} |
| 289 |
\PlateauMathador{1,6,19,7,12}{39} |
| 290 |
\end{DemoCode} |
| 291 |
|
| 292 |
\begin{DemoCode}{} |
| 293 |
\PlateauMathador[rayon=2.5cm,logo=false,epaisseur=0.2mm]{1,6,19,7,12}{39} |
| 294 |
\end{DemoCode} |
| 295 |
|
| 296 |
\begin{DemoCode}{} |
| 297 |
\PlateauMathador[impression,rayon=2.5cm]{1,6,19,7,12}{39} |
| 298 |
\end{DemoCode} |
| 299 |
|
| 300 |
\begin{DemoCode}{} |
| 301 |
\PlateauMathador[impression,pastels,rayon=2.5cm]{1,6,19,7,12}{39} |
| 302 |
\end{DemoCode} |
| 303 |
|
| 304 |
\begin{DemoCode}{} |
| 305 |
%opérateurs basés sur fontawesome |
| 306 |
\def\mathadorplussymb{\vphantom{\faPlus\faMinus\faDivide\faTimes}\faPlus} |
| 307 |
\def\mathadormoinssymb{\vphantom{\faPlus\faMinus\faDivide\faTimes}\faMinus} |
| 308 |
\def\mathadorfoissymb{\vphantom{\faPlus\faMinus\faDivide\faTimes}\faTimes} |
| 309 |
\def\mathadordivsymb{\vphantom{\faPlus\faMinus\faDivide\faTimes}\faDivide} |
| 310 |
|
| 311 |
\PlateauMathador[rayon=1.75cm,logo=false]{,,,,}{} |
| 312 |
\end{DemoCode} |
| 313 |
|
| 314 |
\subsection{La cible, les dés} |
| 315 |
|
| 316 |
Il est également possible de présenter les valeurs via les 6 \textit{dés} : |
| 317 |
|
| 318 |
\begin{DemoCode}{listing only} |
| 319 |
%la cible |
| 320 |
\CibleMathador[couleur]<options tikz>{hauteur}{valeur} |
| 321 |
\end{DemoCode} |
| 322 |
|
| 323 |
\begin{DemoCode}{listing only} |
| 324 |
%les dés |
| 325 |
\DeMathador<options tikz>{couleur}{type}{hauteur}{numéro} |
| 326 |
\end{DemoCode} |
| 327 |
|
| 328 |
La hauteur des dés n'est pas forcément uniforme, l'idée est de pouvoir présenter les dés \textit{cote à cote}, avec un rendu satisfaisant. |
| 329 |
|
| 330 |
\begin{DemoCode}{} |
| 331 |
\DeMathador{red}{Q}{2cm}{6} %dé Quatre |
| 332 |
\DeMathador{olive!50!lime}{S}{2cm}{2} %dé Six |
| 333 |
\DeMathador{orange}{H}{2cm}{} %dé Huit |
| 334 |
\DeMathador{blue}{D}{2cm}{12} %dé Douze |
| 335 |
\DeMathador{purple}{V}{2cm}{1} %dé Vingt |
| 336 |
\end{DemoCode} |
| 337 |
|
| 338 |
\begin{DemoCode}{} |
| 339 |
\CibleMathador{2cm}{61} |
| 340 |
\end{DemoCode} |
| 341 |
|
| 342 |
\begin{DemoCode}{} |
| 343 |
\CibleMathador[teal!50!black]{1.5cm}{61} |
| 344 |
\end{DemoCode} |
| 345 |
|
| 346 |
\subsection{Tirage complet} |
| 347 |
|
| 348 |
L'idée est de proposer une commande pour présenter un tirage \textit{complet}, avec les 7 valeurs. |
| 349 |
|
| 350 |
\begin{DemoCode}{listing only} |
| 351 |
\TirageDesMathador[clés]{cible}{dé1}{dé2}{dé3}{dé4}{dé5} |
| 352 |
\end{DemoCode} |
| 353 |
|
| 354 |
Les \textsf{clés} disponibles sont : |
| 355 |
|
| 356 |
\begin{itemize} |
| 357 |
\item \ShowCode{hauteur} : hauteur des dés \hfill(\ShowCode{1.5cm} par défaut) |
| 358 |
\item \ShowCode{couleurs} : couleurs des dés\hfill(\ShowCode{purple!50!black,red,olive!50!lime,orange,blue,purple} par défaut) |
| 359 |
\item \ShowCode{superpos} : booléen pour \textit{superposer} les dés\hfill(\ShowCode{true} par défaut) |
| 360 |
\item \ShowCode{impression} : booléen pour un mode NB\hfill(\ShowCode{false} par défaut) |
| 361 |
\end{itemize} |
| 362 |
|
| 363 |
\begin{DemoCode}{} |
| 364 |
\TirageDesMathador{61}{2}{4}{6}{7}{9} |
| 365 |
\end{DemoCode} |
| 366 |
|
| 367 |
\begin{DemoCode}{} |
| 368 |
\TirageDesMathador[impression]{61}{2}{4}{6}{7}{9} |
| 369 |
\end{DemoCode} |
| 370 |
|
| 371 |
\pagebreak |
| 372 |
|
| 373 |
\section{Historique} |
| 374 |
|
| 375 |
\texttt{0.1.1 : Meilleure gestion des \textit{opérateurs}} |
| 376 |
|
| 377 |
\texttt{0.1.0 : Version initiale} |
| 378 |
% |
| 379 |
%\section{The code} |
| 380 |
% |
| 381 |
%\DemoCodeFile{commalists-tools-l3.sty} |
| 382 |
|
| 383 |
\end{document} |