3

A similar question has already been asked but hasn't got an answer. I am generating EPS images using tikz externalise library. When I use those EPS images back in a different latex document they work fine. But the same images are not opening in Adobe illustrator or GIMP. I am working with MacTex, on a mac (Mavericks) system. The MWE that I am using to generate the images is,

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external} 

\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-   error
-interaction=batchmode -jobname "\image" "\texsource" && 
dvips -o "\image".ps "\image".dvi;
ps2eps "\image.ps"}}

\tikzexternalize

\begin{document}

\begin{tikzpicture}
\draw (0,0) circle (1cm);
\end{tikzpicture}

\end{document}

To compile I am using latex --shell-escape file.tex.

2
  • I don't think this really has an answer. EPS is not an exchange format, it's more a program than graphics, so I'm not surprised it can't be really opened for editing :-/
    – yo'
    Jul 26, 2014 at 12:19
  • @tohecz I understand but even I can't open these images in Preview (mac based viewing program) which always opens EPS images created with other programs. The same is for illustrator and other similar programs which are ostensibly designed to read EPS format and do read EPS created with gnuplot. The point is why I can open an EPS in illustrator generated by gnuplot and MATLAB but not the one created with tikz externalisation?
    – R.U.
    Jul 26, 2014 at 19:03

1 Answer 1

2

The EPS files generated by PGF should always be viewable and usable.

I know that the EPS output driver of PGF had a bug (it produced a wrong bounding box, compare Tikz externalization: Latex dvi/ps produces a4paper boundary-box around figure). I fixed that after PGF 3.0.0 was released. The fix is also available if you have pgfplots 1.11 and you write \usepgfplotslibrary{external} instead of \usetikzlibrary{external}. With that new version, you do not need ps2eps "\image.ps" anymore.

In fact, my guess is that your externalization failed to compile. But since ps2eps "\image.ps" is called without checking return codes (it comes after a semicolon rather than &&), it will be executed even if the resulting dvi file was corrupt after a compile error.

I see the following action items to solve your problem:

  1. ensure that you have pgfplots 1.11 and write \usepgfplotslibrary{external} instead of \usetikzlibrary{external}. It also activates the bug fix of PGF 3.0.0 . Then, remove the invocation of ps2eps.

  2. Alternative to (1): replace ; by &&. This might still produce unexpected bounding boxes.

  3. look into the .log file of your externalized picture and fix any reported compile issues.

  4. Verify that your code does not have the white spaces as in your MWE, i.e.

    -halt-on- error. This does not compile.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .