6

The message "Package tikz Error: Sorry, the system call 'pdflatex -hell-escape -halt-on-e" appears when I compile with pdflatex and also when I compile with pdflatex-shell-escape.

If I remove \ tikzexternalize from the preamble it compiles correctly, but where I know it must be used if one wishes to include tikz images in other text files. Which function has exactly \ tikzexternalize because this case does not need to be used.

PS: taken from How to properly include tikz pictures in other tex files?

Main file

\documentclass{book}
\usepackage{pgf}
\usepackage{tikz}

\usetikzlibrary{shapes,external}
\tikzexternalize

\usepackage{lipsum}

\tikzset{naming/.style={align=center,font=\footnotesize}}
\tikzset{area/.style = {draw, shape = regular polygon, regular polygon sides = 10, thick, minimum width = 5cm}}

\begin{document}
    \lipsum[1]

    \input{tikzcode}

    \lipsum[2] 


\end{document}

Simplified file (tikzcode)

\begin{figure}[htb]
    \centering
    \begin{tikzpicture}[font=\footnotesize]
    \node [area] at (0,0) (cell1) {};
    \end{tikzpicture}
    \caption{test}
    \label{fig:test}
\end{figure}

Edited:

Correct has a space after pdflatex (see image 1) the configuration is for TeXstudio in MikTex.

enter image description here

In the image 2 the error appears but it produces the document.

enter image description here

Edited 2

Here are the two images compiled with pdflatex -shell-escape

enter image description here

enter image description here

8
  • 1
    I just double checked and used precisely pdflatex -synctex=1 -interaction=nonstopmode -shell-escape, and there is no error on my machine. Of course, I do not question that you get an error, but I cannot reproduce it.
    – user121799
    Commented Dec 3, 2018 at 2:34
  • Add ESCAPE: \the\pdfshellescape to your document (and comment the picture), compile with your --shell-escape call and tell us what you get as output. Commented Dec 3, 2018 at 8:14
  • @Ulrike Fischer Excuse my ignorance, [ESCAPE: \the\pdfshellescape] I add it before begin {document} or after it? or did not understand correctly? Commented Dec 3, 2018 at 15:35
  • Try it out. One of the two possibilities is wrong and will led to an error. Commented Dec 3, 2018 at 15:42
  • 1
    There is no error in the log. Close texstudio and restart. If it stills shows an error, complain at the texstudio issue tracker. And better don't use spaces in file names. Commented Dec 3, 2018 at 17:11

2 Answers 2

3

not sure if you where able to fix this, but I ran into the same problem and noticed the following:

  1. The only reason why the image is generated even though you see the error is because you have the pdf created already. If you delete everything (except tour .tex file) and run again, the error will result in nothing being generated.
  2. The externalize function creates a bunch of pdf files for each tikzpicture. This depends on many things, such as markers for example, so if you are redoing one image, you might need to delete several pdf files in the external folder where they are being created (which is a pain since you can only be sure of the name you are giving to the main image file). If you don't do so, you'll encounter the error you mention.
  3. The other reason why I encounter the same error is because when I reopened texstudio, the compilation command had reverted back to normal (i.e. "-shell-escape" was not there).

Hopefully some of this comments help you.

1

I recently ran into this error and could figure out a solution. I am using Tex on the laptop of my company and stored my main Tex file on a network drive. I was constantly getting the error message, despite compiling with -—shell escape.

When I switched the folder of the main document to my desktop, suddenly it worked without any error messages.

Maybe this can help you or anyone else running into this error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .