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

install texlive conditionally #750

Merged
merged 8 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why skip all other processes? In that case, the package installation will not take place, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe any of the processes listed inside install_texlive.sh ought to take place if we're using the ubuntu binaries which already supply these.

fi
cboettig marked this conversation as resolved.
Show resolved Hide resolved

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
Loading