Skip to content

Repository files navigation

compose-tex

Introduction

This project provides several Docker Compose services.

The services support the following TeX Live supported workflows:

  • TeX compilation
  • package updates
  • environment cleanup

Docker Compose permits this without installing TeX Live directly on your local machine.

Variables

The services require the following environment variables:

  • UID - The Unix User ID. This can be obtained by running id -u
  • GID - The Unix User Group ID. This can be obtained by running id -g

In the following examples, the UID and GID values are stored in an .env file passed to Docker Compose using the --env-file argument.

Services

Description: A base class defining the core TeX Live image (texlive/texlive:latest). This service isn't intended to be invoked directly, but rather extended and reused by other services (inheritance).


Description: Runs tlmgr (the TeX Live package manager) to update all installed LaTeX packages inside the texlive-data volume.

Example:

docker-compose \
    --env-file .env \                   # Include Environment Variables
    -f compose-tex/docker-compose.yml \ # Include Base Compose File
    run --rm \                          # Run Container then Remove
    update                              # Run Service

Description: Compiles your .tex document directly to a PDF using the standard pdflatex engine.

Example:

docker-compose \
    --env-file .env \                   # Include Environment Variables
    -f compose-tex/docker-compose.yml \ # Include Base Compose File
    run --rm \                          # Run Container then Remove
    -e INPUTDIR=. \                     # TeX file location
    -e OUTPUTDIR=build \                # PDF output location
    -e FILE_NAME=main \                 # TeX file name
    compile-opt1                        # Run Service

Description: Compiles your .tex document using latexmk configured for pdflatex.

Example:

docker-compose \
    --env-file .env \                   # Include Environment Variables
    -f compose-tex/docker-compose.yml \ # Include Base Compose File
    run --rm \                          # Run Container then Remove
    -e INPUTDIR=. \                     # TeX file location
    -e OUTPUTDIR=build \                # PDF output location
    -e FILE_NAME=main \                 # TeX file name
    compile-opt2                        # Run Service

Description: A traditional .tex build pipeline.

  1. uses latexmk to create a DVI file.
  2. converts DVI to PostScript using dvips.
  3. converts PostScript to PDF using ps2pdf.

Example:

docker-compose \
    --env-file .env \                   # Include Environment Variables
    -f compose-tex/docker-compose.yml \ # Include Base Compose File
    run --rm \                          # Run Container then Remove
    -e INPUTDIR=. \                     # TeX file location
    -e OUTPUTDIR=build \                # PDF output location
    -e FILE_NAME=main \                 # TeX file name
    compile-opt3                        # Run Service

Description: Compiles your .tex document using xelatex.

Example:

docker-compose \
    --env-file .env \                   # Include Environment Variables
    -f compose-tex/docker-compose.yml \ # Include Base Compose File
    run --rm \                          # Run Container then Remove
    -e INPUTDIR=. \                     # TeX file location
    -e OUTPUTDIR=build \                # PDF output location
    -e FILE_NAME=main \                 # TeX file name
    compile-opt4                        # Run Service

Description: Compiles your document using the lualatex engine, embedding the Lua scripting language.

Example:

docker-compose \
    --env-file .env \                   # Include Environment Variables
    -f compose-tex/docker-compose.yml \ # Include Base Compose File
    run --rm \                          # Run Container then Remove
    -e INPUTDIR=. \                     # TeX file location
    -e OUTPUTDIR=build \                # PDF output location
    -e FILE_NAME=main \                 # TeX file name
    compile-opt5                        # Run Service

Description: An interactive Alpine container mounting both your local project and the persistent texlive-data volume.

  • The local directory is mounted in /data.
  • The texlive-data volume is mounted in /mnt/texlive-data

The alpine-volume service can be started with volume.sh.

Example:

docker-compose \
    --env-file .env \                   # Include Environment Variables
    -f compose-tex/docker-compose.yml \ # Include Base Compose File
    run --rm \                          # Run Container then Remove
    alpine-volume                       # Run Service

Volumes

Description: Persistent storage for TeX Live data to speed up subsequent builds.

Access this volume by running the alpine-volume service.

About

Docker Compose Shared Service for TeX

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages