Re: [Rd] pdf default version

From: Marc Schwartz (via MN) <mschwartz_at_mn.rr.com>
Date: Fri 15 Sep 2006 - 17:42:59 GMT

On Fri, 2006-09-15 at 12:12 -0500, Kevin Wright wrote:
> R has had the ability to generate pdfs with transparent colors for a
> couple of years now using pdf(..., version="1.4").
>
> By default, Sweave uses just 'pdf' (without version 1.4), so a hack is
> needed when using Sweave to create pdfs with transparent colors. See
> http://tolstoy.newcastle.edu.au/R/help/04/11/6655.html
>
> I would find my work process simpler if R defaulted to generating PDFs
> using version="1.4". The help page for R's pdf command says there is
> a risk of some older pdf viewers not being able to view newer PDFs.
> Does anyone have a feeling for how big a risk this is? I tried for a
> while to search google for pdf metadata and the distribution of pdf
> documents of different versions, but could find nothing useful to
> report.
>
> The PDF 1.4 specification appears to have been published in November, 2001.
>
> Is updating pdf() to version="1.4" feasible?
>
> Discussions on this topic will be watched with interest.
>
> Kevin Wright

Rather than globally changing R, wouldn't it be better to add another option to Sweave?

For example, one can already specify 'height' and 'width' arguments for figures, why not a pdf version value?

If I am reading it correctly, the relevant code from Sweave.R seems to be within the RweaveLatexRuncode() function:

  if(options$pdf){

       pdf(file=paste(chunkprefix, "pdf", sep="."),
           width=options$width, height=options$height)

Could this not be modified to something like:

  if(options$pdf){

       pdf(file=paste(chunkprefix, "pdf", sep="."),
           width=options$width, height=options$height,
           version = pdf.version)

Then the call within the .Rnw file could be something like:

  <<fig=true,width=6,height=4,pdf.version=1.4,include=false>>=

I am presuming that I am oversimplifying the changes here as I have not looked at the other code that would be affected by this change.

Comments?

HTH, Marc Schwartz



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Sep 16 03:44:58 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 16 Sep 2006 - 19:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.