
我正在使用 TikZ 和兩個命令繪製圖片\draw
。
第一個有效,但對第二個 LaTeX 聲明有效
! Undefined control sequence. l.44 \draw (0,2) -- (-.5,2);
我能做什麼來解決這個問題...
感謝在前言中
編輯:MWE
\begin{figure}[htbp]
\centering
\begin{tikz}
% First the house
\draw [thick,color=gray] (0,0) -- (0,2) -- (1,3) -- (2,2) -- (2,0) -- cycle (0,2) -- (2,2);
% This command doesnt work...
\draw (0,1) -- (-.5,1);
\end{tikz}
\end{figure}
答案1
嘗試這個。它應該有效。
\begin{tikzpicture}
% First the house
\draw [thick,color=gray] (0,0) -- (0,2) -- (1,3) -- (2,2) -- (2,0) -- cycle (0,2) -- (2,2);
% This command DOES work!
\draw (0,1) -- (-.5,1);
\end{tikzpicture}