rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

Include pdfcrop in rocker/verse #146

Closed riccardoporreca closed 5 years ago

riccardoporreca commented 5 years ago

When using R Markdown with PDF output, it is typically desired to get figures cropped (hence the default fig_crop: true).

For this to work pdfcrop must to installed, but rmarkdown silently ignores cropping if that is not the case. Since the default TinyTeX installation does not include pdfcrop (yihui/tinytex#118), it could be problematic for users of rocker/verse.

It is probably sensible to add pdfcrop to the existing tlmgr install command in the rocker/verse Dockerfile (hinted by @yihui in this comment) https://github.com/rocker-org/rocker-versioned/blob/08ca130eaf2f517452b4d4fa65ac34842eaaafd0/verse/Dockerfile#L50 This should be enough given that Ghostscript is already covered in the Dockerfile.

yihui commented 5 years ago

Just FYI, the pdfcrop package is sufficiently small:

> tinytex::tlmgr(c('info', 'pdfcrop'))
tlmgr info pdfcrop
package:     pdfcrop
category:    Package
shortdesc:   Crop PDF graphics
longdesc:    A Perl script that can either trim pages of any whitespace border, or trim them of a fixed border.
installed:   No
sizes:       doc: 13k, run: 41k, bin: 9k
relocatable: No
cat-version: 1.37
cat-date:    2018-01-06 12:14:59 +0100
cat-license: lppl
cat-topics:  pdfprocess
collection:  collection-binextra
cboettig commented 5 years ago

@riccardoporreca yup, this is a good idea, thanks. want to send us PR for this? (please update both verse/Dockerfile and also verse/devel/Dockerfile so both latest /3.6.0 and devel will have it going forward....)

riccardoporreca commented 5 years ago

want to send us PR for this?

Sure, will do!

eddelbuettel commented 5 years ago
I never understand this approach. `pdfcrop` is part of a TeXLive package and hence part of the distro this container too is based on: ```sh edd@rob:~$ which pdfcrop /usr/bin/pdfcrop edd@rob:~$ dpkg -S $(which pdfcrop) texlive-extra-utils: /usr/bin/pdfcrop edd@rob:~$ ``` Whatever works, as long @cboettig does not mind the manual piecemeal approach.
riccardoporreca commented 5 years ago

@cboettig, closing this issue given PR #147 was merged.