[Tex/LaTex] pdflatex nonstopmode with TikZ stops compiling

compilingerrorstikz-pgf

I compiled a TikZ code using pdflatex -interaction=nonstopmode. Depending on code errors, compiling stops. I want to know what went wrong. Let me show you two cases, both of which involve a code error each.

Case 1: "$" is missing in the 6th line (\node at…). Compiling does NOT stop.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
     \begin{tikzpicture}
          \draw [help lines] (0,0) grid (2,2);
          \node at (1,1) {$x^2};
     \end{tikzpicture}
\end{document}

Case 2: ";" is missing at the end of the 5th line (\draw…). Compiling STOPS. I have to press keys to continue.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
     \begin{tikzpicture}
          \draw [help lines] (0,0) grid (2,2)
          \node at (1,1) {$x^2$};
     \end{tikzpicture}
\end{document}

Is Case 2 an expected result? If so, how can I make compiling non-stop? Your help is appreciated.

Best Answer

Processing does not stop, it just goes into a tight loop

tikz@signal@path ->\tikz@signal@path 

\tikz@signal@path ->\tikz@signal@path 

\tikz@signal@path ->\tikz@signal@path 

\tikz@signal@path ->\tikz@signal@path 

\tikz@signal@path ->\tikz@signal@path 

[15]+  Stopped                 pdflatex -interaction=nonstopmode 

You can see this if you run the following with the % removed. Beware do not do this unless you are confident you can stop a misbehaving program: it will write an arbitrarily large log file until you stop it.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
%\tracingmacros1
%tracingonline1
     \begin{tikzpicture}
          \draw [help lines] (0,0) grid (2,2)
          \node at (1,1) {$x^2$};
     \end{tikzpicture}
\end{document}