原始问题 (简而言之,有人告诉我 eps 文件已损坏,我希望你能检查一下这是否属实。转到更新跳过此部分。)
我使用 tikz 和 externalize 包为科学期刊创建高质量的 eps 图形。尽管我设法创建了图形、用它们编译了 tex 文件并创建了包含这些图形的最终 pdf 论文,但在期刊的修订过程中,审阅者多次回复我,声称 eps 图形已损坏,因此他/她无法正确生成最终的 pdf。
下面我包含了用来制作其中一个图形的两个 tex 文件(请注意,我没有向他们提供这些文件,而只提供了最终的 eps 输出)。
1) 您能否检查一下 eps 是否正确或已损坏?只需编译 MWE 文件,我通常使用 TeXnicCenter 用 latex、dvips、ps2pdf 进行编译。
2) 您知道有什么方法可以检查 eps 文件是否已损坏吗?这些 eps 文件可以正确打开,但校对员继续告诉我文件已损坏。(不幸的是,我无法在此处上传 eps 文件进行测试。)
以下是 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}
和 fig3.tex 文件
%\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}
更新 我问审阅者他/她是如何测试这些图形的,他/她回答说他们尝试使用 Photoshop、Illustrator 打开这些图形,并根据您提供的 eps 图形制作 PDF。因此,我尝试使用 Photoshop 和 Illustrator 打开它们,但确实出现了错误“无法完成您的请求,因为 Photoshop 无法解析 Postscript”。虽然一方面可以责怪 Photoshop,但我想知道是否有人可以用它来测试脚本生成的 eps,以便了解问题出在 Tikz+Externalization 生成的 EPS 中,还是出在我的系统配置中,或者实际上是出在 Photoshop 中。