LaTeX Diff Viewer · Actions · GitHub Marketplace · GitHub
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
LaTeX Diff Viewer<br>Actions
About
Build a git-latexdiff PDF between two commits and share it as a PR comment + artifact<br>v1.1.11<br>Latest
By alpaylan
Star6 (6)You must be signed in to star a repositoryUse latest version<br>Choose a version
latex-diff-viewer
Render git-latexdiff between<br>any two commits of any LaTeX project, and browse the result — on pull requests,<br>via on-demand requests, and as a published, browsable web viewer. All the TeX<br>tooling ships in a prebuilt Docker image; you provide only your build instructions<br>(often none — it auto-detects).
Live demo: https://alpaylan.github.io/latex-diff-viewer-demo/ — pick two<br>commits, view the rendered diff (added text blue + underlined, removed red + struck<br>through), and click a changed page to jump straight to it. The<br>demo repo is a tiny paper with<br>a curated commit history (text edits, a table/float change, a section add).
Quick start (recommended)
Get PR diffs, on-demand diffs, and a browsable viewer — all in one file.
Add the workflow. Copy examples/consumer.yml to<br>.github/workflows/latex-diff.yml.
(Optional) add difftool.toml. Skip it if your project is a single document<br>built with latexmk — the tool auto-detects the main .tex (the file with<br>\documentclass + \begin{document}). Otherwise:<br>main = "paper.tex"<br>build_command = "make" # only if you don't use latexmk
Turn on Pages. After the first run creates the latexdiff-store branch, set<br>Settings → Pages → Deploy from a branch → latexdiff-store / (root) .
That's it. Now:
You do…<br>You get…
Open a PR<br>the base→head diff rendered in the viewer , linked from a PR comment
Push to main<br>recent commits' diffs + a current-draft full render, seeded into the viewer
Open an issue latexdiff ..<br>that diff built on demand , with a viewer link
The viewer (the latexdiff-store branch, served by Pages) shows all of them in one<br>place, with a clickable changed-pages index — automatically, no config.
What it looks like
PR comment (the diff renders in the viewer; the artifact is just a fork-PR fallback):
📄 LaTeX diff
✅ Built a1b2c3d..e4f5a6b — 2 changed page(s) .
View the diff ↗ · or download the latex-diff artifact from the run.
Issue request — a single comment that transitions in place:
🔧 Building diff v1..HEAD… Follow along in the workflow run ▸.
…then, when it's done (and the issue auto-closes):
📄 Built v1..HEAD — 2 changed page(s) . View it here: https://you.github.io/repo/?diff=v1..HEAD
Viewer on mobile — full-screen PDF (rendered with PDF.js so it works on iOS),<br>with slide-in drawers:
┌──────────────────────────┐<br>│ ☰ Diffs Changes(2) │<br>├──────────────────────────┤<br>│ │<br>│ diff PDF (canvas) │<br>│ pinch · scroll │<br>│ │<br>│ [−][⤢][+] │<br>└──────────────────────────┘<br>☰ Diffs → picker + diffs/renders drawer<br>Changes(2) → drawer; tap a page to jump
How it works
PR ──────────┐ push ─────────┐ issue "latexdiff a..b" ──┐<br>▼ ▼ ▼<br>pr-diff.yml store-seed.yml issue-diff.yml<br>└──────── store-add / store-seed ──────────────┘<br>│ (append, idempotent, one concurrency group)<br>latexdiff-store branch = manifest.json + PDFs + viewer<br>│ (served by GitHub Pages, branch source)<br>browsable viewer · ?diff=a..b deep links
Everything appends to one store branch via the same idempotent store-add, so PR,<br>push, and on-demand diffs coexist in a single viewer. The changed-pages index is<br>float-aware : each change's page is recorded at shipout (via zref-abspage),<br>so a changed table or figure points to the page it actually lands on — not the<br>source line. (GitHub artifacts can't power a static viewer — they need auth and<br>expire — which is why the store lives in a branch.)
Configuration (difftool.toml)
All keys optional; a JSON difftool.json with the same keys also works.
key<br>default<br>meaning
main<br>auto-detected, else main.tex<br>Main LaTeX file.
build_command<br>latexmk -pdf -f -interaction=nonstopmode {main}<br>Your full build. {main}/{build_dir}/{jobname} are substituted.
build_dir<br>(unset)<br>latexmk out_dir — set only if your latexmkrc writes the PDF into a subdir.
output_pdf<br>{build_dir}/{jobname}.pdf<br>Where build_command leaves the PDF (auto-discovered if it differs).
latexdiff_options<br>[]<br>Extra flags for git latexdiff...