From db82bb257dbc7d4094b8f1d162df57abeaf5b73b Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Wed, 18 Oct 2023 20:36:49 +0530 Subject: [PATCH] binder: Install packages required for Jupyter to PDF convert Per https://github.com/jupyter/nbconvert/issues/1328, these are the packages needed for Jupyter to be able to convert to PDF. Without it, you get unfriendly errors like [this] (https://github.com/2i2c-org/infrastructure/issues/3188#issuecomment-1755969247). Given that the binder image includes jupyter, and texlive is included in the base, I hope it would be reasonable for the binder image to include enough texlive packages for PDF conversion to work. Otherwise, it works in RStudio but not in Jupyter. --- scripts/install_jupyter.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install_jupyter.sh b/scripts/install_jupyter.sh index f8d42a8e..48fb8b8b 100755 --- a/scripts/install_jupyter.sh +++ b/scripts/install_jupyter.sh @@ -36,6 +36,13 @@ install2.r --error --skipmissing --skipinstalled -n "$NCPUS" remotes R --quiet -e 'remotes::install_github("IRkernel/IRkernel@*release")' R --quiet -e 'IRkernel::installspec(user = FALSE)' +# Install tex packages needed for Jupyter's nbconvert to work correctly & convert to PDF +# Sourced from https://github.com/jupyter/nbconvert/issues/1328 +tlmgr install adjustbox caption collectbox enumitem environ eurosym etoolbox jknapltx parskip \ + pdfcol pgf rsfs tcolorbox titling trimspaces ucs ulem upquote \ + ltxcmds infwarerr iftex kvoptions kvsetkeys float geometry amsmath fontspec \ + unicode-math fancyvrb grffile hyperref booktabs soul ec + # Clean up rm -rf /var/lib/apt/lists/* rm -rf /tmp/downloaded_packages