[Tex/LaTex] Does the lualatex shell enable behavior differ from pdflatex on purpose

luatexpdftexshell-escape

I am trying to use TikzEdt, an editor for TikZ graphics. For some tasks TikZ needs to call other commands so I tried to enable this by the parameter --shell-escape passed to lualatex (on Windows, MiKTeX 2.9). Strangely this fails to enable the feature. After some fiddling around it turns out that it even fails with this MWE:

    \documentclass{standalone}

    \begin{document}
    \write18{echo SHELL ENABLED}
    \end{document}

TikzEdt appends the switch and calls lualatex test.tex --shell-escape which does not seem to work. The same command with pdflatex works nicely. It turns out that other than in pdflatex the order of arguments seem to play a role in lualatex, lualatex --shell-escape test.tex runs nicely. Unfortunately TikzEdt only allows to append switches not insert switches. Is this a bug in lualatex or is TikzEdt using a wrong assumption?

Best Answer

Let's try a simple document test.tex; the package pdftexcmds is loaded in order to have \pdf@shellescape available with all engines.

\documentclass{article}
\usepackage{pdftexcmds}
\makeatletter
\count@=\pdf@shellescape
\showthe\count@
\makeatother

\begin{document}
Ciao
\end{document}

Here's what happens with

  • pdflatex test
  • pdflatex test --shell-escape
  • lualatex test
  • lualatex test --shell-escape
  • xelatex test
  • xelatex test --shell-escape

The execution stops because of \showthe, showing

> 2.
l.5 \showthe\count@

in all six invocations (TeX Live 2012 on Mac OS X, but I don't think it's different with other platforms).

If we put --shell-escape at its proper place, the execution of any of

  • pdflatex --shell-escape test
  • lualatex --shell-escape test
  • xelatex --shell-escape test

stops showing

> 1.
l.5 \showthe\count@

This means that the setting of --shell-escape can be done only in "infix notation" and that the option has no effect if postfixed.

As kindly as usual, Paulo Cereda confirms that, on MiKTeX, options can be specified after the file name for pdftex and xetex, but not for luatex. As the most common syntax format on other systems is with "infix" options, my opinion is that TikZEdt is wrong in its assumptions.

Related Question