Quite long time ago I was extensively using LaTeX with a Makefile that I have found on internet. This allowed me to automatically build/rebuild my project as many time as it was needed to get everything in place. Of course it also took care of the bibliography and the conversion of the jpg figures to eps. At the end, the dvi was translated to ps then to pdf.

It was quite easy because I simply had to configure my text editor (Vim) to use this Makefile.

Nowadays things have changed a lot and people tend to use scripts like latexmk that I don't know. Also it seems simpler to directly use pdflatex with viewers like Sumatra instead of regular dvi viewers.

What would be the most common method to build a whole LaTeX project in one step that includes the following elements?

  • LaTeX files
  • bibliography
  • images (jpg, pdf, eps)
  • code (c, php, ...)
  • output from scripts (Matlab/Octave, Perl, ...)
  • 4
    latexmk will handle points 1 and 2 natively. If you use pdflatex on any modern TeX installation, point 3 is handled automatically (pdflatex will read PDF and JPG natively, and the epstopdf package is normally automatically loaded and handles EPS). Points 4 and 5 could be handled by the listings package, but that won't run the scripts or programs on its own. So you could use a makefile to update output from point 5, and let latexmk and your document handle points 1-4. Aug 25, 2015 at 12:45
  • 2
    Depending on your security concerns, you can enable spawning processes from within a TeX run to have scripts execute directly. The rest as already noted is pretty easy to script with latexmk or one of the alternatives (rubber, arara, ...).
    – Joseph Wright
    Aug 25, 2015 at 13:10

1 Answer 1


In the meantime I have found a solution that is robust and that involves:

  • A Docker image
  • A GitHub repository
  • A CI such as TravisCI
  • A Makefile

One minimal example would be https://github.com/heig-vd-tin/refcard

A Makefile allow to use the Docker image to build the project

# Sed replacement for WSL
PWD!=pwd | sed 's/^\/mnt//'
DOCKER=docker run -it -v "$(PWD):/srv" -w=/srv nowox/latex:1.1

all: main.tex
    $(DOCKER) latexmk -pdf -xelatex $<

    $(DOCKER) latexmk -C

.PHONY: clean

The .travis.yml file will build the project at each commit:

sudo: required
language: latex
services: docker

  - docker pull nowox/latex:1.1

  - make

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .