diff options
author | Karl Berry <karl@freefriends.org> | 2019-04-07 21:21:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-04-07 21:21:35 +0000 |
commit | d71a23f77ba5aa8ad94858efe8080b2cc100bb25 (patch) | |
tree | 40b59b167bfa17b10adb5a738a32b0262986016a /Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty | |
parent | 1f825a1d4a63908fb04cf83a3f531201d2023847 (diff) |
tikzlings (7apr19)
git-svn-id: svn://tug.org/texlive/trunk@50841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty | 105 |
1 files changed, 78 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty index 649b2dc3841..fb15b687196 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty @@ -11,12 +11,12 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.1 -% Nov 9, 2018 +% Version 0.2 +% April 7, 2019 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesPackage{tikzlings-addons} - [2018/11/09 v0.1 Draw additional items for the tikzlings] + [2019/04/07 v0.2 Draw additional items for the tikzlings] \RequirePackage{tikz} \usetikzlibrary{patterns} % for the wizard hat @@ -57,6 +57,7 @@ \newif\ifthing@icecream \newif\ifthing@milkshake \newif\ifthing@wine +\newif\ifthing@cocktail % Sport %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newif\ifthing@cricket \newif\ifthing@hockey @@ -72,6 +73,9 @@ \newif\ifthing@crozier \newif\ifthing@shovel \newif\ifthing@pickaxe +\newif\ifthing@umbrella +\newif\ifthing@umbrellaclosed +\newif\ifthing@handbag \tikzset{% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -81,7 +85,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /thing/.search also={% /tikz,/pgf, - /bear,/coati,/koala,/marmot,/mouse,/owl,/penguin,/snowman,/mole,/sloth, + /bear,/coati,/koala,/marmot,/mouse,/owl,/penguin,/snowman,/mole,/sloth,/pig,/cat,/hippo,/rhino,/panda, }, %/thing/.unknown/.code=\relax, % bad idea, prevents tikz/pgf keys /thing/.cd, @@ -186,7 +190,7 @@ pizza/.code = \thing@pizzatrue, davidlikespineapplepizza/.code = \thing@davidlikespineapplepizzatrue \thing@speechtrue - \def\thing@speech{\scalebox{\yscalefactor}{\scalebox{0.9}{\tiny ih, che schifo!}}}, + \def\thing@speech{\scalebox{\scalingfactor}{\scalebox{0.9}{\tiny ih, che schifo!}}}, david likes pineapple pizza/.forward to = /thing/davidlikespineapplepizza, cheese/.code = \thing@cheesetrue \def\thing@cheese{#1}, @@ -216,6 +220,7 @@ wine/.code = \thing@winetrue \def\thing@wine{#1}, wine/.default = red!70!black, + cocktail/.code = \thing@cocktailtrue, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Sport @@ -276,19 +281,31 @@ shovel/.default = gray, pickaxe/.code = \thing@pickaxetrue \def\thing@pickaxe{#1}, - pickaxe/.default = gray, + pickaxe/.default = gray, + umbrella/.code = \thing@umbrellatrue + \def\thing@umbrella{#1}, + umbrella/.default = cyan, + umbrellaclosed/.code = \thing@umbrellaclosedtrue + \def\thing@umbrellaclosed{#1}, + umbrellaclosed/.default = cyan, + umbrella closed/.forward to = /thing/umbrellaclosed, + handbag/.code = \thing@handbagtrue + \def\thing@handbag{#1}, + handbag/.default = red!70!black, } \def\thing@draw{% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % store the current scale factor -% from https://tex.stackexchange.com/a/86900/36296 +% from https://github.com/samcarter/tikzlings/issues/3#issuecomment-461373494 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\pgfgettransformentries{\myxscale}{\@tempa}{\@tempa}{\myyscale}{\@tempa}{\@tempa} -\gdef\yscalefactor{\myyscale} -\gdef\xscalefactor{\myxscale} +\pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}% +\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))}% +\pgfmathsetmacro{\xscalefactor}{\tmpscaleA} +\pgfmathsetmacro{\yscalefactor}{\tmpscaleD} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -458,7 +475,7 @@ \fill[\thing@graduate,rotate=-15] (0.44,2.1) ellipse (0.37 and 0.1); \fill[\thing@graduate,rotate=-15] (0.07,2.1) rectangle (0.81,2.3); \fill[\thing@graduate] (0.3,2.25) -- (1.05,2.35) -- (1.7,1.95) -- (0.92,1.85) -- cycle; - \fill[\thing@tassel,rounded corners=\yscalefactor*1] (1.12,1.89) -- (1.01,2.1) -- (1.09,2.11) -- (1.2,1.9) -- (1.2,1.3) -- (1.12,1.3) -- cycle; + \fill[\thing@tassel,rounded corners=\scalingfactor*1] (1.12,1.89) -- (1.01,2.1) -- (1.09,2.11) -- (1.2,1.9) -- (1.2,1.3) -- (1.12,1.3) -- cycle; \fill[\thing@tassel] (1.16,1.3) ellipse (0.06 and 0.12); \end{scope} \fi @@ -489,9 +506,9 @@ % signpost %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifthing@signpost \begin{scope}[scale=1.7,xshift=-26,yshift=-7] - \fill[\thing@signcolour, rounded corners=\yscalefactor*1, rotate=-20] (0.8,0.75) rectangle (0.9,1.75); - \fill[\thing@signcolour, rounded corners=\yscalefactor*1, rotate=-20] (0.4,1.7) rectangle (1.3,2.4); - \fill[\thing@signback, rounded corners=\yscalefactor*1, rotate=-20] (0.45,1.75) rectangle (1.25,2.35); + \fill[\thing@signcolour, rounded corners=\scalingfactor*1, rotate=-20] (0.8,0.75) rectangle (0.9,1.75); + \fill[\thing@signcolour, rounded corners=\scalingfactor*1, rotate=-20] (0.4,1.7) rectangle (1.3,2.4); + \fill[\thing@signback, rounded corners=\scalingfactor*1, rotate=-20] (0.45,1.75) rectangle (1.25,2.35); \node[rotate=-20*\yscalefactor/\xscalefactor, color=white] at (1.5,1.65) {\thing@signpost}; \end{scope} \fi @@ -565,7 +582,7 @@ % baguette %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifthing@baguette \begin{scope}[xshift=-38,yshift=7,rotate=-20] - \fill[\thing@baguette!70!white, rounded corners=\yscalefactor*4, rotate=-30] (0.4,0.72) rectangle (0.7,2.0); + \fill[\thing@baguette!70!white, rounded corners=\scalingfactor*4, rotate=-30] (0.4,0.72) rectangle (0.7,2.0); \fill[\thing@baguette!80!black, rotate=5] (1.44,1.1) ellipse (0.1 and 0.03) (1.30,0.9) ellipse (0.1 and 0.03) (1.16,0.7) ellipse (0.1 and 0.03) (1.02,0.5) ellipse (0.1 and 0.03); \end{scope} \fi @@ -630,6 +647,19 @@ \end{scope} \fi % +% cocktail %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifthing@cocktail +\begin{scope}[xshift=-26,yshift=3] + \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse (0.17 and 0.05); + \fill[cyan!10!white, rotate=-10] (0.8,0.55) ellipse (0.12 and 0.03); + \fill[cyan!10!white, rotate=-10] (0.8,0.7) ellipse (0.03 and 0.2); + \fill[cyan!10!white] (0.92,0.6) -- (0.75,0.9) -- (1.18,0.83) -- cycle; + \fill[gray!60!white] (0.928,0.64) -- (0.85,0.77) -- (1.08,0.77) -- cycle; + \fill[green!40!brown!60!white] (0.94,0.71) circle (0.04); + \fill[red!80!black] (0.94,0.72) circle (0.01); + \end{scope} +\fi +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Sport @@ -639,16 +669,16 @@ % cricket bat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifthing@cricket \begin{scope}[xshift=-26] - \fill[\thing@cricket, rounded corners=\yscalefactor*2, rotate=-30] (0.4,1.2) rectangle (0.7,2.2); - \fill[\thing@cricket, rounded corners=\yscalefactor*1, rotate=-30] (0.5,0.8) rectangle (0.6,1.3); + \fill[\thing@cricket, rounded corners=\scalingfactor*2, rotate=-30] (0.4,1.2) rectangle (0.7,2.2); + \fill[\thing@cricket, rounded corners=\scalingfactor*1, rotate=-30] (0.5,0.8) rectangle (0.6,1.3); \end{scope} \fi % % Hockey stick %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifthing@hockey \begin{scope}[xshift=-22] - \fill[\thing@hockey, rounded corners=\yscalefactor*1, rotate=-30] (0.5,0.6) rectangle (0.6,2.1); - \fill[\thing@hockey, rounded corners=\yscalefactor*3] (0.2,0.2) rectangle (0.85,0.4); + \fill[\thing@hockey, rounded corners=\scalingfactor*1, rotate=-30] (0.5,0.6) rectangle (0.6,2.1); + \fill[\thing@hockey, rounded corners=\scalingfactor*3] (0.2,0.2) rectangle (0.85,0.4); \end{scope} \fi % @@ -685,16 +715,16 @@ % rollingpin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifthing@rollingpin \begin{scope}[xshift=-30,yshift=2] - \fill[\thing@rollingpin, rounded corners=\yscalefactor*2, rotate=-60] (-0.18,0.85) rectangle (0.08,1.75); - \fill[\thing@rollingpin, rounded corners=\yscalefactor*1, rotate=-60] (-0.1,0.65) rectangle (0.0,1.95); + \fill[\thing@rollingpin, rounded corners=\scalingfactor*2, rotate=-60] (-0.18,0.85) rectangle (0.08,1.75); + \fill[\thing@rollingpin, rounded corners=\scalingfactor*1, rotate=-60] (-0.1,0.65) rectangle (0.0,1.95); \end{scope} \fi % % lightsaber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifthing@lightsaber \begin{scope}[xshift=-26] - \fill[\thing@lightsaber, rounded corners=\yscalefactor*1, rotate=-30] (0.5,0.9) rectangle (0.6,2.5); - \fill[gray!80!black, rounded corners=\yscalefactor*1, rotate=-30] (0.47,0.7) rectangle (0.63,1.2); + \fill[\thing@lightsaber, rounded corners=\scalingfactor*1, rotate=-30] (0.5,0.9) rectangle (0.6,2.5); + \fill[gray!80!black, rounded corners=\scalingfactor*1, rotate=-30] (0.47,0.7) rectangle (0.63,1.2); \end{scope} \fi % @@ -712,15 +742,15 @@ (1.2447,0.748) .. controls (1.1427,0.8982) and (1.0721,0.8892) .. (1.0646,1.024) .. controls (1.0541,1.1714) and (1.2642,1.1654) .. (1.2492,1.386) .. controls (1.3093,1.3110) and (1.4383,1.2705) .. - (1.4338,1.025) -- cycle;; + (1.4338,1.025) -- cycle; \fill[white!50!yellow, scale=0.4, xshift=53.5, yshift=45.3] (1.4338,1.025) .. controls (1.4308,0.8877) and (1.3468,0.8997) .. (1.2447,0.748) .. controls (1.1427,0.8982) and (1.0721,0.8892) .. (1.0646,1.024) .. controls (1.0541,1.1714) and (1.2642,1.1654) .. (1.2492,1.386) .. controls (1.3093,1.3110) and (1.4383,1.2705) .. - (1.4338,1.025) -- cycle;; - \fill[\thing@torch,rounded corners=\yscalefactor*1] - (1.1,0.96) -- (0.77,0.25) -- (0.83,0.25) -- (1.3,0.86) -- cycle; + (1.4338,1.025) -- cycle; + \fill[\thing@torch,rounded corners=\scalingfactor*1] + (1.1,0.96) -- (0.77,0.25) -- (0.83,0.25) -- (1.3,0.86) -- cycle; \fill[\thing@torch,rotate=-28] (0.62,1.32) ellipse (0.2 and 0.08); \end{scope} \fi% @@ -770,4 +800,25 @@ \fill[\thing@pickaxe] (-0.77, 0.57) .. controls (-0.14, 0.25) and (-0.02, 0.21) .. (0.60, 0.02) .. controls (-0.12, 0.03) and (-0.22, 0.10) .. (-0.77, 0.57) -- cycle; \fi % +% umbrella %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifthing@umbrella + \path (-0.8, 0.4) rectangle (1.2200000000000002, 2.7); + \begin{pgfinterruptboundingbox} + \fill[gray] (-0.3078, 0.5942) -- (-0.2574, 0.6103) .. controls (-0.1724, 0.3884) and (-0.1145, 0.4523) .. (-0.0667, 0.6543) -- (-0.0666, 0.6545) -- (-0.0665, 0.6547) .. controls (0.0347, 1.0671) and (0.2906, 1.9565) .. (0.2906, 1.9565) -- (0.3415, 1.9419) .. controls (0.3415, 1.9419) and (0.0855, 1.0519) .. (-0.0151, 0.6423) -- (-0.0152, 0.642) .. controls (-0.076, 0.3633) and (-0.2126, 0.3312) .. (-0.3078, 0.5942) -- cycle; + \fill[\thing@umbrella] (-0.7815, 1.9927) .. controls (-0.6441, 2.1962) and (-0.3163, 2.072) .. (-0.3239, 1.824) .. controls (-0.1602, 2.0111) and (0.1891, 1.9216) .. (0.1685, 1.6915) .. controls (0.3000, 1.8765) and (0.6639, 1.7626) .. (0.6607, 1.5356) .. controls (0.7865, 1.7271) and (1.135, 1.695) .. (1.1626, 1.4589) .. controls (1.4996, 2.5771) and (-0.4356, 3.2631) .. (-0.7815, 1.9927) -- cycle; + \end{pgfinterruptboundingbox} +\fi +% +% closed umbrella %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifthing@umbrellaclosed + \fill[gray] (0.5401, 0.7996) -- (0.4872, 0.8019) .. controls (0.484, 1.0395) and (0.4076, 0.9995) .. (0.293, 0.8264) -- (0.2929, 0.8262) -- (0.2928, 0.8261) .. controls (0.0555, 0.4739) and (0.1223, 0.5608) .. (0.1223, 0.5608) -- (0.0795, 0.592) .. controls (0.0795, 0.592) and (0.0131, 0.5057) .. (0.2488, 0.8554) -- (0.2489, 0.8556) .. controls (0.4022, 1.0963) and (0.5414, 1.0793) .. (0.5401, 0.7996) -- cycle; + \fill[\thing@umbrellaclosed] (-0.1173, 0.2263) -- (0.0038, 0.7188) -- (0.1548, 0.7494) -- (0.152, 0.9231) -- (0.3945, 0.7529) -- (0.2218, 0.6885) -- (0.2465, 0.5566) -- cycle; +\fi +% +% handbag %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifthing@handbag + \fill[\thing@handbag] (0.5189, 0.1751) -- (-0.1913, 0.3097) -- (-0.0315, 0.7086) -- (0.5168, 0.6152) -- cycle; + \fill[\thing@handbag!70!black] (0.4143, 0.4354) .. controls (0.5139, 0.9811) and (0.1204, 1.0719) .. (0.0134, 0.5155) -- (0.0957, 0.4996) .. controls (0.1753, 0.8952) and (0.3949, 0.8883) .. (0.3324, 0.4536) -- cycle; +\fi +% }
\ No newline at end of file |