Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binder: Install packages required for Jupyter to PDF convert #714

Merged
merged 12 commits into from
Oct 20, 2023
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# News

## 2023-10

### Changes in pre-built images

- `rocker/binder` now includes necessary LaTeX packages to allow Jupyter Notebooks to be converted to PDF. ([#714](https://github.com/rocker-org/rocker-versioned2/pull/714))

eitsupi marked this conversation as resolved.
Show resolved Hide resolved
### Changes in rocker_scripts

- `install_jupyter.sh` will now install TexLive if it is not installed, and add
additional LaTeX packages needed for Jupyter PDF conversion. This will increase
the build time and size of the final image in cases `install_jupyter.sh` is called.

## 2023-04

### Changes in pre-built images
Expand Down
13 changes: 13 additions & 0 deletions scripts/install_jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ 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 texlive if it has not already been installed
if ! command -v tlmgr; then
# shellcheck source=/dev/null
source /rocker_scripts/install_texlive.sh
fi

# 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
Expand Down
Loading