Closed cameronbracken closed 12 years ago
source('http://addictedtor.free.fr/graphiques/sources/source_122.R')
The function diagwl from the climatol package calls plot.new() which creates a new tikzpicture; then it calls par() which closes the tikzpicture without creating any content but throws in a \end{scope}, causing compilation to fail.
This is the offending chunk:
\begin{tikzpicture}[x=1pt,y=1pt] \draw[color=white,opacity=0] (0,0) rectangle (505.89,505.89); \end{scope} \end{tikzpicture}
A tikzpicture should NOT be created when there is not content to put in. pdf() does not create a blank page here so we should not.
Here is a minimal example to reproduce the bug:
tikz(standAlone=T) plot.new() plot(1) dev.off() system('pdflatex Rplots.tex')
The function diagwl from the climatol package calls plot.new() which creates a new tikzpicture; then it calls par() which closes the tikzpicture without creating any content but throws in a \end{scope}, causing compilation to fail.
This is the offending chunk:
A tikzpicture should NOT be created when there is not content to put in. pdf() does not create a blank page here so we should not.