| 1 |
%% Copyright 2016 Nils Fleischhacker |
| 2 |
%% |
| 3 |
%% This work may be distributed and/or modified under the |
| 4 |
%% conditions of the LaTeX Project Public License, either |
| 5 |
%% version 1.3 of this license or (at your option) any later |
| 6 |
%% version. The latest version of this license is in |
| 7 |
%% |
| 8 |
%% http://www.latex-project.org/lppl.txt |
| 9 |
%% |
| 10 |
%% and version 1.3 or later is part of all distributions of |
| 11 |
%% LaTeX version 2005/12/01 or later. |
| 12 |
%% |
| 13 |
%% This work has the LPPL maintenance status `maintained'. |
| 14 |
%% |
| 15 |
%% The Current Maintainer of this work is Nils Fleischhacker. |
| 16 |
%% |
| 17 |
%% This work consists of the files tikzpeople.tex, tikzpeople.sty, |
| 18 |
%% tikzpeople.shape.alice.sty, tikzpeople.shape.bob.sty, |
| 19 |
%% tikzpeople.shape.bride.sty, tikzpeople.shape.builder.sty, |
| 20 |
%% tikzpeople.shape.businessman.sty, tikzpeople.shape.charlie.sty, |
| 21 |
%% tikzpeople.shape.chef.sty, tikzpeople.shape.conductor.sty, |
| 22 |
%% tikzpeople.shape.cowboy.sty, tikzpeople.shape.criminal.sty, |
| 23 |
%% tikzpeople.shape.dave.sty, tikzpeople.shape.graduate.sty, |
| 24 |
%% tikzpeople.shape.groom.sty, tikzpeople.shape.guard.sty, |
| 25 |
%% tikzpeople.shape.jester.sty, tikzpeople.shape.judge.sty, |
| 26 |
%% tikzpeople.shape.mexican.sty, tikzpeople.shape.nun.sty, |
| 27 |
%% tikzpeople.shape.nurse.sty, tikzpeople.shape.physician.sty, |
| 28 |
%% tikzpeople.shape.pilot.sty, tikzpeople.shape.police.sty, |
| 29 |
%% tikzpeople.shape.priest.sty, tikzpeople.shape.sailor.sty, |
| 30 |
%% tikzpeople.shape.santa.sty and tikzpeople.shape.surgeon.sty |
| 31 |
\documentclass{ltxdoc} |
| 32 |
\usepackage[demo]{tikzpeople} |
| 33 |
\usepackage[OT1]{fontenc} |
| 34 |
\usepackage{hyperref} |
| 35 |
\usepackage{microtype} |
| 36 |
\usepackage{xspace} |
| 37 |
\usepackage[most]{tcolorbox} |
| 38 |
\usepackage[title]{appendix} |
| 39 |
\usetikzlibrary{shapes.callouts} |
| 40 |
|
| 41 |
\newcommand*{\Appendixautorefname}{Appendix} |
| 42 |
|
| 43 |
|
| 44 |
\pgfdeclarelayer{background} |
| 45 |
\pgfsetlayers{background,main} |
| 46 |
\selectcolormodel{cmyk} |
| 47 |
|
| 48 |
\newcommand{\tikzname}{Ti\emph{k}Z\xspace} |
| 49 |
|
| 50 |
\newcommand{\varg}[1]{% |
| 51 |
{\ttfamily\char`\{}#1{\ttfamily\char`\}}} |
| 52 |
\newcommand{\DescribeOption}[1]{\leavevmode |
| 53 |
\marginpar{\raggedleft\strut\MacroFont\string #1\ }} |
| 54 |
|
| 55 |
\lstdefinestyle{example}{style=tcblatex, |
| 56 |
classoffset=0, |
| 57 |
texcsstyle=*\color{blue},% |
| 58 |
deletetexcs={begin,end}, |
| 59 |
moretexcs={,% |
| 60 |
pgfdeclarehorizontalshading,pgfuseshading,node, |
| 61 |
useasboundingbox,draw}% |
| 62 |
classoffset=1, |
| 63 |
keywordstyle=\color{blue},% |
| 64 |
morekeywords={tikzpicture,shade,fill,draw,path,node,child,line,width,rectangle,minimum width,minimum size}, |
| 65 |
classoffset=0} |
| 66 |
|
| 67 |
\tcbset{% |
| 68 |
fillbackground/.style={before lower pre={% |
| 69 |
\tikzset{every picture/.style={execute at end picture={\begin{pgfonlayer}{background} |
| 70 |
\fill[yellow!15] |
| 71 |
([xshift=-4mm,yshift=-4mm]current bounding box.south west) rectangle |
| 72 |
([xshift=4mm,yshift=4mm]current bounding box.north east); |
| 73 |
\end{pgfonlayer}}}}}}, |
| 74 |
explicitpicture/.style={before lower=\begin{center},after lower=\end{center},fillbackground}} |
| 75 |
|
| 76 |
\newtcblisting{codeexample}[2][]{% |
| 77 |
enhanced,frame hidden, |
| 78 |
top=0pt,bottom=0pt,left=0pt,right=0pt,arc=0pt,boxrule=0pt, |
| 79 |
colback=blue!15, |
| 80 |
listing style=example, |
| 81 |
sidebyside,text and listing,text outside listing,sidebyside gap=2mm, |
| 82 |
lefthand width=#2,tikz lower,fillbackground, |
| 83 |
#1} |
| 84 |
|
| 85 |
\title{\tikz{\node[graduate,shield,sword,minimum height=2cm]{}}\\The \textsf{tikzpeople} package} |
| 86 |
\author{Nils Fleischhacker} |
| 87 |
\date{} |
| 88 |
|
| 89 |
\begin{document} |
| 90 |
\maketitle |
| 91 |
|
| 92 |
\begin{abstract} |
| 93 |
This package provides people shaped pgf-shapes to be used in \tikzname pictures. |
| 94 |
Given that the the only thing this package does is providing new node shapes for \tikzname, it should probably be a \tikzname library. |
| 95 |
It isn't, it's a package instead, so deal with it. |
| 96 |
|
| 97 |
The package probably has many problems and is nowhere near optimal, but if you find it useful, feel free to use it anyway. |
| 98 |
\end{abstract} |
| 99 |
|
| 100 |
\section{Introduction} |
| 101 |
Let me start with a word of warning: |
| 102 |
The node-shapes defined by this package are heavily influenced by a type of clip art included in the \textsf{Microsoft Visio} software. |
| 103 |
I am by no means an expert on copyright law and as such can make no claim under which circumstances using these shapes might infringe on Microsoft's copyright. |
| 104 |
I do not expect that there are any problems, but be aware of this. |
| 105 |
Let's consider this package an homage to the great design of those \textsf{Visio} clip arts and get on with our lives. |
| 106 |
\subsection{Intended Usecase} |
| 107 |
If you are confused about any of the packages design choices, the original use-case the package was written for might serve as an explanation. |
| 108 |
The package was originally written to provide me with shapes of people to depict parties in cryptographic protocols and security definitions on beamer slides. |
| 109 |
An example of this can be seen in \autoref{fig:protocolexample}. |
| 110 |
\begin{figure} |
| 111 |
\begin{tikzpicture}[font=\small] |
| 112 |
\node[businessman,female,minimum size=1.5cm] (A) {}; |
| 113 |
\node[police,right=3cm of A,minimum size=1.5cm,mirrored] (B) {}; |
| 114 |
\node[anchor=north east] at (A.north west) (a2) {$(\mathsf{com},\mathsf{dec}) \gets \mathsf{Com}(a)$}; |
| 115 |
\node[anchor=south] at (a2.north) (a1) {$a\gets\{0,1\}$}; |
| 116 |
\node[anchor=south west] at (B.south east){$a \gets \mathsf{Opn}(\mathsf{com},\mathsf{dec})$}; |
| 117 |
\draw (A.35) edge[->] node[above] {$\mathsf{com}$} (B.145); |
| 118 |
\node[anchor=south west] at (B.east |- B.180) {$b\gets\{0,1\}$}; |
| 119 |
\draw (A.0) edge[<-] node[above] {$b$} (B.180); |
| 120 |
\draw (A.325) edge[->] node[above] {$\mathsf{dec}$} (B.215); |
| 121 |
\draw (A.270) ++(0,-.5) node {$a\oplus b$} edge[<-] (A.270); |
| 122 |
\draw (B.270) ++(0,-.5) node {$a\oplus b$} edge[<-] (B.270); |
| 123 |
\end{tikzpicture} |
| 124 |
\caption{A secure coin flipping protocol constructed from bit commitment.} |
| 125 |
\label{fig:protocolexample} |
| 126 |
\end{figure} |
| 127 |
If this intended use-case does not resolve your confusion with any weird behavior or design choice, then chances are good that I made a mistake or just did not know any better. |
| 128 |
If you spot a mistake or know how to do something in a saner way, shoot me a message to let me know. |
| 129 |
|
| 130 |
\subsection{Installation} |
| 131 |
To install the package just drop the \textsf{tikzpeople.sty} file and all the shape files, i.e. \textsf{tikzpeople.shape.\meta{shapename}.sty}, somewhere \LaTeX can find them. |
| 132 |
You might for example put them in your local \textsf{texmf} tree at \url{\textasciitilde/texmf/tex/latex/tikzpeople/}. |
| 133 |
Alternatively simply drop all the files into the folder where your main \textsf{.tex} file resides.\footnote{Do not use a subfolder. While you can refer to the package itself in a hackish way using a relative path, \LaTeX wont be able to find the shape files.} |
| 134 |
|
| 135 |
\section{Usage} |
| 136 |
To use the \textsf{tikzpeople} shapes, just write |\usepackage|\oarg{options}\varg{tikzpeople} somewhere in the preamble of your document. |
| 137 |
\subsection{Package Options} |
| 138 |
The package has three global options. |
| 139 |
\DescribeOption{draft} |
| 140 |
Compiling a document with many \textsf{tikzpeople} nodes can be very slow. |
| 141 |
This is especially true for some of the node shapes that make heavy use of \tikzname decorations. |
| 142 |
To make documents compile faster during the drafting stage, the |draft| option is available. |
| 143 |
In draft mode all \textsf{tikzpeople} nodes are only drawn as simple outlines. |
| 144 |
\makeatletter |
| 145 |
\let\listbackup\tikzpeople@shapelist |
| 146 |
\@tikzpeople@drafttrue |
| 147 |
\let\tikzpeople@alice@paint\relax |
| 148 |
\let\tikzpeople@alice@painthair\relax |
| 149 |
\let\tikzpeople@alice@paintshirtdetails\relax |
| 150 |
\let\tikzpeople@alice@definecolors\relax |
| 151 |
\let\tikzpeople@alice@definestyles\relax |
| 152 |
\let\tikzpeople@alice@colors\relax |
| 153 |
\tikzpeople@declareshape{alice} |
| 154 |
\begin{codeexample}{3cm} |
| 155 |
\node[alice,minimum size=1.5cm] {Alice}; |
| 156 |
\end{codeexample} |
| 157 |
\@tikzpeople@draftfalse |
| 158 |
\let\tikzpeople@alice@paint\relax |
| 159 |
\let\tikzpeople@alice@painthair\relax |
| 160 |
\let\tikzpeople@alice@paintshirtdetails\relax |
| 161 |
\let\tikzpeople@alice@definecolors\relax |
| 162 |
\let\tikzpeople@alice@definestyles\relax |
| 163 |
\let\tikzpeople@alice@colors\relax |
| 164 |
\tikzpeople@declareshape{alice} |
| 165 |
\let\tikzpeople@shapelist\listbackup |
| 166 |
\makeatother |
| 167 |
|
| 168 |
\DescribeOption{demo} |
| 169 |
The |demo| option loads the package in demo mode, introducing additional commands. |
| 170 |
These commands |\alltikzpeople| and |\tikzpeoplecolors| explained below are not meant for productive use. |
| 171 |
They are useful for showcasing the available shapes with different node options and getting information for customizing colors. |
| 172 |
|
| 173 |
\DescribeOption{nobeards} |
| 174 |
The |nobeards| option removes all beards from \textsf{tikzpeople} nodes. |
| 175 |
In particular, \textsf{tikzpeople} marked as evil no longer have goatees. |
| 176 |
This option exists because I have been informed that having evil \textsf{tikzpeople} with goatees is very insensitive and discriminatory against people with goatees. |
| 177 |
For a little bit of petty defiance, this option also removes Santa's beard. |
| 178 |
|
| 179 |
\DescribeOption{saturated} |
| 180 |
The \textsf{saturated} option causes all nodes to be rendered with saturated colors. |
| 181 |
Standard nodes are rendered with somewhat washed out colors. |
| 182 |
This works well on light backgrounds but can look weird on dark background. |
| 183 |
The |saturated| option can also be used on individual nodes. |
| 184 |
|
| 185 |
\subsection{Available Shapes} |
| 186 |
Once the package is loaded, any of the defined shapes can be used as the shape of any \tikzname node just like any other predefined shape. |
| 187 |
\begin{codeexample}{3cm} |
| 188 |
\node[draw,rectangle,minimum size=1.5cm] at (0,2) {}; |
| 189 |
\node[businessman,minimum size=1.5cm] at (0,0) {}; |
| 190 |
\end{codeexample} |
| 191 |
However, it should be noted that in many respects the nodes behave quite differently from standard node shapes. |
| 192 |
First, the nodes are drawn and filled, whether |draw| and |fill| are specified or not, because -- quite frankly -- if you do not want to draw the node, then the \textsf{tikzpeople} are quite useless to you. |
| 193 |
Another area where the behavior might be unexpected to the experienced \tikzname user is concerning the node text. |
| 194 |
\begin{codeexample}{3cm} |
| 195 |
\node[draw,rectangle,minimum size=1.5cm] at (0,2) {A Rectangle}; |
| 196 |
\node[businessman,minimum size=1.5cm] (B) at (0,0) {A Businessman}; |
| 197 |
\draw[gray,dotted] (B.north west) rectangle (B.south east); |
| 198 |
\end{codeexample} |
| 199 |
The text appears below the actual node, not within and the width of the text influence neither the drawn shape nor any of the border anchors. |
| 200 |
The reason for this is that in the intended usecase, the node text -- if present at all -- is simply a label and is not supposed to influence the size or behavior of the node. |
| 201 |
|
| 202 |
Another oddity of the tikzpeople shapes is that the border anchors and size of the node only takes into consideration the underlying shape of a person, and nothing of the -- sometimes much larger -- stuff such as hats added by some of the shapes. |
| 203 |
\begin{codeexample}{3cm} |
| 204 |
\node[person,minimum size=1.5cm] (B) at (0,4) {A Person}; |
| 205 |
\draw[gray,dotted] (B.north west) rectangle (B.south east); |
| 206 |
\node[mexican,minimum size=1.5cm] (M) at (0,0) {A Mexican}; |
| 207 |
\draw[gray,dotted] (M.north west) rectangle (M.south east); |
| 208 |
\end{codeexample} |
| 209 |
Again, the reason for this is that two shapes specified to have the same size, should behave like two people of same size. |
| 210 |
If for example \texttt{minimum width} would take the actual width into consideration, then the Mexican would be much smaller than the person. |
| 211 |
|
| 212 |
While all of these oddities are useful to me and in my specific usecase, they may cause problem for you in any number of ways. |
| 213 |
So if you don't think you will be able to cope with them, I suggest you stop reading and look elsewhere for people-shaped \tikzname nodes. |
| 214 |
|
| 215 |
\subsection{The Available Shapes} |
| 216 |
\DescribeMacro{\alltikzpeople} If the package is loaded with the |demo| option, all provided shapes can easily be viewed using the |\alltikzpeople|\allowbreak\marg{width}\allowbreak\marg{options} command. |
| 217 |
The command takes two arguments. |
| 218 |
The first argument specifies the |minimum size| of the drawn nodes in centimeters, the second argument is a comma separated list of options passed to each node. |
| 219 |
The command then produces figures such as \autoref{fig:tikzpeoplefigure1} and \autoref{fig:tikzpeoplefigure2}, which were produces using the command |\alltikzpeople|\varg{1.5}\varg{} |
| 220 |
\DescribeMacro{\alltikzpeople*} The starred version of the command does exactly the same but omits the name of the shapes. |
| 221 |
\alltikzpeople{1.5}{} |
| 222 |
\subsection{General Node Options} |
| 223 |
A number of options can be used to influence the appearance of \textsf{tikzpeople}. |
| 224 |
These options are explained here in alphabetical order. |
| 225 |
Not all nodes are affected by all options. |
| 226 |
This is the case if the option is either simply not applicable or if I have not found a way to make is look not weird. |
| 227 |
|
| 228 |
\DescribeOption{evil} The |evil| option is supposed to make nodes look more evil than usual. |
| 229 |
For most tikzpeople this is accomplished by adding horns and a goatee. |
| 230 |
\begin{codeexample}{3.2cm} |
| 231 |
\node[priest,minimum size=1cm,xshift=-1.2cm]{}; |
| 232 |
\node[priest,evil,minimum size=1cm] {}; |
| 233 |
\end{codeexample} |
| 234 |
This is especially useful to depict attackers in a cryptographic or security setting. |
| 235 |
Unaffected by this option are: \texttt{guard,santa,devil}. |
| 236 |
The color of the horns is controlled with the |horns| key. |
| 237 |
|
| 238 |
\DescribeOption{female} The |female| option is supposed to make stereotypically male nodes look just a tad more feminine. |
| 239 |
For most tikzpeople this is accomplished by adding longer hair and losing the beard -- though surprisingly, evil women still tend to have a goatee. |
| 240 |
\begin{codeexample}{3.2cm} |
| 241 |
\node[conductor,minimum size=1cm,xshift=-1.2cm]{}; |
| 242 |
\node[conductor,female,minimum size=1cm]{}; |
| 243 |
\end{codeexample} |
| 244 |
This is useful to avoid being called sexist for not having women in you figures. |
| 245 |
On the other hand people can now accuse you of enforcing gender stereotypes. So have fun. |
| 246 |
Unaffected by this option are: \texttt{alice, bride, guard, judge, nun, pilot}. |
| 247 |
|
| 248 |
\DescribeOption{good} The |good| option is supposed to make nodes look extraordinarily good. |
| 249 |
For most tikzpeople this is accomplished by adding a halo. |
| 250 |
\begin{codeexample}{3.2cm} |
| 251 |
\node[sailor,minimum size=1cm,xshift=-1.2cm]{}; |
| 252 |
\node[sailor,good,minimum size=1cm]{}; |
| 253 |
\end{codeexample} |
| 254 |
This could be useful to, e.g., depict a trusted party in a security context. |
| 255 |
Unaffected by this option are: \texttt{guard, mexican, santa}. |
| 256 |
The color of the halo is controlled with the |halo| key. |
| 257 |
|
| 258 |
\DescribeOption{mirrored} The \textsf{mirrored} option makes nodes face to the left instead of the right. |
| 259 |
\begin{codeexample}{3.2cm} |
| 260 |
\node[graduate,minimum size=1cm,xshift=-1.2cm]{}; |
| 261 |
\node[graduate,mirrored,minimum size=1cm]{}; |
| 262 |
\end{codeexample} |
| 263 |
I'm sure you will figure out the usefulness of this option on you own. |
| 264 |
|
| 265 |
\DescribeOption{monitor} The \textsf{monitor} option draws a monitor in front of the node. |
| 266 |
\begin{codeexample}{4cm} |
| 267 |
\node[judge,minimum size=1cm,xshift=-1.2cm]{}; |
| 268 |
\node[judge,monitor,minimum size=1cm]{}; |
| 269 |
\end{codeexample} |
| 270 |
This could be useful to emphasize that parties are actually using a computer and not doing complex computations in their head. |
| 271 |
|
| 272 |
\DescribeOption{saturated} The \textsf{saturated} option causes the node to be rendered with saturated colors. |
| 273 |
\begin{codeexample}{3.2cm} |
| 274 |
\node[pilot,minimum size=1cm,xshift=-1.2cm]{}; |
| 275 |
\node[pilot,saturated,minimum size=1cm]{}; |
| 276 |
\end{codeexample} |
| 277 |
Standard nodes are rendered with somewhat washed out colors. |
| 278 |
This works well on light backgrounds but can look weird on dark background. |
| 279 |
The |saturated| option can also be used as a global package option. |
| 280 |
|
| 281 |
\DescribeOption{shield} The \textsf{shield} option gives the node a shield. |
| 282 |
\begin{codeexample}{4cm} |
| 283 |
\node[alice,minimum size=1cm,xshift=-1.2cm]{}; |
| 284 |
\node[alice,shield,minimum size=1cm]{}; |
| 285 |
\end{codeexample} |
| 286 |
This could be useful to symbolize that a party is defending something and combines well with the |sword| option. |
| 287 |
The colors of the shield are controlled using the keys |shieldmid|, |shieldedge|, and |shieldrivets|. |
| 288 |
|
| 289 |
\DescribeOption{sword} The \textsf{sword} option gives the node a sword. |
| 290 |
\begin{codeexample}{4cm} |
| 291 |
\node[dave,minimum size=1cm,xshift=-1.2cm]{}; |
| 292 |
\node[dave,sword,minimum size=1cm]{}; |
| 293 |
\end{codeexample} |
| 294 |
This could be useful to symbolize that a party is attacking or defending something and combines well with the |shield| option. |
| 295 |
The colors of the sword are controlled using the keys |swordblade|, |swordguard|, |swordpommel|, and |swordgrip|. |
| 296 |
|
| 297 |
All of these options can be arbitrarily combined. So, e.g., |good| \textsf{tikzpeople} can very well be |evil| at the same time. |
| 298 |
\begin{codeexample}{4cm} |
| 299 |
\node[chef,evil,female,good,mirrored,monitor, |
| 300 |
saturated,shield,sword,minimum size=1.5cm]{}; |
| 301 |
\end{codeexample} |
| 302 |
\subsection{Color Options} |
| 303 |
Almost all the colors used in the \textsf{tikzpeople} shapes can be specified separately. |
| 304 |
So if you feel, that you do not need a simple priest, but a cardinal instead, just take the priest, make the shirt and hat red and give him gray hair and we have a decent approximation of a cardinal.\footnote{In my defense, I'm not catholic, so I might be missing something crucial about cardinals. Rest assured that I meant no disrespect.} |
| 305 |
\begin{codeexample}{3cm} |
| 306 |
\node[priest, shirt=red, hat=red, hair=gray, minimum size=1.5cm]{}; |
| 307 |
\end{codeexample} |
| 308 |
Similarly, maybe what we actually need is a monk.\footnote{Again, I do not know much about monks...} |
| 309 |
\begin{codeexample}{3cm} |
| 310 |
\node[priest,shirt=brown, hat=skin, cross=gray, collar=brown, minimum size=1.5cm]{}; |
| 311 |
\end{codeexample} |
| 312 |
What I'm trying to get across is, using changes in coloring, we get tons of additional options for different kinds of \textsf{tikzpeople} we can draw. |
| 313 |
|
| 314 |
\DescribeMacro{\tikzpeoplecolors} If the package is loaded with the |demo| option, you can use the command |\tikzpeoplecolors|\marg{shapename} to produce a figure giving you an idea, which color keys can be used for which shape. |
| 315 |
For your convenience, all of those figures are included in \autoref{app:colors}. |
| 316 |
|
| 317 |
\subsection{Text Options} |
| 318 |
Some \textsf{tikzpeople} have include customizable text, such as the |businessman|'s monogram. |
| 319 |
These texts can be specified with pgfkeys just as with the color options. |
| 320 |
\vspace{.75em} |
| 321 |
\begin{codeexample}{3cm} |
| 322 |
\path [clip] (0cm,1cm) rectangle (1.5cm,-1cm); |
| 323 |
\node[businessman, monogramtext=ER ,minimum size=5cm]{}; |
| 324 |
\end{codeexample} |
| 325 |
|
| 326 |
\vspace{1em} |
| 327 |
|
| 328 |
All texts are scaled to fit the available space. Specifying significantly longer text will therefore cause it to be unreadable. |
| 329 |
|
| 330 |
\DescribeOption{monogramtext} The |monogramtext| option is available for |businessman| shapes and changes the text of the monogram. |
| 331 |
While you can change the monogram to any arbitrary text, you should be aware that the monogram is rendered as |\mathcal| and anything except for uppercase letters will probably lead to unexpected results. |
| 332 |
|
| 333 |
\DescribeOption{badgetext} The |badgetext| option is available for |nurse| shapes and changes the text printed on the badge. |
| 334 |
|
| 335 |
\subsection{Anchors} |
| 336 |
\tikzset{shape example/.style={color=black!30, draw, fill=yellow!30, minimum size=3cm}} |
| 337 |
\begin{figure}[htp] |
| 338 |
\centering |
| 339 |
\begin{tikzpicture} |
| 340 |
\node[name=s,shape=businessman,minimum width=3cm,skin=yellow!30!,hair=black!30!,tie=black!30!,undershirt=yellow!30!,shirt=black!30!,monogram=black!30!] {Businessman\vrule width 1pt height 2cm}; |
| 341 |
\foreach \anchor/\placement in |
| 342 |
{north west/above left, north/above, north east/above right, |
| 343 |
west/left, center/above, east/right, |
| 344 |
mid west/above left, mid/above, mid east/above right, |
| 345 |
base west/left, base/below, base east/right, |
| 346 |
south west/below left, south/below, south east/below right, |
| 347 |
text/below left, 10/right, 20/right, 30/right, 40/right, 130/left, |
| 348 |
160/left, 190/left, mouth/above} |
| 349 |
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} |
| 350 |
node[\placement] {\scriptsize\texttt{(s.\anchor)}}; |
| 351 |
\end{tikzpicture} |
| 352 |
\caption{Anchors of a \texttt{businessman} tikzpeople shape.} |
| 353 |
\label{fig:anchors1} |
| 354 |
\end{figure} |
| 355 |
\begin{figure}[htp] |
| 356 |
\centering |
| 357 |
\begin{tikzpicture} |
| 358 |
\node[name=s,shape=guard,minimum width=3cm,skin=yellow!30!,hat=black!30!,lining=yellow!30!,details=yellow!30!,shirt=black!30!,collar=black!30!] {Guard\vrule width 1pt height 2cm}; |
| 359 |
\foreach \anchor/\placement in |
| 360 |
{north west/above left, north/above, north east/above right, |
| 361 |
west/left, center/above, east/right, |
| 362 |
mid west/above left, mid/above, mid east/above right, |
| 363 |
base west/left, base/below, base east/right, |
| 364 |
south west/below left, south/below, south east/below right, |
| 365 |
text/below left, 10/right, 20/right, 30/right, 40/right, 130/left, |
| 366 |
160/left, 190/left, mouth/above} |
| 367 |
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} |
| 368 |
node[\placement] {\scriptsize\texttt{(s.\anchor)}}; |
| 369 |
\end{tikzpicture} |
| 370 |
\caption{Anchors of a \texttt{guard} tikzpeople shape.} |
| 371 |
\label{fig:anchors2} |
| 372 |
\end{figure} |
| 373 |
Basically all standard anchors for nodes exist also for tikzpeople nodes. |
| 374 |
However, as mentioned before, most of them are not influenced by the node text. |
| 375 |
Basically the only anchors that depend on the node text are the |text|, |base|, and |mid| anchors. |
| 376 |
Furthermore, the anchors only take into account the basic shape of the person, not any of the -- possibly much larger -- additions such as hats. |
| 377 |
As a reference, \autoref{fig:anchors1} and \autoref{fig:anchors2} show all the anchors of |businessman| and |guard| nodes. |
| 378 |
|
| 379 |
A special anchor is the |mouth| anchor. In conjunction with \tikzname's |callout| shapes this anchor allows to easily depict talking \textsf{tikzpeople}.. |
| 380 |
\begin{codeexample}{4.6cm} |
| 381 |
\node[name=a,shape=police,minimum size=1cm,xshift=-1.25cm] {}; |
| 382 |
\node[name=b,shape=criminal,minimum size=1cm,mirrored,xshift=1.25cm] {}; |
| 383 |
\node[ellipse callout, draw,yshift= .3cm, callout absolute pointer={(a.mouth)}, font=\tiny] {Hey!}; |
| 384 |
\node[ellipse callout, draw, yshift=-.3cm, callout absolute pointer={(b.mouth)}, font=\tiny] {What?}; |
| 385 |
\end{codeexample} |
| 386 |
|
| 387 |
\subsection{Messing with PGF Internals} |
| 388 |
When using several of the |decoration| heavy \textsf{tikzpeople}, the package runs into errors in the internals of |pgf|. |
| 389 |
Namely into ``Dimension to large'' errors in the |\pgfmath@function@veclen| command. |
| 390 |
Apparently this happens because we are working with numbers that are too small. |
| 391 |
As per this \TeX-stackexchange answer \url{http://tex.stackexchange.com/a/20888/15636}, \textsf{tikzpeople} redeclares |\pgfmath@function@veclen| with a fixed version. |
| 392 |
|
| 393 |
|
| 394 |
\clearpage |
| 395 |
\begin{appendices} |
| 396 |
\section{Color Options} |
| 397 |
\label{app:colors} |
| 398 |
\tikzpeoplecolors{alice} |
| 399 |
\vfill\tikzpeoplecolors{bob} |
| 400 |
\vfill\tikzpeoplecolors{bride} |
| 401 |
\vfill\tikzpeoplecolors{builder} |
| 402 |
\vfill\tikzpeoplecolors{businessman} |
| 403 |
\vfill\tikzpeoplecolors{charlie} |
| 404 |
\vfill\tikzpeoplecolors{chef} |
| 405 |
\vfill\tikzpeoplecolors{conductor} |
| 406 |
\vfill\tikzpeoplecolors{cowboy} |
| 407 |
\vfill\tikzpeoplecolors{criminal} |
| 408 |
\vfill\tikzpeoplecolors{dave} |
| 409 |
\vfill\tikzpeoplecolors{devil} |
| 410 |
\vfill\tikzpeoplecolors{duck} |
| 411 |
\vfill\tikzpeoplecolors{graduate} |
| 412 |
\vfill\tikzpeoplecolors{groom} |
| 413 |
\vfill\tikzpeoplecolors{guard} |
| 414 |
\vfill\tikzpeoplecolors{jester} |
| 415 |
\vfill\tikzpeoplecolors{judge} |
| 416 |
\vfill\tikzpeoplecolors{maninblack} |
| 417 |
\vfill\tikzpeoplecolors{mexican} |
| 418 |
\vfill\tikzpeoplecolors{nun} |
| 419 |
\vfill\tikzpeoplecolors{nurse} |
| 420 |
\vfill\tikzpeoplecolors{physician} |
| 421 |
\vfill\tikzpeoplecolors{pilot} |
| 422 |
\vfill\tikzpeoplecolors{police} |
| 423 |
\vfill\tikzpeoplecolors{priest} |
| 424 |
\vfill\tikzpeoplecolors{sailor} |
| 425 |
\vfill\tikzpeoplecolors{santa} |
| 426 |
\vfill\tikzpeoplecolors{surgeon} |
| 427 |
\end{appendices} |
| 428 |
\end{document} |
| 429 |
|