Since Overleaf online free edition compile only offers a one minute maximum compile time for LaTeX projects this project was created to compile arbitrary LaTeX documents locally of any size. The project contains a docker container that facilitates the usage. The steps below describe how to compile your latex project. The implementation used Latexmk
, similar to Overleaf, make sure that your projects LaTeX version is supported by Latexmk
to ensure reliable compilation results.
- Install necessary programs needed to run the compile.tex.sh script (not needed if using docker). A list of the required programs can be found in the
Dockerfile
. - Start by placing your LaTeX projects in the
./document
folder, either as a project folder or.zip
download fromOverleaf
. - Define path to the main project
.tex
file that should be compiled in thecompilelist.txt
file. The relative path is important, an example of an appropriate path would be:documents/project/thesis_main.tex
. The implementation requires that the symbols(
and - Run the compile script locally or via docker, see how below.
- The resulting compiled
.pdf
file is moved into the./target
folder. Done!
NOTE: The ./document
and ./target
folder is ignored by git tracking, it is safe to place documents within the folders.
Run the compile.tex.sh
script:
# Make file executable:
chmod +x ./compile.tex.sh
# Run script:
./compile.tex.sh
The Dockerfile
contains programs and requirements needed to create the Ubuntu:22.04 docker containers. The containers can be executed directly through docker or with docker-compose. The command below will execute the container.
# Using Docker
docker build -t overleaf_latex_compile .
docker run overleaf_latex_compile
# Using Docker Compose
docker-compose up --build
NOTE: This container takes a long time to build the first time. It is primarily the downloading and installation of programs in the container that takes time. Once the container is built, it is convenient to run it every time documents are to be compiled.
The ./tests
folder contains an example latex project and a script to test compile it using docker-compose.
This project is created under a MIT LICENSE.
Copyright (c) 2023 Grebtsew