Skip to content

Commit

Permalink
install texlive conditionally (#750)
Browse files Browse the repository at this point in the history
@eitsupi my apologies, I didn't realize my local test was pulling the
upstream image. The tex issue is specific to the changes in #743 --
specifically, the official ubuntu repo texlive binaries are installed
and purged in the BUILDDEPS list. By not purging builddeps, we had
conflicting versions of texlive.

This PR modifies the `install_texlive.sh` to not do the manual install
of tlmgr from CPAN if the texlive has already be installed by apt-get
(i.e. `/usr/bin/latex` already exists). I believe it should resolve the
issue.
  • Loading branch information
cboettig committed Jan 25, 2024
2 parents 1828862 + 862715b commit 31b9272
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
15 changes: 9 additions & 6 deletions scripts/install_jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ if ! command -v tlmgr; then
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
# If we are using official Ubuntu binaries, we do not need tex packages installed manually with tlmgr
if [[ ! -x "/usr/bin/latex" ]]; then
# 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
fi

# Clean up
rm -rf /var/lib/apt/lists/*
Expand Down
5 changes: 5 additions & 0 deletions scripts/install_texlive.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -e

if [[ -x "/usr/bin/latex" ]]; then
echo "texlive already installed"
exit 0
fi

CTAN_REPO=${1:-${CTAN_REPO:-"https://mirror.ctan.org/systems/texlive/tlnet"}}

ARCH=$(uname -m)
Expand Down
9 changes: 6 additions & 3 deletions scripts/install_verse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ apt-get remove -y systemd
apt-get -y autoremove

## Add LaTeX, rticles and bookdown support
wget "https://travis-bin.yihui.name/texlive-local.deb"
dpkg -i texlive-local.deb
rm texlive-local.deb
## tinytex recommends a dummy texlive if using tlmgr manually
if [[ ! -x "/usr/bin/latex" ]]; then
wget "https://travis-bin.yihui.name/texlive-local.deb"
dpkg -i texlive-local.deb
rm texlive-local.deb
fi

## Install texlive
/rocker_scripts/install_texlive.sh
Expand Down
6 changes: 6 additions & 0 deletions tests/rocker_scripts/matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
"script_name": "install_tensorflow.sh",
"script_arg": "none"
},
{
"base_image": "rocker/cuda",
"tag": "latest",
"script_name": "install_verse.sh",
"script_arg": "none"
},
{
"base_image": "rocker/cuda",
"tag": "cuda11.1",
Expand Down

0 comments on commit 31b9272

Please sign in to comment.