PGF-TikZ 命名形狀錯誤

PGF-TikZ 命名形狀錯誤

當我運行下面的 LaTeX 程式碼時,出現錯誤

包 pgf 錯誤:沒有名為 h02 的已知形狀

同時,我在 for 迴圈中用\node標籤標記了該物件。h\x0在我看來,這是應該做的正確的事。我什至取消了該命令的註釋\coordinate並將其更改h02.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}

相關內容