diff options
author | Karl Berry <karl@freefriends.org> | 2017-11-21 22:14:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-11-21 22:14:30 +0000 |
commit | ea25281c5adfc7ae5a138c26ea181a72d6eb5301 (patch) | |
tree | 50728cc5b4d0d60d5bb2fcea9fc01d6f837735a5 /Master/texmf-dist/doc | |
parent | 1c39bbfbefd2ecda16fcbfae312a67507fd9ccaf (diff) |
tikzducks (21nov17)
git-svn-id: svn://tug.org/texlive/trunk@45874 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzducks/README.md | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf | bin | 388808 -> 463769 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex | 404 |
3 files changed, 293 insertions, 115 deletions
diff --git a/Master/texmf-dist/doc/latex/tikzducks/README.md b/Master/texmf-dist/doc/latex/tikzducks/README.md index 3d6371a71fd..b0ce44c18d0 100644 --- a/Master/texmf-dist/doc/latex/tikzducks/README.md +++ b/Master/texmf-dist/doc/latex/tikzducks/README.md @@ -6,6 +6,8 @@ This project is licensed under the LaTeX Project Public License v1.3c or later, The project repository, including a bug tracker, can be found at https://github.com/samcarter8/tikzducks/issues +![This repository has an official duck seal of approval](https://i.stack.imgur.com/mSAtL.png) + ### A few examples: -![tikz ducks](https://user-images.githubusercontent.com/8226363/29253620-1c4ea2de-8082-11e7-800b-64df42ce6a66.png) +![tikz ducks](https://user-images.githubusercontent.com/8226363/33049537-e71e9dd0-ce60-11e7-8b4c-7e1de0177f14.png) diff --git a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf Binary files differindex 734ace2c07c..c8fd4e3efae 100644 --- a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf +++ b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.pdf diff --git a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex index d7b43a48885..7d5148ff045 100644 --- a/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex +++ b/Master/texmf-dist/doc/latex/tikzducks/tikzducks-doc.tex @@ -10,26 +10,29 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.4 -% Sep 04, 2017 +% Version 0.5 +% Nov 21, 2017 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[parskip=half]{scrartcl} % packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage[T1]{fontenc} +\usepackage[LSBC5,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage[bitstream-charter]{mathdesign} +\usepackage{chessfss} \usepackage{tikzducks} \usepackage[most]{tcolorbox} \usepackage[paper=a4paper,margin=3cm]{geometry} +\usepackage{url} \usepackage[colorlinks=true,breaklinks=true,urlcolor=duckblue,linkcolor=duckblue,citecolor=duckblue,filecolor=duckblue]{hyperref} \usepackage{xspace} \usepackage{scrlayer-scrpage} \usepackage{marvosym} \usepackage{fontawesome} \usepackage[hang,flushmargin,bottom]{footmisc} +\usepackage{imakeidx} % macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\CTAN}{\textsc{CTAN}\xspace} @@ -53,13 +56,14 @@ 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}, + 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}, texcsstyle=*\color{duckblue}\bfseries, keywordstyle=\color{red!60!black}\bfseries, 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}, + 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}, delim ={[s][\ttfamily\color{green!50!black}]{$}{$}}, - escapechar=@, + moredelim=[is][\footnotesize\ttfamily\color{orange!70!black}]{|}{|}, + index=[1][emph] } \tcbset{% @@ -70,7 +74,8 @@ listing options={style=duckstyle}, center lower, righthand width=6.5cm, - bottom=0cm, top=0cm, + bottom=0pt, + top=0pt, before lower={% \setlength{\parskip}{0.5cm}% \spaceskip=5\fontdimen2\font% @@ -78,39 +83,27 @@ } \lstset{style=duckstyle} +\pgfkeys{/duck/|stripes|/.style={stripes={#1}}} -\setlength{\footheight}{27.21881pt} +\pgfmathsetseed{11} +\setlength{\footheight}{45pt} \newlength{\duckoffset} + \cfoot{% - \begin{tikzpicture}[scale=0.3,baseline=-5pt] - \duck - \end{tikzpicture}% - \ifnum\thepage>1% - \foreach \x in{2,...,\thepage}{% - \ifodd\x - \setlength{\duckoffset}{-12pt} - \else% - \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% + \shuffleducks + \begin{tikzpicture}[scale=0.5] + \duck[signpost=\scalebox{0.6}{\thepage},\randomhead] + \end{tikzpicture} } \pagestyle{scrheadings} +\indexsetup{firstpagestyle=scrheadings} + +%\ifnum\pdfshellescape=1 +% \usetikzlibrary{external} +% \tikzexternalize[prefix=tikzducks-doc-figures/] +%\fi + +\makeindex % meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \title{The \texorpdfstring{\tikzducks}{tikzducks} package} @@ -125,7 +118,7 @@ \url{https://github.com/samcarter8/tikzducks}\\ \url{https://www.ctan.org/pkg/tikzducks} }{samcarter}} -\date{Version 0.4 -- \today} +\date{Version 0.5 -- \today} \begin{document} \maketitle @@ -138,25 +131,24 @@ Rubber ducks can be made of latex, but can they also be made with \LaTeX? Yes! T 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. 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. +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}{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. +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 came to rescue for the keyword highlighting in the documentation, \href{https://tex.stackexchange.com/users/148434/mihikma}{Mihikma} created the duck's beard 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} (\url{inkscape.org}) and then exported to \TikZ paths using the \texttt{SVG to TikZ/PGF} extension (\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{https://inkscape.org}) and then exported to \TikZ paths using the \texttt{SVG to TikZ/PGF} extension (\url{https://github.com/kjellmf/svg2tikz}). \subsection{Dependencies} The \tikzducks package loads the packages \lstinline|xcolor| and \TikZ, both without any options. If you require one of these packages to be loaded with some option, please consider loading it yourself before the \tikzducks package or use, e.g. -\vskip0.5em -\begin{lstlisting}[morekeywords={xcolor,svgnames}] +\begin{lstlisting}[aboveskip=1.2em,morekeywords={xcolor,svgnames}] \PassOptionsToPackage{svgnames}{xcolor} \end{lstlisting} -It also uses the \lstinline|\usetikzlibrary{patterns}|. +It also uses the \lstinline|\usetikzlibrary{patterns}| and \lstinline|\usetikzlibrary{calc}|. \subsection{License} @@ -250,7 +242,7 @@ And of course the colour of each hair style can be adjusted: \end{tikzpicture} \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=<colour name>| 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. +Eyebrows and a beard are also part of the package. The colour choice is more tricky for them -- if a colour is explicitly specified (\lstinline|eyebrow=<colour name>| or \lstinline|beard=<colour name>|) 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} @@ -267,7 +259,17 @@ Eyebrows are also part of the package. The colour choice is more tricky for them \end{tikzpicture} \end{tcblisting} -\clearpage +\addtocounter{footnote}{1} +\begin{tcblisting}{title={Beard duck$^\thefootnote$}} +\begin{tikzpicture} + \duck[beard=white!80!brown] +\end{tikzpicture} +\begin{tikzpicture} + \duck[recedinghair=white,beard] +\end{tikzpicture} +\end{tcblisting} +\footnotetext[\thefootnote]{The beard is based on an answer by Mihikma, see \url{https://tex.stackexchange.com/a/401777/36296}} + \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. @@ -297,10 +299,11 @@ A respectable duck needs a suitable wardrobe. It can choose from a \lstinline|ts For more ways to customise the clothing also have a look at the \hyperref[sec:footballducks]{football ducks in Section \ref{sec:footballducks}}. +\clearpage \subsection{Accessories} \label{sec:accessories} -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. +There is a multitude of things a duck might need. The following examples all also work without specifying a colour, but giving both an example with and one without explicit colour just makes this overview unnecessary long, so only one is given. \begin{tcblisting}{title={Swimming duck}} \begin{tikzpicture} @@ -320,31 +323,44 @@ There is a multitude of things a duck might need. The following examples all als \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Tophat duck}} +\begin{tikzpicture} + \duck[tophat=blue!20!black] +\end{tikzpicture} +\end{tcblisting} + \begin{tcblisting}{title={Basecap duck}} \begin{tikzpicture} \duck[cap=red!80!black] \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Santa Clause}} +\begin{tcblisting}{title={Santa Duck}} \begin{tikzpicture} - \duck[santa=red!80!black] + \duck[santa=red!80!black, + beard=white!80!brown] \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Graduate Duck}} +\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{tcblisting}{title={Beret duck}} \begin{tikzpicture} \duck[beret=red!70!black] \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Crown Duck}} +\begin{tcblisting}{title={Peaked cap duck}} +\begin{tikzpicture} + \duck[peakedcap=blue!50!black] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Crown duck}} \begin{tikzpicture} \duck[body=black!75!white, crown=yellow!70!brown] @@ -359,6 +375,37 @@ There is a multitude of things a duck might need. The following examples all als \end{tikzpicture} \end{tcblisting} +\addtocounter{footnote}{1} +\begin{tcblisting}{title={Bunny duck$^\thefootnote$}} +\begin{tikzpicture} +\duck[body=white!65!brown, bill=white!50!brown, bunny] +\end{tikzpicture} +\begin{tikzpicture} +\duck[bunny=red,inear=blue] +\end{tikzpicture} +\end{tcblisting} +\footnotetext[\thefootnote]{Unless an explicit colour is specified, the bunny ears will take the body colour as default colour, the inner parts will be drawn in a lighter shade.} + +\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={Magic duck}} +\begin{tikzpicture} + \duck[magichat,magicwand] +\end{tikzpicture} +\begin{tikzpicture} + \duck[magichat=teal, + magicstars=blue!30!cyan, + magicwand] +\end{tikzpicture} +\end{tcblisting} + \begin{tcblisting}{title={Glasses duck}} \begin{tikzpicture} \duck[glasses=red!50!black] @@ -371,12 +418,9 @@ There is a multitude of things a duck might need. The following examples all als \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Book duck}} +\begin{tcblisting}{title={Superhero duck}} \begin{tikzpicture} - \duck[book=\scalebox{0.5}{\TeX}] -\end{tikzpicture} -\begin{tikzpicture} -\duck[book=\scalebox{0.6}{$\pi$}, bookcolour=blue!50!black] + \duck[mask=teal,cape=teal] \end{tikzpicture} \end{tcblisting} @@ -393,24 +437,26 @@ There is a multitude of things a duck might need. The following examples all als \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Magic duck}} +\addtocounter{footnote}{1} +\begin{tcblisting}{title={Speaking duck$^\thefootnote$}} \begin{tikzpicture} - \duck[magichat, - magicwand] + \duck[speech={Bla},bubblecolour=cyan!20!white] \end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Thinking duck$^\thefootnote$}} \begin{tikzpicture} - \duck[magichat=teal, - magicstars=blue!30!cyan, - magicwand] + \duck[think={Blub},bubblecolour=white!95!yellow] \end{tikzpicture} \end{tcblisting} +\footnotetext[\thefootnote]{Both the speech and thought bubble are inspired by the wonderful \href{https://www.ctan.org/pkg/ducksay}{ducksay package}} -\begin{tcblisting}{title={Witch duck}} +\begin{tcblisting}{title={Book duck}} \begin{tikzpicture} - \duck[witch=black!50!gray, - longhair=red!80!black, - jacket=black!50!gray, - magicwand] + \duck[book=\scalebox{0.5}{\TeX}] +\end{tikzpicture} +\begin{tikzpicture} +\duck[book=\scalebox{0.6}{$\pi$}, bookcolour=blue!50!black] \end{tikzpicture} \end{tcblisting} @@ -426,6 +472,38 @@ There is a multitude of things a duck might need. The following examples all als \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}} + +\begin{tcblisting}{title={Lightsaber duck}} +\begin{tikzpicture} + \duck[lightsaber=red] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Torch duck}} +\begin{tikzpicture} + \duck[torch=black!30!gray] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Prison duck}} +\begin{tikzpicture} + \duck[prison=gray] +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Necklace duck}} +\begin{tikzpicture} + \duck[necklace=gray!20!white] +\end{tikzpicture} +\end{tcblisting} + \begin{tcblisting}{title={Icecream duck}} \begin{tikzpicture} \duck[icecream] @@ -441,7 +519,7 @@ There is a multitude of things a duck might need. The following examples all als \addtocounter{footnote}{1} \begin{tcblisting}{title={Chef duck$^\thefootnote$}} \begin{tikzpicture} -\duck[chef=white!95!yellow, + \duck[chef=white!95!yellow, rollingpin=brown!80!black] \end{tikzpicture} \end{tcblisting} @@ -465,19 +543,38 @@ There is a multitude of things a duck might need. The following examples all als \end{tikzpicture} \end{tcblisting} -\begin{tcblisting}{title={Lightsaber duck}} +\begin{tcblisting}{title={Milkshake duck}} \begin{tikzpicture} -\duck[lightsaber=red] -\end{tikzpicture} + \duck[milkshake=red!20!white] +\end{tikzpicture} \end{tcblisting} \addtocounter{footnote}{1} -\begin{tcblisting}{title={Football duck$^\thefootnote$}} +\begin{tcblisting}{title={Wine duck$^\thefootnote$}} \begin{tikzpicture} - \duck[football=white!85!yellow] + \duck[wine=red!70!black] +\end{tikzpicture} +\end{tcblisting} +\footnotetext[\thefootnote]{According to the resident Italian wine expert of the \href{https://chat.stackexchange.com/transcript/message/40103109}{ TeX.SE chatroom}, the duck is drinking a fine Brunello di Montalcino} + +\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 ...) + +\begin{tcblisting}{title={Random duck}} +\begin{tikzpicture} + \randuck +\end{tikzpicture} +\end{tcblisting} + +In case the duck should not be completely random, but only some of the random elements are desired, these can be accessed independently by using \lstinline|\randomhead| and \lstinline|\randomaccessories| for a random headpiece and a random accessories, respectively. Small caveat: Before using \lstinline|\randomhead| or \lstinline|\randomaccessories|, \lstinline|\shuffleducks| has to be used to provide the random items (for \lstinline|\randuck| this is done automatically). + +\begin{tcblisting}{title={Random head gear and accessories}} +\begin{tikzpicture} + \shuffleducks + \duck[\randomhead, \randomaccessories] \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} @@ -510,8 +607,7 @@ For convenience the more complex paths of this package are stored in macros, whi In detail, the following paths are available: -\vskip0.5em -\begin{lstlisting}[breakindent=0pt] +\begin{lstlisting}[aboveskip=1.2em,breakindent=0pt] \duckpathbody, \duckpathgrumpybill, \duckpathbill, \duckpathtshirt, \duckpathjacket,\duckpathcape, \duckpathshorthair, \duckpathlonghair, \duckpathcrazyhair, \duckpathrecedinghair, \duckpathcrown \end{lstlisting} @@ -533,7 +629,20 @@ To ease the placement of further accessories, 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}.. +An example making use this option are the \hyperref[starducks]{``Live long and prosper'' ducks}. + +To distinguish coordinates from multiple ducks in the same \lstinline|tikzpicture|, one can name the ducks using the option \lstinline[emph={name}]|name|. If this option is used, the coordinates are prefixed with the respective name and a dash: \lstinline|<name>-<coordinate>|. + +\begin{tcblisting}{title={Named coordinates},listing options={style={duckstyle}, emph={name,wing}}} +\begin{tikzpicture} + \duck[name=foo] + \begin{scope}[xshift=90pt, + scale=.3, yshift=150pt] + \duck[name=bar] + \end{scope} + \draw (foo-wing) -- (bar-wing); +\end{tikzpicture} +\end{tcblisting} \clearpage \section{Football ducks -- contributed by Carla Maggi} @@ -555,7 +664,7 @@ This may be impractical as the stripes are drawn on top of any accessories or ha \begin{tcblisting}{title={Using \texttt{stripes} for \texttt{tikzducks}}} \begin{tikzpicture} - \duck[longhair,stripes={\stripes}] + \duck[longhair,|stripes|={\stripes}] \end{tikzpicture} \end{tcblisting} @@ -585,42 +694,42 @@ Please note that the colour of the stripes only affects the stripes themselves, \duck[stripes] \end{tikzpicture} \begin{tikzpicture} - \duck[stripes={ + \duck[|stripes|={ \stripes[color=blue]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={ +\duck[|stripes|={ \stripes[distance=0.6]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={ +\duck[|stripes|={ \stripes[width=0.03]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={\stripes[emblem={\includegraphics[width=0.3cm]{example-image-a}}]}] +\duck[|stripes|={\stripes[emblem={\includegraphics[width=0.3cm]{example-image-a}}]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={ +\duck[|stripes|={ \stripes[height=1.0]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={ +\duck[|stripes|={ \stripes[initialx=1]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={ +\duck[|stripes|={ \stripes[initialy=0.8]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={ +\duck[|stripes|={ \stripes[rotate=45]}] \end{tikzpicture} \begin{tikzpicture} -\duck[stripes={ +\duck[|stripes|={ \stripes[rotate=-45]}] \end{tikzpicture} \end{tcblisting} @@ -628,7 +737,7 @@ Please note that the colour of the stripes only affects the stripes themselves, 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={ +\duck[tshirt=red, |stripes|={ \stripes[color=yellow, width=0.1] \stripes[color=orange, width=0.1, initialx=0.0]}] \end{tikzpicture} @@ -639,25 +748,26 @@ 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] +\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] +\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] +\duck[tshirt=black,|stripes|={\stripes[color=red]},football] \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={M\"{o}nchengladbach duck}} +\definecolor{mggreen}{RGB}{37,166,89}% \begin{tikzpicture} -\duck[tshirt=green,stripes={\stripes},football] +\duck[tshirt=mggreen,|stripes|={\stripes},football] \end{tikzpicture} \end{tcblisting} @@ -672,14 +782,14 @@ A few examples to see \lstinline|stripes| in action: \definecolor{rossocagliari}{RGB}{149,20,38}% \definecolor{blucagliari}{RGB}{23,52,84}% \begin{tikzpicture} -\duck[tshirt=white, jacket=blucagliari,stripes={ +\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={ +\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] @@ -689,7 +799,7 @@ A few examples to see \lstinline|stripes| in action: \begin{tcblisting}{title={Brescia duck}} \begin{tikzpicture} -\duck[tshirt=blue, jacket=blue,stripes={ +\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] @@ -700,7 +810,8 @@ In case your favourite team is missing from the above examples, feel free to cre \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}. + +In the following a few examples of possible duck customisations, some of which will require additional packages (which are stated as a comment at the start of the code). 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}} \begin{tikzpicture} @@ -788,21 +899,31 @@ For more examples (or to show your own creations) please visit \href{https://tex \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Ghost duck}} +\colorlet{ghost}{white!98!gray}% +\begin{tikzpicture} +\duck[body=ghost,bill=ghost,prison=gray] +\fill[ghost,rotate=-17](-0.1,0.7) rectangle (0.15,1.3); +\fill[ghost,rotate=17] (1.6,0.7) rectangle (1.81,1.3); +\end{tikzpicture} +\end{tcblisting} + \addtocounter{footnote}{1} \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] +\path (0.1,0.1) rectangle (2.1,2.12); +\begin{pgfinterruptboundingbox} +\path[path image=crinklepaper] (0.90,1.50) ellipse (0.50 and 0.625); -\path [path image=crinklepaper] \duckpathbody; -\fill [gray!80!white] \duckpathbill; -\fill[white!70!gray, rotate=-20] - (0.23,1.7675) ellipse (0.0893 and 0.125); -\fill[black, rotate=-20] - (0.26,1.7575) ellipse (0.0357 and 0.0714); +\path[path image=crinklepaper] \duckpathbody; +\fill[gray!80!white] \duckpathbill; \fill[white!70!gray, rotate=-20] + (0.23,1.7675) ellipse (0.0893 and 0.125) (-0.06,1.74) ellipse (0.0786 and 0.1143); \fill[black, rotate=-20] + (0.26,1.7575) ellipse (0.0357 and 0.0714) (-0.03,1.73) ellipse (0.0286 and 0.0643); +\end{pgfinterruptboundingbox} \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{https://arxiv.org/abs/1707.02945}} @@ -866,29 +987,34 @@ For more examples (or to show your own creations) please visit \href{https://tex \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] +\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] + \duck[|stripes|={\stripes[distance=0.4,width=0.2,rotate=0,initialx=0.15]},alien=black] \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Jailbird duck}} +\begin{tikzpicture} +\duck[peakedcap=gray!40!black,tshirt=white,stripes={ +\stripes[rotate=100,color=gray!40!black]},prison=gray] +\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}}}; -} +\newcommand{\superstripes}{\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]} \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} +\duck[tshirt=red!80!black,peakedcap=red!80!black,|stripes|={\superstripes}] +\fill[white] (0.8,2) circle (0.13); +\node[red!80!black,rotate=-25] at (0.8,2) {\scalebox{0.6}{\textsf{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} +\duck[tshirt=green!70!black,peakedcap=green!70!black, |stripes|={\superstripes}] +\fill[white] (0.8,2) circle (0.13); +\node[green!70!black,rotate=-25] at (0.8,2) {\scalebox{0.6}{\textsf{L}}}; \end{tikzpicture} \end{tcblisting} @@ -896,7 +1022,7 @@ For more examples (or to show your own creations) please visit \href{https://tex \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] +\duck[body=pskin!80!white,longhair=phair,tshirt=magenta!60!white,jacket=magenta!40!white,necklace=white!85!yellow] \path (0.7,2) rectangle (1.4,2.55); \begin{pgfinterruptboundingbox} \fill[yellow!80!orange,rotate=-10,xshift=-11,yshift=5] \duckpathcrown; @@ -904,4 +1030,54 @@ For more examples (or to show your own creations) please visit \href{https://tex \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={ZZZoro duck}} +\begin{tikzpicture} +\duck[cape=black,hat=black,mask=black] +\node[rotate=-5] at (0.4,0.7) {\tiny\fontfamily{pzc}\selectfont \textbackslash ZZZ}; +\fill[black,rotate=24] (0.1,0.21) rectangle (1.1,0.23) (1.2,0.22) ellipse (0.15 and 0.03) (1.08,0.22) ellipse (0.03 and 0.15); +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Farm animals}} +\definecolor{fskin}{RGB}{161,140,126}% +\definecolor{fbill}{RGB}{238,212,191}% +\definecolor{fhair}{RGB}{89,72,72}% +\begin{tikzpicture} +\duck[body=fskin,bill=fbill,shorthair=fhair,bunny,inear=fbill] +\node[fskin,rotate=45,scale=3] at (1.7,1.55) {\textsf{s}}; +\fill[fhair,rotate=45] (2.4,0.13) ellipse (0.15 and 0.07); +\end{tikzpicture} + +\begin{tikzpicture} +\duck[body=white!80!brown, bill=white!60!brown, bunny, longhair=white!60!brown] +\fill[white!60!brown] (1.85,1.42) circle (0.2); +\end{tikzpicture} + +\begin{tikzpicture} +\duck[body=red!20!white,bill=red!30!white,shorthair=red!30!white,bunny=red!30!white,inear=red!30!white] +\node[red!20!white,rotate=25,scale=3] at (1.7,1.51) {\textsf{s}}; +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Duck Queen}} +%\usepackage[LSBC5,T1]{fontenc} +%\usepackage{chessfss} +\definecolor{qskin}{RGB}{225,219,206}% +\definecolor{qbill}{RGB}{170,123,154}% +\definecolor{qdress}{RGB}{184,209,206}% +\definecolor{qcrown}{RGB}{90,76,183}% +\setboardfontencoding{LSBC5} +\setboardfontcolors{whiteonwhitepiecemask=qcrown,whitepiece=gray!60!white} +\begin{tikzpicture} +\duck[body=qskin,bill=qbill,jacket=qdress,tshirt=teal!30!qdress,shorthair=gray!60!white,necklace=gray!10!white] +\node[rotate=-10] at (1.03,2.42) {\scalebox{1.9}{\WhiteKingOnWhite}}; +\fill[gray!60!white,rotate=-10] (0.6,2.18) ellipse (0.38 and 0.1); +\fill[gray!60!white,rotate=-30] (0.27,1.23) rectangle (0.37,0.65); +\node[rotate=-30] at (0.94,0.98) {\scalebox{0.4}{\WhiteQueenOnWhite}}; +\end{tikzpicture} +\end{tcblisting} + +\clearpage +\printindex + \end{document}
\ No newline at end of file |