Skip to content

Commit

Permalink
added neckerchief
Browse files Browse the repository at this point in the history
  • Loading branch information
samcarter committed May 23, 2018
1 parent 723172c commit dac798f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 15 deletions.
42 changes: 29 additions & 13 deletions tikzducks-doc.tex
Expand Up @@ -56,11 +56,11 @@
commentstyle={\color{green!50!black}\slshape},
columns=fullflexible,
emphstyle=\color{orange!70!black},
emph=[1]{water,body,head,eye,pupil,bill,grumpy,tshirt,jacket,tie,cape,shorthair,longhair,crazyhair,recedinghair,eyebrow,beard,glasses,sunglasses,alien,hat,cap,santa,chef,graduate,tassel,beret,crown,unicorn,icecream,flavoura,flavourb,flavourc,book,bookcolour,signpost,signcolour,signback,magichat,magicstars,magicwand,witch,cricket,rollingpin,lightsaber,torch,cake,pizza,hockey,baguette,wing,football,mask,bunny,inear,necklace,milkshake,wine,peakedcap,prison,tophat,speech,bubblecolour,think,buttons,sheep,squareglasses,tail,basket,easter,egga,eggb,eggc,mohican,mullet,horsetail,darthvader,crozier,queencrown,kingcrown,wing,laughing,parrot,stethoscope,niuqelrah,harlequin},
emph=[1]{water,body,head,eye,pupil,bill,grumpy,tshirt,jacket,tie,cape,shorthair,longhair,crazyhair,recedinghair,eyebrow,beard,glasses,sunglasses,alien,hat,cap,santa,chef,graduate,tassel,beret,crown,unicorn,icecream,flavoura,flavourb,flavourc,book,bookcolour,signpost,signcolour,signback,magichat,magicstars,magicwand,witch,cricket,rollingpin,lightsaber,torch,cake,pizza,hockey,baguette,wing,football,mask,bunny,inear,necklace,milkshake,wine,peakedcap,prison,tophat,speech,bubblecolour,think,buttons,sheep,squareglasses,tail,basket,easter,egga,eggb,eggc,mohican,mullet,horsetail,darthvader,crozier,queencrown,kingcrown,wing,laughing,parrot,stethoscope,niuqelrah,harlequin,neckerchief,woggle},
texcsstyle=*\color{duckblue}\bfseries,
keywordstyle=\color{red!60!black}\bfseries,
morekeywords={tikzpicture,scope,patterns,calc,pgfinterruptboundingbox},
moretexcs={duck,path,definecolor,duckpathjacket,duckpathbody,duckpathgrumpybill,duckpathbill,duckpathtshirt,duckpathcape,duckpathshorthair,duckpathlonghair,duckpathcrazyhair,duckpathrecedinghair,duckpathcrown,scalebox,foreach,node,draw,PassOptionsToPackage,usetikzlibrary,selectcolormodel,colorlet,insignia,stripes,color,includegraphics,mcap,setboardfontcolors,setboardfontencoding,WhiteQueenOnWhite,WhiteKingOnWhite,superstripes,shuffleducks,randuck,randomhead,randomaccessories,duckpathmohican,duckpathmullet,duckpathqueencrown,duckpathkingcrown,duckpathdarthvader,duckpathhorsetail,tikzset,duckpathwing},
moretexcs={duck,path,definecolor,duckpathjacket,duckpathbody,duckpathgrumpybill,duckpathbill,duckpathtshirt,duckpathcape,duckpathshorthair,duckpathlonghair,duckpathcrazyhair,duckpathrecedinghair,duckpathcrown,scalebox,foreach,node,draw,PassOptionsToPackage,usetikzlibrary,selectcolormodel,colorlet,insignia,stripes,color,includegraphics,mcap,setboardfontcolors,setboardfontencoding,WhiteQueenOnWhite,WhiteKingOnWhite,superstripes,shuffleducks,randuck,randomhead,randomaccessories,duckpathmohican,duckpathmullet,duckpathqueencrown,duckpathkingcrown,duckpathdarthvader,duckpathhorsetail,tikzset,duckpathwing,shade},
delim ={[s][\ttfamily\color{green!50!black}]{$}{$}},
moredelim=[is][\footnotesize\ttfamily\color{orange!70!black}]{|}{|},
index=[1][emph]
Expand All @@ -85,7 +85,7 @@
\lstset{style=duckstyle}
\pgfkeys{/duck/|stripes|/.style={stripes={#1}}}
\pgfmathsetseed{10}
\pgfmathsetseed{1}
\setlength{\footheight}{45pt}
\newlength{\duckoffset}
Expand Down Expand Up @@ -717,7 +717,8 @@ \subsection{Accessories}
\duck[bunny,easter]
\end{tikzpicture}
\begin{tikzpicture}
\duck[bunny,easter=brown,egga=cyan,eggb=orange,eggc=teal]
\duck[bunny,easter=brown,
egga=cyan,eggb=orange,eggc=teal]
\end{tikzpicture}
\end{tcblisting}
\footnotetext[\thefootnote]{The basket and Easter basket was kindly contributed by Benito van der Zander}
Expand All @@ -728,6 +729,13 @@ \subsection{Accessories}
\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Neckerchief duck}}
\begin{tikzpicture}
\duck[neckerchief=red!70!black,
woggle=blue!60!black]
\end{tikzpicture}
\end{tcblisting}
\clearpage
\section{Random ducks}
With all these available accessories it might be hard to decide which one to choose, but don't worry the \tikzducks provide a solution for this dilemma, the random duck, or short \lstinline|\randuck|, which automatically creates a duck with a randomly chosen accessories and something on top of the head (hair, a hat, ears, alien antenna ...)
Expand Down Expand Up @@ -1285,17 +1293,25 @@ \section{Showcase}
\begin{tcblisting}{title={Duck, MD}}
\begin{tikzpicture}
\duck[
body=yellow!70!brown!70!white,
shorthair=brown!70!black,
squareglasses,
tshirt=teal!50!white,
jacket=white,
buttons=gray!50!white,
stethoscope
]
\duck[shorthair=brown!70!black,
squareglasses,
tshirt=teal!50!white, jacket=white,
buttons=gray!50!white, stethoscope]
\end{tikzpicture}
\end{tcblisting}
\addtocounter{footnote}{1}
\begin{tcblisting}{title={Duck scout$^{\thefootnote}$}}
\begin{tikzpicture}
\duck[head=yellow!60!brown!50!white,
tshirt=brown!80!gray!40!white,
cap=orange!50!yellow,
neckerchief=orange!50!yellow,
woggle=brown, bookcolour=brown!80!black,
book={\tiny\sffamily\scalebox{0.3}{\parbox{1.1cm}{\centering Scouting\\for\\Ducklings}}}]
\end{tikzpicture}
\end{tcblisting}
\footnotetext[\thefootnote]{'yo won the scout duck in the contest \href{https://tex.meta.stackexchange.com/q/7493/36296}{When will @egreg reach 654321}. In Czech, the neckerchief is called ``šátek'' and the woggle ``turbánek'', which means ``little turban''.}
\clearpage
\printindex
Expand Down
16 changes: 14 additions & 2 deletions tikzducks.sty
Expand Up @@ -114,6 +114,7 @@
\newif\ifduck@davidlikespineapplepizza
\newif\ifduck@wing
\newif\ifduck@stethoscope
\newif\ifduck@neckerchief

\tikzset{
%
Expand Down Expand Up @@ -320,6 +321,8 @@
david likes pineapple pizza/.forward to=/duck/davidlikespineapplepizza,
wing/.code = \duck@wingtrue \def\duck@wing{#1},
stethoscope/.code = \duck@stethoscopetrue \def\duck@stethoscope{#1},
neckerchief/.code = \duck@neckerchieftrue \def\duck@neckerchief{#1},
woggle/.code = \def\duck@woggle{#1},
% setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
glasses/.default = black,
sunglasses/.default= black,
Expand Down Expand Up @@ -356,6 +359,8 @@
crozier/.default = brown,
wing/.default = yellow!50!brown,
stethoscope/.default = gray,
neckerchief/.default = brown,
woggle = brown!50!black,
}

\def\duck@draw{
Expand Down Expand Up @@ -518,6 +523,13 @@
\fill[\duck@necklace] (0.5000,1.112) circle (0.032) (0.5100,1.050) circle (0.032) (0.5200,0.990) circle (0.032) (0.5400,0.931) circle (0.032) (0.5825,0.885) circle (0.032) (0.6450,0.885) circle (0.032) (0.7000,0.910) circle (0.032) (0.7500,0.945) circle (0.032) (0.8000,0.980) circle (0.032) (0.8500,1.020) circle (0.032) (0.9000,1.050) circle (0.032) (0.9500,1.080) circle (0.032) (1.0000,1.110) circle (0.032) (1.0550,1.130) circle (0.032) (1.1100,1.150) circle (0.032) (1.1650,1.165) circle (0.032) (1.2200,1.180) circle (0.032) (1.2750,1.195) circle (0.032) (1.3300,1.210) circle (0.032);
\fi
%
% Scout neckerchief %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@neckerchief
\fill[\duck@neckerchief]
(0.3650,1.0892) .. controls (0.4127,1.1589) and (0.4900,1.1450) .. (0.4900,1.1450) .. controls (0.6500,0.9300) and (1.1366,1.2400) .. (1.3675,1.2649) .. controls (1.4131,1.2533) and (1.4052,1.2446) .. (1.4099,1.2124) .. controls (1.3028,1.0810) and (0.7415,0.8930) .. (0.6807,0.9076) .. controls (0.8257,0.7387) and (0.6347,0.7168) .. (0.7151,0.4426) .. controls (0.6059,0.5672) and (0.5513,0.6588) .. (0.5938,0.8388) .. controls (0.5871,0.6953) and (0.4493,0.7565) .. (0.4716,0.4967) .. controls (0.3682,0.6697) and (0.3820,0.7984) .. (0.5321,0.9351) .. controls (0.4635,0.9699) and (0.4115,1.0215) .. (0.3650,1.0892) -- cycle;
\fill[\duck@woggle, rounded corners=\yscalefactor*1, rotate=-10] (0.33,1.05) rectangle (0.55,0.98);
\fi
%
% buttons (same argument as for the necklace)
\ifduck@buttons
\ifduck@jacket
Expand Down Expand Up @@ -1057,8 +1069,8 @@
\pgfmathsetseed{\number\pdfrandomseed}
\fi

\pgfmathdeclarerandomlist{head}{{shorthair}{longhair}{crazyhair}{mohican}{mullet}{beard}{alien}{hat}{cap}{santa}{chef}{graduate}{beret}{magichat}{witch}{crown}{bunny}{peakedcap}{tophat}{queencrown}{kingcrown}}
\pgfmathdeclarerandomlist{accessories}{{glasses}{sunglasses}{icecream}{book}{signpost}{magicwand}{cricket}{rollingpin}{lightsaber}{cake}{pizza}{hockey}{baguette}{football}{mask}{necklace}{milkshake}{wine}{prison}{cape}{torch}{crozier}{easter}}
\pgfmathdeclarerandomlist{head}{{shorthair}{longhair}{crazyhair}{mohican}{mullet}{beard}{alien}{hat}{cap}{santa}{chef}{graduate}{beret}{magichat}{witch}{crown}{bunny}{peakedcap}{tophat}{queencrown}{kingcrown}{harlequin}}
\pgfmathdeclarerandomlist{accessories}{{glasses}{sunglasses}{icecream}{book}{signpost}{magicwand}{cricket}{rollingpin}{lightsaber}{cake}{pizza}{hockey}{baguette}{football}{mask}{necklace}{milkshake}{wine}{prison}{cape}{torch}{crozier}{easter}{stethoscope}{neckerchief}}

\newcommand{\shuffleducks}{%
\pgfmathrandomitem{\head}{head}%
Expand Down

0 comments on commit dac798f

Please sign in to comment.