A simple, portable Docker-based environment for building LaTeX documents, articles, papers, books, and presentations.
This project provides:
- A reproducible LaTeX build environment using texlive/texlive
- Support for multiple output formats (
pdf,dvi,ps,slides,beamer, etc.) - Ability to specify which .tex file to compile
- Simple docker run and docker compose usage
- Zero installation of TeX Live on your system
-
Compile any
.texfile using Docker -
Fully isolated environment (no need for LaTeX locally)
-
Supports:
- PDF articles
- DVI output
- PS output
- Beamer presentations
- Slide PDFs
- Clean mode to delete temp files
When published to Docker Hub, users will be able to pull:
docker pull basemax/latex-builder:latest(Replace with your actual Docker Hub namespace.)
Compile a LaTeX file inside the current directory:
docker run --rm \
-v $(pwd):/work \
-e TEX_FILE=backend-assignment.tex \
-e BUILD_FORMAT=pdf \
basemax/latex-builderFinish output appears inside ./backend-assignment.pdf.
| Format | Description |
|---|---|
| Build standard PDF | |
| dvi | Produce .dvi output |
| ps | Generate PostScript (.ps) |
| slides | Build slides (PDF output) |
| beamer | Build beamer presentation PDF |
| clean | Remove LaTeX auxiliary files |
| Variable | Default | Example | Description |
|---|---|---|---|
TEX_FILE |
document.tex |
main.tex |
Name of TeX file to compile |
BUILD_FORMAT |
pdf |
slides |
Output format |
docker run --rm \
-v $(pwd):/work \
-e TEX_FILE=main.tex \
-e BUILD_FORMAT=pdf \
basemax/latex-builderdocker run --rm \
-v $(pwd):/work \
-e TEX_FILE=presentation.tex \
-e BUILD_FORMAT=beamer \
basemax/latex-builderdocker run --rm \
-v $(pwd):/work \
-e TEX_FILE=math-paper.tex \
-e BUILD_FORMAT=dvi \
basemax/latex-builderdocker run --rm \
-v $(pwd):/work \
-e TEX_FILE=main.tex \
-e BUILD_FORMAT=clean \
basemax/latex-builderservices:
latex-builder:
build:
context: .
args:
TEX_FILE: backend-assignment.tex
BUILD_FORMAT: pdf
container_name: latex-builder
volumes:
- ./:/work
environment:
TEX_FILE: backend-assignment.tex
BUILD_FORMAT: pdfRun:
docker compose run latex-builderOverride on-the-fly:
TEX_FILE=slides.tex BUILD_FORMAT=beamer docker compose run latex-builderBuild image locally:
docker build -t basemax/latex-builder .Test run:
docker run --rm -v $(pwd):/work basemax/latex-builderEdit the tag:
docker tag basemax/latex-builder basemax/latex-builder:latestPush:
docker push basemax/latex-builder:latestMIT License
Copyright © 2025 Seyyed Ali Mohammadiyeh (Max Base)