6

The tool pdflatex hangs when I leave a '[' pending after the beginning of a TikZ picture. The same thing happens when I use for instance MikTeX that uses pdflatex under the hood. It happens both on Linux and on Windows.

Minimal example:

\documentclass{article}
\usepackage{tikz}
\begin{document}
  \begin{tikzpicture}[
    \draw[blue] (0,0) -- (1,1);
  \end{tikzpicture}
\end{document}

We're using pdflatex for batch processing. What can we do to avoid it from hanging?

1 Answers1

6

the default definition of \tikz@signal@path is a little dangerous (a "quark" in expl3 code terminology) I think it's safe to use a slightly less dangerous \protected definition

\documentclass{article}
\usepackage{tikz}
\makeatletter
\protected\def\tikz@signal@path{\tikz@signal@path}%
\makeatother
\begin{document}
  \begin{tikzpicture}[
    \draw[blue] (0,0) -- (1,1);
  \end{tikzpicture}
\end{document}

which causes tex to show an error rather than loop.

! Use of \tikz@@scope@env doesn't match its definition.
David Carlisle
  • 757,742