In the pgfmanual I found today under Section 50.4.4 Customizing the Externalization that you can have multicore support during externalization using the mode list and make
.
% step 1: generate main.makefile:
pdflatex main
% step 2: generate ALL graphics on 2 processors:
make -j 2 main.makefile
% step 3: include the graphics:
pdflatex main
I am using Windows 7 and MiKTeX. Since I never used make
I downloaded it here: http://www.gnu.org/software/make/. Then I used this MWE (main.tex):
\documentclass{article}
\usepackage{tikz,pgfplots}
\usetikzlibrary{external}
% Important
\tikzexternalize[mode=list and make]
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot coordinates {(0,0) (1,1) (4,4)};
\end{axis}
\end{tikzpicture}
\end{document}
So I used a batch file like the pgfmanual said:
% step 1: generate main.makefile:
pdflatex main
% step 2: generate ALL graphics on 2 processors:
make -j 2 main.makefile
% step 3: include the graphics:
pdflatex main
But it doesnt' work. I get a message during the make -j 2 main.makefile
part:
make: Nothing to be done for 'main.makefile'
Then I used make -f main.makefile
like it was suggested during the first pdflatex main
and I get:
process_begin: CreateProcess(NULL, cat main.figlist, ...) failed.
process_begin: CreateProcess(NULL, cat main.figlist, ...) failed.
Here a screenshot for the make part:
This is how the make file looks like:
ALL_FIGURE_NAMES=$(shell cat main.figlist)
ALL_FIGURES=$(ALL_FIGURE_NAMES:%=%.pdf)
allimages: $(ALL_FIGURES)
@echo All images exist now. Use make -B to re-generate them.
FORCEREMAKE:
include $(ALL_FIGURE_NAMES:%=%.dep)
%.dep:
mkdir -p $(dir $@)
touch $@ # will be filled later.
main-figure0.pdf:
pdflatex -halt-on-error -interaction=batchmode -jobname "main-figure0" "\def\tikzexternalrealjob{main}\input{main}"
main-figure0.pdf: main-figure0.md5
main-figure0.pdf
is not generated -- but main-figure0.md5
is generated.
Update (Christian's Answer)
I tried your advice (ALL_FIGURE_NAMES=main-figure0
) and replaced the code in the makefile but it still doesn't work.
I voted to close the question. It seems that only I have the problem. Thanks for the help!
list and make
option was probably not intended to be run on windows at all, but the$(dir $@)
line tends to prove otherwise. Have you tried from an administrator console?make -j 2 main.makefile
: this probably didn't work because you miss the-f
flag before the name of the makefile. And the.md5
files are generated during the first run ofpdflatex
.