You are terminating the \path
with a semicolon after making the 1a
node but not starting a new path, so the second node
invocation does nothing.
If you check the log the error is preceded by
Missing character: There is no ( in font nullfont!
Missing character: There is no - in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no , in font nullfont!
Missing character: There is no - in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no ) in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no ( in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no ) in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no ; in font nullfont!
! Package pgf Error: No shape named `2a' is known.
indicating the (-2, -1) node (2a) {12};
line is trying to be printed rather than parsed.
You also need a semicolon to terminate the \draw
command.
\documentclass{report}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[nodes={draw, circle}]
\path
(0, 0) node (1a) {5}
(-2, -1) node (2a) {12};
\draw
(1a)--(2a);
\end{tikzpicture}
\end{document}
Depending on your use case though
\documentclass{report}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[nodes={draw, circle}]
\node (1a) at (0, 0) {5};
\node (2a) at (-2, -1) {12};
\draw (1a)--(2a);
\end{tikzpicture}
\end{document}
might be easier to write.
{5}
, i.e. without the semicolon: you describe one (longer) path, not two.