samcarter / tikzducks Goto Github PK
View Code? Open in Web Editor NEWA latex package to draw cute rubber ducks with TikZ
Home Page: https://ctan.org/pkg/tikzducks
License: LaTeX Project Public License v1.3c
A latex package to draw cute rubber ducks with TikZ
Home Page: https://ctan.org/pkg/tikzducks
License: LaTeX Project Public License v1.3c
Obviously there needs to be a routine for drawing a Milkshake Duck.
https://en.wikipedia.org/wiki/Milkshake_Duck
I have the following LaTeX code:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{ducks}
\begin{document}
\begin{tikzpicture}
\duck[broom]
\end{tikzpicture}
\end{document}
When compiling with latexmk
, I recieve the following error:
! Package pgfkeys Error: I do not know the key '/pgf/broom' and I am going to ignore it. Perhaps you misspelled it.
The broom related accessories (e.g. broomstick
, etc.) produce similar errors, but other accessories (e.g. handbag
) work just fine. I'm not very good at LaTeX so this could just be me being stupid but I'm really not sure what's going on or how to diagnose this further.
By the way, this is really awesome!
Edit: fixed documentclass
.
This link http://www.pirbot.com/mirrors/ctan/graphics/pgf/contrib/tikzducks/arxiv.org/abs/1707.02945, on footnote 3, seams to be broken.
This awesome package is nevertheless missing a ducktor: perhaps with white coat and stethoscope.
Maybe it would be useful to introduce layers, using
\begin{pgfonlayer}{layer name}
environment contents
\end{pgfonlayer}
This would mean drawing order would get less important and one could afterwards still add things below e.g. the hair.
As reported by CarLaTeX in https://tex.stackexchange.com/questions/385158/selectcolormodelgray-doesnt-always-work-with-tikzducks
\selectcolormodel{gray}
does not always work for \path[fill=<some pure color>]
For example
How about a Santa duck? Obviously, it needs a beard and/or a hat.
Perhaps take a look at the santa
implementation in tikzpeople
:
http://mirrors.ctan.org/graphics/pgf/contrib/tikzpeople/tikzpeople.pdf
And hereβs a few million images for inspiration:
https://google.com/search?q=santa+duck&tbm=isch
Maybe it would be convenient to automatically scale the text in book, speech, think to the available width
adding transform shape
from
1a039d7 might be a starting point
Good day, in More ducks section, the last item, Face Mask Duck, should point from
FaceMask
to
Facemask.tex + Facemask.png
Currently, when ducks
is loaded as a tikz libray, it loads tikzlibraryducks.code.tex
, which loads tikzducks.sty
through \usepackage{tikzducks}
. Since \usepackage
is a LaTeX command, this makes the tikz library ducks
unusable in other formats, hence not portable.
tikzducks/tikzlibraryducks.code.tex
Line 14 in d5ebc83
Following a suggestion of Ulrike Fischer (https://chat.stackexchange.com/transcript/message/39245635#39245635) it would be useful to
\path[name path=hair]
)Hello,
Thanks a lot for tikzducks package, it is really amazing.
I would like to know about how to properly solve a problem I have seen that happens when multiple ducks are inside the same \begin{tikzpicture} . That is needed to place different ducks in concrete positions like "Scaled duck and The Ugly Duckling" example of documentation.
The problem that I see is that, when I need to use something relying on /fill, like
https://github.com/samcarter/tikzducks/blob/master/duckpond/Donkey.tex
that part is attached to the first duck (in this case the tail of the donkey).
For example with this:
\begin{tikzpicture}
\definecolor{fskin}{RGB}{161,140,126}
\definecolor{fbill}{RGB}{238,212,191}
\definecolor{fhair}{RGB}{89,72,72}
\duck[graduate=gray!20!black, tassel=red!70!black,speech={Bla},bubblecolour= cyan!20!white,laughing]
\begin{scope}
\duck[xshift=110pt, scale=.6, yshift=80pt,body=fskin,bill=fbill,shorthair=fhair,bunny,inear=fbill]
\begin{pgfinterruptboundingbox}
\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{pgfinterruptboundingbox}
\end{scope}
\end{tikzpicture}
Thanks a lot for your help
Hello there,
I don't know if it is wanted like this but the scale option scales also the x and y shift. I've got a MWE :
\documentclass{minimal}
\usepackage{tikzducks}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\duck[scale=0.4, xshift=30pt]
\duck[scale=2, xshift=30pt]
\end{tikzpicture}
\end{document}
When you comile this you can see, that the big duck is shifted from the little one, as it should be at the same shift.
I just stumbled upon this awesome library and wanted to include it in my project. I tried to use it with just the lightsaber and everything works perfectly. Having just a lightsaber my duck looked a bit dull and I wanted to upgrade it with a Darth Vader helmet, which sadly doesn't work.
I am using TexpadTex for convenience reasons. Switching to other tex-distributions it of course works perfectly fine. I am now wondering why it doesn't always work on TexpadTex.
The error thrown is:
! Package pgfkeys Error: I do not know the key '/duck/darthvader', to which you passed 'black!30!gray', and I am going to ignore it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type H <return> for immediate help.
...
l.58 black!30!gray]
I am hoping to use the cute ducks with TexpadTex in the future π€
I was wondering if it would be possible to make monochromatic ducks with a key instead of explicitly making them colourless. I know xcolor
has an option to globally change the entire colourscheme to monochromatic, but I was thinking more along the lines of a local change.
Probably one for the TikZ experts. π
Take for example https://ctan.org/teaser/pkg/tikzducks
-> If the ducks are scaled down, the radius of rounded corners is not scaled as well. This causes problems e.g. for the baguette, hockey and cricket duck
I really like this package.
It would be cool if there were even more customization options.
E.g different shoes to wear such as:
Good day, lovely work! There are URLs in README pointing to Monet and Surfer, but, at the moment, they are not among files in /duckpond/.
with pirate hat, eyepatch and maybe a little duck sitting on the shoulder instead of the usual parrot
After updating TeX Live on my end, I got interested in how \randuck
is implemented and found the following line. https://github.com/samcarter8/tikzducks/blob/2f69d05fef84253fb6ff60081c2eb5d78b72b653/tikzducks.sty#L767
LuaTeX of version 0.81.0 or higher and XeTeX don't have the primitive \pdfrandomseed
whereas pdfTeX and e-(u)pTeX do. Therefore, the following MWE
\documentclass{article}
\usepackage{tikzducks}
\begin{document}
\end{document}
cannot be typeset with XeLaTeX and LuaLaTeX.
Solution with LuaLaTeX is easy; you only need to \let
\pdfrandomseed
to be \randomseed
(possibly with version checking). There seems to have been a discussion about PRNG in XeTeX, but I don't have time to read all the thread at the moment and XeTeX doesn't have a primitive named \randomseed
.
~$ xetex -interaction=nonstopmode "\show\randomseed\bye"
This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xetex)
restricted \write18 enabled.
entering extended mode
> \randomseed=undefined.
<*> \show\randomseed
\bye
(see the transcript file for additional information)
No pages of output.
Transcript written on texput.log.
Hi
I just installed this package but I haven't been able to compile any duck.
The issue occurs everytime I try to draw a duck. When I try to compile the following:
\documentclass{standalone}
\usepackage{tikzducks}
\begin{document}
\begin{tikzpicture}
\duck
\end{tikzpicture}
\end{document}
I get the error
! I can't find file `tikzducks-generic'.
! Emergency stop. \input tikzducks-generic
! ==> Fatal error occurred, no output PDF file produced!
When I search tikzducks in my machine it seems I can't find the file 'tikzducks-generic.tex' so I thought if I downloaded the file the issue would be solved. The issue persists with the same error message but perhaps because I'm not sure about where should I put the file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.