summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzlings/tikzlings-bats.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-bats.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tikzlings/tikzlings-bats.sty92
1 files changed, 52 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-bats.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-bats.sty
index 3d1bbb27fd6..3c0880f950c 100644
--- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-bats.sty
+++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-bats.sty
@@ -9,10 +9,10 @@
%% https://github.com/samcarter/tikzlings
%%
%% Released under the LaTeX Project Public License v1.3c or later
-%% See http://www.latex-project.org/lppl.txt
+%% See https://www.latex-project.org/lppl.txt
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{tikzlings-bats}[2022/06/17 version v1.0 Drawing bats in TikZ]
+\ProvidesPackage{tikzlings-bats}[2025/01/05 version v2.2 Drawing bats in TikZ]
\RequirePackage{tikz}
\RequirePackage{tikzlings-addons}
@@ -26,13 +26,14 @@
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\csname bathookforeground\endcsname
\csname tikzlinghookforeground\endcsname
- %
+ %
}
\newif\ifbat@threeD
\newif\ifbat@back
\newif\ifbat@contour
\newif\ifbat@teeth
+\newif\ifbat@openmouth
\tikzset{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -50,39 +51,41 @@
body/.store in = \bat@body,
body = black!75!white,
ears/.store in = \bat@ears,
- ears = \bat@body,
+ ears = \bat@body,
eye/.store in = \bat@eye,
eye = white,
pupil/.store in = \bat@pupil,
pupil = black,
mouth/.store in = \bat@mouth,
- mouth = black,
+ mouth = black,
feet/.store in = \bat@feet,
- feet = orange,
+ feet = orange,
wings/.store in = \bat@wings,
- wings = 1,
+ wings = 1,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% options
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- teeth/.code = \bat@teethtrue
- \def\bat@teeth{#1},
+ teeth/.code = \bat@teethtrue
+ \def\bat@teeth{#1},
teeth/.default = white,
- 3D/.code = \bat@threeDtrue,
- back/.code = \bat@backtrue,
+ openmouth/.code = \bat@openmouthtrue,
+ open mouth/.forward to = /bat/openmouth,
+ 3D/.code = \bat@threeDtrue,
+ back/.code = \bat@backtrue,
contour/.code = \bat@contourtrue
\def\bat@contour{#1}
\def\bat@antennas{#1}
\def\bat@mouth{#1},
- contour/.default = black,
- outline/.forward to = /bat/contour,
+ contour/.default = black,
+ outline/.forward to = /bat/contour,
}
\def\bat@draw{%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
- % minimal bounding box size
+ % minimal bounding box size
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\path (-0.44,0.0) rectangle (0.44, 2.2);
@@ -99,7 +102,7 @@
\pgfmathsetmacro{\yscalefactor}{\tmpscaleD}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
+ %
% switch between 2D, 3D and contours, from
% https://chat.stackexchange.com/transcript/message/45991801#45991801
%
@@ -117,7 +120,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Body parts
- %
+ %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -171,13 +174,17 @@
%
% Teeth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifbat@teeth
- \bat@part@draw[\bat@teeth] (-0.1,1.36) -- (-0.12,1.3) -- (-0.14,1.38) -- cycle;
- \bat@part@draw[\bat@teeth] (0.1,1.36) -- (0.12,1.3) -- (0.14,1.38) -- cycle;
+ \bat@part@draw[\bat@teeth] (-0.1,1.36) -- (-0.12,1.3) -- (-0.14,1.38) -- cycle;
+ \bat@part@draw[\bat@teeth] (0.1,1.36) -- (0.12,1.3) -- (0.14,1.38) -- cycle;
\fi
%
% Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \draw[\bat@mouth,line width=\scalingfactor*0.4pt] (0.18, 1.42) arc [start angle=-40, end angle=-140, radius=0.23];
- %
+ \ifbat@openmouth
+ \filldraw[\bat@mouth,line width=\scalingfactor*0.4pt] (0.18, 1.42) arc [start angle=-40, end angle=-140, radius=0.23];
+ \else
+ \draw[\bat@mouth,line width=\scalingfactor*0.4pt] (0.18, 1.42) arc [start angle=-40, end angle=-140, radius=0.23];
+ \fi
+ %
%
\fi% back
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -198,63 +205,68 @@
%
%\subsection{Package name}
%
-%\begin{tcolorbox}[lower separated=false, lefthand width=.8\linewidth]
-%\vspace*{0.5cm}
-%\lstinline|\usepackage{tikzlings-bats}|
-%\vspace*{0.5cm}
+%\begin{tcolorbox}[title={Package usage}]
+%\begin{samcode}
+%\usepackage{tikzlings-bats}
+%\end{samcode}
%\end{tcolorbox}
%
%\subsection{Basic Usage}
%
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Basic bat}}
%\bat
%\end{tcblisting}
%
%\subsection{Options}
%
%The basic bat can be modified by changing its colour:
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Body colour}}
%\bat[body=blue]
%\end{tcblisting}
%
%In addition to the colour of the body, the colour of various body parts can be adjusted:
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Eye colour}}
%\bat[eye=red]
%\end{tcblisting}
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Pupil colour}}
%\bat[pupil=red]
%\end{tcblisting}
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Mouth colour}}
%\bat[mouth=red]
%\end{tcblisting}
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Ear colour}}
%\bat[ears=red]
%\end{tcblisting}
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Foot colour}}
%\bat[feet=red]
%\end{tcblisting}
%
-%The spread of the wings can be adjusted by passing values between 0 and 1 to the \lstinline|wings| option:
-%\begin{tcblisting}{}
+% The bat can open its mouth:
+%\begin{tcblisting}{title={Open mouth}}
+%\bat[openmouth]
+%\end{tcblisting}
+%
+%With the \saminline|wings| option, one can adjust the spread of the wings. It accepts values between~0 and~1:
+%\begin{tcblisting}{title={Wing span}}
%\bat[wings=0.5]
%\end{tcblisting}
%
-%To turn the bat into a vampire bat, the \lstinline|teeth| option can be used:
-%\begin{tcblisting}{}
+%To turn the bat into a vampire bat, the \saminline|teeth| option can be used:
+%\begin{tcblisting}{title={Vampire}}
%\bat[teeth=white]
%\end{tcblisting}
%
%To view the bat from behind:
-%\begin{tcblisting}{}
+%\begin{tcblisting}{title={Back view}}
%\bat[back]
%\end{tcblisting}
%
-%The key \lstinline|3D| will make the bat 3-dimensional:
-%\begin{tcblisting}{}
+%The key \saminline|3D| will make the bat 3-dimensional:
+%\begin{tcblisting}{title={3D view}}
%\bat[3D]
%\end{tcblisting}
%
-%And finally the \lstinline|contour| key will only draw the outlines:
-%\begin{tcblisting}{}
+%And finally the \saminline|contour| key will only draw the outlines:
+%\begin{tcblisting}{title={Contours}}
%\bat[contour=black]
%\end{tcblisting}