Generate latexdiff documents and compiled PDFs directly from VS Code.
This extension supports two comparison flows:
- Compare the active
.texfile against Git history. - Compare the active
.texfile against another.texfile on disk, which is useful for folder-based versioning such asv1/,v2/, or archived drafts.
Features
- Editor title button and status bar entry for LaTeX files.
- Quick pick flow for
HEAD, recent commits, custom Git refs, or another file. - Automatic PDF compilation with
latexmk,pdflatex, ortectonic. - Output isolation under a workspace-local
.latexdiffdirectory by default.
Requirements
The extension shells out to local tools. Install the tools you plan to use:
latexdiff- One compiler tool:
latexmk,pdflatex, ortectonic gitif you want Git-based comparisons
On macOS, the extension augments PATH with common TeX and package-manager locations such as /Library/TeX/texbin, /opt/homebrew/bin, and /usr/local/bin.
Usage
- Open a workspace that contains your
.texfile. - Trust the workspace.
- Open a LaTeX file.
- Click the
Latexdiffeditor button or status bar button. - Choose one of:
Compare with HEADCompare with Another Git Ref...Compare with Another File...
The extension writes generated artifacts to the configured output directory and opens the compiled PDF when compilation succeeds.
Configuration
latexdiff.executablePathPath tolatexdiff. This is a machine-scoped setting and cannot be set by the workspace.latexdiff.outputDirectoryRelative output directory inside the workspace. The extension rejects paths that escape the workspace folder.latexdiff.compilerToolCompiler used for PDF generation:latexmk,pdflatex, ortectonic.
Security Model
- The extension is disabled in untrusted workspaces because it executes external tools.
- The output directory must resolve inside the current workspace.
- The
latexdiffexecutable path is machine-scoped so the workspace cannot silently redirect it.
Status
This extension is currently marked as preview while the command surface and release packaging settle.