summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzmarmots
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-11-09 21:54:24 +0000
committerKarl Berry <karl@freefriends.org>2018-11-09 21:54:24 +0000
commit621d4074c3976631f81047dec629532809f8488a (patch)
treea702e4da411ef5baf887a54ec5fc5ed50f4e00fb /Master/texmf-dist/tex/latex/tikzmarmots
parent05a427a48fbea0f9183ca423dd19d4cbd5feb7a2 (diff)
tikzmarmots (9nov18)
git-svn-id: svn://tug.org/texlive/trunk@49114 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzmarmots')
-rw-r--r--Master/texmf-dist/tex/latex/tikzmarmots/tikzlibrarymarmots.code.tex6
-rw-r--r--Master/texmf-dist/tex/latex/tikzmarmots/tikzmarmots.sty104
2 files changed, 83 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzmarmots/tikzlibrarymarmots.code.tex b/Master/texmf-dist/tex/latex/tikzmarmots/tikzlibrarymarmots.code.tex
index 03503f16296..2f34797f532 100644
--- a/Master/texmf-dist/tex/latex/tikzmarmots/tikzlibrarymarmots.code.tex
+++ b/Master/texmf-dist/tex/latex/tikzmarmots/tikzlibrarymarmots.code.tex
@@ -5,13 +5,13 @@
% Maintained by samcarter
%
% Project repository and bug tracker:
-% https://github.com/samcarter8/tikzmarmots
+% https://github.com/samcarter/tikzmarmots
%
% Released under the LaTeX Project Public License v1.3c or later
% See http://www.latex-project.org/lppl.txt
%
-% Version 0.1
-% July 10, 2018
+% Version 1.0
+% Nov 8, 2018
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikzmarmots}
diff --git a/Master/texmf-dist/tex/latex/tikzmarmots/tikzmarmots.sty b/Master/texmf-dist/tex/latex/tikzmarmots/tikzmarmots.sty
index d9c6537b188..ae2bf3d9376 100644
--- a/Master/texmf-dist/tex/latex/tikzmarmots/tikzmarmots.sty
+++ b/Master/texmf-dist/tex/latex/tikzmarmots/tikzmarmots.sty
@@ -1,4 +1,4 @@
-% !TeX root = ./test.tex
+% !TeX root = ./testing/test.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The tikzmarmots package
@@ -6,19 +6,40 @@
% Maintained by samcarter
%
% Project repository and bug tracker:
-% https://github.com/samcarter8/tikzmarmots
+% https://github.com/samcarter/tikzmarmots
%
% Released under the LaTeX Project Public License v1.3c or later
% See http://www.latex-project.org/lppl.txt
%
-% Version 0.1
-% July 10, 2018
+% Version 1.0
+% Nov 8, 2018
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesPackage{tikzmarmots}
- [2018/07/08 v0.1 Drawing marmots in TikZ]
+ [2018/11/09 v1.0 Drawing marmots in TikZ]
+
+\PackageWarning{tikzmarmots}{The TikZmarmots package was merged into the TikZlings package, please load the package `tikzlings-marmots` or the more general `tikzlings` package instead}
\RequirePackage{tikz}
+\usetikzlibrary{shadows.blur}
+\usetikzlibrary{fadings}
+
+\tikzfading[name=marmot@blush,
+inner color=transparent!50,
+outer color=transparent!100]
+
+\RequirePackage{ifluatex}
+\RequirePackage{ifxetex}
+
+\ifluatex
+ \let\pdfrandomseed\randomseed
+\fi
+
+\ifxetex
+ \pgfmathsetseed{\time}
+\else
+ \pgfmathsetseed{\number\pdfrandomseed}
+\fi
\newcommand*{\marmot}[1][]{%
\begin{scope}%
@@ -27,10 +48,12 @@
\end{scope}%
}
-\newif\ifmarmot@name
\newif\ifmarmot@blush
\newif\ifmarmot@whiskers
\newif\ifmarmot@teeth
+\newif\ifmarmot@threeD
+\newif\ifmarmot@shadow
+\newif\ifmarmot@askphil
\tikzset{
%
@@ -38,7 +61,6 @@
%
/marmot/.search also={/tikz,/pgf},
/marmot/.cd,
- name/.code = \marmot@nametrue \def\marmot@name{#1},
%
% body
%
@@ -50,7 +72,11 @@
blush/.code = \marmot@blushtrue,
whiskers/.code = \marmot@whiskerstrue \def\marmot@whiskers{#1},
whiskers/.default = gray,
- teeth/.code = \marmot@teethtrue,
+ teeth/.code = \marmot@teethtrue,
+ 3D/.code = \marmot@threeDtrue,
+ shadow/.code = \marmot@shadowtrue,
+ askphil/.code = \marmot@askphiltrue,
+ ask phil/.forward to=/marmot/askphil,
}
\def\marmot@draw{%
@@ -62,41 +88,71 @@
\path (0.3,0.1) rectangle (1.83,2.17);
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% switch between 2D and 3D, from
+% https://chat.stackexchange.com/transcript/message/45991801#45991801
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifmarmot@threeD
+ \def\marmot@part@draw##1{\shade[ball color=##1]}
+\else
+ \def\marmot@part@draw##1{\fill[##1]}
+\fi
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% shadow
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+\ifmarmot@askphil
+ \pgfmathparse{int(random(1,120))}
+ \let\marmot@random=\pgfmathresult
+ \ifnum\marmot@random>17
+ \marmot@shadowtrue
+ \fi
+\fi
+%
+\ifmarmot@shadow
+ \fill[opacity=0,blur shadow,rotate=-80] (-0.25,1.3) ellipse (0.28 and 0.8);
+\fi
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% Body parts
+% Body parts (center: x=0.925)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!black] (1.18,0.2) ellipse (0.23 and 0.09);
-\fill[\marmot@body!50!black] (0.67,0.2) ellipse (0.23 and 0.09);
+\marmot@part@draw{\marmot@body!50!black} (1.18,0.2) ellipse (0.23 and 0.09);
+\marmot@part@draw{\marmot@body!50!black} (0.67,0.2) ellipse (0.23 and 0.09);
%
% Ears %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!black] (1.18,2.03) ellipse (0.09 and 0.13);
-\fill[\marmot@body!50!black] (0.67,2.03) ellipse (0.09 and 0.13);
+\marmot@part@draw{\marmot@body!50!black} (1.18,2.03) ellipse (0.09 and 0.13);
+\marmot@part@draw{\marmot@body!50!black} (0.67,2.03) ellipse (0.09 and 0.13);
%
% Tail %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!black] (1.81,0.67) .. controls (1.79,0.40) and (1.27,0.24) .. (1.26,0.44) .. controls (1.24,0.56) and (1.37,0.51) .. (1.50,0.53) .. controls (1.62,0.54) and (1.81,0.72) .. (1.81,0.67) -- cycle;
+\marmot@part@draw{\marmot@body!50!black} (1.81,0.67) .. controls (1.79,0.40) and (1.27,0.24) .. (1.26,0.44) .. controls (1.24,0.56) and (1.37,0.51) .. (1.50,0.53) .. controls (1.62,0.54) and (1.81,0.72) .. (1.81,0.67) -- cycle;
%
% Body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body] (1.52,0.92) .. controls (1.52,0.26) and (1.28,0.18) .. (0.95,0.18) .. controls (0.61,0.18) and (0.32,0.26) .. (0.32,0.92) .. controls (0.32,1.58) and (0.59,2.11) .. (0.92,2.11) .. controls (1.25,2.11) and (1.52,1.58) .. (1.52,0.92) -- cycle;
+\marmot@part@draw{\marmot@body} (1.52,0.92) .. controls (1.52,0.26) and (1.28,0.18) .. (0.925,0.18) .. controls (0.57,0.18) and (0.33,0.26) .. (0.33,0.92) .. controls (0.32,1.58) and (0.59,2.11) .. (0.925,2.11) .. controls (1.26,2.11) and (1.53,1.58) .. (1.52,0.92) -- cycle;
%
% Belly %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!white] (1.35,0.71) .. controls (1.35,0.41) and (1.17,0.37) .. (0.92,0.37) .. controls (0.69,0.37) and (0.48,0.41) .. (0.48,0.71) .. controls (0.48,1.01) and (0.67,1.26) .. (0.91,1.26) .. controls (1.15,1.26) and (1.35,1.01) .. (1.35,0.71) -- cycle;
+\marmot@part@draw{\marmot@body!50!white} (1.35,0.71) .. controls (1.35,0.41) and (1.17,0.37) .. (0.925,0.37) .. controls (0.68,0.37) and (0.5,0.41) .. (0.5,0.71) .. controls (0.5,1.01) and (0.7,1.26) .. (0.925,1.26) .. controls (1.15,1.26) and (1.35,1.01) .. (1.35,0.71) -- cycle;
%
% Arms %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!black,rotate around={70:(1.31,0.93)}] (1.31,0.93) ellipse (0.24 and 0.13);
-\fill[\marmot@body!50!black,rotate around={-70:(0.54,0.93)}] (0.54,0.93) ellipse (0.24 and 0.13);
+\marmot@part@draw{\marmot@body!50!black,rotate around={70:(1.31,0.93)}} (1.31,0.93) ellipse (0.24 and 0.13);
+\marmot@part@draw{\marmot@body!50!black,rotate around={-70:(0.54,0.93)}} (0.54,0.93) ellipse (0.24 and 0.13);
%
% Muzzle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!white] (0.925,1.47) ellipse (0.23 and 0.13);
+\marmot@part@draw{\marmot@body!50!white} (0.925,1.47) ellipse (0.23 and 0.13);
%
% Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!black] (0.925,1.6) circle (0.08);
+\marmot@part@draw{\marmot@body!50!black} (0.925,1.6) circle (0.08);
%
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[\marmot@body!50!black] (0.77,1.77) circle (0.05);
-\fill[\marmot@body!50!black] (1.08,1.77) circle (0.05);
+\marmot@part@draw{\marmot@body!50!black} (0.77,1.77) circle (0.05);
+\marmot@part@draw{\marmot@body!50!black} (1.08,1.77) circle (0.05);
%
% Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\draw[\marmot@body!50!black] (1.07,1.51) arc [start angle=-20, end angle=-160, radius=0.16];
@@ -109,8 +165,8 @@
%
% Blushed %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifmarmot@blush
- \shade[inner color=red!30!\marmot@body,outer color=\marmot@body] (0.63,1.6) circle (0.1);
- \shade[inner color=red!30!\marmot@body,outer color=\marmot@body] (1.22,1.6) circle (0.1);
+ \fill[red,path fading=marmot@blush] (0.63,1.6) circle (0.1);
+ \fill[red,path fading=marmot@blush] (1.22,1.6) circle (0.1);
\fi
%
% Wiskers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%