diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-rhinos.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-rhinos.sty | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-rhinos.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-rhinos.sty index ad83d676b1a..5a9e3b9e1a1 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-rhinos.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-rhinos.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-rhinos}[2020/12/04 version v0.4 Drawing rhinos in TikZ] +\ProvidesPackage{tikzlings-rhinos}[2021/03/17 version v0.5 Drawing rhinos in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -31,6 +31,7 @@ \newif\ifrhino@threeD \newif\ifrhino@back +\newif\ifrhino@contour \tikzset{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -49,13 +50,21 @@ body = gray, toes/.code = \def\rhino@toes{#1}, toes = \rhino@body!55!white, + eye/.code = \def\rhino@eye{#1}, + eye = white, + pupil/.code = \def\rhino@pupil{#1}, + pupil = black, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % options % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3D/.code = \rhino@threeDtrue, - back/.code = \rhino@backtrue, + back/.code = \rhino@backtrue, + contour/.code = \rhino@contourtrue + \def\rhino@contour{#1}, + contour/.default = black, + outline/.forward to = /rhino/contour, } \def\rhino@draw{% @@ -79,14 +88,18 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% switch between 2D and 3D, from +% switch between 2D, 3D and contours, from % https://chat.stackexchange.com/transcript/message/45991801#45991801 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifrhino@threeD \def\rhino@part@draw[##1]{\shade[ball color=##1]} \else - \def\rhino@part@draw[##1]{\fill[##1]} + \ifrhino@contour + \def\rhino@part@draw[##1]{\draw[##1,\rhino@contour,fill=white,line width=\scalingfactor*0.4pt]} + \else + \def\rhino@part@draw[##1]{\fill[##1]} + \fi \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -137,10 +150,17 @@ \ifrhino@back\else % % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[white] (-0.11, 1.83) ellipse[x radius=0.08, y radius=0.12]; -\fill[white] (0.11, 1.83) ellipse[x radius=0.08, y radius=0.12]; -\fill[black] (-0.105, 1.78) ellipse[x radius=0.04, y radius=0.07]; -\fill[black] (0.105, 1.78) ellipse[x radius=0.04, y radius=0.07]; +\ifrhino@contour + \rhino@part@draw[\rhino@eye] (-0.11, 1.83) ellipse[x radius=0.08, y radius=0.12]; + \rhino@part@draw[\rhino@eye] (0.11, 1.83) ellipse[x radius=0.08, y radius=0.12]; + \rhino@part@draw[\rhino@pupil] (-0.105, 1.78) ellipse[x radius=0.04, y radius=0.07]; + \rhino@part@draw[\rhino@pupil] (0.105, 1.78) ellipse[x radius=0.04, y radius=0.07]; +\else + \fill[\rhino@eye] (-0.11, 1.83) ellipse[x radius=0.08, y radius=0.12]; + \fill[\rhino@eye] (0.11, 1.83) ellipse[x radius=0.08, y radius=0.12]; + \fill[\rhino@pupil] (-0.105, 1.78) ellipse[x radius=0.04, y radius=0.07]; + \fill[\rhino@pupil] (0.105, 1.78) ellipse[x radius=0.04, y radius=0.07]; +\fi % % Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \rhino@part@draw[\rhino@body!80!white] (0, 1.55) ellipse[x radius=0.36, y radius=0.2]; @@ -152,7 +172,11 @@ \ifrhino@threeD \draw[black,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2] ; \else - \draw[\rhino@body!70!black,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2] ; + \ifrhino@contour + \draw[\rhino@contour,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2] ; + \else + \draw[\rhino@body!70!black,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2] ; + \fi \fi % % Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |