summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-12-19 03:00:50 +0000
committerNorbert Preining <norbert@preining.info>2023-12-19 03:00:50 +0000
commit60e9a31bad8271499f6b5f9280174e76bd62814f (patch)
treec33ee4a5f7e5fb95bab9a06c6a5121e1f4728db1 /graphics
parente7154d152b4c047832de9bd4cf0d2bc3efe4125a (diff)
CTAN sync 202312190300
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pgf/contrib/thematicpuzzle/README.md7
-rw-r--r--graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.pdfbin0 -> 200040 bytes
-rw-r--r--graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.tex218
-rw-r--r--graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.pdfbin0 -> 195676 bytes
-rw-r--r--graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.tex247
-rw-r--r--graphics/pgf/contrib/thematicpuzzle/tex/thematicpuzzle.sty254
6 files changed, 726 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/thematicpuzzle/README.md b/graphics/pgf/contrib/thematicpuzzle/README.md
new file mode 100644
index 0000000000..c90dc5348f
--- /dev/null
+++ b/graphics/pgf/contrib/thematicpuzzle/README.md
@@ -0,0 +1,7 @@
+thematicpuzzle is a package to present a 'puzzle' of different themes.
+------------------------------------------------------------------------------
+thematicpuzzle est un package pour présenter un 'puzzle' de différents thèmes.
+------------------------------------------------------------------------------
+Author : Cédric Pierquet
+email : cpierquet@outlook.fr
+Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt \ No newline at end of file
diff --git a/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.pdf b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.pdf
new file mode 100644
index 0000000000..d61e0bcadf
--- /dev/null
+++ b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.tex b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.tex
new file mode 100644
index 0000000000..e47d51601c
--- /dev/null
+++ b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.tex
@@ -0,0 +1,218 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
+
+\documentclass[11pt,a4paper]{ltxdoc}
+\usepackage{thematicpuzzle}
+\usepackage{fancyvrb}
+\usepackage{fancyhdr}
+\usepackage{hyperref}
+\usepackage{tcolorbox}
+\tcbuselibrary{listings,listingsutf8}
+\fancyhf{}
+\renewcommand{\headrulewidth}{0pt}
+\lfoot{\sffamily\small [thematicpuzzle]}
+\rfoot{\sffamily\small - \thepage{} -}
+\usepackage{hologo}
+\usepackage{xspace}
+\providecommand\tikzlogo{Ti\textit{k}Z}
+\providecommand\TeXLive{\TeX{}Live\xspace}
+\providecommand\PSTricks{\textsf{PSTricks}\xspace}
+\let\pstricks\PSTricks
+\let\TikZ\tikzlogo
+
+\urlstyle{same}
+\hypersetup{pdfborder=0 0 0}
+\usepackage[margin=2cm]{geometry}
+\setlength{\parindent}{0pt}
+\def\TPversion{0.1.0}
+\def\TPdate{17/12/2023}
+\usepackage{soul}
+\usepackage{codehigh}
+\usepackage{tabularray}
+\sethlcolor{lightgray!25}
+\NewDocumentCommand\MontreCode{ m }{%
+ \hl{\vphantom{\texttt{pf}}\texttt{#1}}%
+}
+\usepackage[english]{babel}
+
+\begin{document}
+
+\pagestyle{fancy}
+
+\thispagestyle{empty}
+
+\begin{center}
+ \begin{minipage}{0.88\linewidth}
+ \begin{tcolorbox}[colframe=yellow,colback=yellow!15]
+ \begin{center}
+ \begin{tabular}{c}
+ {\Huge \texttt{thematicpuzzle [en]}}\\
+ \\
+ {\LARGE Present a horizontal 'puzzle',} \\
+ {\LARGE with different themes.} \\
+ \\
+ {\small \texttt{Version \TPversion{} -- \TPdate}}
+ \end{tabular}
+ \end{center}
+ \end{tcolorbox}
+\end{minipage}
+\end{center}
+
+\begin{center}
+ \begin{tabular}{c}
+ \texttt{Cédric Pierquet}\\
+ {\ttfamily c pierquet -- at -- outlook . fr}\\
+ \texttt{\url{https://github.com/cpierquet/thematicpuzzle}} \\
+\end{tabular}
+\end{center}
+
+\hrule
+
+\vfill
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\ThematicPuzzle{A,B,C,D,E,F,G,H}
+\end{tcolorbox}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\ThematicPuzzle[Thickness=1.25pt,Scale=2.75,BgColors={yellow!10,orange!10,green!10,teal!10,purple!10},Labels={Angry,Python,Cool,Apple,Battery},BorderColor=darkgray,IconsColor=teal!50!black]{\faAngry,\faPython,\faAngellist,\faApple*,\faBatteryHalf}
+\end{tcolorbox}
+
+\vfill~
+
+\pagebreak
+
+\phantomsection
+
+\hypertarget{matoc}{}
+
+\tableofcontents
+
+\vspace*{5mm}
+
+\hrule
+
+\vspace*{5mm}
+
+\section{Introduction}
+
+\subsection{Description}
+
+With this package, it is possible to create a \textit{horizontal banner}, in the form of a puzzle, with different themes.
+
+The styles are \textit{globally} fixed, but it is possible to configure:
+
+\begin{itemize}
+ \item colors;
+ \item icons;
+ \item labels.
+\end{itemize}
+
+The interior \textit{borders} are randomly oriented to the left or to the right, and the code takes care of coloring (if applicable) the parts satisfactorily.
+
+\subsection{Decorations}
+
+For the moment, the \textit{decorations} of the parts must be declared as characters, for example with icons from the \MontreCode{fontawesome5} package (loaded by the package).
+
+\smallskip
+
+Ultimately, it may be possible to insert images or \TikZ\ codes, this is one of the areas for improvement.
+
+\subsection{Loading}
+
+To load the package, simply add in the preamble :
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{thematicpuzzle}
+\end{verbatim}
+\end{quote}
+
+The useful and loaded packages are:
+
+\begin{itemize}
+ \item \MontreCode{tikz};
+ \item \MontreCode{fontawesome5};
+ \item \MontreCode{simplekv}, \MontreCode{listofitems} and \MontreCode{xstring}.
+\end{itemize}
+
+\vfill
+
+\subsection{History}
+
+\begin{quote}
+\begin{verbatim}
+0.1.0: Initial release
+\end{verbatim}
+\end{quote}
+
+\pagebreak
+
+\section{The macro}
+
+\subsection{General usage, keyx and options}
+
+In order to create a \textit{theme puzzle}, the command is:
+
+\begin{quote}
+\begin{verbatim}
+%----thematic puzzle
+\ThematicPuzzle[keys]<tikz options>{decoration list}
+\end{verbatim}
+\end{quote}
+
+The \textsf{keys}, optional and between \MontreCode{[...]}, are:
+
+\begin{itemize}
+ \item \MontreCode{Thickness} := thickness of the lines (\MontreCode{1pt} by default);
+ \item \MontreCode{Scale} := global scale of the figure (\MontreCode{1} by default);
+ \item \MontreCode{BgColors} := background color (\MontreCode{empty} by default);
+ \item \MontreCode{BorderColor} := color(s) (if necessary separated by \MontreCode{,}) of the borders (\MontreCode{black} by default);
+ \item \MontreCode{Labels} := (optional) labels of the themes (\MontreCode{empty} by default);
+ \item \MontreCode{ScaleLabels} := label scale (\MontreCode{1.15} by default);
+ \item \MontreCode{FontLabels} := label font (\MontreCode{\textbackslash tiny\textbackslash sffamily} by default);
+ \item \MontreCode{IconsColor} := color of icons and labels (\MontreCode{black} by default).
+\end{itemize}
+
+\medskip
+
+The optional argument, between \MontreCode{<...>}, corresponds to specific options (in \TikZ language) to pass to the created environment.
+
+\smallskip
+
+The obligatory argument, between \MontreCode{\{...\}}, corresponds to the list of decorations (in the form of \textit{characters}) of the different puzzle pieces, within form \MontreCode{\{deco<1>,deco<2>,...,deco<n>\}}
+
+\subsection{Examples}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\ThematicPuzzle{\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\ThematicPuzzle[Labels={Maths,History,Geo,Chemistry}]%
+ {\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\ThematicPuzzle%
+ [Scale=2,BgColors=yellow!25,Labels={Maths,History,Geo,Chemistry}]%
+ {\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\ThematicPuzzle%
+ [Scale=3,BgColors={yellow!10,orange!10,red!10,teal!10},
+ Labels={Maths,History,Geo,Chemistry}]%
+ {\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\ThematicPuzzle%
+ [Thickness=2pt,Scale=1.25,
+ BgColors={yellow!10,orange!10,red!10,teal!10,purple!10,gray!10},
+ IconsColor=teal!50!black]%
+ {P,Y,T,H,O,N}
+\end{tcblisting}
+
+\end{document} \ No newline at end of file
diff --git a/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.pdf b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.pdf
new file mode 100644
index 0000000000..17569a6dd3
--- /dev/null
+++ b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.tex b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.tex
new file mode 100644
index 0000000000..427ce2fdc4
--- /dev/null
+++ b/graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.tex
@@ -0,0 +1,247 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
+
+\documentclass[11pt,a4paper]{ltxdoc}
+\usepackage{thematicpuzzle}
+\usepackage{fancyvrb}
+\usepackage{fancyhdr}
+\usepackage{hyperref}
+\usepackage{tcolorbox}
+\tcbuselibrary{listings,listingsutf8}
+\fancyhf{}
+\renewcommand{\headrulewidth}{0pt}
+\lfoot{\sffamily\small [thematicpuzzle]}
+\rfoot{\sffamily\small - \thepage{} -}
+\usepackage{hologo}
+\providecommand\tikzlogo{Ti\textit{k}Z}
+\providecommand\TeXLive{\TeX{}Live\xspace}
+\providecommand\PSTricks{\textsf{PSTricks}\xspace}
+\let\pstricks\PSTricks
+\let\TikZ\tikzlogo
+
+\urlstyle{same}
+\hypersetup{pdfborder=0 0 0}
+\usepackage[margin=2cm]{geometry}
+\setlength{\parindent}{0pt}
+\def\TPversion{0.1.0}
+\def\TPdate{17/12/2023}
+\usepackage{soul}
+\usepackage{codehigh}
+\usepackage{tabularray}
+\sethlcolor{lightgray!25}
+\NewDocumentCommand\MontreCode{ m }{%
+ \hl{\vphantom{\texttt{pf}}\texttt{#1}}%
+}
+\usepackage[french]{babel}
+
+\begin{document}
+
+\pagestyle{fancy}
+
+\thispagestyle{empty}
+
+\begin{center}
+ \begin{minipage}{0.88\linewidth}
+ \begin{tcolorbox}[colframe=yellow,colback=yellow!15]
+ \begin{center}
+ \begin{tabular}{c}
+ {\Huge \texttt{thematicpuzzle [fr]}}\\
+ \\
+ {\LARGE Présenter un 'puzzle' horizontal,} \\
+ {\LARGE avec différents thèmes.} \\
+ \\
+ {\small \texttt{Version \TPversion{} -- \TPdate}}
+ \end{tabular}
+ \end{center}
+ \end{tcolorbox}
+\end{minipage}
+\end{center}
+
+\begin{center}
+ \begin{tabular}{c}
+ \texttt{Cédric Pierquet}\\
+ {\ttfamily c pierquet -- at -- outlook . fr}\\
+ \texttt{\url{https://github.com/cpierquet/thematicpuzzle}} \\
+\end{tabular}
+\end{center}
+
+\hrule
+
+\vfill
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\PuzzleThemes{A,B,C,D,E,F,G,H}
+\end{tcolorbox}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\PuzzleThemes[Epaisseur=1.25pt,Echelle=2.75,CouleursFond={yellow!10,orange!10,green!10,teal!10,purple!10},Labels={Probas,Stats,Python,Suites,Matrices},CouleurBord=darkgray,CouleurIcones=teal!50!black]{\ThemProbas,\ThemStats,\ThemPython,\ThemSuites,\ThemMatrices}
+\end{tcolorbox}
+
+\vfill~
+
+\pagebreak
+
+\phantomsection
+
+\hypertarget{matoc}{}
+
+\tableofcontents
+
+\vspace*{5mm}
+
+\hrule
+
+\vspace*{5mm}
+
+\section{Introduction}
+
+\subsection{Description}
+
+Avec ce package, il est possible de créer un \textit{bandeau horizontal}, sous forme de puzzle, avec différentes thématiques.
+
+Les styles sont \textit{globalement} fixés, mais il est possible de configurer :
+
+\begin{itemize}
+ \item les couleurs ;
+ \item les icones ;
+ \item les labels.
+\end{itemize}
+
+Les \textit{bordures} intérieures sont aléatoirement orientées vers la gauche ou vers la droite, et le code se charge de colorier (le cas échéant) les pièces de manière satisfaisante.
+
+\subsection{Décorations}
+
+Pour le moment, les \textit{décorations} des pièces sont à déclarer comme des caractères, par exemple avec des icônes du package \MontreCode{fontawesome5} (chargé par le package).
+
+\smallskip
+
+À terme, il sera peut-être possible d'insérer des images ou des codes \TikZ, cela fait partie des pistes d'améliorations.
+
+\subsection{Chargement}
+
+Pour charger le package, il suffit d'ajouter dans le préambule :
+
+\begin{quote}
+\begin{verbatim}
+\usepackage{thematicpuzzle}
+\end{verbatim}
+\end{quote}
+
+Les packages utiles, et chargés sont :
+
+\begin{itemize}
+ \item \MontreCode{tikz} ;
+ \item \MontreCode{fontawesome5} ;
+ \item \MontreCode{simplekv}, \MontreCode{listofitems} et \MontreCode{xstring}.
+\end{itemize}
+
+\vfill
+
+\subsection{Historique}
+
+\begin{quote}
+\begin{verbatim}
+0.1.0 : Version initiale
+\end{verbatim}
+\end{quote}
+
+\pagebreak
+
+\section{La commande}
+
+\subsection{Fonctionnement global}
+
+Dans le but de créer un \textit{puzzle de thèmes}, la commande est :
+
+\begin{quote}
+\begin{verbatim}
+%----puzzle de thèmes
+\PuzzleThemes[clés]<options tikz>{liste des décorations}
+\end{verbatim}
+\end{quote}
+
+\subsection{Clés, arguments}
+
+Les \textsf{clés}, optionnelles et entre \MontreCode{[...]}, sont :
+
+\begin{itemize}
+ \item \MontreCode{Epaisseur} := épaisseur des traits (\MontreCode{1pt} par défaut) ;
+ \item \MontreCode{Echelle} := échelle globale de la figure (\MontreCode{1} par défaut) ;
+ \item \MontreCode{CouleursFond} := couleur de fond (\MontreCode{vide} par défaut) ;
+ \item \MontreCode{CouleurBord} := couleur(s) (si besoin séparées par des \MontreCode{,}) des bordures (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Labels} := libellés (optionnels) des thèmes (\MontreCode{vide} par défaut) ;
+ \item \MontreCode{EchelleLabels} := échelle des libellés (\MontreCode{1.15} par défaut) ;
+ \item \MontreCode{PoliceLabels} := police des libellés (\MontreCode{\textbackslash tiny\textbackslash sffamily} par défaut) ;
+ \item \MontreCode{CouleurIcones} := couleur des icônes et les libellés (\MontreCode{black} par défaut).
+\end{itemize}
+
+\medskip
+
+L'argument optionnel, entre \MontreCode{<...>}, correspond à des options spécifiques (en langage \TikZ) à passer à l'environnement créé.
+
+\smallskip
+
+L'argument obligatoire, entre \MontreCode{\{...\}}, correspond à la liste des décorations (sous forme de \textit{caractères}) des différentes pièces de puzzle, sous la forme \MontreCode{\{Déco<1>,Déco<2>,...,Déco<n>\}}
+
+\subsection{Raccourcis pour certaines décorations}
+
+Des \textit{raccourcis} francisés ont été créés dans le package, pour des saisies simplifiées d décoration :
+
+\begin{center}
+ \begin{tblr}{hlines,colspec={Q[m,l]Q[m,l]}}
+ \fakeverb{\ThemProbas} & \ThemProbas \\
+ \fakeverb{\ThemStats} & \ThemStats \\
+ \fakeverb{\ThemChimie} & \ThemChimie \\
+ \fakeverb{\ThemArithm} & \ThemArithm \\
+ \fakeverb{\ThemGraphes} & \ThemGraphes \\
+ \fakeverb{\ThemComplexes} & \ThemComplexes \\
+ \fakeverb{\ThemMPM} & \ThemMPM \\
+ \fakeverb{\ThemCalculs} & \ThemCalculs \\
+ \fakeverb{\ThemMatrices} & \ThemMatrices \\
+ \fakeverb{\ThemGeometrie} & \ThemGeometrie \\
+ \fakeverb{\ThemEspace} & \ThemEspace \\
+ \fakeverb{\ThemPhysique} & \ThemPhysique \\
+ \fakeverb{\ThemFonctions} & \ThemFonctions \\
+ \fakeverb{\ThemSuites} & \ThemSuites \\
+ \fakeverb{\ThemTableur} & \ThemTableur \\
+ \fakeverb{\ThemAlgo} & \ThemAlgo \\
+ \fakeverb{\ThemEco} & \ThemEco \\
+ \fakeverb{\ThemPython} & \ThemPython \\
+ \fakeverb{\ThemLogique} & \ThemLogique \\
+ \end{tblr}
+\end{center}
+
+\subsection{Exemples}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\PuzzleThemes{\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\PuzzleThemes[Labels={Maths,Histoire,Géo,Chimie}]{\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\PuzzleThemes%
+ [Echelle=2,CouleursFond=yellow!25,Labels={Maths,Histoire,Géo,Chimie}]%
+ {\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\PuzzleThemes%
+ [Echelle=3,CouleursFond={yellow!10,orange!10,red!10,teal!10},
+ Labels={Maths,Histoire,Géo,Chimie}]%
+ {\faAngry,\faArchway,\faAtlas,\faAtom}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\PuzzleThemes%
+ [Epaisseur=2pt,Echelle=1.25,
+ CouleursFond={yellow!10,orange!10,red!10,teal!10,purple!10},
+ Labels={Probas,Stats,Python,Suites,Matrices},CouleurBord=brown,
+ CouleurIcones=teal!50!black]%
+ {\ThemProbas,\ThemStats,\ThemPython,\ThemSuites,\ThemMatrices}
+\end{tcblisting}
+
+\end{document} \ No newline at end of file
diff --git a/graphics/pgf/contrib/thematicpuzzle/tex/thematicpuzzle.sty b/graphics/pgf/contrib/thematicpuzzle/tex/thematicpuzzle.sty
new file mode 100644
index 0000000000..96576c24f3
--- /dev/null
+++ b/graphics/pgf/contrib/thematicpuzzle/tex/thematicpuzzle.sty
@@ -0,0 +1,254 @@
+% Author : C. Pierquet
+% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{thematicpuzzle}[2023/12/17 0.1.0 Present 'puzzle' with different thematics, in TikZ]
+% 0.1.0 Initial version
+
+%====PACKAGES
+\RequirePackage{tikz}
+\RequirePackage{simplekv}
+\RequirePackage{xstring}
+\RequirePackage{listofitems}
+\RequirePackage{fontawesome5}
+
+%====ALIASES FA5 FRENCH
+\newcommand\ThemProbas{\faDice}
+\newcommand\ThemStats{\faChartBar}
+\newcommand\ThemChimie{\faBong}
+\newcommand\ThemArithm{\faListOl}
+\newcommand\ThemGraphes{\faProjectDiagram}
+\newcommand\ThemComplexes{\faInfo}
+\newcommand\ThemMPM{\faSitemap}
+\newcommand\ThemCalculs{\faIcon{square-root-alt}}
+\newcommand\ThemMatrices{\faTh}
+\newcommand\ThemGeometrie{\faPencilRuler}
+\newcommand\ThemEspace{\faCube}
+\newcommand\ThemPhysique{\faRocket}
+\newcommand\ThemFonctions{\faChartArea}
+\newcommand\ThemSuites{\faSignal}
+\newcommand\ThemTableur{\faTable}
+\newcommand\ThemAlgo{\faCode}
+\newcommand\ThemEco{\faIcon{money-bill-wave}}
+\newcommand\ThemPython{\faPython}
+\newcommand\ThemLogique{\faYinYang}
+\newcommand\VAlignTikz{current bounding box.center}
+
+%====FRENCH VERSION
+\defKV[puzzlethemes]{%
+ Epaisseur=\def\puzzthmthick{#1},%
+ Echelle=\def\puzzthmscale{#1},%
+ CouleursFond=\def\puzzthmbg{#1},%
+ CouleurBord=\def\puzzthmbc{#1},%
+ Labels=\def\puzzthmlab{#1},%
+ EchelleLabels=\def\puzzthmscalab{#1},%
+ PoliceLabels=\def\puzzthmfontlab{#1},%
+ CouleurIcones=\def\puzzthmcolicon{#1}
+}
+\setKVdefault[puzzlethemes]{%
+ Epaisseur=1pt,%
+ Echelle=1,%
+ CouleursFond={},%
+ CouleurBord=black,
+ Labels={},%
+ EchelleLabels=1.15,%
+ PoliceLabels=\tiny\sffamily,%
+ CouleurIcones=black
+}
+
+\NewDocumentCommand\PuzzleThemes{ O{} D<>{} m }{%
+ \def\tmprounded{0.05}%
+ \useKVdefault[puzzlethemes]%
+ \setKV[puzzlethemes]{#1}%
+ \readlist*\PuzzleListeThemes{#3}%
+ \xdef\puzzthmnb{\PuzzleListeThemeslen}%
+ \xdef\puzztmpalea{\fpeval{2*randint(1,2)-3}}%
+ \foreach \i in {2,...,\inteval{\PuzzleListeThemeslen-1}}{%
+ \xdef\puzztmpalea{\puzztmpalea,\fpeval{2*randint(1,2)-3}}%
+ }%
+ \readlist*\PuzzleListeAlea{\puzztmpalea}%
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \readlist*\PuzzleListeCouleurs{\puzzthmbg}%
+ }%
+ {%
+ \xdef\puzzthmbgcol{\puzzthmbg}%
+ }%
+ \begin{tikzpicture}[scale=\puzzthmscale,transform shape,#2]%
+ %styles
+ \tikzset{bordure/.style={\puzzthmbc,line width={0.5*\puzzthmscale*\puzzthmthick}}}%
+ \tikzset{label/.style={font=\puzzthmfontlab,text=\puzzthmcolicon}}%
+ \IfEq{\puzzthmbg}{}%
+ {\tikzset{fond/.style={}}}%
+ {\tikzset{fond/.style={fill=\puzzthmbgcol}}}%
+ %1ère pièce
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \itemtomacro\PuzzleListeCouleurs[1]{\puzzthmbgcol}%
+ }%
+ {}%
+ \itemtomacro\PuzzleListeAlea[1]{\tmprand}%
+ \draw[bordure,fond] (\tmprounded,0) -- (1,0) .. controls (1+\tmprand*0.66*0.00,0.0) and (1+\tmprand*0.66*-0.04,0.4) ..
+ (1+\tmprand*0.66*0.04,0.4) .. controls (1+\tmprand*0.66*0.11,0.4) and (1+\tmprand*0.66*0.26,0.2) ..
+ (1+\tmprand*0.66*0.26,0.5) .. controls (1+\tmprand*0.66*0.26,0.8) and (1+\tmprand*0.66*0.11,0.6) ..
+ (1+\tmprand*0.66*0.04,0.6) .. controls (1+\tmprand*0.66*-0.04,0.6) and (1+\tmprand*0.66*0.00,1.0) ..
+ (1+\tmprand*0.66*0.00,1.0) -- (1,1) -- (\tmprounded,1) to[out=180,in=90] (0,1-\tmprounded) -- (0,\tmprounded) to[out=-90,in=180] (\tmprounded,0) ;
+ %les pièces du milieu
+ \foreach \i in {1,...,\inteval{\PuzzleListeThemeslen-2}}{%
+ \xdef\ipu{\inteval{\i+1}}%
+ \itemtomacro\PuzzleListeAlea[\i]{\tmprandg}%
+ \itemtomacro\PuzzleListeAlea[\ipu]{\tmprandd}%
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \itemtomacro\PuzzleListeCouleurs[\ipu]{\puzzthmbgcol}%
+ }%
+ {}%
+ \draw[bordure,fond] (\i,0) .. controls (\i+\tmprandg*0.66*0.00,0.0) and (\i+\tmprandg*0.66*-0.04,0.4) ..
+ (\i+\tmprandg*0.66*0.04,0.4) .. controls (\i+\tmprandg*0.66*0.11,0.4) and (\i+\tmprandg*0.66*0.26,0.2) ..
+ (\i+\tmprandg*0.66*0.26,0.5) .. controls (\i+\tmprandg*0.66*0.26,0.8) and (\i+\tmprandg*0.66*0.11,0.6) ..
+ (\i+\tmprandg*0.66*0.04,0.6) .. controls (\i+\tmprandg*0.66*-0.04,0.6) and (\i+\tmprandg*0.66*0.00,1.0) ..
+ (\i+\tmprandg*0.66*0.00,1.0) -- (\ipu,1)
+ .. controls (\ipu-\tmprandd*0.66*0.00,1.0) and (\ipu+\tmprandd*0.66*-0.04,0.6) ..
+ (\ipu+\tmprandd*0.66*0.04,0.6) .. controls (\ipu+\tmprandd*0.66*0.11,0.6) and (\ipu+\tmprandd*0.66*0.26,0.8) ..
+ (\ipu+\tmprandd*0.66*0.26,0.5) .. controls (\ipu+\tmprandd*0.66*0.26,0.2) and (\ipu+\tmprandd*0.66*0.11,0.4) ..
+ (\ipu+\tmprandd*0.66*0.04,0.4) .. controls (\ipu+\tmprandd*0.66*-0.04,0.4) and (\ipu+\tmprandd*0.66*0.00,0.0) ..
+ (\ipu+\tmprandd*0.66*0.00,0.0) -- (\ipu,0) -- (\i,0);
+ }%
+ %dernière pièce
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \itemtomacro\PuzzleListeCouleurs[-1]{\puzzthmbgcol}%
+ }%
+ {}%
+ \itemtomacro\PuzzleListeAlea[-1]{\tmprand}%
+ \draw[bordure,fond] (\puzzthmnb-1,0) .. controls (\puzzthmnb-1+\tmprand*0.66*0.00,0.0) and (\puzzthmnb-1+\tmprand*0.66*-0.04,0.4) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.04,0.4) .. controls (\puzzthmnb-1+\tmprand*0.66*0.11,0.4) and (\puzzthmnb-1+\tmprand*0.66*0.26,0.2) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.26,0.5) .. controls (\puzzthmnb-1+\tmprand*0.66*0.26,0.8) and (\puzzthmnb-1+\tmprand*0.66*0.11,0.6) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.04,0.6) .. controls (\puzzthmnb-1+\tmprand*0.66*-0.04,0.6) and (\puzzthmnb-1+\tmprand*0.66*0.00,1.0) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.00,1.0) -- (\puzzthmnb-1,1) -- (\puzzthmnb-\tmprounded,1) to[out=0,in=90] (\puzzthmnb,1-\tmprounded) -- (\puzzthmnb,\tmprounded) to[out=-90,in=0] (\puzzthmnb-\tmprounded,0) -- (\puzzthmnb-1,0) ;
+ %icones
+ \foreach \i in {1,...,\PuzzleListeThemeslen}{%
+ \draw ({\i-0.5},0.5) node[scale=1.25,text=\puzzthmcolicon] {\PuzzleListeThemes[\i]} ;
+ }%
+ %labels dessous
+ \IfEq{\puzzthmlab}{}%
+ {}%
+ {%
+ \readlist*\PuzzleListeLabels{\puzzthmlab}%
+ \foreach \i in {1,...,\PuzzleListeLabelslen}{%
+ \draw ({\i-0.5},0) node[below,inner sep=1pt,scale=\puzzthmscalab,label] {\PuzzleListeLabels[\i]} ;
+ }%
+ }%
+ \end{tikzpicture}%
+}
+
+%====ENGLISH VERSION
+\defKV[themepuzzle]{%
+ Thickness=\def\puzzthmthick{#1},%
+ Scale=\def\puzzthmscale{#1},%
+ BgColors=\def\puzzthmbg{#1},%
+ BorderColor=\def\puzzthmbc{#1},%
+ Labels=\def\puzzthmlab{#1},%
+ ScaleLabels=\def\puzzthmscalab{#1},%
+ FontLabels=\def\puzzthmfontlab{#1},%
+ IconsColor=\def\puzzthmcolicon{#1}
+}
+\setKVdefault[themepuzzle]{%
+ Thickness=1pt,%
+ Scale=1,%
+ BgColors={},%
+ BorderColor=black,
+ Labels={},%
+ ScaleLabels=1.15,%
+ FontLabels=\tiny\sffamily,%
+ IconsColor=black
+}
+
+\NewDocumentCommand\ThematicPuzzle{ O{} D<>{} m }{%
+ \def\tmprounded{0.05}%
+ \useKVdefault[themepuzzle]%
+ \setKV[themepuzzle]{#1}%
+ \readlist*\PuzzleListeThemes{#3}%
+ \xdef\puzzthmnb{\PuzzleListeThemeslen}%
+ \xdef\puzztmpalea{\fpeval{2*randint(1,2)-3}}%
+ \foreach \i in {2,...,\inteval{\PuzzleListeThemeslen-1}}{%
+ \xdef\puzztmpalea{\puzztmpalea,\fpeval{2*randint(1,2)-3}}%
+ }%
+ \readlist*\PuzzleListeAlea{\puzztmpalea}%
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \readlist*\PuzzleListeCouleurs{\puzzthmbg}%
+ }%
+ {%
+ \xdef\puzzthmbgcol{\puzzthmbg}%
+ }%
+ \begin{tikzpicture}[scale=\puzzthmscale,transform shape,#2]%
+ %styles
+ \tikzset{border/.style={\puzzthmbc,line width={0.5*\puzzthmscale*\puzzthmthick}}}%
+ \tikzset{label/.style={font=\puzzthmfontlab,text=\puzzthmcolicon}}%
+ \IfEq{\puzzthmbg}{}%
+ {\tikzset{background/.style={}}}%
+ {\tikzset{background/.style={fill=\puzzthmbgcol}}}%
+ %1ère pièce
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \itemtomacro\PuzzleListeCouleurs[1]{\puzzthmbgcol}%
+ }%
+ {}%
+ \itemtomacro\PuzzleListeAlea[1]{\tmprand}%
+ \draw[border,background] (\tmprounded,0) -- (1,0) .. controls (1+\tmprand*0.66*0.00,0.0) and (1+\tmprand*0.66*-0.04,0.4) ..
+ (1+\tmprand*0.66*0.04,0.4) .. controls (1+\tmprand*0.66*0.11,0.4) and (1+\tmprand*0.66*0.26,0.2) ..
+ (1+\tmprand*0.66*0.26,0.5) .. controls (1+\tmprand*0.66*0.26,0.8) and (1+\tmprand*0.66*0.11,0.6) ..
+ (1+\tmprand*0.66*0.04,0.6) .. controls (1+\tmprand*0.66*-0.04,0.6) and (1+\tmprand*0.66*0.00,1.0) ..
+ (1+\tmprand*0.66*0.00,1.0) -- (1,1) -- (\tmprounded,1) to[out=180,in=90] (0,1-\tmprounded) -- (0,\tmprounded) to[out=-90,in=180] (\tmprounded,0) ;
+ %les pièces du milieu
+ \foreach \i in {1,...,\inteval{\PuzzleListeThemeslen-2}}{%
+ \xdef\ipu{\inteval{\i+1}}%
+ \itemtomacro\PuzzleListeAlea[\i]{\tmprandg}%
+ \itemtomacro\PuzzleListeAlea[\ipu]{\tmprandd}%
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \itemtomacro\PuzzleListeCouleurs[\ipu]{\puzzthmbgcol}%
+ }%
+ {}%
+ \draw[border,background] (\i,0) .. controls (\i+\tmprandg*0.66*0.00,0.0) and (\i+\tmprandg*0.66*-0.04,0.4) ..
+ (\i+\tmprandg*0.66*0.04,0.4) .. controls (\i+\tmprandg*0.66*0.11,0.4) and (\i+\tmprandg*0.66*0.26,0.2) ..
+ (\i+\tmprandg*0.66*0.26,0.5) .. controls (\i+\tmprandg*0.66*0.26,0.8) and (\i+\tmprandg*0.66*0.11,0.6) ..
+ (\i+\tmprandg*0.66*0.04,0.6) .. controls (\i+\tmprandg*0.66*-0.04,0.6) and (\i+\tmprandg*0.66*0.00,1.0) ..
+ (\i+\tmprandg*0.66*0.00,1.0) -- (\ipu,1)
+ .. controls (\ipu-\tmprandd*0.66*0.00,1.0) and (\ipu+\tmprandd*0.66*-0.04,0.6) ..
+ (\ipu+\tmprandd*0.66*0.04,0.6) .. controls (\ipu+\tmprandd*0.66*0.11,0.6) and (\ipu+\tmprandd*0.66*0.26,0.8) ..
+ (\ipu+\tmprandd*0.66*0.26,0.5) .. controls (\ipu+\tmprandd*0.66*0.26,0.2) and (\ipu+\tmprandd*0.66*0.11,0.4) ..
+ (\ipu+\tmprandd*0.66*0.04,0.4) .. controls (\ipu+\tmprandd*0.66*-0.04,0.4) and (\ipu+\tmprandd*0.66*0.00,0.0) ..
+ (\ipu+\tmprandd*0.66*0.00,0.0) -- (\ipu,0) -- (\i,0);
+ }%
+ %dernière pièce
+ \IfSubStr{\puzzthmbg}{,}%
+ {%
+ \itemtomacro\PuzzleListeCouleurs[-1]{\puzzthmbgcol}%
+ }%
+ {}%
+ \itemtomacro\PuzzleListeAlea[-1]{\tmprand}%
+ \draw[border,background] (\puzzthmnb-1,0) .. controls (\puzzthmnb-1+\tmprand*0.66*0.00,0.0) and (\puzzthmnb-1+\tmprand*0.66*-0.04,0.4) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.04,0.4) .. controls (\puzzthmnb-1+\tmprand*0.66*0.11,0.4) and (\puzzthmnb-1+\tmprand*0.66*0.26,0.2) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.26,0.5) .. controls (\puzzthmnb-1+\tmprand*0.66*0.26,0.8) and (\puzzthmnb-1+\tmprand*0.66*0.11,0.6) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.04,0.6) .. controls (\puzzthmnb-1+\tmprand*0.66*-0.04,0.6) and (\puzzthmnb-1+\tmprand*0.66*0.00,1.0) ..
+ (\puzzthmnb-1+\tmprand*0.66*0.00,1.0) -- (\puzzthmnb-1,1) -- (\puzzthmnb-\tmprounded,1) to[out=0,in=90] (\puzzthmnb,1-\tmprounded) -- (\puzzthmnb,\tmprounded) to[out=-90,in=0] (\puzzthmnb-\tmprounded,0) -- (\puzzthmnb-1,0) ;
+ %icones
+ \foreach \i in {1,...,\PuzzleListeThemeslen}{%
+ \draw ({\i-0.5},0.5) node[scale=1.25,text=\puzzthmcolicon] {\PuzzleListeThemes[\i]} ;
+ }%
+ %labels dessous
+ \IfEq{\puzzthmlab}{}%
+ {}%
+ {%
+ \readlist*\PuzzleListeLabels{\puzzthmlab}%
+ \foreach \i in {1,...,\PuzzleListeLabelslen}{%
+ \draw ({\i-0.5},0) node[below,inner sep=1pt,scale=\puzzthmscalab,label] {\PuzzleListeLabels[\i]} ;
+ }%
+ }%
+ \end{tikzpicture}%
+}
+
+
+\endinput \ No newline at end of file