7

i want to compile several pgfplots pictures with lualatex, since it dynamically allocates memory for compiling (in contrast to pdflatex). In some plots, like my MWE.tex given below, i want to use a contour plot. This is typically done with gnuplot. To compile a document like this i need to use --shell-escape, such that gnuplot command can be executed while compiling the document.

\documentclass[a4paper]{article} 
\usepackage[utf8]{luainputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
  \begin{axis}
    \addplot3[contour gnuplot] 
    {x+y};    
  \end{axis}  
\end{tikzpicture}
\end{document}

If i use

pdflatex --shell-escape MWE.tex

everything works fine, and the log says something along the lines

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex 2016.6.12)  13 JUN 2016 10:46
entering extended mode
 \write18 enabled.
....
Package pgfplots notification 'compat/show suggested version=true': document has been generated with the most recent feature set    (\pgfplotsset{compat=1.13}).

\openout3 = `MWE_contourtmp0.dat'.

\openout3 = `MWE_contourtmp0.script'.
runsystem(gnuplot "MWE_contourtmp0.script")...executed.

If i use lualatex --shell-escape MWE.tex i get the following error:

This is LuaTeX, Version 0.95.0 (TeX Live 2016)  (format=lualatex 2016.6.12)  13 JUN 2016 10:52
 system commands enabled.
...
Package pgfplots notification 'compat/show suggested version=true': document has
 been generated with the most recent feature set (\pgfplotsset{compat=1.13}).

Package pgfplots info on input line 10: Using 'lua backend=false' for plot 0 (type 'contour external'): plot handler does not support LUA.

\openout3 = MWE_contourtmp0.dat

\openout3 = MWE_contourtmp0.script
gnuplot "MWE_contourtmp0.script"

! Package pgfplots Error: sorry, plot file{MWE_contourtmp0.table} could not be opened.

The .table file exists and looks identical to the one created by pdflatex, but it says that it cannot be executed.

(I just installed texlive 2016 yesterday, so everything should be up to date.)

  • 2
    Add \usepackage{shellesc}. – Ulrike Fischer Jun 13 '16 at 9:19
  • Thank you. That was exactly the problem - i thought --shell-escape should be enough, since it says " system commands enabled." in the log. Nevermind, now it works fine. – Nils Jun 13 '16 at 11:20
  • Read the documentation of shellesc to understand the problem with the new luatex. – Ulrike Fischer Jun 13 '16 at 11:40
  • I have already submitted a patch to fix that to the author's of pgf and pgfplots, but didn't get any answer :-( – norbert Jun 13 '16 at 12:57
  • @UlrikeFischer A summary or an answer maybe? – percusse Jun 16 '16 at 20:25
2

This is a bug introduced by lualatex shipped with TexLive 2016.

The next version of pgfplots will fix the incompatibility (will be 1.14).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.