Skip to content

Commit 3b8e18a

Browse files
authored
fix texlive package install
1 parent e82feca commit 3b8e18a

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

book/publishing.qmd

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,21 @@ tlmgr install <package>
8282
```
8383
* Run `tlmgr option` to make sure tlmgr is working.
8484

85-
Unfortunately any packages you install will be in the `/opt` directory and this gets recreated every time you restart your server. So if you need a
86-
particular package you will need to keep installing it. Or create your own image based on py-rocket-base:
85+
By default in py-rocket-base when `tlmgr install` is run `TEXMFHOME` is used and that is set to `\home\jovyan\texmf`. This ensures that when users install texlive packages those are persistent in the user home directory.
8786

88-
Dockerfile
87+
If you want to add texlive packages in a Dockerfile that uses py-rocket-base, then you need to unset `TEXMFHOME` otherwise the package is installed in `\home` and that is unattached in a JupyterHub (typically). Here is an example of Dockerfile code.
8988
```markdown
9089
FROM ghcr.io/nmfs-opensci/py-rocket-base:latest
9190

92-
RUN tlmgr install collection-latexrecommended && tlmgr clean --all
91+
USER root
92+
RUN unset TEXMFHOME && \
93+
PATH=/usr/local/texlive/bin/linux:$PATH && \
94+
echo "Installing texlive collections and extra packages..." && \
95+
tlmgr install collection-latexrecommended collection-latexextra && \
96+
tlmgr install \
97+
pdfcol \
98+
tcolorbox && \
99+
tlmgr clean --all
100+
USER ${NB_USER}
93101
```
94102

0 commit comments

Comments
 (0)