LaTeX / TeX Live
PDF rendering for R Markdown, Quarto, and standalone LaTeX
LaTeX is needed for rendering PDF output from R Markdown, Quarto, and knitr documents. There are two ways to use LaTeX on the cluster: a system-wide TeX Live installation (via modules) or a personal tinytex installation (via R).
Quick start
For most users, tinytex is the easiest option:
# In R — one-time setup, no root needed
tinytex::install_tinytex()This installs a minimal TeX Live in your home directory (~250 MB) that automatically downloads missing LaTeX packages on demand. It works immediately with rmarkdown::render() and quarto render.
System-wide TeX Live (modules)
For reproducibility or when you need the full TeX Live distribution, use the system modules:
module avail texlive # See available versions
module load texlive/2025 # Load a specific version
module load texlive # Load the latest availableAvailable versions
| Version | Status | Use case |
|---|---|---|
texlive/2024 |
Frozen | Reproducibility (matches TeX Live 2024 release) |
texlive/2025 |
Frozen | Reproducibility (matches TeX Live 2025 release) |
Each version is a complete, frozen TeX Live installation — it will never change, so documents that compile today will compile the same way in the future.
Using TeX Live in batch jobs
Load the module before submitting your job. The environment (including PATH to pdflatex, xelatex, etc.) is inherited:
module load R/4.5.3
module load texlive/2025
sbatch my_render_job.slurmInside R, rmarkdown and Quarto will automatically find pdflatex/xelatex on the PATH.
Installing additional LaTeX packages
The system TeX Live installations include the full scheme-full collection, so most packages are already available. If you need a package that’s missing, you can install it into your personal ~/texmf directory:
module load texlive/2025
# Check if a package is installed
kpsewhich <package>.sty
# Install to your personal tree (no root needed)
tlmgr --usermode init-usertree # one-time setup
tlmgr --usermode install <package>tinytex (per-user, self-updating)
tinytex is a lightweight R-managed TeX Live distribution. It installs into your home directory and automatically downloads missing LaTeX packages when you render a document.
Install
install.packages("tinytex")
tinytex::install_tinytex()This takes a few minutes and installs to ~/bin (~250 MB).
Usage
Once installed, rmarkdown::render() and quarto render will use tinytex automatically — no module load needed.
# Just works — tinytex handles LaTeX automatically
rmarkdown::render("report.Rmd", output_format = "pdf_document")If a LaTeX package is missing, tinytex downloads and installs it automatically on first use.
Updating
tinytex::tlmgr_update() # Update LaTeX packages
tinytex::reinstall_tinytex() # Upgrade to latest TeX Live releaseWhich should I use?
| tinytex | System TeX Live module | |
|---|---|---|
| Setup | tinytex::install_tinytex() in R |
module load texlive/2025 |
| Size | ~250 MB (minimal, grows as needed) | ~1.5 GB (complete) |
| Updates | Automatic (latest packages) | Frozen per year |
| Root needed | No | No (already installed) |
| Reproducibility | Tracks latest — may change | Pinned to year — stable |
| Missing packages | Auto-installed on demand | Manual via tlmgr --usermode |
| Best for | Day-to-day PDF rendering | Reproducible builds, full distribution |
For most users doing routine R Markdown or Quarto rendering, tinytex is the better choice — it’s lighter, self-managing, and requires no module loading. Use the system TeX Live modules when you need a specific, reproducible TeX Live version or the full distribution.