![PGFPLOT 外部化不起作用](https://rvso.com/image/286973/PGFPLOT%20%E5%A4%96%E9%83%A8%E5%8C%96%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我正在嘗試使用乳膠將 PGF 圖外部化以保存為 EPS 檔案並啟用 shell 轉義。
\documentclass[a4paper]{article}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize%[prefix=fig/]
\tikzset{external/system call={latex -shell-escape -interaction=nonstopmode -jobname="\image" "\texsource" ; dvips -o "\image".ps "\image".dvi ; ps2eps -f "\image".ps && mv "\image".eps "\image"}}
\pgfplotsset{ compat=1.8, tick label style={font=\small}, label style={font=\small}, legend style={font=\footnotesize}}
\tikzexternalize[prefix=fig/]
\title{\LaTeX\ plots with \texttt{tikz} and \texttt{pgfplots}}
\author{Roel Van Beeumen}
\date{April 17, 2012}
\begin{document}
%\tikzsetnextfilename{filename}
\tikzset{external/force remake}
\maketitle
% == A first plot ======================================== %
\section{A first plot}
\lipsum[1]
\begin{figure}[h]
\centering
% -------------------------------------------------------- %
\begin{tikzpicture}
\begin{axis}[xlabel=$x$,ylabel=$\sqrt{|x|}$, axis x line=bottom,axis y line=left, ymax=2.1,xmax=4.4]
\addplot[blue,mark=none,domain=-4:4,samples=201] {sqrt(abs(x))};
\end{axis}
\end{tikzpicture}
% -------------------------------------------------------- %
\end{figure}
\lipsum[2]
% == A second plot ======================================= %
\section{A second plot}
\lipsum[3]
\begin{figure}[h]
\centering
% -------------------------------------------------------- %
\begin{tikzpicture}
\begin{loglogaxis}[xlabel=Dof,ylabel=Error,width=\textwidth]
\addplot file{datafile1a.dat};
\addplot file{datafile1b.dat};
\legend{Case 1,Case 2}
\end{loglogaxis}
\end{tikzpicture}
% -------------------------------------------------------- %
\end{figure}
\lipsum[4-5]
% == A third plot ======================================== %
\section{A third plot}
\lipsum[6]
\begin{figure}[hbtp]
\centering
% -------------------------------------------------------- %
\begin{tikzpicture}
\begin{loglogaxis}[xlabel=Dof,ylabel=Error,width=\textwidth]
\addplot table[x=dof1,y=error1] {datafile2.dat};
\addplot table[x=dof2,y=error2] {datafile2.dat};
\legend{Case 1,Case 2}
\end{loglogaxis}
\end{tikzpicture}
% -------------------------------------------------------- %
\end{figure}
\lipsum[7]
\end{document}
但是,在 Linux Mint 16 中使用 TeX Live 2013 使用 Latex -shell-escape 執行此操作時,每個圖表都會出現下列錯誤。
!套件 tikz 錯誤:抱歉,系統呼叫 'latex -shell-escape -interaction= nonstopmode -jobname="untitled-1-figure2" "\def\tikzexternalrealjob{untitled-1} \input{untitled-1}" ; dvips -o "untitled-1-figure2".ps "untitled-1-figure2".dvi ; ps2eps -f "untitled-1-figure2".ps && mv "untitled-1-figure2".eps "untitled-1 -figure2"' 沒有產生可用的輸出檔 'untitled-1-figure2' (預計有一個epsi: eps:ps)。請確認您已啟用系統呼叫。對於 pd flatex,這是“pdflatex -shell-escape”。有時它也被命名為“write 18”或類似的名稱。或者命令可能只是失敗了?錯誤訊息可以在“untitled-1-figure2.log”中找到。如果你現在繼續,我會嘗試排版圖片。
但是,如果我只是按返回key,成功產生EPS檔。我嘗試了很多嘗試,但沒有運氣。請幫我。