[Tex/LaTex] Shell-escape in Texmaker


This is a frequently asked question but none I have seen actually helped me. My problem is that I installed Gnuplot 5 and I have not been able to make it work in the TeXworks. The figure I have been trying to plot is this:



        title={Contour plot, view from top},
        contour gnuplot={levels={0.8, 0.4, 0.2, -0.2}}

As many answers have suggested I tried to call gnuplottex in the preamble with the code


yet this did not help and instead I have been getting the error

Package pgfplots Error: sorry, plot file{.._contourmp0.table} could not be opened. See the pgfplots package documentation for explanation 

followed by the warning that Shell escape is not enabled.

Could you please help me in making this work?

EDIT I am aware that there is a phenomenally identical question on this site, namely gnuplottex with windows 8.1 but it does not address my problem. The problem persists even after using \usepackage[miktex]{gnuplottex}, as I pointed out from the beginning.

Following suggestions, I have made sure there is a path towards the bin directory and have included the statement --enable-write18 in the PdfLaTeX command line of TeXworks. All other suggestions are of course welcome.

Also here is my attempt to compile through the command line:

enter image description here

And my Texmaker configuration:

enter image description here

Best Answer

You seem to have a MiKTeX distribution. Add the --enable-write18 option to pdflatex options by opening the Options menu, Configure TeXmaker submenu. You'll get this pop-up window:

enter image description here

Related Question