summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikzlings/tikzlings.sty
blob: 389849784aaf4090b4982321e6d42b9deb09dcb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% !TeX root = ./examples/tikzlings.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This is the main part of the TikZlings package
% A package to bring cute little animals and other beings into tikz
% Maintained by samcarter
%
% Project repository and bug tracker:
% https://github.com/samcarter/tikzlings
%
% Released under the LaTeX Project Public License v1.3c or later
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesPackage{tikzlings}[2020/12/04 version v0.4 Collection of packages to draw animals and other beings in TikZ]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% load sub-packages
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{tikz}
\RequirePackage{tikzlings-bears}
\RequirePackage{tikzlings-penguins}
\RequirePackage{tikzlings-marmots}
\RequirePackage{tikzlings-owls}
\RequirePackage{tikzlings-koalas}
\RequirePackage{tikzlings-coatis}
\RequirePackage{tikzlings-snowmans}
\RequirePackage{tikzlings-mice}
\RequirePackage{tikzlings-moles}
\RequirePackage{tikzlings-sloths}
\RequirePackage{tikzlings-pigs}
\RequirePackage{tikzlings-cats}
\RequirePackage{tikzlings-hippos}
\RequirePackage{tikzlings-rhinos}
\RequirePackage{tikzlings-pandas}
\RequirePackage{tikzlings-bees}
\RequirePackage{tikzlings-anteaters}
\RequirePackage{tikzlings-squirrels}
\RequirePackage{tikzlings-sheep}
\RequirePackage{tikzlings-addons}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Drawing a random tikzling
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{expl3}
\ExplSyntaxOn
\ifdefined\sys_rand_seed:
  \pgfmathsetseed {\sys_rand_seed:}
\else
  \ifdefined\pdfrandomseed % pdflatex
  \else
      \ifdefined\randomseed 
        \let\pdfrandomseed\randomseed % post TL19 xelatex and lualatex
      \else
          \let\pdfrandomseed\time % pre TL19 xelatex
      \fi
  \fi
  \pgfmathsetseed{\number\pdfrandomseed} 
\fi
\ExplSyntaxOff

\pgfmathdeclarerandomlist{tikzlings}{{\bear}{\penguin}{\marmot}{\owl}{\koala}{\coati}{\snowman}{\mouse}{\moles}{\sloth}{\pig}{\cat}{\hippo}{\rhino}{\bee}{\anteater}{\sheep}}

\newcommand{\tikzling}[1][]{%
  \pgfmathrandomitem{\tikzling@random}{tikzlings}%
  \tikzling@random[#1]
}