小编Hel*_*hne的帖子

在 tikzpictures 中使用宏?

tikzpicture我尝试使用以下内容压缩 a newcommand

\newcommand{\tchild}[3]{ child { node{#2} #3 edge from parent node[above]{#1} } }
%intended usage: \tchild{edge label}{vertex label}{child nodes}
Run Code Online (Sandbox Code Playgroud)

如果我将其应用于以下示例,我会得到一份工作文档。然而,下面给出的示例pdflatex给出了 a Package pgf Error: No shape named is known.(注意“named”和“is”之间的双空格)。如果我手动展开第二个,tchild我也会得到一份工作文档。有什么想法这里出了什么问题吗?

\begin{tikzpicture}
    \node{0} [grow'=right]
        \tchild{0}{1}{}
        \tchild{1}{0}{};
\end{tikzpicture}
Run Code Online (Sandbox Code Playgroud)

macros latex tikz

5
推荐指数
1
解决办法
4615
查看次数

标签 统计

latex ×1

macros ×1

tikz ×1