# Custom “human” shape for tikz

A question with a large mea culpa. I've tried thinking about how I would add this shape and I've come up completely empty. Not strong enough with Tex to even give it a shot.

I'm trying to put together a visual aid of people numbers in a particular area, so I imagine using something like

\begin{tikzpicture}[every node/.style={human,draw,fill=black}]
\node (sci) {scientist};
\node [right=1mm of sci] (sol) {gurus};
\node [right=1mm of sol] (joe) {workers};
\end{tikzpicture}


My question is: Is there simple shape that already exists (its not in the shapes library) that does something similar. or is this easily coded as a new shape in which case could some kind soul post it as an example or is there a simple way to combine two existing shapes into a new one (A basic version I'd be happy with would be a long-ish down ward pointing isoceles triangle with a circle on top).

Image of what I'm sort of after below. Thanks

As a worst case I could use lots of \includegraphics commands in nodes but that is likely to be the most manual approach and would prefer something else if a solution exists.

Update: Really tough to pick the answer for this one. I picked the one I went with in a hurry but there is a lot of material there for alternative ways to make this work.

I'd really like to thank all three responders for their help. Now if only I could get a shape definition too ... :-)

-

Do you really need tikz?

The marvosym package provides the commands \Gentsroom and Ladiesroom :

A good place to look for such common-use symbols is the comprehensive LaTeX symbol list.

-
Thanks @TVerron unfortunately I need to put several of them side by side and color them according to each category so that it shows numbers of people in groups. I'm not sure how I'd do that outside tikz, ... perhaps a table structure... will try it and revert –  Tahnoon Pasha Nov 26 '12 at 8:50
@TahnoonPasha These commands are usable in text mode, so you can definitely use them in nodes of a tikz picture, and use the standards commands you would use to control the size or color of the text of a node. –  T. Verron Nov 26 '12 at 9:03
That is extremely useful @TVerron. It may be a new question but is there an easy way to shade out half the image that you're aware of? e.g. If I'm using each figure to represent four people and I want to indicate 2 by using half a figure? –  Tahnoon Pasha Nov 26 '12 at 9:30
@TahnoonPasha : That would indeed make a new question. I must confess I have no idea how to do that, except maybe some low-level hacks if your symbol is tikz-defined and parametrized by its height. –  T. Verron Nov 26 '12 at 10:38
The author created a new question for the partial filling of the shape problem: tex.stackexchange.com/questions/84420/… –  JLDiaz Nov 27 '12 at 8:29

Well since you are using TikZ environment anyhow, then loading marvosym becomes redundant (though nothing wrong with that by the way)

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}
\begin{document}
\begin{tikzpicture}
\node[rounded corners=2pt,minimum height=1.3cm,minimum width=0.4cm,fill,below = 1pt of head] (body) {};
\draw[line width=1mm,round cap-round cap] ([shift={(2pt,-1pt)}]body.north east) --++(-90:6mm);
\draw[line width=1mm,round cap-round cap] ([shift={(-2pt,-1pt)}]body.north west)--++(-90:6mm);
\draw[thick,white,-round cap] (body.south) --++(90:5.5mm);
\end{tikzpicture}
\end{document}


then a little digression

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts}
\begin{document}
\begin{tikzpicture}[manstyle/.style={line width=4pt,line cap=round,line join=round}]
\node[fill,circle,inner sep=2.5pt,outer sep=1pt] (head) at (-0.2mm,7.1mm) {};
\node[above left,anchor=pointer,scale=0.4,cloud callout, cloud puffs=10, aspect=2, cloud puff arc=120,
fill,text=white,callout relative pointer={(-4mm,-4mm)}] at (2mm,8mm){$\displaystyle\int_\pi l(d,t)\mathrm{d}t$};
\draw[manstyle] (0,0.5) -- ++(0,-1.2cm);
\draw[manstyle] (-1.5pt,-1pt) -- ++(0,0.535cm) (1.2pt,1pt) --(0,5mm)--++(-80:5mm) coordinate (g);
\draw[-latex] (g) -| (-25:8mm);
\draw[|-|,ultra thin] ([shift={(1mm,2mm)}]g) --++ (5.15mm,0) node [midway,above,scale=0.5] {$l$};
\node[fill,minimum height=7mm,rounded corners=2pt,outer xsep=1pt,outer ysep=0] (syphon) at (1.1cm,-0.45cm) {};
\fill[rounded corners=1pt] (syphon.south west) |-++(140:7mm) coordinate (d) arc (180:230:4mm) |- (syphon.south west) --cycle;
\draw[|-|,ultra thin] (d)++(-0.1mm,0) --++ (-3.1mm,0) node[midway,above,scale=0.5] {$d$};
\node[font=\scshape, align=center] (motto) at (5mm,-1.5cm) {Gents \\ Do It With \\ Precision};
\end{tikzpicture}
\end{document}


-
The restrooms in my university need one of these :) –  henrique Nov 27 '12 at 23:43

An option if you're willing to includegraphics is to go to openclipart.org (or any other clip art site, download an icon in svg, convert it to pdf and simply include it. That's what I do for globes and such in my figures.

Update: To re-use the icon, you can define a new command:

\newcommand{\usericon}[1]{\includegraphics[width=#1\textwidth]{usericon}}


Then, wherever you want to put it, simply put it in a node like so:

\node (user) {\usericon{0.2}};

-
Thanks @recluze. Do you know if there is some way to put the \includegraphics into a \tikzset enivronment and then just call it in the style for each node? –  Tahnoon Pasha Nov 26 '12 at 9:25
Updated the answer :) –  recluze Nov 26 '12 at 11:31

Here is a basic version as per your description, and added an option to control the smiley:

## Code:

\documentclass{article}
\usepackage{tikz}

% http://tex.stackexchange.com/questions/58901/something-between-frownie-and-smiley
\newcommand{\Simley}[3][]{%
% #1 = draw options
% #2 = smile factor
% #3 = location
%\begin{tikzpicture}[scale=0.4]
\begin{scope}[shift={(#3)}, scale=0.4]
\draw [thick, fill=brown!10, #1] (0,0) circle (\SmileyRadius);% outside circle

\draw [fill=cyan,draw=none] (\eyeX,\eyeY) circle (0.15cm);
\draw [fill=cyan,draw=none] (-\eyeX,\eyeY) circle (0.15cm);

\pgfmathsetmacro{\xScale}{2*\eyeX/180}
\pgfmathsetmacro{\yScale}{1.0*\eyeY}
\draw[color=brown, thick, domain=-\eyeX:\eyeX]
plot ({\x},{
-0.1+#2*0.15 % shift the smiley as smile decreases
-#2*1.75*\yScale*(sin((\x+\eyeX)/\xScale))-\eyeY});
\end{scope}
%\end{tikzpicture}%
}%

\newcommand*{\Symbol}[3][]{%
% #1 = draw options
% #2 = smile factor
% #3 = location
%
\begin{scope}[shift={(#3)}]
%\draw [thick, fill=brown!25, #1] (0,0) circle (0.30cm);% Use this for no-smiley version
\Simley[#1]{#2}{0,0.1}% Comment this out if you don't want smiley
\draw [thick, fill=brown!10, #1]
(-0.4, -0.40) -- (0.4, -0.40) -- (0,-2.5) -- cycle;
\end{scope}%
}%

\begin{document}
\begin{tikzpicture}
\Symbol{1}{0,0}
\Symbol[draw=black, fill=red!25, ultra thick]{0.25}{1,0}
\Symbol[draw=blue, fill=green!20, ultra thick]{-1}{2,0}
\end{tikzpicture}
\end{document}

-
thanks @PeterGrill. If I want to put several \Symbol in a row or postion them above each other what would the correct coding be? –  Tahnoon Pasha Nov 26 '12 at 8:48
Have updated solution to show how to position them in a row. You can adjust the coordinate where they are placed to get them in a row. –  Peter Grill Nov 27 '12 at 1:17