LaTeX: TeX Live and TinyTex

Overview

Users of our AlmaLinux images may occasionally encounter missing package errors due to fewer packages in its TexLive installation.

LaTeX, a widely used typesetting system for scientific and technical documents, is essential for rendering Rmarkdown and Quarto documents. We bundle a full installation of the “Tex Live” package in our images for convenience, despite its large size (~2GB). Note that the TexLive package contents vary across operating systems, with the Ubuntu/Debian package containing more than the one for RPM-based systems (RHEL, Alma, etc.).

TinyTex

TinyTex a lightweight and portable LaTeX distribution based on TeX Live, is ideal for R users who need LaTeX without installing a large distribution. However, in a managed Posit environment by cynkra, TinyTex is usually unnecessary. Using it can lead to incompatibility issues due to the mix of the system’s TexLive and TinyTex packages.

When to use TinyTex?

Use TinyTex when a missing package isn’t available in the system’s TexLive installation. First, contact cynkra to check if the package is available via a system package (e.g., texlive-<package name>). Only if not, use TinyTex to install the missing package. Note that TinyTex installs packages in a user-context, which can lead to redundant packages and unnecessary disk space usage over time.

How to use TinyTex?

If required, install and use TinyTex as follows:

# install the R package tinytex itself
install.packages("tinytex")
# via the R package, install the TinyTex LaTeX distribution
tinytex::install_tinytex() # answer "yes" to the prompt
# install a LaTeX package
tinytex::tlmgr_install("<package name>")

All TinyTex assets are stored in ~/.TinyTeX/ and can be removed by deleting this directory.