diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-pigs.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-pigs.sty | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-pigs.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-pigs.sty index e2ce1712a01..0e4da099bb7 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-pigs.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-pigs.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-pigs}[2020/12/04 version v0.4 Drawing pigs in TikZ] +\ProvidesPackage{tikzlings-pigs}[2021/03/17 version v0.5 Drawing pigs in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -32,6 +32,7 @@ \newif\ifpig@threeD \newif\ifpig@back +\newif\ifpig@contour \tikzset{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -48,6 +49,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% body/.code = \def\pig@body{#1}, body = pigdark, + eye/.code = \def\pig@eye{#1}, + eye = gray, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % options @@ -55,6 +58,10 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3D/.code = \pig@threeDtrue, back/.code = \pig@backtrue, + contour/.code = \pig@contourtrue + \def\pig@contour{#1}, + contour/.default = black, + outline/.forward to = /pig/contour, } \def\pig@draw{% @@ -78,14 +85,18 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% switch between 2D and 3D, from +% switch between 2D, 3D and contours, from % https://chat.stackexchange.com/transcript/message/45991801#45991801 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifpig@threeD \def\pig@part@draw[##1]{\shade[ball color=##1]} \else - \def\pig@part@draw[##1]{\fill[##1]} + \ifpig@contour + \def\pig@part@draw[##1]{\draw[##1,\pig@contour,fill=white,line width=\scalingfactor*0.4pt]} + \else + \def\pig@part@draw[##1]{\fill[##1]} + \fi \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -100,7 +111,11 @@ % % Tail %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifpig@back\else - \draw[\pig@body,line width=\scalingfactor*0.8pt] (0.8431, 0.583) .. controls (0.8609, 0.4063) and (0.7006, 0.361) .. (0.6384, 0.4293) .. controls (0.5762, 0.4976) and (0.5613, 0.6052) .. (0.6551, 0.629) .. controls (0.7537, 0.6541) and (0.7759, 0.5628) .. (0.7455, 0.4948) .. controls (0.6412, 0.2697) and (0.3543, 0.356) .. (0.2638, 0.4238) .. controls (0.1967, 0.4779) and (0.1788, 0.6076) .. (0.3192, 0.633) .. controls (0.6000, 0.6836) and (0.5130, 0.3048) .. (0.2098, 0.3322) .. controls (0.0809, 0.3438) and (0.0809, 0.5236) .. (0.0809, 0.5236); + \ifpig@contour + \draw[\pig@contour,line width=\scalingfactor*0.8pt] (0.8431, 0.583) .. controls (0.8609, 0.4063) and (0.7006, 0.361) .. (0.6384, 0.4293) .. controls (0.5762, 0.4976) and (0.5613, 0.6052) .. (0.6551, 0.629) .. controls (0.7537, 0.6541) and (0.7759, 0.5628) .. (0.7455, 0.4948) .. controls (0.6412, 0.2697) and (0.3543, 0.356) .. (0.2638, 0.4238) .. controls (0.1967, 0.4779) and (0.1788, 0.6076) .. (0.3192, 0.633) .. controls (0.6000, 0.6836) and (0.5130, 0.3048) .. (0.2098, 0.3322) .. controls (0.0809, 0.3438) and (0.0809, 0.5236) .. (0.0809, 0.5236); + \else + \draw[\pig@body,line width=\scalingfactor*0.8pt] (0.8431, 0.583) .. controls (0.8609, 0.4063) and (0.7006, 0.361) .. (0.6384, 0.4293) .. controls (0.5762, 0.4976) and (0.5613, 0.6052) .. (0.6551, 0.629) .. controls (0.7537, 0.6541) and (0.7759, 0.5628) .. (0.7455, 0.4948) .. controls (0.6412, 0.2697) and (0.3543, 0.356) .. (0.2638, 0.4238) .. controls (0.1967, 0.4779) and (0.1788, 0.6076) .. (0.3192, 0.633) .. controls (0.6000, 0.6836) and (0.5130, 0.3048) .. (0.2098, 0.3322) .. controls (0.0809, 0.3438) and (0.0809, 0.5236) .. (0.0809, 0.5236); + \fi \fi % % Feet if back %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -128,8 +143,8 @@ \ifpig@back\else % % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\pig@part@draw[gray] (-0.09, 1.82) circle[radius=0.02]; -\pig@part@draw[gray] ( 0.09, 1.82) circle[radius=0.02]; +\pig@part@draw[\pig@eye] (-0.09, 1.82) circle[radius=0.02]; +\pig@part@draw[\pig@eye] ( 0.09, 1.82) circle[radius=0.02]; % % Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pig@part@draw[\pig@body] (0, 1.62) ellipse[x radius=0.18, y radius=0.14]; @@ -140,7 +155,11 @@ \ifpig@threeD \draw[gray!70!black,line width=\scalingfactor*0.4pt] (0.105, 1.46) arc [start angle=-50, end angle=-130, radius=0.16] ; \else - \draw[gray,line width=\scalingfactor*0.4pt] (0.105, 1.46) arc [start angle=-50, end angle=-130, radius=0.16] ; + \ifpig@contour + \draw[\pig@contour,line width=\scalingfactor*0.4pt] (0.105, 1.46) arc [start angle=-50, end angle=-130, radius=0.16] ; + \else + \draw[gray,line width=\scalingfactor*0.4pt] (0.105, 1.46) arc [start angle=-50, end angle=-130, radius=0.16] ; + \fi \fi % % Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -157,7 +176,11 @@ % % Tail if back %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifpig@back - \draw[\pig@body,line width=\scalingfactor*0.8pt] (0.8431, 0.583) .. controls (0.8609, 0.4063) and (0.7006, 0.361) .. (0.6384, 0.4293) .. controls (0.5762, 0.4976) and (0.5613, 0.6052) .. (0.6551, 0.629) .. controls (0.7537, 0.6541) and (0.7759, 0.5628) .. (0.7455, 0.4948) .. controls (0.6412, 0.2697) and (0.3543, 0.356) .. (0.2638, 0.4238) .. controls (0.1967, 0.4779) and (0.1788, 0.6076) .. (0.3192, 0.633) .. controls (0.6000, 0.6836) and (0.5130, 0.3048) .. (0.2098, 0.3322) .. controls (0.0809, 0.3438) and (0.0809, 0.5236) .. (0.0809, 0.5236); + \ifpig@contour + \draw[\pig@contour,line width=\scalingfactor*0.8pt] (0.8431, 0.583) .. controls (0.8609, 0.4063) and (0.7006, 0.361) .. (0.6384, 0.4293) .. controls (0.5762, 0.4976) and (0.5613, 0.6052) .. (0.6551, 0.629) .. controls (0.7537, 0.6541) and (0.7759, 0.5628) .. (0.7455, 0.4948) .. controls (0.6412, 0.2697) and (0.3543, 0.356) .. (0.2638, 0.4238) .. controls (0.1967, 0.4779) and (0.1788, 0.6076) .. (0.3192, 0.633) .. controls (0.6000, 0.6836) and (0.5130, 0.3048) .. (0.2098, 0.3322) .. controls (0.0809, 0.3438) and (0.0809, 0.5236) .. (0.0809, 0.5236); + \else + \draw[\pig@body,line width=\scalingfactor*0.8pt] (0.8431, 0.583) .. controls (0.8609, 0.4063) and (0.7006, 0.361) .. (0.6384, 0.4293) .. controls (0.5762, 0.4976) and (0.5613, 0.6052) .. (0.6551, 0.629) .. controls (0.7537, 0.6541) and (0.7759, 0.5628) .. (0.7455, 0.4948) .. controls (0.6412, 0.2697) and (0.3543, 0.356) .. (0.2638, 0.4238) .. controls (0.1967, 0.4779) and (0.1788, 0.6076) .. (0.3192, 0.633) .. controls (0.6000, 0.6836) and (0.5130, 0.3048) .. (0.2098, 0.3322) .. controls (0.0809, 0.3438) and (0.0809, 0.5236) .. (0.0809, 0.5236); + \fi \fi % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \csname pighookbody\endcsname |