PGF-TikZ 命名形状错误

PGF-TikZ 命名形状错误

当我运行下面的 LaTeX 代码时,出现错误

程序包 pgf 错误:没有已知的名为 h02 的形状

同时,我在 for 循环中用\node标签标记了对象。在我看来,这是应该做的正确的事情。我甚至取消注释了命令行,并更改为,但仍然收到错误h\x0\coordinateh02.westv02.west

程序包 pgf 错误:没有已知的名为 v02 的形状

这是我的代码:

\documentclass[10pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[place/.style={rectangle,draw=blue,inner sep=0pt,minimum size=5mm},scale = 1.6,every lower node part/.style={font=\tiny}]

% Horizontal Vertices
\foreach \x in {0,1,2}
{
    \draw (\x,0) circle (0.03cm);
    \fill (\x,0) circle (0.03cm);
    \node (h\x0) at (\x,0) [place] {};
    % \coordinate (v\x0) at (\x,0);
}
\node [left, every lower node part] at (h02.west) {$N_{1}=3$};
\end{tikzpicture}
\end{document}

答案1

我看到了错误。名称标签(h02.west)应该是(h20.west)

\documentclass[10pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[place/.style={rectangle,draw=blue,inner sep=0pt,minimum size=5mm},scale = 1.6,every lower node part/.style={font=\tiny}]

% Horizontal Vertices
\foreach \x in {0,1,2}
{
    \draw (\x,0) circle (0.03cm);
    \fill (\x,0) circle (0.03cm);
    \node (h\x0) at (\x,0) [place] {};
    % \coordinate (v\x0) at (\x,0);
}
\node [left, every lower node part] at (h20.west) {$N_{1}=3$};
\end{tikzpicture}
\end{document}

相关内容