A GitHub Action that provides a complete TeXLive environment for running LaTeX-related commands and scripts.
Tip
This action is designed for running custom commands, scripts, and build processes in a LaTeX environment. If you only need to compile LaTeX documents, consider using latex-action instead.
- 🐳 Containerized: Runs in a Docker container with a complete TeXLive installation.
- 📅 Version flexibility: Supports both the latest and historic versions of TeXLive (2020-2025).
- 🐧 Multi-platform: Support both Alpine and Debian-based Docker images.
- 📦 Two installation schemes: Choose between full or small TeXLive installation.
- Full scheme: Complete TeXLive installation with all packages
- Small scheme: Minimal TeXLive installation with basic packages only (smaller image size)
- ⚙️ Fully customizable: Run arbitrary commands to build your custom LaTeX documents.
All Docker images are built using scripts from latex-docker.
Configure the action by providing these inputs in the with
section:
-
run
(required) Bash commands to execute. Commands are executed withbash -eo pipefail -c {input}
.- uses: xu-cheng/texlive-action@v3 with: run: | latexmk -pdf -file-line-error -halt-on-error -interaction=nonstopmode main.tex
-
texlive_version
TeXLive version to use (2020-2025 or 'latest'). Defaults to 'latest'. Cannot be used withdocker_image
.- uses: xu-cheng/texlive-action@v3 with: texlive_version: 2024 run: ...
-
os
Base operating system for the Docker image (alpine
ordebian
). Defaults toalpine
.- uses: xu-cheng/texlive-action@v3 with: os: debian run: ...
-
scheme
TeXLive installation scheme (full
orsmall
). Defaults tofull
. Cannot be used withdocker_image
. When usingsmall
,os
must bealpine
andtexlive_version
must belatest
.- uses: xu-cheng/texlive-action@v3 with: texlive_version: latest os: alpine scheme: small run: ...
-
docker_image
Custom Docker image to use (overridestexlive_version
,os
, andscheme
). We recommend using latex-docker images.- uses: xu-cheng/texlive-action@v3 with: docker_image: ghcr.io/xu-cheng/texlive-alpine@sha256:<hash> run: ...
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action@v3
with:
run: |
latexmk -pdf -file-line-error -halt-on-error -interaction=nonstopmode main.tex
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action@v3
with:
scheme: small
run: |
# Install additional packages if needed
tlmgr install collection-fontsextra
pdflatex main.tex
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action@v3
with:
os: debian
run: |
# Install system dependencies
export DEBIAN_FRONTEND=noninteractive
apt-get update -y
apt-get install -y make
make
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action@v3
with:
texlive_version: 2024
run: |
latexmk -pdf -file-line-error -halt-on-error -interaction=nonstopmode main.tex
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action@v3
with:
docker_image: ghcr.io/xu-cheng/texlive-alpine@sha256:<hash>
run: |
latexmk -pdf -file-line-error -halt-on-error -interaction=nonstopmode main.tex
MIT