Closed mlt closed 12 years ago
can you post a minimal example?
Sure.. I was in a hurry yesterday. Name the following as _tikz_lpbug.Rnw.
\documentclass{article}
\usepackage{lastpage}
\usepackage{tikz}
\pgfrealjobname{tikz_lp_bug}
\begin{document}
This is the last page \pageref{LastPage}.
<<fig,fig=TRUE,tikz=TRUE,cache=TRUE,external=TRUE>>=
x=1:10
plot(x,x)
@
\end{document}
I get the following in _tikz_lpbug-fig.log when doing make -B -f tikz_lp_bug.makefile
in particular
! Package lastpage Error: No auxiliary file allowed..
Ok, I can confirm this error. Not sure how to do a real fix, you may want to check with the pgf-users list or tex.stackexchange.
I did find one workaround. Disable the lastpage package (comment it). Compile and run the externalization commands, then enable the lastpage package again. This time around, the figures wont be re-generated so there are no errors.
btw, in the newer version of pgfSweave you dont need to include the \pgfrealjobname
command, it is added automatically, so you can call you document whatever you want.
The maintainer of lastpage kindly changed the error to warning in the last version. See also this.
nice, thanks for following up.
While it is not truly pgfSweave problem, however I don't use tikz externalization other than this way.
lastpage cannot get write access to aux file during pdf generation and bails out.
I'm not sure what workaround is possible inside of the document.