From 8df9c434780b2d6ba9b711f34b8213416cdabe6c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 4 Sep 2017 21:44:24 +0000 Subject: tikzducks (4sep17) git-svn-id: svn://tug.org/texlive/trunk@45211 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/tikzducks/tikzducks-doc.pdf | Bin 293686 -> 388808 bytes .../doc/latex/tikzducks/tikzducks-doc.tex | 507 ++++++++++++++++++--- .../texmf-dist/tex/latex/tikzducks/tikzducks.sty | 403 +++++++++++++--- 3 files changed, 782 insertions(+), 128 deletions(-) diff --git a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf index 690141c3b00..734ace2c07c 100644 Binary files a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf and b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex index 4eebe12d24a..d7b43a48885 100644 --- a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex +++ b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex @@ -10,8 +10,8 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.3 -% Aug 15, 2017 +% Version 0.4 +% Sep 04, 2017 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[parskip=half]{scrartcl} @@ -28,6 +28,8 @@ \usepackage{xspace} \usepackage{scrlayer-scrpage} \usepackage{marvosym} +\usepackage{fontawesome} +\usepackage[hang,flushmargin,bottom]{footmisc} % macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\CTAN}{\textsc{CTAN}\xspace} @@ -41,43 +43,44 @@ \addtokomafont{sectioning}{\color{duckblue}} \addtokomafont{date}{\normalsize} \addtokomafont{author}{\normalsize} +\setlength{\footnotemargin}{0.7em} -\tcbset{% - colframe=duckblue, - arc=2mm, - fonttitle=\bfseries, - sidebyside, - listing options={% - language={[latex]TeX}, - tabsize=2, - breaklines, - basicstyle=\footnotesize\ttfamily, - commentstyle={\color{green!50!black}\slshape}, - columns=fullflexible, - texcsstyle=*\color{duckblue}\bfseries, - keywordstyle=\color{red!60!black}\bfseries, - morekeywords={tikzpicture,scope,patterns}, - moretexcs={duck,path,definecolor,duckpathjacket,duckpathbody,duckpathgrumpybill,duckpathbill,duckpathtshirt,duckpathshorthair,duckpathlonghair,duckpathcrazyhair,duckpathrecedinghair,scalebox,foreach,node,PassOptionsToPackage,usetikzlibrary,selectcolormodel,colorlet}, - delim ={[s][\ttfamily\color{green!50!black}]{$}{$}} - }, - righthand width=6.5cm -} - -\lstset{% +\lstdefinestyle{duckstyle}{% language={[latex]TeX}, tabsize=2, breaklines, basicstyle=\footnotesize\ttfamily, 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,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,cake,pizza,hockey,baguette,wing,football}, texcsstyle=*\color{duckblue}\bfseries, keywordstyle=\color{red!60!black}\bfseries, - morekeywords={tikzpicture,scope,patterns}, - moretexcs={duck,path,definecolor,duckpathjacket,duckpathbody,duckpathgrumpybill,duckpathbill,duckpathtshirt,duckpathshorthair,duckpathlonghair,duckpathcrazyhair,duckpathrecedinghair,scalebox,foreach,node,PassOptionsToPackage,usetikzlibrary,selectcolormodel,colorlet}, - delim ={[s][\ttfamily\color{green!50!black}]{$}{$}} + morekeywords={tikzpicture,scope,patterns,pgfinterruptboundingbox}, + moretexcs={duck,path,definecolor,duckpathjacket,duckpathbody,duckpathgrumpybill,duckpathbill,duckpathtshirt,duckpathcape,duckpathshorthair,duckpathlonghair,duckpathcrazyhair,duckpathrecedinghair,duckpathcrown,scalebox,foreach,node,PassOptionsToPackage,usetikzlibrary,selectcolormodel,colorlet,insignia,stripes,color,includegraphics,mcap}, + delim ={[s][\ttfamily\color{green!50!black}]{$}{$}}, + escapechar=@, +} + +\tcbset{% + colframe=duckblue, + arc=2mm, + fonttitle=\bfseries, + sidebyside, + listing options={style=duckstyle}, + center lower, + righthand width=6.5cm, + bottom=0cm, top=0cm, + before lower={% + \setlength{\parskip}{0.5cm}% + \spaceskip=5\fontdimen2\font% + }, } +\lstset{style=duckstyle} + \setlength{\footheight}{27.21881pt} +\newlength{\duckoffset} \cfoot{% \begin{tikzpicture}[scale=0.3,baseline=-5pt] \duck @@ -85,14 +88,25 @@ \ifnum\thepage>1% \foreach \x in{2,...,\thepage}{% \ifodd\x - \begin{tikzpicture}[scale=0.15,baseline=-12pt] - \duck - \end{tikzpicture} + \setlength{\duckoffset}{-12pt} \else% - \begin{tikzpicture}[scale=0.15,baseline=-5pt] - \duck - \end{tikzpicture} + \setlength{\duckoffset}{-5pt} \fi% + \begin{tikzpicture}[scale=0.15,baseline=\duckoffset] + \ifnum\x=5 + \duck[body=gray!50!white,head=gray!50!white] + \else + \ifnum\x=10 + \duck[body=gray!50!white,head=gray!50!white] + \else + \ifnum\x=15 + \duck[body=gray!50!white,head=gray!50!white] + \else + \duck + \fi + \fi + \fi + \end{tikzpicture} }% \fi% } @@ -103,7 +117,7 @@ \subtitle{using ducks in \TikZ} \author{% \texorpdfstring{\texttt{samcarter} (alias - \begin{tikzpicture}[scale=0.3,baseline=5pt] + \begin{tikzpicture}[scale=0.3,baseline=3pt] \duck[body=yellow!50!brown!50!white, longhair=red!50!brown, jacket=blue!50!black] @@ -111,7 +125,7 @@ \url{https://github.com/samcarter8/tikzducks}\\ \url{https://www.ctan.org/pkg/tikzducks} }{samcarter}} -\date{Version 0.3 -- \today} +\date{Version 0.4 -- \today} \begin{document} \maketitle @@ -120,19 +134,19 @@ \section{Introduc(k)tion} \label{intro} -The \tikzducks package is a latex package for ducks to be used in \TikZ pictures. +Rubber ducks can be made of latex, but can they also be made with \LaTeX? Yes! The \tikzducks package is a \LaTeX{} package for rubber ducks to be used in \TikZ pictures. This project is a continuation of an answer at TeX.Stackexchange: \href{tex.stackexchange.com/a/347458/36296}{How can we draw a duck?}. This package is work in progress (and will probably never be really finished as there is an infinite amount of things which could be added), therefore I would be happy to hear your feedback and ideas how to improve the package. -The head version of the source code can be found on \url{github.com/samcarter8/tikzducks}, including a bug tracker, please make constructive use of it! A more stable package version can be found on \CTAN (\url{www.ctan.org/pkg/tikzducks}) and is included in both \miktex and \texlive as \tikzducks. +The head version of the source code can be found on \url{github.com/samcarter8/tikzducks}, including a bug tracker -- please make constructive use of it! A more stable package version can be found on \CTAN (\url{www.ctan.org/pkg/tikzducks}) and is included in both \miktex and \texlive as \tikzducks. If you seek any other assistance (not bug reports/feature requests), I suggest using the \href{https://tex.stackexchange.com/questions/tagged/tikzducks}{\texttt{\{tikzducks\}}-tag} on TeX.Stackexchange. \subsection{Acknowledgements} Without the friendly and helpful community of \href{https://tex.stackexchange.com/}{TeX.Stackexchange} this package would not exist. I would like to thank a few fellow users in particular: -First of all \href{https://tex.stackexchange.com/users/101651/carlatex}{CarLaTeX} for pointing out the overwhelming need of having a \tikzducks package and \href{https://tex.stackexchange.com/users/3094/paulo-cereda}{Paulo Cereda} for his contagious enthusiasm for ducks (\emph{Quack!}). Many other users contributed to this package (in random order): \href{https://tex.stackexchange.com/users/4427/egreg}{egreg} helped to implement the \lstinline|\tikzset{}| interface which makes it much easier to adjust the properties of the ducks to fit the user needs, \href{https://tex.stackexchange.com/users/51022/symbol-1}{Symbol 1} solved a few problems with default key values, \href{https://tex.stackexchange.com/users/2388/ulrike-fischer}{Ulrike Fischer} gave valuable \TikZ advices and last but not least my thanks go to \href{https://tex.stackexchange.com/users/5763/martin-schr%c3%b6der}{Martin Schr\"oder} for his feedback to the code review. +First of all \href{https://tex.stackexchange.com/users/101651/carlatex}{Carla Maggi} for pointing out the overwhelming need of having a \tikzducks package and valuable contribution to the package code, in particular the \hyperref[sec:footballducks]{football ducks} and \href{https://tex.stackexchange.com/users/3094/paulo-cereda}{Paulo Cereda} for his contagious enthusiasm for ducks (\emph{Quack!}). Many other users contributed to this package (in random order): \href{https://tex.stackexchange.com/users/4427/egreg}{Enrico Gregorio} helped to implement the \lstinline|\tikzset{}| interface which makes it much easier to adjust the properties of the ducks to fit the user needs, \href{https://tex.stackexchange.com/users/51022/symbol-1}{Symbol 1} solved a few problems with default key values, \href{https://tex.stackexchange.com/users/2388/ulrike-fischer}{Ulrike Fischer} gave valuable \TikZ advices and last but not least my thanks go to \href{https://tex.stackexchange.com/users/5763/martin-schr%c3%b6der}{Martin Schr\"oder} for his feedback to the code review. -The ducks mostly consist of basic geometric shapes drawn in \TikZ. Some of the more complex shapes (e.g.\ the different hair styles) are first drawn in \texttt{inkscape}\footnote{\url{inkscape.org}} and then exported to \TikZ paths using the \texttt{SVG to TikZ/PGF} extension\footnote{\url{github.com/kjellmf/svg2tikz}} +The ducks mostly consist of basic geometric shapes drawn in \TikZ. Some of the more complex shapes (e.g.\ the different hair styles) are first drawn in \texttt{inkscape} (\url{inkscape.org}) and then exported to \TikZ paths using the \texttt{SVG to TikZ/PGF} extension (\url{github.com/kjellmf/svg2tikz}). \subsection{Dependencies} @@ -169,6 +183,7 @@ To customise this basic duck, the package uses \lstinline|pgf| keys. For almost \clearpage If the size of the ducks should be changed or shifted: + \begin{tcblisting}{title={Scaled duck and \emph{The Ugly Duckling}}, righthand width=3cm} \begin{tikzpicture}[scale=0.6] \duck @@ -186,16 +201,19 @@ If the size of the ducks should be changed or shifted: \subsection{Body parts} -The various parts of the duck body can also be coloured independently, i.e. \lstinline|body|, \lstinline|head| or \lstinline|bill|: +The various parts of the duck can also be coloured independently, i.e.\ \lstinline|body|, \lstinline|head| or \lstinline|bill|: + \begin{tcblisting}{title={Harlequin duck}} \begin{tikzpicture} \duck[body=yellow, head=yellow!50!orange, - bill=red] + bill=red, + eye=green] \end{tikzpicture} \end{tcblisting} Furthermore using the keyword \lstinline|grumpy| the shape of the bill can be changed: + \begin{tcblisting}{title={Grumpy duck}} \begin{tikzpicture} \duck[grumpy] @@ -233,6 +251,7 @@ And of course the colour of each hair style can be adjusted: \end{tcblisting} Eyebrows are also part of the package. The colour choice is more tricky for them -- if a colour is explicitly specified \lstinline|eyebrow=| this colour is of course used, but if no colour is given, it first falls back to the hair colour and only if the duck does not have any hairs, the default colour is applied. + \begin{tcblisting}{title={Eye brow duck}} \begin{tikzpicture} \duck[eyebrow] @@ -248,9 +267,11 @@ Eyebrows are also part of the package. The colour choice is more tricky for them \end{tikzpicture} \end{tcblisting} +\clearpage \subsection{Clothing} A respectable duck needs a suitable wardrobe. It can choose from a \lstinline|tshirt|, a \lstinline|jacket| and a \lstinline|tie|. In it's infinite wardrobe these items are available in all colours definable in the current colour model. + \begin{tcblisting}{title={Dressed duck}} \begin{tikzpicture} \duck[tshirt] @@ -262,6 +283,10 @@ A respectable duck needs a suitable wardrobe. It can choose from a \lstinline|ts \begin{tikzpicture} \duck[tie] \end{tikzpicture} +\begin{tikzpicture} + \duck[cape] +\end{tikzpicture} + \begin{tikzpicture} \duck[tshirt=lightgray, jacket=blue!50!black, @@ -270,11 +295,12 @@ A respectable duck needs a suitable wardrobe. It can choose from a \lstinline|ts \end{tikzpicture} \end{tcblisting} -\subsection{Accessoires} +For more ways to customise the clothing also have a look at the \hyperref[sec:footballducks]{football ducks in Section \ref{sec:footballducks}}. -There is a multitude of things a duck might need. +\subsection{Accessories} +\label{sec:accessories} -The following examples all also work without specifying a colour, but giving an examples with and one without explicit colour just makes this overview unnecessary long, so only one is given. +There is a multitude of things a duck might need. The following examples all also work without specifying a colour, but giving an examples with and one without explicit colour just makes this overview unnecessary long, so only one is given. \begin{tcblisting}{title={Swimming duck}} \begin{tikzpicture} @@ -306,6 +332,25 @@ The following examples all also work without specifying a colour, but giving an \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Graduate Duck}} +\begin{tikzpicture} + \duck[graduate=gray!20!black,tassel=red!70!black] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Beret Duck}} +\begin{tikzpicture} + \duck[beret=red!70!black] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Crown Duck}} +\begin{tikzpicture} +\duck[body=black!75!white, + crown=yellow!70!brown] +\end{tikzpicture} +\end{tcblisting} + \begin{tcblisting}{title={Unicorn duck}} \begin{tikzpicture} \duck[body=pink, @@ -335,6 +380,19 @@ The following examples all also work without specifying a colour, but giving an \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Signpost duck}} +\begin{tikzpicture} + \duck[signpost=42] +\end{tikzpicture} +\begin{tikzpicture} +\duck[signpost=\scalebox{0.4}{ + \parbox{2cm}{\color{black} + \centering Science\\ first}}, + signcolour=brown!70!gray, + signback=white!80!brown] +\end{tikzpicture} +\end{tcblisting} + \begin{tcblisting}{title={Magic duck}} \begin{tikzpicture} \duck[magichat, @@ -347,25 +405,81 @@ The following examples all also work without specifying a colour, but giving an \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Witch duck}} +\begin{tikzpicture} + \duck[witch=black!50!gray, + longhair=red!80!black, + jacket=black!50!gray, + magicwand] +\end{tikzpicture} +\end{tcblisting} + \begin{tcblisting}{title={Cricket duck}} \begin{tikzpicture} \duck[cricket=red!50!black] \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Hockey duck}} +\begin{tikzpicture} + \duck[hockey=brown!70!black] +\end{tikzpicture} +\end{tcblisting} + \begin{tcblisting}{title={Icecream duck}} \begin{tikzpicture} \duck[icecream] \end{tikzpicture} \begin{tikzpicture} \duck[icecream=brown, - flavoura=brown, + flavoura=green!50!brown, flavourb=white, flavourc=red] \end{tikzpicture} \end{tcblisting} -\clearpage +\addtocounter{footnote}{1} +\begin{tcblisting}{title={Chef duck$^\thefootnote$}} +\begin{tikzpicture} +\duck[chef=white!95!yellow, + rollingpin=brown!80!black] +\end{tikzpicture} +\end{tcblisting} +\footnotetext[\thefootnote]{The chef duck is based on an idea by Carla Maggi, please see the following link for a more sophisticated version of the toque and the rolling pin: \url{https://tex.stackexchange.com/a/387126/36296}} + +\begin{tcblisting}{title={Cake duck}} +\begin{tikzpicture} + \duck[cake=red!50!violet!80!black] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Pizza duck}} +\begin{tikzpicture} + \duck[pizza] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Baguette duck}} +\begin{tikzpicture} + \duck[baguette=brown] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Lightsaber duck}} +\begin{tikzpicture} +\duck[lightsaber=red] +\end{tikzpicture} +\end{tcblisting} + +\addtocounter{footnote}{1} +\begin{tcblisting}{title={Football duck$^\thefootnote$}} +\begin{tikzpicture} + \duck[football=white!85!yellow] +\end{tikzpicture} +\end{tcblisting} +\footnotetext[\thefootnote]{The football duck is simplified version from an answer by Carla Maggi, \url{https://tex.stackexchange.com/a/387126/36296}} + +%\clearpage \section{Further customisation} This package will never be able to do everything every potential user might want to do, as this number quickly approaches $\infty$ -- but as the ducks are simply things inside \lstinline|tikzpicture|s, all the heavy weapons of the \TikZ package are available for further customisation. @@ -385,6 +499,7 @@ This package will never be able to do everything every potential user might want \end{tcblisting} For convenience the more complex paths of this package are stored in macros, which can easily be reused: + \begin{tcblisting}{title={Redraw parts}} \begin{tikzpicture} \duck @@ -397,13 +512,12 @@ In detail, the following paths are available: \vskip0.5em \begin{lstlisting}[breakindent=0pt] -\duckpathbody, \duckpathgrumpybill, \duckpathbill, \duckpathtshirt, \duckpathjacket, -\duckpathshorthair, \duckpathlonghair, \duckpathcrazyhair, \duckpathrecedinghair +\duckpathbody, \duckpathgrumpybill, \duckpathbill, \duckpathtshirt, \duckpathjacket,\duckpathcape, \duckpathshorthair, \duckpathlonghair, \duckpathcrazyhair, \duckpathrecedinghair, \duckpathcrown \end{lstlisting} In case one of the other shapes is needed, please have a look at the package source code, which can be found in \lstinline|tikzducks.sty|. -To ease the placement of further accessoires, some particular spots of the duck are marked with \TikZ coordinates, namely the \lstinline|wing|, \lstinline|head| and \lstinline|bill|. +To ease the placement of further accessories, some particular spots of the duck are marked with \TikZ coordinates, namely the \lstinline|wing|, \lstinline|head| and \lstinline|bill|. { \footnotesize\ttfamily @@ -419,10 +533,176 @@ To ease the placement of further accessoires, some particular spots of the duck \end{tikzpicture} \end{tcblisting} } +An example making use this option are the \hyperref[starducks]{``Live long and prosper'' ducks}.. + +\clearpage +\section{Football ducks -- contributed by Carla Maggi} +\label{sec:footballducks} + +\tikzducks are huge sports fans! They do a lot of different sports themselves (see all the piece of sports equipment amongst the accessories), but to cheer their favourite teams, they need suitable fan clothing. In \href{https://tex.stackexchange.com/a/387126/36296}{The Duck Pond} Carla Maggi was so kind to contribute the necessary code to dress the ducks in their team's colours. + +\addtocounter{footnote}{1} +A (non-representative) survey$^\thefootnote$\footnotetext[\thefootnote]{see the selection of jerseys in \url{https://tex.stackexchange.com/a/387126/36296}} showed that most sports jerseys can be emulated by drawing stripes of various colours, sizes and orientations -- and this is exactly what the \lstinline|stripes| macro does, drawing stripes across the shape of the duck's jacket. In order to preserve the whole flexibility of this powerful macro, it was integrated as an independent command into the \tikzducks package, this means it can simply be used on top of a drawn duck: + +\begin{tcblisting}{title={\texttt{stripes} macro}} +\begin{tikzpicture} + \duck + \stripes +\end{tikzpicture} +\end{tcblisting} + +This may be impractical as the stripes are drawn on top of any accessories or hair the duck may have. Therefore the option \lstinline|stripes| let's you inject any code you would normally use to draw the stripes at the correct layer above the duck's clothing but beneath the hair and accessories: + +\begin{tcblisting}{title={Using \texttt{stripes} for \texttt{tikzducks}}} +\begin{tikzpicture} + \duck[longhair,stripes={\stripes}] +\end{tikzpicture} +\end{tcblisting} + +Not all teams wear vertically stripped jerseys, therefore many parameters can be adjusted to best emulate your favourite teams jerseys. The available options are: + +\begin{tabular}{@{}ll@{}} + \lstinline|color| & colour of the stripes, default: + \lstinline|black| \\ + \lstinline|distance| & periodicity length of the stripes, default: + \lstinline|0.3| \\ + \lstinline|width| & stripe width, default: \lstinline|0.15| \\ + \lstinline|height| & length of the stripes, default: + \lstinline|2.7| \\ + \lstinline|initialx| & x coordinate of staring point, default: + \lstinline|0.1| \\ + \lstinline|initialy| & y coordinate of staring point, default: + \lstinline|-0.3| \\ + \lstinline|rotate| & rotation angle in degree, default: + \lstinline|-10|\\ + \lstinline|emblem| & possibility to add logos etc., default: empty\\ +\end{tabular} + +Please note that the colour of the stripes only affects the stripes themselves, to influence the colour of the empty space between the stripes, clothe the duck with a \lstinline|tshirt| or \lstinline|jacket| of the desired colour underneath the stripes. + +\begin{tcblisting}{title={\texttt{stripes} options}} +\begin{tikzpicture} + \duck[stripes] +\end{tikzpicture} +\begin{tikzpicture} + \duck[stripes={ + \stripes[color=blue]}] +\end{tikzpicture} + +\begin{tikzpicture} +\duck[stripes={ + \stripes[distance=0.6]}] +\end{tikzpicture} +\begin{tikzpicture} +\duck[stripes={ + \stripes[width=0.03]}] +\end{tikzpicture} + +\begin{tikzpicture} +\duck[stripes={\stripes[emblem={\includegraphics[width=0.3cm]{example-image-a}}]}] +\end{tikzpicture} +\begin{tikzpicture} +\duck[stripes={ + \stripes[height=1.0]}] +\end{tikzpicture} + +\begin{tikzpicture} +\duck[stripes={ + \stripes[initialx=1]}] +\end{tikzpicture} +\begin{tikzpicture} +\duck[stripes={ + \stripes[initialy=0.8]}] +\end{tikzpicture} + +\begin{tikzpicture} +\duck[stripes={ + \stripes[rotate=45]}] +\end{tikzpicture} +\begin{tikzpicture} +\duck[stripes={ + \stripes[rotate=-45]}] +\end{tikzpicture} +\end{tcblisting} + +For more complex or multicoloured designs the stripes can easily be stacked on top of each other: +\begin{tcblisting}{title={multicoloured \texttt{stripes}}} +\begin{tikzpicture} +\duck[tshirt=red, stripes={ +\stripes[color=yellow, width=0.1] +\stripes[color=orange, width=0.1, initialx=0.0]}] +\end{tikzpicture} +\end{tcblisting} + +\tcbset{righthand width=3cm} +A few examples to see \lstinline|stripes| in action: +\begin{tcblisting}{title={Inter duck}} +\definecolor{blueinter}{RGB}{0,102,170}% +\begin{tikzpicture} +\duck[tshirt=black,stripes={\stripes[color=blueinter]},football] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Juve duck}} +\begin{tikzpicture} +\duck[tshirt=black,stripes={\stripes[color=white]},football] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Milan duck}} +\begin{tikzpicture} +\duck[tshirt=black,stripes={\stripes[color=red]},football] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={M\"{o}nchengladbach duck}} +\begin{tikzpicture} +\duck[tshirt=green,stripes={\stripes},football] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Palmeiras duck}} +\definecolor{verdep}{RGB}{0,100,55}% +\begin{tikzpicture} +\duck[tshirt=green,jacket=verdep,football] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Cagliari duck}} +\definecolor{rossocagliari}{RGB}{149,20,38}% +\definecolor{blucagliari}{RGB}{23,52,84}% +\begin{tikzpicture} +\duck[tshirt=white, jacket=blucagliari,stripes={ +\stripes[color=rossocagliari, width=0.46, distance=3]},football] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Sampdoria duck}} +\begin{tikzpicture} +\duck[tshirt=blue, jacket=blue,stripes={ +\stripes[color=white,rotate=-90,width=0.6,distance=1] +\stripes[color=red,rotate=-90,width=0.2,distance=1.2] +\stripes[color=black,rotate=-90,width=0.1,distance=1.3] +},football] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Brescia duck}} +\begin{tikzpicture} +\duck[tshirt=blue, jacket=blue,stripes={ + \stripes[color=white, rotate=-70, width=0.22,distance=1.1, initialy=0.01] + \stripes[color=white, rotate=40, width=0.2, distance=1.8, initialy=1.0,initialx=0.285] +},football] +\end{tikzpicture} +\end{tcblisting} + +In case your favourite team is missing from the above examples, feel free to create an example and share it with the community in \href{https://tex.stackexchange.com/q/387047/36296}{The Duck Pond}. +\clearpage \section{Showcase} +For more examples (or to show your own creations) please visit \href{https://tex.stackexchange.com/q/387047/36296}{The Duck Pond}. -\begin{tcblisting}{title={\texttt{samcarter} duck}, righthand width=3cm} +\begin{tcblisting}{title={\texttt{samcarter} duck}} \begin{tikzpicture} \duck[body=yellow!50!brown!50!white, longhair=red!50!brown, @@ -430,17 +710,25 @@ To ease the placement of further accessoires, some particular spots of the duck \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Paulo duck}, righthand width=3cm} +\begin{tcblisting}{title={Paulo duck}} \begin{tikzpicture} \duck[cap,cricket] \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Brazil duck}, righthand width=3cm} +\begin{tcblisting}{title={Party duck}} +\begin{tikzpicture} + \duck[cake=violet, + magichat=violet, + magicstars=white!85!yellow] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Brazil duck}} \begin{tikzpicture} - \definecolor{brazilgreen}{RGB}{0,155,58} - \definecolor{brazilyellow}{RGB}{254,223,0} - \definecolor{brazilblue}{RGB}{0,39,118} + \definecolor{brazilgreen}{RGB}{0,155,58}% + \definecolor{brazilyellow}{RGB}{254,223,0}% + \definecolor{brazilblue}{RGB}{0,39,118}% \duck[body=brazilyellow, shorthair=brazilgreen] \path[preaction={fill, brazilblue},pattern=fivepointed stars, pattern color=white] @@ -448,13 +736,13 @@ To ease the placement of further accessoires, some particular spots of the duck \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Duck in black}, righthand width=3cm} +\begin{tcblisting}{title={Duck in black}} \begin{tikzpicture} \duck[grumpy, body=yellow!50!brown!50!white, tshirt=white, jacket=black, tie=black, hat=black, sunglasses=black] \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Prof.\ van Duck}, righthand width=3cm} +\begin{tcblisting}{title={Prof.\ van Duck}} \begin{tikzpicture} \duck[body=yellow!50!brown!40!white, crazyhair=gray!50!white, @@ -465,7 +753,7 @@ To ease the placement of further accessoires, some particular spots of the duck \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Knuth duck}, righthand width=3cm} +\begin{tcblisting}{title={Knuth duck}} \begin{tikzpicture} \duck[body=yellow!50!red!20!white, recedinghair=gray!50!white, @@ -478,8 +766,30 @@ To ease the placement of further accessoires, some particular spots of the duck \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={May the Quack be with you}} +\begin{tikzpicture} + \colorlet{skin}{white!45!gray!80!green} + \duck[lightsaber, body=skin, bill=gray!80!green, + tshirt=brown!50!black, jacket=brown!30!gray] + \fill[skin,rounded corners=3] (0.44,1.70) -- (0.25,2) -- (0.6,1.95); + \fill[skin,rounded corners=3] (1.34,1.60) -- (1.53,1.9) -- (1.16,1.85); +\end{tikzpicture} + +\begin{tikzpicture} + \duck[grumpy,lightsaber=red,cape=black!70!white, + body=black!85!white] +\end{tikzpicture} + +\begin{tikzpicture} + \fill[brown!70!black] (0.5,1.65) circle (0.25); + \duck[jacket=white!95!brown, body=brown!50!white, + shorthair=brown!70!black, lightsaber=cyan] + \fill[brown!70!black] (1.3,1.6) circle (0.25); +\end{tikzpicture} +\end{tcblisting} + \addtocounter{footnote}{1} -\begin{tcblisting}{title={67P/Churyumov-Gerasimenko duck$^\thefootnote$}, righthand width=3cm} +\begin{tcblisting}{title={67P/Churyumov-Gerasimenko duck$^\thefootnote$}} \begin{tikzpicture}[path image/.style={path picture={\foreach \j in {0,...,2}{\node at (0,\j) {\foreach \i in {1,...,5}{\includegraphics[height=1cm]{#1}}};}}}] \path [path image=crinklepaper] (0.90,1.50) ellipse (0.50 and 0.625); @@ -495,11 +805,12 @@ To ease the placement of further accessoires, some particular spots of the duck (-0.03,1.73) ellipse (0.0286 and 0.0643); \end{tikzpicture} \end{tcblisting} -\footnotetext[\thefootnote]{If you try this at home, replace the \texttt{crinklepaper} with an image of the comet's surface, e.g. \url{arxiv.org/abs/1707.02945}} +\footnotetext[\thefootnote]{If you try this at home, replace the \texttt{crinklepaper} with an image of the comet's surface, e.g. \url{https://arxiv.org/abs/1707.02945}} -\begin{tcblisting}{title={With my username I had to...}, righthand width=3cm} -\definecolor{sgskin}{RGB}{222,197,159} -\definecolor{sgblond}{RGB}{238,203,96} +\begin{tcblisting}{title={With my username I had to...}} +%\usepackage{marvosym} +\definecolor{sgskin}{RGB}{222,197,159}% +\definecolor{sgblond}{RGB}{238,203,96}% \colorlet{sggreen}{olive!50!black} \colorlet{sgbill}{sgskin!85!black} \colorlet{sgshirt}{sggreen!50!black} @@ -523,4 +834,74 @@ To ease the placement of further accessoires, some particular spots of the duck \end{tikzpicture} \end{tcblisting} + +\begin{tcblisting}{title={Live long and prosper},label=starducks} +%\usepackage{fontawesome} +\definecolor{unigold}{RGB}{203,157,52}% +\definecolor{uniblue}{RGB}{46,114,167}% +\definecolor{unired}{RGB}{177,49,34}% + +\definecolor{skink}{RGB}{245,206,193}% +\definecolor{skins}{RGB}{255,222,151}% +\definecolor{skinu}{RGB}{146,113,96}% + +\newcommand*{\insignia}{\node[rotate=15] at (wing) {\color{yellow!80!brown}\faLocationArrow};} + +\begin{tikzpicture} +\duck[tshirt=black!60!gray, jacket=unigold, body=skink, shorthair=brown!80!black, bill=skink!60!gray] +\insignia +\end{tikzpicture} + +\begin{tikzpicture} +\duck[tshirt=black!60!gray, jacket=uniblue, body=skins, shorthair=black!60!brown, bill=skins!60!gray] +\fill[skins,rotate=175, xshift=-46, yshift=-76] (0.45,1.20)--(0.50,0.80)--(0.65,1.20); +\insignia +\end{tikzpicture} + +\begin{tikzpicture} +\duck[tshirt=black!60!gray, jacket=unired, body=skinu, longhair=black!60!brown, bill=skinu!70!black] +\insignia +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={French duck}} +\begin{tikzpicture} +\duck[body=yellow!60!red!30!white,tshirt=white!90!yellow,stripes={\stripes[color=blue!70!black,rotate=-87,width=0.07,distance=0.12]},beret=blue!30!black,baguette=brown] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Bee duck}} +\begin{tikzpicture} + \duck[stripes={\stripes[distance=0.4,width=0.2,rotate=0,initialx=0.15]},alien=black] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Super duck brothers}} +\newcommand{\mcap}[2]{\fill[#1,rotate=-15] (0.35,2.05) ellipse (0.5 and 0.15); +\fill[#1,rotate=-25] (0.13,2.15) ellipse (0.5 and 0.17) (0.13,2.25) ellipse (0.55 and 0.17); +\fill[white] (0.8,2) circle (0.13); +\node[#1,rotate=-15] at (0.8,2) {\scalebox{0.6}{\textsf{#2}}}; +} +\begin{tikzpicture} +\duck[tshirt=red!80!black, stripes={\stripes[color=blue!80!black,width=3,height=1.0,rotate=5] \stripes[color=blue!80!black,width=0.1,rotate=0,distance=0.7,initialx=-1.1,height=2]}] +\mcap{red!80!black}{M} +\end{tikzpicture} +\begin{tikzpicture} +\duck[tshirt=green!70!black, stripes={\stripes[color=blue!80!black,width=4,height=1.0,rotate=5] \stripes[color=blue!80!black,width=0.1,rotate=0,distance=0.7,initialx=-1.1,height=2]}] +\mcap{green!70!black}{L} +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Princess duck}} +\definecolor{pskin}{RGB}{255,200,184}% +\definecolor{phair}{RGB}{249,249,139}% +\begin{tikzpicture} +\duck[body=pskin!80!white,longhair=phair,tshirt=magenta!60!white,jacket=magenta!40!white] +\path (0.7,2) rectangle (1.4,2.55); +\begin{pgfinterruptboundingbox} + \fill[yellow!80!orange,rotate=-10,xshift=-11,yshift=5] \duckpathcrown; +\end{pgfinterruptboundingbox} +\end{tikzpicture} +\end{tcblisting} + \end{document} \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty b/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty index d549ac66320..55f51b7cef1 100644 --- a/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty +++ b/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty @@ -10,8 +10,8 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.3 -% Aug 15, 2017 +% Version 0.4 +% Sep 04, 2017 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -21,6 +21,7 @@ \RequirePackage{tikz} \usetikzlibrary{patterns} % for the wizard hat %\usetikzlibrary{intersections} % for named paths +\usetikzlibrary{calc} % for the sports jerseys \newcommand*{\duck}[1][]{\tikzset{% /duck/.cd,#1}\duck@draw% @@ -40,6 +41,8 @@ \newif\ifduck@tshirt \newif\ifduck@jacket \newif\ifduck@tie +\newif\ifduck@cape +\newif\ifduck@stripes % Accessories %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newif\ifduck@glasses \newif\ifduck@sunglasses @@ -53,6 +56,19 @@ \newif\ifduck@magichat \newif\ifduck@magicwand \newif\ifduck@cricket +\newif\ifduck@rollingpin +\newif\ifduck@chef +\newif\ifduck@signpost +\newif\ifduck@witch +\newif\ifduck@graduate +\newif\ifduck@lightsaber +\newif\ifduck@cake +\newif\ifduck@pizza +\newif\ifduck@hockey +\newif\ifduck@beret +\newif\ifduck@baguette +\newif\ifduck@crown +\newif\ifduck@football \tikzset{ /duck/.cd, @@ -85,13 +101,17 @@ % clothing % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - tshirt/.code = \duck@tshirttrue \def\duck@tshirt{#1}, - jacket/.code = \duck@jackettrue \def\duck@jacket{#1}, - tie/.code = \duck@tietrue \def\duck@tie{#1}, + tshirt/.code = \duck@tshirttrue \def\duck@tshirt{#1}, + jacket/.code = \duck@jackettrue \def\duck@jacket{#1}, + tie/.code = \duck@tietrue \def\duck@tie{#1}, + cape/.code = \duck@capetrue \def\duck@cape{#1}, + stripes/.code = \duck@stripestrue \def\duck@stripes{#1}, % setting default %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - tshirt/.default = white, - jacket/.default = blue, - tie/.default = blue, + tshirt/.default = white, + jacket/.default = blue, + tie/.default = blue, + cape/.default = red, + stripes/.default = \stripes , %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % hair styles @@ -119,6 +139,10 @@ hat/.code = \duck@hattrue \def\duck@hat{#1}, cap/.code = \duck@captrue \def\duck@cap{#1}, santa/.code = \duck@santatrue \def\duck@santa{#1}, + chef/.code = \duck@cheftrue \def\duck@chef{#1}, + graduate/.code = \duck@graduatetrue \def\duck@graduate{#1}, + tassel/.code = \def\duck@tassel{#1}, + beret/.code = \duck@berettrue \def\duck@beret{#1}, unicorn/.code = \duck@unicorntrue \def\duck@unicorn{#1}, icecream/.code = \duck@icecreamtrue \def\duck@cone{#1}, flavoura/.code = \def\duck@flavoura{#1}, @@ -126,10 +150,22 @@ flavourc/.code = \def\duck@flavourc{#1}, book/.code = \duck@booktrue \def\duck@book{#1}, bookcolour/.code = \def\duck@bookcolour{#1}, + signpost/.code = \duck@signposttrue \def\duck@signpost{#1}, + signcolour/.code = \def\duck@signcolour{#1}, + signback/.code = \def\duck@signback{#1}, magichat/.code = \duck@magichattrue \def\duck@magichat{#1}, magicstars/.code = \def\duck@magicstars{#1}, magicwand/.code = \duck@magicwandtrue, + witch/.code = \duck@witchtrue \def\duck@witch{#1}, cricket/.code = \duck@crickettrue \def\duck@cricket{#1}, + rollingpin/.code = \duck@rollingpintrue \def\duck@rollingpin{#1}, + lightsaber/.code = \duck@lightsabertrue \def\duck@lightsaber{#1}, + cake/.code = \duck@caketrue \def\duck@cake{#1}, + pizza/.code = \duck@pizzatrue, + hockey/.code = \duck@hockeytrue \def\duck@hockey{#1}, + baguette/.code = \duck@baguettetrue \def\duck@baguette{#1}, + crown/.code = \duck@crowntrue \def\duck@crown{#1}, + football/.code = \duck@footballtrue \def\duck@football{#1}, % setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% glasses/.default = black, sunglasses/.default = black, @@ -137,20 +173,41 @@ hat/.default = brown, cap/.default = blue, santa/.default = red!80!black, + chef/.default = gray!20!white, + graduate/.default = black, + tassel = red, + beret/.default = black, unicorn/.default = pink, - icecream/.default = brown!70!black, + icecream/.default = brown!60!gray, flavoura = brown!50!black, flavourb = white!70!brown, flavourc = red!50!white, bookcolour = brown, + signcolour = brown!50!black, + signback = green!40!black, magichat/.default = violet, magicstars = yellow!80!brown, + witch/.default = black, cricket/.default = brown, + rollingpin/.default = brown, + lightsaber/.default = green, + cake/.default = violet, + hockey/.default = brown, + baguette/.default = brown, + crown/.default = yellow, + football/.default = white, } \def\duck@draw{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % +% minimal bounding box size +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\path (0.1,0.1) rectangle (2.1,2.12); +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % defining some coordinates % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -166,14 +223,10 @@ % % water %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@water - \draw[\duck@water, line width=5] - (1.00,0.40) ellipse (0.80 and 0.28); - \draw[\duck@water, line width=3] - (1.00,0.40) ellipse (1.00 and 0.45); - \draw[\duck@water, line width=2] - (1.00,0.40) ellipse (1.20 and 0.60); - \draw[\duck@water, line width=1] - (1.00,0.40) ellipse (1.40 and 0.75); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (0.88 and 0.35) (1.00,0.40) ellipse (0.75 and 0.25); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (1.05 and 0.50) (1.00,0.40) ellipse (0.95 and 0.42); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (1.23 and 0.63) (1.00,0.40) ellipse (1.17 and 0.57); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (1.42 and 0.77) (1.00,0.40) ellipse (1.38 and 0.73); \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -183,7 +236,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[\duck@body] \duckpathbody; +\begin{pgfinterruptboundingbox} + \fill[\duck@body] \duckpathbody; +\end{pgfinterruptboundingbox} % % head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifdefined\duck@head\else\let\duck@head=\duck@body\fi @@ -217,17 +272,33 @@ % % tshirt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@tshirt - \fill[\duck@tshirt] \duckpathtshirt; + \begin{pgfinterruptboundingbox} + \fill[\duck@tshirt] \duckpathtshirt; + \end{pgfinterruptboundingbox} \fi % % tie %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@tie - \draw[line width=3,color=\duck@tie] (0.60,1.00) -- (0.50,0.60); + \fill[\duck@tie,rotate=-12] (0.32,0.7) rectangle (0.43,1.15); \fi % % jacket %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@jacket - \fill[\duck@jacket] \duckpathjacket; + \begin{pgfinterruptboundingbox} + \fill[\duck@jacket] \duckpathjacket; + \end{pgfinterruptboundingbox} +\fi +% +% stripes for football jersey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@stripes + \duck@stripes +\fi +% +% superhero cape %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@cape + \begin{pgfinterruptboundingbox} + \fill[\duck@cape] \duckpathcape; + \end{pgfinterruptboundingbox} \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -238,22 +309,34 @@ % % short hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@shorthair - \fill[\duck@hair] \duckpathshorthair; + \path (0.1,0.1) rectangle (2.1,2.25); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathshorthair; + \end{pgfinterruptboundingbox} \fi % % long hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@longhair - \fill[\duck@hair] \duckpathlonghair; + \path (0.1,0.1) rectangle (2.1,2.25); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathlonghair; + \end{pgfinterruptboundingbox} \fi % % crazy hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@crazyhair - \fill[\duck@hair] \duckpathcrazyhair; + \path (0.1,0.1) rectangle (2.1,2.4); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathcrazyhair; + \end{pgfinterruptboundingbox} \fi % % receding hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@recedinghair - \fill[\duck@hair] \duckpathrecedinghair; + \path (0.1,0.1) rectangle (2.1,2.18); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathrecedinghair; + \end{pgfinterruptboundingbox} \fi % % eye brow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -262,10 +345,8 @@ \ifdefined\duck@hair\let\duck@eyebrow=\duck@hair\fi \fi% \ifduck@eyebrow - \draw[line width=2,color=\duck@eyebrow,line cap=round] - (0.96,1.70) -- (0.82,1.77); - \draw[line width=2,color=\duck@eyebrow,line cap=round] - (0.50,1.81) -- (0.60,1.82); + \fill[\duck@eyebrow, rounded corners=1, rotate=60] (1.92,0.21) rectangle (1.98,-0.01); + \fill[\duck@eyebrow, rounded corners=1, rotate=100] (1.67,-0.77) rectangle (1.73,-0.95); \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -276,41 +357,33 @@ % % sunglasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@sunglasses - \draw[\duck@sunglasses,line width=1] - (0.93,1.62) -- (1.30,1.50); - \draw[line width=1,color=\duck@sunglasses] - (0.73,1.67) arc (65:92:0.20); - \fill[\duck@sunglasses, line width=1,rotate=-20] - (0.23,1.7675) circle (0.125); - \fill[\duck@sunglasses,line width=1,rotate=-20] - (-0.06,1.74) circle (0.1143); + \fill[\duck@sunglasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84); + \fill[\duck@sunglasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84); + \fill[\duck@sunglasses,rotate=-20] (0.23,1.7675) circle (0.14); + \fill[\duck@sunglasses,rotate=-20] (-0.06,1.74) circle (0.13); \fi % % glasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@glasses - \draw[\duck@glasses,line width=1] - (0.93,1.62) -- (1.30,1.50); - \draw[line width=1,color=\duck@glasses] - (0.73,1.67) arc (65:92:0.20); - \draw[\duck@glasses, line width=1,rotate=-20] - (0.23,1.7675) circle (0.125); - \draw[\duck@glasses,line width=1,rotate=-20] - (-0.06,1.74) circle (0.1143); + \fill[\duck@glasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84); + \fill[\duck@glasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84); + \fill[\duck@glasses,rotate=-20,even odd rule] (0.23,1.7675) circle (0.14) (0.23,1.7675) circle (0.11); + \fill[\duck@glasses,rotate=-20,even odd rule] (-0.06,1.74) circle (0.13) (-0.06,1.74) circle (0.095); \fi % % alien %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@alien - \draw[line width=2,color=\duck@alien] (1.00,1.83) -- (1.20,2.30); - \draw[line width=2,color=\duck@alien] (0.65,1.92) -- (0.60,2.35); + \fill[\duck@alien,rotate=-25] (0.09,2.1) rectangle (0.16,2.6); + \fill[\duck@alien,rotate=5] (0.79,1.86) rectangle (0.86,2.25); \fill[\duck@alien] (1.20,2.30) circle (0.07); - \fill[\duck@alien] (0.60,2.35) circle (0.07); + \fill[\duck@alien] (0.62,2.35) circle (0.07); \fi % % hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@hat - \fill[\duck@hat] (0.90,1.95) ellipse (0.46 and 0.0893); - \fill[\duck@hat] (0.90,2.20) ellipse (0.25 and 0.0714); - \fill[\duck@hat] (1.15,2.20) rectangle (0.65,1.95); + \fill[\duck@hat,rotate=-15] (0.44,2.1) ellipse (0.6 and 0.1); + \fill[\duck@hat,rotate=-15] (0.07,2.1) rectangle (0.81,2.4); + \fill[\duck@hat,rotate=-15] (0.44,2.4) ellipse (0.37 and 0.08); \fi % % cap %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -335,23 +408,44 @@ \fill[white!80!brown] (1.6,1.0) circle (0.17); \fi % +% Chef hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@chef + \fill[\duck@chef,rotate=-15] (0.44,2.1) ellipse (0.37 and 0.08); + \fill[\duck@chef,rotate=-15] (0.07,2.1) rectangle (0.81,2.55); + \fill[\duck@chef] (1.01,2.47) circle (0.17); + \fill[\duck@chef] (1.24,2.35) circle (0.15); + \fill[\duck@chef] (0.77,2.40) circle (0.12); + \fill[\duck@chef] (1.39,2.20) circle (0.12); +\fi +% +% graduate hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@graduate + \fill[\duck@graduate,rotate=-15] (0.44,2.1) ellipse (0.37 and 0.1); + \fill[\duck@graduate,rotate=-15] (0.07,2.1) rectangle (0.81,2.3); + \fill[\duck@graduate] (0.3,2.25) -- (1.05,2.35) -- (1.7,1.95) -- (0.92,1.85) -- cycle; + \fill[\duck@tassel,rounded corners=1] (1.12,1.89) -- (1.01,2.1) -- (1.09,2.11) -- (1.2,1.9) -- (1.2,1.3) -- (1.12,1.3) -- cycle; + \fill[\duck@tassel] (1.16,1.3) ellipse (0.06 and 0.12); +\fi +% +% beret %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@beret + \fill[\duck@beret,rotate=-25] (0.13,2.15) ellipse (0.5 and 0.17); + \fill[\duck@beret,rotate=-25] (0.13,2.25) ellipse (0.55 and 0.17); + \fill[\duck@beret,rotate=-25] (0.13,2.4) circle (0.08); +\fi +% % unicorn %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@unicorn - \draw[\duck@unicorn,fill=\duck@body!100,line width=1,rotate=25] - (1.50,1.4375)--(1.60,1.8375)--(1.70,1.4375); + \fill[\duck@unicorn,rotate=25] (1.48,1.4375)--(1.60,1.9)--(1.72,1.4375); + \fill[\duck@body!100,rotate=25] (1.50,1.43)--(1.60,1.8375)--(1.70,1.43); \fi % % icecream %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@icecream - \draw[\duck@cone,fill=\duck@cone!50!white, - line width=0.5,rotate=-20] - (0.35,1.20)--(0.50,0.60)--(0.75,1.20); - \draw[\duck@cone,fill=\duck@cone!50!white, - rotate=-20,line width=0.5] - (0.55,1.20) ellipse (0.20 and 0.09); - \fill[\duck@flavoura] (0.82,1.03) circle (0.12); - \fill[\duck@flavourb] (1.02,0.95) circle (0.12); - \fill[\duck@flavourc] (0.95,1.06) circle (0.12); + \fill[\duck@cone,rotate=-20] (0.35,1.20)--(0.50,0.60)--(0.75,1.20); + \fill[\duck@flavoura] (0.85,1.03) circle (0.12); + \fill[\duck@flavourb] (1.05,0.95) circle (0.12); + \fill[\duck@flavourc] (0.95,1.1) circle (0.12); \fi % % book %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -361,6 +455,14 @@ \node[rotate=-20, color=white] at (0.88,0.70) {\duck@book};% \fi % +% signpost %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@signpost + \fill[\duck@signcolour, rounded corners=1, rotate=-20] (0.8,0.75) rectangle (0.9,1.75); + \fill[\duck@signcolour, rounded corners=1, rotate=-20] (0.4,1.7) rectangle (1.3,2.4); + \fill[\duck@signback, rounded corners=1, rotate=-20] (0.45,1.75) rectangle (1.25,2.35); + \node[rotate=-20, color=white] at (1.5,1.65) {\duck@signpost}; +\fi +% % magic hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@magichat \path[preaction={fill, \duck@magichat!100},rotate=-5, @@ -370,8 +472,14 @@ % % magic wand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@magicwand - \draw[line width=2.5,color=black] (0.90,0.90) -- (0.60,0.40); - \draw[line width=2.5,color=white] (0.85,0.8167) -- (0.80,0.7333); + \fill[black,rotate=-30] (0.27,1.23) rectangle (0.37,0.65); + \fill[white,rotate=-30] (0.27,1.13) rectangle (0.37,1.03); +\fi +% +% witch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@witch + \fill[\duck@witch,rotate=-15] (0.44,2.13) ellipse (0.75 and 0.17); + \fill[\duck@witch,rotate=-15] (0.05,2.2)--(0.45,3.2)--(0.82,2.2); \fi % % cricket bat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -380,6 +488,76 @@ \fill[\duck@cricket, rounded corners=1, rotate=-30] (0.5,0.8) rectangle (0.6,1.3); \fi % +% rollingpin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@rollingpin + \fill[\duck@rollingpin, rounded corners=2, rotate=-60] (-0.18,0.85) rectangle (0.08,1.75); + \fill[\duck@rollingpin, rounded corners=1, rotate=-60] (-0.1,0.65) rectangle (0.0,1.95); +\fi +% +% lightsaber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@lightsaber + \fill[\duck@lightsaber, rounded corners=1, rotate=-30] (0.5,0.9) rectangle (0.6,2.5); + \fill[gray!80!black, rounded corners=1, rotate=-30] (0.47,0.7) rectangle (0.63,1.2); +\fi +% +% cake %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@cake + \fill[\duck@cake] (1.00,0.50) ellipse (0.4 and 0.2); + \fill[\duck@cake] (0.6,0.5) rectangle (1.4,0.7); + \fill[\duck@cake] (1.00,0.70) ellipse (0.4 and 0.2); + \fill[\duck@cake!50!white] (0.75,0.75) rectangle (0.8,0.95); + \fill[\duck@cake!50!white] (1.2,0.75) rectangle (1.25,0.95); + \fill[\duck@cake!50!white] (0.975,0.65) rectangle (1.025,0.85); + \fill[white!85!yellow] (1.0,0.93) ellipse (0.03 and 0.06); + \fill[white!85!yellow] (1.225,1.03) ellipse (0.03 and 0.06); + \fill[white!85!yellow] (0.775,1.03) ellipse (0.03 and 0.06); +\fi +% +% pizza %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@pizza + \fill[brown] (1.00,0.60) ellipse (0.4 and 0.2); + \fill[red!70!black] (1.00,0.60) ellipse (0.34 and 0.16); + \fill[white!85!yellow] (1.15,0.65) ellipse (0.065 and 0.04); + \fill[white!85!yellow] (0.81,0.57) ellipse (0.065 and 0.04); + \fill[white!85!yellow] (0.95,0.68) ellipse (0.065 and 0.04); + \fill[white!85!yellow] (1.02,0.54) ellipse (0.065 and 0.04); + \fill[green!40!brown] (1.09,0.54) ellipse (0.07 and 0.02); + \fill[green!40!brown,rotate=20] (1.0,0.34) ellipse (0.07 and 0.02); + \fill[green!40!brown,rotate=-20] (0.9,1.05) ellipse (0.07 and 0.02); + \fill[green!40!brown] (1.00,0.60) ellipse (0.03 and 0.06); +\fi +% +% Hockey stick %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@hockey + \fill[\duck@hockey, rounded corners=1, rotate=-30] (0.5,0.6) rectangle (0.6,2.1); + \fill[\duck@hockey, rounded corners=3] (0.2,0.2) rectangle (0.85,0.4); +\fi +% +% baguette %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@baguette + \fill[\duck@baguette!70!white, rounded corners=4, rotate=-30] (0.4,0.72) rectangle (0.7,2.0); + \fill[\duck@baguette!80!black, rotate=5] (1.44,1.1) ellipse (0.1 and 0.03) (1.30,0.9) ellipse (0.1 and 0.03) (1.16,0.7) ellipse (0.1 and 0.03) (1.02,0.5) ellipse (0.1 and 0.03); +\fi +% +% crown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@crown + \path (0.7,1.95) rectangle (1.4,2.45); + \begin{pgfinterruptboundingbox} + \fill[\duck@crown,rotate=-10,xshift=-10,yshift=3] \duckpathcrown; + \end{pgfinterruptboundingbox} +\fi +% +% football %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@football + \fill[\duck@football] (1.2,0.33) circle (0.32); + \begin{scope} + \clip (1.2,0.33) circle (0.32); + \fill[black] (1.06,0.30) -- (1.01,0.17) -- (1.14,0.08) -- (1.26,0.14) -- (1.20,0.28) -- cycle (1.37,0.14) -- (1.46,0.27) -- (1.59,0.27) -- (1.41,0.04) -- cycle (1.28,0.38) -- (1.22,0.52) -- (1.33,0.61) -- (1.45,0.51) -- (1.43,0.37) -- cycle (0.87,0.44) -- (1.02,0.40) -- (1.10,0.53) -- (1.07,0.62) -- (0.94,0.57) -- cycle; + \end{scope} +\fi +% +%\draw (current bounding box.north west) rectangle (current bounding box.south east);% For debugging bounding boxes +% }% from `\def\duck@draw{` at the very beginning %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -477,7 +655,18 @@ (1.3964,1.8658) .. controls (1.1071,2.3511) and (0.5189,2.1609) .. (0.4381,1.6816) .. controls (0.4575,1.9618) and (0.9007,2.2059) .. (1.1308,2.0390) .. controls (1.4703,1.7469) and (1.0343,1.5949) .. - (1.3385,1.4841) -- cycle; + (1.3385,1.4841) -- cycle +} + +\newcommand{\duckpathcape}{% + (0.225,0.966) .. controls (1.314,0.961) and (2.070,0.650) .. (2.042,1.245) .. controls (1.863,1.164) and (1.844,1.173) .. (1.792,1.340) .. controls (1.635,1.235) and (1.620,1.268) .. (1.567,1.393) .. controls (1.358,1.086) and (0.664,1.096) .. (0.460,1.110) .. controls (0.461,1.133) and (0.305,1.077) .. (0.235,0.966) -- cycle +} + +\newcommand{\duckpathcrown}{% + (0.71,2.06) .. controls (0.71,2.06) and (0.73,2.18) .. + (0.60,2.45) -- (0.83,2.26) -- (0.95,2.44) -- (1.07,2.26) -- (1.31,2.44) .. controls (1.15,2.19) and (1.20,2.06) .. + (1.20,2.06) .. controls (1.07,1.98) and (0.84,1.98) .. + (0.71,2.06) -- cycle } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -516,4 +705,88 @@ % 2378223223223223223223223223223223223223223782232 % 322378282232232232232232232232282878223223 % 223232232282828282322322323223 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% stripes for sports jerseys +% +% code contributed by Carla Maggi +% https://tex.stackexchange.com/a/387126/36296 +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand*{\stripes}[1][]{\tikzset{% + /stripes/.cd,#1}\stripes@draw% +} + +\tikzset{ + /stripes/.cd, + color/.code = \def\stripes@color{#1}, + distance/.code = \def\stripes@distance{#1}, + width/.code = \def\stripes@width{#1}, + height/.code = \def\stripes@height{#1}, + initialx/.code = \def\stripes@initialx{#1}, + initialy/.code = \def\stripes@initialy{#1}, + rotate/.code = \def\stripes@rotate{#1}, + emblem/.code = \def\stripes@emblem{#1}, + % setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + color = black, + distance = 0.3, + width = 0.15, + height = 2.7, + initialx = 0.1, + initialy = -0.3, + rotate = -10, + emblem = \empty +} + +\def\stripes@draw{% + \path (0.1,0.1) rectangle (2.1,1.45); + \begin{pgfinterruptboundingbox} + \begin{scope} + \clip \duckpathjacket; + \foreach \shifta in {0,\stripes@distance,...,2.4}{% + \fill[\stripes@color,rotate around={\stripes@rotate:(1.2,0.9)}] + ($(\stripes@initialx,\stripes@initialy)+(\shifta,0)$) rectangle ($(\stripes@initialx,\stripes@initialy)+(\shifta,0)+(\stripes@width,\stripes@height)$); + } + \end{scope} + \end{pgfinterruptboundingbox} + \node at (wing) {\stripes@emblem }; +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%.........................%%%%%%%%%%%%%%%%%%%......................... +%....................%%%%%%%%%............%%%%%%%%.................... +%................%%%%%%....%%...................%%%%%%................ +%.............%%%%%.......%%%.......................%%%%%............. +%...........%%%%........%%%%%%%%%...................%%%%%%%........... +%.........%%%........%%%%%%%%%%%%%%%%..............%%%%%%%%%%......... +%.......%%%.......%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%....... +%......%%%...%%%%%%%%%%%%%%%%%%%%%%%%%%..............%%%%%%%%%%%...... +%.....%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%................%%%%%%%%%%%..... +%...%%%%........%%%%%%%%%%%%%%%%%%%%%...................%%%%%%%%%%%... +%...%%%..........%%%%%%%%%%%%%%%%%%%.....................%%%%%%%%%%... +%..%%%............%%%%%%%%%%%%%%%%%.......................%%%%%%%%%%.. +%.%%%%............%%%%%%%%%%%%%%%%%........................%%%%%%%%%%. +%.%%%..............%%%%%%%.......%%%......................%%%.....%%%. +%%%%..............%%...............%%%...................%%%.......%%% +%%%..............%%.................%%%..................%%.........%% +%%%%............%%%...................%%%...............%%..........%% +%%%%...........%%%.....................%%%.............%%...........%% +%%%%%..........%%........................%%%%%%%%%%%%%%%%...........%% +%%%%%........%%%........................%%%%%%%%%%%%%%%%%%.........%%% +%.%%%%%%%%%%%%%%%......................%%%%%%%%%%%%%%%%%%%.........%%. +%.%%%%%%%%%%%%%%%%.....................%%%%%%%%%%%%%%%%%%%........%%%. +%..%%%%%%%%%%%%%%%%...................%%%%%%%%%%%%%%%%%%%%%.......%%.. +%...%%%%%%%%%%%%%%%%%................%%%%%%%%%%%%%%%%%%%%%%......%%... +%...%%%%%%%%%%%%%%%%%%............%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%.... +%.....%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%....%%%..... +%......%%%%%%%%%%%%%%%%................%%%%%%%%%%%%%%%%......%%%...... +%.......%%%%%%%%%%%%%%....................%%%%%%%%%%........%%%....... +%.........%%%%%%%%%%%........................%%%%.........%%%......... +%...........%%%%%%%%%........................%%........%%%%........... +%.............%%%%%%%%%.....................%%......%%%%%............. +%................%%%%%%%%.................%%%...%%%%%%................ +%....................%%%%%%%%......%%%%%%%%%%%%%%%.................... +%..........................%%%%%%%%%%%%%%%%%.......................... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ No newline at end of file -- cgit v1.2.3