I am writing a long thesis and would like to source out some graphics, so that I do not have to in every run I am compiling the tex file. Here is a simple example:
\documentclass[a4paper]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[latin9]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{bibgerm}
\usepackage{paralist}
\usepackage{lmodern}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}
\usepackage{tikz}
\usepgfplotslibrary{external}
\tikzexternalize[shell escape=-enable-write18]
\begin{document}
long text ...
\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis}
\addplot[color=black, mark=] table[x=Tag,y=Dax] {test.txt};
\addlegendentry{DAX}
\end{axis}
\end{tikzpicture}
\caption{Test}
\end{figure}
long text ...
\end{document}
I get the error message:
! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact ion=batchmode -jobname "diss-figure0" "\def\tikzexternalrealjob{diss}\input{dis s}"' did NOT result in a usable output file 'diss-figure0' (expected one of .pd f:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdfl atex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' o r something like that. Or maybe the command simply failed? Error messages can b e found in 'diss-figure0.log'. If you continue now, I'll try to typeset the pic ture.
I read several manuals and tried many modifications, but nothing worked. I am using TexnicCenter 1.0, MikTex 2.8 and Windows XP SP3.
standaloneclass just for that. See Compile a LaTeX document into a PNG image that's as short as possible which also works for PDF output and Insert a TikZ picture from an external file. Note that you must copy the source code with the required preamble to an extra file, which is however anyway good practice IMHO. – Martin Scharrer Oct 05 '11 at 09:59externallibrary, I never used it. However, it basically create PDF files as well and uses these. I'm planning to support this as well withinstandalone. – Martin Scharrer Oct 05 '11 at 10:09\tikzexternalizeis needed. You naturally must use --shell-escape on the main pdflatex call. – Ulrike Fischer Oct 05 '11 at 10:49\write18 enabledsomewhere there. – Andrew Stacey Oct 05 '11 at 10:52--enable-write18. Try it on the commandline first. – Andrew Stacey Oct 05 '11 at 11:30