On Mon, May 30, 2011 at 8:30 AM, Graham Smith <myotis...@gmail.com> wrote:
> Yihui > > > , I think Graham's question has pointed out a very useful >> direction -- we may consider leaving some sort of API's or hooks in >> the R script in LyX which is used to process the Rnw document. > > >> A few months ago I also recommended the qpdf program to R developers >> to compress PDF plots and it has been included in R now (the option >> --compact-vignettes in R CMD build). Graham, is your script portable >> to Windows and Mac? Could you share it with us? Maybe we can propose >> this feature to LyX developers. It will be definitely helpful. >> > > Although I do normally use SWeave, these particular files were simply > exported from R, and then imported into Lyx, there just big PDFs. ECDFs > based on 120,000 data points, which is why I suspect they are large without > some form of flattening. > > But compressing imported PDFs goes beyond R and maybe qpdf could become a > Lyx feature to optimise PDFs the same way that MSWord allows you to > optimise graphics before saving/printing. > > The Nautilus script in Linux uses Ghostscript and maybe this could be > another option to consider along with qpdf. > http://www.webupd8.org/2010/11/download-compress-pdf-12-nautilus.html > > But I will have a look at qpdf, thanks, > The problem of to large graphics is one which I am also am confronted with when using LyX. Most of the time, it is caused by images from digital cameras. And this is when I am missing one feature in LyX: downscaling the pictures auomatically to a specified resolution of the printed graphs. It should not be to difficult to implement: provide to each *raster* image an additional field in the insert-graphics window, to resampled to a given resolution. I assume the actual print size can be obtained from LaTeX, so the image could be, in addition to be scaled, resampled to the provided resolution. This would be a very useful feature. This resampling could be configured during the reconfigure, and could be a kind of a copier "jpeg to jpeg". By the way - if it would be possible to define a copier "jpeg to jpeg" (it does not seem to be possible in 2.0), it would be very easy to include automatic resampling. Cheers, Rainer > > Graham > > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax (F): +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug