\documentclass{article}
\usepackage{mpgraphics}
\begin{document}
\begin{figure}
.
\label{fig:a}
\caption{a}
\end{figure}
\begin{mpinline}
draw (20,20)--(0,0)--(0,30)--(30,0)--(0,0)
\end{mpinline}
\ref{fig:a}
\end{document}
I use MikTex 2.9 and TexMaker. I compiled this MWE with means of latexmk
. To be more precise, the command was: latexmk -e "$pdflatex=q/pdflatex -synctex=1 -shell-escape -interaction=nonstopmode/" -pdf %.tex
.
My document compiled over and over and over. A log says that:
Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'C:/tmp/tmp-fig1.pdf' 'tmp-fig1.pdf' ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -synctex=1 -shell-escape -interaction=nonstopmode -recorder "tmp.tex"' ------------
Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'C:/tmp/tmp-fig1.pdf' 'tmp-fig1.pdf' ------------ Run number 2 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -synctex=1 -shell-escape -interaction=nonstopmode -recorder "tmp.tex"' ------------
Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'C:/tmp/tmp-fig1.pdf' 'tmp-fig1.pdf' ------------ Run number 3 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -synctex=1 -shell-escape -interaction=nonstopmode -recorder "tmp.tex"' ------------
Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'C:/tmp/tmp-fig1.pdf' 'tmp-fig1.pdf' ------------ Run number 4 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -synctex=1 -shell-escape -interaction=nonstopmode -recorder "tmp.tex"' ------------
Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'C:/tmp/tmp-fig1.pdf' 'tmp-fig1.pdf' ------------ Run number 5 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -synctex=1 -shell-escape -interaction=nonstopmode -recorder "tmp.tex"' ------------
Finally, it compiled five times which is 3 more than necessary.
I suspect the reason is that pdfs that are results of mpinline
are not binary equal (they contain a timestamp or something like that?) and that causes latexmk to think that it needs to compile again.
When compiling very long document this behaviur is really annoying as it consumes a lot of time. Can it be fixed?