![Tikz 中的动物图标](https://linux22.com/image/321088/Tikz%20%E4%B8%AD%E7%9A%84%E5%8A%A8%E7%89%A9%E5%9B%BE%E6%A0%87.png)
答案1
网站上已经有绘制鸭子的代码了。因此,只剩下画乌龟的代码了。我希望乌龟足够像陆龟,这样乌龟才能通过审查:
根据您的喜好调整颜色。
\documentclass[border=10pt,tikz,svgnames]{standalone}
\usetikzlibrary{calc}
\colorlet{lliw symbolau cefndir}{DarkSlateBlue}
\tikzset{
pics/crwban/.style n args={2}{
code={
\path [fill=#1, draw=#1, double=lliw symbolau cefndir, line width=.025*#2, double distance=.01*#2, pic actions]
(-.5*#2,-.2*#2)
[out=-20, in=-160] to coordinate [pos=.15] (troed1a) coordinate [pos=.2] (troed1b) coordinate [pos=.3] (troed1d) coordinate [pos=.65] (troed2a) coordinate [pos=.7] (troed2b) coordinate [pos=.8] (troed2e) coordinate [pos=.85] (troed2d) coordinate [pos=.9] (crwb4) (.25*#2,-.2*#2)
[out=20, in=-90] to (.3*#2,-.15*#2) coordinate (crwb3)
[out=90, in=20] to coordinate [pos=.5] (crwb5) (.25*#2,-.1*#2) coordinate (crwb2)
[out=-160, in=-20] to (-.5*#2,-.1*#2) coordinate (crwb1)
[out=160, in=90] to (-.55*#2,-.15*#2)
[out=-90, in=160] to cycle
(crwb1)
[out=75, in=180] to coordinate (crwb6) (-.125*#2,.25*#2)
[out=0, in=105] to (crwb2)
[out=-160, in=-20] to cycle
(crwb4)
[out=-15, in=-70] to (.55*#2,.1*#2)
[out=110, in=0] to (.5*#2,.125*#2)
[out=180, in=75] to (.45*#2,.1*#2)
[out=-105, in=15] to (crwb5)
(troed1a)
[out=-135, in=-170] to ++(.125*#2,-.1*#2)
[out=10, in=-20] to coordinate (troed1c) ++(-.05*#2,.05*#2)
[out=160, in=-80] to (troed1b)
(troed1d)
[out=-135, in=10] to ++(.05*#2,-.05*#2)
[out=-170, in=-20] to (troed1c)
(troed2a)
[out=-135, in=-170] to ++(.125*#2,-.1*#2)
[out=10, in=-20] to ++(-.05*#2,.05*#2)
[out=160, in=-80] to (troed2b)
(troed2e)
[out=-135, in=-170] to ++(.105*#2,-.09*#2)
[out=10, in=-20] to ++(-.05*#2,.05*#2)
[out=160, in=-80] to (troed2d)
;
\path [draw=lliw symbolau cefndir, line cap=round, line join=round, line width=.01*#2]
(crwb6) ++(0,-.025*#2)
[out=-100, in=80] to coordinate (crwb13) ($(crwb1)!1/2!(crwb2) - (0,.04*#2)$)
(crwb6) ++(.01*#2,-.025*#2)
[out=-35, in=120] to coordinate (crwb11) ($(crwb1)!3/4!(crwb2) - (0,.02*#2)$)
(crwb6) ++(-.01*#2,-.025*#2)
[out=-145, in=60] to coordinate (crwb12) ($(crwb1)!1/4!(crwb2) - (0,.02*#2)$)
(crwb6) ++(-.02*#2,-.015*#2)
[out=-175, in=45] to coordinate [pos=.5] (crwb7) coordinate (crwb8) ($(crwb1)!1/9!(crwb2) + (0,.1*#2)$)
(crwb6) ++(.02*#2,-.015*#2)
[out=-5, in=135] to coordinate [pos=.5] (crwb9) coordinate (crwb10) ($(crwb1)!8/9!(crwb2) + (0,.1*#2)$)
(crwb7) ++(-.015*#2,.025*#2) [out=-35, in=170] to ($(crwb9) + (.05*#2,-.025*#2)$)
(crwb8) ++(-.01*#2,-.005*#2) [out=15, in=-170] to ($(crwb10) + (.005*#2,0)$)
(crwb8)
[out=-100, in=-160] to (crwb12)
[out=20, in=170] to (crwb13)
[out=-10, in=170] to (crwb11)
[out=-10, in=-80] to (crwb10)
;
}
},
}
\begin{document}
\begin{tikzpicture}
\pic at (3.1,0) {crwban={DarkSlateGrey}{10pt}};
\pic at (2.5,0) {crwban={DarkSlateGrey}{20pt}};
\pic at (1.55,0) {crwban={DarkSlateGrey}{30pt}};
\pic at (.25,0) {crwban={DarkSlateGrey}{40pt}};
\pic at (-1.5,0) {crwban={DarkSlateGrey}{50pt}};
\end{tikzpicture}
\colorlet{lliw symbolau cefndir}{white}
\begin{tikzpicture}
\pic at (4,0) {crwban={Crimson}{25pt}};
\pic at (3,0) {crwban={Gold}{25pt}};
\pic at (2,0) {crwban={MediumTurquoise}{25pt}};
\pic at (0,0) {crwban={Green}{25pt}};
\pic at (1,0) {crwban={DodgerBlue}{25pt}};
\end{tikzpicture}
\end{document}
答案2
\documentclass{standalone}
\usepackage{tikz}
\usepackage{graphicx}
\def\D{\includegraphics[width=3ex]{duck}}
\def\T{\includegraphics[width=4ex]{turtle}}
\tikzset{
D/.style = {inner sep=2pt, font={\D}, anchor=south},
T/.style = {inner sep=2pt, font={\T}, anchor=south}
}
\begin{document}
\tikz{
\foreach \animal [count=\x] in {D,T,D,T,D,T,T,D,T,D,D}
\node[\animal] at (4*\x ex,0) {};
}
\end{document}
答案3
只有部分解决方案,因为缺少乌龟,但对于鸭子,我有适合您的完美方案:
\documentclass{standalone}
\usepackage{tikzducks}
\begin{document}
\begin{tikzpicture}
\duck
\end{tikzpicture}
\end{document}
随着开发版本包中tikzducks
,你可以将鸭子“龟化”:
\documentclass{standalone}
\usepackage{tikzducks}
\begin{document}
\begin{tikzpicture}
\duck[mask=purple!50!blue!70!white,body=green!50!brown,jacket=brown!80!yellow,bill=green!20!brown]
\end{tikzpicture}
\begin{tikzpicture}
\duck[mask=blue!70!white,body=green!50!brown,jacket=brown!80!yellow,bill=green!20!brown]
\end{tikzpicture}
\begin{tikzpicture}
\duck[mask=orange,body=green!50!brown,jacket=brown!80!yellow,bill=green!20!brown]
\end{tikzpicture}
\begin{tikzpicture}
\duck[mask=red,body=green!50!brown,jacket=brown!80!yellow,bill=green!20!brown]
\end{tikzpicture}
\end{document}