diff options
author | Karl Berry <karl@freefriends.org> | 2023-04-05 20:00:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-04-05 20:00:42 +0000 |
commit | 4e2ef99b906502fbcb098bc6c1f487657ee43b58 (patch) | |
tree | be2fa51fc62ba0f582d0f655a5513e96751fc656 /Master/texmf-dist/tex/generic | |
parent | a85169c1a5c033b4bd940bb89ba260bebc13deb7 (diff) |
tikzducks (5apr23)
git-svn-id: svn://tug.org/texlive/trunk@66773 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
4 files changed, 162 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/generic/tikzducks/t-tikzducks.mkiv b/Master/texmf-dist/tex/generic/tikzducks/t-tikzducks.mkiv index d9b24b5b057..93b587b169e 100644 --- a/Master/texmf-dist/tex/generic/tikzducks/t-tikzducks.mkiv +++ b/Master/texmf-dist/tex/generic/tikzducks/t-tikzducks.mkiv @@ -14,43 +14,49 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Code for this ConTeXt User Module kindly provided by @JairoAdelRio https://github.com/samcarter/tikzducks/pull/25 -\writestatus{loading}{ConTeXt User Module / TikZDucks 2020/06/30 version v1.5 Draw rubber ducks in TikZ} +\writestatus{loading}{ConTeXt User Module / TikZDucks 2023/04/05 version v1.6 Draw rubber ducks in TikZ} + \setupcolors[state=start] \usemodule[tikz] \enabledirectives[colors.pgf] \usetikzlibrary[patterns] % for the wizard hat \usetikzlibrary[calc] \definecolor[duck@overleafcol][x=48AC3C] -%\unprotect does not work here + \catcode`\@=11 -%So \scalebox and co. works in MkIV too + +% Defining commands not available in context %%%%%%%%%%%%%%%%%%%%%%%%% \define[2]\scalebox{\scale[factor={\ctxlua{context(3*#1)}}]{#2}} \let\tiny\tfxx \let\pdfrandomseed\randomseed -%Duck + +% Duck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\duck{\dosingleempty\doduck} \def\doduck[#1]{% - \iffirstargument - \startscope% - \tikzset{/duck/.cd,#1}% - \duck@draw% - \stopscope% - \else - \startscope% - \tikzset{/duck/.cd}% - \duck@draw% - \stopscope% - \fi% + \iffirstargument + \startscope% + \tikzset{/duck/.cd,#1}% + \duck@draw% + \stopscope% + \else + \startscope% + \tikzset{/duck/.cd}% + \duck@draw% + \stopscope% + \fi% } -%Stripes + +% Stripes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\stripes{\dosingleempty\dostripes} -\def\dostripes[#1]{ - \iffirstargument - \tikzset{/stripes/.cd,#1}\stripes@draw - \else - \tikzset{/stripes/.cd}\stripes@draw - \fi +\def\dostripes[#1]{% + \iffirstargument + \tikzset{/stripes/.cd,#1}\stripes@draw + \else + \tikzset{/stripes/.cd}\stripes@draw + \fi } + \input tikzducks-generic.tex + \catcode`\@=12 \endinput diff --git a/Master/texmf-dist/tex/generic/tikzducks/tikzducks-generic.tex b/Master/texmf-dist/tex/generic/tikzducks/tikzducks-generic.tex index 8c5a996f57e..019e65e2b73 100644 --- a/Master/texmf-dist/tex/generic/tikzducks/tikzducks-generic.tex +++ b/Master/texmf-dist/tex/generic/tikzducks/tikzducks-generic.tex @@ -41,6 +41,7 @@ \newif\ifduck@bowtie \newif\ifduck@lapel \newif\ifduck@aodai +\newif\ifduck@scarf % Headgear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newif\ifduck@alien \newif\ifduck@hat @@ -66,6 +67,7 @@ \newif\ifduck@devil \newif\ifduck@conicalhat \newif\ifduck@sailor +\newif\ifduck@bobblehat % Accessories %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newif\ifduck@glasses \newif\ifduck@sunglasses @@ -106,6 +108,8 @@ \newif\ifduck@cheese \newif\ifduck@shovel \newif\ifduck@pickaxe +\newif\ifduck@strawbroom +\newif\ifduck@broom \newif\ifduck@umbrella \newif\ifduck@umbrellaclosed \newif\ifduck@handbag @@ -183,6 +187,9 @@ \def\duck@aodai{#1}, ao dai/.forward to = /duck/aodai, aodai/.default = blue!50!black, + scarf/.code = \duck@scarftrue + \def\duck@scarf{#1}, + scarf/.default = red!70!black, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % hair styles @@ -318,6 +325,10 @@ sailor/.code = \duck@sailortrue \def\duck@sailor{#1}, sailor/.default = white!80!gray, + bobblehat/.code = \duck@bobblehattrue + \def\duck@bobblehat{#1}, + bobble hat/.forward to = /duck/bobblehat, + bobblehat/.default = red!70!black, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Accessories @@ -485,7 +496,19 @@ shovel/.default = gray, pickaxe/.code = \duck@pickaxetrue \def\duck@pickaxe{#1}, - pickaxe/.default = gray, + pickaxe/.default = gray, + strawbroom/.code = \duck@strawbroomtrue + \def\duck@strawbroom{#1}, + strawbroom/.default = brown!50!white, + strawbroomstick/.code = \def\duck@strawbroomstick{#1}, + strawbroomstick = brown, + strawbroomribbon/.code = \def\duck@strawbroomribbon{#1}, + strawbroomribbon = red!50!black, + broom/.code = \duck@broomtrue + \def\duck@broom{#1}, + broom/.default = brown, + broomstick/.code = \def\duck@broomstick{#1}, + broomstick = gray!50!black, umbrella/.code = \duck@umbrellatrue \def\duck@umbrella{#1}, umbrella/.default = cyan, @@ -704,6 +727,11 @@ \fill[\duck@woggle, rounded corners=\scalingfactor*1, rotate=-10] (0.33,1.05) rectangle (0.55,0.98); \fi % +% Scarf %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@scarf + \fill[\duck@scarf] (1.3780,1.2876) .. controls (1.1405,1.0484) and (0.7278,0.8710) .. (0.4865,1.1319) .. controls (0.4312,1.1245) and (0.3749,1.1088) .. (0.3443,1.0553) .. controls (0.4097,0.9269) and (0.4360,0.9534) .. (0.5231,0.8623) -- (0.4780,0.5230) -- (0.5666,0.5486) -- (0.6442,0.5011) -- (0.6584,0.6852) -- (0.6881,0.3913) -- (0.7782,0.4358) -- (0.8543,0.4133) -- (0.7988,0.8309) .. controls (1.0539,0.8635) and (1.1298,0.8415) .. (1.4849,1.1302) .. controls (1.4898,1.1985) and (1.4313,1.2543) .. (1.3780,1.2876) -- cycle; +\fi +% % buttons (same argument as for the necklace) \ifduck@buttons \ifduck@jacket @@ -983,6 +1011,15 @@ \fill[\duck@sailor] (1.0390,2.2743) .. controls (0.9475,2.2748) and (0.8569,2.2355) .. (0.7943,2.1690) .. controls (0.7147,2.1872) and (0.6335,2.2098) .. (0.5512,2.2029) .. controls (0.5524,2.1164) and (0.5536,2.0299) .. (0.5547,1.9434) .. controls (0.6637,1.9348) and (0.7679,1.8974) .. (0.8716,1.8653) .. controls (1.0321,1.8101) and (1.1932,1.7522) .. (1.3420,1.6697) .. controls (1.3671,1.6622) and (1.3911,1.6147) .. (1.4083,1.6518) .. controls (1.4623,1.7160) and (1.5163,1.7802) .. (1.5702,1.8444) .. controls (1.5154,1.8979) and (1.4433,1.9287) .. (1.3757,1.9624) .. controls (1.3666,2.1156) and (1.2403,2.2511) .. (1.0881,2.2707) .. controls (1.0718,2.2731) and (1.0554,2.2743) .. (1.0390,2.2743) -- cycle; \fi % +% Bobble hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@bobblehat + \pgfinterruptboundingbox + \fill[\duck@bobblehat] (0.4639,1.7996) .. controls (0.5789,1.8438) and (1.3853,1.6023) .. (1.4046,1.4672) .. controls (1.4581,1.5025) and (1.5242,1.5917) .. (1.4544,1.6879) .. controls (1.5205,2.1879) and (0.7711,2.3780) .. (0.5562,1.9848) .. controls (0.4314,1.9650) and (0.4277,1.8625) .. (0.4639,1.7996) -- cycle; + \fill[\duck@bobblehat] (1.1,2.2) circle [radius=0.1]; + \endpgfinterruptboundingbox + \path (0.43,1.3) rectangle (1.5,2.3); +\fi +% % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \csname duckhookhat\endcsname % @@ -1297,6 +1334,23 @@ \fill[\duck@pickaxe] (-0.0085, 0.6858) .. controls (0.6422, 0.3523) and (0.7609, 0.3068) .. (1.4114, 0.1108) .. controls (0.6589, 0.1246) and (0.5556, 0.1887) .. (-0.0085, 0.6858) -- cycle; \fi % +% strawbroom %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@strawbroom + \fill[\duck@strawbroomstick] (0.9160,0.5478) -- (1.2792,1.6574) .. controls (1.3063,1.6961) and (1.3956,1.6649) .. (1.3688,1.6176) -- (0.9508,0.5179) .. controls (0.9360,0.5142) and (0.9202,0.5331) .. (0.9160,0.5478) -- cycle; + \fill[\duck@strawbroom] (0.5528,0.2890) .. controls (0.6449,0.3598) and (0.7460,0.5693) .. (0.8911,0.6871) .. controls (0.9481,0.7215) and (1.0395,0.6925) .. (1.0553,0.6224) .. controls (1.1219,0.4385) and (0.9965,0.2147) .. (1.0056,0.1000) .. controls (0.8926,0.0241) and (0.5950,0.2078) .. (0.5528,0.2890) -- cycle; + \draw[\duck@strawbroomribbon,line width=\scalingfactor*0.4pt] (0.7916,0.5876) .. controls (0.7916,0.5876) and (0.8210,0.5404) .. (0.8451,0.5304) .. controls (0.8708,0.5197) and (0.9021,0.5419) .. (0.9284,0.5329) .. controls (0.9544,0.5240) and (0.9663,0.4903) .. (0.9919,0.4806) .. controls (1.0148,0.4720) and (1.0653,0.4781) .. (1.0653,0.4781); + \draw[\duck@strawbroomribbon,line width=\scalingfactor*0.4pt] (0.7565,0.5493) .. controls (0.7565,0.5493) and (0.7897,0.4961) .. (0.8169,0.4848) .. controls (0.8458,0.4727) and (0.8812,0.4978) .. (0.9109,0.4876) .. controls (0.9401,0.4776) and (0.9535,0.4396) .. (0.9824,0.4287) .. controls (1.0083,0.4189) and (1.0652,0.4259) .. (1.0652,0.4259); +\fi +% +% broom %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@broom + \scope[rotate=-10] + \draw[\duck@broomstick,line width=\scalingfactor*1.8pt] (0.9, 1.8) -- ++(0,-1.4); + \draw[\duck@broomstick,line width=\scalingfactor*1.8pt] (0.6, 0.42) -- ++(0.6,0); + \fill[\duck@broom] (0.6, 0.40) -- ++(-0.05,-0.1) -- ++(0.7,0) -- ++(-0.05, 0.1) -- cycle; + \endscope +\fi +% % umbrella %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@umbrella \path (0.2,0.4) rectangle (2.22,2.7); @@ -1361,10 +1415,10 @@ \edef\randomaccessories{\accessories}% } -\def\randuck{% +\newcommand*{\randuck}[1][]{% \shuffleducks% - \duck[\randomhead, \randomaccessories]% -} + \duck[\randomhead, \randomaccessories, #1]% +} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/Master/texmf-dist/tex/generic/tikzducks/tikzducks-plain.tex b/Master/texmf-dist/tex/generic/tikzducks/tikzducks-plain.tex new file mode 100644 index 00000000000..9b01fb4d626 --- /dev/null +++ b/Master/texmf-dist/tex/generic/tikzducks/tikzducks-plain.tex @@ -0,0 +1,61 @@ +% !TeX root = ./testing/plain_duck.tex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% The tikzducks package +% A package to bring rubber ducks into tikz +% Maintained by samcarter +% +% Project repository and bug tracker: +% https://github.com/samcarter/tikzducks +% +% Released under the LaTeX Project Public License v1.3c or later +% See http://www.latex-project.org/lppl.txt +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input miniltx +\input graphicx.sty +\input tikz.tex +\usetikzlibrary{calc}% +\usetikzlibrary{patterns}% + +\catcode`\@=11 + +\let\pdfrandomseed\randomseed +\font\tiny=cmr5 + +% Duck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\duck{\futurelet\next\doduck} +\def\doduck{% + \ifx[\next %] + \expandafter\doduckopt + \else + \scope%% + \tikzset{/duck/.cd}% + \duck@draw% + \endscope%% + \fi +} +\def\doduckopt[#1]{% + \scope%% + \tikzset{/duck/.cd,#1}% + \duck@draw% + \endscope%% +} + +% Stripes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\stripes{\futurelet\next\dostripes} +\def\dostripes{ + \ifx[\next %] + \expandafter\dostripesopt + \else + \tikzset{/stripes/.cd}\stripes@draw + \fi +} +\def\dostripesopt[#1]{% + \tikzset{/stripes/.cd,#1}\stripes@draw +} + +\input tikzducks-generic.tex + +\catcode`\@=12
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/tikzducks/tikzducks.sty b/Master/texmf-dist/tex/generic/tikzducks/tikzducks.sty index b377387c2da..843658c93a7 100644 --- a/Master/texmf-dist/tex/generic/tikzducks/tikzducks.sty +++ b/Master/texmf-dist/tex/generic/tikzducks/tikzducks.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzducks}[2020/06/30 version v1.5 Draw rubber ducks in TikZ] +\ProvidesPackage{tikzducks}[2023/04/05 version v1.6 Draw rubber ducks in TikZ] \RequirePackage{expl3} \RequirePackage{tikz} @@ -30,21 +30,23 @@ \ExplSyntaxOn \ifdefined\sys_rand_seed: -\pgfmathsetseed {\sys_rand_seed:} + \pgfmathsetseed {\sys_rand_seed:} \else -\ifdefined\pdfrandomseed % pdflatex -\else -\ifdefined\randomseed -\let\pdfrandomseed\randomseed % post TL19 xelatex and lualatex -\else -\let\pdfrandomseed\time % pre TL19 xelatex -\fi -\fi -\pgfmathsetseed{\number\pdfrandomseed} + \ifdefined\pdfrandomseed % pdflatex + \else + \ifdefined\randomseed + \let\pdfrandomseed\randomseed % post TL19 xelatex and lualatex + \else + \let\pdfrandomseed\time % pre TL19 xelatex + \fi + \fi + \pgfmathsetseed{\number\pdfrandomseed} \fi \ExplSyntaxOff -\newcommand*{\stripes}[1][]{\tikzset{% - /stripes/.cd,#1}\stripes@draw% + +\newcommand*{\stripes}[1][]{% + \tikzset{/stripes/.cd,#1}% + \stripes@draw% } \input tikzducks-generic |