diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.pdf | bin | 490580 -> 481429 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.tex | 114 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.pdf | bin | 487997 -> 520790 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.tex | 152 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/scrabble/Scrabble.sty | 410 |
5 files changed, 309 insertions, 367 deletions
diff --git a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.pdf b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.pdf Binary files differindex 10a44a45d73..4ec7478db80 100644 --- a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.pdf +++ b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.pdf diff --git a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.tex b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.tex index 1bde6eb244c..3bbae9eae40 100644 --- a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.tex +++ b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-en.tex @@ -31,8 +31,8 @@ \setlength{\parindent}{0pt} \definecolor{LightGray}{gray}{0.9} -\def\TPversion{0.1.2} -\def\TPdate{07/01/2023} +\def\TPversion{0.1.3} +\def\TPdate{09/01/2023} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} @@ -110,22 +110,22 @@ \ScrabbleBoard[Scale=0.5] ~~~~ \begin{EnvScrabble}[Scale=0.5] - \ScrabblePutWord{T,I,K,Z}{1,13} - \ScrabblePutWord[V]{P,S,T,R,I,C,K,S}{1,15} - \ScrabblePutWord[V]{K,A,T,E,X}{3,13} - \ScrabblePutWord{C,L,E,V,E,R,E,F}{1,10} - \ScrabblePutWord[V]{M,E,T,A,P,O,S,T}{7,11} - \ScrabblePutWord{L,U,A,L,A,T,E,X}{5,8} - \ScrabblePutWord[V]{P,R,O,F,L,Y,*,E,E}{11,15} - \ScrabblePutWord{P,R,O,F,C,O,L,L,E,*,E}{1,1} - \ScrabblePutWord{S,Y,N,T,A,X,E}{7,5} - \ScrabblePutWord[V]{S,T,R,I,N,*}{10,6} + \ScrabblePutWord{TIKZ}{1,13} + \ScrabblePutWord[V]{pstricks}{1,15} + \ScrabblePutWord[V]{KaTeX}{3,13} + \ScrabblePutWord{cleveref}{1,10} + \ScrabblePutWord[V]{METAPOST}{7,11} + \ScrabblePutWord{LUALATEX}{5,8} + \ScrabblePutWord[V]{ProfLy*ee}{11,15} + \ScrabblePutWord{PROFCOLLE*E}{1,1} + \ScrabblePutWord{SYNTAX}{7,5} + \ScrabblePutWord[V]{STRIN*}{10,6} \end{EnvScrabble} \end{center} \vspace{0.5cm} -\hfill{}\textit{Thanks to french members of group \faFacebook{} " Coin \LaTeX{} " for help an aideas !} +\hfill{}\textit{Thanks to Denis Bitouzé and Patrick Bideault for help and ideas !} \vfill @@ -150,14 +150,6 @@ \newpage -\part*{History} - -\verb|v0.1.2|~:~~~~Key \textsf{<ScaleLabels>} to modify scale of the cell's names - -\verb|v0.1.1|~:~~~~Option \textsf{[fr]} for french commands - -\verb|v0.1 |~:~~~~Initial version - \part*{Introduction} \section{The Scrabble package} @@ -187,7 +179,7 @@ It loads the following packages and libraries : \begin{itemize} \item \texttt{tikz} with \Cle{calc} with the tikzlibraries \Cle{calc} and \Cle{shapes.geometric} ; \item \texttt{pgf} and \texttt{pgffor} ; - \item \texttt{xstring}, \texttt{xparse} and \texttt{simplekv}. + \item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} and \texttt{listofitems}. \end{itemize} \subsection{The package itself} @@ -195,17 +187,17 @@ It loads the following packages and libraries : The idea is to, thanks to \TikZ, propose commands or environments to display a Scrabble\texttrademark{} board : \begin{itemize} - \item \textit{independant} ; - \item in an \textit{environement} with words. + \item \textit{independent} ; + \item in an \textit{environment} with words. \end{itemize} \begin{PresentationCode}{listing only} -%independant command for the empty board +%independent command for the empty board \ScrabbleBoard<language>[keys] -%environmentt with word(s) +%environment with word(s) \begin{EnvScrabble}<language>[keys] - \ScrabblePutWord[orientation]{l,e,t,t,e,r,s}{coordinates of the beginning cell} + \ScrabblePutWord[orientation]{word}{coordinates of the beginning cell} \end{EnvScrabble} \end{PresentationCode} @@ -214,10 +206,10 @@ The idea is to, thanks to \TikZ, propose commands or environments to display a S The \textsf{commands}, \textsf{environments} et \textsf{keys} are in english, but cells can be displayed in : \begin{itemize} - \item english ; - \item french ; - \item german ; - \item spanish. + \item english (code ISO 639-1 EN) ; + \item french (code ISO 639-1 FR) ; + \item german (code ISO 639-1 DE) ; + \item spanish (code ISO 639-1 ES). \end{itemize} \pagebreak @@ -228,7 +220,7 @@ The \textsf{commands}, \textsf{environments} et \textsf{keys} are in english, bu The first argument, \textit{optional}, between \texttt{<...>} is the \Cle{langage} of the display, form the list : -\hfill\Cle{EN} (english, default), \Cle{FR} (french), \Cle{GE} (german) et \Cle{SP} (spanish).\hfill~ +\hfill\Cle{EN} (english, default), \Cle{FR} (french), \Cle{DE} (german) et \Cle{ES} (spanish).\hfill~ \smallskip @@ -238,24 +230,24 @@ The second argument, \textit{optional}, between \texttt{[...]} give the \Cle{key \item \Cle{Scale} for the display (the initial unit is 1~cm) ; \hfill~default : \Cle{1} \item \Cle{ScaleLabels} for the cell's names ; \hfill~défaut : \Cle{1} \item the boolean \Cle{Border} pour print a border outside the board ; \hfill~default : \Cle{true} - \item the boolean \Cle{Labels} to print \textit{names} of the special cells ;\hfill~defalut : \Cle{true} + \item the boolean \Cle{Labels} to print \textit{names} of the special cells ;\hfill~default : \Cle{true} \item the boolean \Cle{Help} pour print numbers to reperate th cells ;\hfill~default : \Cle{false} \end{itemize} \begin{PresentationCode}{} \ScrabbleBoard[Labels=false,Scale=0.55]\\ %board without cell's names -\ScrabbleBoard<SP>[Scale=0.55,Cadre=false] %board in spanisch +\ScrabbleBoard<ES>[Scale=0.55,Border=false] %board in spanish, without border \end{PresentationCode} \newpage \subsection{The board with words} -Here we can use the \textsf{environement} with the specific \textsf{command} in order to print words on the board. +Here we can use the \textsf{environment} with the specific \textsf{command} in order to print words on the board. \smallskip -For the \textit{environment}, the options are the same as for the independant \textsf{command} ! +For the \textit{environment}, the options are the same as for the independent \textsf{command} ! \smallskip @@ -263,7 +255,7 @@ For putting word on the board : \begin{itemize} \item the first argument, \textit{optional}, between \texttt{[...]} is the orientation of the word, \Cle{H} (by default) or \Cle{V} ; - \item the second argument, \textit{mandatory}, between \texttt{\{...\}}, is the list of the letters, separate by " \texttt{,} " ; + \item the second argument, \textit{mandatory}, between \texttt{\{...\}}, is the word, with uppercase or lowercase letters ; \item the last argument, \textit{mandatory}, between \texttt{\{...\}}, is the coordinates of the first cell for fisrt lettre (the cell (1;\,1) is south-west corner). \end{itemize} @@ -275,40 +267,46 @@ For putting word on the board : \begin{PresentationCode}{} \begin{EnvScrabble}[Scale=0.75,Labels=false,Help] - \ScrabblePutWord{T,I,K,Z}{1,13} - \ScrabblePutWord[V]{P,S,T,R,I,C,K,S}{1,15} - \ScrabblePutWord[V]{K,A,T,E,X}{3,13} - \ScrabblePutWord{C,L,E,V,E,R,E,F}{1,10} - \ScrabblePutWord[V]{M,E,T,A,P,O,S,T}{7,11} - \ScrabblePutWord{L,U,A,L,A,T,E,X}{5,8} - \ScrabblePutWord[V]{P,R,O,F,L,Y,*,E,E}{11,15} - \ScrabblePutWord{P,R,O,F,C,O,L,L,E,*,E}{1,1} - \ScrabblePutWord{S,Y,N,T,A,X,E}{7,5} - \ScrabblePutWord[V]{S,T,R,I,N,*}{10,6} + \ScrabblePutWord{TIKZ}{1,13} + \ScrabblePutWord[V]{pstricks}{1,15} + \ScrabblePutWord[V]{KaTeX}{3,13} + \ScrabblePutWord{cleveref}{1,10} + \ScrabblePutWord[V]{METAPOST}{7,11} + \ScrabblePutWord{LUALATEX}{5,8} + \ScrabblePutWord[V]{ProfLy*ee}{11,15} + \ScrabblePutWord{PROFCOLLE*E}{1,1} + \ScrabblePutWord{SYNTAX}{7,5} + \ScrabblePutWord[V]{STRIN*}{10,6} \end{EnvScrabble} \end{PresentationCode} \begin{PresentationCode}{} -\begin{EnvScrabble}<EN>[Scale=0.55] - \ScrabblePutWord{T,I,K,Z}{1,13} - \ScrabblePutWord[V]{P,S,T,R,I,C,K,S}{1,15} +\begin{EnvScrabble}[Scale=0.55] + \ScrabblePutWord{tikz}{1,13} \ScrabblePutWord[V]{PSTRiCKS}{1,15} \draw (7,15) node[font=\LARGE\sffamily] {English version} ; \end{EnvScrabble}~~~ \begin{EnvScrabble}<FR>[Scale=0.55] - \ScrabblePutWord{T,I,K,Z}{1,13} - \ScrabblePutWord[V]{P,S,T,R,I,C,K,S}{1,15} + \ScrabblePutWord{tikz}{1,13} \ScrabblePutWord[V]{PSTRiCKS}{1,15} \draw (7,15) node[font=\LARGE\sffamily] {French version} ; \end{EnvScrabble}\\ -\begin{EnvScrabble}<GE>[Scale=0.55] - \ScrabblePutWord{T,I,K,Z}{1,13} - \ScrabblePutWord[V]{P,S,T,R,I,C,K,S}{1,15} +\begin{EnvScrabble}<DE>[Scale=0.55] + \ScrabblePutWord{tikz}{1,13} \ScrabblePutWord[V]{PSTRiCKS}{1,15} \draw (7,15) node[font=\LARGE\sffamily] {German version} ; \end{EnvScrabble}~~~ -\begin{EnvScrabble}<SP>[Scale=0.55] - \ScrabblePutWord{L,A,T,E,X}{1,14} - \ScrabblePutWord[V]{M,A,D,R,I,D}{2,15} +\begin{EnvScrabble}<ES>[Scale=0.55] + \ScrabblePutWord{LaTeX}{1,14} \ScrabblePutWord[V]{Madrid}{2,15} \draw (7,15) node[font=\LARGE\sffamily] {Spanish vesion} ; \end{EnvScrabble} \end{PresentationCode} +\newpage + +\part*{History} + +\verb|v0.1.3|~:~~~~Words in uppercase or lowercase, adjusted codes for language (ISO 639-1) + +\verb|v0.1.2|~:~~~~Key \textsf{<ScaleLabels>} to modify scale of the cell's names + +\verb|v0.1 |~:~~~~Initial version + \end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.pdf b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.pdf Binary files differindex 3ea08b4c26a..04bb85d6fc2 100644 --- a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.pdf +++ b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.pdf diff --git a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.tex b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.tex index a7ee94ba36a..05d0ae1f4d4 100644 --- a/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.tex +++ b/Master/texmf-dist/doc/latex/scrabble/Scrabble-doc-fr.tex @@ -6,11 +6,11 @@ \usepackage[french]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} -\usepackage[fr]{Scrabble} +\usepackage{Scrabble} %\usepackage[upright]{fourier} %\usepackage[scaled=0.875]{helvet} %\renewcommand\ttdefault{lmtt} -%\usepackage[scaled=0.875]{cabin} +%\usepackage{cabin} \usepackage{amsmath,amssymb} \usepackage{fontawesome5} \usepackage{enumitem} @@ -31,8 +31,8 @@ \setlength{\parindent}{0pt} \definecolor{LightGray}{gray}{0.9} -\def\TPversion{0.1.2} -\def\TPdate{7 Janvier 2023} +\def\TPversion{0.1.3} +\def\TPdate{9 Janvier 2023} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} @@ -107,25 +107,27 @@ \vspace{0.5cm} \begin{center} - \PlateauScrabble[Echelle=0.5] + \PlateauScrabble[Echelle=0.4] ~~~~ - \begin{EnvScrabble}[Echelle=0.5] - \ScrabblePlaceMot{T,I,K,Z}{1,13} - \ScrabblePlaceMot[V]{P,S,T,R,I,C,K,S}{1,15} - \ScrabblePlaceMot[V]{K,A,T,E,X}{3,13} - \ScrabblePlaceMot{C,L,E,V,E,R,E,F}{1,10} - \ScrabblePlaceMot[V]{M,E,T,A,P,O,S,T}{7,11} - \ScrabblePlaceMot{L,U,A,L,A,T,E,X}{5,8} - \ScrabblePlaceMot[V]{P,R,O,F,L,Y,*,E,E}{11,15} - \ScrabblePlaceMot{P,R,O,F,C,O,L,L,E,*,E}{1,1} - \ScrabblePlaceMot{S,Y,N,T,A,X,E}{7,5} - \ScrabblePlaceMot[V]{S,T,R,I,N,*}{10,6} - \end{EnvScrabble} + \begin{EnvScrabbleFR}[Echelle=0.4] + \ScrabblePlaceMot{TIKZ}{1,13} + \ScrabblePlaceMot[V]{pstricks}{1,15} + \ScrabblePlaceMot[V]{KaTeX}{3,13} + \ScrabblePlaceMot{cleveref}{1,10} + \ScrabblePlaceMot[V]{METAPOST}{7,11} + \ScrabblePlaceMot{LUALATEX}{5,8} + \ScrabblePlaceMot[V]{ProfLy*ee}{11,15} + \ScrabblePlaceMot{PROFCOLLE*E}{1,1} + \ScrabblePlaceMot{SYNTAXE}{7,5} + \ScrabblePlaceMot[V]{STRIN*}{10,6} + \end{EnvScrabbleFR} \end{center} \vspace{0.5cm} -\hfill{}\textit{Merci aux membres du groupe \faFacebook{} du \og Coin \LaTeX{} \fg{} pour leur aide et leurs idées !} +%\hfill{}\textit{Merci aux membres du groupe \faFacebook{} du \og Coin \LaTeX{} \fg{} pour leur aide et leurs idées !} + +\hfill{}\textit{Merci à Denis Bitouzé et à Patrick Bideault pour leurs retours et idées !} \vfill @@ -150,14 +152,6 @@ \newpage -\part*{Historique} - -\verb|v0.1.2|~:~~~~Clé \textsf{<EchelleLabels>} pour modifier l'échelle des noms des cases - -\verb|v0.1.1|~:~~~~Option \textsf{[fr]} pour franciser les commandes - -\verb|v0.1 |~:~~~~Version initiale - \part*{Introduction} \section{Le package Scrabble} @@ -175,7 +169,7 @@ Le package a ensuite été \textit{construit} et \textit{modestement enrichi} au Le package \textsf{Scrabble} se charge dans le préambule via la commande : \begin{PresentationCode}{listing only} -\usepackage[fr]{Scrabble} +\usepackage{Scrabble} \end{PresentationCode} Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} ou \textsf{xelatex}. @@ -187,7 +181,7 @@ Il charge les packages et librairies suivantes : \begin{itemize} \item \texttt{tikz} avec les librairies \Cle{calc} et \Cle{shapes.geometric} ; \item \texttt{pgf} et \texttt{pgffor} ; - \item \texttt{xstring}, \texttt{xparse} et \texttt{simplekv}. + \item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} et \texttt{listofitems}. \end{itemize} \subsection{\og Philosophie \fg{} du package} @@ -203,21 +197,22 @@ L'idée est de proposer, grâce à des commandes en \TikZ, des \textsf{commandes %commande autonome pour afficher le plateau (vide) \PlateauScrabble<langue>[clés] -%environnement avec mot(s) -\begin{EnvScrabble}<langue>[clés] - \ScrabblePlaceMot[orientation]{l,e,t,t,r,e,s,}{coordonnées de la case de départ} -\end{EnvScrabble} +%environnement francisé, avec clés en français, avec mot(s) +\begin{EnvScrabbleFR}<langue>[clés] + \ScrabblePlaceMot[orientation]{mot}{coordonnées de la case de départ} + \ScrabblePlaceMot[orientation]{mot}{coordonnées de la case de départ} +\end{EnvScrabbleFR} \end{PresentationCode} \subsection{Langues} -Les \textsf{commandes}, \textsf{environnements} et \textsf{clés} proposées le sont en version \textsf{française}, mais les cases et points peuvent être affichées en : +Les \textsf{commandes}, \textsf{environnements} et \textsf{clés} proposées le sont en version \textsf{française} (et \textsf{anglaise}, voir fin de la doc), et les cases et points peuvent être affichées en : \begin{itemize} - \item français ; - \item anglais ; - \item allemand ; - \item espagnol. + \item français (code ISO 639-1 FR) ; + \item anglais (code ISO 639-1 EN) ; + \item allemand (code ISO 639-1 DE) ; + \item espagnol (code ISO 639-1 ES). \end{itemize} \pagebreak @@ -244,7 +239,7 @@ Le second argument, \textit{optionnel}, entre \texttt{[...]} propose les \Cle{cl \begin{PresentationCode}{} \PlateauScrabble[Labels=false,Echelle=0.55]\\ %plateau sans le nom des cases -\PlateauScrabble<EN>[Echelle=0.55,Cadre=false] %plateau en anglais +\PlateauScrabble<EN>[Echelle=0.55,Cadre=false] %plateau en anglais, sans cadre \end{PresentationCode} \newpage @@ -263,7 +258,7 @@ Pour le placement des mots : \begin{itemize} \item le premier argument, \textit{optionnel}, entre \texttt{[...]} est l'orientation du mot, à choisir entre \Cle{H} (par défaut) et \Cle{V} (en fait toute autre lettre que \Cle{H} !) ; - \item le deuxième argument, \textit{mandataire}, entre \texttt{\{...\}}, est la liste des lettres à placer, séparées par des \og \texttt{,} \fg{} ; + \item le deuxième argument, \textit{mandataire}, entre \texttt{\{...\}}, est le mot à placer, en majuscules ou minuscules ; \item le dernier argument, \textit{mandataire}, entre \texttt{\{...\}}, correspond aux coordonnées de la case sur laquelle sera placée le début du mot (la case (1;\,1) étant la case au bord Bas/Gauche). \end{itemize} @@ -274,41 +269,68 @@ Pour le placement des mots : \textbf{Remarque 2 :} le \textit{blanc} (ou \textit{joker}) est obtenu par la lettre \texttt{*}. \begin{PresentationCode}{} -\begin{EnvScrabble}[Echelle=0.75,Labels=false,Aide] - \ScrabblePlaceMot{T,I,K,Z}{1,13} - \ScrabblePlaceMot[V]{P,S,T,R,I,C,K,S}{1,15} - \ScrabblePlaceMot[V]{K,A,T,E,X}{3,13} - \ScrabblePlaceMot{C,L,E,V,E,R,E,F}{1,10} - \ScrabblePlaceMot[V]{M,E,T,A,P,O,S,T}{7,11} - \ScrabblePlaceMot{L,U,A,L,A,T,E,X}{5,8} - \ScrabblePlaceMot[V]{P,R,O,F,L,Y,*,E,E}{11,15} - \ScrabblePlaceMot{P,R,O,F,C,O,L,L,E,*,E}{1,1} - \ScrabblePlaceMot{S,Y,N,T,A,X,E}{7,5} - \ScrabblePlaceMot[V]{S,T,R,I,N,*}{10,6} -\end{EnvScrabble} +\begin{EnvScrabbleFR}[Echelle=0.75,Labels=false,Aide] + \ScrabblePlaceMot{TIKZ}{1,13} + \ScrabblePlaceMot[V]{pstricks}{1,15} + \ScrabblePlaceMot[V]{KaTeX}{3,13} + \ScrabblePlaceMot{cleveref}{1,10} + \ScrabblePlaceMot[V]{METAPOST}{7,11} + \ScrabblePlaceMot{LUALATEX}{5,8} + \ScrabblePlaceMot[V]{ProfLy*ee}{11,15} + \ScrabblePlaceMot{PROFCOLLE*E}{1,1} + \ScrabblePlaceMot{SYNTAXE}{7,5} + \ScrabblePlaceMot[V]{STRIN*}{10,6} +\end{EnvScrabbleFR} \end{PresentationCode} \begin{PresentationCode}{} -\begin{EnvScrabble}<FR>[Echelle=0.55] - \ScrabblePlaceMot{T,I,K,Z}{1,13} - \ScrabblePlaceMot[V]{P,S,T,R,I,C,K,S}{1,15} +\begin{EnvScrabbleFR}<FR>[Echelle=0.55] + \ScrabblePlaceMot{TIKZ}{1,13} \ScrabblePlaceMot[V]{pstricks}{1,15} \draw (7,15) node[font=\LARGE\sffamily] {Version française} ; %code rajouté -\end{EnvScrabble}~~~ -\begin{EnvScrabble}<EN>[Echelle=0.55] - \ScrabblePlaceMot{T,I,K,Z}{1,13} - \ScrabblePlaceMot[V]{P,S,T,R,I,C,K,S}{1,15} +\end{EnvScrabbleFR}~~~ +\begin{EnvScrabbleFR}<EN>[Echelle=0.55] + \ScrabblePlaceMot{TIKZ}{1,13} \ScrabblePlaceMot[V]{pstricks}{1,15} \draw (7,15) node[font=\LARGE\sffamily] {Version anglaise} ; %code rajouté -\end{EnvScrabble}\\ -\begin{EnvScrabble}<DE>[Echelle=0.55] - \ScrabblePlaceMot{T,I,K,Z}{1,13} - \ScrabblePlaceMot[V]{P,S,T,R,I,C,K,S}{1,15} +\end{EnvScrabbleFR}\\ +\begin{EnvScrabbleFR}<DE>[Echelle=0.55] + \ScrabblePlaceMot{TIKZ}{1,13} \ScrabblePlaceMot[V]{pstricks}{1,15} \draw (7,15) node[font=\LARGE\sffamily] {Version allemande} ; %code rajouté +\end{EnvScrabbleFR}~~~ +\begin{EnvScrabbleFR}<ES>[Echelle=0.55] + \ScrabblePlaceMot{TIKZ}{1,13} \ScrabblePlaceMot[V]{pstricks}{1,15} + \draw (7,15) node[font=\LARGE\sffamily] {Version espagnole} ; %code rajouté +\end{EnvScrabbleFR} +\end{PresentationCode} + +\newpage + +\subsection{Commandes anglaises} + +Le package ayant potentiellement une portée \textit{internationale}, les commandes existent également en version \textit{anglaise}. Dans ce cas, les \Cle{clés} sont également à donner en anglais. + +\begin{PresentationCode}{} +\ScrabbleBoard[Scale=0.5] \ScrabbleBoard[Labels=false,Scale=0.5] +\end{PresentationCode} + +\begin{PresentationCode}{} +\begin{EnvScrabble}[Scale=0.5] + \ScrabblePutWord{TIKZ}{1,13} \ScrabblePutWord[V]{pstricks}{1,15} + \draw (7,15) node[font=\LARGE\sffamily] {Version anglaise} ; %code rajouté \end{EnvScrabble}~~~ -\begin{EnvScrabble}<ES>[Echelle=0.55] - \ScrabblePlaceMot{L,A,T,E,X}{1,14} - \ScrabblePlaceMot[V]{M,A,D,R,I,D}{2,15} +\begin{EnvScrabble}<ES>[Scale=0.5] + \ScrabblePutWord{TIKZ}{1,13} \ScrabblePutWord[V]{pstricks}{1,15} \draw (7,15) node[font=\LARGE\sffamily] {Version espagnole} ; %code rajouté \end{EnvScrabble} \end{PresentationCode} +\newpage + +\part*{Historique} + +\verb|v0.1.3|~:~~~~Meilleure gestion de la saisie des mots (sans virgule, majuscule ou minuscule) + +\verb|v0.1.2|~:~~~~Clé \textsf{<EchelleLabels>} pour modifier l'échelle des noms des cases + +\verb|v0.1 |~:~~~~Version initiale + \end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/scrabble/Scrabble.sty b/Master/texmf-dist/tex/latex/scrabble/Scrabble.sty index 2777a1ac6e5..6c87e7e370c 100644 --- a/Master/texmf-dist/tex/latex/scrabble/Scrabble.sty +++ b/Master/texmf-dist/tex/latex/scrabble/Scrabble.sty @@ -4,66 +4,72 @@ % Inspiration : Mark Wibrow in https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{Scrabble}[2023/01/07 v0.1.2 Scrabble] +\ProvidesPackage{Scrabble}[2023/01/09 v0.1.3 Scrabble] +% 0.1.3 Refonte des commandes fr/en + gestion mot % 0.1.2 Clé <EchelleLabels> pour les labels des cases -% 0.1.1 Option [fr] pour franciser les commandes +% 0.1.1 Commandes en/fr % 0.1 Version initiale -%------Option -\newif\if@fr \@frfalse -\DeclareOption{fr}{\@frtrue} -\DeclareOption*{}%si option inconnue ;-) -\ProcessOptions\relax - %------Packages utiles \RequirePackage{tikz} \RequirePackage{pgf,pgffor} \RequirePackage{xstring} \RequirePackage{xparse} \RequirePackage{simplekv} +\RequirePackage{listofitems} %librairies tikz \usetikzlibrary{calc,shapes.geometric} -\if@fr %les commandes francisées -%score par lettre -%idées de https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders -\newcommand\lettrescorescrabble[2][FR]{%avec gestion du Joker par * +%score par lettre, codes pays par ISO 639-1 +\def\AlphabetMajuscule{ABCDEFGHIJKLMNOPQRSTUVWXYZ} +\def\AlphabetMinuscule{abcdefghijklmnopqrstuvwxyz} +\def\PointsScrabbleFR{1,3,3,2,1,4,2,4,1,8,10,1,1,1,1,3,8,1,1,1,1,4,10,10,10,10} +\readlist*{\PtsScrbFR}{\PointsScrabbleFR} +\def\PointsScrabbleEN{1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10} +\readlist*{\PtsScrbEN}{\PointsScrabbleEN} +\def\PointsScrabbleDE{1,3,4,1,1,2,2,2,2,1,6,4,2,3,2,4,10,1,1,1,1,6,3,8,10,3} +\readlist*{\PtsScrbDE}{\PointsScrabbleDE} +\def\PointsScrabbleES{1,3,3,2,1,4,2,4,1,8, ,1,3,1,1,3,5,1,1,1,1,4, ,8,4,10} +\readlist*{\PtsScrbES}{\PointsScrabbleES} + +\newcommand\scrabblescorelettre[2][EN]{%avec gestion du Joker par * \IfStrEq{#2}{*}% {}% {% - \def\tmp{#2}% - \expandafter\count\expandafter0\expandafter`#2\relax\advance\count0 by-65\relax% + \IfSubStr{\AlphabetMajuscule}{#2}%MAJ ou min + {\StrPosition{\AlphabetMajuscule}{#2}[\pos]}%index MAJ + {\StrPosition{\AlphabetMinuscule}{#2}[\pos]}%index min \IfStrEq{#1}{FR}% - {\ifcase\count0\relax1\or3\or3\or2\or1\or4\or2\or4\or1\or8\or10\or1\or1\or1\or1\or3\or8\or1\or1\or1\or1\or4\or10\or10\or10\or10\else\fi}{}% + {\PtsScrbFR[\pos]}{}%scoreFR \IfStrEq{#1}{EN}% - {\ifcase\count0\relax1\or3\or3\or2\or1\or4\or2\or4\or1\or8\or5\or1\or3\or1\or1\or3\or10\or1\or1\or1\or1\or4\or4\or8\or4\or10\else\fi}{}% + {\PtsScrbEN[\pos]}{}%scoreEN \IfStrEq{#1}{DE}% - {\ifcase\count0\relax1\or3\or4\or1\or1\or2\or2\or2\or2\or1\or6\or4\or2\or3\or2\or4\or10\or1\or1\or1\or1\or6\or3\or8\or10\or3\else\fi}{}% + {\PtsScrbDE[\pos]}{}%scoreDE \IfStrEq{#1}{ES}% - {\ifcase\count0\relax1\or3\or3\or2\or1\or4\or2\or4\or1\or8\or0\or1\or3\or1\or1\or3\or5\or1\or1\or1\or1\or4\or0\or8\or4\or10\else\fi}{}% + {\PtsScrbES[\pos]}{}%scoreSP }% } %commandes localisées des cases -\newcommand\SCRBMCT[1][FR]{% +\newcommand\SCRBMCT[1]{%mot x3 \IfStrEq{#1}{FR}{MOT\\COMPTE\\TRIPLE}{}% \IfStrEq{#1}{EN}{TRIPLE\\WORD\\SCORE}{}% \IfStrEq{#1}{DE}{\scalebox{2}[2]{3W}}{}% \IfStrEq{#1}{ES}{TRIPLE\\TANTO\\DE\\PALABRA}{}% } -\newcommand\SCRBMCD[1][FR]{% +\newcommand\SCRBMCD[1]{%mot x2 \IfStrEq{#1}{FR}{MOT\\COMPTE\\DOUBLE}{}% \IfStrEq{#1}{EN}{DOUBLE\\WORD\\SCORE}{}% \IfStrEq{#1}{DE}{\scalebox{2}[2]{2W}}{}% \IfStrEq{#1}{ES}{DOBLE\\TANTO\\DE\\PALABRA}{}% } -\newcommand\SCRBLCT[1][FR]{% +\newcommand\SCRBLCT[1]{%lettre x3 \IfStrEq{#1}{FR}{LETTRE\\COMPTE\\TRIPLE}{}% \IfStrEq{#1}{EN}{TRIPLE\\LETTER\\SCORE}{}% \IfStrEq{#1}{DE}{\scalebox{2}[2]{3B}}{}% \IfStrEq{#1}{ES}{TRIPLE\\TANTO\\DE\\LETRA}{}% } -\newcommand\SCRBLCD[1][FR]{% +\newcommand\SCRBLCD[1]{%lettre x2 \IfStrEq{#1}{FR}{LETTRE\\COMPTE\\DOUBLE}{}% \IfStrEq{#1}{EN}{DOUBLE\\LETTER\\SCORE}{}% \IfStrEq{#1}{DE}{\scalebox{2}[2]{2B}}{}% @@ -72,7 +78,7 @@ %styles case + jetons %idées de https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders -\tikzset{ +\tikzset{%fr scorelettre/.style={ font=\sffamily\bfseries\tiny,align=center,scale=\fpeval{\PLSCRBBLEechelleLabel*0.8},draw=none,fill=none }, @@ -91,246 +97,114 @@ }, jeton/.style={ code={ - \node[fill=yellow!40,minimum size=0.9 cm,rounded corners=\fpeval{\PLSCRBBLEechelle*0.15} cm,font=\Large\sffamily\bfseries] (JETON) {\IfStrEq{#1}{*}{}{#1}};% - \node[inner sep=2pt,font=\sffamily\scriptsize,anchor=south east] at (JETON.south east) { \lettrescorescrabble[\PLSCRBBLElangue]{#1} };% + \IfStrEq{#1}{*}{\node[fill=yellow!40,minimum size=0.9 cm,rounded corners=\fpeval{\PLSCRBBLEechelle*0.15} cm,font=\Large\sffamily\bfseries] (JETON) {};}% + {% + \node[fill=yellow!40,minimum size=0.9 cm,rounded corners=\fpeval{\PLSCRBBLEechelle*0.15} cm,font=\Large\sffamily\bfseries] (JETON) {\expandafter\MakeUppercase\expandafter{#1}};% + \node[inner sep=2pt,font=\sffamily\scriptsize,anchor=south east] at (JETON.south east) { \scrabblescorelettre[\PLSCRBBLElangue]{#1} };% + }% } }, placemotH/.style={ code={ - \foreach \l [count=\x from 0] in {#1} {\path ({\x-1},-1) pic {jeton={\l}};} + \StrLen{#1}[\lgmot]% + \foreach \l in {1,2,...,\lgmot} {\StrChar{#1}{\l}[\ll] \path ({\l-2},-1) pic {jeton={\ll}};} } }, placemotV/.style={ code={ - \foreach \l [count=\y from 0] in {#1} {\path (-1,-{\y-1}) pic {jeton={\l}};} + \StrLen{#1}[\lgmot]% + \foreach \l in {1,2,...,\lgmot} {\StrChar{#1}{\l}[\ll] \path (-1,-{\l}) pic {jeton={\ll}};} } }, - motcomptetriple/.style={ + motcomptetriplefr/.style={ code={ \path pic {pointes={3}{0.15}{red!75}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBMCT[\PLSCRBBLElangue] };}{} + \ifboolKV[PLSCRABBLETIKZFR]{Labels}% + {\node [scorelettre] { \SCRBMCT{\PLSCRBBLElangue} };}{} } }, - motcomptedouble/.style={ + motcomptedoublefr/.style={ code={ \path pic {pointes={2}{0.15}{red!25}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBMCD[\PLSCRBBLElangue] };} + \ifboolKV[PLSCRABBLETIKZFR]{Labels}% + {\node [scorelettre] { \SCRBMCD{\PLSCRBBLElangue} };} {}% } }, - lettrecomptetriple/.style={ + lettrecomptetriplefr/.style={ code={ \path pic {pointes={3}{0.15}{blue!50!cyan!75}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBLCT[\PLSCRBBLElangue] };}{} + \ifboolKV[PLSCRABBLETIKZFR]{Labels}% + {\node [scorelettre] { \SCRBLCT{\PLSCRBBLElangue} };}{} } }, - lettrecomptedouble/.style={ + lettrecomptedoublefr/.style={ code={ \path pic {pointes={2}{0.15}{blue!50!cyan!50}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBLCD[\PLSCRBBLElangue] };}{} - } - } -} - -%commande pour placer un mot -\newcommand\ScrabblePlaceMot[3][H]{% - \IfStrEq{#1}{H}% - {\path (#3) pic {placemotH={#2}};} - {\path (#3) pic {placemotV={#2}};} -} - -%clés -\defKV[PLSCRABBLETIKZ]{% - Echelle=\xdef\PLSCRBBLEechelle{#1},% - EchelleLabels=\xdef\PLSCRBBLEechelleLabel{#1} -} -\setKVdefault[PLSCRABBLETIKZ]{% - Echelle=1,% - EchelleLabels=1,% - Cadre=true,% - Labels=true,% - Aide=false -} - -%commandes génériques autonomes pour plateau -\NewDocumentCommand\PlateauScrabble{ D<>{FR} O{} }{%1=lng,2=options - \xdef\PLSCRBBLElangue{#1} - \useKVdefault[PLSCRABBLETIKZ] - \setKV[PLSCRABBLETIKZ]{#2} - \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}] - %plateau - \fill[gray!25] (-.5,-.5) rectangle ++(15,15); - \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15); - \foreach \scrcase in{(\x,\y),(\y,14-\x),(14-\x,14-\y),(14-\y,\x)}{% - \foreach \x/\y in {0/0,7/0}{\path \scrcase pic {motcomptetriple};} - \foreach \x/\y in {1/1,2/2,3/3,4/4}{\path \scrcase pic {motcomptedouble};} - \foreach \x/\y in {1/5,5/1,5/5}{\path \scrcase pic {lettrecomptetriple};} - \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6}{\path \scrcase pic {lettrecomptedouble};} - } - \path (7,7) pic {casecentrale}; - \ifboolKV[PLSCRABBLETIKZ]{Cadre}{\draw[line width=\fpeval{\PLSCRBBLEechelle*0.075} cm] (-0.6,-0.6) rectangle (14.6,14.6) ;}{} - \end{tikzpicture}% -} - -%environnement pour plateau, pour placer des mots -\NewDocumentEnvironment{EnvScrabble}{ D<>{FR} O{} }%1=LANG,2=options -{ - \xdef\PLSCRBBLElangue{#1} - \useKVdefault[PLSCRABBLETIKZ] - \setKV[PLSCRABBLETIKZ]{#2} - \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}] - %plateau - \fill[gray!25] (-.5,-.5) rectangle ++(15,15); - \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15); - \foreach \scrcase in{(\x,\y),(\y,14-\x),(14-\x,14-\y),(14-\y,\x)}{%cases spéciales - \foreach \x/\y in {0/0,7/0} {\path \scrcase pic {motcomptetriple};} - \foreach \x/\y in {1/1,2/2,3/3,4/4} {\path \scrcase pic {motcomptedouble};} - \foreach \x/\y in {1/5,5/1,5/5} {\path \scrcase pic {lettrecomptetriple};} - \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6} {\path \scrcase pic {lettrecomptedouble};} - } - \path (7,7) pic {casecentrale}; - \ifboolKV[PLSCRABBLETIKZ]{Cadre} - {\draw[line width=\fpeval{\PLSCRBBLEechelle*0.075} cm] (-0.6,-0.6) rectangle (14.6,14.6) ;}% - {} - \ifboolKV[PLSCRABBLETIKZ]{Aide} - {% - \foreach \numberscr in {1,2,...,15} - {\draw[gray] ({\numberscr-1},-0.65) node[below,font=\sffamily] {\numberscr};\draw[gray] (-0.65,{\numberscr-1}) node[left,font=\sffamily] {\numberscr};} - }% - {} -} -{ - \end{tikzpicture}% -} -\else %les commandes "anglaises" -%score par lettre -%idées de https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders -\newcommand\lettrescorescrabble[2][EN]{%avec gestion du Joker par * - \IfStrEq{#2}{*}% - {}% - {% - \def\tmp{#2}% - \expandafter\count\expandafter0\expandafter`#2\relax\advance\count0 by-65\relax% - \IfStrEq{#1}{FR}% - {\ifcase\count0\relax1\or3\or3\or2\or1\or4\or2\or4\or1\or8\or10\or1\or1\or1\or1\or3\or8\or1\or1\or1\or1\or4\or10\or10\or10\or10\else\fi}{}% - \IfStrEq{#1}{EN}% - {\ifcase\count0\relax1\or3\or3\or2\or1\or4\or2\or4\or1\or8\or5\or1\or3\or1\or1\or3\or10\or1\or1\or1\or1\or4\or4\or8\or4\or10\else\fi}{}% - \IfStrEq{#1}{GE}% - {\ifcase\count0\relax1\or3\or4\or1\or1\or2\or2\or2\or2\or1\or6\or4\or2\or3\or2\or4\or10\or1\or1\or1\or1\or6\or3\or8\or10\or3\else\fi}{}% - \IfStrEq{#1}{SP}% - {\ifcase\count0\relax1\or3\or3\or2\or1\or4\or2\or4\or1\or8\or0\or1\or3\or1\or1\or3\or5\or1\or1\or1\or1\or4\or0\or8\or4\or10\else\fi}{}% - }% -} - -%commandes localisées des cases -\newcommand\SCRBMCT[1][EN]{% - \IfStrEq{#1}{FR}{MOT\\COMPTE\\TRIPLE}{}% - \IfStrEq{#1}{EN}{TRIPLE\\WORD\\SCORE}{}% - \IfStrEq{#1}{GE}{\scalebox{2}[2]{3W}}{}% - \IfStrEq{#1}{SP}{TRIPLE\\TANTO\\DE\\PALABRA}{}% -} -\newcommand\SCRBMCD[1][EN]{% - \IfStrEq{#1}{FR}{MOT\\COMPTE\\DOUBLE}{}% - \IfStrEq{#1}{EN}{DOUBLE\\WORD\\SCORE}{}% - \IfStrEq{#1}{GE}{\scalebox{2}[2]{2W}}{}% - \IfStrEq{#1}{SP}{DOBLE\\TANTO\\DE\\PALABRA}{}% -} -\newcommand\SCRBLCT[1][EN]{% - \IfStrEq{#1}{FR}{LETTRE\\COMPTE\\TRIPLE}{}% - \IfStrEq{#1}{EN}{TRIPLE\\LETTER\\SCORE}{}% - \IfStrEq{#1}{GE}{\scalebox{2}[2]{3B}}{}% - \IfStrEq{#1}{SP}{TRIPLE\\TANTO\\DE\\LETRA}{}% -} -\newcommand\SCRBLCD[1][EN]{% - \IfStrEq{#1}{FR}{LETTRE\\COMPTE\\DOUBLE}{}% - \IfStrEq{#1}{EN}{DOUBLE\\LETTER\\SCORE}{}% - \IfStrEq{#1}{GE}{\scalebox{2}[2]{2B}}{}% - \IfStrEq{#1}{SP}{DOBLE\\TANTO\\DE\\LETRA}{}% -} - -%styles case + jetons -%idées de https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders -\tikzset{ - scorelettre/.style={ - font=\sffamily\bfseries\tiny,align=center,scale=\fpeval{\PLSCRBBLEechelleLabel*0.8},draw=none,fill=none - }, - pics/.cd, - pointes/.style args={#1#2#3}{ - code={ - \fill [#3,scale=0.5*0.9] (-1,1) {\foreach \i in {0,1,2,3}{% - [rotate=-\i*90] -- (-#1*#2,1) {\foreach \j in {1,...,#1} {-- ++(#2,#2) -- ++(#2,-#2)} -- (1,1)}}} -- cycle; + \ifboolKV[PLSCRABBLETIKZFR]{Labels}% + {\node [scorelettre] { \SCRBLCD{\PLSCRBBLElangue} };}{} } }, - casecentrale/.style={ - code={ - \path pic {pointes={2}{0.15}{red!25}}; - \node [star,fill,star point ratio=2.35] {};% - } - }, - jeton/.style={ - code={ - \node[fill=yellow!40,minimum size=0.9 cm,rounded corners=\fpeval{\PLSCRBBLEechelle*0.15} cm,font=\Large\sffamily\bfseries] (JETON) {\IfStrEq{#1}{*}{}{#1}};% - \node[inner sep=2pt,font=\sffamily\scriptsize,anchor=south east] at (JETON.south east) { \lettrescorescrabble[\PLSCRBBLElangue]{#1} };% - } - }, - placemotH/.style={ - code={ - \foreach \l [count=\x from 0] in {#1} {\path ({\x-1},-1) pic {jeton={\l}};} - } - }, - placemotV/.style={ - code={ - \foreach \l [count=\y from 0] in {#1} {\path (-1,-{\y-1}) pic {jeton={\l}};} - } - }, - motcomptetriple/.style={ + motcomptetripleen/.style={ code={ \path pic {pointes={3}{0.15}{red!75}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBMCT[\PLSCRBBLElangue] };}{} + \ifboolKV[PLSCRABBLETIKZEN]{Labels}% + {\node [scorelettre] { \SCRBMCT{\PLSCRBBLElangue} };}{} } }, - motcomptedouble/.style={ + motcomptedoubleen/.style={ code={ \path pic {pointes={2}{0.15}{red!25}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBMCD[\PLSCRBBLElangue] };} + \ifboolKV[PLSCRABBLETIKZEN]{Labels}% + {\node [scorelettre] { \SCRBMCD{\PLSCRBBLElangue} };} {}% } }, - lettrecomptetriple/.style={ + lettrecomptetripleen/.style={ code={ \path pic {pointes={3}{0.15}{blue!50!cyan!75}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBLCT[\PLSCRBBLElangue] };}{} + \ifboolKV[PLSCRABBLETIKZEN]{Labels}% + {\node [scorelettre] { \SCRBLCT{\PLSCRBBLElangue} };}{} } }, - lettrecomptedouble/.style={ + lettrecomptedoubleen/.style={ code={ \path pic {pointes={2}{0.15}{blue!50!cyan!50}};% - \ifboolKV[PLSCRABBLETIKZ]{Labels}% - {\node [scorelettre] { \SCRBLCD[\PLSCRBBLElangue] };}{} + \ifboolKV[PLSCRABBLETIKZEN]{Labels}% + {\node [scorelettre] { \SCRBLCD{\PLSCRBBLElangue} };}{} } } } -%commande pour placer un mot +%commande pour placer un mot fr/en +\newcommand\ScrabblePlaceMot[3][H]{% + \IfStrEq{#1}{H}% + {\path (#3) pic {placemotH={#2}};} + {\path (#3) pic {placemotV={#2}};} +} \newcommand\ScrabblePutWord[3][H]{% \IfStrEq{#1}{H}% {\path (#3) pic {placemotH={#2}};} {\path (#3) pic {placemotV={#2}};} } -%clés -\defKV[PLSCRABBLETIKZ]{% +%clés en/fr +\defKV[PLSCRABBLETIKZFR]{% + Echelle=\xdef\PLSCRBBLEechelle{#1},% + EchelleLabels=\xdef\PLSCRBBLEechelleLabel{#1} +} +\defKV[PLSCRABBLETIKZEN]{% Scale=\xdef\PLSCRBBLEechelle{#1},% ScaleLabels=\xdef\PLSCRBBLEechelleLabel{#1} } -\setKVdefault[PLSCRABBLETIKZ]{% +\setKVdefault[PLSCRABBLETIKZFR]{% + Echelle=1,% + EchelleLabels=1,% + Cadre=true,% + Labels=true,% + Aide=false +} +\setKVdefault[PLSCRABBLETIKZEN]{% Scale=1,% ScaleLabels=1,% Border=true,% @@ -339,55 +213,103 @@ } %commandes génériques autonomes pour plateau +\NewDocumentCommand\PlateauScrabble{ D<>{FR} O{} }{%1=lng,2=options + \xdef\PLSCRBBLElangue{#1}% + \useKVdefault[PLSCRABBLETIKZFR]% + \setKV[PLSCRABBLETIKZFR]{#2}% + \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}]% + %plateau + \fill[gray!25] (-.5,-.5) rectangle ++(15,15);% + \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15);% + \foreach \scrcase in{(\x,\y),(\y,14-\x),(14-\x,14-\y),(14-\y,\x)}{% + \foreach \x/\y in {0/0,7/0}{\path \scrcase pic {motcomptetriplefr};} + \foreach \x/\y in {1/1,2/2,3/3,4/4}{\path \scrcase pic {motcomptedoublefr};} + \foreach \x/\y in {1/5,5/1,5/5}{\path \scrcase pic {lettrecomptetriplefr};} + \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6}{\path \scrcase pic {lettrecomptedoublefr};} + }% + \path (7,7) pic {casecentrale};% + \ifboolKV[PLSCRABBLETIKZFR]{Cadre}{\draw[line width=\fpeval{\PLSCRBBLEechelle*0.075} cm] (-0.6,-0.6) rectangle (14.6,14.6) ;}{} + \end{tikzpicture}% +} \NewDocumentCommand\ScrabbleBoard{ D<>{EN} O{} }{%1=lng,2=options - \xdef\PLSCRBBLElangue{#1} - \useKVdefault[PLSCRABBLETIKZ] - \setKV[PLSCRABBLETIKZ]{#2} - \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}] + \xdef\PLSCRBBLElangue{#1}% + \useKVdefault[PLSCRABBLETIKZEN]% + \setKV[PLSCRABBLETIKZEN]{#2}% + \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}]% %plateau - \fill[gray!25] (-.5,-.5) rectangle ++(15,15); - \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15); + \fill[gray!25] (-.5,-.5) rectangle ++(15,15);% + \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15);% \foreach \scrcase in{(\x,\y),(\y,14-\x),(14-\x,14-\y),(14-\y,\x)}{% - \foreach \x/\y in {0/0,7/0}{\path \scrcase pic {motcomptetriple};} - \foreach \x/\y in {1/1,2/2,3/3,4/4}{\path \scrcase pic {motcomptedouble};} - \foreach \x/\y in {1/5,5/1,5/5}{\path \scrcase pic {lettrecomptetriple};} - \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6}{\path \scrcase pic {lettrecomptedouble};} - } - \path (7,7) pic {casecentrale}; - \ifboolKV[PLSCRABBLETIKZ]{Border}{\draw[line width=\fpeval{\PLSCRBBLEechelle*0.075} cm] (-0.6,-0.6) rectangle (14.6,14.6) ;}{} + \foreach \x/\y in {0/0,7/0}{\path \scrcase pic {motcomptetripleen};} + \foreach \x/\y in {1/1,2/2,3/3,4/4}{\path \scrcase pic {motcomptedoubleen};} + \foreach \x/\y in {1/5,5/1,5/5}{\path \scrcase pic {lettrecomptetripleen};} + \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6}{\path \scrcase pic {lettrecomptedoubleen};} + }% + \path (7,7) pic {casecentrale};% + \ifboolKV[PLSCRABBLETIKZEN]{Border}{\draw[line width=\fpeval{\PLSCRBBLEechelle*0.075} cm] (-0.6,-0.6) rectangle (14.6,14.6) ;}{}% \end{tikzpicture}% } -%environnement pour plateau, pour placer des mots -\NewDocumentEnvironment{EnvScrabble}{ D<>{EN} O{} }%1=LANG,2=options -{ - \xdef\PLSCRBBLElangue{#1} - \useKVdefault[PLSCRABBLETIKZ] - \setKV[PLSCRABBLETIKZ]{#2} - \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}] +%environnement FR pour plateau, pour placer des mots +\NewDocumentEnvironment{EnvScrabbleFR}{ D<>{FR} O{} }%1=LANG,2=options +{% + \xdef\PLSCRBBLElangue{#1}% + \useKVdefault[PLSCRABBLETIKZFR]% + \setKV[PLSCRABBLETIKZFR]{#2}% + \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}]% %plateau - \fill[gray!25] (-.5,-.5) rectangle ++(15,15); - \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15); + \fill[gray!25] (-.5,-.5) rectangle ++(15,15);% + \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15);% \foreach \scrcase in{(\x,\y),(\y,14-\x),(14-\x,14-\y),(14-\y,\x)}{%cases spéciales - \foreach \x/\y in {0/0,7/0} {\path \scrcase pic {motcomptetriple};} - \foreach \x/\y in {1/1,2/2,3/3,4/4} {\path \scrcase pic {motcomptedouble};} - \foreach \x/\y in {1/5,5/1,5/5} {\path \scrcase pic {lettrecomptetriple};} - \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6} {\path \scrcase pic {lettrecomptedouble};} - } - \path (7,7) pic {casecentrale}; - \ifboolKV[PLSCRABBLETIKZ]{Border} + \foreach \x/\y in {0/0,7/0} {\path \scrcase pic {motcomptetriplefr};} + \foreach \x/\y in {1/1,2/2,3/3,4/4} {\path \scrcase pic {motcomptedoublefr};} + \foreach \x/\y in {1/5,5/1,5/5} {\path \scrcase pic {lettrecomptetriplefr};} + \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6} {\path \scrcase pic {lettrecomptedoublefr};} + }% + \path (7,7) pic {casecentrale};% + \ifboolKV[PLSCRABBLETIKZFR]{Cadre}% {\draw[line width=\fpeval{\PLSCRBBLEechelle*0.075} cm] (-0.6,-0.6) rectangle (14.6,14.6) ;}% - {} - \ifboolKV[PLSCRABBLETIKZ]{Help} + {}% + \ifboolKV[PLSCRABBLETIKZFR]{Aide}% {% - \foreach \numberscr in {1,2,...,15} - {\draw[gray] ({\numberscr-1},-0.65) node[below,font=\sffamily] {\numberscr};\draw[gray] (-0.65,{\numberscr-1}) node[left,font=\sffamily] {\numberscr};} + \foreach \nb in {1,2,...,15} + {\draw[gray] ({\nb-1},-0.65) node[below,font=\sffamily] {\nb};\draw[gray] (-0.65,{\nb-1}) node[left,font=\sffamily] {\nb};}% }% - {} + {}% +}% +{% + \end{tikzpicture}% } -{ + +%environnement EN pour plateau, pour placer des mots +\NewDocumentEnvironment{EnvScrabble}{ D<>{EN} O{} }%1=LANG,2=options +{% + \xdef\PLSCRBBLElangue{#1}% + \useKVdefault[PLSCRABBLETIKZEN]% + \setKV[PLSCRABBLETIKZEN]{#2}% + \begin{tikzpicture}[scale=\PLSCRBBLEechelle,every node/.style={scale=\PLSCRBBLEechelle}]% + %plateau + \fill[gray!25] (-.5,-.5) rectangle ++(15,15);% + \draw[white,line width=\fpeval{\PLSCRBBLEechelle*0.1} cm, shift={(-.5,-.5)}] grid (15,15);% + \foreach \scrcase in{(\x,\y),(\y,14-\x),(14-\x,14-\y),(14-\y,\x)}{%cases spéciales + \foreach \x/\y in {0/0,7/0} {\path \scrcase pic {motcomptetripleen};} + \foreach \x/\y in {1/1,2/2,3/3,4/4} {\path \scrcase pic {motcomptedoubleen};} + \foreach \x/\y in {1/5,5/1,5/5} {\path \scrcase pic {lettrecomptetripleen};} + \foreach \x/\y in {3/0,0/3,2/6,6/2,6/6} {\path \scrcase pic {lettrecomptedoubleen};} + }% + \path (7,7) pic {casecentrale};% + \ifboolKV[PLSCRABBLETIKZEN]{Border}% + {\draw[line width=\fpeval{\PLSCRBBLEechelle*0.075} cm] (-0.6,-0.6) rectangle (14.6,14.6) ;}% + {}% + \ifboolKV[PLSCRABBLETIKZEN]{Help}% + {% + \foreach \nb in {1,2,...,15} + {\draw[gray] ({\nb-1},-0.65) node[below,font=\sffamily] {\nb};\draw[gray] (-0.65,{\nb-1}) node[left,font=\sffamily] {\nb};}% + }% + {}% +}% +{% \end{tikzpicture}% } -\fi \endinput
\ No newline at end of file |