How the marked manuscript is built
Most journals ask for a version of a revised paper that shows what changed. Producing it by hand is slow and easy to get wrong, and producing it automatically from LaTeX source is harder than it looks: the marking has to go inside somebody else’s document and still compile. This article describes how Manulyx builds it, and what we check.
What you get
From a stage’s menu, or a .tex file’s, Manulyx offers two PDFs:
- Marked manuscript: the revision compared with an earlier submitted stage, deleted text struck through in red and new text underlined in blue.
- Highlighted manuscript: the same comparison shown as the revised manuscript itself, new and changed text in blue and nothing deleted shown.
Any stage can be compared with any earlier one; by default it is the one the revision answers. Separately, while you work, PDF with these changes marked shows the tracked changes still waiting in a stage, marked the same way.
The comparison never changes your source. The marked files exist for that one build only, compiled beside the stage’s own files so that its document class, styles and figures are found. It is not recorded as a compile of the project, and the PDF in the editor is left as it was. If you already mark your changes yourself, with colour commands or a changes package, Manulyx leaves that as you wrote it: the marked manuscript is an optional tool, not a requirement.
latexdiff first
The comparison is made by latexdiff, an open-source program written for comparing LaTeX documents. It is installed in the image Manulyx runs from, alongside the TeX Live packages the compiler uses, and Manulyx tries it first for every file.
Before comparing, Manulyx joins the two arguments of a running header (\markboth, \markright) onto one line, and asks latexdiff not to mark inside them. Publisher templates often write those arguments on separate lines, and marking between them can push the title off the first page. A changed header is shown as it now reads.
A documented fallback that aims to compile
If latexdiff is unavailable, or does not return a complete result, Manulyx uses its own differ instead; the marked LaTeX in the submission package records which of the two produced it. The fallback follows one principle: a marked manuscript that does not compile is worse than a plainer one that does. So it is deliberately conservative.
- It compares the text line by line, and wraps lines of prose that changed in the marking.
- Structural lines are never wrapped: section headings, the beginning and end of environments, figures, captions, labels, list items and display maths. They are kept as they now read, and every structural change is listed in a Summary of structural changes at the end, printed as text so that a changed heading is shown rather than typeset as a heading. The preamble is never marked.
- Table rows, and lines that open a brace they do not close, are never wrapped either: inside a marking command they stop being valid LaTeX. They too go in the summary, so a changed table is still reported.
- A comment at the end of a changed line is moved outside the marking rather than left to comment out its closing brace. The note is yours, so it is kept; an escaped
\%is not treated as a comment. - Citations, cross-references, URLs and footnotes in a changed line are boxed, so that the ulem package, which draws the underline and the strike-through, treats each as a single unit. They are still marked in colour and still typeset. This was fixed on 14 October 2026; before it, a changed line containing a citation could stop the marked manuscript from compiling.
- The marking commands are added without package options, so a manuscript that already loads ulem or xcolor with options of its own does not fail with an option clash.
Chapters and included files
A thesis keeps most of its text in chapters brought in with \input or \include, and comparing the main file alone would mark almost nothing. So Manulyx compares every .tex file in the stage that also exists in the earlier one and has changed, replaces each with its marked version for that build, and gives the main file the marking commands even when the main file itself did not change.
The highlighted manuscript
The highlighted manuscript is the same comparison with the marking redefined after the preamble: additions in blue, deletions producing nothing. It uses coloured text rather than a background highlight, because a highlight breaks on mathematics and inside tables and colour does not. The fallback’s summary of structural changes is left out of it, since it is a note for the editor rather than part of the manuscript.
When it does not compile
A marked manuscript can still fail, most often because the manuscript itself does not compile. When it does, Manulyx says so rather than handing you an empty file, and the message says how to download the LaTeX it produced so you can see why.
What we check
The tests for the marked manuscript do not ask whether the markup looks right; they ask whether LaTeX produces a PDF from it. Every case is compiled. They cover the cases latexdiff is known to find hard and the ones authors write without thinking: changed prose, a changed table row, a changed figure caption, display and aligned equations, a custom macro, a trailing comment, unbalanced braces across lines, a manuscript that already loads ulem and xcolor with and without options, changed lines containing citations (including citations with page numbers), cross-references, equation references, URLs and footnotes, the summary of structural changes, running headers, and a document with no changes, which must come out with no marking at all.
More articles
- After a rejection: moving a paper to another journal's template
- Checking your references for retracted papers before you submit
- How to convert a Word document to LaTeX (equations included)
- How to write a response letter to reviewers
- How to make a marked (tracked-changes) manuscript in LaTeX
- Fixing common BibTeX and biblatex errors
- Choosing and setting up a thesis template in LaTeX
- How Manulyx keeps the version you submitted
- How co-editing keeps your work safe
- All articles