[R-pkg-devel] [External] compact vignettes
Ivan Krylov
|kry|ov @end|ng |rom d|@root@org
Thu Jul 24 01:00:32 CEST 2025
В Wed, 23 Jul 2025 20:09:26 +0000
"Richard M. Heiberger" <rmh using temple.edu> пишет:
> When I use
> R_QPDF=/Library/Frameworks/R.framework/Resources/bin/qpdf
> R_GSCMD=/usr/local/bin/Cellar/ghostscript/10.03.0/bin/gs
> GS_QUALITY=ebook
> echo $R_QPDF $R_GSCMD $GS_QUALITY
> R CMD build --compact-vignettes=both microplot
>
> I get 558950 bytes
>
> The bytecount for the package went up.
Unfortunately, this seems to be very dependent on versions of software
in use, including LaTeX and Ghostscript (and fonts?). I can compress
your pre-built 372Kb vignette to 96Kb (as does the CRAN machine), but
when I rebuild the package, I can only get down from 276Kb to 156Kb:
R -q -s -e '
untar("microplot_1.0-47.tar.gz.orig");
tools::compactPDF(
"microplot/inst/doc",
gs_cmd = "gs", gs_quality = "ebook",
verbose = TRUE
)
'
qs_quality="ebook" : use_gs=TRUE, use_qpdf=TRUE
#{pdf}s = length(paths) = 1
- microplot/inst/doc/rmhPoster.pdf: gs: res=0; + qpdf: res=0;
==> (new=98115)/(old=380862) = 0.257613 =====> using it !!
compacted ‘rmhPoster.pdf’ from 372Kb to 96Kb
LANGUAGE=en R_GSCMD=gs GS_QUALITY=ebook R CMD build \
--compact-vignettes=both microplot
<...>
* creating vignettes ... OK
<...>
* compacting vignettes and other PDF files
compacted ‘rmhPoster.pdf’ from 276Kb to 156Kb
And 'gs --version' says '10.00.0', which shouldn't be that different
from your '10.03.0'!
--
Best regards,
Ivan
More information about the R-package-devel
mailing list