texlive[74842] Master/texmf-dist: tangramtikz (3apr25)
commits+karl at tug.org
commits+karl at tug.org
Thu Apr 3 21:52:19 CEST 2025
Revision: 74842
https://tug.org/svn/texlive?view=revision&revision=74842
Author: karl
Date: 2025-04-03 21:52:19 +0200 (Thu, 03 Apr 2025)
Log Message:
-----------
tangramtikz (3apr25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-en.pdf
trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-en.tex
trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-fr.pdf
trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-fr.tex
trunk/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty
Modified: trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-en.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-en.tex 2025-04-03 19:52:07 UTC (rev 74841)
+++ trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-en.tex 2025-04-03 19:52:19 UTC (rev 74842)
@@ -50,8 +50,8 @@
\setlength{\parindent}{0pt}
\definecolor{LightGray}{gray}{0.9}
-\def\TPversion{0.1.7}
-\def\TPdate{25/01/2025}
+\def\TPversion{0.1.8}
+\def\TPdate{03/04/2025}
\usepackage[most]{tcolorbox}
\usepackage{minted2}
@@ -309,7 +309,7 @@
\draw[thick,<->,>=latex] (0,-0.25)--(1,-0.25) node[blue,scale=1.5,midway,below,font=\large\sffamily] {1} ;
\draw[thick,<->,>=latex] (-0.15,0.15)--++(45:{sqrt(2)}) node[blue,scale=1.5,midway,sloped,above,font=\large\sffamily] {$\mathsf{\sqrt{2}}$} ;
\draw[thick,<->,>=latex] (2.15,0)--++(0,1) node[blue,scale=1.5,midway,right,font=\large\sffamily] {1} ;
- \draw[thick,<->,>=latex] (2.15,1.15)--++(135:{0.5*sqrt(2)}) node[blue,midway,sloped,above,font=\large\sffamily] {$\mathsf{0{,}5\sqrt{2}}$} ;
+ \draw[thick,<->,>=latex] (2.15,1.15)--++(135:{0.5*sqrt(2)}) node[blue,midway,sloped,above,font=\large\sffamily] {$\mathsf{0.5\sqrt{2}}$} ;
\draw[thick,dashed] (2,1)--++(0.15,0.15) (1,1)--++(45:{0.5*sqrt(2)+0.2}) ;
\draw (1,3) node[purple,scale=1.5,below=1pt,font=\Large\ttfamily] {TangPara} ;
\end{tikzpicture}
@@ -320,7 +320,8 @@
\begin{itemize}
\item rotated, thanks to \tikzlogo\ \texttt{rotate=...} option;
\item flipped vertically or horizontally, thanks to \tikzlogo\ \texttt{xscale=-1} and \texttt{yscale=-1} options;
- \item moved, by placing its origin at the point of coordinates \texttt{(x,y)}.
+ \item moved, by placing its origin at the point of coordinates \texttt{(x,y)} ;
+ \item in case a piece is both rotated and flipped about a single axis, the rotation is performed before the flip.
\end{itemize}
Each piece comes with a \tikzlogo\ style:
@@ -403,14 +404,15 @@
The first argument, \textit{optional} and provided within \texttt{[...]}, deals with the keys and their associated options:
\begin{itemize}
- \item the boolean \Cle{Puzzle} to display \textit{mono}coloured pieces, without border \hfill~default : \Cle{true}
- \item the boolean \Cle{Solution} (\textsc{\textcolor{purple}{\scriptsize\textbf{new name since v0.1.7 !}}}) to display \textit{mono}coloured pieces, with a border \hfill~default : \Cle{false}
- \item \Cle{Color} to configure the \textit{mono}colour associated with the previous booleans \hfill~default : \Cle{black}
- \item the boolean \Cle{ColorSolution} (\textsc{\textcolor{purple}{\scriptsize\textbf{new name since v0.1.7 !}}}) to display coloured pieces, with a border \hfill~default : \Cle{false}
+ \item the boolean \Cle{Puzzle} to display \textit{mono}coloured pieces, without border \hfill~default: \Cle{true}
+ \item the boolean \Cle{Solution} (\textsc{\textcolor{purple}{\scriptsize\textbf{new name since v0.1.7 !}}}) to display \textit{mono}coloured pieces, with a border \hfill~default: \Cle{false}
+ \item the boolean \Cle{BlackWhite} which displays part layouts with border \hfill~default: \Cle{false}
+ \item \Cle{Color} to configure the \textit{mono}colour associated with the previous booleans \hfill~default: \Cle{black}
+ \item the boolean \Cle{ColorSolution} (\textsc{\textcolor{purple}{\scriptsize\textbf{new name since v0.1.7 !}}}) to display coloured pieces, with a border \hfill~default: \Cle{false}
\item \Cle{ColorList} to list the colours of the pieces (\texttt{BT,MT,ST,SQUA,PARA});
- \hfill~default : \Cle{red,orange,blue,green,purple}
- \item \Cle{Sep}, the width of the border in \Cle{Solution} mode. \hfill~default : \Cle{1pt}
+ \hfill~default: \Cle{red,orange,blue,green,purple}
+ \item \Cle{Sep}, the width of the border in \Cle{Solution} mode. \hfill~default: \Cle{1pt}
\end{itemize}
The second argument, \textit{optional} and within \texttt{<...>}, provides options to the \tikzlogo{} environment, for instance:
@@ -467,6 +469,8 @@
\item Crab
\item Snail
\item Goose
+ \item Cow
+ \item Gift
\end{itemize}
\end{multicols}}
@@ -478,7 +482,8 @@
\TangramTikz[ColorSolution,ColorList={orange,blue,yellow,green,pink},Sep=1mm]{Rocket}
\TangramTikz<scale=1.5,rotate=30>{Rocket}~~
-\TangramTikz<scale=0.75,rotate=-90>{Rocket}
+\TangramTikz<scale=0.75,rotate=-90>{Rocket}~~
+\TangramTikz[BlackWhite]<scale=0.5>{Rocket}
\end{PresentationCode}
\pagebreak
@@ -487,6 +492,7 @@
\begin{PresentationCode}{}
\TangramTikz{Square}
+\TangramTikz[BlackWhite]{Square}
\TangramTikz[Solution]{Square}
\TangramTikz[ColorSolution]{Square}
\end{PresentationCode}
@@ -582,9 +588,9 @@
\end{PresentationCode}
\begin{PresentationCode}{}
-\TangramTikz{Plane}
-\TangramTikz[Solution]{Plane}
-\TangramTikz[ColorSolution]{Plane}
+\TangramTikz<scale=0.75>{Plane}
+\TangramTikz[Solution]<scale=0.75>{Plane}
+\TangramTikz[ColorSolution]<scale=0.75>{Plane}
\end{PresentationCode}
\begin{PresentationCode}{}
@@ -707,10 +713,25 @@
\TangramTikz[ColorSolution]<scale=0.75>{Goose}
\end{PresentationCode}
+\begin{PresentationCode}{}
+\TangramTikz{Cow}
+\TangramTikz[Solution]{Cow}
+\TangramTikz[ColorSolution]{Cow}
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+\TangramTikz{Gift}
+\TangramTikz[BlackWhite]{Gift}
+\TangramTikz[Solution]{Gift}
+\TangramTikz[ColorSolution]{Gift}
+\end{PresentationCode}
+
\newpage
\part{History}
+\verb|v0.1.8|~:~~~~\textsf{[BlackWhite]} key + \textsf{Cow}/\textsf{Gift} models
+
\verb|v0.1.7|~:~~~~Bugfixes in english doc + Renaming certain keys
\verb|v0.1.6|~:~~~~New models
Modified: trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-fr.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-fr.tex 2025-04-03 19:52:07 UTC (rev 74841)
+++ trunk/Master/texmf-dist/doc/latex/tangramtikz/TangramTikz-doc-fr.tex 2025-04-03 19:52:19 UTC (rev 74842)
@@ -49,8 +49,8 @@
\setlength{\parindent}{0pt}
\definecolor{LightGray}{gray}{0.9}
-\def\TPversion{0.1.7}
-\def\TPdate{25 janvier 2025}
+\def\TPversion{0.1.8}
+\def\TPdate{3 avril 2025}
\usepackage[most]{tcolorbox}
\usepackage{minted2}
@@ -407,6 +407,7 @@
\begin{itemize}
\item le booléen \Cle{Puzzle} qui affiche les pièces (monochromes) de puzzle, sans bordure ; \hfill~défaut : \Cle{true}
\item le booléen \Cle{Correction} qui affiche les pièces (monochromes) du puzzle, avec bordure ; \hfill~défaut : \Cle{false}
+ \item le booléen \Cle{NoirBlanc} qui affiche les tracés des pièces avec bordure ; \hfill~défaut : \Cle{false}
\item \Cle{Couleur} qui paramètre la couleur globale du puzzle avec les booléens précédents ; \hfill~défaut : \Cle{black}
\item le booléen \Cle{CorrectionCouleur} qui affiche les pièces (colorées) du puzzle, avec bordure ; \hfill~défaut : \Cle{false}
\item \Cle{ListeCouleurs} qui est la couleur des pièces (\texttt{GT,MT,PT,CAR,PARA}) ;
@@ -468,6 +469,8 @@
\item Crabe
\item Escargot
\item Oie
+ \item Vache
+ \item Cadeau
\end{itemize}
\end{multicols}}
@@ -481,7 +484,8 @@
\TangramTikz[CorrectionCouleur,ListeCouleurs={orange,blue,yellow,green,pink},Sep=1mm]{Fusee}
\TangramTikz<scale=1.5,rotate=30>{Fusee}~~
-\TangramTikz<scale=0.75,rotate=-90>{Fusee}
+\TangramTikz<scale=0.75,rotate=-90>{Fusee}~~
+\TangramTikz[NoirBlanc]<scale=0.5>{Fusee}
\end{PresentationCode}
\pagebreak
@@ -490,6 +494,7 @@
\begin{PresentationCode}{}
\TangramTikz{Carre}
+\TangramTikz[NoirBlanc]{Carre}
\TangramTikz[Correction]{Carre}
\TangramTikz[CorrectionCouleur]{Carre}
\end{PresentationCode}
@@ -591,9 +596,9 @@
\end{PresentationCode}
\begin{PresentationCode}{}
-\TangramTikz{Avion}
-\TangramTikz[Correction]{Avion}
-\TangramTikz[CorrectionCouleur]{Avion}
+\TangramTikz<scale=0.75>{Avion}
+\TangramTikz[Correction]<scale=0.75>{Avion}
+\TangramTikz[CorrectionCouleur]<scale=0.75>{Avion}
\end{PresentationCode}
\begin{PresentationCode}{}
@@ -710,10 +715,24 @@
\TangramTikz[CorrectionCouleur]<scale=0.75>{Oie}
\end{PresentationCode}
+\begin{PresentationCode}{}
+\TangramTikz<scale=0.75>{Vache}
+\TangramTikz[Correction]<scale=0.75>{Vache}
+\TangramTikz[CorrectionCouleur]<scale=0.75>{Vache}
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+\TangramTikz<scale=0.75>{Cadeau}
+\TangramTikz[Correction]<scale=0.75>{Cadeau}
+\TangramTikz[CorrectionCouleur]<scale=0.75>{Cadeau}
+\end{PresentationCode}
+
\newpage
\part{Historique}
+\verb|v0.1.8|~:~~~~Clé \textsf{[NoirBlanc]} pour un affichage non coloré + modèles \textsf{Vache} et \textsf{Cadeau}
+
\verb|v0.1.7|~:~~~~Améliorations pour la version anglaise
\verb|v0.1.6|~:~~~~Nouveaux modèles
Modified: trunk/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty 2025-04-03 19:52:07 UTC (rev 74841)
+++ trunk/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty 2025-04-03 19:52:19 UTC (rev 74842)
@@ -3,7 +3,8 @@
% Inspiration....: https://tex.stackexchange.com/questions/407449/typesetting-tangram-figures-in-latex
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{TangramTikz}[2025/01/25 v0.1.7 Tangram Puzzles with TikZ]
+\ProvidesPackage{TangramTikz}[2025/04/03 v0.1.8 Tangram Puzzles with TikZ]
+% 0.1.8 New key BlackWhite + modèle vache
% 0.1.7 Améliorations pour la version [en]
% 0.1.6 Ajout de modèles
% 0.1.5 Ajout de modèles
@@ -39,7 +40,8 @@
TangPuzz/.style={transform shape,fill=#1,draw=#1},
TangPuzz/.default=black,
TangSol/.style={transform shape,fill=#1,draw=white,line width=\TangBorder},
- TangSol/.default=black
+ TangSol/.default=black,
+ TangBW/.style={transform shape,draw=black,line width=\TangBorder}
}
%the square / le carre
@@ -897,37 +899,101 @@
}%
}
+%the cow / la vache (0.1.8)
+\NewDocumentCommand\TangramCow{ s O{TangPuzz} }{%*=colorcorrection,[key for pic]
+ \IfBooleanTF{#1}%
+ {%
+ \PieceTangram[TangSol={\TanGListeCouleurs[4]}]({-1},{-0.35}){TangCar}
+ \PieceTangram[TangSol={\TanGListeCouleurs[1]}]<xscale=-1,rotate=-135>({0},{0}){TangGrandTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[1]}]<rotate=-135>({sqrt(2)+(sqrt(2)+0.75)*sqrt(2)/2},{sqrt(2)-(sqrt(2)+0.75)*sqrt(2)/2}){TangGrandTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[5]}]<xscale=-1,rotate=-135>({sqrt(2)+(sqrt(2)+0.75)*sqrt(2)/2},{sqrt(2)-(sqrt(2)+0.75)*sqrt(2)/2}){TangPara}
+ \PieceTangram[TangSol={\TanGListeCouleurs[3]}]<rotate=45>({0},{0}){TangPetTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[3]}]<xscale=-1,rotate=45>({-1},{0}){TangPetTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[2]}]<yscale=-1,rotate=0>(-45:0.75){TangMoyTri}
+ }%
+ {%
+ \PieceTangram[#2]({-1},{-0.35}){TangCar}
+ \PieceTangram[#2]<xscale=-1,rotate=-135>({0},{0}){TangGrandTri}
+ \PieceTangram[#2]<rotate=-135>({sqrt(2)+(sqrt(2)+0.75)*sqrt(2)/2},{sqrt(2)-(sqrt(2)+0.75)*sqrt(2)/2}){TangGrandTri}
+ \PieceTangram[#2]<xscale=-1,rotate=-135>({sqrt(2)+(sqrt(2)+0.75)*sqrt(2)/2},{sqrt(2)-(sqrt(2)+0.75)*sqrt(2)/2}){TangPara}{TangPara}
+ \PieceTangram[#2]<rotate=45>({0},{0}){TangPetTri}
+ \PieceTangram[#2]<xscale=-1,rotate=45>({-1},{0}){TangPetTri}
+ \PieceTangram[#2]<yscale=-1,rotate=0>(-45:0.75){TangMoyTri}
+ }%
+}
+
+%the gift / le cadeau 0.1.8)
+\NewDocumentCommand\TangramGift{ s O{TangPuzz} }{%*=colorcorrection,[key for pic]
+ \IfBooleanTF{#1}%
+ {%
+ \PieceTangram[TangSol={\TanGListeCouleurs[4]}](-1,-2){TangCar}
+ \PieceTangram[TangSol={\TanGListeCouleurs[1]}]<rotate=-90>(0,0){TangGrandTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[1]}]<yscale=-1>(0,0){TangGrandTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[5]}]<rotate=60,yscale=-1>(0.5,0){TangPara}
+ \PieceTangram[TangSol={\TanGListeCouleurs[3]}]<yscale=-1>(-1,0){TangPetTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[3]}]<rotate=-90>(-1,0){TangPetTri}
+ \PieceTangram[TangSol={\TanGListeCouleurs[2]}]<xscale=-1,rotate=20>(0.5,0){TangMoyTri}
+ %\filldraw (0,0) circle[radius=2pt] ;
+ }%
+ {%
+ \PieceTangram[#2](-1,-2){TangCar}
+ \PieceTangram[#2]<rotate=-90>(0,0){TangGrandTri}
+ \PieceTangram[#2]<yscale=-1>(0,0){TangGrandTri}
+ \PieceTangram[#2]<rotate=60,yscale=-1>(0.5,0){TangPara}
+ \PieceTangram[#2]<yscale=-1>(-1,0){TangPetTri}
+ \PieceTangram[#2]<rotate=-90>(-1,0){TangPetTri}
+ \PieceTangram[#2]<xscale=-1,rotate=20>(0.5,0){TangMoyTri}
+ }%
+}
+
%macros for tangram creation / commandes pour créer le tangram
\NewDocumentCommand\TangramTikzCreateEN{ m }{%
\readlist*\TanGListeCouleurs{\TangColors}%
+ %booleans
+ \ifboolKV[TGRMTikz]{BlackWhite}{\setKV[TGRMTikz]{Puzzle=false}]}{}%
+ \ifboolKV[TGRMTikz]{Solution}{\setKV[TGRMTikz]{Puzzle=false}]}{}%
+ \ifboolKV[TGRMTikz]{ColorSolution}{\setKV[TGRMTikz]{Puzzle=false}]}{}%
+ %displays
\ifboolKV[TGRMTikz]{Puzzle}{#1[TangPuzz={\TangColor}]}{}%
\ifboolKV[TGRMTikz]{Solution}{#1[TangSol={\TangColor}]}{}%
+ \ifboolKV[TGRMTikz]{BlackWhite}{#1[TangBW]}{}%
\ifboolKV[TGRMTikz]{ColorSolution}{#1*}{}%
}
\NewDocumentCommand\TangramTikzCreateFR{ m }{%
\readlist*\TanGListeCouleurs{\TangCouleurs}%
+ %gestion des booléens
+ \ifboolKV[TGRMTikz]{NoirBlanc}{\setKV[TGRMTikz]{Puzzle=false}]}{}%
+ \ifboolKV[TGRMTikz]{Correction}{\setKV[TGRMTikz]{Puzzle=false}]}{}%
+ \ifboolKV[TGRMTikz]{CorrectionCouleur}{\setKV[TGRMTikz]{Puzzle=false}]}{}%
+ %affichages
\ifboolKV[TGRMTikz]{Puzzle}{#1[TangPuzz={\TangCouleur}]}{}%
+ \ifboolKV[TGRMTikz]{NoirBlanc}{#1[TangBW]}{}%
\ifboolKV[TGRMTikz]{Correction}{#1[TangSol={\TangCouleur}]}{}%
\ifboolKV[TGRMTikz]{CorrectionCouleur}{#1*}{}%
}
+\newlength\TangBorder
+\setlength\TangBorder{1pt}
+
\defKV[TGRMTikz]{%keys [en] and [fr]
ListeCouleurs=\xdef\TangCouleurs{#1},
ColorList=\xdef\TangColors{#1},%
Couleur=\xdef\TangCouleur{#1},%
Color=\xdef\TangColor{#1},%
- Sep=\xdef\TangBorder{#1}
+ Sep=\setlength\TangBorder{#1}
}
\setKVdefault[TGRMTikz]{%keys by default [en] and [fr]
Puzzle=true,%
+ BlackWhite=false,%en
+ NoirBlanc=false,%
Correction=false,%
CorrectionCouleur=false,%
Solution=false,%en
ColorSolution=false,%en
ListeCouleurs={red,orange,blue,green,purple},%
- ColorList={red,orange,blue,green,purple},%
+ ColorList={red,orange,blue,green,purple},%en
Couleur=black,%
- Color=black,%
+ Color=black,%en
Sep=1pt
}
@@ -1047,6 +1113,12 @@
%GOOSE
\IfStrEq{#3}{Goose}{\TangramTikzCreateEN{\TangramGoose}}{}%
\IfStrEq{#3}{Oie}{\TangramTikzCreateFR{\TangramGoose}}{}%
+ %COW
+ \IfStrEq{#3}{Cow}{\TangramTikzCreateEN{\TangramCow}}{}%
+ \IfStrEq{#3}{Vache}{\TangramTikzCreateFR{\TangramCow}}{}%
+ %GIFT
+ \IfStrEq{#3}{Gift}{\TangramTikzCreateEN{\TangramGift}}{}%
+ \IfStrEq{#3}{Cadeau}{\TangramTikzCreateFR{\TangramGift}}{}%
\end{tikzpicture}%
}
More information about the tex-live-commits
mailing list.