HenrikBengtsson / R.rsp

:page_facing_up: R package: Dynamic generation of scientific reports
https://henrikbengtsson.github.io/R.rsp/
31 stars 6 forks source link

Add meta variable for controlling compression of output (e.g. PDF) #6

Closed HenrikBengtsson closed 9 years ago

HenrikBengtsson commented 9 years ago

Add meta variable for controlling compression of output, e.g.

<%@meta compression="gs+qpdf"%>
<%@meta compression="gs(ebook)+qpdf"%>

This meta variable can then be used downstream to run a "compressPDF" post processor, cf. Issue #5.

With the current setup, you can then without further modifications start using:

%\VignetteCompression{gs(ebook)+qpdf}

which will set meta variable compression accordingly. This will allow users to control the compression per vignette basis. It will also allow the user to control the compression on systems where they otherwise don't have control over this, e.g. on the R-Forge servers (such that they can submit to CRAN even if non-default 'ebook' compression is needed).

Also, it can already today be quite complicated to understand how to use R CMD build --compress-vignettes=gs+qpdf with proper environment variables e.g. export GS_QUALITY=ebook. The R documentation on this is quite nested with the bits of information spread out in WRE and the help.

HenrikBengtsson commented 9 years ago

NOTE: Make use of new R.utils::compressPDF().

HenrikBengtsson commented 9 years ago

RSP directive <%@meta compression="gs(ebook)"%> seems to work. Used in test file inst/rsp_LoremIpsum/LoremIpsum.tex.rsp. If gs(ebook) compression is not supported, a warning is generated, and the original PDF is used/returned.