| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} |
| 3 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') |
| 4 |
|
| 5 |
\documentclass{article} |
| 6 |
\usepackage[english]{babel} |
| 7 |
\usepackage[utf8]{inputenc} |
| 8 |
\usepackage[T1]{fontenc} |
| 9 |
\usepackage{Scrabble} |
| 10 |
%\usepackage[upright]{fourier} |
| 11 |
%\usepackage[scaled=0.875]{helvet} |
| 12 |
%\renewcommand\ttdefault{lmtt} |
| 13 |
%\usepackage[scaled=0.875]{cabin} |
| 14 |
\usepackage{amsmath,amssymb} |
| 15 |
\usepackage{fontawesome5} |
| 16 |
\usepackage{enumitem} |
| 17 |
\usepackage{tabularray} |
| 18 |
\usepackage{fancyvrb} |
| 19 |
\usepackage{fancyhdr} |
| 20 |
\fancyhf{} |
| 21 |
\renewcommand{\headrulewidth}{0pt} |
| 22 |
\lfoot{\sffamily\small [Scrabble]} |
| 23 |
\cfoot{\sffamily\small - \thepage{} -} |
| 24 |
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} |
| 25 |
|
| 26 |
\usepackage{hologo} |
| 27 |
\usepackage{xspace} |
| 28 |
\newcommand\tikzlogo{Ti\textit{k}Z} |
| 29 |
\newcommand\TeXLive{\hologo{TeX}Live\xspace} |
| 30 |
\let\TikZ\tikzlogo |
| 31 |
\newcommand\TableauDocumentation{% |
| 32 |
\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} |
| 33 |
{\huge \LaTeX} & & & & &\\ |
| 34 |
& {\huge \hologo{pdfLaTeX}} & & & & \\ |
| 35 |
& & {\huge \hologo{LuaLaTeX}} & & & \\ |
| 36 |
& & & {\huge \TikZ} & & \\ |
| 37 |
& & & & {\huge \TeXLive} & \\ |
| 38 |
& & & & & {\huge \hologo{MiKTeX}} \\ |
| 39 |
\end{tblr} |
| 40 |
} |
| 41 |
|
| 42 |
\usepackage{hyperref} |
| 43 |
\urlstyle{same} |
| 44 |
\hypersetup{pdfborder=0 0 0} |
| 45 |
\usepackage[margin=1.5cm]{geometry} |
| 46 |
\setlength{\parindent}{0pt} |
| 47 |
\definecolor{LightGray}{gray}{0.9} |
| 48 |
|
| 49 |
\def\TPversion{0.20a} |
| 50 |
\def\TPdate{16/12/2025} |
| 51 |
|
| 52 |
\usepackage[most]{tcolorbox} |
| 53 |
\usepackage{minted2} |
| 54 |
\tcbuselibrary{minted} |
| 55 |
\NewTCBListing{PresentationCode}{ O{blue} m }{% |
| 56 |
sharp corners=downhill,enhanced,arc=12pt,skin=bicolor,% |
| 57 |
colback=#1!1!white,colframe=#1!75!black,colbacklower=white,% |
| 58 |
attach boxed title to top right={yshift=-\tcboxedtitleheight},title=Code \LaTeX,% |
| 59 |
boxed title style={% |
| 60 |
colframe=#1!75!black,colback=#1!15!white,% |
| 61 |
,sharp corners=downhill,arc=12pt,% |
| 62 |
},% |
| 63 |
fonttitle=\color{#1!90!black}\itshape\ttfamily\footnotesize,% |
| 64 |
listing engine=minted,minted style=colorful, |
| 65 |
minted language=tex,minted options={tabsize=4,fontsize=\footnotesize,autogobble}, |
| 66 |
#2 |
| 67 |
} |
| 68 |
|
| 69 |
\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}} |
| 70 |
|
| 71 |
\begin{document} |
| 72 |
|
| 73 |
\pagestyle{fancy} |
| 74 |
|
| 75 |
\thispagestyle{empty} |
| 76 |
|
| 77 |
\vspace{2cm} |
| 78 |
|
| 79 |
\begin{center} |
| 80 |
\begin{minipage}{0.75\linewidth} |
| 81 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 82 |
\begin{center} |
| 83 |
\begin{tabular}{c} |
| 84 |
{\Huge \texttt{Scrabble [en]}}\\ |
| 85 |
\\ |
| 86 |
{\LARGE A board of Scrabble,} \\ |
| 87 |
\\ |
| 88 |
{\LARGE with words or not.} \\ |
| 89 |
\\ |
| 90 |
{Scrabble\texttrademark{}, from Hasbro\texttrademark{} and Mattel\texttrademark{}.} |
| 91 |
\end{tabular} |
| 92 |
|
| 93 |
\medskip |
| 94 |
|
| 95 |
{\small \texttt{Version \TPversion{} -- \TPdate}} |
| 96 |
\end{center} |
| 97 |
\end{tcolorbox} |
| 98 |
\end{minipage} |
| 99 |
\end{center} |
| 100 |
|
| 101 |
\vspace{0.5cm} |
| 102 |
|
| 103 |
\begin{center} |
| 104 |
\begin{tabular}{c} |
| 105 |
\texttt{Cédric Pierquet}\\ |
| 106 |
{\ttfamily c pierquet -- at -- outlook . fr}\\ |
| 107 |
\texttt{\url{https://github.com/cpierquet/latex-packages/tree/main/scrabble}}\\ |
| 108 |
\texttt{\url{https://forge.apps.education.fr/pierquetcedric/packages-latex}} |
| 109 |
\end{tabular} |
| 110 |
\end{center} |
| 111 |
|
| 112 |
\vspace{0.5cm} |
| 113 |
|
| 114 |
{$\blacktriangleright$~~Some commands to display a Scrabble board, with or without words.} |
| 115 |
|
| 116 |
\smallskip |
| 117 |
|
| 118 |
{$\blacktriangleright$~~English, French, German or Spanish version for points and labels.} |
| 119 |
|
| 120 |
\smallskip |
| 121 |
|
| 122 |
{$\blacktriangleright$~~Ideas from \scalebox{0.8}[1]{\ttfamily\url{ https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders}}} |
| 123 |
|
| 124 |
\vspace{0.15cm} |
| 125 |
|
| 126 |
\begin{center} |
| 127 |
\ScrabbleBoard[Scale=0.5] |
| 128 |
~~~~ |
| 129 |
\begin{EnvScrabble}[Scale=0.5] |
| 130 |
\ScrabblePutWord{TIKZ}{1,13} |
| 131 |
\ScrabblePutWord[V]{pstricks}{1,15} |
| 132 |
\ScrabblePutWord[V]{KaTeX}{3,13} |
| 133 |
\ScrabblePutWord{cleveref}{1,10} |
| 134 |
\ScrabblePutWord[V]{METAPOST}{7,11} |
| 135 |
\ScrabblePutWord{LUALATEX}{5,8} |
| 136 |
\ScrabblePutWord[V]{ProfLy*ee}{11,15} |
| 137 |
\ScrabblePutWord{PROFCOLLE*E}{1,1} |
| 138 |
\ScrabblePutWord{SYNTAX}{7,5} |
| 139 |
\ScrabblePutWord[V]{STRIN*}{10,6} |
| 140 |
\end{EnvScrabble} |
| 141 |
\end{center} |
| 142 |
|
| 143 |
\vspace{0.5cm} |
| 144 |
|
| 145 |
\hfill{}\textit{Thanks to \textsf{Denis Bitouzé}, \textsf{Patrick Bideault}, \textsf{quark67}, \textsf{Patrick Jenty} and \textsf{jmbeckers} for help and ideas !} |
| 146 |
|
| 147 |
\vfill |
| 148 |
|
| 149 |
\hrule |
| 150 |
|
| 151 |
\medskip |
| 152 |
|
| 153 |
\TableauDocumentation |
| 154 |
|
| 155 |
\medskip |
| 156 |
|
| 157 |
\hrule |
| 158 |
|
| 159 |
\medskip |
| 160 |
|
| 161 |
\newpage |
| 162 |
|
| 163 |
\part*{Introduction} |
| 164 |
|
| 165 |
\section{The Scrabble package} |
| 166 |
|
| 167 |
\subsection{Source} |
| 168 |
|
| 169 |
Some ideas are from \scalebox{0.8}[1]{\ttfamily\url{ https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders}}, with proposition from Mark Wibrow. |
| 170 |
|
| 171 |
\smallskip |
| 172 |
|
| 173 |
This package is \textit{build} within styles and ideas from Mark Wibrow. |
| 174 |
|
| 175 |
\subsection{Loading of the package, used packages} |
| 176 |
|
| 177 |
The package \textsf{Scrabble} loads within the preamble: |
| 178 |
|
| 179 |
\begin{PresentationCode}{listing only} |
| 180 |
\usepackage{Scrabble} |
| 181 |
\end{PresentationCode} |
| 182 |
|
| 183 |
It's mostly compatible with \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} or \textsf{xelatex} compilation! |
| 184 |
|
| 185 |
\medskip |
| 186 |
|
| 187 |
It loads the following packages and libraries: |
| 188 |
|
| 189 |
\begin{itemize} |
| 190 |
\item \texttt{tikz} with \Cle{calc} with the tikzlibraries \Cle{calc} and \Cle{shapes.geometric}; |
| 191 |
\item \texttt{pgf} and \texttt{pgffor}; |
| 192 |
\item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} and \texttt{listofitems}. |
| 193 |
\end{itemize} |
| 194 |
|
| 195 |
\subsection{The package itself} |
| 196 |
|
| 197 |
The idea is to, thanks to \TikZ, propose commands or environments to display a Scrabble\texttrademark{} board: |
| 198 |
|
| 199 |
\begin{itemize} |
| 200 |
\item \textit{independent}; |
| 201 |
\item in an \textit{environment} with words. |
| 202 |
\end{itemize} |
| 203 |
|
| 204 |
\begin{PresentationCode}{listing only} |
| 205 |
%independent command for the empty board |
| 206 |
\ScrabbleBoard<language>[keys] |
| 207 |
|
| 208 |
%environment with word(s) |
| 209 |
\begin{EnvScrabble}<language>[keys] |
| 210 |
\ScrabblePutWord[orientation]{word}{coordinates of the beginning cell} |
| 211 |
\end{EnvScrabble} |
| 212 |
\end{PresentationCode} |
| 213 |
|
| 214 |
\subsection{Languages} |
| 215 |
|
| 216 |
The \textsf{commands}, \textsf{environments} et \textsf{keys} are in english, but cells can be displayed in: |
| 217 |
|
| 218 |
\begin{itemize} |
| 219 |
\item english (code ISO 639-1 EN); |
| 220 |
\item french (code ISO 639-1 FR); |
| 221 |
\item german (code ISO 639-1 DE); |
| 222 |
\item spanish (code ISO 639-1 ES). |
| 223 |
\end{itemize} |
| 224 |
|
| 225 |
\pagebreak |
| 226 |
|
| 227 |
\section{Commands, keys and options} |
| 228 |
|
| 229 |
\subsection{The board, standalone} |
| 230 |
|
| 231 |
The first argument, \textit{optional}, between \texttt{<...>} is the \Cle{langage} of the display, form the list: |
| 232 |
|
| 233 |
\hfill\Cle{EN} (english, default), \Cle{FR} (french), \Cle{DE} (german) et \Cle{ES} (spanish).\hfill~ |
| 234 |
|
| 235 |
\smallskip |
| 236 |
|
| 237 |
The second argument, \textit{optional}, between \texttt{[...]} give the \Cle{keys}: |
| 238 |
|
| 239 |
\begin{itemize} |
| 240 |
\item \Cle{Scale} for the display (the initial unit is 1~cm); \hfill~default: \Cle{1} |
| 241 |
\item \Cle{ScaleLabels} for the cell's names; \hfill~défaut: \Cle{1} |
| 242 |
\item the boolean \Cle{Border} pour print a border outside the board; \hfill~default: \Cle{true} |
| 243 |
\item the boolean \Cle{Labels} to print \textit{names} of the special cells;\hfill~default: \Cle{true} |
| 244 |
\item the boolean \Cle{Help} pour print numbers to reperate th cells;\hfill~default: \Cle{false} |
| 245 |
\end{itemize} |
| 246 |
|
| 247 |
\begin{PresentationCode}{} |
| 248 |
\ScrabbleBoard[Labels=false,Scale=0.55]\\ %board without cell's names |
| 249 |
\ScrabbleBoard<ES>[Scale=0.55,Border=false] %board in spanish, without border |
| 250 |
\end{PresentationCode} |
| 251 |
|
| 252 |
\newpage |
| 253 |
|
| 254 |
\subsection{The board with words} |
| 255 |
|
| 256 |
Here we can use the \textsf{environment} with the specific \textsf{command} in order to print words on the board. |
| 257 |
|
| 258 |
\smallskip |
| 259 |
|
| 260 |
For the \textit{environment}, the options are the same as for the independent \textsf{command}! |
| 261 |
|
| 262 |
\smallskip |
| 263 |
|
| 264 |
For putting word on the board: |
| 265 |
|
| 266 |
\begin{itemize} |
| 267 |
\item the first argument, \textit{optional}, between \texttt{[...]} is the orientation of the word, \Cle{H} (by default) or \Cle{V}; |
| 268 |
\item the second argument, \textit{mandatory}, between \texttt{\{...\}}, is the word, with uppercase or lowercase letters; |
| 269 |
\item the last argument, \textit{mandatory}, between \texttt{\{...\}}, is the coordinates of the first cell for fisrt lettre (the cell \texttt{(1,1)} is south-west corner). |
| 270 |
\end{itemize} |
| 271 |
|
| 272 |
\textbf{Observation 1:} the chosen language will display the right points in the til! |
| 273 |
|
| 274 |
\smallskip |
| 275 |
|
| 276 |
\textbf{Observation 2:} the \textit{white} (or \textit{joker}) is coded by the character \texttt{*}. |
| 277 |
|
| 278 |
\begin{PresentationCode}{} |
| 279 |
\begin{EnvScrabble}[Scale=0.75,Labels=false,Help] |
| 280 |
\ScrabblePutWord{TIKZ}{1,13} |
| 281 |
\ScrabblePutWord[V]{pstricks}{1,15} |
| 282 |
\ScrabblePutWord[V]{KaTeX}{3,13} |
| 283 |
\ScrabblePutWord{cleveref}{1,10} |
| 284 |
\ScrabblePutWord[V]{METAPOST}{7,11} |
| 285 |
\ScrabblePutWord{LUALATEX}{5,8} |
| 286 |
\ScrabblePutWord[V]{ProfLy*ee}{11,15} |
| 287 |
\ScrabblePutWord{PROFCOLLE*E}{1,1} |
| 288 |
\ScrabblePutWord{SYNTAX}{7,5} |
| 289 |
\ScrabblePutWord[V]{STRIN*}{10,6} |
| 290 |
\end{EnvScrabble} |
| 291 |
\end{PresentationCode} |
| 292 |
|
| 293 |
\begin{PresentationCode}{} |
| 294 |
\begin{EnvScrabble}[Scale=0.55] |
| 295 |
\ScrabblePutWord{tikz}{1,13} \ScrabblePutWord[V]{PSTRiCKS}{1,15} |
| 296 |
\draw (7,15) node[font=\LARGE\sffamily] {English version} ; |
| 297 |
\end{EnvScrabble}~~~ |
| 298 |
\begin{EnvScrabble}<FR>[Scale=0.55] |
| 299 |
\ScrabblePutWord{tikz}{1,13} \ScrabblePutWord[V]{PSTRiCKS}{1,15} |
| 300 |
\draw (7,15) node[font=\LARGE\sffamily] {French version} ; |
| 301 |
\end{EnvScrabble}\\ |
| 302 |
\begin{EnvScrabble}<DE>[Scale=0.55] |
| 303 |
\ScrabblePutWord{tikz}{1,13} \ScrabblePutWord[V]{PSTRiCKS}{1,15} |
| 304 |
\draw (7,15) node[font=\LARGE\sffamily] {German version} ; |
| 305 |
\end{EnvScrabble}~~~ |
| 306 |
\begin{EnvScrabble}<ES>[Scale=0.55] |
| 307 |
\ScrabblePutWord{LaTeX}{1,14} \ScrabblePutWord[V]{Madrid}{2,15} |
| 308 |
\draw (7,15) node[font=\LARGE\sffamily] {Spanish version} ; |
| 309 |
\end{EnvScrabble} |
| 310 |
\end{PresentationCode} |
| 311 |
|
| 312 |
\newpage |
| 313 |
|
| 314 |
\subsection{\textit{Inline} word} |
| 315 |
|
| 316 |
The idea is to propose a command to insert a word in \textit{online} mode, with automatic adjustment of size and position. |
| 317 |
|
| 318 |
\begin{PresentationCode}{listing only} |
| 319 |
%command to put inline word |
| 320 |
\ScrabbleWord[keys]{word} |
| 321 |
\end{PresentationCode} |
| 322 |
|
| 323 |
The first argument, \textit{optional}, between \texttt{[...]} allows you to configure the \Cle{keys}: |
| 324 |
|
| 325 |
\begin{itemize} |
| 326 |
\item \Cle{Colback} for the color of the pieces \hfill~default: \Cle{yellow!40} |
| 327 |
\item \Cle{Font} for the font; \hfill~default: \Cle{\textbackslash bfseries\textbackslash sffamily} |
| 328 |
\item \Cle{Colfonte} for the color of the characters; \hfill~default: \Cle{black} |
| 329 |
\item \Cle{Lang} to choose the language (for the number of points); \hfill~default: \Cle{EN} |
| 330 |
\item \Cle{Offset} to specify horizontal spacing between pieces; \hfill~default: \Cle{0.1pt} |
| 331 |
\item \Cle{Scale} to specify a base scale for texts; \hfill~default: \Cle{0.6} |
| 332 |
\item \Cle{Shuffle} (boolean) to mix letters; \hfill~default: \Cle{false} |
| 333 |
\item \Cle{Score} which is a boolean to display the score of each piece. \hfill~default: \Cle{true} |
| 334 |
\end{itemize} |
| 335 |
|
| 336 |
\textbf{Note 1:} the code is responsible for positioning the pieces for \textit{satisfactory} alignment and scaling based on the active font. |
| 337 |
|
| 338 |
\smallskip |
| 339 |
|
| 340 |
\textbf{Note 2:} the \textit{blank} (or \textit{wildcard}) is obtained by the character \texttt{*}. |
| 341 |
|
| 342 |
\begin{PresentationCode}{} |
| 343 |
Inline Scrabble letter test positioning \ScrabbleWord{K} to see! |
| 344 |
\end{PresentationCode} |
| 345 |
|
| 346 |
\begin{PresentationCode}{} |
| 347 |
Inline Scrabble word test positioning \ScrabbleWord{TE*ST} to see! |
| 348 |
\end{PresentationCode} |
| 349 |
|
| 350 |
\begin{PresentationCode}{} |
| 351 |
{\Huge\sffamily Test positioning \ScrabbleWord[Colback=teal!5,Colfonte=orange]{PYTHAG*RE} to see!} |
| 352 |
\end{PresentationCode} |
| 353 |
|
| 354 |
\begin{PresentationCode}{} |
| 355 |
\scalebox{3}[3]{Positioning \ScrabbleWord[Lang=DE,Font=\ttfamily,Scale=0.75,Shuffle]{PYTHAG*RE} to see!} |
| 356 |
\end{PresentationCode} |
| 357 |
|
| 358 |
\begin{PresentationCode}{} |
| 359 |
{\LARGE Test positioning \ScrabbleWord[Score=false,Offset=1pt,Colback=orange!50]{PSTRICKS} to see!} |
| 360 |
\end{PresentationCode} |
| 361 |
|
| 362 |
\newpage |
| 363 |
|
| 364 |
\subsection{Special letters} |
| 365 |
|
| 366 |
It is possible to use special characters, for the languages \textsf{<DE>} and \textsf{<ES>}, but for compatibility reasons, special characters are \textit{coded} by numbers: |
| 367 |
|
| 368 |
\begin{itemize} |
| 369 |
\item \texttt{0} code the letter \fbox{\"O} with 8 points; |
| 370 |
\item \texttt{1} code the letter \fbox{\"A} with 6 points; |
| 371 |
\item \texttt{4} code the letter \fbox{\"U} with 6 points; |
| 372 |
\item \texttt{6} code the \textit{letter} \fbox{CH} with 5 points; |
| 373 |
\item \texttt{7} code the letter \fbox{\~{N}} with 8 points; |
| 374 |
\item \texttt{8} code the \textit{letter} \fbox{RR} with 8 points; |
| 375 |
\item \texttt{9} code the \textit{letter} \fbox{LL} with 8 points. |
| 376 |
\end{itemize} |
| 377 |
|
| 378 |
\begin{PresentationCode}{} |
| 379 |
{\Huge \ScrabbleWord[Lang=DE,Font=\ttfamily,Scale=0.75]{104AAA}} |
| 380 |
|
| 381 |
{\Huge \ScrabbleWord[Lang=ES,Font=\sffamily,Scale=0.75]{RO7OSO689}} |
| 382 |
\end{PresentationCode} |
| 383 |
|
| 384 |
\subsection{Colors} |
| 385 |
|
| 386 |
The colors used can be redefined using the aliases given below. |
| 387 |
|
| 388 |
\begin{PresentationCode}{listing only} |
| 389 |
\colorlet{triplewordscore}{red!75} |
| 390 |
\colorlet{doublewordscore}{red!25} |
| 391 |
\colorlet{tripleletterscore}{blue!50!cyan!75} |
| 392 |
\colorlet{doubleletterscore}{blue!50!cyan!50} |
| 393 |
\colorlet{scrabblebgtile}{yellow!40} |
| 394 |
\colorlet{scrabblebloard}{gray!25} |
| 395 |
\end{PresentationCode} |
| 396 |
|
| 397 |
\newpage |
| 398 |
|
| 399 |
\part*{History} |
| 400 |
|
| 401 |
\verb|v0.20a|:~~~~Bugfix with single letters |
| 402 |
|
| 403 |
\verb|v0.1.9|:~~~~Bugfix (forgotten 'cells') + colors |
| 404 |
|
| 405 |
\verb|v0.1.8|:~~~~Bugfix |
| 406 |
|
| 407 |
\verb|v0.1.7|:~~~~Key \textsf{[Shuffle]} for inline words |
| 408 |
|
| 409 |
\verb|v0.1.6|:~~~~Bugfix with \textit{joker} ; enhancements for \textsf{<DE>} board |
| 410 |
|
| 411 |
\verb|v0.1.5|:~~~~Special letters for \textsf{<DE>} and \textsf{<ES>} |
| 412 |
|
| 413 |
\verb|v0.1.4|:~~~~Command to insert \textit{inline} words |
| 414 |
|
| 415 |
\verb|v0.1.3|:~~~~Words in uppercase or lowercase, adjusted codes for language (ISO 639-1) |
| 416 |
|
| 417 |
\verb|v0.1.2|:~~~~Key \textsf{<ScaleLabels>} to modify scale of the cell's names |
| 418 |
|
| 419 |
\verb|v0.1 |:~~~~Initial version |
| 420 |
|
| 421 |
\end{document} |