diff --git a/scripts/install_jupyter.sh b/scripts/install_jupyter.sh index 00db0ab2..832dde5c 100755 --- a/scripts/install_jupyter.sh +++ b/scripts/install_jupyter.sh @@ -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/* diff --git a/scripts/install_texlive.sh b/scripts/install_texlive.sh index 98060b00..c76b4ac3 100755 --- a/scripts/install_texlive.sh +++ b/scripts/install_texlive.sh @@ -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) diff --git a/scripts/install_verse.sh b/scripts/install_verse.sh index 97f3d368..54fabed8 100755 --- a/scripts/install_verse.sh +++ b/scripts/install_verse.sh @@ -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 diff --git a/tests/rocker_scripts/matrix.json b/tests/rocker_scripts/matrix.json index bf07564a..6201f189 100644 --- a/tests/rocker_scripts/matrix.json +++ b/tests/rocker_scripts/matrix.json @@ -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",