Ich versuche, ein PGF-Plot auszulagern, um es mit Latex und aktiviertem Shell-Escape als EPS-Datei zu speichern.
\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}
Wenn ich dies jedoch mit latex -shell-escape in Linux Mint 16 mit TeX Live 2013 ausführe, erhalte ich für jedes Diagramm den folgenden Fehler.
! Paket tikz Fehler: Entschuldigung, der Systemaufruf '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"' hat KEINE verwendbare Ausgabedatei 'untitled-1-figure2' ergeben (erwartet wurde eine von epsi:eps:ps). Bitte überprüfen Sie, ob Sie Systemaufrufe aktiviert haben. Für pd flatex ist dies 'pdflatex -shell-escape'. Manchmal wird es auch 'write 18' oder so ähnlich genannt. Oder ist der Befehl vielleicht einfach fehlgeschlagen? Fehlermeldungen finden Sie in „untitled-1-figure2.log“. Wenn Sie jetzt fortfahren, werde ich versuchen, das Bild zu setzen.
Wenn ich jedoch einfach drückeZurückkehrenTaste, es werden erfolgreich EPS-Dateien generiert. Ich habe es viele Male versucht, aber ohne Erfolg. Bitte helfen Sie mir.