From f6d0f3e98514cae7f2fce3030e521e067fc9f607 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 20 Feb 2023 21:03:03 +0000 Subject: tangramtikz (20feb23) git-svn-id: svn://tug.org/texlive/trunk@65988 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/tangramtikz/TangramTikz.sty | 107 ++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty b/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty index 6943745a3c5..acc0051592d 100644 --- a/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty +++ b/Master/texmf-dist/tex/latex/tangramtikz/TangramTikz.sty @@ -3,7 +3,8 @@ % Inspiration....: https://tex.stackexchange.com/questions/407449/typesetting-tangram-figures-in-latex \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{TangramTikz}[2023/02/17 v0.1.3 Tangram Puzzles with TikZ] +\ProvidesPackage{TangramTikz}[2023/02/18 v0.1.4 Tangram Puzzles with TikZ] +% 0.1.4 Ajout de modèles % 0.1.3 Ajout de modèles % 0.1.2 Ajout de modèles % 0.1.1 Ajout de modèles @@ -686,6 +687,98 @@ }% } +%the factory / l'usine (0.1.4) +\NewDocumentCommand\TangramFactory{ s O{TangPuzz} }{%*=colorcorrection,[key for pic] + \IfBooleanTF{#1}% + {% + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({0},{0}){TangGrandTri} + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({0},{2*sqrt(2)}){TangGrandTri} + \PieceTangram[TangSol={\TanGListeCouleurs[2]}]({-sqrt(2)},{sqrt(2)}){TangMoyTri} + \PieceTangram[TangSol={\TanGListeCouleurs[4]}]({-1},{2*sqrt(2)}){TangCar} + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({0.5*sqrt(2)-0.5},{2*sqrt(2)+1}){TangPetTri} + \PieceTangram[TangSol={\TanGListeCouleurs[5]}]({-2*sqrt(2)},{0}){TangPara} + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({-2*sqrt(2)+1},{2}){TangPetTri} + }% + {% + \PieceTangram[#2]({0},{0}){TangGrandTri} + \PieceTangram[#2]({0},{2*sqrt(2)}){TangGrandTri} + \PieceTangram[#2]({-sqrt(2)},{sqrt(2)}){TangMoyTri} + \PieceTangram[#2]({-1},{2*sqrt(2)}){TangCar} + \PieceTangram[#2]({0.5*sqrt(2)-0.5},{2*sqrt(2)+1}){TangPetTri} + \PieceTangram[#2]({-2*sqrt(2)},{0}){TangPara} + \PieceTangram[#2]({-2*sqrt(2)+1},{2}){TangPetTri} + }% +} + +%the angel / l'ange (0.1.4) +\NewDocumentCommand\TangramAngel{ s O{TangPuzz} }{%*=colorcorrection,[key for pic] + \IfBooleanTF{#1}% + {% + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({0},{0}){TangPetTri} + \PieceTangram[TangSol={\TanGListeCouleurs[5]}]({0},{0}){TangPara} + \PieceTangram[TangSol={\TanGListeCouleurs[2]}]({0},{1}){TangMoyTri} + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({0},{2.5}){TangPetTri} + \PieceTangram[TangSol={\TanGListeCouleurs[4]}]({0},{3}){TangCar} + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({0},{3}){TangGrandTri} + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({0},{3}){TangGrandTri} + }% + {% + \PieceTangram[#2]({0},{0}){TangPetTri} + \PieceTangram[#2]({0},{0}){TangPara} + \PieceTangram[#2]({0},{1}){TangMoyTri} + \PieceTangram[#2]({0},{2.5}){TangPetTri} + \PieceTangram[#2]({0},{3}){TangCar} + \PieceTangram[#2]({0},{3}){TangGrandTri} + \PieceTangram[#2]({0},{3}){TangGrandTri} + }% +} + +%the tower / la tour (0.1.4) +\NewDocumentCommand\TangramTower{ s O{TangPuzz} }{%*=colorcorrection,[key for pic] + \IfBooleanTF{#1}% + {% + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({-2},{0}){TangGrandTri} + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({0},{2}){TangGrandTri} + \PieceTangram[TangSol={\TanGListeCouleurs[5]}]({0},{3}){TangPara} + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({1},{2+sqrt(2)}){TangPetTri} + \PieceTangram[TangSol={\TanGListeCouleurs[2]}]({2-0.5*sqrt(2)},{3+0.5*sqrt(2)}){TangMoyTri} + \PieceTangram[TangSol={\TanGListeCouleurs[4]}]({0},{3+0.5*sqrt(2)}){TangCar} + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({0.5+0.5*sqrt(2)},{4+0.5*sqrt(2)}){TangPetTri} + }% + {% + \PieceTangram[#2]({-2},{0}){TangGrandTri} + \PieceTangram[#2]({0},{2}){TangGrandTri} + \PieceTangram[#2]({0},{3}){TangPara} + \PieceTangram[#2]({1},{2+sqrt(2)}){TangPetTri} + \PieceTangram[#2]({2-0.5*sqrt(2)},{3+0.5*sqrt(2)}){TangMoyTri} + \PieceTangram[#2]({0},{3+0.5*sqrt(2)}){TangCar} + \PieceTangram[#2]({0.5+0.5*sqrt(2)},{4+0.5*sqrt(2)}){TangPetTri} + }% +} + +%the UFO / l'OVNI (0.1.4) +\NewDocumentCommand\TangramUfo{ s O{TangPuzz} }{%*=colorcorrection,[key for pic] + \IfBooleanTF{#1}% + {% + \PieceTangram[TangSol={\TanGListeCouleurs[4]}]({0},{0}){TangCar} + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({2},{-2}){TangGrandTri} + \PieceTangram[TangSol={\TanGListeCouleurs[1]}]({0},{0}){TangGrandTri} + \PieceTangram[TangSol={\TanGListeCouleurs[2]}]({-1},{0}){TangMoyTri} + \PieceTangram[TangSol={\TanGListeCouleurs[5]}]({2},{0}){TangPara} + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({-3},{-1}){TangPetTri} + \PieceTangram[TangSol={\TanGListeCouleurs[3]}]({-2},{-1}){TangPetTri} + }% + {% + \PieceTangram[#2]({0},{0}){TangCar} + \PieceTangram[#2]({2},{-2}){TangGrandTri} + \PieceTangram[#2]({0},{0}){TangGrandTri} + \PieceTangram[#2]({-1},{0}){TangMoyTri} + \PieceTangram[#2]({2},{0}){TangPara} + \PieceTangram[#2]({-3},{-1}){TangPetTri} + \PieceTangram[#2]({-2},{-1}){TangPetTri} + }% +} + %macros for tangram creation / commandes pour créer le tangram \NewDocumentCommand\TangramTikzCreateEN{ m }{% \readlist*\TanGListeCouleurs{\TangColors}% @@ -808,6 +901,18 @@ %LION \IfStrEq{#3}{Lions}{\TangramTikzCreateEN{\TangramLion}}{}% \IfStrEq{#3}{Lion}{\TangramTikzCreateFR{\TangramLion}}{}% + %FACTORY + \IfStrEq{#3}{Factory}{\TangramTikzCreateEN{\TangramFactory}}{}% + \IfStrEq{#3}{Usine}{\TangramTikzCreateFR{\TangramFactory}}{}% + %ANGEL + \IfStrEq{#3}{Angel}{\TangramTikzCreateEN{\TangramAngel}}{}% + \IfStrEq{#3}{Ange}{\TangramTikzCreateFR{\TangramAngel}}{}% + %TOWER + \IfStrEq{#3}{Tower}{\TangramTikzCreateEN{\TangramTower}}{}% + \IfStrEq{#3}{Tour}{\TangramTikzCreateFR{\TangramTower}}{}% + %UFO + \IfStrEq{#3}{Ufo}{\TangramTikzCreateEN{\TangramUfo}}{}% + \IfStrEq{#3}{Ovni}{\TangramTikzCreateFR{\TangramUfo}}{}% \end{tikzpicture}% } -- cgit v1.2.3