Purplelink
← All guides

latexdiff online for a multi-file project

A revision usually asks for a marked-up PDF, and a real manuscript is rarely one file. This guide covers the commands for a project with \input and \include, the options that fix the usual failures, and what our online tool does with a project.

Everything below about latexdiff, latexdiff-vc and latexpand comes from their own documentation: the manual embedded in the latexdiff source and the help text of latexpand, both read on 2026-10-13. I did not run the commands for this page, because neither program is installed on the machine I wrote it on, so there is no sample output here. Run them on a copy of your project first.

Which tool for which job

One file

With a single .tex file per version:

latexdiff old.tex new.tex > diff.tex
pdflatex diff.tex

The manual says the old and new files must be real files, not pipes. It also says the preamble is compared line by line while the body is compared word by word, so a changed preamble shows up as commented lines (%DIF) rather than as marked text.

A project with several files

latexdiff compares the text of the two files you give it. If the main file only contains \input{intro}, a comparison of two main files sees an unchanged line. You need the included text in front of latexdiff. There are three ways to get it.

Option 1: latexdiff-vc with git

If the project is in a git repository, latexdiff-vc (installed alongside latexdiff) can check out two revisions into a temporary directory, flatten them and compare them. From the documentation:

# working copy against the last commit
latexdiff-vc --git --flatten -r HEAD main.tex

# two named revisions
latexdiff-vc --git --flatten -r v1-submitted -r HEAD main.tex

Here v1-submitted stands for any tag, branch or commit in your repository. Points from the documentation worth knowing:

Option 2: flatten with latexpand, then compare

If the versions are two folders rather than two commits, flatten each one first. latexpand expands \input and \include and, by default, strips comments.

latexpand old/main.tex -o old-flat.tex
latexpand new/main.tex -o new-flat.tex
latexdiff old-flat.tex new-flat.tex > diff.tex

Two options from its help text matter for manuscripts. --keep-comments keeps comment lines, which is the documented workaround for verbatim blocks, because latexpand does not recognise verbatim environments and would strip a % inside one. --expand-bbl FILE inlines a compiled .bbl file; --biber FILE does the same for biblatex with biber. Compile diff.tex in the folder of the new version, or copy that version's figures and class files next to it, so LaTeX can find them.

Option 3: let latexdiff flatten

latexdiff has its own flag:

latexdiff --flatten old/main.tex new/main.tex > diff.tex

The manual says this replaces \input and \include in the body with the file contents, recursively, honours \includeonly, and also handles \import, \subimport and \subfile. It assumes included files sit in the same directories as the old and new main files. It also warns that processing time can become prohibitive for larger documents and that the result no longer reflects the structure of your input files. If it is slow on a long thesis, option 1 or 2 is the fallback.

Common failures and the options that exist for them

Every option below is listed in the latexdiff manual. Add them to the same command line.

A moved paragraph is compared as text, so it shows as deleted in one place and added in another. The manual describes no move detection.

What our online tool does today

Everything here is taken from the LaTeX diff tool page itself.

The tool page does not list any latexdiff options, so you cannot pass --math-markup or --append-textcmd to it, and it does not say how it handles a bibliography. If your project needs those, run latexdiff locally with the commands above. Install LaTeX on a Mac if you do not have a TeX distribution yet.

Other ways to run latexdiff online

Three other services come up when you search for latexdiff online, and a local install is the fourth option. The figures below come from each maker's own page, read on November 21, 2026. I have not tested the other services.

latexdiff online and its alternatives, as of November 21, 2026
Tool Where it runs Size limit Several files Cost
Our LaTeX diff tool Our server; files deleted after the PDF is built 5 MB .tex, 10 MB .zip Yes, a .zip with main.tex Free
TheLaTeXLab Their server, running latexdiff from CTAN 500 KB per file, 4 MB project, 5 MB .zip Yes, two project zips Free
git-latexdiff-web latexdiff.cn, or your own server with Docker Not stated Yes, \input MIT licence; no price stated for the hosted site
Overleaf Online editor Not applicable Yes Track changes from Student, $8.25 a month billed yearly; Free keeps 24 hours of history
latexdiff on your Mac Your Mac, with TeX Live or MacTeX None Yes, --flatten Free

Three points stand out. First, TheLaTeXLab caps each file at 500 KB, so a long thesis chapter may need splitting there, while our tool takes up to 5 MB per file. Second, git-latexdiff-web is the one to choose if your files must not leave your own machines, because you can run it yourself in Docker. Third, Overleaf's plans page lists track changes and full history as paid features. It does not describe a latexdiff export, so check Overleaf's documentation before relying on it for a marked-up PDF. None of the online services lists the latexdiff options covered above, so a project that needs them is best run locally.

After the PDF

Check your journal's submission instructions for whether it wants a marked-up PDF. Producing a diff PDF for journal resubmission covers producing one. To compile the project itself in a browser, see compile a LaTeX project online, and check your response letter before resubmitting before it goes out.