Incremental XeLaTeX and pdfLaTeX preview inside VS Code.
Live preview

Recorded in VS Code at actual playback speed. Both clips type the same line character by character on page 18 of a 24-page example without saving.
In the 24-page pdfLaTeX integration test, an unsaved edit on page 18 kept the same compiler process, reused the first 17 pages, and retypeset only 2 pages.
What Doppio adds to TeXpresso
Doppio builds on TeXpresso’s incremental XeLaTeX engine and its VS Code extension. Both engines share one side-by-side preview and the same two-way source navigation.
- Incremental pdfLaTeX. Doppio sends unsaved edits to a running FlashTeX process, which can resume from a saved compiler state and reuse unchanged pages.
- Selectable XeLaTeX preview text. Doppio recovers Unicode characters from font glyphs where a mapping is available, so you can select and copy rendered text, including Chinese.
- More reliable XeLaTeX jumps. Forward SyncTeX waits for the target line while pages compile, avoiding a brief jump to the table of contents. After an edit compiles, the preview follows the edited line without showing a position marker.
- Standalone XeLaTeX
subfiles previews. Open a chapter declared with \documentclass[../main]{subfiles} and preview it on its own. Doppio adds the main document’s directory to the search path for classes, styles, and figures.
Install on macOS
The first release was tested on Apple Silicon with TeX Live and desktop VS Code. Download the VSIX from GitHub Releases or build it from source below. Install it with Extensions: Install from VSIX…. If you already use the TeXpresso VS Code extension, disable it before enabling Doppio TeXPresso, since the extensions share command and setting identifiers.
Install the Xcode Command Line Tools, Homebrew, Rust, and a TeX Live distribution such as MacTeX. Then build the engines once:
brew install mupdf-tools sdl2 pkgconf fontconfig harfbuzz freetype icu4c@78
git clone https://github.com/PhotonYan/Doppio-TeXPresso.git
cd Doppio-TeXPresso
./scripts/build-engines-macos.sh
The script builds the pinned engine sources with the patches in this repository. Copy the settings it prints into Preferences: Open User Settings (JSON). Keep the checkout where you built it, since the settings point to its engine binaries.
Use
- Open a
.tex file. Open the command palette (⌘⇧P on macOS) and run Doppio TeXPresso: Start Document.
- Choose XeLaTeX or pdfLaTeX. If the open file is an included file and has no
% !TeX root = ... directive, select the main file when prompted.
- To jump from PDF to source, hold
⌘ or Ctrl and click rendered text. To jump from source to PDF, place the caret on a source line and run Doppio TeXPresso: SyncTeX Forward.
Doppio TeXPresso: Open Preview (Auto) reuses a running preview. When starting a new preview, Auto uses the workspace default or reads the main file’s % !TeX program directive. If neither specifies an engine, it asks you once and saves your choice in the workspace. Use Doppio TeXPresso: Select Default Compiler to change that preference and preview with the selected engine.
Use your usual LaTeX Workshop or latexmk build to produce the final PDF and regenerate bibliographies and indexes. FlashTeX previews use an isolated copy of the project and run with shell escape disabled.
Build the extension from source
Use Node.js 22+ and npm.
npm ci
npm test
npm exec --yes --package=@vscode/[email protected] -- npm run package:vsix
Install artifacts/texpresso.vsix using Extensions: Install from VSIX….
Credits and licenses
The VS Code extension builds on Dominik Peters’s TeXpresso extension, which integrates Frédéric Bour’s TeXpresso. This project adds dual-engine integration, the compiler picker, selectable preview text, and changes to editing and navigation. The VS Code extension retains the upstream MIT license.
The XeLaTeX backend uses the TeXpresso VS Code fork. The pdfLaTeX backend communicates with FlashTeX over its display-list protocol. The FlashTeX engine is GPL-2.0-or-later. MuPDF provides PDF rendering. The VSIX includes the extension code and UI assets, with the engines and renderer installed separately.
See native build notes for development and engine patches for the local changes.
评论