1

Original question (In short, I am told the eps files are corrupted and I wuold like you to check if it's true. Go to Update to skip this part.)

I use tikz and the externalize package in order to create high quality eps figures for a scientific journal. Although I manage to create the figures, compile the tex file with them and create the final pdf paper with such figures included, during the revision process of the journal the revisor replies (several times) to me asserting the eps figures are corrupted, and therefore he/she cannot produce the final pdf correctly.

I include below the two tex files I use to produce one of the figures (Note that I do not provide them these files, but only the final eps output).

1) Could you please check if you get the eps correctly or corrupted? Just compile the MWE file, I usually do it compiling with latex, dvips, ps2pdf using TeXnicCenter.

2) Do you know any way to check from a eps file if it is corrupted? These eps files open correctly, but the proof-reader continues to tell me the files are corrupted. (Unfortunately, I couldn't upload here an eps file to test.)

Here's the MWE

\documentclass{article}

\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{xcolor} % in order to use color names
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{latexsym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{color}
\usepackage{psfrag}
\usepackage{rotating}
\usepackage{pgf,pgfsys,pgffor}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage[caption=false]{subfig} %option caption=false for incompatibility with revtex
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{steinmetz}
\usepackage{trfsigns}
\usetikzlibrary{plotmarks, decorations.markings,decorations.shapes,shapes.geometric, intersections}

%\graphicspath{{./figure/}}

% New commands: quantum and others
\newcommand{\tr}[2][]{\textrm{Tr}_{#1} \left[ {#2} \right]}
\newcommand{\bra}[1]{\langle {#1} \vert}
\newcommand{\ket}[1]{\vert {#1} \rangle}
\newcommand{\pure}[1]{\vert {#1} \rangle \langle {#1} \vert}
\newcommand{\inn}[2]{\langle {#1} \vert {#2} \rangle}
\newcommand{\san}[3]{\langle {#1} \vert {#2} \vert {#3} \rangle}
\newcommand{\ave}[1]{\left \langle {#1} \right \rangle}                     % expectation
\renewcommand{\e}{\textrm{e}}           
\newcommand{\imaginary}{\im}
\newcommand{\Span}{\textrm{span}} %  nota: ridefinire \span crea problemi con align!
\newcommand{\factor}{1}

\newcommand{\C}[1]{\mathcal{#1}}
\newcommand{\B}[1]{\mathbb{#1}}
\newcommand{\beq}{\begin{equation}}
\newcommand{\eeq}{\end{equation}}
\renewcommand{\d}{\textrm{d}} % differenziale

\newtheorem{prop}{Proposition}
\newtheorem{defin}{Definition}
\newtheorem{thm}{Theorem}
\newtheorem{cor}{Corollary}
\newtheorem{Lemma}{Lemma}
\newtheorem{prob}{Problem}
\newtheorem{remark}{Remark}
\newcommand{\proof}{\noindent {\bf Proof. }}
\newcommand{\qed}{\hfill $\Box$ \vskip 2ex}

\newcommand{\barg}{\bar{\gamma}} % quantum state trasmesso
\newcommand{\coherentTensorProduct}{\gamma} % quantum state nel prodotto tensore di stati coerenti
\newcommand{\g}{\xi}    % uantum state nello slot
\newcommand{\m}{\mu}    % operatore di misura locale
\newcommand{\M}{M}  % cardinalità
\newcommand{\Prob}[1]{\textrm{P} \left[ #1 \right]} % simbolo P[ ]
\newcommand{\p}{p} % probabilità congiunta, condizionata...
\newcommand{\q}{q} % probabilità congiunta, condizionata stati coerenti
\newcommand{\x}{x} % simbolo trasmesso
\newcommand{\y}{y} % simbolo stimato
\newcommand{\z}{z} % outcome
\newcommand{\barz}{\bar{\z}} % vettore di outcome
\newcommand{\barp}{\bar{\p}} % vettore di probabilità
\newcommand{\X}{\textrm{x}} \newcommand{\Y}{\textrm{y}} % base spazio di Hilbert
\newcommand{\inner}{\chi} % prodotto interno \inner = |<0|a>|^2 = |<\g_0|\g_1>|^2
\renewcommand{\o}{0} % outcome of local measurement
\renewcommand{\l}{1}
\newcommand{\newO}{\hat{\o}}
\newcommand{\newL}{\hat{\l}}
\newcommand{\Pc}{P_c}
\newcommand{\Pe}{P_e}
\newcommand{\povm}{\textrm{P}} % simbolo povm
\newcommand{\zM}{\textrm{z}} % realizzazione, contatore di \z
\newcommand{\f}{h} % funzione stima
\newcommand{\mx}{m} % rappresenta il simbolo con massima probabilità a priori
\newcommand{\fTable}{\J}%{T}
\newcommand{\ang}{\phi}
\newcommand{\angDP}{\pi}%{\varphi}
\newcommand{\nextS}{\textrm{children}}
\newcommand{\pro}{\wp} % probabilità per gli stati, densità di probabilità
\newcommand{\proj}{\Pi} % proiettore nello spazio di Hilbert degli stati coerenti

% Dynamic Programming
\newcommand{\s}{s}      % stato del sistema
\renewcommand{\S}{S}        % dominio stato
\renewcommand{\u}{u}        % controllo 
\newcommand{\baru}{\bar{\u}} % sequenza di controlli
\newcommand{\U}{U}      % dominio controllo
\newcommand{\w}{w}      % disturbo
\newcommand{\W}{W}      % dominio disturbo
\newcommand{\E}[2][]{\operatorname*{\textrm{E}}_{#1}\left[ #2 \right]} % aspettazione E_#1[ #2 ]
\newcommand{\J}{J}      % funzionale 

%-----------------------EXTERNALIZATION (DO NOT CHANGE)------------------------------------------------------------------%

 %%set up externalization

\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[shell escape=-enable-write18] 

%\usetikzlibrary{external}
%\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error 
%-interaction=batchmode -jobname "\image" "\texsource" &&
%pdftops -eps "\image".pdf}}
%\tikzexternalize[shell escape=-enable-write18]

%-----------------------DOCUMENT------------------------------------------------------------------%
\begin{document}

\tikzsetnextfilename{figure3}
\input{fig3.tex}

\end{document}

and the fig3.tex file

%\tikzsetnextfilename{figure3}
% Set the overall layout of the tree
\tikzstyle{level 1}=[level distance=1.3cm, sibling distance=2cm]
\tikzstyle{level 2}=[level distance=1.3cm, sibling distance=1cm]
\tikzstyle{level 3}=[level distance=1.3cm, sibling distance=0.7cm]
\tikzstyle{level 4}=[level distance=.5cm, sibling distance=0.35cm]
% Define styles for bags and leafs
\tikzstyle{bag} = [circle,draw=black, line width=1pt,text width=1.7em, text centered]
\tikzstyle{bag2} = [line width=1pt,text width=1.8em, text centered]
\tikzstyle{end} = [circle, minimum width=1pt,fill,inner sep=0pt]
\tikzstyle{link} = [->,shorten <=1pt,>=stealth',line width=1pt]
\begin{tikzpicture}[scale=1.5,grow=right]%, sloped]
\node[ bag] {$\ang$}
    child {
        node[ bag] {$\ang^\l$}        
            child {
                node[ bag] {$\ang^{\l\l}$}
                    child{
                        node[bag] {$\ang^{\l\l\l}$}
                            child{
                                node[end, label={right}:{$\barz=\l\l\l\l$}] {}
                                                %node[end, label={right}:{$\barz=\l\l\l\l \Rightarrow \y = 4 $}] {}
                                edge from parent[link]
%                               node[below] {\l}
                            }
                            child{
                                node[end, label={right}:{$\barz=\l\l\l\o$}] {}
                                                %node[end, label={right}:{$\z=\l\l\l\o \Rightarrow \y = 3 $}] {}
                                edge from parent[link]
%                               node[above] {\o}
                            }
                        edge from parent[link]
                        node[below] {$\l$}
                    }
                    child{
                        node[bag] {$\ang^{\l\l\o}$}
                            child{
                                node[end, label={right}:{$\barz=\l\l\o\l$}] {}
                                                %node[end, label={right}:{$\barz=\l\l\o\l \Rightarrow \y = 4$}] {}
                                edge from parent[link]
%                               node[below] {\l}
                            }
                            child{
                                node[end, label={right}:{$\barz=\l\l\o\o$}] {}
                                                %node[end, label={right}:{$\barz=\l\l\o\o \Rightarrow \y = 2$}] {}
                                edge from parent[link]
%                               node[above] {\o}
                            }
                        edge from parent[link]
                        node[above] {$\o$}
                    }                
                edge from parent[link]
                node[below] {$\l$}
            }
            child {
                node[ bag] {$\ang^{\l\o}$}
                    child{
                        node[bag2] {}%{$\vdots$}
                    }
                    child{
                        node[bag2] {$\vdots$}
                    }                
                edge from parent[link]
                node[above] {$\o$}
            }    
    edge from parent[link]
    node[below] {$\l$}   
    }
    child {
        node[ bag] {$\ang^\o$}        
            child {
                node[ bag] {$\ang^{\o\l}$}
                    child{
                        node[bag2] {$\vdots$}
                            %child{
                                %node[end, label=right:{$\vdots$}] {}
                            %}
                            %child{
                                %node[end, label=right:{$\vdots$}] {}
                            %}                  
                                    }  
                    child{
                        node[bag2] {}%{$\vdots$}
                    }               
                edge from parent[link]
                node[below]  {$\l$}
            }
            child {
                node[ bag] {$\ang^{\o\o}$}
                    child{
                        node[bag] {$\ang^{\o\o\l}$}
                            child{
                                node[end, label={right}:{$\barz=\o\o\l\l$}] {}
                                                %node[end, label={right}:{$\barz=\o\o\l\l \Rightarrow \y = 4$}] {}
                                edge from parent[link]
%                               node[below] {\l}
                            }
                            child{
                                node[end, label={right}:{$\barz=\o\o\l\o$}] {}
                                                %node[end, label={right}:{$\barz=\o\o\l\o \Rightarrow \y = 3$}] {}
                                edge from parent[link]
%                               node[above] {\o}
                            }
                        edge from parent[link]
                        node[below] {$\l$}
                    }           
                    child{
                        node[bag] {$\ang^{\o\o\o}$}
                            child{
                                node[end, label={right}:{$\barz=\o\o\o\l$}] {}
                                                %node[end, label={right}:{$\barz=\o\o\o\l \Rightarrow \y = 4$}] {}
                                edge from parent[link]
%                               node[below] {\l}
                            }
                            child{
                                node[end, label={right}:{$\barz=\o\o\o\o$}] {}
                                                %node[end, label={right}:{$\barz=\o\o\o\o \Rightarrow \y = 1$}] {}
                                edge from parent[link]
%                               node[above] {\o}
                            }
                        edge from parent[link]
                        node[above] {$\o$}
                    }                
                edge from parent[link]
                node[above] {$\o$}
            }  
        edge from parent[link]
    node[above] {$\o$}  
    };
\end{tikzpicture}

Update I ask the revisor how he/she tested the figures, and he/she replies that they tried opening the figures with Photoshop, Illustrator and by making PDFs from the eps figures you provided. So I tried to open them with Photoshop and Illustrator and indeed I got the error "Could not complete your request because Photoshop was unable to parse the Postscript". Although on one hand one could blame Photoshop, I wonder if anyone could test with it the eps generated by the script, in order to understand if the problem is in the Tikz+Externalization generation of EPS, or in MY system configuration, or actually in Photoshop.

  • First of all why the ps2eps? use -E lets dvips generate EPS files – daleif Jan 20 '14 at 10:30
  • I must just have copy-and-paste the MWE, and leave it there since it produces the right output. Are the eps produced by dvips and dvips + ps2eps different? – Nicola Jan 20 '14 at 10:35
  • Ahh, the problem is that -E gives the wrong bounding box. I tend to compile as PDF and convert to EPS if needed. How about getting the proof reader to expolain what is meant by corrupt, how is it tested? And no I do not see any problems with the generated EPS (tested using TL13) – daleif Jan 20 '14 at 10:38
  • Maybe you can provide a more minimal MWE ;). – Dr. Manuel Kuehner Jan 20 '14 at 10:47
  • I beg your pardon @daleif, but what does TL13 stands for exactly? – Nicola Jan 20 '14 at 10:56

Your Answer

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

Browse other questions tagged or ask your own question.