# texlive shell escape problems with psfrag

I work with some scripts that automatically convert the fonts in a plot using psfrag and pstool to another font.

However these fail if I use texlive. They work with Miktex. Since I get requests from Linux users to make the scripts work on Linux I would like to know better why I get these problems.

The script is based on Matlab. If you are interested in all details see svn source and explanation/documentation.

The code that is created is like this one

\documentclass[11pt, oneside]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage[]{pstool}
\pagestyle{empty}

\begin{document}
\centering
\psfragfig{TEMP9134}
\end{document}


with the Figure file TEMP9134, which contains all psfrag calls

\providecommand\matlabtextA{\color[rgb]{0.000,0.000,0.000}\fontsize{14.5}
{14.5}\selectfont\strut}%
\psfrag{011}[cl][cl]{\matlabtextA Validation Data}%
\psfrag{012}[cl][cl]{\matlabtextA Fit}%
\psfrag{013}[cl][cl]{\matlabtextA Model}%
\psfrag{014}[cl][cl]{\matlabtextA Data}%


for this eps file

• If I call the main tex file with pdflatex from miktex with enabled shell escape everything works.
• If I call the main tex with pdflatex from texlive without enabling shell escape no error occurs, because the pstool package disables itself without shell escape.
• If I I call the main tex with pdflatex from texlive with enabling shell escape TeX stops with the error

(c:/texlive/2011/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))" (./pstool-statusfile.txt)Das System kann den angegebenen Pfad nicht finden. ! Missing number, treated as zero.

(./pstool-statusfile.txt)
runsystem(cd "./"& del "pstool-statusfile.txt" )...executed.
! Missing number, treated as zero.


pstool-statusfile.txt contains this

This is pdfTeX, Version 3.1415926-2.3-1.40.12 (Web2C 2011)
\write18 enabled.
entering extended mode
"^^%ERRORLEVEL^^%"


Here I have no clue what is going wrong actually. Any ideas are welcome.

-
With TeX Live 2011 on a Mac I get the expected result. –  egreg Jun 10 '12 at 17:01

del is not a Unix command ; you should use rm on Unix-like operating systems. You may want to use the ifplatform package to detect the platform.