A local-first LaTeX build, diagnostics, and PDF preview extension for VS Code.
VS Code Marketplace · Website · How to use · Engineering guide
PureTeX keeps LaTeX work inside your editor and on your machine. It detects the right root document, chooses an appropriate compiler/runtime, builds locally, maps errors back to source files, and renders a polished live PDF preview in VS Code.
PureTeX ships target-specific VSIX packages for Windows x64, Linux x64, macOS Intel, and macOS Apple Silicon.
- Local LaTeX builds with automatic runtime selection.
- Docker, managed local toolchain, and system compiler support.
- Smart diagnostics for compiler, bibliography, glossary, runtime, and package-recovery issues.
- Live PDF preview with refresh, zoom, fit width, fit page, search, page jump, external open, and PDF download.
- SyncTeX-backed source-to-preview and preview-to-source navigation.
- Workspace indexing for labels, references, citations, glossary entries, acronyms, includes, and bibliography resources.
- Structured runtime and recovery logs in the
PureTeXoutput channel.
- VS Code
1.95.0or newer. - Supported packaged targets: Windows x64, Linux x64, macOS Intel, and macOS Apple Silicon.
- Node.js
22for extension development. - Rust stable for backend development.
- At least one LaTeX build path:
- Docker, recommended for predictable builds.
- Local
tectonic. - Local or managed
latexmk.
Docker and managed toolchains give PureTeX the best chance of recovering missing packages automatically. Plain system latexmk works, but package installation depends on the host TeX distribution and permissions.
PureTeX uses a public Docker Hub image for the optional full Docker runtime:
puretex/puretex-runtime:amd64puretex/puretex-runtime:arm64
Users only need Docker installed and running. The extension pulls the image automatically when the full Docker preset is selected.
Runtime image details:
- Open a folder containing a
.texproject. - Open a
.texfile. - Press the PureTeX play button in the editor title bar, or run
PureTeX: Open Live Previewfrom the Command Palette. - Build from the preview toolbar or save the document, depending on your build trigger setting.
PureTeX will resolve the project root, choose a runtime, build the document, and show the generated PDF in the preview panel.
Visit the hosted site at hn026.github.io/PureTeX for the demo and install links.
For a complete walkthrough of the preview controls and recommended settings, see How to use PureTeX.
PureTeX contributes these settings under the puretex namespace:
puretex.compiler: chooseauto,latexmk, ortectonic.puretex.buildRuntime: chooseauto,docker, orlocal.puretex.dockerImagePreset: choosebasic,full, orcustom.puretex.dockerImage: custom Docker image used with the custom preset.puretex.advancedToolchainSource: chooseauto,extension, orsystem.puretex.outputDirectory: build output directory, default.latex-build.puretex.buildTriggerMode: chooseautosave,save, ormanual.puretex.backendPath: optional backend binary override.puretex.texlabPath: optional TexLab binary override.
Install extension dependencies:
cd extension
npm installBuild the extension bundle:
cd extension
npm run buildRun the extension test suite:
cd extension
npm testRun the backend tests:
cd backend
cargo testRun type checking:
cd extension
npm run typecheckCompatibility fixture builds are opt-in because they run real LaTeX builds:
cd extension
npm run test:e2e:phase1Performance fixture builds are intended for release candidates and scale-sensitive changes:
cd extension
npm run test:e2e:performancePerformance budget checks:
cd extension
npm run test:performance-budgets
cd ../backend
PURETEX_PERFORMANCE_BUDGETS=1 cargo testBuild the extension, then package it with VSCE:
cd extension
npm run build
PURETEX_VSCODE_TARGET=linux-x64 npx @vscode/vsce package --target linux-x64The extension build stages a bundled Rust backend under extension/bin/<target>/. Publish separate target-specific VSIX packages for each supported platform, for example:
cd backend
cargo build --release
cd ../extension
PURETEX_VSCODE_TARGET=linux-x64 npx @vscode/vsce package --target linux-x64
PURETEX_VSCODE_TARGET=win32-x64 npx @vscode/vsce package --target win32-x64The package uses extension/package.json#files plus extension/.vscodeignore to keep development-only files out of the VSIX.
For release builds across multiple platforms, use the GitHub Actions workflow in .github/workflows/release-extension.yml. It builds native backend binaries and target-specific VSIX packages for:
linux-x64darwin-x64darwin-arm64win32-x64
Run the workflow manually from the Actions tab, or push a version tag such as v0.1.0 to generate release-ready artifacts.
Contributions are welcome. Keep changes focused, match the existing TypeScript and Rust style, and update tests or fixtures when behavior changes.
Before opening a pull request, run the checks that match your change:
cd extension
npm run typecheck
npm test
npm run build
cd ../backend
cargo testFor build-runtime, package-recovery, root-detection, or performance-sensitive changes, also run the relevant fixture tests from the sections above. Documentation, Marketplace metadata, and screenshots should be updated in the same change when user-facing behavior changes.
- How to use PureTeX: user-facing walkthrough of the preview, controls, defaults, and recommendations.
- Engineering guide: architecture, runtime selection, CI pipeline, design decisions, and release notes.
- Basic runtime image: package expectations for
texlive/texlive:latest. - Full runtime image: package list and build notes for
puretex/puretex-runtime.
extension/: VS Code extension source, preview UI, tests, and Marketplace metadata.backend/: Rust backend for root detection, log parsing, and SyncTeX operations.shared/protocol/: backend protocol schema.examples/: compatibility, navigation, root-detection, and performance fixtures.docker/: local Docker runtime image support.docs/: engineering notes and runtime image documentation.
PureTeX is licensed under the MIT License.
