Compile .tex files in a Docker container with custom dependencies.
Inspire from this project by blang and his docker image blang/latex.
make f=main.tex
Or configure the MAIN_FILE variable in the Makefile and run:
make
- Docker installed
- Make command installed
- The user should be in the docker group. If not, run:
sudo usermod -aG docker $USER
cd /path/to/my-latex-project
git clone https://github.com/mathurinhauville/latex-docker.git
make build
make start
You can edit the Dockerfile.custom to add other tlmgr packages.
The Dockerfile use image from blang/latex and add custom dependencies. Initially, the tag is set to ctanfull
and provide a large amount of packages but heavy (3.07GB). If you want to reduce the image size and customize as you want, you can change the tag to ctanbasic
(210.18 MB).
make build
: Build the Docker imagemake start
: Start the Docker containermake stop
: Stop the Docker containermake comp <f=texfile>
: Compile the .tex file. By default, the .tex file ismain.tex
and display the pdf file.make clean
: Remove the generated filesmake preview
: Preview the generated PDF file