I have several large TikZ plots I want to externalize. Without externalization, everything works fine.
Document:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
%\tikzexternalize
\begin{document}
\input{plot}
\end{document}
Output:
$ pdflatex article
<output omitted>
(./plot.tex) [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
(./article.aux) )</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/
cmr10.pfb>
Output written on article.pdf (1 page, 357026 bytes).
Transcript written on article.log.
However, when I uncomment \tikzexternalize
, pdflatex
exists with an error.
$ pdflatex article
<output omitted>
(./plot.tex
Runaway text?
[x=1pt,y=1pt] \definecolor {fillColor}{RGB}{255,255,255} \path [use a\ETC.
! TeX capacity exceeded, sorry [main memory size=5000000].
<argument> ... circle ( 1.16); \par \path [dr\ETC.
l.21034 \end{tikzpicture}
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on article.log.
What is going on here? How can externalization increase space consumption? After all, the whole point of externalization is to improve efficiency and space consumption during compilation.
\tikzexternalize
you need to enable shell escaping (pdflatex -shell-escape article
). If that doesn't work you will need to show us theplot.tex
file or a stripped down version which fails with the same error.-shell-escape
is not the problem here, but: Activating externalization significantly increases space consumption. Please findplot.tex
here.pgfplots
(!) manual. (BTW, I sometimes indeed write a "wrapper" standalone file that loads the same relevant styles and compile pdf's with those. I agree that this is more efforts if you use the plots, say, in regular notes and in beamer document, so +1.)