ich habe folgendes Problem: Grundsätzlich funktioniert Tikzexternalize gut, wenn ich meine Plots gemeinsam mit pgfplots erzeuge. Problematisch wird es komischerweise, sobald ich eine Legende erzeuge bzw. irgendwelche \ref's im Plot haben möchte.
Folgendes Minimalbeispiel kompilliert bei mir problemlos (0 Fehler, 0 Warnungen):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \RequirePackage{fix-cm} \documentclass[ a4paper, 11pt, BCOR8mm, numbers=noenddot, oneside, parskip=half, openright, fleqn, bibliography=totoc, table, DIV=14 ]{scrbook} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{ae} \usepackage{aecompl} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amstext} \usepackage[ngerman]{babel} \usepackage{bibgerm} \usepackage{bigstrut} \usepackage{blkarray} \usepackage{blindtext} \usepackage{bm} \usepackage{booktabs} \usepackage{courier} \usepackage{chngcntr} \usepackage{float} \usepackage{graphicx} \usepackage[ %pdftex=true, hypertexnames=false, plainpages=false, pdfpagelabels, pagebackref=false, colorlinks=false, bookmarks=true, bookmarksopen=true, bookmarksnumbered=true, pdftitle={Dissertation}, pdfauthor={TU}, pdfsubject={PhD}, pdfcreator={Accomplished with LaTeX2e and pdfLaTeX with hyperref-package.}, pdfproducer={}, pdfkeywords={IBB}, pdfstartview=Fit, pdfpagemode={UseOutlines}, ]{hyperref} \usepackage{ifthen} \usepackage[latin1]{inputenc} \usepackage{listings} \usepackage{lmodern} \usepackage{mathtools} \usepackage{marvosym} \usepackage{multirow} \usepackage[square]{natbib} \usepackage{ngerman} \usepackage[intoc]{nomencl} \usepackage{overpic} \usepackage{pdfpages} \usepackage{pgfplots} \usepackage{pifont} \usepackage{rotating} \usepackage[automark]{scrpage2} \usepackage{scrhack} \usepackage{siunitx} \usepackage{stmaryrd} \usepackage{subcaption} \usepackage{tabularx} \usepackage{tikz} \usepackage{todonotes} \usepackage{units} \usepackage{upgreek} \usepackage{url} \usepackage{ucs} \usepackage{wrapfig} \usepackage{wasysym} \usepackage{xfrac} \graphicspath{{./img/bin/}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepgfplotslibrary{external} %% Tikz \usetikzlibrary{arrows} \usetikzlibrary{arrows.meta} \usetikzlibrary{backgrounds} \usetikzlibrary{calc} \usetikzlibrary{decorations.markings} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.text} \usetikzlibrary{external} \usetikzlibrary{math} \usetikzlibrary{matrix} \usetikzlibrary{shapes} \tikzexternalize % [shell escape=-enable-write18,optimize command away=\includepdf] \tikzsetexternalprefix{img_exp/} % Basisdefinition \pgfplotsset{ compat=1.10, table file path/.initial={{./data/}}, height=6cm, width=15cm, grid=major, grid style={ solid, thin, gray }, x tick label style={ font=\footnotesize, }, x label style={ font=\footnotesize, }, y tick label style={ font=\footnotesize, }, y label style={ font=\footnotesize, }, /pgf/number format/.cd, use comma, set thousands separator={} } % Pfadeinstellung \makeatletter \def\pgfplotstableread@openfile{% \def\pgfplotstable@loc@TMPa{\pgfutil@in@{ }}% \expandafter\pgfplotstable@loc@TMPa\expandafter{\pgfplotstableread@filename}% \ifpgfutil@in@ \t@pgfplots@toka=\expandafter{\pgfplotstableread@filename}% \edef\pgfplotstableread@filename{\pgfplots@dquote\the\t@pgfplots@toka\pgfplots@dquote}% \fi \let\pgfplotstableread@old@crcr=\\% \def\\{\string\\}% just to make sure we don't try to open inline table data... \openin\r@pgfplots@reada=\csname pgfk@/pgfplots/table file path\endcsname\pgfplotstableread@filename.tex \ifeof\r@pgfplots@reada \openin\r@pgfplots@reada=\csname pgfk@/pgfplots/table file path\endcsname\pgfplotstableread@filename\relax \else \pgfplots@warning{% You requested to open table '\pgfplotstableread@filename', but there is also a '\pgfplotstableread@filename.tex'. TeX will automatically append the suffix '.tex', so I will now open '\pgfplotstableread@filename.tex'. Please make sure you don't accidentally load TeX files - this may produce unrecoverable errors.}% \closein\r@pgfplots@reada \openin\r@pgfplots@reada=\pgfplotstableread@filename\relax \fi % \ifeof\r@pgfplots@reada \pgfplotsthrow{no such table file}{\pgfplots@loc@TMPa}{\pgfplotstableread@filename}{Could not read table file '\csname pgfk@/pgfplots/table file path\endcsname\pgfplotstableread@filename'. In case you intended to provide inline data: maybe TeX screwed up your end-of-lines? Try `row sep=crcr' and terminate your lines with `\string\\' (refer to the pgfplotstable manual for details)}\pgfeov% \global\let\pgfplotstable@colnames@glob=\pgfplots@loc@TMPa \def\pgfplotstableread@ready{0}% \fi \pgfplots@logfileopen{\pgfplotstableread@filename}% \let\\=\pgfplotstableread@old@crcr } \makeatother %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \begin{figure}[htbp] \centering \begin{tikzpicture} \pgfplotsset{ height=5.0cm, width=10.5cm } \begin{axis}[ xmin=-2, xmax=2, ymin=-2, ymax=2, y tick label style={ /pgf/number format/.cd, fixed, fixed zerofill, precision=2, /tikz/.cd }, xlabel={Zeit $t$}, ylabel={Spektralwert $K$}, ] \addplot {sin(deg(x))}; \label{plot:spektrk1} % Legende % \matrix[ % matrix of nodes, % anchor=south west, % inner sep=0.2em, % fill=white, % %nodes={font=\Large}, % ] at([yshift=2ex, xshift=2ex]current axis.south west) % { % \ref{plot:spektrk1}& \small{$k = 1$}\\ % }; \end{axis} \end{tikzpicture} \caption{Approximationen unterschiedlicher Ordnung} \label{fig:approximation} \end{figure} \end{document}
Sobald ich nun die Legende einfüge (also den im Beispiel auskommentierten Teil einkommentiere) gibt es folgenden Fehler:
===== tikzexternal: \end{document} reached. Working on rescheduled images to re solve references... ======== ===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o n-error -interaction=batchmode -jobname "img_exp/testdoc-figure0" "\def\tikzext ernalrealjob{testdoc}\input{testdoc}"' ======== runsystem(pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "img_exp/testdoc-figure0" "\def\tikzexternalrealjob{testdoc}\input{testdoc}"). ..executed. ! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e rror -interaction=batchmode -jobname "img_exp/testdoc-figure0" "\def\tikzextern alrealjob{testdoc}\input{testdoc}"' did NOT result in a usable output file 'img _exp/testdoc-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify th at you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape '. Sometimes it is also named 'write 18' or something like that. Or maybe the c ommand simply failed? Error messages can be found in 'img_exp/testdoc-figure0.l og'. If you continue now, I'll try to typeset the picture. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.214 \end{document} This error message was generated by an \errmessage command, so I can't give any explicit help. Pretend that you're Hercule Poirot: Examine all clues, and deduce the truth by order and method.
[...] <argument> \pgf@matrix@last@nextcell@options l.209 \end{axis} Here is how much of TeX's memory you used: 50429 strings out of 493334 1153591 string characters out of 3139241 1379165 words of memory out of 3000000 53068 multiletter control sequences out of 15000+200000 55655 words of font info for 86 fonts, out of 3000000 for 9000 1141 hyphenation exceptions out of 8191 74i,21n,109p,10478b,3006s stack positions out of 5000i,500n,10000p,200000b,50000s ! ==> Fatal error occurred, no output PDF file produced!
Ich verwende TechnicCenter und -shel-escape ist im entsprechenden Ausgabeprofil aktiviert.
Vielen lieben Dank im Voraus,
pjheinrich