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.
The services require the following environment variables:
UID- The Unix User ID. This can be obtained by runningid -uGID- The Unix User Group ID. This can be obtained by runningid -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.
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 ServiceDescription: 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 Servicecompile-opt2 (latexmk with pdflatex)
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 Servicecompile-opt3 (latexmk -> dvips -> ps2pdf -> pdf)
Description: A traditional .tex build pipeline.
- uses
latexmkto create a DVI file. - converts DVI to PostScript using
dvips. - 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 ServiceDescription: 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 ServiceDescription: 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 ServiceDescription: 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 ServiceDescription: Persistent storage for TeX Live data to speed up subsequent builds.
Access this volume by running the alpine-volume service.