pdflatex by hand breaks down as soon as a paper grows or co-authors join. You have three practical ways to automate builds—local latexmk and make, containerized CI such as GitHub Actions, or a browser editor—and many teams combine them.
Choosing a build workflow
Option 1: Local builds with latexmk and a Makefile
latexmk ships with TeX Live and inspects .aux, .fls, and bibliography dependencies to run pdflatex (or xelatex/lualatex), BibTeX/Biber, and cross-reference passes in the required order until the output stabilizes.
.latexmkrc file next to main.tex so every collaborator runs the same settings with plain latexmk:
latexmk in a short Makefile:
latexdiff-vc ships with TeX Live alongside latexdiff and writes main-diffsubmitted-v1.pdf when given --git -r submitted-v1 --pdf. Note that arxiv assumes classic BibTeX has produced $(MAIN).bbl; if your venue uses BibLaTeX/Biber or accepts .bib directly, check its submission instructions before bundling.
Option 2: Reproducible CI with GitHub Actions and a pinned TeX Live container
Runninglatexmk inside a pinned official texlive/texlive Docker image avoids relying on unverified third-party wrapper actions and keeps the exact TeX Live distribution stable across future revisions:
- Stop on errors and check warnings explicitly.
-interaction=nonstopmode -halt-on-errorprevents TeX from hanging on a prompt and returns a non-zero exit code on errors. Unresolved\refor\citekeys still exit0by default, so checkingmain.logforThere were undefined references.andCitation .* undefinedcatches broken links before submission. - Pin the container digest (and action versions). Rolling
latesttags update weekly; pinning a specifictexlive/texlive@sha256:...digest (or a historic release tag such asTL2025-historic) keeps builds reproducible months later during journal revisions.
Option 3: Combining GitHub CI with a browser editor
You do not have to choose between CI and browser editing. In LaTeX Cloud Studio, full compilation runslatexmk on TeX Live 2026 so bibliography and cross-reference passes finish in one compile, and projects can be transferred through ZIP upload/export and GitHub import, push, and pull workflows (see GitHub Sync, Import & Export). Co-authors who prefer editing in the browser can push commits to the same GitHub repository that runs your CI workflow and Makefile targets.
Related Guides
- LaTeX Collaboration Workflow - The conventions that make the Git flow calm
- Bibliography Management - Why those extra passes exist at all
- Common LaTeX Errors - What to do when CI goes red
latexmk compilation without maintaining a local TeX installation? Start from the Basic Article template in LaTeX Cloud Studio or import your existing GitHub repository.