[Tex/LaTex] pdf/Tikz Undefined Control Sequence

errorstikz-pgf

I am drawing a Picture using TikZ with two \draw commands.
The first one works but on the second LaTeX claims

! Undefined control sequence. l.44 \draw (0,2) -- (-.5,2);

What can I do to fix that…
Thanks in the preface

EDIT: 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}

Best Answer

Try this. It should work.

\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}
Related Question