Searching 'tikz undefined control sequence draw' usually means the previous line lacks a semicolon. Minimal examples, a 3-step checklist, and a DrawFig workflow to avoid syntax traps.
\draw? Find the missing semicolon in 3 minutes\draw is clearly correct?
! Undefined control sequence.
l.42 \draw (A) -- (B);
Many people edit line 42 — the real bug is often a missing semicolon ; at the end of line 41. This is the most common case behind searches like “tikz undefined control sequence draw” or “tikz missing semicolon”.
📌 Full overview of 7 error types: TikZ won't compile? Seven common errors and a DrawFig workflow
\draw “undefined”\node, \draw, \path, and similar commands usually end a path or node declaration with ;. TeX reads continuously: if the previous statement never closed, the next line's \draw is parsed as an illegal token inside that statement → Undefined control sequence, with the line number pointing at \draw.
\begin{tikzpicture}
\node (A) {A} % ← missing semicolon
\draw (A) circle (5pt); % error often reported here
\end{tikzpicture}
\begin{tikzpicture}
\node (A) {A}; % ← semicolon required
\draw (A) circle (5pt);
\end{tikzpicture}
;? (Comment lines with % excepted.)\node + one \draw; confirm the environment, then add complexity back.tikzpicture, recompile, narrow to the statement missing ;.\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (A) at (0,0) {A};
\draw (A) circle (3pt);
\end{tikzpicture}
\end{document}
| Symptom | Might actually be |
|---|---|
\end{tikzpicture} reported undefined |
Same as above, or unclosed environment |
Error around right=of |
Missing \usetikzlibrary{positioning} → tikzlibrary guide |
| Whole Overleaf project red | Start with Overleaf TikZ checklist |
\draw …;. When done, Export → TikZ and paste into your paper for one compile pass.
Pricing: Canvas editing and SVG/PNG/PDF export are free, no sign-in. TikZ export costs 3 credits per use (sign-in required; 30 credits/day). See credits rules.
Suggested flow: edit on canvas → export TikZ → compile standalone → merge into the main document.
; first.\draw.