Debian Codegraph @

texmf-dist/tex/latex/tikzlings/tikzlings-apes.sty

raw
1 % !TeX root = ./examples/ape.tex
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %%
4 %% This package is part of the TikZlings package
5 %% A package to bring cute little animals and other beings into tikz
6 %% Maintained by samcarter
7 %%
8 %% Project repository and bug tracker:
9 %% https://github.com/samcarter/tikzlings
10 %%
11 %% Released under the LaTeX Project Public License v1.3c or later
12 %% See https://www.latex-project.org/lppl.txt
13 %%
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 \ProvidesPackage{tikzlings-apes}[2025/12/11 version v2.5 Drawing apes in TikZ]
16
17 \RequirePackage{tikz}
18 \RequirePackage{tikzlings-addons}
19
20 \newcommand*{\ape}[1][]{%
21 \begin{scope}%
22 \tikzset{/ape/.cd,#1}%
23 \ape@draw%
24 \end{scope}%
25 \thing[#1]%
26 % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 \UseHook{tikzlings/ape/foreground}
28 \UseHook{tikzlings/foreground}
29 \csname apehookforeground\endcsname
30 \csname tikzlinghookforeground\endcsname
31 }
32
33 \newif\ifape@threeD
34 \newif\ifape@handposition@hearnoevil
35 \newif\ifape@handposition@seenoevil
36 \newif\ifape@handposition@speaknoevil
37 \newif\ifape@handposition@clap
38 \newif\ifape@handposition@waving
39 \newif\ifape@back
40 \newif\ifape@contour
41 \newif\ifape@openmouth
42
43 \NewHook{tikzlings/ape/background}
44 \NewHook{tikzlings/ape/belly}
45 \NewHook{tikzlings/ape/body}
46 \NewHook{tikzlings/ape/foreground}
47
48 \tikzset{
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 %
51 % Pass unknown keys on to tikz
52 %
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 /ape/.search also={/tikz,/pgf,/thing},
55 /ape/.cd,
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %
58 % body
59 %
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 body/.store in = \ape@body,
62 body = red!15!brown!80!black,
63 eyes/.store in = \ape@eyes,
64 eyes = \ape@body!40!black,
65 eye/.forward to = /ape/eyes,
66 skin/.store in = \ape@skin,
67 skin = \ape@body!50!gray,
68 nose/.store in = \ape@nose,
69 nose = \ape@skin!60!black,
70 mouth/.store in = \ape@mouth,
71 mouth = \ape@skin!50!black,
72 muzzle/.store in = \ape@muzzle,
73 muzzle = \ape@skin!80!white,
74 legs/.store in = \ape@legs,
75 legs = \ape@body!90!black,
76 leg/.forward to = /ape/legs,
77 arms/.store in = \ape@arms,
78 arms = \ape@body!95!black,
79 arm/.forward to = /ape/arms,
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 %
82 % options
83 %
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 3D/.code = \ape@threeDtrue,
86 handposition/.code = \csname ape@handposition@#1true\endcsname,
87 kikazaru/.code = \ape@handposition@hearnoeviltrue,
88 mizaru/.code = \ape@handposition@seenoeviltrue,
89 iwazaru/.code = \ape@handposition@speaknoeviltrue,
90 %clap/.code = \ape@handposition@claptrue, %%% should we support this too?
91 %waving/.code = \ape@handposition@wavingtrue, %%% should we support this too?
92 hearnoevil/.code = \ape@handposition@hearnoeviltrue,
93 seenoevil/.code = \ape@handposition@seenoeviltrue,
94 speaknoevil/.code = \ape@handposition@speaknoeviltrue,
95 back/.code = \ape@backtrue,
96 openmouth/.code = \ape@openmouthtrue,
97 open mouth/.forward to = /ape/openmouth,
98 contour/.code = \ape@contourtrue
99 \def\ape@contour{#1}
100 \def\ape@mouth{#1},
101 contour/.default = black,
102 outline/.forward to = /ape/contour,
103 }
104
105 \def\ape@draw{%
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 %
108 % minimal bounding box size
109 %
110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 \path (-1.435,0.1) rectangle (1.435, 2.27);
112 %
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
114 %
115 % store the current scale factor
116 % from https://github.com/samcarter/tikzlings/issues/3#issuecomment-461373494
117 %
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
119 \pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}%
120 \pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))*sqrt(abs((\pgf@xx/1cm)*(\pgf@yy/1cm)-(\pgf@xy/1cm)*(\pgf@yx/1cm)))}%
121 \pgfmathsetmacro{\xscalefactor}{\tmpscaleA}
122 \pgfmathsetmacro{\yscalefactor}{\tmpscaleD}
123 %
124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125 %
126 % switch between 2D, 3D and contours, from
127 % https://chat.stackexchange.com/transcript/message/45991801#45991801
128 %
129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
130 \ifape@threeD
131 \def\ape@part@draw[##1]{\shade[ball color=##1]}
132 \else% 3D
133 \ifape@contour
134 \def\ape@part@draw[##1]{\draw[##1,\ape@contour,fill=white,line width=\scalingfactor*0.4pt]}
135 \else% contour
136 \def\ape@part@draw[##1]{\fill[##1]}
137 \fi% contour
138 \fi% 3D
139 %
140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
141 %
142 % Body parts
143 %
144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145 %
146 % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
147 \UseHook{tikzlings/ape/background}
148 \UseHook{tikzlings/background}
149 \csname apehookbackground\endcsname
150 \csname tikzlinghookbackground\endcsname
151 %
152 % Draw backside partially in reversed order %%%%%%%%%%%%%%%%%%%%%%%%
153 \ifape@back
154 % arms / hand for hear-no-evil pose backside %%%%%%%%%%%%%%%%%%%%%
155 \ifape@handposition@hearnoevil%
156 \ape@part@draw[\ape@skin!90!white] (-0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=80];
157 \ape@part@draw[\ape@arms] (-0.55,1.73) {[rotate=-20] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
158 \ape@part@draw[\ape@arms] (-0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=-125];
159 \ape@part@draw[\ape@skin!90!white] (0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=100];
160 \ape@part@draw[\ape@arms] (0.55,1.73) {[rotate=20] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
161 \ape@part@draw[\ape@arms] (0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=125];
162 % see-no-evil pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163 \else\ifape@handposition@seenoevil%
164 \ape@part@draw[\ape@skin!90!white] (-0.325,1.91) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
165 \ape@part@draw[\ape@arms] (-0.59,1.97) arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15] --cycle;
166 \ape@part@draw[\ape@arms] (-0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=70];
167 \ape@part@draw[\ape@skin!90!white] (0.325,1.91) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
168 \ape@part@draw[\ape@arms] (0.59,1.97) arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15] --cycle;
169 \ape@part@draw[\ape@arms] (0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=110];
170 % speak-no-evil pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
171 \else\ifape@handposition@speaknoevil%
172 \ape@part@draw[\ape@arms] (-0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=-100];
173 \ape@part@draw[\ape@skin!90!white] (-0.275,1.46) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
174 \ape@part@draw[\ape@arms] (-0.53,1.52) {[rotate=-10] arc [start angle=15, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
175 \ape@part@draw[\ape@arms] (0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=100];
176 \ape@part@draw[\ape@skin!90!white] (0.275,1.46) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
177 \ape@part@draw[\ape@arms] (0.53,1.52) {[rotate=10] arc [start angle=165, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
178 % clapping hand pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 \else\ifape@handposition@clap%
180 \ape@part@draw[\ape@skin!90!white] (-0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=80];
181 \ape@part@draw[\ape@arms] (-0.23,2.65) {[rotate=10] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
182 \ape@part@draw[\ape@arms] (-0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=30];
183 \ape@part@draw[\ape@skin!90!white] (0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=100];
184 \ape@part@draw[\ape@arms] (0.23,2.65) {[rotate=-10] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
185 \ape@part@draw[\ape@arms] (0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=150];
186 % waving left hand pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
187 \else\ifape@handposition@waving%
188 \ape@part@draw[\ape@arms] (-0.53,1.115) {[rotate=5] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
189 \ape@part@draw[\ape@arms] (-0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=-60];
190 \ape@part@draw[\ape@skin!90!white] (0.97,3.2) ++(390:0.3 and 0.1) {[rotate=90] arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle};
191 \ape@part@draw[\ape@arms] (1.35,2.74) {[rotate=100] arc [start angle=335, end angle=25,x radius=0.475, y radius=0.15]} --cycle;
192 \ape@part@draw[\ape@arms] (0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=-70];
193 % default pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194 \else
195 \ape@part@draw[\ape@arms] (-0.53,1.115) {[rotate=5] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
196 \ape@part@draw[\ape@arms] (-0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=-60];
197 \ape@part@draw[\ape@arms] (0.53,1.115) {[rotate=-5] arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
198 \ape@part@draw[\ape@arms] (0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=60];
199 \fi\fi\fi\fi\fi
200 %
201 % legs / feet backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
202 \ape@part@draw[\ape@skin] (1.2,0.27) ++(210:0.3 and 0.1) {[rotate=180] arc [start angle=210, end angle=-30,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=-30, end angle=-240,x radius=0.15, y radius=0.03]}-- cycle};
203 \ape@part@draw[\ape@legs] (0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=-30];
204 \ape@part@draw[\ape@legs] (0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=-45];
205 \ape@part@draw[\ape@skin] (-1.2,0.27) ++(-30:0.3 and 0.1) {[rotate=180] arc [start angle=-30, end angle=210,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=210, end angle=420,x radius=0.15, y radius=0.03]}-- cycle};
206 \ape@part@draw[\ape@legs] (-0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=30];
207 \ape@part@draw[\ape@legs] (-0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=45];
208 %
209 % head backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210 \ape@part@draw[\ape@body] (0, 1.76) circle[x radius=0.4,y radius=0.5];
211 \fi% back
212 %
213 % Body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214 \ape@part@draw[\ape@body] ( 0.5, 0.8 ) .. controls ( 0.5 , 0.4) and ( 0.35, 0.17) .. ( 0.0, 0.17) .. controls (-0.35, 0.17) and (-0.5 , 0.4) .. (-0.5, 0.8 ) .. controls (-0.9 , 1.6) and (-0.4, 1.65) .. ( 0.0, 1.65) .. controls ( 0.4, 1.65) and ( 0.9 , 1.6) .. ( 0.5, 0.8) -- cycle;
215 %
216 % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217 \UseHook{tikzlings/ape/belly}
218 \UseHook{tikzlings/belly}
219 \csname apehookbelly\endcsname
220 \csname tikzlinghookbelly\endcsname
221 %
222 % Show details only from the front %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
223 \unless\ifape@back
224 % Head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225 \ape@part@draw[\ape@body] (0, 1.76) circle[x radius=0.4,y radius=0.5];
226 \ape@part@draw[\ape@skin] (0, 1.76) circle[x radius=0.32,y radius=0.40];
227 %
228 % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
229 \ape@part@draw[\ape@eyes] (-0.08, 1.9) ellipse[x radius=0.04, y radius=0.04];
230 \ape@part@draw[\ape@eyes] (0.08, 1.9) ellipse[x radius=0.04, y radius=0.04];
231 %
232 % muzzle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
233 \ape@part@draw[\ape@muzzle] (0, 1.55) ellipse[x radius=0.28, y radius=0.2];
234 %
235 % mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236 \ifape@openmouth
237 \ifape@threeD
238 \fill[\ape@mouth] (0,1.5) ellipse[x radius=0.05,y radius=0.07];
239 \else
240 \ape@part@draw[\ape@mouth] (0,1.5) ellipse[x radius=0.05,y radius=0.07];
241 \fi
242 \else
243 \draw[\ape@mouth,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2] ;
244 \fi
245 %
246 % Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247 \ifape@threeD
248 \fill[\ape@nose] (-0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=30 ];
249 \fill[\ape@nose] (0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=-30 ];
250 \else
251 \ape@part@draw[\ape@nose] (-0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=30 ];
252 \ape@part@draw[\ape@nose] (0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=-30 ];
253 \fi
254 %
255 % Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256 \ape@part@draw[\ape@skin] (0.675,0.2) ++(-30:0.3 and 0.1) arc [start angle=-30, end angle=210,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=210, end angle=420,x radius=0.15, y radius=0.03]}-- cycle;
257 \ape@part@draw[\ape@skin] (-0.675,0.2) ++(210:0.3 and 0.1) arc [start angle=210, end angle=-30,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=-30, end angle=-240,x radius=0.15, y radius=0.03]}-- cycle;
258 %
259 % Legs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 \ape@part@draw[\ape@legs] (0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=-45];
261 \ape@part@draw[\ape@legs] (0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=-30];
262 \ape@part@draw[\ape@legs] (-0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=45];
263 \ape@part@draw[\ape@legs] (-0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=30];
264 %
265 % hear-no-evil pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 \ifape@handposition@hearnoevil
267 \ape@part@draw[\ape@arms] (-0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=-125];
268 \ape@part@draw[\ape@skin!90!white] (-0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=80];
269 \ape@part@draw[\ape@arms] (-0.55,1.73) {[rotate=-20] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
270 \ape@part@draw[\ape@arms] (0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=125];
271 \ape@part@draw[\ape@skin!90!white] (0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=100];
272 \ape@part@draw[\ape@arms] (0.55,1.73) {[rotate=20] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
273 % see-no-evil pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274 \else\ifape@handposition@seenoevil
275 \ape@part@draw[\ape@arms] (-0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=70];
276 \ape@part@draw[\ape@skin!90!white] (-0.325,1.91) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
277 \ape@part@draw[\ape@arms] (-0.59,1.97) arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15] --cycle;
278 \ape@part@draw[\ape@arms] (0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=110];
279 \ape@part@draw[\ape@skin!90!white] (0.325,1.91) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
280 \ape@part@draw[\ape@arms] (0.59,1.97) arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15] --cycle;
281 % speak-no-evil pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
282 \else\ifape@handposition@speaknoevil%
283 \ape@part@draw[\ape@arms] (-0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=-100];
284 \ape@part@draw[\ape@skin!90!white] (-0.275,1.46) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
285 \ape@part@draw[\ape@arms] (-0.53,1.52) {[rotate=-10] arc [start angle=15, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
286 \ape@part@draw[\ape@arms] (0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=100];
287 \ape@part@draw[\ape@skin!90!white] (0.275,1.46) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
288 \ape@part@draw[\ape@arms] (0.53,1.52) {[rotate=10] arc [start angle=165, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
289 % clapping pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290 \else\ifape@handposition@clap%
291 \ape@part@draw[\ape@arms] (-0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=30];
292 \ape@part@draw[\ape@skin!90!white] (-0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=80];
293 \ape@part@draw[\ape@arms] (-0.23,2.65) {[rotate=10] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
294 \ape@part@draw[\ape@arms] (0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=150];
295 \ape@part@draw[\ape@skin!90!white] (0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=100];
296 \ape@part@draw[\ape@arms] (0.23,2.65) {[rotate=-10] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
297 % waving hand pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298 \else\ifape@handposition@waving%
299 \ape@part@draw[\ape@arms] (-0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=70];
300 \ape@part@draw[\ape@skin!90!white] (-0.97,3.2) ++(150:0.3 and 0.1) {[rotate=-90] arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle};
301 \ape@part@draw[\ape@arms] (-1.35,2.74) {[rotate=80] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
302 \ape@part@draw[\ape@arms] (0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=60];
303 \ape@part@draw[\ape@skin!90!white] (0.325,1.05) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
304 \ape@part@draw[\ape@arms] (0.53,1.115) {[rotate=-5] arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
305 % normal pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
306 \else
307 \ape@part@draw[\ape@arms] (-0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=-60];
308 \ape@part@draw[\ape@skin!90!white] (-0.325,1.05) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
309 \ape@part@draw[\ape@arms] (-0.53,1.115) {[rotate=5] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
310 \ape@part@draw[\ape@arms] (0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=60];
311 \ape@part@draw[\ape@skin!90!white] (0.325,1.05) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
312 \ape@part@draw[\ape@arms] (0.53,1.115) {[rotate=-5] arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
313 \fi\fi\fi\fi\fi%
314 \fi%
315 %
316 % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317 \UseHook{tikzlings/ape/body}
318 \UseHook{tikzlings/body}
319 \csname apehookbody\endcsname
320 \csname tikzlinghookbody\endcsname
321 }
322
323 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
324 %%
325 %% Documentation
326 %%
327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328 %\clearpage
329 %\section[Ape]{Sandra, the orangutan}
330 %
331 %\emph{The ape was kindly contributed by @NuzzleTOO. It is named after an orangutan who was freed from living alone in a zoo in Bueonos Aires and taken to a sanctuary for great apes after temporarily becoming legally a non-human person.}
332 %
333 %\subsection{Package name}
334 %
335 %\begin{tcolorbox}[title={Package usage}]
336 %\begin{samcode}
337 %\usepackage{tikzlings-apes}
338 %\end{samcode}
339 %\end{tcolorbox}
340 %
341 %\subsection{Basic Usage}
342 %
343 %\begin{tcblisting}{title={Basic ape}}
344 %\ape
345 %\end{tcblisting}
346 %
347 %\subsection{Options}
348 %
349 %The basic ape can be modified by changing its colour:
350 %\begin{tcblisting}{title={Body colour}}
351 %\ape[body=blue]
352 %\end{tcblisting}
353 %
354 %In addition to the colour of the body, the colour of various body parts can be adjusted:
355 %\begin{tcblisting}{title={Eye colour}}
356 %\ape[eyes=red]
357 %\end{tcblisting}
358 %\begin{tcblisting}{title={Nose colour}}
359 %\ape[nose=red]
360 %\end{tcblisting}
361 %\begin{tcblisting}{title={Mouth colour}}
362 %\ape[mouth=red]
363 %\end{tcblisting}
364 %\begin{tcblisting}{title={Muzzle colour}}
365 %\ape[muzzle=red]
366 %\end{tcblisting}
367 %\begin{tcblisting}{title={Skin colour}}
368 %\ape[skin=red]
369 %\end{tcblisting}
370 %\begin{tcblisting}{title={Arm colour}}
371 %\ape[arms=red]
372 %\end{tcblisting}
373 %\begin{tcblisting}{title={Leg colour}}
374 %\ape[legs=red]
375 %\end{tcblisting}
376 %
377 %The ape make can make use of it hands in different ways:
378 %\begin{tcblisting}{title={Clapping ape}}
379 %\ape[handposition=clap]
380 %\end{tcblisting}
381 %\begin{tcblisting}{title={Waving ape}}
382 %\ape[handposition=waving]
383 %\end{tcblisting}
384 %
385 %Including the gestures of the three mystic apes \textbf{Mizaru} (see no evil), \textbf{Kikazaru} (hear no evil) and \textbf{Iwazaru} (speak no evil):
386 %\begin{tcblisting}{title={See no evil}}
387 %\ape[handposition=seenoevil]
388 %\end{tcblisting}
389 %\begin{tcblisting}{title={hear no evil}}
390 %\ape[handposition=hearnoevil]
391 %\end{tcblisting}
392 %\begin{tcblisting}{title={speak no evil}}
393 %\ape[handposition=speaknoevil]
394 %\end{tcblisting}
395 % As shortcuts, these three apes are also available via
396 %\saminline|\ape[seenoevil]|, \saminline|\ape[hearnoevil]|, \saminline|\ape[speaknoevil]| and \saminline|\ape[mizaru]|, \saminline|\ape[kikazaru]|, \saminline|\ape[iwazaru]|.
397 %
398 %To see a hooting ape:
399 %\begin{tcblisting}{title={Hooting ape}}
400 %\ape[openmouth]
401 %\end{tcblisting}
402 %
403 %To view the ape from behind:
404 %\begin{tcblisting}{title={Back view}}
405 %\ape[back]
406 %\end{tcblisting}
407 %
408 %The key \saminline|3D| will make the ape 3-dimensional:
409 %\begin{tcblisting}{title={3D view}}
410 %\ape[3D]
411 %\end{tcblisting}
412 %
413 %And finally the \saminline|contour| key will only draw the outlines:
414 %\begin{tcblisting}{title={Contours}}
415 %\ape[contour=black]
416 %\end{tcblisting}