答案1
答案2
好的,通过仔细查看tikzpeople
包中的文件,我成功了。
要定义新的组合(builderalice
就我而言),您需要定义一个新文件tikzpeople.shape.builderalice.sty
,在其中组合各个部分和相应的颜色。然后您需要调用\tikzpeople@declareshape{builderalice}
(因为它不应从外部调用,并且包含@
您需要将其包装在\makeatletter
和中\makeatother
)。
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usepackage{tikzpeople}
\usepackage{filecontents}
\begin{filecontents}{tikzpeople.shape.builderalice.sty}
\newcommand{\tikzpeople@builderalice@paint}{
\tikzpeople@person@paintshirt
\tikzpeople@alice@paintshirtdetails
\tikzpeople@person@paintrighthorn
\tikzpeople@person@painthead
\tikzpeople@alice@painthair
\tikzpeople@person@paintgoatee
\tikzpeople@person@paintlefthorn
\tikzpeople@person@painthalo
\tikzpeople@builder@painthat
}
\newcommand{\tikzpeople@builderalice@definecolors}{
\definecolor{shirt}{RGB}{253,156,40}
\definecolor{undershirt}{RGB}{232,232,232}
\definecolor{skin}{RGB}{148,60,19}
\definecolor{hair}{rgb}{0,0,0}
\definecolor{hat}{RGB}{238,175,0}
}
\end{filecontents}
\makeatletter
\tikzpeople@declareshape{builderalice}
\makeatother
\begin{document}
\begin{tikzpicture}[]
\node[builder,minimum size=1.5cm] (T) at (-1,0) {};
\node[alice,minimum size=1.5cm] (N) at (1,0) {};
\node[builderalice,minimum size=1.5cm] (A) at (3,0) {};
\end{tikzpicture}
\end{document}
答案3
这似乎是一个 XY 问题。您真正想要的可能是 TikZlings 包,您可以在其中随意添加配件。
\documentclass[tikz,border=1mm]{standalone}
\usepackage{tikzlings}
\begin{document}
\begin{tikzpicture}
\owl
\thing[tophat,scale=1.5,yshift=-0.6cm,xshift=-0.05cm]
\begin{scope}[xshift=2cm]
\bear[magichat=violet,
magicstars=yellow!80!brown]
\end{scope}
\end{tikzpicture}
\end{document}