rstudio / rstudio-docker-products

Docker images for RStudio Professional Products
https://hub.docker.com/u/rstudio
MIT License
62 stars 55 forks source link

Tex version issue in base images #743

Open kfeinauer opened 2 months ago

kfeinauer commented 2 months ago

In the base image, we install Tex here:

https://github.com/rstudio/rstudio-docker-products/blob/75f550bf7123c765712e23eae20df898a362b1ca/product/base/Dockerfile.ubuntu2204#L33-L39

This allows users to use Quarto and RMarkdown to knit documents, but this will only work for so long. Eventually, next calendar year, the default Tex repos will bump versions and no longer be compatible, as mentioned by a customer. This prevents rendering of any Quarto/RMarkdown documents unless worked around.

Example .qmd file content:

---
title: "TexLive Error Example"
format: pdf
---

# Demoing the error

```{r}
mtcars

Error when rendering:

==> quarto preview remediation_EValue_4.1.3.qmd --to pdf --no-watch-inputs --no-browse

processing file: remediation_EValue_4.1.3.qmd
1/3
2/3 [unnamed-chunk-1]
3/3
output file: remediation_EValue_4.1.3.knit.md

pandoc
to: latex
output-file: remediation_EValue_4.1.3.tex
standalone: true
pdf-engine: xelatex
variables:
graphics: true
tables: true
default-image-extension: pdf

metadata
documentclass: scrartcl
classoption:
- DIV=11
- numbers=noendperiod
papersize: letter
header-includes:
- '\KOMAoption{captions}{tableheading}'
block-headings: true
title: TexLive Error Example

Rendering PDF
running xelatex - 1
This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode

updating tlmgr

updating existing packages
finding package for scrartcl.cls
ERROR: Your TexLive version is not updated enough to connect to the remote repository and download packages. Please update your installation of TexLive or TinyTex.

Underlying message: Local TeX Live (2023) is older than remote repository (2024).
Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update
See https://tug.org/texlive/upgrade.html for details.

Stack trace:

Underlying message: Local TeX Live (2023) is older than remote repository (2024).
Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update
See https://tug.org/texlive/upgrade.html for details.

at findPackages (file:///opt/quarto/1.4.550/bin/quarto.js:75468:27)
at eventLoopTick (ext:core/01_core.js:183:11)
at async findAndInstallPackages (file:///opt/quarto/1.4.550/bin/quarto.js:76288:30)
at async initialCompileLatex (file:///opt/quarto/1.4.550/bin/quarto.js:76180:39)
at async generatePdf (file:///opt/quarto/1.4.550/bin/quarto.js:76125:22)
at async Object.complete (file:///opt/quarto/1.4.550/bin/quarto.js:76405:27)
at async file:///opt/quarto/1.4.550/bin/quarto.js:70089:31
at async withTimingAsync (file:///opt/quarto/1.4.550/bin/quarto.js:19466:25)
at async Object.complete (file:///opt/quarto/1.4.550/bin/quarto.js:70087:13)
at async Object.onPostProcess (file:///opt/quarto/1.4.550/bin/quarto.js:77266:36)

This can be mitigated by users by running a command to pin the Tex repos to an older version as mentioned in this thread but this is an annoyance to customers and either requires them to run this every time they do work, or to modify the image manually.

Ideally this error would never surface to customers and things would just work, falling back to older Tex repos if necessary. I do not think we should be rebuilding images with updated versions of Tex.

The Quarto team may have some ideas on how to tackle this issue.

bdeitte commented 2 months ago

We should ask in the quarto Slack channel and can go from there

bschwedler commented 2 months ago

Guidance from Quarto: https://quarto.org/docs/output-formats/pdf-engine.html#managing-tex

We may want to implement this outside of quarto, but use the same underlying method to update tinytex.