| 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{TangramTikz} |
| 10 |
%\usepackage[upright]{fourier} |
| 11 |
%\usepackage[scaled=0.875]{helvet} |
| 12 |
%\renewcommand\ttdefault{lmtt} |
| 13 |
%\usepackage{cabin} |
| 14 |
\usepackage{amsmath,amssymb} |
| 15 |
\usepackage{fontawesome5} |
| 16 |
\usepackage{enumitem} |
| 17 |
\usepackage{tabularray} |
| 18 |
\usepackage{multicol} |
| 19 |
\usepackage{fancyvrb} |
| 20 |
\usepackage{fancyhdr} |
| 21 |
\fancyhf{} |
| 22 |
\renewcommand{\headrulewidth}{0pt} |
| 23 |
\lfoot{\sffamily\small [TangramTikz]} |
| 24 |
\cfoot{\sffamily\small - \thepage{} -} |
| 25 |
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} |
| 26 |
|
| 27 |
%\usepackage{hvlogos} |
| 28 |
\usepackage{hologo} |
| 29 |
\usepackage{xspace} |
| 30 |
\providecommand\tikzlogo{Ti\textit{k}Z} |
| 31 |
\providecommand\TeXLive{\TeX{}Live\xspace} |
| 32 |
\providecommand\PSTricks{\textsf{PSTricks}\xspace} |
| 33 |
\let\pstricks\PSTricks |
| 34 |
\let\TikZ\tikzlogo |
| 35 |
\newcommand\TableauDocumentation{% |
| 36 |
\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} |
| 37 |
{\huge \LaTeX} & & & & &\\ |
| 38 |
& {\huge \hologo{pdfLaTeX}} & & & & \\ |
| 39 |
& & {\huge \hologo{LuaLaTeX}} & & & \\ |
| 40 |
& & & {\huge \TikZ} & & \\ |
| 41 |
& & & & {\huge \TeXLive} & \\ |
| 42 |
& & & & & {\huge \hologo{MiKTeX}} \\ |
| 43 |
\end{tblr} |
| 44 |
} |
| 45 |
|
| 46 |
\usepackage{hyperref} |
| 47 |
\urlstyle{same} |
| 48 |
\hypersetup{pdfborder=0 0 0} |
| 49 |
\usepackage[margin=1.5cm]{geometry} |
| 50 |
\setlength{\parindent}{0pt} |
| 51 |
\definecolor{LightGray}{gray}{0.9} |
| 52 |
|
| 53 |
\def\TPversion{0.2.2} |
| 54 |
\def\TPdate{05/05/2025} |
| 55 |
|
| 56 |
\usepackage[most]{tcolorbox} |
| 57 |
\usepackage{minted2} |
| 58 |
\tcbuselibrary{minted} |
| 59 |
\NewTCBListing{PresentationCode}{ O{blue} m }{% |
| 60 |
sharp corners=downhill,enhanced,arc=12pt,skin=bicolor,% |
| 61 |
colback=#1!1!white,colframe=#1!75!black,colbacklower=white,% |
| 62 |
attach boxed title to top right={yshift=-\tcboxedtitleheight},title=Code \LaTeX,% |
| 63 |
boxed title style={% |
| 64 |
colframe=#1!75!black,colback=#1!15!white,% |
| 65 |
,sharp corners=downhill,arc=12pt,% |
| 66 |
},% |
| 67 |
fonttitle=\color{#1!90!black}\itshape\ttfamily\footnotesize,% |
| 68 |
listing engine=minted,minted style=colorful, |
| 69 |
minted language=tex,minted options={tabsize=4,fontsize=\footnotesize,autogobble}, |
| 70 |
#2 |
| 71 |
} |
| 72 |
|
| 73 |
\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}} |
| 74 |
|
| 75 |
\begin{document} |
| 76 |
|
| 77 |
\pagestyle{fancy} |
| 78 |
|
| 79 |
\thispagestyle{empty} |
| 80 |
|
| 81 |
\vspace{2cm} |
| 82 |
|
| 83 |
\begin{center} |
| 84 |
\begin{minipage}{0.75\linewidth} |
| 85 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 86 |
\begin{center} |
| 87 |
\begin{tabular}{c} |
| 88 |
{\Huge \texttt{TangramTikz [en]}}\\ |
| 89 |
\\ |
| 90 |
{\LARGE An extension of Ti\textit{k}Z to display Tangrams,} \\ |
| 91 |
\\ |
| 92 |
{\LARGE outlining or not individual pieces,} \\ |
| 93 |
\\ |
| 94 |
{\LARGE with a single or individual colours} \\ |
| 95 |
\end{tabular} |
| 96 |
|
| 97 |
\medskip |
| 98 |
|
| 99 |
{\small \texttt{Version \TPversion{} -- \TPdate}} |
| 100 |
\end{center} |
| 101 |
\end{tcolorbox} |
| 102 |
\end{minipage} |
| 103 |
\end{center} |
| 104 |
|
| 105 |
\vspace{0.5cm} |
| 106 |
|
| 107 |
\begin{center} |
| 108 |
\begin{tabular}{c} |
| 109 |
\texttt{Cédric Pierquet}\\ |
| 110 |
{\ttfamily cpierquet -- at -- outlook . fr}\\ |
| 111 |
\texttt{\url{https://forge.apps.education.fr/pierquetcedric/packages-latex}} |
| 112 |
\end{tabular} |
| 113 |
\end{center} |
| 114 |
|
| 115 |
\vspace{0.5cm} |
| 116 |
|
| 117 |
{$\blacktriangleright$~~Commands to display predefined Tangrams} |
| 118 |
|
| 119 |
\smallskip |
| 120 |
|
| 121 |
{$\blacktriangleright$~~Commands to create Tangrams by positioning individual pieces} |
| 122 |
|
| 123 |
\smallskip |
| 124 |
|
| 125 |
{$\blacktriangleright$~~Inspired by \url{https://tex.stackexchange.com/questions/407449/typesetting-tangram-figures-in-latex}} |
| 126 |
|
| 127 |
\vspace{0.5cm} |
| 128 |
|
| 129 |
\begin{center} |
| 130 |
\tikz {\pic[TangPuzz={blue}] at (0,0) {TangBigTri} ;}~~ |
| 131 |
\tikz {\pic[TangPuzz={orange}] at (0,0) {TangBigTri} ;}~~ |
| 132 |
\tikz {\pic[TangPuzz={purple}] at (0,0) {TangMedTri} ;}~~ |
| 133 |
\tikz {\pic[TangPuzz={yellow}] at (0,0) {TangSqua} ;}~~ |
| 134 |
\tikz {\pic[TangPuzz={green}] at (0,0) {TangSmalTri} ;}~~ |
| 135 |
\tikz {\pic[TangPuzz={cyan}] at (0,0) {TangSmalTri} ;}~~ |
| 136 |
\tikz {\pic[TangPuzz={magenta}] at (0,0) {TangPara} ;}~~ |
| 137 |
|
| 138 |
\vspace*{1cm} |
| 139 |
|
| 140 |
\TangramTikz[Couleur=orange]<scale=1>{Maison} |
| 141 |
\TangramTikz[Solution]<scale=1>{Maison} |
| 142 |
\TangramTikz[ColorSolution]<scale=1>{Maison} |
| 143 |
\TangramTikz[ListeCouleurs={blue,red,black,orange,purple},CorrectionCouleur]<scale=1>{Maison} |
| 144 |
\end{center} |
| 145 |
|
| 146 |
\vspace{0.5cm} |
| 147 |
|
| 148 |
\hfill{}\textit{\small Thanks to Eric Martin, teacher-researcher in Sydney, for his careful proofreading of the English version!} |
| 149 |
|
| 150 |
\smallskip |
| 151 |
|
| 152 |
\hfill{}\textit{\small Thanks to Sarah Hadley, Laboratory Manager \&\ Research Assistant at the University of Saskatchewan, for her feedback and ideas!} |
| 153 |
|
| 154 |
%\hfill{}\textit{Merci à Denis Bitouzé et à Patrick Bideault pour leurs retours et idées !} |
| 155 |
|
| 156 |
\vfill |
| 157 |
|
| 158 |
\hrule |
| 159 |
|
| 160 |
\medskip |
| 161 |
|
| 162 |
\TableauDocumentation |
| 163 |
|
| 164 |
\medskip |
| 165 |
|
| 166 |
\hrule |
| 167 |
|
| 168 |
\medskip |
| 169 |
|
| 170 |
\newpage |
| 171 |
|
| 172 |
\phantomsection |
| 173 |
\hypertarget{matoc}{} |
| 174 |
|
| 175 |
\tableofcontents |
| 176 |
|
| 177 |
\newpage |
| 178 |
|
| 179 |
\part{Introduction} |
| 180 |
|
| 181 |
\section{The TangramTikz package} |
| 182 |
|
| 183 |
\subsection{Origination} |
| 184 |
|
| 185 |
Some of the ideas come from \url{https://tex.stackexchange.com/questions/407449/typesetting-tangram-figures-in-latex}, with a partial solution by Andrew Stacey. |
| 186 |
|
| 187 |
\smallskip |
| 188 |
|
| 189 |
The package has then been \textit{built} and \emph{modestly enriched} on the basis of the styles and methods proposed by Andrew Stacey. |
| 190 |
|
| 191 |
\subsection{Loading the package, used packages} |
| 192 |
|
| 193 |
The \textsf{TangramTikz} package is loaded into the preamble using: |
| 194 |
|
| 195 |
\begin{PresentationCode}{listing only} |
| 196 |
\usepackage{TangramTikz} |
| 197 |
\end{PresentationCode} |
| 198 |
|
| 199 |
It is fully compatible with the usual compilation methods, such as \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} or \textsf{xelatex}. |
| 200 |
|
| 201 |
\medskip |
| 202 |
|
| 203 |
It loads the following packages and libraries: |
| 204 |
|
| 205 |
\begin{itemize} |
| 206 |
\item \texttt{tikz} with the \Cle{calc} and \Cle{shapes.geometric} libraries; |
| 207 |
\item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} and \texttt{listofitems}. |
| 208 |
\end{itemize} |
| 209 |
|
| 210 |
\subsection{Package design} |
| 211 |
|
| 212 |
The aim is to leverage \TikZ\ functionality and define \textsf{commands} to display a Tangram puzzle: |
| 213 |
|
| 214 |
\begin{itemize} |
| 215 |
\item without gaps between pieces, so the overall shape stands out, |
| 216 |
\item or with a small gap between pieces, which are then individually recognisable, |
| 217 |
\item in the latter case, with pieces that are either \textit{mono}coloured or \emph{individually} coloured. |
| 218 |
\end{itemize} |
| 219 |
|
| 220 |
\begin{PresentationCode}{listing only} |
| 221 |
%Standalone command to display a Tangram |
| 222 |
\TangramTikz[keys]<options tikz>{tangram_name} |
| 223 |
\end{PresentationCode} |
| 224 |
|
| 225 |
Also available are an \textsf{environment} and a special \textsf{command} to build a puzzle by positioning each piece. |
| 226 |
|
| 227 |
\begin{PresentationCode}{listing only} |
| 228 |
%Environment, with keys, to position the pieces |
| 229 |
\begin{EnvTangramTikz}[keys]<options tikz> |
| 230 |
%Position each piece |
| 231 |
\PieceTangram[keys]<options pic>(offsetH,offsetV){TangBigTri} |
| 232 |
\PieceTangram[keys]<options pic>(offsetH,offsetH){TangBigTri} |
| 233 |
\PieceTangram[keys]<options pic>(offsetH,offsetH){TangMedTri} |
| 234 |
\PieceTangram[keys]<options pic>(offsetH,offsetH){TangSmalTri} |
| 235 |
\PieceTangram[keys]<options pic>(offsetH,offsetH){TangSmalTri} |
| 236 |
\PieceTangram[keys]<options pic>(offsetH,offsetH){TangSqua} |
| 237 |
\PieceTangram[keys]<options pic>(offsetH,offsetH){TangPara} |
| 238 |
%\filldraw[black] (0,0) circle[radius=4pt] ; %Origin to help positioning |
| 239 |
\end{EnvTangramTikz} |
| 240 |
\end{PresentationCode} |
| 241 |
|
| 242 |
\pagebreak |
| 243 |
|
| 244 |
\part{Using the package} |
| 245 |
|
| 246 |
\section{Dealing with individual pieces} |
| 247 |
|
| 248 |
\subsection{The pieces} |
| 249 |
|
| 250 |
A Tangram consists of 7 pieces: |
| 251 |
\begin{itemize} |
| 252 |
\item 2 large triangles; 1 medium triangle; 2 small triangles; |
| 253 |
\item 1 square; |
| 254 |
\item 1 parallelogram. |
| 255 |
\end{itemize} |
| 256 |
|
| 257 |
Each piece that makes up the Tangram is defined in \tikzlogo\ as an individual \texttt{pic}. |
| 258 |
|
| 259 |
\medskip |
| 260 |
|
| 261 |
Next is a figure that shows the 5 kinds of pieces, with for each of them: |
| 262 |
|
| 263 |
\begin{itemize} |
| 264 |
\item the \textcolor{purple}{\texttt{name}} of the associated \texttt{pic}; |
| 265 |
\item its initial \textit{orientation}; |
| 266 |
\item its initial \textcolor{red}{\textit{origin}}; |
| 267 |
\item its useful \textcolor{blue}{\textit{dimensions}} (given in \textit{unit}). |
| 268 |
\end{itemize} |
| 269 |
|
| 270 |
\begin{center} |
| 271 |
\begin{tikzpicture}[scale=1.25] |
| 272 |
\draw[thin,lightgray!50] (-1,-1) grid (3,3) ; |
| 273 |
\PieceTangram{TangBigTri} \filldraw[red] (0,0) circle[radius=2pt] ; |
| 274 |
\draw[thick,<->,>=latex] (0,-0.25)--(2,-0.25) node[blue,scale=1.5,midway,below,font=\large\sffamily] {2} ; |
| 275 |
\draw[thick,<->,>=latex] (2.25,0)--++(0,2) node[blue,scale=1.5,midway,right,font=\large\sffamily] {2} ; |
| 276 |
\draw[thick,<->,>=latex] (-0.15,0.15)--++(45:{sqrt(8)}) node[blue,scale=1.5,midway,sloped,above,font=\large\sffamily] {$\mathsf{2\sqrt{2}}$} ; |
| 277 |
\draw (1,3) node[scale=1.5,purple,below=1pt,font=\Large\ttfamily] {TangBigTri} ; |
| 278 |
\end{tikzpicture} |
| 279 |
~ |
| 280 |
\begin{tikzpicture}[scale=1.25] |
| 281 |
\draw[thin,lightgray!50] (-1,-1) grid (3,3) ; |
| 282 |
\PieceTangram{TangMedTri} \filldraw[red] (0,0) circle[radius=2pt] ; |
| 283 |
\draw[thick,<->,>=latex] (0,-0.25)--(2,-0.25) node[blue,scale=1.5,midway,below,font=\large\sffamily] {2} ; |
| 284 |
\draw[thick,<->,>=latex] (-0.15,0.15)--++(45:{sqrt(2)}) node[blue,scale=1.5,midway,sloped,above,font=\large\sffamily] {$\mathsf{\sqrt{2}}$} ; |
| 285 |
\draw[thick,<->,>=latex] (2.15,0.15)--++(135:{sqrt(2)}) node[blue,scale=1.5,midway,sloped,above,font=\large\sffamily] {$\mathsf{\sqrt{2}}$} ; |
| 286 |
\draw (1,3) node[purple,scale=1.5,below=1pt,font=\Large\ttfamily] {TangMedTri} ; |
| 287 |
\end{tikzpicture} |
| 288 |
~ |
| 289 |
\begin{tikzpicture}[scale=1.25] |
| 290 |
\draw[thin,lightgray!50] (-1,-1) grid (3,3) ; |
| 291 |
\PieceTangram{TangSmalTri} \filldraw[red] (0,0) circle[radius=2pt] ; |
| 292 |
\draw[thick,<->,>=latex] (0,-0.25)--(1,-0.25) node[blue,scale=1.5,midway,below,font=\large\sffamily] {1} ; |
| 293 |
\draw[thick,<->,>=latex] (-0.15,0.15)--++(45:{sqrt(2)}) node[blue,scale=1.5,midway,sloped,above,font=\large\sffamily] {$\mathsf{\sqrt{2}}$} ; |
| 294 |
\draw[thick,<->,>=latex] (1.25,0)--++(0,1) node[blue,scale=1.5,midway,right,font=\large\sffamily] {1} ; |
| 295 |
\draw (1,3) node[purple,scale=1.5,below=1pt,font=\Large\ttfamily] {TangSmalTri} ; |
| 296 |
\end{tikzpicture} |
| 297 |
|
| 298 |
\smallskip |
| 299 |
|
| 300 |
\begin{tikzpicture}[scale=1.25] |
| 301 |
\draw[thin,lightgray!50] (-1,-1) grid (3,3) ; |
| 302 |
\PieceTangram{TangSqua} \filldraw[red] (0,0) circle[radius=2pt] ; |
| 303 |
\draw[thick,<->,>=latex] (0,-0.25)--(1,-0.25) node[blue,scale=1.5,midway,below,font=\large\sffamily] {1} ; |
| 304 |
\draw[thick,<->,>=latex] (1.25,0)--++(0,1) node[blue,scale=1.5,midway,right,font=\large\sffamily] {1} ; |
| 305 |
\draw[thick,dashed] (0,0)--(-0.65,0.65) (1,1)--(0.35,1.65) ; |
| 306 |
\draw[thick,<->,>=latex] (-0.65,0.65)--++(45:{sqrt(2)}) node[blue,scale=1.5,midway,sloped,above,font=\large\sffamily] {$\mathsf{\sqrt{2}}$} ; |
| 307 |
\draw (1,3) node[purple,scale=1.5,below=1pt,font=\Large\ttfamily] {TangSqua} ; |
| 308 |
\end{tikzpicture} |
| 309 |
~ |
| 310 |
\begin{tikzpicture}[scale=1.25] |
| 311 |
\draw[thin,lightgray!50] (-1,-1) grid (3,3) ; |
| 312 |
\PieceTangram{TangPara} \filldraw[red] (0,0) circle[radius=2pt] ; |
| 313 |
\draw[thick,<->,>=latex] (0,-0.25)--(1,-0.25) node[blue,scale=1.5,midway,below,font=\large\sffamily] {1} ; |
| 314 |
\draw[thick,<->,>=latex] (-0.15,0.15)--++(45:{sqrt(2)}) node[blue,scale=1.5,midway,sloped,above,font=\large\sffamily] {$\mathsf{\sqrt{2}}$} ; |
| 315 |
\draw[thick,<->,>=latex] (2.15,0)--++(0,1) node[blue,scale=1.5,midway,right,font=\large\sffamily] {1} ; |
| 316 |
\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}}$} ; |
| 317 |
\draw[thick,dashed] (2,1)--++(0.15,0.15) (1,1)--++(45:{0.5*sqrt(2)+0.2}) ; |
| 318 |
\draw (1,3) node[purple,scale=1.5,below=1pt,font=\Large\ttfamily] {TangPara} ; |
| 319 |
\end{tikzpicture} |
| 320 |
\end{center} |
| 321 |
|
| 322 |
Each \textit{piece} can be: |
| 323 |
|
| 324 |
\begin{itemize} |
| 325 |
\item rotated, thanks to \tikzlogo\ \texttt{rotate=...} option; |
| 326 |
\item flipped vertically or horizontally, thanks to \tikzlogo\ \texttt{xscale=-1} and \texttt{yscale=-1} options; |
| 327 |
\item moved, by placing its origin at the point of coordinates \texttt{(x,y)} ; |
| 328 |
\item in case a piece is both rotated and flipped about a single axis, the rotation is performed before the flip. |
| 329 |
\end{itemize} |
| 330 |
|
| 331 |
Each piece comes with a \tikzlogo\ style: |
| 332 |
|
| 333 |
\begin{itemize} |
| 334 |
\item \texttt{TangPuzz}: Tangram piece, \textit{without border}, coloured (\Cle{black} by default); |
| 335 |
\item \texttt{TangSol}: Tangram piece, \textit{with a white border}, coloured (\Cle{black} by default). |
| 336 |
\end{itemize} |
| 337 |
|
| 338 |
\pagebreak |
| 339 |
|
| 340 |
\subsection{Positioning the pieces} |
| 341 |
|
| 342 |
A first method is given by \tikzlogo{} \texttt{pic} syntax: |
| 343 |
|
| 344 |
\begin{PresentationCode}{listing only} |
| 345 |
%Environment or tikz command |
| 346 |
\pic[style,rotate=...,xscale=...,yscale=...] at (x,y) {piece_name} ; |
| 347 |
\end{PresentationCode} |
| 348 |
|
| 349 |
The \textsf{TangramTikz} package offers a specific command to place the pieces: |
| 350 |
|
| 351 |
\begin{PresentationCode}{listing only} |
| 352 |
%Environment or tikz command |
| 353 |
\PieceTangram[style={color}]<xscale=...,yscale=...,rotate=...>(x,y){piece_name} |
| 354 |
\end{PresentationCode} |
| 355 |
|
| 356 |
A Tangram is built from the 7 pieces, by: |
| 357 |
|
| 358 |
\begin{itemize} |
| 359 |
\item \textit{placing} pieces at the origin; |
| 360 |
\item \textit{rotating/flipping} them to give them the desired orientation; |
| 361 |
\item \textit{moving} them to the desired location. |
| 362 |
\end{itemize} |
| 363 |
|
| 364 |
Options (\texttt{rotate/xscale/yscale}) are processed from right to left, and can be given in any order. |
| 365 |
|
| 366 |
\begin{PresentationCode}{} |
| 367 |
%Coloured solved version, default size |
| 368 |
\begin{EnvTangramTikz} |
| 369 |
\PieceTangram[TangSol={green}]({0},{0}){TangSqua} |
| 370 |
\PieceTangram[TangSol={red}]({-1.5},{1}){TangBigTri} |
| 371 |
\PieceTangram[TangSol={red}]<rotate=-90>({0.5},{3}){TangBigTri} |
| 372 |
\PieceTangram[TangSol={purple}]<xscale=-1,rotate=0>({2.5},{2}){TangPara} |
| 373 |
\PieceTangram[TangSol={blue}]({-1.5},{2}){TangSmalTri} |
| 374 |
\PieceTangram[TangSol={blue}]<xscale=-1,rotate=90>({-0.5},{2}){TangSmalTri} |
| 375 |
\PieceTangram[TangSol={orange}]({-0.5},{3}){TangMedTri} |
| 376 |
\filldraw[black] (0,0) circle[radius=2pt] ; %help |
| 377 |
\end{EnvTangramTikz} |
| 378 |
%Standard version, default size |
| 379 |
\begin{EnvTangramTikz} |
| 380 |
\PieceTangram[TangPuzz]({0},{0}){TangSqua} |
| 381 |
\PieceTangram[TangPuzz]({-1.5},{1}){TangBigTri} |
| 382 |
\PieceTangram[TangPuzz]<rotate=-90>({0.5},{3}){TangBigTri} |
| 383 |
\PieceTangram[TangPuzz]<xscale=-1,rotate=0>({2.5},{2}){TangPara} |
| 384 |
\PieceTangram[TangPuzz]({-1.5},{2}){TangSmalTri} |
| 385 |
\PieceTangram[TangPuzz]<xscale=-1,rotate=90>({-0.5},{2}){TangSmalTri} |
| 386 |
\PieceTangram[TangPuzz]({-0.5},{3}){TangMedTri} |
| 387 |
\end{EnvTangramTikz} |
| 388 |
\end{PresentationCode} |
| 389 |
|
| 390 |
\pagebreak |
| 391 |
|
| 392 |
\section{Dealing with a whole shape} |
| 393 |
|
| 394 |
\subsection{Command} |
| 395 |
|
| 396 |
A collection of predefined Tangrams is included in \textsf{TangramTikz}, together with a standalone \textsf{command} to display them: |
| 397 |
|
| 398 |
\begin{PresentationCode}{listing only} |
| 399 |
%Standalone command to display a Tangram |
| 400 |
\TangramTikz[keys]<tikz options>{tangram_name} |
| 401 |
\end{PresentationCode} |
| 402 |
|
| 403 |
\begin{PresentationCode}{} |
| 404 |
%Standalone command to display Cat/Boat/Kangaroo with default options |
| 405 |
\TangramTikz{Cat}~~\TangramTikz{Boat}~~\TangramTikz{Kangaroo} |
| 406 |
\end{PresentationCode} |
| 407 |
|
| 408 |
\subsection{Keys, options and arguments} |
| 409 |
|
| 410 |
The first argument, \textit{optional} and provided within \texttt{[...]}, deals with the keys and their associated options: |
| 411 |
|
| 412 |
\begin{itemize} |
| 413 |
\item the boolean \Cle{Puzzle} to display \textit{mono}coloured pieces, without border \hfill~default: \Cle{true} |
| 414 |
\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} |
| 415 |
\item the boolean \Cle{BlackWhite} which displays part layouts with border \hfill~default: \Cle{false} |
| 416 |
\item \Cle{Color} to configure the \textit{mono}colour associated with the previous booleans \hfill~default: \Cle{black} |
| 417 |
\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} |
| 418 |
\item \Cle{ColorList} to list the colours of the pieces (\texttt{BT,MT,ST,SQUA,PARA} or \texttt{BT1,BT2,MT,ST1,ST2,SQUA,PARA}); |
| 419 |
|
| 420 |
\hfill~default: \Cle{red,orange,blue,green,purple} |
| 421 |
\item \Cle{PartsList} to specify the list of parts to be displayed (in the same \textit{order} as the \textit{complete} colors); |
| 422 |
|
| 423 |
\hfill~default: \Cle{1234567} |
| 424 |
\item \Cle{Sep}, the width of the border in \Cle{Solution} mode. \hfill~default: \Cle{1pt} |
| 425 |
\end{itemize} |
| 426 |
|
| 427 |
The second argument, \textit{optional} and within \texttt{<...>}, provides options to the \tikzlogo{} environment, for instance: |
| 428 |
|
| 429 |
\begin{itemize} |
| 430 |
\item change of unit |
| 431 |
\item change of scale |
| 432 |
\item rotation |
| 433 |
\item vertical alignment |
| 434 |
\end{itemize} |
| 435 |
|
| 436 |
The third argument, \textit{mandatory} and within \texttt{\{...\}}, is the name of the predefined Tangram (from the following list). |
| 437 |
|
| 438 |
\pagebreak |
| 439 |
|
| 440 |
\subsection{Help for 'missing tan task'} |
| 441 |
|
| 442 |
To work with \textit{missing tan task} operation (\href{https://www.researchgate.net/publication/371039854_Comparing_Mental_Effort_Difficulty_and_Confidence_Appraisals_in_Problem-Solving_A_Metacognitive_Perspective}{[link]}), it is possible to display a small \textit{help} puzzle with the names of the pieces displayed. |
| 443 |
|
| 444 |
\begin{PresentationCode}{listing only} |
| 445 |
%commande autonome pour afficher une aide type 'mtt' |
| 446 |
\TangramTikzHelp[keys]<tikz options> |
| 447 |
\end{PresentationCode} |
| 448 |
|
| 449 |
Two specific keys are available, in addition to those detailed above: |
| 450 |
|
| 451 |
\begin{itemize} |
| 452 |
\item boolean \Cle{Help} to show the name of the pieces; \hfill~default: \Cle{true} |
| 453 |
\item \Cle{Names} for the name of the pieces \texttt{BT1,BT2,MT,ST1,ST2,SQUARE,PARA} ; |
| 454 |
|
| 455 |
\hfill~default: \Cle{A1,A2,D,B1,B2,E,C} |
| 456 |
\end{itemize} |
| 457 |
|
| 458 |
\begin{PresentationCode}{} |
| 459 |
\TangramTikzHelp[Solution] |
| 460 |
\end{PresentationCode} |
| 461 |
|
| 462 |
\begin{PresentationCode}{} |
| 463 |
\TangramTikzHelp[Solution,Color=teal]<scale=2,transform shape> |
| 464 |
\end{PresentationCode} |
| 465 |
|
| 466 |
\begin{PresentationCode}{} |
| 467 |
\TangramTikzHelp[ColorList,Help=false] |
| 468 |
\end{PresentationCode} |
| 469 |
|
| 470 |
The \TikZ\ style for the nodes is given below. |
| 471 |
|
| 472 |
\begin{PresentationCode}{listing only} |
| 473 |
\tikzset{tangramhelp/.style={text=white,inner sep=0pt,font=\sffamily\small\bfseries}} |
| 474 |
\end{PresentationCode} |
| 475 |
|
| 476 |
\pagebreak |
| 477 |
|
| 478 |
\subsection{List of predefined Tangrams} |
| 479 |
|
| 480 |
\texttt{\begin{multicols}{5} |
| 481 |
\begin{itemize} |
| 482 |
\item \hyperref[square]{Square} |
| 483 |
\item Pinguin |
| 484 |
\item Boat |
| 485 |
\item Home |
| 486 |
\item FirTree |
| 487 |
\item Cat |
| 488 |
\item Swan |
| 489 |
\item Pyramid |
| 490 |
\item Duck |
| 491 |
\item Rocket |
| 492 |
\item Candle |
| 493 |
\item Shirt |
| 494 |
\item Fish |
| 495 |
\item Sailboat |
| 496 |
\item Kangaroo |
| 497 |
\item Dog |
| 498 |
\item Plane |
| 499 |
\item Rabbit |
| 500 |
\item Rooster |
| 501 |
\item Jogger |
| 502 |
\item Dancer |
| 503 |
\item Camel |
| 504 |
\item Flamingo |
| 505 |
\item Heart |
| 506 |
\item Giraffe |
| 507 |
\item Horse |
| 508 |
\item Goat |
| 509 |
\item Lions |
| 510 |
\item Factory |
| 511 |
\item Angel |
| 512 |
\item Tower |
| 513 |
\item Ufo |
| 514 |
\item Chicken |
| 515 |
\item Turtle |
| 516 |
\item Crab |
| 517 |
\item Snail |
| 518 |
\item Goose |
| 519 |
\item Cow |
| 520 |
\item Gift |
| 521 |
\item Man |
| 522 |
\item Arrow |
| 523 |
\item Triangl |
| 524 |
\end{itemize} |
| 525 |
\end{multicols}} |
| 526 |
|
| 527 |
\begin{PresentationCode}{} |
| 528 |
\TangramTikz{Rocket}~~ |
| 529 |
\TangramTikz[Color=red]{Rocket}~~ |
| 530 |
\TangramTikz[Solution]{Rocket}~~ |
| 531 |
\TangramTikz[Solution,Color=lightgray]{Rocket}~~ |
| 532 |
\TangramTikz[ColorSolution,ColorList={orange,blue,yellow,green,pink},Sep=1mm]{Rocket} |
| 533 |
|
| 534 |
\TangramTikz<scale=1.5,rotate=30>{Rocket}~~ |
| 535 |
\TangramTikz<scale=0.75,rotate=-90>{Rocket}~~ |
| 536 |
\TangramTikz[BlackWhite]<scale=0.5>{Rocket}~~ |
| 537 |
\TangramTikz[PartsList=134567,ColorSolution,ColorList={cyan,green,red,pink,purple,orange,yellow},Sep=0pt]{Rocket} |
| 538 |
\end{PresentationCode} |
| 539 |
|
| 540 |
\pagebreak |
| 541 |
|
| 542 |
\part{A gallery of Tangrams} |
| 543 |
|
| 544 |
\label{square} |
| 545 |
\begin{PresentationCode}{} |
| 546 |
\TangramTikz{Square} |
| 547 |
\TangramTikz[BlackWhite]{Square} |
| 548 |
\TangramTikz[Solution]{Square} |
| 549 |
\TangramTikz[ColorSolution]{Square} |
| 550 |
\end{PresentationCode} |
| 551 |
|
| 552 |
\begin{PresentationCode}{} |
| 553 |
\TangramTikz{Pinguin} |
| 554 |
\TangramTikz[Solution]{Pinguin} |
| 555 |
\TangramTikz[ColorSolution]{Pinguin} |
| 556 |
\end{PresentationCode} |
| 557 |
|
| 558 |
\begin{PresentationCode}{} |
| 559 |
\TangramTikz{Boat} |
| 560 |
\TangramTikz[Solution]{Boat} |
| 561 |
\TangramTikz[ColorSolution]{Boat} |
| 562 |
\end{PresentationCode} |
| 563 |
|
| 564 |
\begin{PresentationCode}{} |
| 565 |
\TangramTikz{Home} |
| 566 |
\TangramTikz[Solution]{Home} |
| 567 |
\TangramTikz[ColorSolution]{Home} |
| 568 |
\end{PresentationCode} |
| 569 |
|
| 570 |
\begin{PresentationCode}{} |
| 571 |
\TangramTikz{FirTree} |
| 572 |
\TangramTikz[Solution]{FirTree} |
| 573 |
\TangramTikz[ColorSolution]{FirTree} |
| 574 |
\end{PresentationCode} |
| 575 |
|
| 576 |
\begin{PresentationCode}{} |
| 577 |
\TangramTikz{Cat} |
| 578 |
\TangramTikz[Solution]{Cat} |
| 579 |
\TangramTikz[ColorSolution]{Cat} |
| 580 |
\end{PresentationCode} |
| 581 |
|
| 582 |
\begin{PresentationCode}{} |
| 583 |
\TangramTikz{Swan} |
| 584 |
\TangramTikz[Solution]{Swan} |
| 585 |
\TangramTikz[ColorSolution]{Swan} |
| 586 |
\end{PresentationCode} |
| 587 |
|
| 588 |
\begin{PresentationCode}{} |
| 589 |
\TangramTikz{Pyramid} |
| 590 |
\TangramTikz[Solution]{Pyramid} |
| 591 |
\TangramTikz[ColorSolution]{Pyramid} |
| 592 |
\end{PresentationCode} |
| 593 |
|
| 594 |
\begin{PresentationCode}{} |
| 595 |
\TangramTikz{Duck} |
| 596 |
\TangramTikz[Solution]{Duck} |
| 597 |
\TangramTikz[ColorSolution]{Duck} |
| 598 |
\end{PresentationCode} |
| 599 |
|
| 600 |
\begin{PresentationCode}{} |
| 601 |
\TangramTikz{Rocket} |
| 602 |
\TangramTikz[Solution]{Rocket} |
| 603 |
\TangramTikz[ColorSolution]{Rocket} |
| 604 |
\end{PresentationCode} |
| 605 |
|
| 606 |
\begin{PresentationCode}{} |
| 607 |
\TangramTikz{Candle} |
| 608 |
\TangramTikz[Solution]{Candle} |
| 609 |
\TangramTikz[ColorSolution]{Candle} |
| 610 |
\end{PresentationCode} |
| 611 |
|
| 612 |
\begin{PresentationCode}{} |
| 613 |
\TangramTikz{Shirt} |
| 614 |
\TangramTikz[Solution]{Shirt} |
| 615 |
\TangramTikz[ColorSolution]{Shirt} |
| 616 |
\end{PresentationCode} |
| 617 |
|
| 618 |
\begin{PresentationCode}{} |
| 619 |
\TangramTikz{Fish} |
| 620 |
\TangramTikz[Solution]{Fish} |
| 621 |
\TangramTikz[ColorSolution]{Fish} |
| 622 |
\end{PresentationCode} |
| 623 |
|
| 624 |
\begin{PresentationCode}{} |
| 625 |
\TangramTikz{Sailboat} |
| 626 |
\TangramTikz[Solution]{Sailboat} |
| 627 |
\TangramTikz[ColorSolution]{Sailboat} |
| 628 |
\end{PresentationCode} |
| 629 |
|
| 630 |
\begin{PresentationCode}{} |
| 631 |
\TangramTikz{Kangaroo} |
| 632 |
\TangramTikz[Solution]{Kangaroo} |
| 633 |
\TangramTikz[ColorSolution]{Kangaroo} |
| 634 |
\end{PresentationCode} |
| 635 |
|
| 636 |
\begin{PresentationCode}{} |
| 637 |
\TangramTikz{Dog} |
| 638 |
\TangramTikz[Solution]{Dog} |
| 639 |
\TangramTikz[ColorSolution]{Dog} |
| 640 |
\end{PresentationCode} |
| 641 |
|
| 642 |
\begin{PresentationCode}{} |
| 643 |
\TangramTikz<scale=0.75>{Plane} |
| 644 |
\TangramTikz[Solution]<scale=0.75>{Plane} |
| 645 |
\TangramTikz[ColorSolution]<scale=0.75>{Plane} |
| 646 |
\end{PresentationCode} |
| 647 |
|
| 648 |
\begin{PresentationCode}{} |
| 649 |
\TangramTikz{Rabbit} |
| 650 |
\TangramTikz[Solution]{Rabbit} |
| 651 |
\TangramTikz[ColorSolution]{Rabbit} |
| 652 |
\end{PresentationCode} |
| 653 |
|
| 654 |
\begin{PresentationCode}{} |
| 655 |
\TangramTikz{Rooster} |
| 656 |
\TangramTikz[Solution]{Rooster} |
| 657 |
\TangramTikz[ColorSolution]{Rooster} |
| 658 |
\end{PresentationCode} |
| 659 |
|
| 660 |
\begin{PresentationCode}{} |
| 661 |
\TangramTikz{Jogger} |
| 662 |
\TangramTikz[Solution]{Jogger} |
| 663 |
\TangramTikz[ColorSolution]{Jogger} |
| 664 |
\end{PresentationCode} |
| 665 |
|
| 666 |
\begin{PresentationCode}{} |
| 667 |
\TangramTikz{Dancer} |
| 668 |
\TangramTikz[Solution]{Dancer} |
| 669 |
\TangramTikz[ColorSolution]{Dancer} |
| 670 |
\end{PresentationCode} |
| 671 |
|
| 672 |
\begin{PresentationCode}{} |
| 673 |
\TangramTikz{Camel} |
| 674 |
\TangramTikz[Solution]{Camel} |
| 675 |
\TangramTikz[ColorSolution]{Camel} |
| 676 |
\end{PresentationCode} |
| 677 |
|
| 678 |
\begin{PresentationCode}{} |
| 679 |
\TangramTikz{Flamingo} |
| 680 |
\TangramTikz[Solution]{Flamingo} |
| 681 |
\TangramTikz[ColorSolution]{Flamingo} |
| 682 |
\end{PresentationCode} |
| 683 |
|
| 684 |
\begin{PresentationCode}{} |
| 685 |
\TangramTikz{Heart} |
| 686 |
\TangramTikz[Solution]{Heart} |
| 687 |
\TangramTikz[ColorSolution]{Heart} |
| 688 |
\end{PresentationCode} |
| 689 |
|
| 690 |
\begin{PresentationCode}{} |
| 691 |
\TangramTikz{Giraffe} |
| 692 |
\TangramTikz[Solution]{Giraffe} |
| 693 |
\TangramTikz[ColorSolution]{Giraffe} |
| 694 |
\end{PresentationCode} |
| 695 |
|
| 696 |
\begin{PresentationCode}{} |
| 697 |
\TangramTikz{Horse} |
| 698 |
\TangramTikz[Solution]{Horse} |
| 699 |
\TangramTikz[ColorSolution]{Horse} |
| 700 |
\end{PresentationCode} |
| 701 |
|
| 702 |
\begin{PresentationCode}{} |
| 703 |
\TangramTikz{Goat} |
| 704 |
\TangramTikz[Solution]{Goat} |
| 705 |
\TangramTikz[ColorSolution]{Goat} |
| 706 |
\end{PresentationCode} |
| 707 |
|
| 708 |
\begin{PresentationCode}{} |
| 709 |
\TangramTikz{Lions} |
| 710 |
\TangramTikz[Solution]{Lions} |
| 711 |
\TangramTikz[ColorSolution]{Lions} |
| 712 |
\end{PresentationCode} |
| 713 |
|
| 714 |
\begin{PresentationCode}{} |
| 715 |
\TangramTikz{Factory} |
| 716 |
\TangramTikz[Solution]{Factory} |
| 717 |
\TangramTikz[ColorSolution]{Factory} |
| 718 |
\end{PresentationCode} |
| 719 |
|
| 720 |
\begin{PresentationCode}{} |
| 721 |
\TangramTikz{Angel} |
| 722 |
\TangramTikz[Solution]{Angel} |
| 723 |
\TangramTikz[ColorSolution]{Angel} |
| 724 |
\end{PresentationCode} |
| 725 |
|
| 726 |
\begin{PresentationCode}{} |
| 727 |
\TangramTikz{Tower} |
| 728 |
\TangramTikz[Solution]{Tower} |
| 729 |
\TangramTikz[ColorSolution]{Tower} |
| 730 |
\end{PresentationCode} |
| 731 |
|
| 732 |
\begin{PresentationCode}{} |
| 733 |
\TangramTikz<scale=0.75>{Ufo} |
| 734 |
\TangramTikz[Solution]<scale=0.75>{Ufo} |
| 735 |
\TangramTikz[ColorSolution]<scale=0.75>{Ufo} |
| 736 |
\end{PresentationCode} |
| 737 |
|
| 738 |
\begin{PresentationCode}{} |
| 739 |
\TangramTikz{Chicken} |
| 740 |
\TangramTikz[Solution]{Chicken} |
| 741 |
\TangramTikz[ColorSolution]{Chicken} |
| 742 |
\end{PresentationCode} |
| 743 |
|
| 744 |
\begin{PresentationCode}{} |
| 745 |
\TangramTikz{Turtle} |
| 746 |
\TangramTikz[Solution]{Turtle} |
| 747 |
\TangramTikz[ColorSolution]{Turtle} |
| 748 |
\end{PresentationCode} |
| 749 |
|
| 750 |
\begin{PresentationCode}{} |
| 751 |
\TangramTikz{Crab} |
| 752 |
\TangramTikz[Solution]{Crab} |
| 753 |
\TangramTikz[ColorSolution]{Crab} |
| 754 |
\end{PresentationCode} |
| 755 |
|
| 756 |
\begin{PresentationCode}{} |
| 757 |
\TangramTikz{Snail} |
| 758 |
\TangramTikz[Solution]{Snail} |
| 759 |
\TangramTikz[ColorSolution]{Snail} |
| 760 |
\end{PresentationCode} |
| 761 |
|
| 762 |
\begin{PresentationCode}{} |
| 763 |
\TangramTikz<scale=0.75>{Goose} |
| 764 |
\TangramTikz[Solution]<scale=0.75>{Goose} |
| 765 |
\TangramTikz[ColorSolution]<scale=0.75>{Goose} |
| 766 |
\end{PresentationCode} |
| 767 |
|
| 768 |
\begin{PresentationCode}{} |
| 769 |
\TangramTikz{Cow} |
| 770 |
\TangramTikz[Solution]{Cow} |
| 771 |
\TangramTikz[ColorSolution]{Cow} |
| 772 |
\end{PresentationCode} |
| 773 |
|
| 774 |
\begin{PresentationCode}{} |
| 775 |
\TangramTikz{Gift} |
| 776 |
\TangramTikz[BlackWhite]{Gift} |
| 777 |
\TangramTikz[Solution]{Gift} |
| 778 |
\TangramTikz[ColorSolution]{Gift} |
| 779 |
\end{PresentationCode} |
| 780 |
|
| 781 |
\begin{PresentationCode}{} |
| 782 |
\TangramTikz<scale=0.75>{Man} |
| 783 |
\TangramTikz[Solution]<scale=0.75>{Man} |
| 784 |
\TangramTikz[ColorSolution]<scale=0.75>{Man} |
| 785 |
\end{PresentationCode} |
| 786 |
|
| 787 |
\begin{PresentationCode}{} |
| 788 |
\TangramTikz<scale=0.75>{Horseman} |
| 789 |
\TangramTikz[Solution]<scale=0.75>{Horseman} |
| 790 |
\TangramTikz[ColorSolution]<scale=0.75>{Horseman} |
| 791 |
\end{PresentationCode} |
| 792 |
|
| 793 |
\begin{PresentationCode}{} |
| 794 |
\TangramTikz<scale=0.75>{Arrow} |
| 795 |
\TangramTikz[Solution]<scale=0.75>{Arrow} |
| 796 |
\TangramTikz[ColorSolution]<scale=0.75>{Arrow} |
| 797 |
\end{PresentationCode} |
| 798 |
|
| 799 |
\begin{PresentationCode}{} |
| 800 |
\TangramTikz<scale=0.75>{Triangl} |
| 801 |
\TangramTikz[Solution]<scale=0.75>{Triangl} |
| 802 |
\TangramTikz[ColorSolution]<scale=0.75>{Triangl} |
| 803 |
\end{PresentationCode} |
| 804 |
|
| 805 |
\newpage |
| 806 |
|
| 807 |
\part{History} |
| 808 |
|
| 809 |
\verb|v0.2.2|~:~Bugfix + new models |
| 810 |
|
| 811 |
\verb|v0.2.0|~:~New key for choosing parts + new model + enhancements for colors + help |
| 812 |
|
| 813 |
\verb|v0.1.8|~:~\textsf{[BlackWhite]} key + \textsf{Cow}/\textsf{Gift} models |
| 814 |
|
| 815 |
\verb|v0.1.7|~:~Bugfixes in english doc + Renaming certain keys |
| 816 |
|
| 817 |
\verb|v0.1.6|~:~New models |
| 818 |
|
| 819 |
\verb|v0.1.5|~:~New models |
| 820 |
|
| 821 |
\verb|v0.1.4|~:~New models |
| 822 |
|
| 823 |
\verb|v0.1.3|~:~New models |
| 824 |
|
| 825 |
\verb|v0.1.2|~:~New models |
| 826 |
|
| 827 |
\verb|v0.1.1|~:~New models |
| 828 |
|
| 829 |
\verb|v0.1.0|~:~Initial version |
| 830 |
|
| 831 |
\end{document} |