# Latex Tikz externalize with shell escape does not work

Im trying to use the Tikz externalize, because for some tikz pictures the file gets to big and exceeds the memory size. I found a lot of other topics with similar problems, but non of the solutions worked for me or I did not implement them well enough. I'm using Winedt 10.2(also tried Winedt 9) Mixtex 2.9

The structure of the report:

Final_Report.tex
--Layout.tex
--Simulation_model.tex
----plot_baseunit.tex(Tikz picture)


Final_Report.tex

\documentclass[10pt,a4paper]{report}
\input{./Lay_out/layout.tex}
\begin{document}
\input{./Chapters/Simulation_Model/Simulation_Model.tex}
\end{document}


layout.tex

\usepackage{tikz,pgfplots}
\usepackage{subcaption}
%\usepackage[pdftex]{graphicx}
\usetikzlibrary{external,calc,patterns,angles,quotes,shapes.geometric,positioning}
\pgfplotsset{plot coordinates/math parser=false}
\tikzexternalize[prefix=figures/,shell escape=-enable-write18]
\newlength\figureheight
\newlength\figurewidth
%Standard figure dimension
\newcommand{\plotx}{12.0cm}
\newcommand{\ploty}{6.0cm}
\newcommand{\plotysub}{3.0cm} %y-dimension of seperate subplots
%Subplot dimensions (2 plots wide subplots)
\newcommand{\subtwoplotx}{5.25cm}
\newcommand{\subtwoploty}{4.5cm}
\tikzstyle{block} = [draw, rectangle, node distance=2.0cm, minimum height=3em, minimum width=4em]
\tikzstyle{sum} = [draw, circle, node distance=2.0cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]


Simulation_model.tex

\begin{figure}[H]
\resizebox{\textwidth}{!}{%
\input{./figures/plot_baseunit.tex}
}%
\caption{The throughput and cycle time of the production line plotted against the process time of a base unit workstation, as bottleneck of the system. The horizontal dotted lines represent the designed throughput and cycle time of the Honda/JLR(green) and Audi/Porsche roof systems(purple).}
\label{fig:Base_unit_through}
\end{figure}


When I try to run this using PDFTeXify it gives the following error.

   (figures/plot_baseunit.tex
===== 'mode=convert with system call': Invoking 'pdflatex -halt-on-error -interaction=batchmode -jobname
"figures/Final_Report-figure0" "\def\tikzexternalrealjob{Final_Report}\input{Final_Report}"' ========

! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error-interact
ion=batchmode -jobname "figures/Final_Report-figure0" "\def\tikzexternalrealjob
{Final_Report}\input{Final_Report}"
did NOT result in a usable output file
'figures/Final_Report-figure0' (expected one of .pdf:.jpg:.jpeg:.png:).
Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'.
Sometimes it is also named 'write 18' or something like that. Or maybe  the command simply failed?
Error messages can be found in 'figures/Final_Report-figure0.log'. If you continue now, I'll try to typeset the picture.


If I just press enter the right figures come out, but this does not work for large files and then the memory size is exceeded.

• How did you configure WinEdt to add -shell-escape (or --enable-write18) to the switches of pdflatex`? – Bernard Jun 24 '17 at 13:34