diff options
author | Karl Berry <karl@freefriends.org> | 2020-04-22 20:50:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-04-22 20:50:07 +0000 |
commit | 8cefef32705bb30289f033d7dc655ce9b6ffc6d7 (patch) | |
tree | 305a5010d8202f553d3d8ad80e7b25ac15b68347 /Master/texmf-dist/tex/latex/tikzlings/tikzlings-snowmans.sty | |
parent | 631561b7942e1ab1547a224f308d55c5b00c6043 (diff) |
tikzlings (22apr20)
git-svn-id: svn://tug.org/texlive/trunk@54838 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-snowmans.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-snowmans.sty | 134 |
1 files changed, 96 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-snowmans.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-snowmans.sty index c084e99bcb6..7e72e3bb2cf 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-snowmans.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-snowmans.sty @@ -1,8 +1,8 @@ % !TeX root = ./examples/snowman.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% The tikzlings-snowmans package (part of the tikzlings collection) -% A package to bring snowmans into tikz +% This package is part of the TikZlings package +% A package to bring cute little animals and other beings into tikz % Maintained by samcarter % % Project repository and bug tracker: @@ -11,12 +11,8 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.2 -% April 7, 2019 -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-snowmans} - [2019/04/07 v0.2 Draw snowmans in TikZ] +\ProvidesPackage{tikzlings-snowmans}[2020/04/22 version v0.3 Draw snowmans in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -27,9 +23,15 @@ \snowman@draw% \end{scope}% \thing[#1]% + % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \csname snowmanhookforeground\endcsname + \csname tikzlinghookforeground\endcsname + % } \newif\ifsnowman@threeD +\newif\ifsnowman@back +\newif\ifsnowman@globalwarming \tikzset{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -60,6 +62,11 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3D/.code = \snowman@threeDtrue, + back/.code = \snowman@backtrue, + globalwarming/.code= \snowman@globalwarmingtrue + \def\snowman@globalwarming{#1}, + globalwarming/.default = blue!10!white, + global warming/.forward to = /snowman/globalwarming, } \def\snowman@draw{% @@ -77,7 +84,7 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}% -\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))}% +\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))*sqrt(abs((\pgf@xx/1cm)*(\pgf@yy/1cm)-(\pgf@xy/1cm)*(\pgf@yx/1cm)))}% \pgfmathsetmacro{\xscalefactor}{\tmpscaleA} \pgfmathsetmacro{\yscalefactor}{\tmpscaleD} % @@ -95,38 +102,89 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% Body parts (center: x=0.925) +% Body parts % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% Arms %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\snowman@part@draw[\snowman@body,rotate around={-50:(0.5,1.1)}] (0.5,1.1) ellipse (0.3 and 0.12); -\snowman@part@draw[\snowman@body,rotate around={50:(-0.5,1.1)}] (-0.5,1.1) ellipse (0.3 and 0.12); -% -% Body + Head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\snowman@part@draw[\snowman@body] (0,0.5) ellipse (0.6 and 0.5); -\snowman@part@draw[\snowman@body] (0,1.1) ellipse (0.5 and 0.4); -\snowman@part@draw[\snowman@body] (0,1.7) circle (0.4); -% -% Mouth% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[\snowman@mouth] (0,1.5) circle (0.016); -\fill[\snowman@mouth] (0.04,1.507) circle (0.016); -\fill[\snowman@mouth] (-0.04,1.507) circle (0.016); -\fill[\snowman@mouth] (0.08,1.522) circle (0.016); -\fill[\snowman@mouth] (-0.08,1.522) circle (0.016); -\fill[\snowman@mouth] (0.12,1.543) circle (0.016); -\fill[\snowman@mouth] (-0.12,1.543) circle (0.016); -% -% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\snowman@part@draw[\snowman@eye] (-0.155,1.8) circle (0.04); -\snowman@part@draw[\snowman@eye] (0.155,1.8) circle (0.04); -% -% Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\snowman@part@draw[\snowman@nose] (0,1.67) circle (0.05) (0,1.72) -- (0,1.62) -- (0.15,1.64) -- cycle; -% -% buttons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\snowman@part@draw[\snowman@buttons] (0,1.15) circle (0.04); -\snowman@part@draw[\snowman@buttons] (0,0.95) circle (0.04); -\snowman@part@draw[\snowman@buttons] (0,0.75) circle (0.04); +% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\csname snowmanhookbackground\endcsname +\csname tikzlinghookbackground\endcsname +% +% Global warming %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifsnowman@globalwarming + % + % Puddle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \fill[\snowman@globalwarming] (0,1.15) ellipse[x radius=1.6,y radius=1.15]; + % + % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \csname snowmanhookbelly\endcsname + \csname tikzlinghookbelly\endcsname + % + % Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \fill[\snowman@mouth] (0,1.23) circle[radius=0.025]; + \fill[\snowman@mouth] (0.06,1.3) circle[radius=0.025]; + \fill[\snowman@mouth] (-0.06,1.27) circle[radius=0.025]; + \fill[\snowman@mouth] (0.09,1.37) circle[radius=0.025]; + \fill[\snowman@mouth] (-0.18,1.28) circle[radius=0.025]; + \fill[\snowman@mouth] (0.2,1.28) circle[radius=0.025]; + \fill[\snowman@mouth] (-0.25,1.2) circle[radius=0.025]; + % + % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@eye] (-0.5,1.75) circle[radius=0.06]; + \snowman@part@draw[\snowman@eye] (-0.1,1.55) circle[radius=0.06]; + % + % Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@nose] (-0.6,1.54) -- (-0.6,1.4) -- (-0.8,1.42) -- cycle; + \snowman@part@draw[\snowman@nose] (-0.6,1.47) circle[radius=0.07]; + % + % Buttons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@buttons] (0.1,0.8) circle[radius=0.06]; + \snowman@part@draw[\snowman@buttons] (-0.15,0.55) circle[radius=0.06]; + \snowman@part@draw[\snowman@buttons] (0,0.25) circle[radius=0.06]; +% +% normal snowman %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\else + % + % Arms %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@body] (0.5,1.1) ellipse[x radius=0.3, y radius=0.12, rotate=-50]; + \snowman@part@draw[\snowman@body] (-0.5,1.1) ellipse[x radius=0.3, y radius=0.12, rotate=50]; + % + % Body + Head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@body] (0,0.5) ellipse[x radius=0.6, y radius=0.5]; + \snowman@part@draw[\snowman@body] (0,1.1) ellipse[x radius=0.5, y radius=0.4]; + \snowman@part@draw[\snowman@body] (0,1.7) circle[radius=0.4]; + % + % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \csname snowmanhookbelly\endcsname + \csname tikzlinghookbelly\endcsname + % + % Show details only from the front %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \ifsnowman@back\else + % + % Mouth% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \fill[\snowman@mouth] (0,1.5) circle[radius=0.016]; + \fill[\snowman@mouth] (0.04,1.507) circle[radius=0.016]; + \fill[\snowman@mouth] (-0.04,1.507) circle[radius=0.016]; + \fill[\snowman@mouth] (0.08,1.522) circle[radius=0.016]; + \fill[\snowman@mouth] (-0.08,1.522) circle[radius=0.016]; + \fill[\snowman@mouth] (0.12,1.543) circle[radius=0.016]; + \fill[\snowman@mouth] (-0.12,1.543) circle[radius=0.016]; + % + % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@eye] (-0.155,1.8) circle[radius=0.04]; + \snowman@part@draw[\snowman@eye] (0.155,1.8) circle[radius=0.04]; + % + % Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@nose] (0,1.67) circle[radius=0.05] (0,1.72) -- (0,1.62) -- (0.15,1.64) -- cycle; + % + % Buttons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \snowman@part@draw[\snowman@buttons] (0,1.15) circle[radius=0.04]; + \snowman@part@draw[\snowman@buttons] (0,0.95) circle[radius=0.04]; + \snowman@part@draw[\snowman@buttons] (0,0.75) circle[radius=0.04]; + % +\fi\fi +% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\csname snowmanhookbody\endcsname +\csname tikzlinghookbody\endcsname % } |