Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to use \includegraphics and the auto-pst-pdf package to convert and import an EPS file, but when I enable TikZ's external library, \includegraphics fails with an error message:

Package tikz Error: Sorry, the system call 'pdflatex -shell-e
scape -halt-on-error -interaction=batchmode -jobname "images/exports/EPSMods-fi
gure0" "\def\tikzexternalrealjob{EPSMods}\input{EPSMods}"' did NOT result in a 
usable output file 'images/exports/EPSMods-figure0' (expected one of .pdf:.jpg:
.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, t
his is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or somet
hing like that. Or maybe the command simply failed? Error messages can be found
 in 'images/exports/EPSMods-figure0.log'. If you continue now, I'll try to type
set the picture.

When I try to prevent externalization of the offending picture with tikzexternaldisable, I get the same result.

Is there a way to use auto-pst-pdf and TikZ's external library at the same time (and independently of one another)?


\documentclass{article}

\usepackage{auto-pst-pdf}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{tikz}

\usetikzlibrary{external}
\tikzexternalize[prefix=images/exports/]
%\tikzset{external/force remake}   % Uncommenting this generates the error every time

\begin{document}

\begin{tikzpicture}
\node {root}
    child {node {left}}
    child {node {right}
      child {node {child}}
      child {node {child}}
    };
\end{tikzpicture}

\bigskip{}

{\tikzexternaldisable       % Removing this causes the third figure to appear in place of this one
\begin{tikzpicture}         % Shouldn't this picture  behave as it would in the absence of the `external` library?
\psfrag{Z}{$Q=\Sigma_X$}
%\psfragfig{GraphA}         % GraphA is an EPS file being processed by `auto-pst-pdf`; this works
\includegraphics{GraphA}    % This fails, even if wrapped in a node
\end{tikzpicture} 
}

\bigskip{}

\begin{tikzpicture}
\node {A}
    child {node {B}}
    child {node {C}
      child {node {D}}
      child {node {X}}
    };
\end{tikzpicture}

\end{document}

 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
auto-pst-pdf.sty    2009/04/26 v0.6 Wrapper for pst-pdf
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
ifplatform.sty    2010/10/22 v0.4 Testing for the operating system
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
catchfile.sty    2011/03/01 v1.6 Catch the contents of a file (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
EPSIncludeBug.w18
 pst-pdf.sty    2008/10/09 v1.1v PS graphics for pdfLaTeX (RN,HjG)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
pstricks.sty    2011/10/31 v0.52 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex    2012/03/11 v2.27 `PSTricks' (tvz,hv)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
  pst-fp.tex    2012/03/11 v2.27 `PST-fp' (hv)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 preview.sty    2010/02/14 11.86 (AUCTeX/preview-latex)
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
 environ.sty    2008/06/18 v0.2 A new way to define environments
  psfrag.sty    1998/04/11 v3.04 PSfrag (MCG)
    tikz.sty    2010/10/13 v2.10 (rcs-revision 1.76)
     pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)
  pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)
 pgfkeys.sty    
 pgfkeys.code.tex
  pgffor.code.tex
    tikz.code.tex
supp-pdf.mkii
EPSIncludeBug-pics.pdf    Graphic file (type pdf)
share|improve this question
    
Can you also try using the \pgfuseimage{himage namei}? You can check the manual Section 79.3. –  percusse Jun 10 '12 at 14:46
    
Replacing \includegraphics with \pgfuseimage fails the same way. –  raxacoricofallapatorius Jun 10 '12 at 15:17
    
Can't you convert the image before including in the document using, for example, the epstopdf command line tool? And more, which compiler do you use? latex or pdflatex? I am not sure that the latter is fully compatible with the psfrag package –  Spike Jun 11 '12 at 16:42
    
Have you try this answer <tex.stackexchange.com/a/59368/14500>; ? –  Paul Gaborit Jun 11 '12 at 16:43
    
@PolGab: Yes, see the comment, added earlier, in the MWE. –  raxacoricofallapatorius Jun 11 '12 at 18:59

1 Answer 1

up vote 2 down vote accepted

An EPS file (test-external.eps) build by gnuplot:

# to make an EPS file
set terminal postscript
set output "test-external.eps"
plot sin(x)
quit

Then, a LaTeX file (tikz-externalize.tex) with \includegraphics and TikZ externalization:

\documentclass{standalone}
\usepackage{auto-pst-pdf}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzset{external/force remake}

\begin{document}
\begin{tikzpicture}
  \node {root}
  child {node {left}}
  child {node {right}
    child {node {child}}
    child {node {child}}
  };
\end{tikzpicture}

{
  \tikzexternaldisable
  \begin{tikzpicture}
    \psfrag{sin(x)}{$y=sin(x)$}%
    \node{\includegraphics[width=.5\linewidth]{test-external}};
  \end{tikzpicture} 
}
\begin{tikzpicture}
  \node {A}
  child {node {B}}
  child {node {C}
    child {node {D}}
    child {node {X}}
  };
\end{tikzpicture}
\end{document}

To compile:

pdflatex -shell-escape tikz-externalize.tex

Here, the result:

enter image description here

share|improve this answer
    
Aha! Note the absence, in your MMWE, of \tikzexternalize[prefix=images/exports/]. –  raxacoricofallapatorius Jun 12 '12 at 17:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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