| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} |
| 3 |
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} |
| 4 |
|
| 5 |
\documentclass[11pt,a4paper]{ltxdoc} |
| 6 |
\usepackage{bera} |
| 7 |
\usepackage{inconsolata} |
| 8 |
\usepackage[T1]{fontenc} |
| 9 |
\usepackage[utf8]{inputenc} |
| 10 |
\usepackage[scale=0.875]{cabin} |
| 11 |
\usepackage{tikzbrickfigurines} |
| 12 |
\usepackage{fancyvrb} |
| 13 |
\usepackage{fancyhdr} |
| 14 |
\usepackage{tabularray} |
| 15 |
\usepackage{fontawesome5} |
| 16 |
\fancyhf{} |
| 17 |
\renewcommand{\headrulewidth}{0pt} |
| 18 |
\lfoot{\sffamily\small [tikzbrickfigurines]} |
| 19 |
\cfoot{% |
| 20 |
\raisebox{-1.75em}{\minitikzbrickfigurine[color sweat=white,display logo,scale logo=0.5,logo={\footnotesize\bfseries\sffamily\color{black}{\thepage}}]{3.5em}{*}} |
| 21 |
} |
| 22 |
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} |
| 23 |
\usepackage{hologo} |
| 24 |
\usepackage{xspace} |
| 25 |
\providecommand*{\CTAN}{\textsc{CTAN}\xspace} |
| 26 |
\providecommand*{\TikZ}{Ti\emph{k}Z\xspace} |
| 27 |
\providecommand*{\miktex}{MiK\TeX\xspace} |
| 28 |
\providecommand*{\texlive}{\TeX{}Live\xspace} |
| 29 |
\providecommand*{\tikzbrick}{Ti\emph{k}Zbricks\xspace} |
| 30 |
\providecommand*{\tikzbrickfigurines}{Ti\emph{k}Zbrickfigurines\xspace} |
| 31 |
|
| 32 |
\usepackage{openmoji} |
| 33 |
\definecolor{brickskin}{HTML}{FFDFC4} |
| 34 |
\definecolor{brickjean}{HTML}{24496B} |
| 35 |
\definecolor{brickblondhair}{HTML}{E2BC74} |
| 36 |
\newlength\brickfigfigurineheight |
| 37 |
|
| 38 |
\usepackage{hyperref} |
| 39 |
\urlstyle{same} |
| 40 |
\hypersetup{pdfborder=0 0 0} |
| 41 |
\usepackage[margin=2cm,includefoot]{geometry} |
| 42 |
\setlength{\parindent}{0pt} |
| 43 |
\def\TPversion{0.1.1} |
| 44 |
\def\TPdate{18/08/2025} |
| 45 |
\usepackage{enumitem} |
| 46 |
\usepackage{openmoji} |
| 47 |
\usepackage{tcolorbox} |
| 48 |
\usepackage{pgffor} |
| 49 |
\tcbuselibrary{breakable,skins,hooks,listingsutf8} |
| 50 |
|
| 51 |
\lstdefinestyle{packagestyle} |
| 52 |
{ |
| 53 |
language=[LaTeX]TeX,% |
| 54 |
columns=fullflexible,% |
| 55 |
extendedchars=true,% |
| 56 |
basicstyle=\small\ttfamily,% |
| 57 |
keywordstyle={\color{black}},% |
| 58 |
classoffset=0,% |
| 59 |
keywords={\includegraphics},% |
| 60 |
alsoletter={-},% |
| 61 |
keywordstyle={\color{blue}},% |
| 62 |
classoffset=1,% |
| 63 |
alsoletter={-},% |
| 64 |
morekeywords={tikzbrickfigurines},% |
| 65 |
keywordstyle={\color{violet}},% |
| 66 |
classoffset=2,% |
| 67 |
alsoletter={-},% |
| 68 |
morekeywords={\tikzbrickfigurine,\minitikzbrickfigurine,\tikzbrickfigurinepiece},% |
| 69 |
keywordstyle={\color{green!50!black}},% |
| 70 |
classoffset=3,% |
| 71 |
morekeywords={},% |
| 72 |
keywordstyle={\color{orange}},% |
| 73 |
inputencoding=utf8/latin1 |
| 74 |
} |
| 75 |
|
| 76 |
\lstset{ |
| 77 |
basicstyle=\small\ttfamily,% |
| 78 |
keywordstyle={},% |
| 79 |
} |
| 80 |
|
| 81 |
\newtcblisting{DemoCode}[1]{% |
| 82 |
enhanced,width=\linewidth,% |
| 83 |
bicolor,size=title,% |
| 84 |
colback=cyan!10!white,% |
| 85 |
colbacklower=cyan!5!white,% |
| 86 |
colframe=cyan!75!black,% |
| 87 |
listing options={% |
| 88 |
breaklines=true,% |
| 89 |
breakatwhitespace=true,% |
| 90 |
style=packagestyle,% |
| 91 |
basicstyle=\footnotesize\ttfamily,% |
| 92 |
tabsize=4,% |
| 93 |
commentstyle={\itshape\color{gray}}, |
| 94 |
keywordstyle={\color{blue}},% |
| 95 |
classoffset=0,% |
| 96 |
keywords={},% |
| 97 |
alsoletter={-},% |
| 98 |
keywordstyle={\color{blue}},% |
| 99 |
classoffset=1,% |
| 100 |
alsoletter={-},% |
| 101 |
morekeywords={},% |
| 102 |
keywordstyle={\color{violet}},% |
| 103 |
classoffset=2,% |
| 104 |
alsoletter={-},% |
| 105 |
morekeywords={},% |
| 106 |
keywordstyle={\color{green!50!black}},% |
| 107 |
classoffset=3,% |
| 108 |
morekeywords={},% |
| 109 |
keywordstyle={\color{orange}} |
| 110 |
},% |
| 111 |
#1 |
| 112 |
} |
| 113 |
|
| 114 |
\newtcbinputlisting\DemoCodeFile[1]{% |
| 115 |
enhanced,width=\linewidth,% |
| 116 |
bicolor,size=title,% |
| 117 |
colback=lightgray!10!white,% |
| 118 |
colbacklower=lightgray!5!white,% |
| 119 |
colframe=lightgray!75!black,% |
| 120 |
listing options={% |
| 121 |
breaklines=true,% |
| 122 |
breakatwhitespace=true,% |
| 123 |
style=tcblatex, |
| 124 |
extendedchars=true,% |
| 125 |
basicstyle=\tiny\ttfamily,% |
| 126 |
keywordstyle={},% |
| 127 |
tabsize=2,% |
| 128 |
commentstyle={\itshape\color{gray}},% |
| 129 |
inputencoding=utf8/latin1 |
| 130 |
},% |
| 131 |
breakable, |
| 132 |
listing only,% |
| 133 |
listing file={#1} |
| 134 |
} |
| 135 |
|
| 136 |
\setlength\fboxsep{1.5pt} |
| 137 |
|
| 138 |
\NewDocumentCommand\ShowCode{ O{lightgray!50} m }{% |
| 139 |
\colorbox{#1}{\lstinline+#2+}% |
| 140 |
} |
| 141 |
|
| 142 |
\begin{document} |
| 143 |
|
| 144 |
\pagestyle{fancy} |
| 145 |
|
| 146 |
\begin{center} |
| 147 |
\begin{minipage}{0.88\linewidth} |
| 148 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 149 |
\begin{center} |
| 150 |
\renewcommand{\arraystretch}{1.25}% |
| 151 |
\begin{tabular}{c} |
| 152 |
{\Huge \texttt{tikzbrickfigurines}}\\ |
| 153 |
\\ |
| 154 |
{\LARGE Drawing brick-figurines} \\ |
| 155 |
{\LARGE with \TikZ.} \\ |
| 156 |
\\ |
| 157 |
{\small \texttt{Version \TPversion\ -- \TPdate}} |
| 158 |
\end{tabular} |
| 159 |
\end{center} |
| 160 |
\end{tcolorbox} |
| 161 |
\end{minipage} |
| 162 |
\end{center} |
| 163 |
|
| 164 |
\begin{center} |
| 165 |
\begin{tabular}{c} |
| 166 |
\texttt{Cédric Pierquet}\\ |
| 167 |
{\ttfamily cpierquet -- at -- outlook . fr}\\ |
| 168 |
\texttt{\url{https://github.com/cpierquet/latex-packages/tikzbrickfigurines}} \\ |
| 169 |
\end{tabular} |
| 170 |
\end{center} |
| 171 |
|
| 172 |
\hrule |
| 173 |
|
| 174 |
\vfill |
| 175 |
|
| 176 |
\hfill% |
| 177 |
\tikzbrickfigurine% |
| 178 |
[% |
| 179 |
mouthstyle=7,% |
| 180 |
eyestyle=1,% |
| 181 |
eyebrowstyle=7, |
| 182 |
hairstyle=10, |
| 183 |
color skin=brickskin, |
| 184 |
color hair=brown, |
| 185 |
color sweat=white, |
| 186 |
color pant=brickjean, |
| 187 |
color foot=brickjean!50!black, |
| 188 |
custom logo, |
| 189 |
%logo={\openmoji{rhinoceros}} |
| 190 |
logo={\huge\bfseries\sffamily\rotatebox{30}{\begin{tabular}{c} {\Huge\openmoji{snake}} \\ {\LARGE \faHandPointRight} made with \\ \LaTeX/\TikZ\ {\LARGE \faHandPointLeft} \\ {\Huge\openmoji{infinity}} \end{tabular}}} |
| 191 |
]% |
| 192 |
{3in}% |
| 193 |
\hfill\null |
| 194 |
|
| 195 |
\vfill |
| 196 |
|
| 197 |
\section{Introduction} |
| 198 |
|
| 199 |
The package allows to draw \textit{brick}-figurines with \TikZ. |
| 200 |
|
| 201 |
The user can modify their colour, shape and elements. |
| 202 |
|
| 203 |
\medskip |
| 204 |
|
| 205 |
The package is included in both \texlive and \miktex and available from \CTAN\ (\url{https://ctan.org/pkg/tikzbrickfigurines}). |
| 206 |
|
| 207 |
\medskip |
| 208 |
|
| 209 |
The development version of this package is located on github at \url{https://github.com/cpierquet/latex-packages/tikzbrickfigurines}. If you have any problems, ideas or other feedback, please make constructive use of its bug tracker. |
| 210 |
|
| 211 |
\medskip |
| 212 |
|
| 213 |
The style of this documentation is inspired by \texttt{samcarter}'s doc for their great \tikzbrick\ package (\url{https://ctan.org/pkg/tikzbricks}). |
| 214 |
|
| 215 |
\medskip |
| 216 |
|
| 217 |
Copyright \raisebox{0.2em}{\tiny\fontfamily{cmr}\selectfont\textcopyright} \texttt{Cédric Pierquet}. |
| 218 |
|
| 219 |
\textbullet~~Inspired by LEGO\texttrademark, but all graphics are made from scratch. |
| 220 |
|
| 221 |
\textbullet~~Permission is granted to copy, distribute and\slash or modify this software under the terms of the |
| 222 |
|
| 223 |
\hfill\href{https://www.latex-project.org/lppl.txt}{LaTeX project public licence, version 1.3c or later}.\hfill\null |
| 224 |
|
| 225 |
\vfill\null |
| 226 |
|
| 227 |
\pagebreak |
| 228 |
|
| 229 |
\phantomsection |
| 230 |
|
| 231 |
\hypertarget{matoc}{} |
| 232 |
|
| 233 |
\tableofcontents |
| 234 |
|
| 235 |
\vspace*{5mm} |
| 236 |
|
| 237 |
\vfill |
| 238 |
|
| 239 |
\section{History} |
| 240 |
|
| 241 |
\texttt{0.1.1: Enhancements for adjusted logo} |
| 242 |
|
| 243 |
\texttt{0.1.0: Initial version} |
| 244 |
|
| 245 |
\vspace*{5mm} |
| 246 |
|
| 247 |
\pagebreak |
| 248 |
|
| 249 |
\section{Loading, developments} |
| 250 |
|
| 251 |
\subsection{Loading, useful packages} |
| 252 |
|
| 253 |
To use \texttt{tikzbrickfigurines}, simply use \ShowCode{\\usepackage\{tikzbrickfigurines\}}. |
| 254 |
|
| 255 |
\begin{DemoCode}{listing only} |
| 256 |
\usepackage{tikzbrickfigurines} |
| 257 |
\end{DemoCode} |
| 258 |
|
| 259 |
Loaded packages are \ShowCode{tikz}, \ShowCode{simplekv}, \ShowCode{xstring}, \ShowCode{ifthen}, \ShowCode{listofitems}, \ShowCode{graphicx}, \ShowCode{etoolbox} and \ShowCode{calc}. |
| 260 |
|
| 261 |
Loaded libraries are \ShowCode{shapes.geometric,bbox,decorations,decorations.pathmorphing,calc}. |
| 262 |
|
| 263 |
\subsection{Developments} |
| 264 |
|
| 265 |
For the moment, the package uses internal macros for creating/manipulating pieces and elements, but eventually, the future plan is: |
| 266 |
|
| 267 |
\begin{itemize} |
| 268 |
\item to manipulate these elements with a \ShowCode{pic} code; |
| 269 |
\item to improve the code for the logo (work in progress). |
| 270 |
\end{itemize} |
| 271 |
|
| 272 |
|
| 273 |
\section{Global usage} |
| 274 |
|
| 275 |
\subsection{Version 1} |
| 276 |
|
| 277 |
An individual \tikzbrickfigurines can be drawn with: |
| 278 |
|
| 279 |
\begin{DemoCode}{listing only} |
| 280 |
\tikzbrickfigurine% |
| 281 |
[keys]% |
| 282 |
<tikz options>% |
| 283 |
{height} |
| 284 |
\end{DemoCode} |
| 285 |
|
| 286 |
\begin{DemoCode}{} |
| 287 |
%default output |
| 288 |
\tikzbrickfigurine{1.5in} |
| 289 |
\end{DemoCode} |
| 290 |
|
| 291 |
\subsection{Version 2} |
| 292 |
|
| 293 |
An individual \tikzbrickfigurines can be drawn with: |
| 294 |
|
| 295 |
\begin{DemoCode}{listing only} |
| 296 |
\minitikzbrickfigurine% |
| 297 |
[keys]% |
| 298 |
<tikz options>% |
| 299 |
{height}% |
| 300 |
{list of styles, within M/E/Eb/H} |
| 301 |
\end{DemoCode} |
| 302 |
|
| 303 |
\begin{DemoCode}{} |
| 304 |
\minitikzbrickfigurine{1.5in}{1/1/1/0}%default style |
| 305 |
\minitikzbrickfigurine{1.5in}{4/7/1/2}%with choosen styles |
| 306 |
\minitikzbrickfigurine{1.5in}{3/*/9/*}%with choosen and random styles |
| 307 |
\minitikzbrickfigurine{1.5in}{*}%with full random styles |
| 308 |
\minitikzbrickfigurine{1.5in}{*}%with other full random styles |
| 309 |
\end{DemoCode} |
| 310 |
|
| 311 |
\subsection{Individual part} |
| 312 |
|
| 313 |
An individual \tikzbrickfigurines piece can be drawn with: |
| 314 |
|
| 315 |
\begin{DemoCode}{listing only} |
| 316 |
\tikzbrickfigurinepiece% |
| 317 |
[keys]% |
| 318 |
<tikz options>% |
| 319 |
{piece / style}% |
| 320 |
{height} |
| 321 |
\end{DemoCode} |
| 322 |
|
| 323 |
\begin{DemoCode}{} |
| 324 |
\tikzbrickfigurinepiece[head=true]{hair=3}{1in}% |
| 325 |
\tikzbrickfigurinepiece[head=true]{eyes=7}{1in}% |
| 326 |
\tikzbrickfigurinepiece[head=true]{mouth=2}{1in}% |
| 327 |
\tikzbrickfigurinepiece{head=2/3/*/5}{1in}% |
| 328 |
\end{DemoCode} |
| 329 |
|
| 330 |
\section{Keys and styles} |
| 331 |
|
| 332 |
\subsection{Keys} |
| 333 |
|
| 334 |
Available \texttt{\textbf{keys}} are: |
| 335 |
|
| 336 |
\begin{itemize}[leftmargin=*,itemsep=1pt] |
| 337 |
\item \ShowCode{color lines}: eventual color for borders |
| 338 |
\item \ShowCode{color skin}: global color for skin (override individual colors if given) |
| 339 |
\item \ShowCode{color sweat}: global color for body and arms (override individual colors if given) |
| 340 |
\item \ShowCode{color pant}: global color for pant (override individual colors if given) |
| 341 |
\item \ShowCode{color belt}: color for the belt (\ShowCode[orange!15]{darkgray}) |
| 342 |
\item \ShowCode{color bottom belt}: color for the belt (\ShowCode[orange!15]{blue!75}) |
| 343 |
\item \ShowCode{color body}: simple color for the body (\ShowCode[orange!15]{red}) |
| 344 |
\item \ShowCode{color arm}: simple color for the arms (\ShowCode[orange!15]{red}) |
| 345 |
\item \ShowCode{color arm shadow}: simple color for the arms shadow (\ShowCode[orange!15]{red!85!black}) |
| 346 |
\item \ShowCode{color hand}: simple color for the hand (\ShowCode[orange!15]{yellow}) |
| 347 |
\item \ShowCode{color hand shadow}: simple color for the hand shadow (\ShowCode[orange!15]{yellow!85!black}) |
| 348 |
\item \ShowCode{color neck}: simple color for the neck (\ShowCode[orange!15]{yellow}) |
| 349 |
\item \ShowCode{color head}: simple color for the head (\ShowCode[orange!15]{yellow}) |
| 350 |
\item \ShowCode{color hair}: color for the hair (\ShowCode[orange!15]{brown}) |
| 351 |
\item \ShowCode{color top pant}: simple color for top pant (\ShowCode[orange!15]{blue!75}) |
| 352 |
\item \ShowCode{color middle pant}: simple color for mid pant (\ShowCode[orange!15]{blue!75}) |
| 353 |
\item \ShowCode{color foot}: simple color for shoes (\ShowCode[orange!15]{darkgray!50!black}) |
| 354 |
\item \ShowCode{adjusted logo}: the logo will be adjusted to sweat |
| 355 |
\item \ShowCode{display logo}: boolean for logo (\ShowCode[orange!15]{false}) |
| 356 |
\item \ShowCode{custom logo}: boolean for custom logo (\ShowCode[orange!15]{false}) |
| 357 |
\item \ShowCode{logo}: code for the optional logo |
| 358 |
\item \ShowCode{scale logo}: custom scale for \ShowCode{display logo} (\ShowCode[orange!15]{0.667}) |
| 359 |
\item \ShowCode{empty}: boolean for empty figurine (\ShowCode[orange!15]{false}) |
| 360 |
\item \ShowCode{hairstyle}: style of hair, from 0 to 10 (\ShowCode[orange!15]{0}) |
| 361 |
\item \ShowCode{eyestyle}: style of eyes, from 1 to 10(\ShowCode[orange!15]{1}) |
| 362 |
\item \ShowCode{eyebrowstyle}: style of eyebrows, from 1 to 10(\ShowCode[orange!15]{1}) |
| 363 |
\item \ShowCode{mouthstyle}: style of mouth, from 1 to 10(\ShowCode[orange!15]{1}) |
| 364 |
\item \ShowCode{seed}: random seed for some hair code (\ShowCode[orange!15]{365479}) |
| 365 |
\item \ShowCode{bbox} boolean for using \ShowCode{bbox} library (\ShowCode[orange!15]{false}) |
| 366 |
\item \ShowCode{vcenter} boolean for centering vertically, with \texttt{tikz baseline} (\ShowCode[orange!15]{false}) |
| 367 |
\item \ShowCode{head}: boolean for showing head with individual element (\ShowCode[orange!15]{false}) |
| 368 |
\end{itemize} |
| 369 |
|
| 370 |
\subsection{Elements} |
| 371 |
|
| 372 |
\subsubsection{Body / legs / head / arms / hands / heads} |
| 373 |
|
| 374 |
\begin{DemoCode}{listing only} |
| 375 |
\tikzbrickfigurinepiece[keys]<tizk options>{piece}{height} |
| 376 |
\end{DemoCode} |
| 377 |
|
| 378 |
\begin{tblr}{hlines,vlines,colspec={Q[1.25cm,m,c]*{9}{Q[m,c]}},row{1}={font=\footnotesize\ttfamily}} |
| 379 |
\SetCell[r=2,c=1]{c}{\rotatebox{45}{\textbf{piece}}} & body & legs & head & {left\\arm} & {right\\arm} &{left arm\\wo hand} & {right arm\\wo hand} & {left\\hand} & {righ\\hand} \\ |
| 380 |
&\tikzbrickfigurinepiece[vcenter]{body}{0.75in} & |
| 381 |
\tikzbrickfigurinepiece[vcenter]{legs}{0.75in} & |
| 382 |
\tikzbrickfigurinepiece[vcenter]{head}{0.75in} & |
| 383 |
\tikzbrickfigurinepiece[vcenter]{left arm}{0.75in} & |
| 384 |
\tikzbrickfigurinepiece[vcenter]{right arm}{0.75in} & |
| 385 |
\tikzbrickfigurinepiece[vcenter]{left arm wo hand}{0.75in} & |
| 386 |
\tikzbrickfigurinepiece[vcenter]{right arm wo hand}{0.75in} & |
| 387 |
\tikzbrickfigurinepiece[vcenter]{left hand}{0.75in} & |
| 388 |
\tikzbrickfigurinepiece[vcenter]{right hand}{0.75in} \\ |
| 389 |
\end{tblr} |
| 390 |
|
| 391 |
\subsubsection{Mouth} |
| 392 |
|
| 393 |
\begin{DemoCode}{listing only} |
| 394 |
\tikzbrickfigurinepiece[keys]<tizk options>{mouth=...}{height} |
| 395 |
\end{DemoCode} |
| 396 |
|
| 397 |
\begin{tblr}{hlines,vlines,colspec={Q[1.25cm,m,c]*{10}{Q[0.8cm,m,c]}},row{1}={font=\footnotesize\ttfamily}} |
| 398 |
\SetCell[r=2,c=1]{c}{\rotatebox{45}{\textbf{mouth=}}} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ |
| 399 |
&\tikzbrickfigurinepiece[head=true]{mouth=1}{1in} & |
| 400 |
\tikzbrickfigurinepiece[head=true]{mouth=2}{1in} & |
| 401 |
\tikzbrickfigurinepiece[head=true]{mouth=3}{1in} & |
| 402 |
\tikzbrickfigurinepiece[head=true]{mouth=4}{1in} & |
| 403 |
\tikzbrickfigurinepiece[head=true]{mouth=5}{1in} & |
| 404 |
\tikzbrickfigurinepiece[head=true]{mouth=6}{1in} & |
| 405 |
\tikzbrickfigurinepiece[head=true]{mouth=7}{1in} & |
| 406 |
\tikzbrickfigurinepiece[head=true]{mouth=8}{1in} & |
| 407 |
\tikzbrickfigurinepiece[head=true]{mouth=9}{1in} & |
| 408 |
\tikzbrickfigurinepiece[head=true]{mouth=10}{1in} |
| 409 |
\end{tblr} |
| 410 |
|
| 411 |
\subsubsection{Eyes} |
| 412 |
|
| 413 |
\begin{DemoCode}{listing only} |
| 414 |
\tikzbrickfigurinepiece[keys,head=true]<tizk options>{eyes=...}{height} |
| 415 |
\end{DemoCode} |
| 416 |
|
| 417 |
\begin{tblr}{hlines,vlines,colspec={Q[1.25cm,m,c]*{10}{Q[0.8cm,m,c]}},row{1}={font=\footnotesize\ttfamily}} |
| 418 |
\SetCell[r=2,c=1]{c}{\rotatebox{45}{\textbf{eyes=}}} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ |
| 419 |
&\tikzbrickfigurinepiece[head=true]{eyes=1}{1in} & |
| 420 |
\tikzbrickfigurinepiece[head=true]{eyes=2}{1in} & |
| 421 |
\tikzbrickfigurinepiece[head=true]{eyes=3}{1in} & |
| 422 |
\tikzbrickfigurinepiece[head=true]{eyes=4}{1in} & |
| 423 |
\tikzbrickfigurinepiece[head=true]{eyes=5}{1in} & |
| 424 |
\tikzbrickfigurinepiece[head=true]{eyes=6}{1in} & |
| 425 |
\tikzbrickfigurinepiece[head=true]{eyes=7}{1in} & |
| 426 |
\tikzbrickfigurinepiece[head=true]{eyes=8}{1in} & |
| 427 |
\tikzbrickfigurinepiece[head=true]{eyes=9}{1in} & |
| 428 |
\tikzbrickfigurinepiece[head=true]{eyes=10}{1in} |
| 429 |
\end{tblr} |
| 430 |
|
| 431 |
\subsubsection{Eyebrows} |
| 432 |
|
| 433 |
\begin{DemoCode}{listing only} |
| 434 |
\tikzbrickfigurinepiece[keys,head=true]<tizk options>{eyebrows=...}{height} |
| 435 |
\end{DemoCode} |
| 436 |
|
| 437 |
\begin{tblr}{hlines,vlines,colspec={Q[1.25cm,m,c]*{10}{Q[0.8cm,m,c]}},row{1}={font=\footnotesize\ttfamily}} |
| 438 |
\SetCell[r=2,c=1]{c}{\rotatebox{45}{\textbf{eyebrows=}}} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ |
| 439 |
&\tikzbrickfigurinepiece[head=true]{eyebrows=1}{1in} & |
| 440 |
\tikzbrickfigurinepiece[head=true]{eyebrows=2}{1in} & |
| 441 |
\tikzbrickfigurinepiece[head=true]{eyebrows=3}{1in} & |
| 442 |
\tikzbrickfigurinepiece[head=true]{eyebrows=4}{1in} & |
| 443 |
\tikzbrickfigurinepiece[head=true]{eyebrows=5}{1in} & |
| 444 |
\tikzbrickfigurinepiece[head=true]{eyebrows=6}{1in} & |
| 445 |
\tikzbrickfigurinepiece[head=true]{eyebrows=7}{1in} & |
| 446 |
\tikzbrickfigurinepiece[head=true]{eyebrows=8}{1in} & |
| 447 |
\tikzbrickfigurinepiece[head=true]{eyebrows=9}{1in} & |
| 448 |
\tikzbrickfigurinepiece[head=true]{eyebrows=10}{1in} |
| 449 |
\end{tblr} |
| 450 |
|
| 451 |
\subsubsection{Hair} |
| 452 |
|
| 453 |
\begin{DemoCode}{listing only} |
| 454 |
\tikzbrickfigurinepiece[keys,head=true]<tizk options>{hair=...}{height} |
| 455 |
\end{DemoCode} |
| 456 |
|
| 457 |
\begin{tblr}{hlines,vlines,colspec={Q[1.25cm,m,c]*{11}{Q[0.8cm,m,c]}},row{1}={font=\footnotesize\ttfamily}} |
| 458 |
\SetCell[r=2,c=1]{c}{\rotatebox{45}{\textbf{hair=}}} & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ |
| 459 |
&\tikzbrickfigurinepiece[head=true]{hair=0}{1in} & |
| 460 |
\tikzbrickfigurinepiece[head=true]{hair=1}{1in} & |
| 461 |
\tikzbrickfigurinepiece[head=true]{hair=2}{1in} & |
| 462 |
\tikzbrickfigurinepiece[head=true]{hair=3}{1in} & |
| 463 |
\tikzbrickfigurinepiece[head=true]{hair=4}{1in} & |
| 464 |
\tikzbrickfigurinepiece[head=true]{hair=5}{1in} & |
| 465 |
\tikzbrickfigurinepiece[head=true]{hair=6}{1in} & |
| 466 |
\tikzbrickfigurinepiece[head=true]{hair=7}{1in} & |
| 467 |
\tikzbrickfigurinepiece[head=true]{hair=8}{1in} & |
| 468 |
\tikzbrickfigurinepiece[head=true]{hair=9}{1in} & |
| 469 |
\tikzbrickfigurinepiece[head=true]{hair=10}{1in} |
| 470 |
\end{tblr} |
| 471 |
|
| 472 |
\subsubsection{Head(s)} |
| 473 |
|
| 474 |
\begin{DemoCode}{listing only} |
| 475 |
\tikzbrickfigurinepiece[keys]<tizk options>{head=...}{height} |
| 476 |
\end{DemoCode} |
| 477 |
|
| 478 |
\begin{tblr}{hlines,vlines,colspec={Q[1.25cm,m,c]*{5}{Q[1.6cm,m,c]}},row{1}={font=\footnotesize\ttfamily}} |
| 479 |
\SetCell[r=2,c=1]{c}{\rotatebox{45}{\textbf{head=}}} & * & 4/8/1/6 & 2/*/*/9 & 3/3/3/3 & 10/10/10/2 \\ |
| 480 |
&\tikzbrickfigurinepiece{head=*}{2in} & |
| 481 |
\tikzbrickfigurinepiece{head=4/8/1/6}{2in} & |
| 482 |
\tikzbrickfigurinepiece{head=2/*/*/9}{2in} & |
| 483 |
\tikzbrickfigurinepiece{head=3/3/3/3}{2in} & |
| 484 |
\tikzbrickfigurinepiece{head=10/10/10/2}{2in} |
| 485 |
\end{tblr} |
| 486 |
|
| 487 |
\subsection{The optional logo} |
| 488 |
|
| 489 |
Due to scaling process, a global scale is applied to whole figure (with the \TikZ\ option \ShowCode{transform shape}). So every node is scaled too. |
| 490 |
|
| 491 |
The special key \ShowCode{scale logo=...} can adjust most precisely the logo! |
| 492 |
|
| 493 |
\smallskip |
| 494 |
|
| 495 |
There's three methods in order to place a logo: |
| 496 |
|
| 497 |
\begin{itemize} |
| 498 |
\item boolean \ShowCode{custom logo} and key \ShowCode{logo=...} with the same global scale; |
| 499 |
\item boolean \ShowCode{display logo} and key \ShowCode{logo=...} with a \textit{cancel} scale; |
| 500 |
\item key \ShowCode{adjusted logo=...} to adjust in the sweat. |
| 501 |
\end{itemize} |
| 502 |
|
| 503 |
\def\mylogo{% |
| 504 |
\sffamily\rotatebox{30}{% |
| 505 |
\begin{tabular}{@{}c@{}}% |
| 506 |
\faPython\ I'm a \\ Python \\ user \faPython |
| 507 |
\end{tabular}% |
| 508 |
}% |
| 509 |
} |
| 510 |
|
| 511 |
\begin{DemoCode}{} |
| 512 |
\def\mylogo{\sffamily\rotatebox{30}{% |
| 513 |
\begin{tabular}{@{}c@{}}% |
| 514 |
\faPython\ I'm a \\ Python \\ user \faPython |
| 515 |
\end{tabular}}% |
| 516 |
} |
| 517 |
|
| 518 |
\mylogo |
| 519 |
\end{DemoCode} |
| 520 |
|
| 521 |
\begin{DemoCode}{} |
| 522 |
\tikzbrickfigurine[custom logo,logo=\mylogo]{4cm}%with 'global' scale |
| 523 |
\tikzbrickfigurine[display logo,logo=\mylogo]{4cm}%with 'cancel' scale |
| 524 |
\tikzbrickfigurine[adjusted logo=\mylogo]{4cm}%adjusted |
| 525 |
\end{DemoCode} |
| 526 |
|
| 527 |
\begin{DemoCode}{} |
| 528 |
\tikzbrickfigurine[custom logo,logo=\mylogo,scale logo=1]{4cm}%with 'global' scale |
| 529 |
\tikzbrickfigurine[display logo,logo=\mylogo,scale logo=1]{4cm}%with 'cancel' scale |
| 530 |
\tikzbrickfigurine[adjusted logo=\mylogo,scale logo=1]{4cm}%adjusted |
| 531 |
\end{DemoCode} |
| 532 |
|
| 533 |
\pagebreak |
| 534 |
|
| 535 |
\section{Samples} |
| 536 |
|
| 537 |
\subsection{Influence of options} |
| 538 |
|
| 539 |
\begin{DemoCode}{} |
| 540 |
\definecolor{brickskin}{HTML}{FFDFC4} |
| 541 |
|
| 542 |
\def\mylogo{\rotatebox{30}{\sffamily\begin{tabular}{@{}c@{}}\faFastForward\ I'm a\\\LaTeX\\user \faFastBackward\end{tabular}}} |
| 543 |
|
| 544 |
\tikzbrickfigurine% |
| 545 |
[% |
| 546 |
color lines=darkgray, |
| 547 |
color belt=lightgray, |
| 548 |
color bottom belt=blue!75, |
| 549 |
color body=red, |
| 550 |
color arm=violet, |
| 551 |
color arm shadow=lime, |
| 552 |
color hand=yellow, |
| 553 |
color hand shadow=orange, |
| 554 |
color neck=teal, |
| 555 |
color head=brickskin, |
| 556 |
color hair=cyan, |
| 557 |
color top pant=pink, |
| 558 |
color middle pant=pink!50!black, |
| 559 |
color foot=white, |
| 560 |
adjusted logo=\mylogo, |
| 561 |
scale logo=1, |
| 562 |
hairstyle=6,% |
| 563 |
eyestyle=5,% |
| 564 |
eyebrowstyle=10,% |
| 565 |
mouthstyle=2 |
| 566 |
]% |
| 567 |
<rotate=15> |
| 568 |
{2.75in}% |
| 569 |
\end{DemoCode} |
| 570 |
|
| 571 |
\pagebreak |
| 572 |
|
| 573 |
\subsection{Random usage} |
| 574 |
|
| 575 |
\begin{DemoCode}{} |
| 576 |
\newcommand\randomcolor[1]{% |
| 577 |
\pgfmathsetmacro{\R}{random(0,10000)/10000}% |
| 578 |
\pgfmathsetmacro{\G}{random(0,10000)/10000}% |
| 579 |
\pgfmathsetmacro{\B}{random(0,10000)/10000}% |
| 580 |
\definecolor{#1}{rgb}{\R,\G,\B}% |
| 581 |
} |
| 582 |
|
| 583 |
\pgfmathdeclarerandomlist{listsksintones}% |
| 584 |
{{brickskin}{yellow}{pink}{brown}{brown!50!white}} |
| 585 |
\pgfmathdeclarerandomlist{listhairtones}% |
| 586 |
{{lightgray!15}{yellow}{orange}{brown}{gray}{black}} |
| 587 |
\pgfmathdeclarerandomlist{listlogos}% |
| 588 |
{{unicorn}{alien}{snake}{adhesive bandage}{desert island}{videocassette}{alien monster}} |
| 589 |
|
| 590 |
%five 'random' clothes + face + skin + hair + logo brickfigurines |
| 591 |
\foreach \i in {1,...,5}{% |
| 592 |
\randomcolor{randomsweatcolor}% |
| 593 |
\randomcolor{randompantcolor}% |
| 594 |
\randomcolor{randomshoecolor}% |
| 595 |
\pgfmathrandomitem{\skinrandom}{listsksintones}% |
| 596 |
\pgfmathrandomitem{\hairrandom}{listhairtones}% |
| 597 |
\pgfmathrandomitem{\logorandom}{listlogos}% |
| 598 |
\minitikzbrickfigurine% |
| 599 |
[% |
| 600 |
color skin=\skinrandom,% |
| 601 |
color hair=\hairrandom,% |
| 602 |
color sweat=randomsweatcolor,% |
| 603 |
color pant=randompantcolor,% |
| 604 |
color foot=randomshoecolor,% |
| 605 |
display logo,scale logo=0.8,% |
| 606 |
logo={\openmoji{\logorandom}},% |
| 607 |
vcenter |
| 608 |
]% |
| 609 |
<rotate=\fpeval{randint(-20,20)}>% |
| 610 |
{1.75in}{*} |
| 611 |
} |
| 612 |
\end{DemoCode} |
| 613 |
|
| 614 |
\pagebreak |
| 615 |
|
| 616 |
\subsection{Overlay usage} |
| 617 |
|
| 618 |
Several nodes a created within internal code, and with \TikZ\ options, overlays elements can be added. |
| 619 |
|
| 620 |
\begin{DemoCode}{listing only} |
| 621 |
\tikzbrickfigurine% |
| 622 |
[figure name=myfigurine]% |
| 623 |
<remember picture> |
| 624 |
{4.5in}% |
| 625 |
|
| 626 |
\end{DemoCode} |
| 627 |
|
| 628 |
\tikzbrickfigurine% |
| 629 |
[figure name=myfigurine]% |
| 630 |
<remember picture> |
| 631 |
{4.5in}% |
| 632 |
|
| 633 |
\begin{tikzpicture}[remember picture,overlay] |
| 634 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-MOUTH) circle[radius=3pt] --++ (5cm,-1cm) node[right,font=\small\sffamily] {node (myfigurine-MOUTH)} ; |
| 635 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-EYES) circle[radius=3pt] --++ (5cm,-1cm) node[right,font=\small\sffamily] {node (myfigurine-EYES)} ; |
| 636 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-LOGO) circle[radius=3pt] --++ (5cm,-1cm) node[right,font=\small\sffamily] {node (myfigurine-LOGO)} ; |
| 637 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-HAIR) circle[radius=3pt] --++ (5cm,-1cm) node[right,font=\small\sffamily] {node (myfigurine-HAIR)} ; |
| 638 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-EYEBROWS) circle[radius=3pt] --++ (5cm,-1cm) node[right,font=\small\sffamily] {node (myfigurine-EYEBROWS)} ; |
| 639 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-BELT) circle[radius=3pt] --++ (5cm,0cm) node[right,font=\small\sffamily] {node (myfigurine-BELT)} ; |
| 640 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-LEFTHAND) circle[radius=3pt] --++ (2.5cm,-1cm) node[right,font=\small\sffamily] {node (myfigurine-LEFTHAND)} ; |
| 641 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-RIGHTHAND) circle[radius=3pt] --++ (8.5cm,-2cm) node[right,font=\small\sffamily] {node (myfigurine-RIGHTHAND)} ; |
| 642 |
%feet |
| 643 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-LEFTFOOT) circle[radius=3pt] --++ (3cm,0cm) node[right,font=\small\sffamily] {node (myfigurine-LEFTFOOT)} ; |
| 644 |
\draw[very thick,gray,fill=white,->,>=latex] (myfigurine-RIGHTFOOT) circle[radius=3pt] --++ (5cm,-1cm) node[right,font=\small\sffamily] {node (myfigurine-RIGHTFOOT)} ; |
| 645 |
%shoulders |
| 646 |
\draw[very thick,violet,fill=white] (myfigurine-RIGHTSHOULDER) circle[radius=3pt] (myfigurine-LEFTSHOULDER) circle[radius=3pt]; |
| 647 |
\draw[very thick,violet] ([shift={(135:3pt)}]myfigurine-RIGHTSHOULDER) --++ (-45:6pt) ; |
| 648 |
\draw[very thick,violet] ([shift={(-135:3pt)}]myfigurine-RIGHTSHOULDER) --++ (45:6pt) ; |
| 649 |
\draw[very thick,violet] ([shift={(135:3pt)}]myfigurine-LEFTSHOULDER) --++ (-45:6pt) ; |
| 650 |
\draw[very thick,violet] ([shift={(-135:3pt)}]myfigurine-LEFTSHOULDER) --++ (45:6pt) ; |
| 651 |
%neck |
| 652 |
\draw[very thick,teal,fill=white] (myfigurine-NECK) circle[radius=3pt]; |
| 653 |
\draw[very thick,teal] ([shift={(-135:3pt)}]myfigurine-NECK) --++ (45:6pt) ; |
| 654 |
\draw[very thick,teal] ([shift={(135:3pt)}]myfigurine-NECK) --++ (-45:6pt) ; |
| 655 |
\end{tikzpicture} |
| 656 |
|
| 657 |
\vspace*{1cm} |
| 658 |
|
| 659 |
Other available nodes are: |
| 660 |
|
| 661 |
\begin{itemize} |
| 662 |
\item \ShowCode[violet!50]{(<mynode>-RIGHTSHOULDER)}, \ShowCode[violet!50]{(<mynode>-LEFTSHOULDER)}; |
| 663 |
\item \ShowCode[teal!50]{(<mynode>-NECK)}. |
| 664 |
\end{itemize} |
| 665 |
|
| 666 |
\end{document} |