From berwin at maths.uwa.edu.au  Fri Feb 20 19:37:38 2009
From: berwin at maths.uwa.edu.au (Berwin A Turlach)
Date: Sat, 21 Feb 2009 02:37:38 +0800
Subject: [Rd] vignette compilation times
In-Reply-To: <971536df0902191447x62b7c879h348b08e629c85bf0@mail.gmail.com>
References: <499D3E35.4050300@cam.ac.uk>
	<499D442A.20605@statistik.tu-dortmund.de>
	<499D46C0.10404@cam.ac.uk>
	<18845.57098.447677.624190@ridcully.stat.uni-muenchen.de>
	<971536df0902191447x62b7c879h348b08e629c85bf0@mail.gmail.com>
Message-ID: <20090221023738.0853af60@berwin5>

G'day Gabor,

On Thu, 19 Feb 2009 17:47:53 -0500
Gabor Grothendieck <ggrothendieck at gmail.com> wrote:

> [...]
> Unless this has changed recently,I've tried including a PDF but it
> does not appear in library(help = myPackage) nor on the CRAN site on
> http://cran.r-project.org/package=myPackage
> while Sweave'd PDFs do.

If you want a PDF file to appear in library(help=myPackage), then you
can write a vignette that just includes that PDF file via \includepdf
from the LaTeX package(?) pdfpages.

You will, of course, end up with two PDF files that are practically
identical.  So you might want to exclude the original PDF file from the
build package via .Rbuildignore.

If you do so, the next problem is that since R 2.6.0 "R CMD check" is
trying to latex the vignette and not just checks the code in the
vignette.  And in current TeX systems latex will hang if \includepdf
does not find the specified PDF file; latex does not stop with an
error, it hangs.  

So the vignette has to be written smart enough to try to include the
PDF file via \includepdf only if the file really exists, but that can
easily be done.  See the package lasso2 for an example.  

If you follow this set up, your PDF file will show up in
library(help=myPackage) and your package will pass "R CMD check" on
CRAN.

HTH.

Cheers,
	
	Berwin



[Rd] vignette compilation times
Berwin A Turlach